diff --git a/BLOCKERS.md b/BLOCKERS.md new file mode 100644 index 00000000..8cf36426 --- /dev/null +++ b/BLOCKERS.md @@ -0,0 +1,33 @@ +# Blockers + +## App +- Client application + +### Github issue +- https://github.com/Oloodi/krow-workforce/issues/210 +### Why this task is blocked: +- This task is currently blocked, mainly because client registration via social logins is blocked. To create a business, we require a business name, and with social sign-up we don’t have a screen to capture that information. Because of this, the flow cannot be completed. +- The best option, in my opinion, is to allow Google and Apple sign-in only for existing users, and not use them for new user registration. + +### Github issue +- https://github.com/Oloodi/krow-workforce/issues/257 +### Why this task is blocked: +- Although this page existed in the prototype, it was not connected to any other pages. In other words, there was no way to navigate to it from anywhere in the application. Therefore, this issue can be closed, as the page is not required in the main application. + +## App +- Staff application + +### Github issue +- https://github.com/Oloodi/krow-workforce/issues/249 +### Why this task is blocked: +- Although this page existed in the prototype, it was not connected to any other pages. In other words, there was no way to navigate to it from anywhere in the application. Therefore, this issue can be closed, as the page is not required in the main application. + +# Deviations + +## App +- Client Application + +### Github issue +- https://github.com/Oloodi/krow-workforce/issues/240 +### Deveations: +- In the web prototype, when creating an order, position role rates are displayed based on the selected vendor. This behavior was missing in the mobile prototype. Therefore, we added a dropdown to select the vendor and display the corresponding role rates based on that selection. diff --git a/Makefile b/Makefile index b8591669..dd9040a0 100644 --- a/Makefile +++ b/Makefile @@ -28,18 +28,19 @@ help: @echo " make launchpad-dev - Starts the local launchpad server (Firebase Hosting emulator)." @echo "" @echo " --- MOBILE APP DEVELOPMENT ---" - @echo " make mobile-client-install - Install dependencies for client app" - @echo " make mobile-client-dev - Run client app in dev mode" - @echo " make mobile-client-build - Build client app (requires ENV & PLATFORM)" - @echo " make mobile-staff-install - Install dependencies for staff app" - @echo " make mobile-staff-dev - Run staff app in dev mode" - @echo " make mobile-staff-build - Build staff app (requires ENV & PLATFORM)" + @echo " make mobile-install - Bootstrap the mobile workspace (Melos)." + @echo " make mobile-info - List custom mobile development commands." + @echo " make mobile-client-dev-android - Run client app in dev mode (Android)." + @echo " make mobile-client-build PLATFORM=apk - Build client app for specified platform." + @echo " make mobile-staff-dev-android - Run staff app in dev mode (Android)." + @echo " make mobile-staff-build PLATFORM=apk - Build staff app for specified platform." @echo "" @echo " --- DEPLOYMENT ---" @echo " make deploy-launchpad-hosting - Deploys internal launchpad to Firebase Hosting." @echo " make deploy-app [ENV=staging] - Builds and deploys the main web app (default: dev)." @echo "" @echo " --- DEVELOPMENT TOOLS ---" + @echo " make install-melos - Installs Melos globally if not already present." @echo " make install-git-hooks - Installs git pre-push hook to protect main/dev branches." @echo " make sync-prototypes - Builds and copies prototypes from adjacent 'client-krow-poc' repo." @echo "" diff --git a/README.md b/README.md index 695004f7..04116b6a 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,9 @@ KROW is a comprehensive workforce management platform designed to streamline ope ### πŸ“¦ Apps (`/apps`) These are the production-ready applications for our users: - **`web-dashboard/`**: The primary React/Vite dashboard for Admin, Vendors, and Clients. -- **`mobile-client/`**: Flutter application for final clients to manage orders and billing. -- **`mobile-staff/`**: Flutter application for staff members (scheduling, clock-in/out, earnings). +- **`mobile/`**: Flutter applications for client and staff. + - `client`: The application for final clients to manage orders and billing. + - `staff`: The application for staff members (scheduling, clock-in/out, earnings). ### βš™οΈ Backend (`/backend`) The core data engine powering all applications: diff --git a/apps/mobile-client/.keep b/apps/mobile-client/.keep deleted file mode 100644 index 8b137891..00000000 --- a/apps/mobile-client/.keep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/apps/mobile-staff/.keep b/apps/mobile-staff/.keep deleted file mode 100644 index 8b137891..00000000 --- a/apps/mobile-staff/.keep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/apps/mobile/.gitignore b/apps/mobile/.gitignore new file mode 100644 index 00000000..4f9c2908 --- /dev/null +++ b/apps/mobile/.gitignore @@ -0,0 +1,22 @@ +# Old apps prototypes +prototypes/* + +# AI prompts +ai_prompts/* + +# Docs +docs/* + +# Template feature +packages/features/shared/template_feature/* + +# Generated files +*.g.dart +*.freezed.dart + +# Dart/Flutter +.dart_tool/ +.packages +.pub-cache/ +.pub/ +build/ diff --git a/apps/mobile/README.md b/apps/mobile/README.md new file mode 100644 index 00000000..a708b8eb --- /dev/null +++ b/apps/mobile/README.md @@ -0,0 +1,68 @@ +# KROW Workforce Mobile πŸ“± + +This folder holds the mobile app code for the KROW Workforce apps. +This project uses [Melos](https://melos.invertase.dev/) to manage multiple Flutter packages and applications. + +## πŸ“‚ Project Structure + +The project is organized into modular packages to ensure separation of concerns and maintainability. + +- **`apps/`**: Main application entry points. + - `client`: The application for businesses/clients. + - `staff`: The application for workforce/staff. + - `design_system_viewer`: A gallery of our design system components. +- **`packages/`**: Shared logic and feature modules. + - `features/`: UI and business logic for specific features (e.g., Auth, Home, Hubs). + - `features/client`: Client specific features. + - `features/staff`: Staff specific features. + - `design_system/`: Shared UI components, tokens (colors, spacing), and core widgets. + - `domain/`: Shared business entities and repository interfaces. + - `data_connect/`: Data access layer (Mocks and Firebase Data Connect SDK). + - `core_localization/`: Internationalization using Slang. + - `core/`: Base utilities and common logic. + +## πŸš€ Getting Started + +### 1. Prerequisites +Ensure you have the Flutter SDK installed and configured. + +### 2. Initial Setup +Run the following command from the **project root** to install Melos, bootstrap all packages, and generate localization files: + +```bash +# Using Makefile +make mobile-install +# Using Melos +melos bootstrap +``` + +### 3. Running the Apps +You can run the applications using Melos scripts or through the `Makefile`: + +#### Client App +```bash +# Using Melos +melos run start:client -d android # or ios +# Using Makefile +make mobile-client-dev-android +``` + +#### Staff App +```bash +# Using Melos +melos run start:staff -d android # or ios +# Using Makefile +make mobile-staff-dev-android +``` + +## πŸ›  Useful Commands + +- **Bootstrap**: `melos bootstrap` (Installs all dependencies) +- **Generate All**: `melos run gen:all` (Localization + Code Generation) +- **Analyze**: `melos run analyze:all` +- **Help**: `melos run info` (Shows all available custom scripts) + +## πŸ— Coding Principles +- **Clean Architecture**: We strictly follow Domain-Driven Design and Clean Architecture. +- **Modularity**: Every feature should be its own package in `packages/features/`. Client and staff specific features should be in their respective packages. +- **Consistency**: Use the `design_system` package for all UI elements to ensure a premium, unified look. diff --git a/apps/mobile/analysis_options.yaml b/apps/mobile/analysis_options.yaml new file mode 100644 index 00000000..cec4e925 --- /dev/null +++ b/apps/mobile/analysis_options.yaml @@ -0,0 +1,26 @@ +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - "**/dataconnect_generated/**" + - "**/*.g.dart" + - "**/*.freezed.dart" + - "**/*.config.dart" + errors: + # Set the severity of the always_specify_types rule to warning as requested. + always_specify_types: warning + +linter: + rules: + # Every variable should have an explicit type. + - always_specify_types + + # Additional common best practices not always enforced by default + - prefer_const_constructors + - prefer_const_declarations + - prefer_final_locals + - avoid_void_async + - unawaited_futures + - sort_constructors_first + - camel_case_types + - library_private_types_in_public_api diff --git a/apps/mobile/apps/client/.gitignore b/apps/mobile/apps/client/.gitignore new file mode 100644 index 00000000..3820a95c --- /dev/null +++ b/apps/mobile/apps/client/.gitignore @@ -0,0 +1,45 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ +/coverage/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/apps/mobile/apps/client/.metadata b/apps/mobile/apps/client/.metadata new file mode 100644 index 00000000..08c24780 --- /dev/null +++ b/apps/mobile/apps/client/.metadata @@ -0,0 +1,45 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "3b62efc2a3da49882f43c372e0bc53daef7295a6" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: android + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: ios + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: linux + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: macos + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: web + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: windows + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/apps/mobile/apps/client/analysis_options.yaml b/apps/mobile/apps/client/analysis_options.yaml new file mode 100644 index 00000000..fac60e24 --- /dev/null +++ b/apps/mobile/apps/client/analysis_options.yaml @@ -0,0 +1 @@ +include: ../../analysis_options.yaml \ No newline at end of file diff --git a/apps/mobile/apps/client/android/.gitignore b/apps/mobile/apps/client/android/.gitignore new file mode 100644 index 00000000..be3943c9 --- /dev/null +++ b/apps/mobile/apps/client/android/.gitignore @@ -0,0 +1,14 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java +.cxx/ + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/apps/mobile/apps/client/android/app/build.gradle.kts b/apps/mobile/apps/client/android/app/build.gradle.kts new file mode 100644 index 00000000..04b25374 --- /dev/null +++ b/apps/mobile/apps/client/android/app/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") + id("com.google.gms.google-services") +} + +android { + namespace = "com.example.krow_client" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.krowwithus.client" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/apps/mobile/apps/client/android/app/google-services.json b/apps/mobile/apps/client/android/app/google-services.json new file mode 100644 index 00000000..7533ddc2 --- /dev/null +++ b/apps/mobile/apps/client/android/app/google-services.json @@ -0,0 +1,190 @@ +{ + "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:87d41566f8dda41d7757db", + "android_client_info": { + "package_name": "com.example.krow_workforce" + } + }, + "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: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:d26bde4ee337b0b17757db", + "android_client_info": { + "package_name": "com.krowwithus.krow_workforce.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" + } + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/apps/mobile/apps/client/android/app/src/debug/AndroidManifest.xml b/apps/mobile/apps/client/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..399f6981 --- /dev/null +++ b/apps/mobile/apps/client/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/apps/mobile/apps/client/android/app/src/main/AndroidManifest.xml b/apps/mobile/apps/client/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..2b7a964a --- /dev/null +++ b/apps/mobile/apps/client/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/client/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/apps/mobile/apps/client/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..de98cbea --- /dev/null +++ b/apps/mobile/apps/client/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,49 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.appcheck.FlutterFirebaseAppCheckPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin firebase_app_check, io.flutter.plugins.firebase.appcheck.FlutterFirebaseAppCheckPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.auth.FlutterFirebaseAuthPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin firebase_auth, io.flutter.plugins.firebase.auth.FlutterFirebaseAuthPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin firebase_core, io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin path_provider_android, io.flutter.plugins.pathprovider.PathProviderPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin shared_preferences_android, io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin url_launcher_android, io.flutter.plugins.urllauncher.UrlLauncherPlugin", e); + } + } +} diff --git a/apps/mobile/apps/client/android/app/src/main/kotlin/com/example/krow_client/MainActivity.kt b/apps/mobile/apps/client/android/app/src/main/kotlin/com/example/krow_client/MainActivity.kt new file mode 100644 index 00000000..419b3bd4 --- /dev/null +++ b/apps/mobile/apps/client/android/app/src/main/kotlin/com/example/krow_client/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.krow_client + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/apps/mobile/apps/client/android/app/src/main/res/drawable-v21/launch_background.xml b/apps/mobile/apps/client/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 00000000..f74085f3 --- /dev/null +++ b/apps/mobile/apps/client/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/apps/mobile/apps/client/android/app/src/main/res/drawable/launch_background.xml b/apps/mobile/apps/client/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 00000000..304732f8 --- /dev/null +++ b/apps/mobile/apps/client/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/apps/mobile/apps/client/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/apps/mobile/apps/client/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..db77bb4b Binary files /dev/null and b/apps/mobile/apps/client/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/client/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/apps/mobile/apps/client/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..17987b79 Binary files /dev/null and b/apps/mobile/apps/client/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/client/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/apps/mobile/apps/client/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..09d43914 Binary files /dev/null and b/apps/mobile/apps/client/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/client/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/apps/mobile/apps/client/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..d5f1c8d3 Binary files /dev/null and b/apps/mobile/apps/client/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/client/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/apps/mobile/apps/client/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..4d6372ee Binary files /dev/null and b/apps/mobile/apps/client/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/client/android/app/src/main/res/values-night/styles.xml b/apps/mobile/apps/client/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 00000000..06952be7 --- /dev/null +++ b/apps/mobile/apps/client/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/apps/mobile/apps/client/android/app/src/main/res/values/styles.xml b/apps/mobile/apps/client/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..cb1ef880 --- /dev/null +++ b/apps/mobile/apps/client/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/apps/mobile/apps/client/android/app/src/profile/AndroidManifest.xml b/apps/mobile/apps/client/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 00000000..399f6981 --- /dev/null +++ b/apps/mobile/apps/client/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/apps/mobile/apps/client/android/build.gradle.kts b/apps/mobile/apps/client/android/build.gradle.kts new file mode 100644 index 00000000..dbee657b --- /dev/null +++ b/apps/mobile/apps/client/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/apps/mobile/apps/client/android/gradle.properties b/apps/mobile/apps/client/android/gradle.properties new file mode 100644 index 00000000..fbee1d8c --- /dev/null +++ b/apps/mobile/apps/client/android/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true diff --git a/apps/mobile/apps/client/android/gradle/wrapper/gradle-wrapper.jar b/apps/mobile/apps/client/android/gradle/wrapper/gradle-wrapper.jar new file mode 100755 index 00000000..13372aef Binary files /dev/null and b/apps/mobile/apps/client/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/apps/mobile/apps/client/android/gradle/wrapper/gradle-wrapper.properties b/apps/mobile/apps/client/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..e4ef43fb --- /dev/null +++ b/apps/mobile/apps/client/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip diff --git a/apps/mobile/apps/client/android/gradlew b/apps/mobile/apps/client/android/gradlew new file mode 100755 index 00000000..9d82f789 --- /dev/null +++ b/apps/mobile/apps/client/android/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/apps/mobile/apps/client/android/gradlew.bat b/apps/mobile/apps/client/android/gradlew.bat new file mode 100755 index 00000000..aec99730 --- /dev/null +++ b/apps/mobile/apps/client/android/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/apps/mobile/apps/client/android/settings.gradle.kts b/apps/mobile/apps/client/android/settings.gradle.kts new file mode 100644 index 00000000..e4e86fb6 --- /dev/null +++ b/apps/mobile/apps/client/android/settings.gradle.kts @@ -0,0 +1,27 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.11.1" apply false + id("org.jetbrains.kotlin.android") version "2.2.20" apply false + id("com.google.gms.google-services") version "4.4.2" apply false +} + +include(":app") diff --git a/apps/mobile/apps/client/ios/.gitignore b/apps/mobile/apps/client/ios/.gitignore new file mode 100644 index 00000000..7a7f9873 --- /dev/null +++ b/apps/mobile/apps/client/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/apps/mobile/apps/client/ios/Flutter/AppFrameworkInfo.plist b/apps/mobile/apps/client/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 00000000..1dc6cf76 --- /dev/null +++ b/apps/mobile/apps/client/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 13.0 + + diff --git a/apps/mobile/apps/client/ios/Flutter/Debug.xcconfig b/apps/mobile/apps/client/ios/Flutter/Debug.xcconfig new file mode 100644 index 00000000..ec97fc6f --- /dev/null +++ b/apps/mobile/apps/client/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/apps/mobile/apps/client/ios/Flutter/Release.xcconfig b/apps/mobile/apps/client/ios/Flutter/Release.xcconfig new file mode 100644 index 00000000..c4855bfe --- /dev/null +++ b/apps/mobile/apps/client/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/apps/mobile/apps/client/ios/Flutter/ephemeral/flutter_lldb_helper.py b/apps/mobile/apps/client/ios/Flutter/ephemeral/flutter_lldb_helper.py new file mode 100644 index 00000000..a88caf99 --- /dev/null +++ b/apps/mobile/apps/client/ios/Flutter/ephemeral/flutter_lldb_helper.py @@ -0,0 +1,32 @@ +# +# Generated file, do not edit. +# + +import lldb + +def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict): + """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages.""" + base = frame.register["x0"].GetValueAsAddress() + page_len = frame.register["x1"].GetValueAsUnsigned() + + # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the + # first page to see if handled it correctly. This makes diagnosing + # misconfiguration (e.g. missing breakpoint) easier. + data = bytearray(page_len) + data[0:8] = b'IHELPED!' + + error = lldb.SBError() + frame.GetThread().GetProcess().WriteMemory(base, data, error) + if not error.Success(): + print(f'Failed to write into {base}[+{page_len}]', error) + return + +def __lldb_init_module(debugger: lldb.SBDebugger, _): + target = debugger.GetDummyTarget() + # Caveat: must use BreakpointCreateByRegEx here and not + # BreakpointCreateByName. For some reasons callback function does not + # get carried over from dummy target for the later. + bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$") + bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__)) + bp.SetAutoContinue(True) + print("-- LLDB integration loaded --") diff --git a/apps/mobile/apps/client/ios/Flutter/ephemeral/flutter_lldbinit b/apps/mobile/apps/client/ios/Flutter/ephemeral/flutter_lldbinit new file mode 100644 index 00000000..e3ba6fbe --- /dev/null +++ b/apps/mobile/apps/client/ios/Flutter/ephemeral/flutter_lldbinit @@ -0,0 +1,5 @@ +# +# Generated file, do not edit. +# + +command script import --relative-to-command-file flutter_lldb_helper.py diff --git a/apps/mobile/apps/client/ios/Podfile b/apps/mobile/apps/client/ios/Podfile new file mode 100644 index 00000000..620e46eb --- /dev/null +++ b/apps/mobile/apps/client/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '13.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/apps/mobile/apps/client/ios/Runner.xcodeproj/project.pbxproj b/apps/mobile/apps/client/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..6da39393 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,616 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.krowwithus.client; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.krowwithus.client; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.krowwithus.client; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.krowwithus.client; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.krowwithus.client; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.krowwithus.client; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/apps/mobile/apps/client/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/apps/mobile/apps/client/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/apps/mobile/apps/client/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile/apps/client/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/apps/mobile/apps/client/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/apps/mobile/apps/client/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/apps/mobile/apps/client/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/apps/mobile/apps/client/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..e3773d42 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/client/ios/Runner.xcworkspace/contents.xcworkspacedata b/apps/mobile/apps/client/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/apps/mobile/apps/client/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile/apps/client/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/apps/mobile/apps/client/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/apps/mobile/apps/client/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/apps/mobile/apps/client/ios/Runner/AppDelegate.swift b/apps/mobile/apps/client/ios/Runner/AppDelegate.swift new file mode 100644 index 00000000..62666446 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Flutter +import UIKit + +@main +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d36b1fab --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 00000000..dc9ada47 Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 00000000..7353c41e Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 00000000..797d452e Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 00000000..6ed2d933 Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 00000000..4cd7b009 Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 00000000..fe730945 Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 00000000..321773cd Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 00000000..797d452e Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 00000000..502f463a Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 00000000..0ec30343 Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 00000000..0ec30343 Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 00000000..e9f5fea2 Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 00000000..84ac32ae Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 00000000..8953cba0 Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 00000000..0467bf12 Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..0bedcf2f --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/apps/mobile/apps/client/ios/Runner/Base.lproj/LaunchScreen.storyboard b/apps/mobile/apps/client/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f2e259c7 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/client/ios/Runner/Base.lproj/Main.storyboard b/apps/mobile/apps/client/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 00000000..f3c28516 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/client/ios/Runner/GeneratedPluginRegistrant.h b/apps/mobile/apps/client/ios/Runner/GeneratedPluginRegistrant.h new file mode 100644 index 00000000..7a890927 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner/GeneratedPluginRegistrant.h @@ -0,0 +1,19 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GeneratedPluginRegistrant_h +#define GeneratedPluginRegistrant_h + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface GeneratedPluginRegistrant : NSObject ++ (void)registerWithRegistry:(NSObject*)registry; +@end + +NS_ASSUME_NONNULL_END +#endif /* GeneratedPluginRegistrant_h */ diff --git a/apps/mobile/apps/client/ios/Runner/GeneratedPluginRegistrant.m b/apps/mobile/apps/client/ios/Runner/GeneratedPluginRegistrant.m new file mode 100644 index 00000000..69b16696 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner/GeneratedPluginRegistrant.m @@ -0,0 +1,49 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#import "GeneratedPluginRegistrant.h" + +#if __has_include() +#import +#else +@import firebase_app_check; +#endif + +#if __has_include() +#import +#else +@import firebase_auth; +#endif + +#if __has_include() +#import +#else +@import firebase_core; +#endif + +#if __has_include() +#import +#else +@import shared_preferences_foundation; +#endif + +#if __has_include() +#import +#else +@import url_launcher_ios; +#endif + +@implementation GeneratedPluginRegistrant + ++ (void)registerWithRegistry:(NSObject*)registry { + [FLTFirebaseAppCheckPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseAppCheckPlugin"]]; + [FLTFirebaseAuthPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseAuthPlugin"]]; + [FLTFirebaseCorePlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseCorePlugin"]]; + [SharedPreferencesPlugin registerWithRegistrar:[registry registrarForPlugin:@"SharedPreferencesPlugin"]]; + [URLLauncherPlugin registerWithRegistrar:[registry registrarForPlugin:@"URLLauncherPlugin"]]; +} + +@end diff --git a/apps/mobile/apps/client/ios/Runner/Info.plist b/apps/mobile/apps/client/ios/Runner/Info.plist new file mode 100644 index 00000000..e7dfbac0 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + krowwithus_client + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + krowwithus_client + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/apps/mobile/apps/client/ios/Runner/Runner-Bridging-Header.h b/apps/mobile/apps/client/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 00000000..308a2a56 --- /dev/null +++ b/apps/mobile/apps/client/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/apps/mobile/apps/client/ios/RunnerTests/RunnerTests.swift b/apps/mobile/apps/client/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 00000000..86a7c3b1 --- /dev/null +++ b/apps/mobile/apps/client/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/apps/mobile/apps/client/lib/main.dart b/apps/mobile/apps/client/lib/main.dart new file mode 100644 index 00000000..ba82fce4 --- /dev/null +++ b/apps/mobile/apps/client/lib/main.dart @@ -0,0 +1,88 @@ +import 'package:core_localization/core_localization.dart' as core_localization; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:client_authentication/client_authentication.dart' + as client_authentication; +import 'package:client_main/client_main.dart' as client_main; +import 'package:client_settings/client_settings.dart' as client_settings; +import 'package:client_hubs/client_hubs.dart' as client_hubs; +import 'package:client_create_order/client_create_order.dart' + as client_create_order; +import 'package:firebase_core/firebase_core.dart'; + +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + await Firebase.initializeApp(); + runApp(ModularApp(module: AppModule(), child: const AppWidget())); +} + +/// The main application module for the Client app. +class AppModule extends Module { + @override + List get imports => [core_localization.LocalizationModule()]; + + @override + void routes(RouteManager r) { + // Initial route points to the client authentication flow + r.module('/', module: client_authentication.ClientAuthenticationModule()); + + // Client main shell with bottom navigation (includes home as a child) + r.module('/client-main', module: client_main.ClientMainModule()); + + // Client settings route + r.module( + '/client-settings', + module: client_settings.ClientSettingsModule(), + ); + + // Client hubs route + r.module('/client-hubs', module: client_hubs.ClientHubsModule()); + + // Client create order route + r.module( + '/client/create-order', + module: client_create_order.ClientCreateOrderModule(), + ); + } +} + +class AppWidget extends StatelessWidget { + const AppWidget({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (BuildContext context) => + Modular.get() + ..add(const core_localization.LoadLocale()), + child: + BlocBuilder< + core_localization.LocaleBloc, + core_localization.LocaleState + >( + builder: + (BuildContext context, core_localization.LocaleState state) { + return core_localization.TranslationProvider( + child: MaterialApp.router( + debugShowCheckedModeBanner: false, + title: "Krow Client", + theme: UiTheme.light, + routerConfig: Modular.routerConfig, + locale: state.locale, + supportedLocales: state.supportedLocales, + localizationsDelegates: + const >[ + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], + ), + ); + }, + ), + ); + } +} diff --git a/apps/mobile/apps/client/linux/.gitignore b/apps/mobile/apps/client/linux/.gitignore new file mode 100644 index 00000000..d3896c98 --- /dev/null +++ b/apps/mobile/apps/client/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/apps/mobile/apps/client/linux/CMakeLists.txt b/apps/mobile/apps/client/linux/CMakeLists.txt new file mode 100644 index 00000000..6f1df0fe --- /dev/null +++ b/apps/mobile/apps/client/linux/CMakeLists.txt @@ -0,0 +1,128 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "krow_client") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID +set(APPLICATION_ID "com.example.krow_client") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Load bundled libraries from the lib/ directory relative to the binary. +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Root filesystem for cross-building. +if(FLUTTER_TARGET_PLATFORM_SYSROOT) + set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() + +# Define build configuration options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Only the install-generated bundle's copy of the executable will launch +# correctly, since the resources must in the right relative locations. To avoid +# people trying to run the unbundled copy, put it in a subdirectory instead of +# the default top-level location. +set_target_properties(${BINARY_NAME} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" +) + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endforeach(bundled_library) + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/apps/mobile/apps/client/linux/flutter/CMakeLists.txt b/apps/mobile/apps/client/linux/flutter/CMakeLists.txt new file mode 100644 index 00000000..d5bd0164 --- /dev/null +++ b/apps/mobile/apps/client/linux/flutter/CMakeLists.txt @@ -0,0 +1,88 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/apps/mobile/apps/client/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux b/apps/mobile/apps/client/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux new file mode 120000 index 00000000..d7e81bb9 --- /dev/null +++ b/apps/mobile/apps/client/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux @@ -0,0 +1 @@ +/Users/achinthaisuru/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/ \ No newline at end of file diff --git a/apps/mobile/apps/client/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux b/apps/mobile/apps/client/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux new file mode 120000 index 00000000..6202480c --- /dev/null +++ b/apps/mobile/apps/client/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux @@ -0,0 +1 @@ +/Users/achinthaisuru/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/ \ No newline at end of file diff --git a/apps/mobile/apps/client/linux/flutter/ephemeral/.plugin_symlinks/url_launcher_linux b/apps/mobile/apps/client/linux/flutter/ephemeral/.plugin_symlinks/url_launcher_linux new file mode 120000 index 00000000..ad8c4158 --- /dev/null +++ b/apps/mobile/apps/client/linux/flutter/ephemeral/.plugin_symlinks/url_launcher_linux @@ -0,0 +1 @@ +/Users/achinthaisuru/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.2/ \ No newline at end of file diff --git a/apps/mobile/apps/client/linux/flutter/generated_plugin_registrant.cc b/apps/mobile/apps/client/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..f6f23bfe --- /dev/null +++ b/apps/mobile/apps/client/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include + +void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); +} diff --git a/apps/mobile/apps/client/linux/flutter/generated_plugin_registrant.h b/apps/mobile/apps/client/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..e0f0a47b --- /dev/null +++ b/apps/mobile/apps/client/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/apps/mobile/apps/client/linux/flutter/generated_plugins.cmake b/apps/mobile/apps/client/linux/flutter/generated_plugins.cmake new file mode 100644 index 00000000..f16b4c34 --- /dev/null +++ b/apps/mobile/apps/client/linux/flutter/generated_plugins.cmake @@ -0,0 +1,24 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + url_launcher_linux +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/apps/mobile/apps/client/linux/runner/CMakeLists.txt b/apps/mobile/apps/client/linux/runner/CMakeLists.txt new file mode 100644 index 00000000..e97dabc7 --- /dev/null +++ b/apps/mobile/apps/client/linux/runner/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the application ID. +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/apps/mobile/apps/client/linux/runner/main.cc b/apps/mobile/apps/client/linux/runner/main.cc new file mode 100644 index 00000000..e7c5c543 --- /dev/null +++ b/apps/mobile/apps/client/linux/runner/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/apps/mobile/apps/client/linux/runner/my_application.cc b/apps/mobile/apps/client/linux/runner/my_application.cc new file mode 100644 index 00000000..d5fe45fd --- /dev/null +++ b/apps/mobile/apps/client/linux/runner/my_application.cc @@ -0,0 +1,148 @@ +#include "my_application.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; + char** dart_entrypoint_arguments; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Called when first Flutter frame received. +static void first_frame_cb(MyApplication* self, FlView* view) { + gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); +} + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + + // Use a header bar when running in GNOME as this is the common style used + // by applications and is the setup most users will be using (e.g. Ubuntu + // desktop). + // If running on X and not using GNOME then just use a traditional title bar + // in case the window manager does more exotic layout, e.g. tiling. + // If running on Wayland assume the header bar will work (may need changing + // if future cases occur). + gboolean use_header_bar = TRUE; +#ifdef GDK_WINDOWING_X11 + GdkScreen* screen = gtk_window_get_screen(window); + if (GDK_IS_X11_SCREEN(screen)) { + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); + if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + use_header_bar = FALSE; + } + } +#endif + if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "krow_client"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } else { + gtk_window_set_title(window, "krow_client"); + } + + gtk_window_set_default_size(window, 1280, 720); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + fl_dart_project_set_dart_entrypoint_arguments( + project, self->dart_entrypoint_arguments); + + FlView* view = fl_view_new(project); + GdkRGBA background_color; + // Background defaults to black, override it here if necessary, e.g. #00000000 + // for transparent. + gdk_rgba_parse(&background_color, "#000000"); + fl_view_set_background_color(view, &background_color); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + // Show the window when Flutter renders. + // Requires the view to be realized so we can start rendering. + g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), + self); + gtk_widget_realize(GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +// Implements GApplication::local_command_line. +static gboolean my_application_local_command_line(GApplication* application, + gchar*** arguments, + int* exit_status) { + MyApplication* self = MY_APPLICATION(application); + // Strip out the first argument as it is the binary name. + self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); + + g_autoptr(GError) error = nullptr; + if (!g_application_register(application, nullptr, &error)) { + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; + } + + g_application_activate(application); + *exit_status = 0; + + return TRUE; +} + +// Implements GApplication::startup. +static void my_application_startup(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application startup. + + G_APPLICATION_CLASS(my_application_parent_class)->startup(application); +} + +// Implements GApplication::shutdown. +static void my_application_shutdown(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application shutdown. + + G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); +} + +// Implements GObject::dispose. +static void my_application_dispose(GObject* object) { + MyApplication* self = MY_APPLICATION(object); + g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); + G_OBJECT_CLASS(my_application_parent_class)->dispose(object); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; + G_APPLICATION_CLASS(klass)->local_command_line = + my_application_local_command_line; + G_APPLICATION_CLASS(klass)->startup = my_application_startup; + G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; + G_OBJECT_CLASS(klass)->dispose = my_application_dispose; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + // Set the program name to the application ID, which helps various systems + // like GTK and desktop environments map this running application to its + // corresponding .desktop file. This ensures better integration by allowing + // the application to be recognized beyond its binary name. + g_set_prgname(APPLICATION_ID); + + return MY_APPLICATION(g_object_new(my_application_get_type(), + "application-id", APPLICATION_ID, "flags", + G_APPLICATION_NON_UNIQUE, nullptr)); +} diff --git a/apps/mobile/apps/client/linux/runner/my_application.h b/apps/mobile/apps/client/linux/runner/my_application.h new file mode 100644 index 00000000..db16367a --- /dev/null +++ b/apps/mobile/apps/client/linux/runner/my_application.h @@ -0,0 +1,21 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, + my_application, + MY, + APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/apps/mobile/apps/client/macos/.gitignore b/apps/mobile/apps/client/macos/.gitignore new file mode 100644 index 00000000..746adbb6 --- /dev/null +++ b/apps/mobile/apps/client/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/apps/mobile/apps/client/macos/Flutter/Flutter-Debug.xcconfig b/apps/mobile/apps/client/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 00000000..4b81f9b2 --- /dev/null +++ b/apps/mobile/apps/client/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/apps/mobile/apps/client/macos/Flutter/Flutter-Release.xcconfig b/apps/mobile/apps/client/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 00000000..5caa9d15 --- /dev/null +++ b/apps/mobile/apps/client/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/apps/mobile/apps/client/macos/Flutter/GeneratedPluginRegistrant.swift b/apps/mobile/apps/client/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 00000000..c4ba9dcf --- /dev/null +++ b/apps/mobile/apps/client/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,20 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import firebase_app_check +import firebase_auth +import firebase_core +import shared_preferences_foundation +import url_launcher_macos + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FLTFirebaseAppCheckPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAppCheckPlugin")) + FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) + FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) + UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) +} diff --git a/apps/mobile/apps/client/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/apps/mobile/apps/client/macos/Flutter/ephemeral/Flutter-Generated.xcconfig new file mode 100644 index 00000000..a6a728c3 --- /dev/null +++ b/apps/mobile/apps/client/macos/Flutter/ephemeral/Flutter-Generated.xcconfig @@ -0,0 +1,11 @@ +// This is a generated file; do not edit or check into version control. +FLUTTER_ROOT=/Users/achinthaisuru/Documents/flutter +FLUTTER_APPLICATION_PATH=/Users/achinthaisuru/Documents/Github/krow-workforce/apps/mobile/apps/client +COCOAPODS_PARALLEL_CODE_SIGN=true +FLUTTER_BUILD_DIR=build +FLUTTER_BUILD_NAME=1.0.0 +FLUTTER_BUILD_NUMBER=1 +DART_OBFUSCATION=false +TRACK_WIDGET_CREATION=true +TREE_SHAKE_ICONS=false +PACKAGE_CONFIG=.dart_tool/package_config.json diff --git a/apps/mobile/apps/client/macos/Flutter/ephemeral/flutter_export_environment.sh b/apps/mobile/apps/client/macos/Flutter/ephemeral/flutter_export_environment.sh new file mode 100755 index 00000000..c97ab106 --- /dev/null +++ b/apps/mobile/apps/client/macos/Flutter/ephemeral/flutter_export_environment.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# This is a generated file; do not edit or check into version control. +export "FLUTTER_ROOT=/Users/achinthaisuru/Documents/flutter" +export "FLUTTER_APPLICATION_PATH=/Users/achinthaisuru/Documents/Github/krow-workforce/apps/mobile/apps/client" +export "COCOAPODS_PARALLEL_CODE_SIGN=true" +export "FLUTTER_BUILD_DIR=build" +export "FLUTTER_BUILD_NAME=1.0.0" +export "FLUTTER_BUILD_NUMBER=1" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=true" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/apps/mobile/apps/client/macos/Podfile b/apps/mobile/apps/client/macos/Podfile new file mode 100644 index 00000000..ff5ddb3b --- /dev/null +++ b/apps/mobile/apps/client/macos/Podfile @@ -0,0 +1,42 @@ +platform :osx, '10.15' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/apps/mobile/apps/client/macos/Runner.xcodeproj/project.pbxproj b/apps/mobile/apps/client/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..613f0631 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,705 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* krow_client.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "krow_client.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* krow_client.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* krow_client.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowClient.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/krow_client.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/krow_client"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowClient.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/krow_client.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/krow_client"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowClient.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/krow_client.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/krow_client"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/apps/mobile/apps/client/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile/apps/client/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/apps/mobile/apps/client/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/apps/mobile/apps/client/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..0e92a56b --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/client/macos/Runner.xcworkspace/contents.xcworkspacedata b/apps/mobile/apps/client/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/apps/mobile/apps/client/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile/apps/client/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/apps/mobile/apps/client/macos/Runner/AppDelegate.swift b/apps/mobile/apps/client/macos/Runner/AppDelegate.swift new file mode 100644 index 00000000..b3c17614 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Cocoa +import FlutterMacOS + +@main +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } +} diff --git a/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..a2ec33f1 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 00000000..82b6f9d9 Binary files /dev/null and b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 00000000..13b35eba Binary files /dev/null and b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 00000000..0a3f5fa4 Binary files /dev/null and b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 00000000..bdb57226 Binary files /dev/null and b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 00000000..f083318e Binary files /dev/null and b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 00000000..326c0e72 Binary files /dev/null and b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 00000000..2f1632cf Binary files /dev/null and b/apps/mobile/apps/client/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/apps/mobile/apps/client/macos/Runner/Base.lproj/MainMenu.xib b/apps/mobile/apps/client/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 00000000..80e867a4 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/client/macos/Runner/Configs/AppInfo.xcconfig b/apps/mobile/apps/client/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 00000000..3dceff21 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = krow_client + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.example.krowClient + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright Β© 2026 com.example. All rights reserved. diff --git a/apps/mobile/apps/client/macos/Runner/Configs/Debug.xcconfig b/apps/mobile/apps/client/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 00000000..36b0fd94 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/apps/mobile/apps/client/macos/Runner/Configs/Release.xcconfig b/apps/mobile/apps/client/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 00000000..dff4f495 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/apps/mobile/apps/client/macos/Runner/Configs/Warnings.xcconfig b/apps/mobile/apps/client/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 00000000..42bcbf47 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/apps/mobile/apps/client/macos/Runner/DebugProfile.entitlements b/apps/mobile/apps/client/macos/Runner/DebugProfile.entitlements new file mode 100644 index 00000000..dddb8a30 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/apps/mobile/apps/client/macos/Runner/Info.plist b/apps/mobile/apps/client/macos/Runner/Info.plist new file mode 100644 index 00000000..4789daa6 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/apps/mobile/apps/client/macos/Runner/MainFlutterWindow.swift b/apps/mobile/apps/client/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 00000000..3cc05eb2 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/apps/mobile/apps/client/macos/Runner/Release.entitlements b/apps/mobile/apps/client/macos/Runner/Release.entitlements new file mode 100644 index 00000000..852fa1a4 --- /dev/null +++ b/apps/mobile/apps/client/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/apps/mobile/apps/client/macos/RunnerTests/RunnerTests.swift b/apps/mobile/apps/client/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 00000000..61f3bd1f --- /dev/null +++ b/apps/mobile/apps/client/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Cocoa +import FlutterMacOS +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/apps/mobile/apps/client/pubspec.yaml b/apps/mobile/apps/client/pubspec.yaml new file mode 100644 index 00000000..f40ce950 --- /dev/null +++ b/apps/mobile/apps/client/pubspec.yaml @@ -0,0 +1,50 @@ +name: krowwithus_client +description: "Krow Client Application" +publish_to: 'none' +version: 1.0.0+1 +resolution: workspace + +environment: + sdk: ^3.10.7 + +dependencies: + flutter: + sdk: flutter + + # Architecture Packages + design_system: + path: ../../packages/design_system + core_localization: + path: ../../packages/core_localization + + # Feature Packages + client_authentication: + path: ../../packages/features/client/authentication + client_main: + path: ../../packages/features/client/client_main + client_home: + path: ../../packages/features/client/home + client_coverage: + path: ../../packages/features/client/client_coverage + client_settings: + path: ../../packages/features/client/settings + client_hubs: + path: ../../packages/features/client/hubs + client_create_order: + path: ../../packages/features/client/create_order + + cupertino_icons: ^1.0.8 + flutter_modular: ^6.3.2 + flutter_bloc: ^8.1.3 + flutter_localizations: + sdk: flutter + firebase_core: ^4.4.0 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + rename: ^3.1.0 + +flutter: + uses-material-design: true diff --git a/apps/mobile/apps/client/test/widget_test.dart b/apps/mobile/apps/client/test/widget_test.dart new file mode 100644 index 00000000..1888d2ab --- /dev/null +++ b/apps/mobile/apps/client/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:client/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/apps/mobile/apps/client/web/favicon.png b/apps/mobile/apps/client/web/favicon.png new file mode 100644 index 00000000..8aaa46ac Binary files /dev/null and b/apps/mobile/apps/client/web/favicon.png differ diff --git a/apps/mobile/apps/client/web/icons/Icon-192.png b/apps/mobile/apps/client/web/icons/Icon-192.png new file mode 100644 index 00000000..b749bfef Binary files /dev/null and b/apps/mobile/apps/client/web/icons/Icon-192.png differ diff --git a/apps/mobile/apps/client/web/icons/Icon-512.png b/apps/mobile/apps/client/web/icons/Icon-512.png new file mode 100644 index 00000000..88cfd48d Binary files /dev/null and b/apps/mobile/apps/client/web/icons/Icon-512.png differ diff --git a/apps/mobile/apps/client/web/icons/Icon-maskable-192.png b/apps/mobile/apps/client/web/icons/Icon-maskable-192.png new file mode 100644 index 00000000..eb9b4d76 Binary files /dev/null and b/apps/mobile/apps/client/web/icons/Icon-maskable-192.png differ diff --git a/apps/mobile/apps/client/web/icons/Icon-maskable-512.png b/apps/mobile/apps/client/web/icons/Icon-maskable-512.png new file mode 100644 index 00000000..d69c5669 Binary files /dev/null and b/apps/mobile/apps/client/web/icons/Icon-maskable-512.png differ diff --git a/apps/mobile/apps/client/web/index.html b/apps/mobile/apps/client/web/index.html new file mode 100644 index 00000000..0b6cda5a --- /dev/null +++ b/apps/mobile/apps/client/web/index.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + krow_client + + + + + + diff --git a/apps/mobile/apps/client/web/manifest.json b/apps/mobile/apps/client/web/manifest.json new file mode 100644 index 00000000..3f8812a2 --- /dev/null +++ b/apps/mobile/apps/client/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "krow_client", + "short_name": "krow_client", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/apps/mobile/apps/client/windows/.gitignore b/apps/mobile/apps/client/windows/.gitignore new file mode 100644 index 00000000..d492d0d9 --- /dev/null +++ b/apps/mobile/apps/client/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ephemeral/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/apps/mobile/apps/client/windows/CMakeLists.txt b/apps/mobile/apps/client/windows/CMakeLists.txt new file mode 100644 index 00000000..77e16d56 --- /dev/null +++ b/apps/mobile/apps/client/windows/CMakeLists.txt @@ -0,0 +1,108 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(krow_client LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "krow_client") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(VERSION 3.14...3.25) + +# Define build configuration option. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() +# Define settings for the Profile build mode. +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/apps/mobile/apps/client/windows/flutter/CMakeLists.txt b/apps/mobile/apps/client/windows/flutter/CMakeLists.txt new file mode 100644 index 00000000..903f4899 --- /dev/null +++ b/apps/mobile/apps/client/windows/flutter/CMakeLists.txt @@ -0,0 +1,109 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + ${FLUTTER_TARGET_PLATFORM} $ + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/firebase_auth b/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/firebase_auth new file mode 120000 index 00000000..a05ca7fe --- /dev/null +++ b/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/firebase_auth @@ -0,0 +1 @@ +/Users/achinthaisuru/.pub-cache/hosted/pub.dev/firebase_auth-6.1.4/ \ No newline at end of file diff --git a/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/firebase_core b/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/firebase_core new file mode 120000 index 00000000..1d268465 --- /dev/null +++ b/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/firebase_core @@ -0,0 +1 @@ +/Users/achinthaisuru/.pub-cache/hosted/pub.dev/firebase_core-4.4.0/ \ No newline at end of file diff --git a/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/path_provider_windows b/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/path_provider_windows new file mode 120000 index 00000000..2316cfff --- /dev/null +++ b/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/path_provider_windows @@ -0,0 +1 @@ +/Users/achinthaisuru/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/ \ No newline at end of file diff --git a/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/shared_preferences_windows b/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/shared_preferences_windows new file mode 120000 index 00000000..d567e409 --- /dev/null +++ b/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/shared_preferences_windows @@ -0,0 +1 @@ +/Users/achinthaisuru/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/ \ No newline at end of file diff --git a/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/url_launcher_windows b/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/url_launcher_windows new file mode 120000 index 00000000..7bce5a33 --- /dev/null +++ b/apps/mobile/apps/client/windows/flutter/ephemeral/.plugin_symlinks/url_launcher_windows @@ -0,0 +1 @@ +/Users/achinthaisuru/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.5/ \ No newline at end of file diff --git a/apps/mobile/apps/client/windows/flutter/generated_plugin_registrant.cc b/apps/mobile/apps/client/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..869eecae --- /dev/null +++ b/apps/mobile/apps/client/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,20 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include +#include +#include + +void RegisterPlugins(flutter::PluginRegistry* registry) { + FirebaseAuthPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi")); + FirebaseCorePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); +} diff --git a/apps/mobile/apps/client/windows/flutter/generated_plugin_registrant.h b/apps/mobile/apps/client/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..dc139d85 --- /dev/null +++ b/apps/mobile/apps/client/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/apps/mobile/apps/client/windows/flutter/generated_plugins.cmake b/apps/mobile/apps/client/windows/flutter/generated_plugins.cmake new file mode 100644 index 00000000..7ba8383b --- /dev/null +++ b/apps/mobile/apps/client/windows/flutter/generated_plugins.cmake @@ -0,0 +1,26 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + firebase_auth + firebase_core + url_launcher_windows +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/apps/mobile/apps/client/windows/runner/CMakeLists.txt b/apps/mobile/apps/client/windows/runner/CMakeLists.txt new file mode 100644 index 00000000..394917c0 --- /dev/null +++ b/apps/mobile/apps/client/windows/runner/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.14) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/apps/mobile/apps/client/windows/runner/Runner.rc b/apps/mobile/apps/client/windows/runner/Runner.rc new file mode 100644 index 00000000..406f018c --- /dev/null +++ b/apps/mobile/apps/client/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// Microsoft Visual C++ generated resource script. +// +#pragma code_page(65001) +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APP_ICON ICON "resources\\app_icon.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD +#else +#define VERSION_AS_NUMBER 1,0,0,0 +#endif + +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION +#else +#define VERSION_AS_STRING "1.0.0" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VERSION_AS_NUMBER + PRODUCTVERSION VERSION_AS_NUMBER + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "com.example" "\0" + VALUE "FileDescription", "krow_client" "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "krow_client" "\0" + VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0" + VALUE "OriginalFilename", "krow_client.exe" "\0" + VALUE "ProductName", "krow_client" "\0" + VALUE "ProductVersion", VERSION_AS_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/apps/mobile/apps/client/windows/runner/flutter_window.cpp b/apps/mobile/apps/client/windows/runner/flutter_window.cpp new file mode 100644 index 00000000..955ee303 --- /dev/null +++ b/apps/mobile/apps/client/windows/runner/flutter_window.cpp @@ -0,0 +1,71 @@ +#include "flutter_window.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(const flutter::DartProject& project) + : project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + + // Flutter can complete the first frame before the "show window" callback is + // registered. The following call ensures a frame is pending to ensure the + // window is shown. It is a no-op if the first frame hasn't completed yet. + flutter_controller_->ForceRedraw(); + + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opportunity to handle window messages. + if (flutter_controller_) { + std::optional result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/apps/mobile/apps/client/windows/runner/flutter_window.h b/apps/mobile/apps/client/windows/runner/flutter_window.h new file mode 100644 index 00000000..6da0652f --- /dev/null +++ b/apps/mobile/apps/client/windows/runner/flutter_window.h @@ -0,0 +1,33 @@ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include +#include + +#include + +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow hosting a Flutter view running |project|. + explicit FlutterWindow(const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/apps/mobile/apps/client/windows/runner/main.cpp b/apps/mobile/apps/client/windows/runner/main.cpp new file mode 100644 index 00000000..2c445bb3 --- /dev/null +++ b/apps/mobile/apps/client/windows/runner/main.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#include "flutter_window.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + flutter::DartProject project(L"data"); + + std::vector command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.Create(L"krow_client", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + ::MSG msg; + while (::GetMessage(&msg, nullptr, 0, 0)) { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/apps/mobile/apps/client/windows/runner/resource.h b/apps/mobile/apps/client/windows/runner/resource.h new file mode 100644 index 00000000..66a65d1e --- /dev/null +++ b/apps/mobile/apps/client/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/apps/mobile/apps/client/windows/runner/resources/app_icon.ico b/apps/mobile/apps/client/windows/runner/resources/app_icon.ico new file mode 100644 index 00000000..c04e20ca Binary files /dev/null and b/apps/mobile/apps/client/windows/runner/resources/app_icon.ico differ diff --git a/apps/mobile/apps/client/windows/runner/runner.exe.manifest b/apps/mobile/apps/client/windows/runner/runner.exe.manifest new file mode 100644 index 00000000..153653e8 --- /dev/null +++ b/apps/mobile/apps/client/windows/runner/runner.exe.manifest @@ -0,0 +1,14 @@ + + + + + PerMonitorV2 + + + + + + + + + diff --git a/apps/mobile/apps/client/windows/runner/utils.cpp b/apps/mobile/apps/client/windows/runner/utils.cpp new file mode 100644 index 00000000..3a0b4651 --- /dev/null +++ b/apps/mobile/apps/client/windows/runner/utils.cpp @@ -0,0 +1,65 @@ +#include "utils.h" + +#include +#include +#include +#include + +#include + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector(); + } + + std::vector command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + unsigned int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr) + -1; // remove the trailing null character + int input_length = (int)wcslen(utf16_string); + std::string utf8_string; + if (target_length == 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + input_length, utf8_string.data(), target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/apps/mobile/apps/client/windows/runner/utils.h b/apps/mobile/apps/client/windows/runner/utils.h new file mode 100644 index 00000000..3879d547 --- /dev/null +++ b/apps/mobile/apps/client/windows/runner/utils.h @@ -0,0 +1,19 @@ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include +#include + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector, +// encoded in UTF-8. Returns an empty std::vector on failure. +std::vector GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/apps/mobile/apps/client/windows/runner/win32_window.cpp b/apps/mobile/apps/client/windows/runner/win32_window.cpp new file mode 100644 index 00000000..60608d0f --- /dev/null +++ b/apps/mobile/apps/client/windows/runner/win32_window.cpp @@ -0,0 +1,288 @@ +#include "win32_window.h" + +#include +#include + +#include "resource.h" + +namespace { + +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + } + FreeLibrary(user32_module); +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registrar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast(origin.x), + static_cast(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + UpdateTheme(window); + + return OnCreate(); +} + +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast(window_struct->lpCreateParams)); + + auto that = static_cast(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/apps/mobile/apps/client/windows/runner/win32_window.h b/apps/mobile/apps/client/windows/runner/win32_window.h new file mode 100644 index 00000000..e901dde6 --- /dev/null +++ b/apps/mobile/apps/client/windows/runner/win32_window.h @@ -0,0 +1,102 @@ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include + +#include +#include +#include + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates a win32 window with |title| that is positioned and sized using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_ diff --git a/apps/mobile/apps/design_system_viewer/.gitignore b/apps/mobile/apps/design_system_viewer/.gitignore new file mode 100644 index 00000000..3820a95c --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/.gitignore @@ -0,0 +1,45 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ +/coverage/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/apps/mobile/apps/design_system_viewer/.metadata b/apps/mobile/apps/design_system_viewer/.metadata new file mode 100644 index 00000000..08c24780 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/.metadata @@ -0,0 +1,45 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "3b62efc2a3da49882f43c372e0bc53daef7295a6" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: android + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: ios + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: linux + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: macos + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: web + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: windows + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/apps/mobile/apps/design_system_viewer/analysis_options.yaml b/apps/mobile/apps/design_system_viewer/analysis_options.yaml new file mode 100644 index 00000000..fac60e24 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/analysis_options.yaml @@ -0,0 +1 @@ +include: ../../analysis_options.yaml \ No newline at end of file diff --git a/apps/mobile/apps/design_system_viewer/android/.gitignore b/apps/mobile/apps/design_system_viewer/android/.gitignore new file mode 100644 index 00000000..be3943c9 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/.gitignore @@ -0,0 +1,14 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java +.cxx/ + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/apps/mobile/apps/design_system_viewer/android/app/build.gradle.kts b/apps/mobile/apps/design_system_viewer/android/app/build.gradle.kts new file mode 100644 index 00000000..ba883b72 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.example.krow_design_system_viewer" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.krow_design_system_viewer" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/apps/mobile/apps/design_system_viewer/android/app/src/debug/AndroidManifest.xml b/apps/mobile/apps/design_system_viewer/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..399f6981 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/apps/mobile/apps/design_system_viewer/android/app/src/main/AndroidManifest.xml b/apps/mobile/apps/design_system_viewer/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..4ee81882 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/design_system_viewer/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/apps/mobile/apps/design_system_viewer/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..539ab022 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,19 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + } +} diff --git a/apps/mobile/apps/design_system_viewer/android/app/src/main/kotlin/com/example/krow_design_system_viewer/MainActivity.kt b/apps/mobile/apps/design_system_viewer/android/app/src/main/kotlin/com/example/krow_design_system_viewer/MainActivity.kt new file mode 100644 index 00000000..9f6aa558 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/app/src/main/kotlin/com/example/krow_design_system_viewer/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.krow_design_system_viewer + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/apps/mobile/apps/design_system_viewer/android/app/src/main/res/drawable-v21/launch_background.xml b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 00000000..f74085f3 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/apps/mobile/apps/design_system_viewer/android/app/src/main/res/drawable/launch_background.xml b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 00000000..304732f8 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..db77bb4b Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..17987b79 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..09d43914 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..d5f1c8d3 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..4d6372ee Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/design_system_viewer/android/app/src/main/res/values-night/styles.xml b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 00000000..06952be7 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/apps/mobile/apps/design_system_viewer/android/app/src/main/res/values/styles.xml b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..cb1ef880 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/apps/mobile/apps/design_system_viewer/android/app/src/profile/AndroidManifest.xml b/apps/mobile/apps/design_system_viewer/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 00000000..399f6981 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/apps/mobile/apps/design_system_viewer/android/build.gradle.kts b/apps/mobile/apps/design_system_viewer/android/build.gradle.kts new file mode 100644 index 00000000..dbee657b --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/apps/mobile/apps/design_system_viewer/android/gradle.properties b/apps/mobile/apps/design_system_viewer/android/gradle.properties new file mode 100644 index 00000000..fbee1d8c --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true diff --git a/apps/mobile/apps/design_system_viewer/android/gradle/wrapper/gradle-wrapper.properties b/apps/mobile/apps/design_system_viewer/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..e4ef43fb --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip diff --git a/apps/mobile/apps/design_system_viewer/android/settings.gradle.kts b/apps/mobile/apps/design_system_viewer/android/settings.gradle.kts new file mode 100644 index 00000000..ca7fe065 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/android/settings.gradle.kts @@ -0,0 +1,26 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.11.1" apply false + id("org.jetbrains.kotlin.android") version "2.2.20" apply false +} + +include(":app") diff --git a/apps/mobile/apps/design_system_viewer/ios/.gitignore b/apps/mobile/apps/design_system_viewer/ios/.gitignore new file mode 100644 index 00000000..7a7f9873 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/apps/mobile/apps/design_system_viewer/ios/Flutter/AppFrameworkInfo.plist b/apps/mobile/apps/design_system_viewer/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 00000000..1dc6cf76 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 13.0 + + diff --git a/apps/mobile/apps/design_system_viewer/ios/Flutter/Debug.xcconfig b/apps/mobile/apps/design_system_viewer/ios/Flutter/Debug.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/apps/mobile/apps/design_system_viewer/ios/Flutter/Release.xcconfig b/apps/mobile/apps/design_system_viewer/ios/Flutter/Release.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/apps/mobile/apps/design_system_viewer/ios/Flutter/ephemeral/flutter_lldb_helper.py b/apps/mobile/apps/design_system_viewer/ios/Flutter/ephemeral/flutter_lldb_helper.py new file mode 100644 index 00000000..a88caf99 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Flutter/ephemeral/flutter_lldb_helper.py @@ -0,0 +1,32 @@ +# +# Generated file, do not edit. +# + +import lldb + +def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict): + """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages.""" + base = frame.register["x0"].GetValueAsAddress() + page_len = frame.register["x1"].GetValueAsUnsigned() + + # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the + # first page to see if handled it correctly. This makes diagnosing + # misconfiguration (e.g. missing breakpoint) easier. + data = bytearray(page_len) + data[0:8] = b'IHELPED!' + + error = lldb.SBError() + frame.GetThread().GetProcess().WriteMemory(base, data, error) + if not error.Success(): + print(f'Failed to write into {base}[+{page_len}]', error) + return + +def __lldb_init_module(debugger: lldb.SBDebugger, _): + target = debugger.GetDummyTarget() + # Caveat: must use BreakpointCreateByRegEx here and not + # BreakpointCreateByName. For some reasons callback function does not + # get carried over from dummy target for the later. + bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$") + bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__)) + bp.SetAutoContinue(True) + print("-- LLDB integration loaded --") diff --git a/apps/mobile/apps/design_system_viewer/ios/Flutter/ephemeral/flutter_lldbinit b/apps/mobile/apps/design_system_viewer/ios/Flutter/ephemeral/flutter_lldbinit new file mode 100644 index 00000000..e3ba6fbe --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Flutter/ephemeral/flutter_lldbinit @@ -0,0 +1,5 @@ +# +# Generated file, do not edit. +# + +command script import --relative-to-command-file flutter_lldb_helper.py diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/project.pbxproj b/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..c782926e --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,616 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowDesignSystemViewer; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowDesignSystemViewer.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowDesignSystemViewer.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowDesignSystemViewer.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowDesignSystemViewer; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowDesignSystemViewer; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..e3773d42 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner.xcworkspace/contents.xcworkspacedata b/apps/mobile/apps/design_system_viewer/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile/apps/design_system_viewer/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/apps/mobile/apps/design_system_viewer/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/AppDelegate.swift b/apps/mobile/apps/design_system_viewer/ios/Runner/AppDelegate.swift new file mode 100644 index 00000000..62666446 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Flutter +import UIKit + +@main +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d36b1fab --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 00000000..dc9ada47 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 00000000..7353c41e Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 00000000..797d452e Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 00000000..6ed2d933 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 00000000..4cd7b009 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 00000000..fe730945 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 00000000..321773cd Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 00000000..797d452e Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 00000000..502f463a Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 00000000..0ec30343 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 00000000..0ec30343 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 00000000..e9f5fea2 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 00000000..84ac32ae Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 00000000..8953cba0 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 00000000..0467bf12 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..0bedcf2f --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Base.lproj/LaunchScreen.storyboard b/apps/mobile/apps/design_system_viewer/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f2e259c7 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Base.lproj/Main.storyboard b/apps/mobile/apps/design_system_viewer/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 00000000..f3c28516 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/GeneratedPluginRegistrant.h b/apps/mobile/apps/design_system_viewer/ios/Runner/GeneratedPluginRegistrant.h new file mode 100644 index 00000000..7a890927 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner/GeneratedPluginRegistrant.h @@ -0,0 +1,19 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GeneratedPluginRegistrant_h +#define GeneratedPluginRegistrant_h + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface GeneratedPluginRegistrant : NSObject ++ (void)registerWithRegistry:(NSObject*)registry; +@end + +NS_ASSUME_NONNULL_END +#endif /* GeneratedPluginRegistrant_h */ diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/GeneratedPluginRegistrant.m b/apps/mobile/apps/design_system_viewer/ios/Runner/GeneratedPluginRegistrant.m new file mode 100644 index 00000000..efe65ecc --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner/GeneratedPluginRegistrant.m @@ -0,0 +1,14 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#import "GeneratedPluginRegistrant.h" + +@implementation GeneratedPluginRegistrant + ++ (void)registerWithRegistry:(NSObject*)registry { +} + +@end diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Info.plist b/apps/mobile/apps/design_system_viewer/ios/Runner/Info.plist new file mode 100644 index 00000000..0c4dda83 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Krow Design System Viewer + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + krow_design_system_viewer + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/apps/mobile/apps/design_system_viewer/ios/Runner/Runner-Bridging-Header.h b/apps/mobile/apps/design_system_viewer/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 00000000..308a2a56 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/apps/mobile/apps/design_system_viewer/ios/RunnerTests/RunnerTests.swift b/apps/mobile/apps/design_system_viewer/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 00000000..86a7c3b1 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/apps/mobile/apps/design_system_viewer/lib/main.dart b/apps/mobile/apps/design_system_viewer/lib/main.dart new file mode 100644 index 00000000..7bd967d4 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/lib/main.dart @@ -0,0 +1,122 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + // This widget is the root of your application. + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + theme: ThemeData( + // This is the theme of your application. + // + // TRY THIS: Try running your application with "flutter run". You'll see + // the application has a purple toolbar. Then, without quitting the app, + // try changing the seedColor in the colorScheme below to Colors.green + // and then invoke "hot reload" (save your changes or press the "hot + // reload" button in a Flutter-supported IDE, or press "r" if you used + // the command line to start the app). + // + // Notice that the counter didn't reset back to zero; the application + // state is not lost during the reload. To reset the state, use hot + // restart instead. + // + // This works for code too, not just values: Most code changes can be + // tested with just a hot reload. + colorScheme: .fromSeed(seedColor: Colors.deepPurple), + ), + home: const MyHomePage(title: 'Flutter Demo Home Page'), + ); + } +} + +class MyHomePage extends StatefulWidget { + const MyHomePage({super.key, required this.title}); + + // This widget is the home page of your application. It is stateful, meaning + // that it has a State object (defined below) that contains fields that affect + // how it looks. + + // This class is the configuration for the state. It holds the values (in this + // case the title) provided by the parent (in this case the App widget) and + // used by the build method of the State. Fields in a Widget subclass are + // always marked "final". + + final String title; + + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + int _counter = 0; + + void _incrementCounter() { + setState(() { + // This call to setState tells the Flutter framework that something has + // changed in this State, which causes it to rerun the build method below + // so that the display can reflect the updated values. If we changed + // _counter without calling setState(), then the build method would not be + // called again, and so nothing would appear to happen. + _counter++; + }); + } + + @override + Widget build(BuildContext context) { + // This method is rerun every time setState is called, for instance as done + // by the _incrementCounter method above. + // + // The Flutter framework has been optimized to make rerunning build methods + // fast, so that you can just rebuild anything that needs updating rather + // than having to individually change instances of widgets. + return Scaffold( + appBar: AppBar( + // TRY THIS: Try changing the color here to a specific color (to + // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar + // change color while the other colors stay the same. + backgroundColor: Theme.of(context).colorScheme.inversePrimary, + // Here we take the value from the MyHomePage object that was created by + // the App.build method, and use it to set our appbar title. + title: Text(widget.title), + ), + body: Center( + // Center is a layout widget. It takes a single child and positions it + // in the middle of the parent. + child: Column( + // Column is also a layout widget. It takes a list of children and + // arranges them vertically. By default, it sizes itself to fit its + // children horizontally, and tries to be as tall as its parent. + // + // Column has various properties to control how it sizes itself and + // how it positions its children. Here we use mainAxisAlignment to + // center the children vertically; the main axis here is the vertical + // axis because Columns are vertical (the cross axis would be + // horizontal). + // + // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint" + // action in the IDE, or press "p" in the console), to see the + // wireframe for each widget. + mainAxisAlignment: .center, + children: [ + const Text('You have pushed the button this many times:'), + Text( + '$_counter', + style: Theme.of(context).textTheme.headlineMedium, + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: const Icon(Icons.add), + ), + ); + } +} diff --git a/apps/mobile/apps/design_system_viewer/linux/.gitignore b/apps/mobile/apps/design_system_viewer/linux/.gitignore new file mode 100644 index 00000000..d3896c98 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/apps/mobile/apps/design_system_viewer/linux/CMakeLists.txt b/apps/mobile/apps/design_system_viewer/linux/CMakeLists.txt new file mode 100644 index 00000000..2ea8bc94 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/linux/CMakeLists.txt @@ -0,0 +1,128 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "krow_design_system_viewer") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID +set(APPLICATION_ID "com.example.krow_design_system_viewer") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Load bundled libraries from the lib/ directory relative to the binary. +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Root filesystem for cross-building. +if(FLUTTER_TARGET_PLATFORM_SYSROOT) + set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() + +# Define build configuration options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Only the install-generated bundle's copy of the executable will launch +# correctly, since the resources must in the right relative locations. To avoid +# people trying to run the unbundled copy, put it in a subdirectory instead of +# the default top-level location. +set_target_properties(${BINARY_NAME} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" +) + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endforeach(bundled_library) + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/apps/mobile/apps/design_system_viewer/linux/flutter/CMakeLists.txt b/apps/mobile/apps/design_system_viewer/linux/flutter/CMakeLists.txt new file mode 100644 index 00000000..d5bd0164 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/linux/flutter/CMakeLists.txt @@ -0,0 +1,88 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/apps/mobile/apps/design_system_viewer/linux/flutter/generated_plugin_registrant.cc b/apps/mobile/apps/design_system_viewer/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..e71a16d2 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void fl_register_plugins(FlPluginRegistry* registry) { +} diff --git a/apps/mobile/apps/design_system_viewer/linux/flutter/generated_plugin_registrant.h b/apps/mobile/apps/design_system_viewer/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..e0f0a47b --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/apps/mobile/apps/design_system_viewer/linux/flutter/generated_plugins.cmake b/apps/mobile/apps/design_system_viewer/linux/flutter/generated_plugins.cmake new file mode 100644 index 00000000..2e1de87a --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/linux/flutter/generated_plugins.cmake @@ -0,0 +1,23 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/apps/mobile/apps/design_system_viewer/linux/runner/CMakeLists.txt b/apps/mobile/apps/design_system_viewer/linux/runner/CMakeLists.txt new file mode 100644 index 00000000..e97dabc7 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/linux/runner/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the application ID. +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/apps/mobile/apps/design_system_viewer/linux/runner/main.cc b/apps/mobile/apps/design_system_viewer/linux/runner/main.cc new file mode 100644 index 00000000..e7c5c543 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/linux/runner/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/apps/mobile/apps/design_system_viewer/linux/runner/my_application.cc b/apps/mobile/apps/design_system_viewer/linux/runner/my_application.cc new file mode 100644 index 00000000..9a57dad4 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/linux/runner/my_application.cc @@ -0,0 +1,148 @@ +#include "my_application.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; + char** dart_entrypoint_arguments; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Called when first Flutter frame received. +static void first_frame_cb(MyApplication* self, FlView* view) { + gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); +} + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + + // Use a header bar when running in GNOME as this is the common style used + // by applications and is the setup most users will be using (e.g. Ubuntu + // desktop). + // If running on X and not using GNOME then just use a traditional title bar + // in case the window manager does more exotic layout, e.g. tiling. + // If running on Wayland assume the header bar will work (may need changing + // if future cases occur). + gboolean use_header_bar = TRUE; +#ifdef GDK_WINDOWING_X11 + GdkScreen* screen = gtk_window_get_screen(window); + if (GDK_IS_X11_SCREEN(screen)) { + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); + if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + use_header_bar = FALSE; + } + } +#endif + if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "krow_design_system_viewer"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } else { + gtk_window_set_title(window, "krow_design_system_viewer"); + } + + gtk_window_set_default_size(window, 1280, 720); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + fl_dart_project_set_dart_entrypoint_arguments( + project, self->dart_entrypoint_arguments); + + FlView* view = fl_view_new(project); + GdkRGBA background_color; + // Background defaults to black, override it here if necessary, e.g. #00000000 + // for transparent. + gdk_rgba_parse(&background_color, "#000000"); + fl_view_set_background_color(view, &background_color); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + // Show the window when Flutter renders. + // Requires the view to be realized so we can start rendering. + g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), + self); + gtk_widget_realize(GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +// Implements GApplication::local_command_line. +static gboolean my_application_local_command_line(GApplication* application, + gchar*** arguments, + int* exit_status) { + MyApplication* self = MY_APPLICATION(application); + // Strip out the first argument as it is the binary name. + self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); + + g_autoptr(GError) error = nullptr; + if (!g_application_register(application, nullptr, &error)) { + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; + } + + g_application_activate(application); + *exit_status = 0; + + return TRUE; +} + +// Implements GApplication::startup. +static void my_application_startup(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application startup. + + G_APPLICATION_CLASS(my_application_parent_class)->startup(application); +} + +// Implements GApplication::shutdown. +static void my_application_shutdown(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application shutdown. + + G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); +} + +// Implements GObject::dispose. +static void my_application_dispose(GObject* object) { + MyApplication* self = MY_APPLICATION(object); + g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); + G_OBJECT_CLASS(my_application_parent_class)->dispose(object); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; + G_APPLICATION_CLASS(klass)->local_command_line = + my_application_local_command_line; + G_APPLICATION_CLASS(klass)->startup = my_application_startup; + G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; + G_OBJECT_CLASS(klass)->dispose = my_application_dispose; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + // Set the program name to the application ID, which helps various systems + // like GTK and desktop environments map this running application to its + // corresponding .desktop file. This ensures better integration by allowing + // the application to be recognized beyond its binary name. + g_set_prgname(APPLICATION_ID); + + return MY_APPLICATION(g_object_new(my_application_get_type(), + "application-id", APPLICATION_ID, "flags", + G_APPLICATION_NON_UNIQUE, nullptr)); +} diff --git a/apps/mobile/apps/design_system_viewer/linux/runner/my_application.h b/apps/mobile/apps/design_system_viewer/linux/runner/my_application.h new file mode 100644 index 00000000..db16367a --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/linux/runner/my_application.h @@ -0,0 +1,21 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, + my_application, + MY, + APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/apps/mobile/apps/design_system_viewer/macos/.gitignore b/apps/mobile/apps/design_system_viewer/macos/.gitignore new file mode 100644 index 00000000..746adbb6 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/apps/mobile/apps/design_system_viewer/macos/Flutter/Flutter-Debug.xcconfig b/apps/mobile/apps/design_system_viewer/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 00000000..c2efd0b6 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1 @@ +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/apps/mobile/apps/design_system_viewer/macos/Flutter/Flutter-Release.xcconfig b/apps/mobile/apps/design_system_viewer/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 00000000..c2efd0b6 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1 @@ +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/apps/mobile/apps/design_system_viewer/macos/Flutter/GeneratedPluginRegistrant.swift b/apps/mobile/apps/design_system_viewer/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 00000000..cccf817a --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,10 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { +} diff --git a/apps/mobile/apps/design_system_viewer/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/apps/mobile/apps/design_system_viewer/macos/Flutter/ephemeral/Flutter-Generated.xcconfig new file mode 100644 index 00000000..d7e96049 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Flutter/ephemeral/Flutter-Generated.xcconfig @@ -0,0 +1,11 @@ +// This is a generated file; do not edit or check into version control. +FLUTTER_ROOT=/Users/achinthaisuru/Documents/flutter +FLUTTER_APPLICATION_PATH=/Users/achinthaisuru/Documents/Github/krow-workforce/apps/mobile/apps/design_system_viewer +COCOAPODS_PARALLEL_CODE_SIGN=true +FLUTTER_BUILD_DIR=build +FLUTTER_BUILD_NAME=1.0.0 +FLUTTER_BUILD_NUMBER=1 +DART_OBFUSCATION=false +TRACK_WIDGET_CREATION=true +TREE_SHAKE_ICONS=false +PACKAGE_CONFIG=.dart_tool/package_config.json diff --git a/apps/mobile/apps/design_system_viewer/macos/Flutter/ephemeral/flutter_export_environment.sh b/apps/mobile/apps/design_system_viewer/macos/Flutter/ephemeral/flutter_export_environment.sh new file mode 100755 index 00000000..6b0b50f3 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Flutter/ephemeral/flutter_export_environment.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# This is a generated file; do not edit or check into version control. +export "FLUTTER_ROOT=/Users/achinthaisuru/Documents/flutter" +export "FLUTTER_APPLICATION_PATH=/Users/achinthaisuru/Documents/Github/krow-workforce/apps/mobile/apps/design_system_viewer" +export "COCOAPODS_PARALLEL_CODE_SIGN=true" +export "FLUTTER_BUILD_DIR=build" +export "FLUTTER_BUILD_NAME=1.0.0" +export "FLUTTER_BUILD_NUMBER=1" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=true" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner.xcodeproj/project.pbxproj b/apps/mobile/apps/design_system_viewer/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..37a481ad --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,705 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* krow_design_system_viewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "krow_design_system_viewer.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* krow_design_system_viewer.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* krow_design_system_viewer.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowDesignSystemViewer.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/krow_design_system_viewer.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/krow_design_system_viewer"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowDesignSystemViewer.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/krow_design_system_viewer.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/krow_design_system_viewer"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowDesignSystemViewer.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/krow_design_system_viewer.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/krow_design_system_viewer"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile/apps/design_system_viewer/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/apps/mobile/apps/design_system_viewer/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..bbf718ff --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner.xcworkspace/contents.xcworkspacedata b/apps/mobile/apps/design_system_viewer/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile/apps/design_system_viewer/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/AppDelegate.swift b/apps/mobile/apps/design_system_viewer/macos/Runner/AppDelegate.swift new file mode 100644 index 00000000..b3c17614 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Cocoa +import FlutterMacOS + +@main +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } +} diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..a2ec33f1 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 00000000..82b6f9d9 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 00000000..13b35eba Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 00000000..0a3f5fa4 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 00000000..bdb57226 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 00000000..f083318e Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 00000000..326c0e72 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 00000000..2f1632cf Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Base.lproj/MainMenu.xib b/apps/mobile/apps/design_system_viewer/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 00000000..80e867a4 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Configs/AppInfo.xcconfig b/apps/mobile/apps/design_system_viewer/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 00000000..b45ff361 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = krow_design_system_viewer + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.example.krowDesignSystemViewer + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright Β© 2026 com.example. All rights reserved. diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Configs/Debug.xcconfig b/apps/mobile/apps/design_system_viewer/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 00000000..36b0fd94 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Configs/Release.xcconfig b/apps/mobile/apps/design_system_viewer/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 00000000..dff4f495 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Configs/Warnings.xcconfig b/apps/mobile/apps/design_system_viewer/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 00000000..42bcbf47 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/DebugProfile.entitlements b/apps/mobile/apps/design_system_viewer/macos/Runner/DebugProfile.entitlements new file mode 100644 index 00000000..dddb8a30 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Info.plist b/apps/mobile/apps/design_system_viewer/macos/Runner/Info.plist new file mode 100644 index 00000000..4789daa6 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/MainFlutterWindow.swift b/apps/mobile/apps/design_system_viewer/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 00000000..3cc05eb2 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/apps/mobile/apps/design_system_viewer/macos/Runner/Release.entitlements b/apps/mobile/apps/design_system_viewer/macos/Runner/Release.entitlements new file mode 100644 index 00000000..852fa1a4 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/apps/mobile/apps/design_system_viewer/macos/RunnerTests/RunnerTests.swift b/apps/mobile/apps/design_system_viewer/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 00000000..61f3bd1f --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Cocoa +import FlutterMacOS +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/apps/mobile/apps/design_system_viewer/pubspec.yaml b/apps/mobile/apps/design_system_viewer/pubspec.yaml new file mode 100644 index 00000000..c96bbd77 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/pubspec.yaml @@ -0,0 +1,90 @@ +name: design_system_viewer +description: "A new Flutter project." +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 +resolution: workspace + +environment: + sdk: ^3.10.7 + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.8 + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^6.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/to/asset-from-package + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/to/font-from-package diff --git a/apps/mobile/apps/design_system_viewer/test/widget_test.dart b/apps/mobile/apps/design_system_viewer/test/widget_test.dart new file mode 100644 index 00000000..59ec1d1b --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:design_system_viewer/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/apps/mobile/apps/design_system_viewer/web/favicon.png b/apps/mobile/apps/design_system_viewer/web/favicon.png new file mode 100644 index 00000000..8aaa46ac Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/web/favicon.png differ diff --git a/apps/mobile/apps/design_system_viewer/web/icons/Icon-192.png b/apps/mobile/apps/design_system_viewer/web/icons/Icon-192.png new file mode 100644 index 00000000..b749bfef Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/web/icons/Icon-192.png differ diff --git a/apps/mobile/apps/design_system_viewer/web/icons/Icon-512.png b/apps/mobile/apps/design_system_viewer/web/icons/Icon-512.png new file mode 100644 index 00000000..88cfd48d Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/web/icons/Icon-512.png differ diff --git a/apps/mobile/apps/design_system_viewer/web/icons/Icon-maskable-192.png b/apps/mobile/apps/design_system_viewer/web/icons/Icon-maskable-192.png new file mode 100644 index 00000000..eb9b4d76 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/web/icons/Icon-maskable-192.png differ diff --git a/apps/mobile/apps/design_system_viewer/web/icons/Icon-maskable-512.png b/apps/mobile/apps/design_system_viewer/web/icons/Icon-maskable-512.png new file mode 100644 index 00000000..d69c5669 Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/web/icons/Icon-maskable-512.png differ diff --git a/apps/mobile/apps/design_system_viewer/web/index.html b/apps/mobile/apps/design_system_viewer/web/index.html new file mode 100644 index 00000000..6105e798 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/web/index.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + krow_design_system_viewer + + + + + + diff --git a/apps/mobile/apps/design_system_viewer/web/manifest.json b/apps/mobile/apps/design_system_viewer/web/manifest.json new file mode 100644 index 00000000..19d97c3e --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "krow_design_system_viewer", + "short_name": "krow_design_system_viewer", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/apps/mobile/apps/design_system_viewer/windows/.gitignore b/apps/mobile/apps/design_system_viewer/windows/.gitignore new file mode 100644 index 00000000..d492d0d9 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ephemeral/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/apps/mobile/apps/design_system_viewer/windows/CMakeLists.txt b/apps/mobile/apps/design_system_viewer/windows/CMakeLists.txt new file mode 100644 index 00000000..e7ce1a4f --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/CMakeLists.txt @@ -0,0 +1,108 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(krow_design_system_viewer LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "krow_design_system_viewer") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(VERSION 3.14...3.25) + +# Define build configuration option. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() +# Define settings for the Profile build mode. +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/apps/mobile/apps/design_system_viewer/windows/flutter/CMakeLists.txt b/apps/mobile/apps/design_system_viewer/windows/flutter/CMakeLists.txt new file mode 100644 index 00000000..903f4899 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/flutter/CMakeLists.txt @@ -0,0 +1,109 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + ${FLUTTER_TARGET_PLATFORM} $ + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/apps/mobile/apps/design_system_viewer/windows/flutter/generated_plugin_registrant.cc b/apps/mobile/apps/design_system_viewer/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..8b6d4680 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void RegisterPlugins(flutter::PluginRegistry* registry) { +} diff --git a/apps/mobile/apps/design_system_viewer/windows/flutter/generated_plugin_registrant.h b/apps/mobile/apps/design_system_viewer/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..dc139d85 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/apps/mobile/apps/design_system_viewer/windows/flutter/generated_plugins.cmake b/apps/mobile/apps/design_system_viewer/windows/flutter/generated_plugins.cmake new file mode 100644 index 00000000..b93c4c30 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/flutter/generated_plugins.cmake @@ -0,0 +1,23 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/apps/mobile/apps/design_system_viewer/windows/runner/CMakeLists.txt b/apps/mobile/apps/design_system_viewer/windows/runner/CMakeLists.txt new file mode 100644 index 00000000..394917c0 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/runner/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.14) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/apps/mobile/apps/design_system_viewer/windows/runner/Runner.rc b/apps/mobile/apps/design_system_viewer/windows/runner/Runner.rc new file mode 100644 index 00000000..9447ef0f --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// Microsoft Visual C++ generated resource script. +// +#pragma code_page(65001) +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APP_ICON ICON "resources\\app_icon.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD +#else +#define VERSION_AS_NUMBER 1,0,0,0 +#endif + +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION +#else +#define VERSION_AS_STRING "1.0.0" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VERSION_AS_NUMBER + PRODUCTVERSION VERSION_AS_NUMBER + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "com.example" "\0" + VALUE "FileDescription", "krow_design_system_viewer" "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "krow_design_system_viewer" "\0" + VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0" + VALUE "OriginalFilename", "krow_design_system_viewer.exe" "\0" + VALUE "ProductName", "krow_design_system_viewer" "\0" + VALUE "ProductVersion", VERSION_AS_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/apps/mobile/apps/design_system_viewer/windows/runner/flutter_window.cpp b/apps/mobile/apps/design_system_viewer/windows/runner/flutter_window.cpp new file mode 100644 index 00000000..955ee303 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/runner/flutter_window.cpp @@ -0,0 +1,71 @@ +#include "flutter_window.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(const flutter::DartProject& project) + : project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + + // Flutter can complete the first frame before the "show window" callback is + // registered. The following call ensures a frame is pending to ensure the + // window is shown. It is a no-op if the first frame hasn't completed yet. + flutter_controller_->ForceRedraw(); + + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opportunity to handle window messages. + if (flutter_controller_) { + std::optional result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/apps/mobile/apps/design_system_viewer/windows/runner/flutter_window.h b/apps/mobile/apps/design_system_viewer/windows/runner/flutter_window.h new file mode 100644 index 00000000..6da0652f --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/runner/flutter_window.h @@ -0,0 +1,33 @@ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include +#include + +#include + +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow hosting a Flutter view running |project|. + explicit FlutterWindow(const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/apps/mobile/apps/design_system_viewer/windows/runner/main.cpp b/apps/mobile/apps/design_system_viewer/windows/runner/main.cpp new file mode 100644 index 00000000..adbbdb30 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/runner/main.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#include "flutter_window.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + flutter::DartProject project(L"data"); + + std::vector command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.Create(L"krow_design_system_viewer", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + ::MSG msg; + while (::GetMessage(&msg, nullptr, 0, 0)) { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/apps/mobile/apps/design_system_viewer/windows/runner/resource.h b/apps/mobile/apps/design_system_viewer/windows/runner/resource.h new file mode 100644 index 00000000..66a65d1e --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/apps/mobile/apps/design_system_viewer/windows/runner/resources/app_icon.ico b/apps/mobile/apps/design_system_viewer/windows/runner/resources/app_icon.ico new file mode 100644 index 00000000..c04e20ca Binary files /dev/null and b/apps/mobile/apps/design_system_viewer/windows/runner/resources/app_icon.ico differ diff --git a/apps/mobile/apps/design_system_viewer/windows/runner/runner.exe.manifest b/apps/mobile/apps/design_system_viewer/windows/runner/runner.exe.manifest new file mode 100644 index 00000000..153653e8 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/runner/runner.exe.manifest @@ -0,0 +1,14 @@ + + + + + PerMonitorV2 + + + + + + + + + diff --git a/apps/mobile/apps/design_system_viewer/windows/runner/utils.cpp b/apps/mobile/apps/design_system_viewer/windows/runner/utils.cpp new file mode 100644 index 00000000..3a0b4651 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/runner/utils.cpp @@ -0,0 +1,65 @@ +#include "utils.h" + +#include +#include +#include +#include + +#include + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector(); + } + + std::vector command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + unsigned int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr) + -1; // remove the trailing null character + int input_length = (int)wcslen(utf16_string); + std::string utf8_string; + if (target_length == 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + input_length, utf8_string.data(), target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/apps/mobile/apps/design_system_viewer/windows/runner/utils.h b/apps/mobile/apps/design_system_viewer/windows/runner/utils.h new file mode 100644 index 00000000..3879d547 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/runner/utils.h @@ -0,0 +1,19 @@ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include +#include + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector, +// encoded in UTF-8. Returns an empty std::vector on failure. +std::vector GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/apps/mobile/apps/design_system_viewer/windows/runner/win32_window.cpp b/apps/mobile/apps/design_system_viewer/windows/runner/win32_window.cpp new file mode 100644 index 00000000..60608d0f --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/runner/win32_window.cpp @@ -0,0 +1,288 @@ +#include "win32_window.h" + +#include +#include + +#include "resource.h" + +namespace { + +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + } + FreeLibrary(user32_module); +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registrar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast(origin.x), + static_cast(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + UpdateTheme(window); + + return OnCreate(); +} + +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast(window_struct->lpCreateParams)); + + auto that = static_cast(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/apps/mobile/apps/design_system_viewer/windows/runner/win32_window.h b/apps/mobile/apps/design_system_viewer/windows/runner/win32_window.h new file mode 100644 index 00000000..e901dde6 --- /dev/null +++ b/apps/mobile/apps/design_system_viewer/windows/runner/win32_window.h @@ -0,0 +1,102 @@ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include + +#include +#include +#include + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates a win32 window with |title| that is positioned and sized using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_ diff --git a/apps/mobile/apps/staff/.gitignore b/apps/mobile/apps/staff/.gitignore new file mode 100644 index 00000000..3820a95c --- /dev/null +++ b/apps/mobile/apps/staff/.gitignore @@ -0,0 +1,45 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ +/coverage/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/apps/mobile/apps/staff/.metadata b/apps/mobile/apps/staff/.metadata new file mode 100644 index 00000000..10fc6261 --- /dev/null +++ b/apps/mobile/apps/staff/.metadata @@ -0,0 +1,30 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "3b62efc2a3da49882f43c372e0bc53daef7295a6" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + - platform: ios + create_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + base_revision: 3b62efc2a3da49882f43c372e0bc53daef7295a6 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/apps/mobile/apps/staff/README.md b/apps/mobile/apps/staff/README.md new file mode 100644 index 00000000..54a11c2f --- /dev/null +++ b/apps/mobile/apps/staff/README.md @@ -0,0 +1,3 @@ +# krowwithus_staff + +A new Flutter project. diff --git a/apps/mobile/apps/staff/analysis_options.yaml b/apps/mobile/apps/staff/analysis_options.yaml new file mode 100644 index 00000000..fac60e24 --- /dev/null +++ b/apps/mobile/apps/staff/analysis_options.yaml @@ -0,0 +1 @@ +include: ../../analysis_options.yaml \ No newline at end of file diff --git a/apps/mobile/apps/staff/android/.gitignore b/apps/mobile/apps/staff/android/.gitignore new file mode 100644 index 00000000..be3943c9 --- /dev/null +++ b/apps/mobile/apps/staff/android/.gitignore @@ -0,0 +1,14 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java +.cxx/ + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/apps/mobile/apps/staff/android/app/build.gradle.kts b/apps/mobile/apps/staff/android/app/build.gradle.kts new file mode 100644 index 00000000..80f2b222 --- /dev/null +++ b/apps/mobile/apps/staff/android/app/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") + id("com.google.gms.google-services") +} + +android { + namespace = "com.example.krow_staff" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.krowwithus.staff" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/apps/mobile/apps/staff/android/app/google-services.json b/apps/mobile/apps/staff/android/app/google-services.json new file mode 100644 index 00000000..13b4592b --- /dev/null +++ b/apps/mobile/apps/staff/android/app/google-services.json @@ -0,0 +1,226 @@ +{ + "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:87d41566f8dda41d7757db", + "android_client_info": { + "package_name": "com.example.krow_workforce" + } + }, + "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: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:d26bde4ee337b0b17757db", + "android_client_info": { + "package_name": "com.krowwithus.krow_workforce.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: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-dppsapp5i3lsfrlm1mhob2s21peofg1t.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.krow.app.staff.dev" + } + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/apps/mobile/apps/staff/android/app/src/debug/AndroidManifest.xml b/apps/mobile/apps/staff/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..399f6981 --- /dev/null +++ b/apps/mobile/apps/staff/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/apps/mobile/apps/staff/android/app/src/main/AndroidManifest.xml b/apps/mobile/apps/staff/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..a80e0f85 --- /dev/null +++ b/apps/mobile/apps/staff/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/staff/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/apps/mobile/apps/staff/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000..899a1487 --- /dev/null +++ b/apps/mobile/apps/staff/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,44 @@ +package io.flutter.plugins; + +import androidx.annotation.Keep; +import androidx.annotation.NonNull; +import io.flutter.Log; + +import io.flutter.embedding.engine.FlutterEngine; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Android platform. + */ +@Keep +public final class GeneratedPluginRegistrant { + private static final String TAG = "GeneratedPluginRegistrant"; + public static void registerWith(@NonNull FlutterEngine flutterEngine) { + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.appcheck.FlutterFirebaseAppCheckPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin firebase_app_check, io.flutter.plugins.firebase.appcheck.FlutterFirebaseAppCheckPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.auth.FlutterFirebaseAuthPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin firebase_auth, io.flutter.plugins.firebase.auth.FlutterFirebaseAuthPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin firebase_core, io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin path_provider_android, io.flutter.plugins.pathprovider.PathProviderPlugin", e); + } + try { + flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin()); + } catch (Exception e) { + Log.e(TAG, "Error registering plugin shared_preferences_android, io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin", e); + } + } +} diff --git a/apps/mobile/apps/staff/android/app/src/main/kotlin/com/example/krow_staff/MainActivity.kt b/apps/mobile/apps/staff/android/app/src/main/kotlin/com/example/krow_staff/MainActivity.kt new file mode 100644 index 00000000..13520833 --- /dev/null +++ b/apps/mobile/apps/staff/android/app/src/main/kotlin/com/example/krow_staff/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.krow_staff + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/apps/mobile/apps/staff/android/app/src/main/kotlin/com/krowwithus/krowwithus_staff/MainActivity.kt b/apps/mobile/apps/staff/android/app/src/main/kotlin/com/krowwithus/krowwithus_staff/MainActivity.kt new file mode 100644 index 00000000..994d7695 --- /dev/null +++ b/apps/mobile/apps/staff/android/app/src/main/kotlin/com/krowwithus/krowwithus_staff/MainActivity.kt @@ -0,0 +1,5 @@ +package com.krowwithus.krowwithus_staff + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/apps/mobile/apps/staff/android/app/src/main/res/drawable-v21/launch_background.xml b/apps/mobile/apps/staff/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 00000000..f74085f3 --- /dev/null +++ b/apps/mobile/apps/staff/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/apps/mobile/apps/staff/android/app/src/main/res/drawable/launch_background.xml b/apps/mobile/apps/staff/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 00000000..304732f8 --- /dev/null +++ b/apps/mobile/apps/staff/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/apps/mobile/apps/staff/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/apps/mobile/apps/staff/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..db77bb4b Binary files /dev/null and b/apps/mobile/apps/staff/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/staff/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/apps/mobile/apps/staff/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..17987b79 Binary files /dev/null and b/apps/mobile/apps/staff/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/staff/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/apps/mobile/apps/staff/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..09d43914 Binary files /dev/null and b/apps/mobile/apps/staff/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/staff/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/apps/mobile/apps/staff/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..d5f1c8d3 Binary files /dev/null and b/apps/mobile/apps/staff/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/staff/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/apps/mobile/apps/staff/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..4d6372ee Binary files /dev/null and b/apps/mobile/apps/staff/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/apps/mobile/apps/staff/android/app/src/main/res/values-night/styles.xml b/apps/mobile/apps/staff/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 00000000..06952be7 --- /dev/null +++ b/apps/mobile/apps/staff/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/apps/mobile/apps/staff/android/app/src/main/res/values/styles.xml b/apps/mobile/apps/staff/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..cb1ef880 --- /dev/null +++ b/apps/mobile/apps/staff/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/apps/mobile/apps/staff/android/app/src/profile/AndroidManifest.xml b/apps/mobile/apps/staff/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 00000000..399f6981 --- /dev/null +++ b/apps/mobile/apps/staff/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/apps/mobile/apps/staff/android/build.gradle.kts b/apps/mobile/apps/staff/android/build.gradle.kts new file mode 100644 index 00000000..dbee657b --- /dev/null +++ b/apps/mobile/apps/staff/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/apps/mobile/apps/staff/android/gradle.properties b/apps/mobile/apps/staff/android/gradle.properties new file mode 100644 index 00000000..fbee1d8c --- /dev/null +++ b/apps/mobile/apps/staff/android/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true diff --git a/apps/mobile/apps/staff/android/gradle/wrapper/gradle-wrapper.jar b/apps/mobile/apps/staff/android/gradle/wrapper/gradle-wrapper.jar new file mode 100755 index 00000000..13372aef Binary files /dev/null and b/apps/mobile/apps/staff/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/apps/mobile/apps/staff/android/gradle/wrapper/gradle-wrapper.properties b/apps/mobile/apps/staff/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..e4ef43fb --- /dev/null +++ b/apps/mobile/apps/staff/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip diff --git a/apps/mobile/apps/staff/android/gradlew b/apps/mobile/apps/staff/android/gradlew new file mode 100755 index 00000000..9d82f789 --- /dev/null +++ b/apps/mobile/apps/staff/android/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/apps/mobile/apps/staff/android/gradlew.bat b/apps/mobile/apps/staff/android/gradlew.bat new file mode 100755 index 00000000..aec99730 --- /dev/null +++ b/apps/mobile/apps/staff/android/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/apps/mobile/apps/staff/android/settings.gradle.kts b/apps/mobile/apps/staff/android/settings.gradle.kts new file mode 100644 index 00000000..e4e86fb6 --- /dev/null +++ b/apps/mobile/apps/staff/android/settings.gradle.kts @@ -0,0 +1,27 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.11.1" apply false + id("org.jetbrains.kotlin.android") version "2.2.20" apply false + id("com.google.gms.google-services") version "4.4.2" apply false +} + +include(":app") diff --git a/apps/mobile/apps/staff/ios/.gitignore b/apps/mobile/apps/staff/ios/.gitignore new file mode 100644 index 00000000..7a7f9873 --- /dev/null +++ b/apps/mobile/apps/staff/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/apps/mobile/apps/staff/ios/Flutter/AppFrameworkInfo.plist b/apps/mobile/apps/staff/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 00000000..1dc6cf76 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 13.0 + + diff --git a/apps/mobile/apps/staff/ios/Flutter/Debug.xcconfig b/apps/mobile/apps/staff/ios/Flutter/Debug.xcconfig new file mode 100644 index 00000000..ec97fc6f --- /dev/null +++ b/apps/mobile/apps/staff/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/apps/mobile/apps/staff/ios/Flutter/Release.xcconfig b/apps/mobile/apps/staff/ios/Flutter/Release.xcconfig new file mode 100644 index 00000000..c4855bfe --- /dev/null +++ b/apps/mobile/apps/staff/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/apps/mobile/apps/staff/ios/Flutter/ephemeral/flutter_lldb_helper.py b/apps/mobile/apps/staff/ios/Flutter/ephemeral/flutter_lldb_helper.py new file mode 100644 index 00000000..a88caf99 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Flutter/ephemeral/flutter_lldb_helper.py @@ -0,0 +1,32 @@ +# +# Generated file, do not edit. +# + +import lldb + +def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict): + """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages.""" + base = frame.register["x0"].GetValueAsAddress() + page_len = frame.register["x1"].GetValueAsUnsigned() + + # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the + # first page to see if handled it correctly. This makes diagnosing + # misconfiguration (e.g. missing breakpoint) easier. + data = bytearray(page_len) + data[0:8] = b'IHELPED!' + + error = lldb.SBError() + frame.GetThread().GetProcess().WriteMemory(base, data, error) + if not error.Success(): + print(f'Failed to write into {base}[+{page_len}]', error) + return + +def __lldb_init_module(debugger: lldb.SBDebugger, _): + target = debugger.GetDummyTarget() + # Caveat: must use BreakpointCreateByRegEx here and not + # BreakpointCreateByName. For some reasons callback function does not + # get carried over from dummy target for the later. + bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$") + bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__)) + bp.SetAutoContinue(True) + print("-- LLDB integration loaded --") diff --git a/apps/mobile/apps/staff/ios/Flutter/ephemeral/flutter_lldbinit b/apps/mobile/apps/staff/ios/Flutter/ephemeral/flutter_lldbinit new file mode 100644 index 00000000..e3ba6fbe --- /dev/null +++ b/apps/mobile/apps/staff/ios/Flutter/ephemeral/flutter_lldbinit @@ -0,0 +1,5 @@ +# +# Generated file, do not edit. +# + +command script import --relative-to-command-file flutter_lldb_helper.py diff --git a/apps/mobile/apps/staff/ios/Podfile b/apps/mobile/apps/staff/ios/Podfile new file mode 100644 index 00000000..620e46eb --- /dev/null +++ b/apps/mobile/apps/staff/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '13.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/apps/mobile/apps/staff/ios/Runner.xcodeproj/project.pbxproj b/apps/mobile/apps/staff/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..a377333e --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,616 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.krowwithus.staff; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.krowwithus.staff; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.krowwithus.staff; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.krowwithus.staff; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.krowwithus.staff; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.krowwithus.staff; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/apps/mobile/apps/staff/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/apps/mobile/apps/staff/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/apps/mobile/apps/staff/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile/apps/staff/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/apps/mobile/apps/staff/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/apps/mobile/apps/staff/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/apps/mobile/apps/staff/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/apps/mobile/apps/staff/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..e3773d42 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/staff/ios/Runner.xcworkspace/contents.xcworkspacedata b/apps/mobile/apps/staff/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/apps/mobile/apps/staff/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile/apps/staff/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/apps/mobile/apps/staff/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/apps/mobile/apps/staff/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/apps/mobile/apps/staff/ios/Runner/AppDelegate.swift b/apps/mobile/apps/staff/ios/Runner/AppDelegate.swift new file mode 100644 index 00000000..62666446 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Flutter +import UIKit + +@main +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d36b1fab --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 00000000..dc9ada47 Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 00000000..7353c41e Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 00000000..797d452e Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 00000000..6ed2d933 Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 00000000..4cd7b009 Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 00000000..fe730945 Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 00000000..321773cd Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 00000000..797d452e Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 00000000..502f463a Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 00000000..0ec30343 Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 00000000..0ec30343 Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 00000000..e9f5fea2 Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 00000000..84ac32ae Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 00000000..8953cba0 Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 00000000..0467bf12 Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..0bedcf2f --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/apps/mobile/apps/staff/ios/Runner/Base.lproj/LaunchScreen.storyboard b/apps/mobile/apps/staff/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f2e259c7 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/staff/ios/Runner/Base.lproj/Main.storyboard b/apps/mobile/apps/staff/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 00000000..f3c28516 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/staff/ios/Runner/GeneratedPluginRegistrant.h b/apps/mobile/apps/staff/ios/Runner/GeneratedPluginRegistrant.h new file mode 100644 index 00000000..7a890927 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner/GeneratedPluginRegistrant.h @@ -0,0 +1,19 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GeneratedPluginRegistrant_h +#define GeneratedPluginRegistrant_h + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface GeneratedPluginRegistrant : NSObject ++ (void)registerWithRegistry:(NSObject*)registry; +@end + +NS_ASSUME_NONNULL_END +#endif /* GeneratedPluginRegistrant_h */ diff --git a/apps/mobile/apps/staff/ios/Runner/GeneratedPluginRegistrant.m b/apps/mobile/apps/staff/ios/Runner/GeneratedPluginRegistrant.m new file mode 100644 index 00000000..bde6e93e --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner/GeneratedPluginRegistrant.m @@ -0,0 +1,42 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#import "GeneratedPluginRegistrant.h" + +#if __has_include() +#import +#else +@import firebase_app_check; +#endif + +#if __has_include() +#import +#else +@import firebase_auth; +#endif + +#if __has_include() +#import +#else +@import firebase_core; +#endif + +#if __has_include() +#import +#else +@import shared_preferences_foundation; +#endif + +@implementation GeneratedPluginRegistrant + ++ (void)registerWithRegistry:(NSObject*)registry { + [FLTFirebaseAppCheckPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseAppCheckPlugin"]]; + [FLTFirebaseAuthPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseAuthPlugin"]]; + [FLTFirebaseCorePlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTFirebaseCorePlugin"]]; + [SharedPreferencesPlugin registerWithRegistrar:[registry registrarForPlugin:@"SharedPreferencesPlugin"]]; +} + +@end diff --git a/apps/mobile/apps/staff/ios/Runner/Info.plist b/apps/mobile/apps/staff/ios/Runner/Info.plist new file mode 100644 index 00000000..73018413 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + krowwithus_staff + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + krowwithus_staff + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/apps/mobile/apps/staff/ios/Runner/Runner-Bridging-Header.h b/apps/mobile/apps/staff/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 00000000..308a2a56 --- /dev/null +++ b/apps/mobile/apps/staff/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/apps/mobile/apps/staff/ios/RunnerTests/RunnerTests.swift b/apps/mobile/apps/staff/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 00000000..86a7c3b1 --- /dev/null +++ b/apps/mobile/apps/staff/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/apps/mobile/apps/staff/lib/main.dart b/apps/mobile/apps/staff/lib/main.dart new file mode 100644 index 00000000..92770719 --- /dev/null +++ b/apps/mobile/apps/staff/lib/main.dart @@ -0,0 +1,64 @@ +import 'package:core_localization/core_localization.dart' as core_localization; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:staff_authentication/staff_authentication.dart' + as staff_authentication; +import 'package:staff_main/staff_main.dart' as staff_main; +import 'package:firebase_core/firebase_core.dart'; + +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + await Firebase.initializeApp(); + runApp(ModularApp(module: AppModule(), child: const AppWidget())); +} + +/// The main application module. +class AppModule extends Module { + @override + List get imports => [core_localization.LocalizationModule()]; + + @override + void routes(RouteManager r) { + // Set the initial route to the authentication module + r.module("/", module: staff_authentication.StaffAuthenticationModule()); + + r.module('/worker-main', module: staff_main.StaffMainModule()); + } +} + +class AppWidget extends StatelessWidget { + const AppWidget({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (BuildContext context) => + Modular.get() + ..add(const core_localization.LoadLocale()), + child: + BlocBuilder< + core_localization.LocaleBloc, + core_localization.LocaleState + >( + builder: (BuildContext context, core_localization.LocaleState state) { + return core_localization.TranslationProvider( + child: MaterialApp.router( + title: "KROW Staff", + theme: UiTheme.light, + routerConfig: Modular.routerConfig, + locale: state.locale, + supportedLocales: state.supportedLocales, + localizationsDelegates: const >[ + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], + )); + }, + ), + ); + } +} diff --git a/apps/mobile/apps/staff/linux/.gitignore b/apps/mobile/apps/staff/linux/.gitignore new file mode 100644 index 00000000..d3896c98 --- /dev/null +++ b/apps/mobile/apps/staff/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/apps/mobile/apps/staff/linux/CMakeLists.txt b/apps/mobile/apps/staff/linux/CMakeLists.txt new file mode 100644 index 00000000..b222a83e --- /dev/null +++ b/apps/mobile/apps/staff/linux/CMakeLists.txt @@ -0,0 +1,128 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "krow_staff") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID +set(APPLICATION_ID "com.example.krow_staff") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Load bundled libraries from the lib/ directory relative to the binary. +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Root filesystem for cross-building. +if(FLUTTER_TARGET_PLATFORM_SYSROOT) + set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() + +# Define build configuration options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Only the install-generated bundle's copy of the executable will launch +# correctly, since the resources must in the right relative locations. To avoid +# people trying to run the unbundled copy, put it in a subdirectory instead of +# the default top-level location. +set_target_properties(${BINARY_NAME} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" +) + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endforeach(bundled_library) + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/apps/mobile/apps/staff/linux/flutter/CMakeLists.txt b/apps/mobile/apps/staff/linux/flutter/CMakeLists.txt new file mode 100644 index 00000000..d5bd0164 --- /dev/null +++ b/apps/mobile/apps/staff/linux/flutter/CMakeLists.txt @@ -0,0 +1,88 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/apps/mobile/apps/staff/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux b/apps/mobile/apps/staff/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux new file mode 120000 index 00000000..d7e81bb9 --- /dev/null +++ b/apps/mobile/apps/staff/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux @@ -0,0 +1 @@ +/Users/achinthaisuru/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/ \ No newline at end of file diff --git a/apps/mobile/apps/staff/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux b/apps/mobile/apps/staff/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux new file mode 120000 index 00000000..6202480c --- /dev/null +++ b/apps/mobile/apps/staff/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux @@ -0,0 +1 @@ +/Users/achinthaisuru/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/ \ No newline at end of file diff --git a/apps/mobile/apps/staff/linux/flutter/generated_plugin_registrant.cc b/apps/mobile/apps/staff/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..e71a16d2 --- /dev/null +++ b/apps/mobile/apps/staff/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void fl_register_plugins(FlPluginRegistry* registry) { +} diff --git a/apps/mobile/apps/staff/linux/flutter/generated_plugin_registrant.h b/apps/mobile/apps/staff/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..e0f0a47b --- /dev/null +++ b/apps/mobile/apps/staff/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/apps/mobile/apps/staff/linux/flutter/generated_plugins.cmake b/apps/mobile/apps/staff/linux/flutter/generated_plugins.cmake new file mode 100644 index 00000000..2e1de87a --- /dev/null +++ b/apps/mobile/apps/staff/linux/flutter/generated_plugins.cmake @@ -0,0 +1,23 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/apps/mobile/apps/staff/linux/runner/CMakeLists.txt b/apps/mobile/apps/staff/linux/runner/CMakeLists.txt new file mode 100644 index 00000000..e97dabc7 --- /dev/null +++ b/apps/mobile/apps/staff/linux/runner/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the application ID. +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/apps/mobile/apps/staff/linux/runner/main.cc b/apps/mobile/apps/staff/linux/runner/main.cc new file mode 100644 index 00000000..e7c5c543 --- /dev/null +++ b/apps/mobile/apps/staff/linux/runner/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/apps/mobile/apps/staff/linux/runner/my_application.cc b/apps/mobile/apps/staff/linux/runner/my_application.cc new file mode 100644 index 00000000..d0bb4280 --- /dev/null +++ b/apps/mobile/apps/staff/linux/runner/my_application.cc @@ -0,0 +1,148 @@ +#include "my_application.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; + char** dart_entrypoint_arguments; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Called when first Flutter frame received. +static void first_frame_cb(MyApplication* self, FlView* view) { + gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); +} + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + + // Use a header bar when running in GNOME as this is the common style used + // by applications and is the setup most users will be using (e.g. Ubuntu + // desktop). + // If running on X and not using GNOME then just use a traditional title bar + // in case the window manager does more exotic layout, e.g. tiling. + // If running on Wayland assume the header bar will work (may need changing + // if future cases occur). + gboolean use_header_bar = TRUE; +#ifdef GDK_WINDOWING_X11 + GdkScreen* screen = gtk_window_get_screen(window); + if (GDK_IS_X11_SCREEN(screen)) { + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); + if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + use_header_bar = FALSE; + } + } +#endif + if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "krow_staff"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } else { + gtk_window_set_title(window, "krow_staff"); + } + + gtk_window_set_default_size(window, 1280, 720); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + fl_dart_project_set_dart_entrypoint_arguments( + project, self->dart_entrypoint_arguments); + + FlView* view = fl_view_new(project); + GdkRGBA background_color; + // Background defaults to black, override it here if necessary, e.g. #00000000 + // for transparent. + gdk_rgba_parse(&background_color, "#000000"); + fl_view_set_background_color(view, &background_color); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + // Show the window when Flutter renders. + // Requires the view to be realized so we can start rendering. + g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), + self); + gtk_widget_realize(GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +// Implements GApplication::local_command_line. +static gboolean my_application_local_command_line(GApplication* application, + gchar*** arguments, + int* exit_status) { + MyApplication* self = MY_APPLICATION(application); + // Strip out the first argument as it is the binary name. + self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); + + g_autoptr(GError) error = nullptr; + if (!g_application_register(application, nullptr, &error)) { + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; + } + + g_application_activate(application); + *exit_status = 0; + + return TRUE; +} + +// Implements GApplication::startup. +static void my_application_startup(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application startup. + + G_APPLICATION_CLASS(my_application_parent_class)->startup(application); +} + +// Implements GApplication::shutdown. +static void my_application_shutdown(GApplication* application) { + // MyApplication* self = MY_APPLICATION(object); + + // Perform any actions required at application shutdown. + + G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); +} + +// Implements GObject::dispose. +static void my_application_dispose(GObject* object) { + MyApplication* self = MY_APPLICATION(object); + g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); + G_OBJECT_CLASS(my_application_parent_class)->dispose(object); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; + G_APPLICATION_CLASS(klass)->local_command_line = + my_application_local_command_line; + G_APPLICATION_CLASS(klass)->startup = my_application_startup; + G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; + G_OBJECT_CLASS(klass)->dispose = my_application_dispose; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + // Set the program name to the application ID, which helps various systems + // like GTK and desktop environments map this running application to its + // corresponding .desktop file. This ensures better integration by allowing + // the application to be recognized beyond its binary name. + g_set_prgname(APPLICATION_ID); + + return MY_APPLICATION(g_object_new(my_application_get_type(), + "application-id", APPLICATION_ID, "flags", + G_APPLICATION_NON_UNIQUE, nullptr)); +} diff --git a/apps/mobile/apps/staff/linux/runner/my_application.h b/apps/mobile/apps/staff/linux/runner/my_application.h new file mode 100644 index 00000000..db16367a --- /dev/null +++ b/apps/mobile/apps/staff/linux/runner/my_application.h @@ -0,0 +1,21 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, + my_application, + MY, + APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/apps/mobile/apps/staff/macos/.gitignore b/apps/mobile/apps/staff/macos/.gitignore new file mode 100644 index 00000000..746adbb6 --- /dev/null +++ b/apps/mobile/apps/staff/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/apps/mobile/apps/staff/macos/Flutter/Flutter-Debug.xcconfig b/apps/mobile/apps/staff/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 00000000..4b81f9b2 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/apps/mobile/apps/staff/macos/Flutter/Flutter-Release.xcconfig b/apps/mobile/apps/staff/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 00000000..5caa9d15 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/apps/mobile/apps/staff/macos/Flutter/GeneratedPluginRegistrant.swift b/apps/mobile/apps/staff/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 00000000..8bd29968 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,18 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import firebase_app_check +import firebase_auth +import firebase_core +import shared_preferences_foundation + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FLTFirebaseAppCheckPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAppCheckPlugin")) + FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) + FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) +} diff --git a/apps/mobile/apps/staff/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/apps/mobile/apps/staff/macos/Flutter/ephemeral/Flutter-Generated.xcconfig new file mode 100644 index 00000000..b27990b2 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Flutter/ephemeral/Flutter-Generated.xcconfig @@ -0,0 +1,11 @@ +// This is a generated file; do not edit or check into version control. +FLUTTER_ROOT=/Users/achinthaisuru/Documents/flutter +FLUTTER_APPLICATION_PATH=/Users/achinthaisuru/Documents/Github/krow-workforce/apps/mobile/apps/staff +COCOAPODS_PARALLEL_CODE_SIGN=true +FLUTTER_BUILD_DIR=build +FLUTTER_BUILD_NAME=1.0.0 +FLUTTER_BUILD_NUMBER=1 +DART_OBFUSCATION=false +TRACK_WIDGET_CREATION=true +TREE_SHAKE_ICONS=false +PACKAGE_CONFIG=.dart_tool/package_config.json diff --git a/apps/mobile/apps/staff/macos/Flutter/ephemeral/flutter_export_environment.sh b/apps/mobile/apps/staff/macos/Flutter/ephemeral/flutter_export_environment.sh new file mode 100755 index 00000000..a90de9ca --- /dev/null +++ b/apps/mobile/apps/staff/macos/Flutter/ephemeral/flutter_export_environment.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# This is a generated file; do not edit or check into version control. +export "FLUTTER_ROOT=/Users/achinthaisuru/Documents/flutter" +export "FLUTTER_APPLICATION_PATH=/Users/achinthaisuru/Documents/Github/krow-workforce/apps/mobile/apps/staff" +export "COCOAPODS_PARALLEL_CODE_SIGN=true" +export "FLUTTER_BUILD_DIR=build" +export "FLUTTER_BUILD_NAME=1.0.0" +export "FLUTTER_BUILD_NUMBER=1" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=true" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/apps/mobile/apps/staff/macos/Podfile b/apps/mobile/apps/staff/macos/Podfile new file mode 100644 index 00000000..ff5ddb3b --- /dev/null +++ b/apps/mobile/apps/staff/macos/Podfile @@ -0,0 +1,42 @@ +platform :osx, '10.15' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/apps/mobile/apps/staff/macos/Podfile.lock b/apps/mobile/apps/staff/macos/Podfile.lock new file mode 100644 index 00000000..1385d0fb --- /dev/null +++ b/apps/mobile/apps/staff/macos/Podfile.lock @@ -0,0 +1,23 @@ +PODS: + - FlutterMacOS (1.0.0) + - shared_preferences_foundation (0.0.1): + - Flutter + - FlutterMacOS + +DEPENDENCIES: + - FlutterMacOS (from `Flutter/ephemeral`) + - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) + +EXTERNAL SOURCES: + FlutterMacOS: + :path: Flutter/ephemeral + shared_preferences_foundation: + :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin + +SPEC CHECKSUMS: + FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 + shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb + +PODFILE CHECKSUM: 54d867c82ac51cbd61b565781b9fada492027009 + +COCOAPODS: 1.16.2 diff --git a/apps/mobile/apps/staff/macos/Runner.xcodeproj/project.pbxproj b/apps/mobile/apps/staff/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..7b0274bc --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,801 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 412DA1D6D757DD2D1DEDC778 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 069E89A5AB8E920696C344DA /* Pods_RunnerTests.framework */; }; + F61791A921ED082C9512CA02 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8AEFAD6205BEEBA5D907529 /* Pods_Runner.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 060EC3AF3A2AB752545F2191 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 069E89A5AB8E920696C344DA /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 15C63A664E0150CA184E03A8 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* krow_staff.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = krow_staff.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 6D300BB405A262BD11BC8E17 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + C1453B9ED71BA9085495FCB6 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + C24103C2702CAEE0091BFC73 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + D8AEFAD6205BEEBA5D907529 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E11FE7E42C3C39C49F50BEB5 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 412DA1D6D757DD2D1DEDC778 /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F61791A921ED082C9512CA02 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + 6ABA80E4B64F392061994EFD /* Pods */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* krow_staff.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + 6ABA80E4B64F392061994EFD /* Pods */ = { + isa = PBXGroup; + children = ( + 6D300BB405A262BD11BC8E17 /* Pods-Runner.debug.xcconfig */, + E11FE7E42C3C39C49F50BEB5 /* Pods-Runner.release.xcconfig */, + 060EC3AF3A2AB752545F2191 /* Pods-Runner.profile.xcconfig */, + 15C63A664E0150CA184E03A8 /* Pods-RunnerTests.debug.xcconfig */, + C24103C2702CAEE0091BFC73 /* Pods-RunnerTests.release.xcconfig */, + C1453B9ED71BA9085495FCB6 /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + D8AEFAD6205BEEBA5D907529 /* Pods_Runner.framework */, + 069E89A5AB8E920696C344DA /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + B5C2C461D64A106CDA5480B9 /* [CP] Check Pods Manifest.lock */, + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 4EAF5AFAFCC94D6A860EEA53 /* [CP] Check Pods Manifest.lock */, + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + 03022428CF28990CD27A7DBC /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* krow_staff.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 03022428CF28990CD27A7DBC /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; + 4EAF5AFAFCC94D6A860EEA53 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + B5C2C461D64A106CDA5480B9 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 15C63A664E0150CA184E03A8 /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowStaff.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/krow_staff.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/krow_staff"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C24103C2702CAEE0091BFC73 /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowStaff.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/krow_staff.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/krow_staff"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C1453B9ED71BA9085495FCB6 /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.krowStaff.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/krow_staff.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/krow_staff"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/apps/mobile/apps/staff/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile/apps/staff/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/apps/mobile/apps/staff/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/apps/mobile/apps/staff/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..23783d1d --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/staff/macos/Runner.xcworkspace/contents.xcworkspacedata b/apps/mobile/apps/staff/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..21a3cc14 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/apps/mobile/apps/staff/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile/apps/staff/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/apps/mobile/apps/staff/macos/Runner/AppDelegate.swift b/apps/mobile/apps/staff/macos/Runner/AppDelegate.swift new file mode 100644 index 00000000..b3c17614 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import Cocoa +import FlutterMacOS + +@main +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } +} diff --git a/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..a2ec33f1 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 00000000..82b6f9d9 Binary files /dev/null and b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 00000000..13b35eba Binary files /dev/null and b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 00000000..0a3f5fa4 Binary files /dev/null and b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 00000000..bdb57226 Binary files /dev/null and b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 00000000..f083318e Binary files /dev/null and b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 00000000..326c0e72 Binary files /dev/null and b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 00000000..2f1632cf Binary files /dev/null and b/apps/mobile/apps/staff/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/apps/mobile/apps/staff/macos/Runner/Base.lproj/MainMenu.xib b/apps/mobile/apps/staff/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 00000000..80e867a4 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/mobile/apps/staff/macos/Runner/Configs/AppInfo.xcconfig b/apps/mobile/apps/staff/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 00000000..721d6ca0 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = krow_staff + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.example.krowStaff + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright Β© 2026 com.example. All rights reserved. diff --git a/apps/mobile/apps/staff/macos/Runner/Configs/Debug.xcconfig b/apps/mobile/apps/staff/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 00000000..36b0fd94 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/apps/mobile/apps/staff/macos/Runner/Configs/Release.xcconfig b/apps/mobile/apps/staff/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 00000000..dff4f495 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/apps/mobile/apps/staff/macos/Runner/Configs/Warnings.xcconfig b/apps/mobile/apps/staff/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 00000000..42bcbf47 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/apps/mobile/apps/staff/macos/Runner/DebugProfile.entitlements b/apps/mobile/apps/staff/macos/Runner/DebugProfile.entitlements new file mode 100644 index 00000000..dddb8a30 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/apps/mobile/apps/staff/macos/Runner/Info.plist b/apps/mobile/apps/staff/macos/Runner/Info.plist new file mode 100644 index 00000000..4789daa6 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/apps/mobile/apps/staff/macos/Runner/MainFlutterWindow.swift b/apps/mobile/apps/staff/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 00000000..3cc05eb2 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/apps/mobile/apps/staff/macos/Runner/Release.entitlements b/apps/mobile/apps/staff/macos/Runner/Release.entitlements new file mode 100644 index 00000000..852fa1a4 --- /dev/null +++ b/apps/mobile/apps/staff/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/apps/mobile/apps/staff/macos/RunnerTests/RunnerTests.swift b/apps/mobile/apps/staff/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 00000000..61f3bd1f --- /dev/null +++ b/apps/mobile/apps/staff/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Cocoa +import FlutterMacOS +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/apps/mobile/apps/staff/pubspec.yaml b/apps/mobile/apps/staff/pubspec.yaml new file mode 100644 index 00000000..4a968d93 --- /dev/null +++ b/apps/mobile/apps/staff/pubspec.yaml @@ -0,0 +1,34 @@ +name: krowwithus_staff +description: "Krow Staff Application" +publish_to: 'none' +version: 1.0.0+1 +resolution: workspace + +environment: + sdk: ^3.10.7 +dependencies: + flutter: + sdk: flutter + flutter_localizations: + sdk: flutter + cupertino_icons: ^1.0.8 + flutter_modular: ^6.3.0 + + # Architecture Packages + design_system: + path: ../../packages/design_system + core_localization: + path: ../../packages/core_localization + + # Feature Packages + staff_authentication: + path: ../../packages/features/staff/authentication + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + rename: ^3.1.0 + +flutter: + uses-material-design: true diff --git a/apps/mobile/apps/staff/test/widget_test.dart b/apps/mobile/apps/staff/test/widget_test.dart new file mode 100644 index 00000000..1e60e4a3 --- /dev/null +++ b/apps/mobile/apps/staff/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:staff/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/apps/mobile/apps/staff/web/favicon.png b/apps/mobile/apps/staff/web/favicon.png new file mode 100644 index 00000000..8aaa46ac Binary files /dev/null and b/apps/mobile/apps/staff/web/favicon.png differ diff --git a/apps/mobile/apps/staff/web/icons/Icon-192.png b/apps/mobile/apps/staff/web/icons/Icon-192.png new file mode 100644 index 00000000..b749bfef Binary files /dev/null and b/apps/mobile/apps/staff/web/icons/Icon-192.png differ diff --git a/apps/mobile/apps/staff/web/icons/Icon-512.png b/apps/mobile/apps/staff/web/icons/Icon-512.png new file mode 100644 index 00000000..88cfd48d Binary files /dev/null and b/apps/mobile/apps/staff/web/icons/Icon-512.png differ diff --git a/apps/mobile/apps/staff/web/icons/Icon-maskable-192.png b/apps/mobile/apps/staff/web/icons/Icon-maskable-192.png new file mode 100644 index 00000000..eb9b4d76 Binary files /dev/null and b/apps/mobile/apps/staff/web/icons/Icon-maskable-192.png differ diff --git a/apps/mobile/apps/staff/web/icons/Icon-maskable-512.png b/apps/mobile/apps/staff/web/icons/Icon-maskable-512.png new file mode 100644 index 00000000..d69c5669 Binary files /dev/null and b/apps/mobile/apps/staff/web/icons/Icon-maskable-512.png differ diff --git a/apps/mobile/apps/staff/web/index.html b/apps/mobile/apps/staff/web/index.html new file mode 100644 index 00000000..e03e65a3 --- /dev/null +++ b/apps/mobile/apps/staff/web/index.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + krow_staff + + + + + + diff --git a/apps/mobile/apps/staff/web/manifest.json b/apps/mobile/apps/staff/web/manifest.json new file mode 100644 index 00000000..39e502ff --- /dev/null +++ b/apps/mobile/apps/staff/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "krow_staff", + "short_name": "krow_staff", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/apps/mobile/apps/staff/windows/.gitignore b/apps/mobile/apps/staff/windows/.gitignore new file mode 100644 index 00000000..d492d0d9 --- /dev/null +++ b/apps/mobile/apps/staff/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ephemeral/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/apps/mobile/apps/staff/windows/CMakeLists.txt b/apps/mobile/apps/staff/windows/CMakeLists.txt new file mode 100644 index 00000000..95f1489e --- /dev/null +++ b/apps/mobile/apps/staff/windows/CMakeLists.txt @@ -0,0 +1,108 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(krow_staff LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "krow_staff") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(VERSION 3.14...3.25) + +# Define build configuration option. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() +# Define settings for the Profile build mode. +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/apps/mobile/apps/staff/windows/flutter/CMakeLists.txt b/apps/mobile/apps/staff/windows/flutter/CMakeLists.txt new file mode 100644 index 00000000..903f4899 --- /dev/null +++ b/apps/mobile/apps/staff/windows/flutter/CMakeLists.txt @@ -0,0 +1,109 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + ${FLUTTER_TARGET_PLATFORM} $ + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/apps/mobile/apps/staff/windows/flutter/ephemeral/.plugin_symlinks/firebase_auth b/apps/mobile/apps/staff/windows/flutter/ephemeral/.plugin_symlinks/firebase_auth new file mode 120000 index 00000000..a05ca7fe --- /dev/null +++ b/apps/mobile/apps/staff/windows/flutter/ephemeral/.plugin_symlinks/firebase_auth @@ -0,0 +1 @@ +/Users/achinthaisuru/.pub-cache/hosted/pub.dev/firebase_auth-6.1.4/ \ No newline at end of file diff --git a/apps/mobile/apps/staff/windows/flutter/ephemeral/.plugin_symlinks/firebase_core b/apps/mobile/apps/staff/windows/flutter/ephemeral/.plugin_symlinks/firebase_core new file mode 120000 index 00000000..1d268465 --- /dev/null +++ b/apps/mobile/apps/staff/windows/flutter/ephemeral/.plugin_symlinks/firebase_core @@ -0,0 +1 @@ +/Users/achinthaisuru/.pub-cache/hosted/pub.dev/firebase_core-4.4.0/ \ No newline at end of file diff --git a/apps/mobile/apps/staff/windows/flutter/ephemeral/.plugin_symlinks/path_provider_windows b/apps/mobile/apps/staff/windows/flutter/ephemeral/.plugin_symlinks/path_provider_windows new file mode 120000 index 00000000..2316cfff --- /dev/null +++ b/apps/mobile/apps/staff/windows/flutter/ephemeral/.plugin_symlinks/path_provider_windows @@ -0,0 +1 @@ +/Users/achinthaisuru/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/ \ No newline at end of file diff --git a/apps/mobile/apps/staff/windows/flutter/ephemeral/.plugin_symlinks/shared_preferences_windows b/apps/mobile/apps/staff/windows/flutter/ephemeral/.plugin_symlinks/shared_preferences_windows new file mode 120000 index 00000000..d567e409 --- /dev/null +++ b/apps/mobile/apps/staff/windows/flutter/ephemeral/.plugin_symlinks/shared_preferences_windows @@ -0,0 +1 @@ +/Users/achinthaisuru/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/ \ No newline at end of file diff --git a/apps/mobile/apps/staff/windows/flutter/generated_plugin_registrant.cc b/apps/mobile/apps/staff/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 00000000..d141b74f --- /dev/null +++ b/apps/mobile/apps/staff/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,17 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include +#include + +void RegisterPlugins(flutter::PluginRegistry* registry) { + FirebaseAuthPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi")); + FirebaseCorePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); +} diff --git a/apps/mobile/apps/staff/windows/flutter/generated_plugin_registrant.h b/apps/mobile/apps/staff/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 00000000..dc139d85 --- /dev/null +++ b/apps/mobile/apps/staff/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/apps/mobile/apps/staff/windows/flutter/generated_plugins.cmake b/apps/mobile/apps/staff/windows/flutter/generated_plugins.cmake new file mode 100644 index 00000000..29944d5b --- /dev/null +++ b/apps/mobile/apps/staff/windows/flutter/generated_plugins.cmake @@ -0,0 +1,25 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + firebase_auth + firebase_core +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/apps/mobile/apps/staff/windows/runner/CMakeLists.txt b/apps/mobile/apps/staff/windows/runner/CMakeLists.txt new file mode 100644 index 00000000..394917c0 --- /dev/null +++ b/apps/mobile/apps/staff/windows/runner/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.14) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/apps/mobile/apps/staff/windows/runner/Runner.rc b/apps/mobile/apps/staff/windows/runner/Runner.rc new file mode 100644 index 00000000..1338842e --- /dev/null +++ b/apps/mobile/apps/staff/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// Microsoft Visual C++ generated resource script. +// +#pragma code_page(65001) +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APP_ICON ICON "resources\\app_icon.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD +#else +#define VERSION_AS_NUMBER 1,0,0,0 +#endif + +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION +#else +#define VERSION_AS_STRING "1.0.0" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VERSION_AS_NUMBER + PRODUCTVERSION VERSION_AS_NUMBER + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "com.example" "\0" + VALUE "FileDescription", "krow_staff" "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "krow_staff" "\0" + VALUE "LegalCopyright", "Copyright (C) 2026 com.example. All rights reserved." "\0" + VALUE "OriginalFilename", "krow_staff.exe" "\0" + VALUE "ProductName", "krow_staff" "\0" + VALUE "ProductVersion", VERSION_AS_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/apps/mobile/apps/staff/windows/runner/flutter_window.cpp b/apps/mobile/apps/staff/windows/runner/flutter_window.cpp new file mode 100644 index 00000000..955ee303 --- /dev/null +++ b/apps/mobile/apps/staff/windows/runner/flutter_window.cpp @@ -0,0 +1,71 @@ +#include "flutter_window.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(const flutter::DartProject& project) + : project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + + // Flutter can complete the first frame before the "show window" callback is + // registered. The following call ensures a frame is pending to ensure the + // window is shown. It is a no-op if the first frame hasn't completed yet. + flutter_controller_->ForceRedraw(); + + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opportunity to handle window messages. + if (flutter_controller_) { + std::optional result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/apps/mobile/apps/staff/windows/runner/flutter_window.h b/apps/mobile/apps/staff/windows/runner/flutter_window.h new file mode 100644 index 00000000..6da0652f --- /dev/null +++ b/apps/mobile/apps/staff/windows/runner/flutter_window.h @@ -0,0 +1,33 @@ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include +#include + +#include + +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow hosting a Flutter view running |project|. + explicit FlutterWindow(const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/apps/mobile/apps/staff/windows/runner/main.cpp b/apps/mobile/apps/staff/windows/runner/main.cpp new file mode 100644 index 00000000..330b294b --- /dev/null +++ b/apps/mobile/apps/staff/windows/runner/main.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#include "flutter_window.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + flutter::DartProject project(L"data"); + + std::vector command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.Create(L"krow_staff", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + ::MSG msg; + while (::GetMessage(&msg, nullptr, 0, 0)) { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/apps/mobile/apps/staff/windows/runner/resource.h b/apps/mobile/apps/staff/windows/runner/resource.h new file mode 100644 index 00000000..66a65d1e --- /dev/null +++ b/apps/mobile/apps/staff/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/apps/mobile/apps/staff/windows/runner/resources/app_icon.ico b/apps/mobile/apps/staff/windows/runner/resources/app_icon.ico new file mode 100644 index 00000000..c04e20ca Binary files /dev/null and b/apps/mobile/apps/staff/windows/runner/resources/app_icon.ico differ diff --git a/apps/mobile/apps/staff/windows/runner/runner.exe.manifest b/apps/mobile/apps/staff/windows/runner/runner.exe.manifest new file mode 100644 index 00000000..153653e8 --- /dev/null +++ b/apps/mobile/apps/staff/windows/runner/runner.exe.manifest @@ -0,0 +1,14 @@ + + + + + PerMonitorV2 + + + + + + + + + diff --git a/apps/mobile/apps/staff/windows/runner/utils.cpp b/apps/mobile/apps/staff/windows/runner/utils.cpp new file mode 100644 index 00000000..3a0b4651 --- /dev/null +++ b/apps/mobile/apps/staff/windows/runner/utils.cpp @@ -0,0 +1,65 @@ +#include "utils.h" + +#include +#include +#include +#include + +#include + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector(); + } + + std::vector command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + unsigned int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr) + -1; // remove the trailing null character + int input_length = (int)wcslen(utf16_string); + std::string utf8_string; + if (target_length == 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + input_length, utf8_string.data(), target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/apps/mobile/apps/staff/windows/runner/utils.h b/apps/mobile/apps/staff/windows/runner/utils.h new file mode 100644 index 00000000..3879d547 --- /dev/null +++ b/apps/mobile/apps/staff/windows/runner/utils.h @@ -0,0 +1,19 @@ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include +#include + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector, +// encoded in UTF-8. Returns an empty std::vector on failure. +std::vector GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/apps/mobile/apps/staff/windows/runner/win32_window.cpp b/apps/mobile/apps/staff/windows/runner/win32_window.cpp new file mode 100644 index 00000000..60608d0f --- /dev/null +++ b/apps/mobile/apps/staff/windows/runner/win32_window.cpp @@ -0,0 +1,288 @@ +#include "win32_window.h" + +#include +#include + +#include "resource.h" + +namespace { + +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + } + FreeLibrary(user32_module); +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registrar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast(origin.x), + static_cast(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + UpdateTheme(window); + + return OnCreate(); +} + +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast(window_struct->lpCreateParams)); + + auto that = static_cast(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/apps/mobile/apps/staff/windows/runner/win32_window.h b/apps/mobile/apps/staff/windows/runner/win32_window.h new file mode 100644 index 00000000..e901dde6 --- /dev/null +++ b/apps/mobile/apps/staff/windows/runner/win32_window.h @@ -0,0 +1,102 @@ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include + +#include +#include +#include + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates a win32 window with |title| that is positioned and sized using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_ diff --git a/apps/mobile/melos.yaml b/apps/mobile/melos.yaml new file mode 100644 index 00000000..ae2cce43 --- /dev/null +++ b/apps/mobile/melos.yaml @@ -0,0 +1,80 @@ +name: krow_workspace + +packages: + - apps/** + - packages/** + +command: + bootstrap: + usePubspecOverrides: true + +scripts: + info: + run: | + echo " πŸš€ KROW WORKFORCE CUSTOM COMMANDS πŸš€" + echo "============================================================" + echo " BUILD COMMANDS:" + echo " - melos run build:client : Build Client App (APK)" + echo " - melos run build:staff : Build Staff App (APK)" + echo " - melos run build:design-system : Build Design System Viewer" + echo "" + echo " DEBUG/START COMMANDS:" + echo " - melos run start:client -- -d : Run Client App" + echo " - melos run start:staff -- -d : Run Staff App" + echo " - melos run start:design-system : Run DS Viewer" + echo " (e.g., melos run start:client -- -d chrome)" + echo "" + echo " CODE GENERATION:" + echo " - melos run gen:l10n : Generate Slang l10n" + echo " - melos run gen:build : Run build_runner" + echo " - melos run gen:all : Run l10n and build_runner" + echo "============================================================" + description: "Display information about available custom Melos commands." + + gen:all: + run: | + melos run gen:l10n + melos run gen:build + description: "Run both localization and build_runner generation across all packages." + + gen:l10n: + exec: dart run slang + description: "Generate localization files using Slang across all packages." + packageFilters: + dependsOn: slang + + gen:build: + exec: dart run build_runner build --delete-conflicting-outputs + description: "Run build_runner build across all packages." + packageFilters: + dependsOn: build_runner + + build:client: + run: | + melos run gen:l10n --filter="core_localization" + melos run gen:build --filter="core_localization" + melos exec --scope="krowwithus_client" -- "flutter build apk" + description: "Build the Client app (Android APK by default)." + + build:staff: + run: | + melos run gen:l10n --filter="core_localization" + melos run gen:build --filter="core_localization" + melos exec --scope="krowwithus_staff" -- "flutter build apk" + description: "Build the Staff app (Android APK by default)." + + build:design-system-viewer: + run: melos exec --scope="design_system_viewer" -- "flutter build apk" + description: "Build the Design System Viewer app (Android APK by default)." + + start:client: + run: melos exec --scope="krowwithus_client" -- "flutter run" + description: "Start the Client app. Pass platform using -- -d , e.g. -d chrome" + + start:staff: + run: melos exec --scope="krowwithus_staff" -- "flutter run" + description: "Start the Staff app. Pass platform using -- -d , e.g. -d chrome" + + start:design-system-viewer: + run: melos exec --scope="design_system_viewer" -- "flutter run" + description: "Start the Design System Viewer app. Pass platform using -- -d , e.g. -d chrome" diff --git a/apps/mobile/packages/core/lib/core.dart b/apps/mobile/packages/core/lib/core.dart new file mode 100644 index 00000000..f46af624 --- /dev/null +++ b/apps/mobile/packages/core/lib/core.dart @@ -0,0 +1,4 @@ +library core; + +export 'src/domain/arguments/usecase_argument.dart'; +export 'src/domain/usecases/usecase.dart'; diff --git a/apps/mobile/packages/core/lib/src/domain/arguments/usecase_argument.dart b/apps/mobile/packages/core/lib/src/domain/arguments/usecase_argument.dart new file mode 100644 index 00000000..aba3af53 --- /dev/null +++ b/apps/mobile/packages/core/lib/src/domain/arguments/usecase_argument.dart @@ -0,0 +1,12 @@ +import 'package:equatable/equatable.dart'; + +/// Abstract base class for all use case arguments. +/// +/// Use case arguments are data transfer objects (DTOs) used to pass data +/// into a use case. They must extend [Equatable] to ensure value equality. +abstract class UseCaseArgument extends Equatable { + const UseCaseArgument(); + + @override + List get props => []; +} diff --git a/apps/mobile/packages/core/lib/src/domain/usecases/usecase.dart b/apps/mobile/packages/core/lib/src/domain/usecases/usecase.dart new file mode 100644 index 00000000..ddc33eba --- /dev/null +++ b/apps/mobile/packages/core/lib/src/domain/usecases/usecase.dart @@ -0,0 +1,25 @@ +/// Abstract base class for all use cases in the application. +/// +/// Use cases encapsulate application-specific business rules and orchestrate +/// the flow of data to and from the entities. They are typically invoked +/// from the presentation layer (e.g., BLoCs, ViewModels) and interact with +/// repositories from the data layer. +/// +/// [Input] represents the type of data passed into the use case. +/// [Output] represents the type of data returned by the use case. +abstract class UseCase { + /// Executes the use case with the given [input]. + /// + /// This method should contain the core business logic of the use case. + Future call(Input input); +} + +/// Abstract base class for use cases that do not require any input. +/// +/// [Output] represents the type of data returned by the use case. +abstract class NoInputUseCase { + /// Executes the use case. + /// + /// This method should contain the core business logic of the use case. + Future call(); +} diff --git a/apps/mobile/packages/core/pubspec.yaml b/apps/mobile/packages/core/pubspec.yaml new file mode 100644 index 00000000..1b14ddda --- /dev/null +++ b/apps/mobile/packages/core/pubspec.yaml @@ -0,0 +1,13 @@ +name: krow_core +description: Core utilities and shared logic. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter diff --git a/apps/mobile/packages/core_localization/.gitignore b/apps/mobile/packages/core_localization/.gitignore new file mode 100644 index 00000000..dd5eb989 --- /dev/null +++ b/apps/mobile/packages/core_localization/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.flutter-plugins-dependencies +/build/ +/coverage/ diff --git a/apps/mobile/packages/core_localization/.metadata b/apps/mobile/packages/core_localization/.metadata new file mode 100644 index 00000000..685c30f1 --- /dev/null +++ b/apps/mobile/packages/core_localization/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "3b62efc2a3da49882f43c372e0bc53daef7295a6" + channel: "stable" + +project_type: package diff --git a/apps/mobile/packages/core_localization/analysis_options.yaml b/apps/mobile/packages/core_localization/analysis_options.yaml new file mode 100644 index 00000000..f04c6cf0 --- /dev/null +++ b/apps/mobile/packages/core_localization/analysis_options.yaml @@ -0,0 +1 @@ +include: ../../analysis_options.yaml diff --git a/apps/mobile/packages/core_localization/lib/core_localization.dart b/apps/mobile/packages/core_localization/lib/core_localization.dart new file mode 100644 index 00000000..8c8c71fc --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/core_localization.dart @@ -0,0 +1,10 @@ +export 'src/bloc/locale_bloc.dart'; +export 'src/bloc/locale_event.dart'; +export 'src/bloc/locale_state.dart'; +export 'src/l10n/strings.g.dart'; +export 'src/domain/repositories/locale_repository_interface.dart'; +export 'src/domain/usecases/get_locale_use_case.dart'; +export 'src/domain/usecases/set_locale_use_case.dart'; +export 'src/data/repositories_impl/locale_repository_impl.dart'; +export 'src/data/datasources/locale_local_data_source.dart'; +export 'src/localization_module.dart'; diff --git a/apps/mobile/packages/core_localization/lib/src/bloc/locale_bloc.dart b/apps/mobile/packages/core_localization/lib/src/bloc/locale_bloc.dart new file mode 100644 index 00000000..5ae60907 --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/src/bloc/locale_bloc.dart @@ -0,0 +1,56 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../domain/usecases/get_locale_use_case.dart'; +import '../domain/usecases/set_locale_use_case.dart'; +import '../l10n/strings.g.dart'; +import 'locale_event.dart'; +import 'locale_state.dart'; + +/// A [Bloc] that manages the application's locale state. +/// +/// It coordinates the flow between user language requests and persistent storage +/// using [SetLocaleUseCase] and [GetLocaleUseCase]. +class LocaleBloc extends Bloc { + final GetLocaleUseCase getLocaleUseCase; + final SetLocaleUseCase setLocaleUseCase; + + /// Creates a [LocaleBloc] with the required use cases. + LocaleBloc({required this.getLocaleUseCase, required this.setLocaleUseCase}) + : super(LocaleState.initial()) { + on(_onChangeLocale); + on(_onLoadLocale); + } + + /// Handles the [ChangeLocale] event by saving it via the use case and emitting new state. + Future _onChangeLocale( + ChangeLocale event, + Emitter emit, + ) async { + // 1. Update slang settings + LocaleSettings.setLocaleRaw(event.locale.languageCode); + + // 2. Persist using Use Case + await setLocaleUseCase(event.locale); + + // 3. Emit new state + emit( + LocaleState( + locale: event.locale, + supportedLocales: state.supportedLocales, + ), + ); + } + + /// Handles the [LoadLocale] event by retrieving it via the use case and updating settings. + Future _onLoadLocale( + LoadLocale event, + Emitter emit, + ) async { + final Locale? savedLocale = await getLocaleUseCase(); + final Locale locale = const Locale('es'); + + LocaleSettings.setLocaleRaw(locale.languageCode); + + emit(LocaleState(locale: locale, supportedLocales: state.supportedLocales)); + } +} diff --git a/apps/mobile/packages/core_localization/lib/src/bloc/locale_event.dart b/apps/mobile/packages/core_localization/lib/src/bloc/locale_event.dart new file mode 100644 index 00000000..52a57fbc --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/src/bloc/locale_event.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; + +/// Base class for all locale-related events. +sealed class LocaleEvent { + /// Creates a [LocaleEvent]. + const LocaleEvent(); +} + +/// Event triggered when the user wants to change the application locale. +class ChangeLocale extends LocaleEvent { + /// The new locale to apply. + final Locale locale; + + /// Creates a [ChangeLocale] event. + const ChangeLocale(this.locale); +} + +/// Event triggered to load the saved locale from persistent storage. +class LoadLocale extends LocaleEvent { + /// Creates a [LoadLocale] event. + const LoadLocale(); +} diff --git a/apps/mobile/packages/core_localization/lib/src/bloc/locale_state.dart b/apps/mobile/packages/core_localization/lib/src/bloc/locale_state.dart new file mode 100644 index 00000000..33219cd1 --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/src/bloc/locale_state.dart @@ -0,0 +1,20 @@ +import 'package:flutter/material.dart'; +import '../l10n/strings.g.dart'; + +/// Represents the current state of the application's localization. +class LocaleState { + /// The current active locale. + final Locale locale; + + /// The list of supported locales for the application. + final List supportedLocales; + + /// Creates a [LocaleState] with the specified [locale]. + const LocaleState({required this.locale, required this.supportedLocales}); + + /// The initial state of the application, defaulting to English. + factory LocaleState.initial() => LocaleState( + locale: const Locale('es'), + supportedLocales: AppLocaleUtils.supportedLocales, + ); +} diff --git a/apps/mobile/packages/core_localization/lib/src/data/datasources/locale_local_data_source.dart b/apps/mobile/packages/core_localization/lib/src/data/datasources/locale_local_data_source.dart new file mode 100644 index 00000000..f036b915 --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/src/data/datasources/locale_local_data_source.dart @@ -0,0 +1,29 @@ +import 'package:shared_preferences/shared_preferences.dart'; + +/// Interface for the local data source that manages locale persistence. +abstract interface class LocaleLocalDataSource { + /// Saves the language code to local storage. + Future saveLanguageCode(String languageCode); + + /// Retrieves the saved language code from local storage. + Future getLanguageCode(); +} + +/// Implementation of [LocaleLocalDataSource] using [SharedPreferencesAsync]. +class LocaleLocalDataSourceImpl implements LocaleLocalDataSource { + static const String _localeKey = 'app_locale'; + final SharedPreferencesAsync _sharedPreferences; + + /// Creates a [LocaleLocalDataSourceImpl] with the required [SharedPreferencesAsync] instance. + LocaleLocalDataSourceImpl(this._sharedPreferences); + + @override + Future saveLanguageCode(String languageCode) async { + await _sharedPreferences.setString(_localeKey, languageCode); + } + + @override + Future getLanguageCode() async { + return _sharedPreferences.getString(_localeKey); + } +} diff --git a/apps/mobile/packages/core_localization/lib/src/data/repositories_impl/locale_repository_impl.dart b/apps/mobile/packages/core_localization/lib/src/data/repositories_impl/locale_repository_impl.dart new file mode 100644 index 00000000..ddda18cb --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/src/data/repositories_impl/locale_repository_impl.dart @@ -0,0 +1,28 @@ +import 'dart:ui'; +import '../../domain/repositories/locale_repository_interface.dart'; +import '../datasources/locale_local_data_source.dart'; + +/// Implementation of [LocaleRepositoryInterface] that coordinates with a local data source. +/// +/// This class handles the mapping between domain [Locale] objects and the raw +/// strings handled by the [LocaleLocalDataSource]. +class LocaleRepositoryImpl implements LocaleRepositoryInterface { + final LocaleLocalDataSource _localDataSource; + + /// Creates a [LocaleRepositoryImpl] with the provided [_localDataSource]. + LocaleRepositoryImpl(this._localDataSource); + + @override + Future saveLocale(Locale locale) { + return _localDataSource.saveLanguageCode(locale.languageCode); + } + + @override + Future getSavedLocale() async { + final String? languageCode = await _localDataSource.getLanguageCode(); + if (languageCode != null) { + return Locale(languageCode); + } + return null; + } +} diff --git a/apps/mobile/packages/core_localization/lib/src/domain/repositories/locale_repository_interface.dart b/apps/mobile/packages/core_localization/lib/src/domain/repositories/locale_repository_interface.dart new file mode 100644 index 00000000..604c2d41 --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/src/domain/repositories/locale_repository_interface.dart @@ -0,0 +1,17 @@ +import 'dart:ui'; + +/// Interface for the locale repository. +/// +/// This defines the contracts for persisting and retrieving the application's locale. +/// Implementations of this interface should handle the details of the storage mechanism. +abstract interface class LocaleRepositoryInterface { + /// Saves the specified [locale] to persistent storage. + /// + /// Throws a [RepositoryException] if the operation fails. + Future saveLocale(Locale locale); + + /// Retrieves the saved [locale] from persistent storage. + /// + /// Returns `null` if no locale has been previously saved. + Future getSavedLocale(); +} diff --git a/apps/mobile/packages/core_localization/lib/src/domain/usecases/get_locale_use_case.dart b/apps/mobile/packages/core_localization/lib/src/domain/usecases/get_locale_use_case.dart new file mode 100644 index 00000000..8d29876e --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/src/domain/usecases/get_locale_use_case.dart @@ -0,0 +1,19 @@ +import 'dart:ui'; +import 'package:krow_core/core.dart'; +import '../repositories/locale_repository_interface.dart'; + +/// Use case to retrieve the persisted application locale. +/// +/// This class extends [NoInputUseCase] and interacts with [LocaleRepositoryInterface] +/// to fetch the saved locale. +class GetLocaleUseCase extends NoInputUseCase { + final LocaleRepositoryInterface _repository; + + /// Creates a [GetLocaleUseCase] with the required [LocaleRepositoryInterface]. + GetLocaleUseCase(this._repository); + + @override + Future call() { + return _repository.getSavedLocale(); + } +} diff --git a/apps/mobile/packages/core_localization/lib/src/domain/usecases/set_locale_use_case.dart b/apps/mobile/packages/core_localization/lib/src/domain/usecases/set_locale_use_case.dart new file mode 100644 index 00000000..dcddd0c1 --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/src/domain/usecases/set_locale_use_case.dart @@ -0,0 +1,19 @@ +import 'dart:ui'; +import 'package:krow_core/core.dart'; +import '../repositories/locale_repository_interface.dart'; + +/// Use case to save the application locale to persistent storage. +/// +/// This class extends [UseCase] and interacts with [LocaleRepositoryInterface] +/// to save a given locale. +class SetLocaleUseCase extends UseCase { + final LocaleRepositoryInterface _repository; + + /// Creates a [SetLocaleUseCase] with the required [LocaleRepositoryInterface]. + SetLocaleUseCase(this._repository); + + @override + Future call(Locale input) { + return _repository.saveLocale(input); + } +} diff --git a/apps/mobile/packages/core_localization/lib/src/l10n/en.i18n.json b/apps/mobile/packages/core_localization/lib/src/l10n/en.i18n.json new file mode 100644 index 00000000..514f70cb --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/src/l10n/en.i18n.json @@ -0,0 +1,709 @@ +{ + "common": { + "ok": "OK", + "cancel": "Cancel", + "save": "Save", + "delete": "Delete", + "continue_text": "Continue" + }, + "settings": { + "language": "Language", + "change_language": "Change Language" + }, + "staff_authentication": { + "get_started_page": { + "title_part1": "Work, Grow, ", + "title_part2": "Elevate", + "subtitle": "Build your career in hospitality with \nflexibility and freedom.", + "sign_up_button": "Sign Up", + "log_in_button": "Log In" + }, + "phone_verification_page": { + "validation_error": "Please enter a valid 10-digit phone number", + "send_code_button": "Send Code", + "enter_code_title": "Enter verification code", + "code_sent_message": "We sent a 6-digit code to ", + "code_sent_instruction": ". Enter it below to verify your account." + }, + "phone_input": { + "title": "Verify your phone number", + "subtitle": "We'll send you a verification code to get started.", + "label": "Phone Number", + "hint": "Enter your number" + }, + "otp_verification": { + "did_not_get_code": "Didn't get the code ?", + "resend_in": "Resend in $seconds s", + "resend_code": "Resend code" + }, + "profile_setup_page": { + "step_indicator": "Step $current of $total", + "error_occurred": "An error occurred", + "complete_setup_button": "Complete Setup", + "steps": { + "basic": "Basic Info", + "location": "Location", + "experience": "Experience" + }, + "basic_info": { + "title": "Let's get to know you", + "subtitle": "Tell us a bit about yourself", + "full_name_label": "Full Name *", + "full_name_hint": "John Smith", + "bio_label": "Short Bio", + "bio_hint": "Experienced hospitality professional..." + }, + "location": { + "title": "Where do you want to work?", + "subtitle": "Add your preferred work locations", + "full_name_label": "Full Name", + "add_location_label": "Add Location *", + "add_location_hint": "City or ZIP code", + "add_button": "Add", + "max_distance": "Max Distance: $distance miles", + "min_dist_label": "5 mi", + "max_dist_label": "50 mi" + }, + "experience": { + "title": "What are your skills?", + "subtitle": "Select all that apply", + "skills_label": "Skills *", + "industries_label": "Preferred Industries", + "skills": { + "food_service": "Food Service", + "bartending": "Bartending", + "warehouse": "Warehouse", + "retail": "Retail", + "events": "Events", + "customer_service": "Customer Service", + "cleaning": "Cleaning", + "security": "Security", + "driving": "Driving", + "cooking": "Cooking" + }, + "industries": { + "hospitality": "Hospitality", + "food_service": "Food Service", + "warehouse": "Warehouse", + "events": "Events", + "retail": "Retail", + "healthcare": "Healthcare" + } + } + }, + "common": { + "trouble_question": "Having trouble? ", + "contact_support": "Contact Support" + } + }, + "client_authentication": { + "get_started_page": { + "title": "Take Control of Your\nShifts and Events", + "subtitle": "Streamline your operations with powerful tools to manage schedules, track performance, and keep your team on the same pageβ€”all in one place", + "sign_in_button": "Sign In", + "create_account_button": "Create Account" + }, + "sign_in_page": { + "title": "Welcome Back", + "subtitle": "Sign in to manage your shifts and workers", + "email_label": "Email", + "email_hint": "Enter your email", + "password_label": "Password", + "password_hint": "Enter your password", + "forgot_password": "Forgot Password?", + "sign_in_button": "Sign In", + "or_divider": "or", + "social_apple": "Sign In with Apple", + "social_google": "Sign In with Google", + "no_account": "Don't have an account? ", + "sign_up_link": "Sign Up" + }, + "sign_up_page": { + "title": "Create Account", + "subtitle": "Get started with Krow for your business", + "company_label": "Company Name", + "company_hint": "Enter company name", + "email_label": "Email", + "email_hint": "Enter your email", + "password_label": "Password", + "password_hint": "Create a password", + "confirm_password_label": "Confirm Password", + "confirm_password_hint": "Confirm your password", + "create_account_button": "Create Account", + "or_divider": "or", + "social_apple": "Sign Up with Apple", + "social_google": "Sign Up with Google", + "has_account": "Already have an account? ", + "sign_in_link": "Sign In" + } + }, + "client_home": { + "dashboard": { + "welcome_back": "Welcome back", + "edit_mode_active": "Edit Mode Active", + "drag_instruction": "Drag to reorder, toggle visibility", + "reset": "Reset", + "metric_needed": "Needed", + "metric_filled": "Filled", + "metric_open": "Open", + "view_all": "View all", + "insight_lightbulb": "Save $amount/month", + "insight_tip": "Book 48hrs ahead for better rates" + }, + "widgets": { + "actions": "Quick Actions", + "reorder": "Reorder", + "coverage": "Today's Coverage", + "spending": "Spending Insights", + "live_activity": "Live Activity" + }, + "actions": { + "rapid": "RAPID", + "rapid_subtitle": "Urgent same-day", + "create_order": "Create Order", + "create_order_subtitle": "Schedule shifts", + "hubs": "Hubs", + "hubs_subtitle": "Clock-in points" + }, + "reorder": { + "title": "REORDER", + "reorder_button": "Reorder", + "per_hr": "$amount/hr" + }, + "form": { + "edit_reorder": "Edit & Reorder", + "post_new": "Post a New Shift", + "review_subtitle": "Review and edit the details before posting", + "date_label": "Date *", + "date_hint": "mm/dd/yyyy", + "location_label": "Location *", + "location_hint": "Business address", + "positions_title": "Positions", + "add_position": "Add Position", + "role_label": "Role *", + "role_hint": "Select role", + "start_time": "Start Time *", + "end_time": "End Time *", + "workers_needed": "Workers Needed *", + "hourly_rate": "Hourly Rate (\\$) *", + "post_shift": "Post Shift" + } + }, + "client_settings": { + "profile": { + "title": "Profile", + "edit_profile": "Edit Profile", + "hubs": "Hubs", + "log_out": "Log Out", + "quick_links": "Quick Links", + "clock_in_hubs": "Clock-In Hubs", + "billing_payments": "Billing & Payments" + } + }, + "client_hubs": { + "title": "Hubs", + "subtitle": "Manage clock-in locations", + "add_hub": "Add Hub", + "empty_state": { + "title": "No hubs yet", + "description": "Create clock-in stations for your locations", + "button": "Add Your First Hub" + }, + "about_hubs": { + "title": "About Hubs", + "description": "Hubs are clock-in stations at your locations. Assign NFC tags to each hub so workers can quickly clock in/out using their phones." + }, + "hub_card": { + "tag_label": "Tag: $id" + }, + "add_hub_dialog": { + "title": "Add New Hub", + "name_label": "Hub Name *", + "name_hint": "e.g., Main Kitchen, Front Desk", + "location_label": "Location Name", + "location_hint": "e.g., Downtown Restaurant", + "address_label": "Address", + "address_hint": "Full address", + "create_button": "Create Hub" + }, + "nfc_dialog": { + "title": "Identify NFC Tag", + "instruction": "Tap your phone to the NFC tag to identify it", + "scan_button": "Scan NFC Tag", + "tag_identified": "Tag Identified", + "assign_button": "Assign Tag" + } + }, + "client_create_order": { + "title": "Create Order", + "section_title": "ORDER TYPE", + "types": { + "rapid": "RAPID", + "rapid_desc": "URGENT same-day Coverage", + "one_time": "One-Time", + "one_time_desc": "Single Event or Shift Request", + "recurring": "Recurring", + "recurring_desc": "Ongoing Weekly / Monthly Coverage", + "permanent": "Permanent", + "permanent_desc": "Long-Term Staffing Placement" + }, + "rapid": { + "title": "RAPID Order", + "subtitle": "Emergency staffing in minutes", + "urgent_badge": "URGENT", + "tell_us": "Tell us what you need", + "need_staff": "Need staff urgently?", + "type_or_speak": "Type or speak what you need. I'll handle the rest", + "example": "Example: ", + "hint": "Type or speak... (e.g., \"Need 5 cooks ASAP until 5am\")", + "speak": "Speak", + "listening": "Listening...", + "send": "Send Message", + "sending": "Sending...", + "success_title": "Request Sent!", + "success_message": "We're finding available workers for you right now. You'll be notified as they accept.", + "back_to_orders": "Back to Orders" + }, + "one_time": { + "title": "One-Time Order", + "subtitle": "Single event or shift request", + "create_your_order": "Create Your Order", + "date_label": "Date", + "date_hint": "Select date", + "location_label": "Location", + "location_hint": "Enter address", + "positions_title": "Positions", + "add_position": "Add Position", + "position_number": "Position $number", + "remove": "Remove", + "select_role": "Select role", + "start_label": "Start", + "end_label": "End", + "workers_label": "Workers", + "lunch_break_label": "Lunch Break", + "no_break": "No break", + "paid_break": "min (Paid)", + "unpaid_break": "min (Unpaid)", + "different_location": "Use different location for this position", + "different_location_title": "Different Location", + "different_location_hint": "Enter different address", + "create_order": "Create Order", + "creating": "Creating...", + "success_title": "Order Created!", + "success_message": "Your shift request has been posted. Workers will start applying soon.", + "back_to_orders": "Back to Orders" + }, + "recurring": { + "title": "Recurring Order", + "subtitle": "Ongoing weekly/monthly coverage", + "placeholder": "Recurring Order Flow (Work in Progress)" + }, + "permanent": { + "title": "Permanent Order", + "subtitle": "Long-term staffing placement", + "placeholder": "Permanent Order Flow (Work in Progress)" + } + }, + "client_main": { + "tabs": { + "coverage": "Coverage", + "billing": "Billing", + "home": "Home", + "orders": "Orders", + "reports": "Reports" + } + }, + "client_view_orders": { + "title": "Orders", + "post_button": "Post", + "post_order": "Post an Order", + "no_orders": "No orders for $date", + "tabs": { + "up_next": "Up Next", + "active": "Active", + "completed": "Completed" + }, + "card": { + "open": "OPEN", + "filled": "FILLED", + "confirmed": "CONFIRMED", + "in_progress": "IN PROGRESS", + "completed": "COMPLETED", + "cancelled": "CANCELLED", + "get_direction": "Get direction", + "total": "Total", + "hrs": "HRS", + "workers": "$count workers", + "clock_in": "CLOCK IN", + "clock_out": "CLOCK OUT", + "coverage": "Coverage", + "workers_label": "$filled/$needed Workers", + "confirmed_workers": "Workers Confirmed", + "no_workers": "No workers confirmed yet." + } + }, + "client_billing": { + "title": "Billing", + "current_period": "Current Period", + "saved_amount": "$amount saved", + "awaiting_approval": "Awaiting Approval", + "payment_method": "Payment Method", + "add_payment": "Add", + "default_badge": "Default", + "expires": "Expires $date", + "period_breakdown": "This Period Breakdown", + "week": "Week", + "month": "Month", + "total": "Total", + "hours": "$count hours", + "rate_optimization_title": "Rate Optimization", + "rate_optimization_body": "Save $amount/month by switching 3 shifts", + "view_details": "View Details", + "invoice_history": "Invoice History", + "view_all": "View all", + "export_button": "Export All Invoices", + "pending_badge": "PENDING APPROVAL", + "paid_badge": "PAID" + } + , + "staff": { + "main": { + "tabs": { + "shifts": "Shifts", + "payments": "Payments", + "home": "Home", + "clock_in": "Clock In", + "profile": "Profile" + } + }, + "home": { + "header": { + "welcome_back": "Welcome back", + "user_name_placeholder": "Krower" + }, + "banners": { + "complete_profile_title": "Complete Your Profile", + "complete_profile_subtitle": "Get verified to see more shifts", + "availability_title": "Availability", + "availability_subtitle": "Update your availability for next week" + }, + "quick_actions": { + "find_shifts": "Find Shifts", + "availability": "Availability", + "messages": "Messages", + "earnings": "Earnings" + }, + "sections": { + "todays_shift": "Today's Shift", + "scheduled_count": "$count scheduled", + "tomorrow": "Tomorrow", + "recommended_for_you": "Recommended for You", + "view_all": "View all" + }, + "empty_states": { + "no_shifts_today": "No shifts scheduled for today", + "find_shifts_cta": "Find shifts β†’", + "no_shifts_tomorrow": "No shifts for tomorrow", + "no_recommended_shifts": "No recommended shifts" + }, + "pending_payment": { + "title": "Pending Payment", + "subtitle": "Payment processing", + "amount": "$amount" + }, + "recommended_card": { + "act_now": "β€’ ACT NOW", + "one_day": "One Day", + "today": "Today", + "applied_for": "Applied for $title", + "time_range": "$start - $end" + } + , + "benefits": { + "title": "Your Benefits", + "view_all": "View all", + "hours_label": "hours", + "items": { + "sick_days": "Sick Days", + "vacation": "Vacation", + "holidays": "Holidays" + } + }, + "auto_match": { + "title": "Auto-Match", + "finding_shifts": "Finding shifts for you", + "get_matched": "Get matched automatically", + "matching_based_on": "Matching based on:", + "chips": { + "location": "Location", + "availability": "Availability", + "skills": "Skills" + } + }, + "improve": { + "title": "Improve Yourself", + "items": { + "training": { + "title": "Training Section", + "description": "Improve your skills and get certified.", + "page": "/krow-university" + }, + "podcast": { + "title": "Krow Podcast", + "description": "Listen to tips from top workers.", + "page": "/krow-university" + } + } + }, + "more_ways": { + "title": "More Ways To Use Krow", + "items": { + "benefits": { "title": "Krow Benefits", "page": "/benefits" }, + "refer": { "title": "Refer a Friend", "page": "/worker-profile" } + } + } + }, + "profile": { + "header": { + "title": "Profile", + "sign_out": "SIGN OUT" + }, + "reliability_stats": { + "shifts": "Shifts", + "rating": "Rating", + "on_time": "On Time", + "no_shows": "No Shows", + "cancellations": "Cancel." + }, + "reliability_score": { + "title": "Reliability Score", + "description": "Keep your score above 45% to continue picking up shifts." + }, + "sections": { + "onboarding": "ONBOARDING", + "compliance": "COMPLIANCE", + "level_up": "LEVEL UP", + "finance": "FINANCE", + "support": "SUPPORT" + }, + "menu_items": { + "personal_info": "Personal Info", + "emergency_contact": "Emergency Contact", + "experience": "Experience", + "attire": "Attire", + "documents": "Documents", + "certificates": "Certificates", + "tax_forms": "Tax Forms", + "krow_university": "Krow University", + "trainings": "Trainings", + "leaderboard": "Leaderboard", + "bank_account": "Bank Account", + "payments": "Payments", + "timecard": "Timecard", + "faqs": "FAQs", + "privacy_security": "Privacy & Security", + "messages": "Messages" + }, + "bank_account_page": { + "title": "Bank Account", + "linked_accounts": "LINKED ACCOUNTS", + "add_account": "Add New Account", + "secure_title": "100% Secured", + "secure_subtitle": "Your account details are encrypted and safe.", + "primary": "Primary", + "add_new_account": "Add New Account", + "routing_number": "Routing Number", + "routing_hint": "Enter routing number", + "account_number": "Account Number", + "account_hint": "Enter account number", + "account_type": "Account Type", + "checking": "Checking", + "savings": "Savings", + "cancel": "Cancel", + "save": "Save", + "account_ending": "Ending in $last4" + }, + "logout": { + "button": "Sign Out" + } + }, + "onboarding": { + "personal_info": { + "title": "Personal Info", + "change_photo_hint": "Tap to change photo", + "full_name_label": "Full Name", + "email_label": "Email", + "phone_label": "Phone Number", + "phone_hint": "+1 (555) 000-0000", + "bio_label": "Bio", + "bio_hint": "Tell clients about yourself...", + "languages_label": "Languages", + "languages_hint": "English, Spanish, French...", + "locations_label": "Preferred Locations", + "locations_hint": "Downtown, Midtown, Brooklyn...", + "save_button": "Save Changes", + "save_success": "Personal info saved successfully" + }, + "experience": { + "title": "Experience & Skills", + "industries_title": "Industries", + "industries_subtitle": "Select the industries you have experience in", + "skills_title": "Skills", + "skills_subtitle": "Select your skills or add custom ones", + "custom_skills_title": "Custom Skills:", + "custom_skill_hint": "Add custom skill...", + "save_button": "Save & Continue", + "industries": { + "hospitality": "Hospitality", + "food_service": "Food Service", + "warehouse": "Warehouse", + "events": "Events", + "retail": "Retail", + "healthcare": "Healthcare", + "other": "Other" + }, + "skills": { + "food_service": "Food Service", + "bartending": "Bartending", + "event_setup": "Event Setup", + "hospitality": "Hospitality", + "warehouse": "Warehouse", + "customer_service": "Customer Service", + "cleaning": "Cleaning", + "security": "Security", + "retail": "Retail", + "cooking": "Cooking", + "cashier": "Cashier", + "server": "Server", + "barista": "Barista", + "host_hostess": "Host/Hostess", + "busser": "Busser" + } + } + } + }, + "staff_documents": { + "title": "Documents", + "verification_card": { + "title": "Document Verification", + "progress": "$completed/$total Complete" + }, + "list": { + "empty": "No documents found", + "error": "Error: $message" + }, + "card": { + "view": "View", + "upload": "Upload", + "verified": "Verified", + "pending": "Pending", + "missing": "Missing", + "rejected": "Rejected" + } + }, + "staff_certificates": { + "title": "Certificates", + "progress": { + "title": "Your Progress", + "verified_count": "$completed of $total verified", + "active": "Compliance Active" + }, + "card": { + "expires_in_days": "Expires in $days days - Renew now", + "expired": "Expired - Renew now", + "verified": "Verified", + "expiring_soon": "Expiring Soon", + "exp": "Exp: $date", + "upload_button": "Upload Certificate", + "edit_expiry": "Edit Expiration Date", + "remove": "Remove Certificate", + "renew": "Renew", + "opened_snackbar": "Certificate opened in new tab" + }, + "add_more": { + "title": "Add Another Certificate", + "subtitle": "Upload additional certifications" + }, + "upload_modal": { + "title": "Upload Certificate", + "expiry_label": "Expiration Date (Optional)", + "select_date": "Select date", + "upload_file": "Upload File", + "drag_drop": "Drag and drop or click to upload", + "supported_formats": "PDF, JPG, PNG up to 10MB", + "cancel": "Cancel", + "save": "Save Certificate" + }, + "delete_modal": { + "title": "Remove Certificate?", + "message": "This action cannot be undone.", + "cancel": "Cancel", + "confirm": "Remove" + } + }, + "staff_profile_attire": { + "title": "Attire", + "info_card": { + "title": "Your Wardrobe", + "description": "Select the attire items you own. This helps us match you with shifts that fit your wardrobe." + }, + "status": { + "required": "REQUIRED", + "add_photo": "Add Photo", + "added": "Added", + "pending": "⏳ Pending verification" + }, + "attestation": "I certify that I own these items and will wear them to my shifts. I understand that items are pending manager verification at my first shift.", + "actions": { + "save": "Save Attire" + }, + "validation": { + "select_required": "βœ“ Select all required items", + "upload_required": "βœ“ Upload photos of required items", + "accept_attestation": "βœ“ Accept attestation" + } + }, + "staff_shifts": { + "title": "Shifts", + "tabs": { + "my_shifts": "My Shifts", + "find_work": "Find Work" + }, + "list": { + "no_shifts": "No shifts found", + "pending_offers": "PENDING OFFERS", + "available_jobs": "$count AVAILABLE JOBS", + "search_hint": "Search jobs..." + }, + "filter": { + "all": "All Jobs", + "one_day": "One Day", + "multi_day": "Multi Day", + "long_term": "Long Term" + }, + "status": { + "confirmed": "CONFIRMED", + "act_now": "ACT NOW", + "swap_requested": "SWAP REQUESTED", + "completed": "COMPLETED", + "no_show": "NO SHOW", + "pending_warning": "Please confirm assignment" + }, + "action": { + "decline": "Decline", + "confirm": "Confirm", + "request_swap": "Request Swap" + }, + "details": { + "additional": "ADDITIONAL DETAILS", + "days": "$days Days", + "exp_total": "(exp.total \\$$amount)", + "pending_time": "Pending $time ago" + }, + "tags": { + "immediate_start": "Immediate start", + "no_experience": "No experience" + } + } +} + diff --git a/apps/mobile/packages/core_localization/lib/src/l10n/es.i18n.json b/apps/mobile/packages/core_localization/lib/src/l10n/es.i18n.json new file mode 100644 index 00000000..21177038 --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/src/l10n/es.i18n.json @@ -0,0 +1,707 @@ +{ + "common": { + "ok": "Aceptar", + "cancel": "Cancelar", + "save": "Guardar", + "delete": "Eliminar", + "continue_text": "Continuar" + }, + "settings": { + "language": "Idioma", + "change_language": "Cambiar Idioma" + }, + "staff_authentication": { + "get_started_page": { + "title_part1": "Trabaja, Crece, ", + "title_part2": "ElΓ©vate", + "subtitle": "Construye tu carrera en hostelerΓ­a con \nflexibilidad y libertad.", + "sign_up_button": "Registrarse", + "log_in_button": "Iniciar sesiΓ³n" + }, + "phone_verification_page": { + "validation_error": "Por favor, ingresa un nΓΊmero de telΓ©fono vΓ‘lido de 10 dΓ­gitos", + "send_code_button": "Enviar cΓ³digo", + "enter_code_title": "Ingresa el cΓ³digo de verificaciΓ³n", + "code_sent_message": "Enviamos un cΓ³digo de 6 dΓ­gitos a ", + "code_sent_instruction": ". IngrΓ©salo a continuaciΓ³n para verificar tu cuenta." + }, + "phone_input": { + "title": "Verifica tu nΓΊmero de telΓ©fono", + "subtitle": "Te enviaremos un cΓ³digo de verificaciΓ³n para comenzar.", + "label": "NΓΊmero de telΓ©fono", + "hint": "Ingresa tu nΓΊmero" + }, + "otp_verification": { + "did_not_get_code": "ΒΏNo recibiste el cΓ³digo?", + "resend_in": "Reenviar en $seconds s", + "resend_code": "Reenviar cΓ³digo" + }, + "profile_setup_page": { + "step_indicator": "Paso $current de $total", + "error_occurred": "OcurriΓ³ un error", + "complete_setup_button": "Completar configuraciΓ³n", + "steps": { + "basic": "InformaciΓ³n bΓ‘sica", + "location": "UbicaciΓ³n", + "experience": "Experiencia" + }, + "basic_info": { + "title": "ConozcΓ‘monos", + "subtitle": "CuΓ©ntanos un poco sobre ti", + "full_name_label": "Nombre completo *", + "full_name_hint": "Juan PΓ©rez", + "bio_label": "BiografΓ­a corta", + "bio_hint": "Profesional experimentado en hostelerΓ­a..." + }, + "location": { + "title": "ΒΏDΓ³nde quieres trabajar?", + "subtitle": "Agrega tus ubicaciones de trabajo preferidas", + "full_name_label": "Nombre completo", + "add_location_label": "Agregar ubicaciΓ³n *", + "add_location_hint": "Ciudad o cΓ³digo postal", + "add_button": "Agregar", + "max_distance": "Distancia mΓ‘xima: $distance millas", + "min_dist_label": "5 mi", + "max_dist_label": "50 mi" + }, + "experience": { + "title": "ΒΏCuΓ‘les son tus habilidades?", + "subtitle": "Selecciona todas las que correspondan", + "skills_label": "Habilidades *", + "industries_label": "Industrias preferidas", + "skills": { + "food_service": "Servicio de comida", + "bartending": "PreparaciΓ³n de bebidas", + "warehouse": "AlmacΓ©n", + "retail": "Venta minorista", + "events": "Eventos", + "customer_service": "Servicio al cliente", + "cleaning": "Limpieza", + "security": "Seguridad", + "driving": "ConducciΓ³n", + "cooking": "Cocina" + }, + "industries": { + "hospitality": "HostelerΓ­a", + "food_service": "Servicio de comida", + "warehouse": "AlmacΓ©n", + "events": "Eventos", + "retail": "Venta minorista", + "healthcare": "AtenciΓ³n mΓ©dica" + } + } + }, + "common": { + "trouble_question": "ΒΏTienes problemas? ", + "contact_support": "Contactar a soporte" + } + }, + "client_authentication": { + "get_started_page": { + "title": "Toma el control de tus\nturnos y eventos", + "subtitle": "Optimiza tus operaciones con potentes herramientas para gestionar horarios, realizar un seguimiento del rendimiento y mantener a tu equipo en la misma pΓ‘gina, todo en un solo lugar", + "sign_in_button": "Iniciar sesiΓ³n", + "create_account_button": "Crear cuenta" + }, + "sign_in_page": { + "title": "Bienvenido de nuevo", + "subtitle": "Inicia sesiΓ³n para gestionar tus turnos y trabajadores", + "email_label": "Correo electrΓ³nico", + "email_hint": "Ingresa tu correo electrΓ³nico", + "password_label": "ContraseΓ±a", + "password_hint": "Ingresa tu contraseΓ±a", + "forgot_password": "ΒΏOlvidaste tu contraseΓ±a?", + "sign_in_button": "Iniciar sesiΓ³n", + "or_divider": "o", + "social_apple": "Iniciar sesiΓ³n con Apple", + "social_google": "Iniciar sesiΓ³n con Google", + "no_account": "ΒΏNo tienes una cuenta? ", + "sign_up_link": "RegΓ­strate" + }, + "sign_up_page": { + "title": "Crear cuenta", + "subtitle": "Comienza con Krow para tu negocio", + "company_label": "Nombre de la empresa", + "company_hint": "Ingresa el nombre de la empresa", + "email_label": "Correo electrΓ³nico", + "email_hint": "Ingresa tu correo electrΓ³nico", + "password_label": "ContraseΓ±a", + "password_hint": "Crea una contraseΓ±a", + "confirm_password_label": "Confirmar contraseΓ±a", + "confirm_password_hint": "Confirma tu contraseΓ±a", + "create_account_button": "Crear cuenta", + "or_divider": "o", + "social_apple": "RegΓ­strate con Apple", + "social_google": "RegΓ­strate con Google", + "has_account": "ΒΏYa tienes una cuenta? ", + "sign_in_link": "Iniciar sesiΓ³n" + } + }, + "client_home": { + "dashboard": { + "welcome_back": "Bienvenido de nuevo", + "edit_mode_active": "Modo EdiciΓ³n Activo", + "drag_instruction": "Arrastra para reordenar, cambia la visibilidad", + "reset": "Restablecer", + "metric_needed": "Necesario", + "metric_filled": "Lleno", + "metric_open": "Abierto", + "view_all": "Ver todo", + "insight_lightbulb": "Ahorra $amount/mes", + "insight_tip": "Reserva con 48h de antelaciΓ³n para mejores tarifas" + }, + "widgets": { + "actions": "Acciones RΓ‘pidas", + "reorder": "Reordenar", + "coverage": "Cobertura de Hoy", + "spending": "InformaciΓ³n de Gastos", + "live_activity": "Actividad en Vivo" + }, + "actions": { + "rapid": "RÁPIDO", + "rapid_subtitle": "Urgente mismo dΓ­a", + "create_order": "Crear Orden", + "create_order_subtitle": "Programar turnos", + "hubs": "Hubs", + "hubs_subtitle": "Puntos marcaje" + }, + "reorder": { + "title": "REORDENAR", + "reorder_button": "Reordenar", + "per_hr": "$amount/hr" + }, + "form": { + "edit_reorder": "Editar y Reordenar", + "post_new": "Publicar un Nuevo Turno", + "review_subtitle": "Revisa y edita los detalles antes de publicar", + "date_label": "Fecha *", + "date_hint": "mm/dd/aaaa", + "location_label": "UbicaciΓ³n *", + "location_hint": "DirecciΓ³n del negocio", + "positions_title": "Posiciones", + "add_position": "AΓ±adir PosiciΓ³n", + "role_label": "Rol *", + "role_hint": "Seleccionar rol", + "start_time": "Hora de Inicio *", + "end_time": "Hora de Fin *", + "workers_needed": "Trabajadores Necesarios *", + "hourly_rate": "Tarifa por hora (\\$) *", + "post_shift": "Publicar Turno" + } + }, + "client_settings": { + "profile": { + "title": "Perfil", + "edit_profile": "Editar Perfil", + "hubs": "Hubs", + "log_out": "Cerrar sesiΓ³n", + "quick_links": "Enlaces rΓ‘pidos", + "clock_in_hubs": "Hubs de Marcaje", + "billing_payments": "FacturaciΓ³n y Pagos" + } + }, + "client_hubs": { + "title": "Hubs", + "subtitle": "Gestionar ubicaciones de marcaje", + "add_hub": "AΓ±adir Hub", + "empty_state": { + "title": "No hay hubs aΓΊn", + "description": "Crea estaciones de marcaje para tus ubicaciones", + "button": "AΓ±ade tu primer Hub" + }, + "about_hubs": { + "title": "Sobre los Hubs", + "description": "Los Hubs son estaciones de marcaje en tus ubicaciones. Asigna etiquetas NFC a cada hub para que los trabajadores puedan marcar entrada/salida rΓ‘pidamente usando sus telΓ©fonos." + }, + "hub_card": { + "tag_label": "Etiqueta: $id" + }, + "add_hub_dialog": { + "title": "AΓ±adir Nuevo Hub", + "name_label": "Nombre del Hub *", + "name_hint": "ej., Cocina Principal, RecepciΓ³n", + "location_label": "Nombre de la UbicaciΓ³n", + "location_hint": "ej., Restaurante Centro", + "address_label": "DirecciΓ³n", + "address_hint": "DirecciΓ³n completa", + "create_button": "Crear Hub" + }, + "nfc_dialog": { + "title": "Identificar Etiqueta NFC", + "instruction": "Acerque su telΓ©fono a la etiqueta NFC para identificarla", + "scan_button": "Escanear Etiqueta NFC", + "tag_identified": "Etiqueta Identificada", + "assign_button": "Asignar Etiqueta" + } + }, + "client_create_order": { + "title": "Crear Orden", + "section_title": "TIPO DE ORDEN", + "types": { + "rapid": "RÁPIDO", + "rapid_desc": "Cobertura URGENTE mismo dΓ­a", + "one_time": "Única Vez", + "one_time_desc": "Evento Único o PeticiΓ³n de Turno", + "recurring": "Recurrente", + "recurring_desc": "Cobertura Continua Semanal / Mensual", + "permanent": "Permanente", + "permanent_desc": "ColocaciΓ³n de Personal a Largo Plazo" + }, + "rapid": { + "title": "Orden RÁPIDA", + "subtitle": "Personal de emergencia en minutos", + "urgent_badge": "URGENTE", + "tell_us": "Dinos quΓ© necesitas", + "need_staff": "ΒΏNecesitas personal urgentemente?", + "type_or_speak": "Escribe o habla lo que necesitas. Yo me encargo del resto", + "example": "Ejemplo: ", + "hint": "Escribe o habla... (ej., \"Necesito 5 cocineros YA hasta las 5am\")", + "speak": "Hablar", + "listening": "Escuchando...", + "send": "Enviar Mensaje", + "sending": "Enviando...", + "success_title": "Β‘Solicitud Enviada!", + "success_message": "Estamos encontrando trabajadores disponibles para ti ahora mismo. Te notificaremos cuando acepten.", + "back_to_orders": "Volver a Γ“rdenes" + }, + "one_time": { + "title": "Orden Única Vez", + "subtitle": "Evento ΓΊnico o peticiΓ³n de turno", + "create_your_order": "Crea Tu Orden", + "date_label": "Fecha", + "date_hint": "Seleccionar fecha", + "location_label": "UbicaciΓ³n", + "location_hint": "Ingresar direcciΓ³n", + "positions_title": "Posiciones", + "add_position": "AΓ±adir PosiciΓ³n", + "position_number": "PosiciΓ³n $number", + "remove": "Eliminar", + "select_role": "Seleccionar rol", + "start_label": "Inicio", + "end_label": "Fin", + "workers_label": "Trabajadores", + "lunch_break_label": "Descanso para Almuerzo", + "different_location": "Usar ubicaciΓ³n diferente para esta posiciΓ³n", + "different_location_title": "UbicaciΓ³n Diferente", + "different_location_hint": "Ingresar direcciΓ³n diferente", + "create_order": "Crear Orden", + "creating": "Creando...", + "success_title": "Β‘Orden Creada!", + "success_message": "Tu solicitud de turno ha sido publicada. Los trabajadores comenzarΓ‘n a postularse pronto.", + "back_to_orders": "Volver a Γ“rdenes", + "no_break": "Sin descanso", + "paid_break": "min (Pagado)", + "unpaid_break": "min (No pagado)" + }, + "recurring": { + "title": "Orden Recurrente", + "subtitle": "Cobertura continua semanal/mensual", + "placeholder": "Flujo de Orden Recurrente (Trabajo en Progreso)" + }, + "permanent": { + "title": "Orden Permanente", + "subtitle": "ColocaciΓ³n de personal a largo plazo", + "placeholder": "Flujo de Orden Permanente (Trabajo en Progreso)" + } + }, + "client_main": { + "tabs": { + "coverage": "Cobertura", + "billing": "FacturaciΓ³n", + "home": "Inicio", + "orders": "Γ“rdenes", + "reports": "Reportes" + } + }, + "client_view_orders": { + "title": "Γ“rdenes", + "post_button": "Publicar", + "post_order": "Publicar una Orden", + "no_orders": "No hay Γ³rdenes para $date", + "tabs": { + "up_next": "PrΓ³ximos", + "active": "Activos", + "completed": "Completados" + }, + "card": { + "open": "ABIERTO", + "filled": "LLENO", + "confirmed": "CONFIRMADO", + "in_progress": "EN PROGRESO", + "completed": "COMPLETADO", + "cancelled": "CANCELADO", + "get_direction": "Obtener direcciΓ³n", + "total": "Total", + "hrs": "HRS", + "workers": "$count trabajadores", + "clock_in": "ENTRADA", + "clock_out": "SALIDA", + "coverage": "Cobertura", + "workers_label": "$filled/$needed Trabajadores", + "confirmed_workers": "Trabajadores Confirmados", + "no_workers": "NingΓΊn trabajador confirmado aΓΊn." + } + }, + "client_billing": { + "title": "FacturaciΓ³n", + "current_period": "PerΓ­odo Actual", + "saved_amount": "$amount ahorrado", + "awaiting_approval": "Esperando AprobaciΓ³n", + "payment_method": "MΓ©todo de Pago", + "add_payment": "AΓ±adir", + "default_badge": "Predeterminado", + "expires": "Expira $date", + "period_breakdown": "Desglose de este PerΓ­odo", + "week": "Semana", + "month": "Mes", + "total": "Total", + "hours": "$count horas", + "rate_optimization_title": "OptimizaciΓ³n de Tarifas", + "rate_optimization_body": "Ahorra $amount/mes cambiando 3 turnos", + "view_details": "Ver Detalles", + "invoice_history": "Historial de Facturas", + "view_all": "Ver todo", + "export_button": "Exportar Todas las Facturas", + "pending_badge": "PENDIENTE APROBACIΓ“N", + "paid_badge": "PAGADO" + } + , + "staff": { + "main": { + "tabs": { + "shifts": "Turnos", + "payments": "Pagos", + "home": "Inicio", + "clock_in": "Marcar Entrada", + "profile": "Perfil" + } + }, + "home": { + "header": { + "welcome_back": "Welcome back", + "user_name_placeholder": "Krower" + }, + "banners": { + "complete_profile_title": "Complete Your Profile", + "complete_profile_subtitle": "Get verified to see more shifts", + "availability_title": "Availability", + "availability_subtitle": "Update your availability for next week" + }, + "quick_actions": { + "find_shifts": "Find Shifts", + "availability": "Availability", + "messages": "Messages", + "earnings": "Earnings" + }, + "sections": { + "todays_shift": "Today's Shift", + "scheduled_count": "$count scheduled", + "tomorrow": "Tomorrow", + "recommended_for_you": "Recommended for You", + "view_all": "View all" + }, + "empty_states": { + "no_shifts_today": "No shifts scheduled for today", + "find_shifts_cta": "Find shifts β†’", + "no_shifts_tomorrow": "No shifts for tomorrow", + "no_recommended_shifts": "No recommended shifts" + }, + "pending_payment": { + "title": "Pending Payment", + "subtitle": "Payment processing", + "amount": "$amount" + }, + "recommended_card": { + "act_now": "β€’ ACT NOW", + "one_day": "One Day", + "today": "Today", + "applied_for": "Applied for $title", + "time_range": "$start - $end" + }, + "benefits": { + "title": "Your Benefits", + "view_all": "View all", + "hours_label": "hours", + "items": { + "sick_days": "Sick Days", + "vacation": "Vacation", + "holidays": "Holidays" + } + }, + "auto_match": { + "title": "Auto-Match", + "finding_shifts": "Finding shifts for you", + "get_matched": "Get matched automatically", + "matching_based_on": "Matching based on:", + "chips": { + "location": "Location", + "availability": "Availability", + "skills": "Skills" + } + }, + "improve": { + "title": "Improve Yourself", + "items": { + "training": { + "title": "Training Section", + "description": "Improve your skills and get certified.", + "page": "/krow-university" + }, + "podcast": { + "title": "Krow Podcast", + "description": "Listen to tips from top workers.", + "page": "/krow-university" + } + } + }, + "more_ways": { + "title": "More Ways To Use Krow", + "items": { + "benefits": { "title": "Krow Benefits", "page": "/benefits" }, + "refer": { "title": "Refer a Friend", "page": "/worker-profile" } + } + } + }, + "profile": { + "header": { + "title": "Perfil", + "sign_out": "CERRAR SESIΓ“N" + }, + "reliability_stats": { + "shifts": "Turnos", + "rating": "CalificaciΓ³n", + "on_time": "A Tiempo", + "no_shows": "Faltas", + "cancellations": "Cancel." + }, + "reliability_score": { + "title": "PuntuaciΓ³n de Confiabilidad", + "description": "MantΓ©n tu puntuaciΓ³n por encima del 45% para continuar aceptando turnos." + }, + "sections": { + "onboarding": "INCORPORACIΓ“N", + "compliance": "CUMPLIMIENTO", + "level_up": "MEJORAR NIVEL", + "finance": "FINANZAS", + "support": "SOPORTE" + }, + "menu_items": { + "personal_info": "InformaciΓ³n Personal", + "emergency_contact": "Contacto de Emergencia", + "experience": "Experiencia", + "attire": "Vestimenta", + "documents": "Documentos", + "certificates": "Certificados", + "tax_forms": "Formularios Fiscales", + "krow_university": "Krow University", + "trainings": "Capacitaciones", + "leaderboard": "Tabla de ClasificaciΓ³n", + "bank_account": "Cuenta Bancaria", + "payments": "Pagos", + "timecard": "Tarjeta de Tiempo", + "faqs": "Preguntas Frecuentes", + "privacy_security": "Privacidad y Seguridad", + "messages": "Mensajes" + }, + "bank_account_page": { + "title": "Cuenta Bancaria", + "linked_accounts": "Cuentas Vinculadas", + "add_account": "Agregar Cuenta Bancaria", + "secure_title": "Seguro y Cifrado", + "secure_subtitle": "Su informaciΓ³n bancaria estΓ‘ cifrada y almacenada de forma segura. Nunca compartimos sus detalles.", + "add_new_account": "Agregar Nueva Cuenta", + "routing_number": "NΓΊmero de Ruta", + "routing_hint": "9 dΓ­gitos", + "account_number": "NΓΊmero de Cuenta", + "account_hint": "Ingrese nΓΊmero de cuenta", + "account_type": "Tipo de Cuenta", + "checking": "CORRIENTE", + "savings": "AHORROS", + "cancel": "Cancelar", + "save": "Guardar", + "primary": "Principal", + "account_ending": "Termina en $last4" + }, + "logout": { + "button": "Cerrar SesiΓ³n" + } + }, + "onboarding": { + "personal_info": { + "title": "InformaciΓ³n Personal", + "change_photo_hint": "Toca para cambiar foto", + "full_name_label": "Nombre Completo", + "email_label": "Correo ElectrΓ³nico", + "phone_label": "NΓΊmero de TelΓ©fono", + "phone_hint": "+1 (555) 000-0000", + "bio_label": "BiografΓ­a", + "bio_hint": "CuΓ©ntales a los clientes sobre ti...", + "languages_label": "Idiomas", + "languages_hint": "InglΓ©s, EspaΓ±ol, FrancΓ©s...", + "locations_label": "Ubicaciones Preferidas", + "locations_hint": "Centro, Midtown, Brooklyn...", + "save_button": "Guardar Cambios", + "save_success": "InformaciΓ³n personal guardada exitosamente" + }, + "experience": { + "title": "Experience & Skills", + "industries_title": "Industries", + "industries_subtitle": "Select the industries you have experience in", + "skills_title": "Skills", + "skills_subtitle": "Select your skills or add custom ones", + "custom_skills_title": "Custom Skills:", + "custom_skill_hint": "Add custom skill...", + "save_button": "Save & Continue", + "industries": { + "hospitality": "Hospitality", + "food_service": "Food Service", + "warehouse": "Warehouse", + "events": "Events", + "retail": "Retail", + "healthcare": "Healthcare", + "other": "Other" + }, + "skills": { + "food_service": "Food Service", + "bartending": "Bartending", + "event_setup": "Event Setup", + "hospitality": "Hospitality", + "warehouse": "Warehouse", + "customer_service": "Customer Service", + "cleaning": "Cleaning", + "security": "Security", + "retail": "Retail", + "cooking": "Cooking", + "cashier": "Cashier", + "server": "Server", + "barista": "Barista", + "host_hostess": "Host/Hostess", + "busser": "Busser" + } + } + } + }, + "staff_documents": { + "title": "Documents", + "verification_card": { + "title": "Document Verification", + "progress": "$completed/$total Complete" + }, + "list": { + "empty": "No documents found", + "error": "Error: $message" + }, + "card": { + "view": "View", + "upload": "Upload", + "verified": "Verified", + "pending": "Pending", + "missing": "Missing", + "rejected": "Rejected" + } + }, + "staff_certificates": { + "title": "Certificates", + "progress": { + "title": "Your Progress", + "verified_count": "$completed of $total verified", + "active": "Compliance Active" + }, + "card": { + "expires_in_days": "Expires in $days days - Renew now", + "expired": "Expired - Renew now", + "verified": "Verified", + "expiring_soon": "Expiring Soon", + "exp": "Exp: $date", + "upload_button": "Upload Certificate", + "edit_expiry": "Edit Expiration Date", + "remove": "Remove Certificate", + "renew": "Renew", + "opened_snackbar": "Certificate opened in new tab" + }, + "add_more": { + "title": "Add Another Certificate", + "subtitle": "Upload additional certifications" + }, + "upload_modal": { + "title": "Upload Certificate", + "expiry_label": "Expiration Date (Optional)", + "select_date": "Select date", + "upload_file": "Upload File", + "drag_drop": "Drag and drop or click to upload", + "supported_formats": "PDF, JPG, PNG up to 10MB", + "cancel": "Cancel", + "save": "Save Certificate" + }, + "delete_modal": { + "title": "Remove Certificate?", + "message": "This action cannot be undone.", + "cancel": "Cancel", + "confirm": "Remove" + } + }, + "staff_profile_attire": { + "title": "Vestimenta", + "info_card": { + "title": "Tu Vestuario", + "description": "Selecciona los artΓ­culos de vestimenta que posees. Esto nos ayuda a asignarte turnos que se ajusten a tu vestuario." + }, + "status": { + "required": "REQUERIDO", + "add_photo": "AΓ±adir Foto", + "added": "AΓ±adido", + "pending": "⏳ VerificaciΓ³n pendiente" + }, + "attestation": "Certifico que poseo estos artΓ­culos y los usarΓ© en mis turnos. Entiendo que los artΓ­culos estΓ‘n pendientes de verificaciΓ³n por el gerente en mi primer turno.", + "actions": { + "save": "Guardar Vestimenta" + }, + "validation": { + "select_required": "βœ“ Seleccionar todos los artΓ­culos requeridos", + "upload_required": "βœ“ Subir fotos de artΓ­culos requeridos", + "accept_attestation": "βœ“ Aceptar certificaciΓ³n" + } + }, + "staff_shifts": { + "title": "Shifts", + "tabs": { + "my_shifts": "My Shifts", + "find_work": "Find Work" + }, + "list": { + "no_shifts": "No shifts found", + "pending_offers": "PENDING OFFERS", + "available_jobs": "$count AVAILABLE JOBS", + "search_hint": "Search jobs..." + }, + "filter": { + "all": "All Jobs", + "one_day": "One Day", + "multi_day": "Multi Day", + "long_term": "Long Term" + }, + "status": { + "confirmed": "CONFIRMED", + "act_now": "ACT NOW", + "swap_requested": "SWAP REQUESTED", + "completed": "COMPLETED", + "no_show": "NO SHOW", + "pending_warning": "Please confirm assignment" + }, + "action": { + "decline": "Decline", + "confirm": "Confirm", + "request_swap": "Request Swap" + }, + "details": { + "additional": "ADDITIONAL DETAILS", + "days": "$days Days", + "exp_total": "(exp.total \\$$amount)", + "pending_time": "Pending $time ago" + }, + "tags": { + "immediate_start": "Immediate start", + "no_experience": "No experience" + } + } +} diff --git a/apps/mobile/packages/core_localization/lib/src/l10n/strings.g.dart b/apps/mobile/packages/core_localization/lib/src/l10n/strings.g.dart new file mode 100644 index 00000000..e18f4423 --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/src/l10n/strings.g.dart @@ -0,0 +1,183 @@ +/// Generated file. Do not edit. +/// +/// Source: lib/src/l10n +/// To regenerate, run: `dart run slang` +/// +/// Locales: 2 +/// Strings: 1004 (502 per locale) +/// +/// Built on 2026-01-25 at 22:04 UTC + +// coverage:ignore-file +// ignore_for_file: type=lint, unused_import +// dart format off + +import 'package:flutter/widgets.dart'; +import 'package:intl/intl.dart'; +import 'package:slang/generated.dart'; +import 'package:slang_flutter/slang_flutter.dart'; +export 'package:slang_flutter/slang_flutter.dart'; + +import 'strings_es.g.dart' deferred as l_es; +part 'strings_en.g.dart'; + +/// Supported locales. +/// +/// Usage: +/// - LocaleSettings.setLocale(AppLocale.en) // set locale +/// - Locale locale = AppLocale.en.flutterLocale // get flutter locale from enum +/// - if (LocaleSettings.currentLocale == AppLocale.en) // locale check +enum AppLocale with BaseAppLocale { + en(languageCode: 'en'), + es(languageCode: 'es'); + + const AppLocale({ + required this.languageCode, + this.scriptCode, // ignore: unused_element, unused_element_parameter + this.countryCode, // ignore: unused_element, unused_element_parameter + }); + + @override final String languageCode; + @override final String? scriptCode; + @override final String? countryCode; + + @override + Future build({ + Map? overrides, + PluralResolver? cardinalResolver, + PluralResolver? ordinalResolver, + }) async { + switch (this) { + case AppLocale.en: + return TranslationsEn( + overrides: overrides, + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver, + ); + case AppLocale.es: + await l_es.loadLibrary(); + return l_es.TranslationsEs( + overrides: overrides, + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver, + ); + } + } + + @override + Translations buildSync({ + Map? overrides, + PluralResolver? cardinalResolver, + PluralResolver? ordinalResolver, + }) { + switch (this) { + case AppLocale.en: + return TranslationsEn( + overrides: overrides, + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver, + ); + case AppLocale.es: + return l_es.TranslationsEs( + overrides: overrides, + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver, + ); + } + } + + /// Gets current instance managed by [LocaleSettings]. + Translations get translations => LocaleSettings.instance.getTranslations(this); +} + +/// Method A: Simple +/// +/// No rebuild after locale change. +/// Translation happens during initialization of the widget (call of t). +/// Configurable via 'translate_var'. +/// +/// Usage: +/// String a = t.someKey.anotherKey; +/// String b = t['someKey.anotherKey']; // Only for edge cases! +Translations get t => LocaleSettings.instance.currentTranslations; + +/// Method B: Advanced +/// +/// All widgets using this method will trigger a rebuild when locale changes. +/// Use this if you have e.g. a settings page where the user can select the locale during runtime. +/// +/// Step 1: +/// wrap your App with +/// TranslationProvider( +/// child: MyApp() +/// ); +/// +/// Step 2: +/// final t = Translations.of(context); // Get t variable. +/// String a = t.someKey.anotherKey; // Use t variable. +/// String b = t['someKey.anotherKey']; // Only for edge cases! +class TranslationProvider extends BaseTranslationProvider { + TranslationProvider({required super.child}) : super(settings: LocaleSettings.instance); + + static InheritedLocaleData of(BuildContext context) => InheritedLocaleData.of(context); +} + +/// Method B shorthand via [BuildContext] extension method. +/// Configurable via 'translate_var'. +/// +/// Usage (e.g. in a widget's build method): +/// context.t.someKey.anotherKey +extension BuildContextTranslationsExtension on BuildContext { + Translations get t => TranslationProvider.of(this).translations; +} + +/// Manages all translation instances and the current locale +class LocaleSettings extends BaseFlutterLocaleSettings { + LocaleSettings._() : super( + utils: AppLocaleUtils.instance, + lazy: true, + ); + + static final instance = LocaleSettings._(); + + // static aliases (checkout base methods for documentation) + static AppLocale get currentLocale => instance.currentLocale; + static Stream getLocaleStream() => instance.getLocaleStream(); + static Future setLocale(AppLocale locale, {bool? listenToDeviceLocale = false}) => instance.setLocale(locale, listenToDeviceLocale: listenToDeviceLocale); + static Future setLocaleRaw(String rawLocale, {bool? listenToDeviceLocale = false}) => instance.setLocaleRaw(rawLocale, listenToDeviceLocale: listenToDeviceLocale); + static Future useDeviceLocale() => instance.useDeviceLocale(); + static Future setPluralResolver({String? language, AppLocale? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) => instance.setPluralResolver( + language: language, + locale: locale, + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver, + ); + + // synchronous versions + static AppLocale setLocaleSync(AppLocale locale, {bool? listenToDeviceLocale = false}) => instance.setLocaleSync(locale, listenToDeviceLocale: listenToDeviceLocale); + static AppLocale setLocaleRawSync(String rawLocale, {bool? listenToDeviceLocale = false}) => instance.setLocaleRawSync(rawLocale, listenToDeviceLocale: listenToDeviceLocale); + static AppLocale useDeviceLocaleSync() => instance.useDeviceLocaleSync(); + static void setPluralResolverSync({String? language, AppLocale? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) => instance.setPluralResolverSync( + language: language, + locale: locale, + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver, + ); +} + +/// Provides utility functions without any side effects. +class AppLocaleUtils extends BaseAppLocaleUtils { + AppLocaleUtils._() : super( + baseLocale: AppLocale.en, + locales: AppLocale.values, + ); + + static final instance = AppLocaleUtils._(); + + // static aliases (checkout base methods for documentation) + static AppLocale parse(String rawLocale) => instance.parse(rawLocale); + static AppLocale parseLocaleParts({required String languageCode, String? scriptCode, String? countryCode}) => instance.parseLocaleParts(languageCode: languageCode, scriptCode: scriptCode, countryCode: countryCode); + static AppLocale findDeviceLocale() => instance.findDeviceLocale(); + static List get supportedLocales => instance.supportedLocales; + static List get supportedLocalesRaw => instance.supportedLocalesRaw; +} diff --git a/apps/mobile/packages/core_localization/lib/src/l10n/strings_en.g.dart b/apps/mobile/packages/core_localization/lib/src/l10n/strings_en.g.dart new file mode 100644 index 00000000..40d8a78b --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/src/l10n/strings_en.g.dart @@ -0,0 +1,3119 @@ +/// +/// Generated file. Do not edit. +/// +// coverage:ignore-file +// ignore_for_file: type=lint, unused_import +// dart format off + +part of 'strings.g.dart'; + +// Path: +typedef TranslationsEn = Translations; // ignore: unused_element +class Translations with BaseTranslations { + /// Returns the current translations of the given [context]. + /// + /// Usage: + /// final t = Translations.of(context); + static Translations of(BuildContext context) => InheritedLocaleData.of(context).translations; + + /// You can call this constructor and build your own translation instance of this locale. + /// Constructing via the enum [AppLocale.build] is preferred. + Translations({Map? overrides, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver, TranslationMetadata? meta}) + : assert(overrides == null, 'Set "translation_overrides: true" in order to enable this feature.'), + $meta = meta ?? TranslationMetadata( + locale: AppLocale.en, + overrides: overrides ?? {}, + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver, + ) { + $meta.setFlatMapFunction(_flatMapFunction); + } + + /// Metadata for the translations of . + @override final TranslationMetadata $meta; + + /// Access flat map + dynamic operator[](String key) => $meta.getTranslation(key); + + late final Translations _root = this; // ignore: unused_field + + Translations $copyWith({TranslationMetadata? meta}) => Translations(meta: meta ?? this.$meta); + + // Translations + late final TranslationsCommonEn common = TranslationsCommonEn._(_root); + late final TranslationsSettingsEn settings = TranslationsSettingsEn._(_root); + late final TranslationsStaffAuthenticationEn staff_authentication = TranslationsStaffAuthenticationEn._(_root); + late final TranslationsClientAuthenticationEn client_authentication = TranslationsClientAuthenticationEn._(_root); + late final TranslationsClientHomeEn client_home = TranslationsClientHomeEn._(_root); + late final TranslationsClientSettingsEn client_settings = TranslationsClientSettingsEn._(_root); + late final TranslationsClientHubsEn client_hubs = TranslationsClientHubsEn._(_root); + late final TranslationsClientCreateOrderEn client_create_order = TranslationsClientCreateOrderEn._(_root); + late final TranslationsClientMainEn client_main = TranslationsClientMainEn._(_root); + late final TranslationsClientViewOrdersEn client_view_orders = TranslationsClientViewOrdersEn._(_root); + late final TranslationsClientBillingEn client_billing = TranslationsClientBillingEn._(_root); + late final TranslationsStaffEn staff = TranslationsStaffEn._(_root); + late final TranslationsStaffDocumentsEn staff_documents = TranslationsStaffDocumentsEn._(_root); + late final TranslationsStaffCertificatesEn staff_certificates = TranslationsStaffCertificatesEn._(_root); + late final TranslationsStaffProfileAttireEn staff_profile_attire = TranslationsStaffProfileAttireEn._(_root); + late final TranslationsStaffShiftsEn staff_shifts = TranslationsStaffShiftsEn._(_root); +} + +// Path: common +class TranslationsCommonEn { + TranslationsCommonEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'OK' + String get ok => 'OK'; + + /// en: 'Cancel' + String get cancel => 'Cancel'; + + /// en: 'Save' + String get save => 'Save'; + + /// en: 'Delete' + String get delete => 'Delete'; + + /// en: 'Continue' + String get continue_text => 'Continue'; +} + +// Path: settings +class TranslationsSettingsEn { + TranslationsSettingsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Language' + String get language => 'Language'; + + /// en: 'Change Language' + String get change_language => 'Change Language'; +} + +// Path: staff_authentication +class TranslationsStaffAuthenticationEn { + TranslationsStaffAuthenticationEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + late final TranslationsStaffAuthenticationGetStartedPageEn get_started_page = TranslationsStaffAuthenticationGetStartedPageEn._(_root); + late final TranslationsStaffAuthenticationPhoneVerificationPageEn phone_verification_page = TranslationsStaffAuthenticationPhoneVerificationPageEn._(_root); + late final TranslationsStaffAuthenticationPhoneInputEn phone_input = TranslationsStaffAuthenticationPhoneInputEn._(_root); + late final TranslationsStaffAuthenticationOtpVerificationEn otp_verification = TranslationsStaffAuthenticationOtpVerificationEn._(_root); + late final TranslationsStaffAuthenticationProfileSetupPageEn profile_setup_page = TranslationsStaffAuthenticationProfileSetupPageEn._(_root); + late final TranslationsStaffAuthenticationCommonEn common = TranslationsStaffAuthenticationCommonEn._(_root); +} + +// Path: client_authentication +class TranslationsClientAuthenticationEn { + TranslationsClientAuthenticationEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + late final TranslationsClientAuthenticationGetStartedPageEn get_started_page = TranslationsClientAuthenticationGetStartedPageEn._(_root); + late final TranslationsClientAuthenticationSignInPageEn sign_in_page = TranslationsClientAuthenticationSignInPageEn._(_root); + late final TranslationsClientAuthenticationSignUpPageEn sign_up_page = TranslationsClientAuthenticationSignUpPageEn._(_root); +} + +// Path: client_home +class TranslationsClientHomeEn { + TranslationsClientHomeEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + late final TranslationsClientHomeDashboardEn dashboard = TranslationsClientHomeDashboardEn._(_root); + late final TranslationsClientHomeWidgetsEn widgets = TranslationsClientHomeWidgetsEn._(_root); + late final TranslationsClientHomeActionsEn actions = TranslationsClientHomeActionsEn._(_root); + late final TranslationsClientHomeReorderEn reorder = TranslationsClientHomeReorderEn._(_root); + late final TranslationsClientHomeFormEn form = TranslationsClientHomeFormEn._(_root); +} + +// Path: client_settings +class TranslationsClientSettingsEn { + TranslationsClientSettingsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + late final TranslationsClientSettingsProfileEn profile = TranslationsClientSettingsProfileEn._(_root); +} + +// Path: client_hubs +class TranslationsClientHubsEn { + TranslationsClientHubsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Hubs' + String get title => 'Hubs'; + + /// en: 'Manage clock-in locations' + String get subtitle => 'Manage clock-in locations'; + + /// en: 'Add Hub' + String get add_hub => 'Add Hub'; + + late final TranslationsClientHubsEmptyStateEn empty_state = TranslationsClientHubsEmptyStateEn._(_root); + late final TranslationsClientHubsAboutHubsEn about_hubs = TranslationsClientHubsAboutHubsEn._(_root); + late final TranslationsClientHubsHubCardEn hub_card = TranslationsClientHubsHubCardEn._(_root); + late final TranslationsClientHubsAddHubDialogEn add_hub_dialog = TranslationsClientHubsAddHubDialogEn._(_root); + late final TranslationsClientHubsNfcDialogEn nfc_dialog = TranslationsClientHubsNfcDialogEn._(_root); +} + +// Path: client_create_order +class TranslationsClientCreateOrderEn { + TranslationsClientCreateOrderEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Create Order' + String get title => 'Create Order'; + + /// en: 'ORDER TYPE' + String get section_title => 'ORDER TYPE'; + + late final TranslationsClientCreateOrderTypesEn types = TranslationsClientCreateOrderTypesEn._(_root); + late final TranslationsClientCreateOrderRapidEn rapid = TranslationsClientCreateOrderRapidEn._(_root); + late final TranslationsClientCreateOrderOneTimeEn one_time = TranslationsClientCreateOrderOneTimeEn._(_root); + late final TranslationsClientCreateOrderRecurringEn recurring = TranslationsClientCreateOrderRecurringEn._(_root); + late final TranslationsClientCreateOrderPermanentEn permanent = TranslationsClientCreateOrderPermanentEn._(_root); +} + +// Path: client_main +class TranslationsClientMainEn { + TranslationsClientMainEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + late final TranslationsClientMainTabsEn tabs = TranslationsClientMainTabsEn._(_root); +} + +// Path: client_view_orders +class TranslationsClientViewOrdersEn { + TranslationsClientViewOrdersEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Orders' + String get title => 'Orders'; + + /// en: 'Post' + String get post_button => 'Post'; + + /// en: 'Post an Order' + String get post_order => 'Post an Order'; + + /// en: 'No orders for $date' + String no_orders({required Object date}) => 'No orders for ${date}'; + + late final TranslationsClientViewOrdersTabsEn tabs = TranslationsClientViewOrdersTabsEn._(_root); + late final TranslationsClientViewOrdersCardEn card = TranslationsClientViewOrdersCardEn._(_root); +} + +// Path: client_billing +class TranslationsClientBillingEn { + TranslationsClientBillingEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Billing' + String get title => 'Billing'; + + /// en: 'Current Period' + String get current_period => 'Current Period'; + + /// en: '$amount saved' + String saved_amount({required Object amount}) => '${amount} saved'; + + /// en: 'Awaiting Approval' + String get awaiting_approval => 'Awaiting Approval'; + + /// en: 'Payment Method' + String get payment_method => 'Payment Method'; + + /// en: 'Add' + String get add_payment => 'Add'; + + /// en: 'Default' + String get default_badge => 'Default'; + + /// en: 'Expires $date' + String expires({required Object date}) => 'Expires ${date}'; + + /// en: 'This Period Breakdown' + String get period_breakdown => 'This Period Breakdown'; + + /// en: 'Week' + String get week => 'Week'; + + /// en: 'Month' + String get month => 'Month'; + + /// en: 'Total' + String get total => 'Total'; + + /// en: '$count hours' + String hours({required Object count}) => '${count} hours'; + + /// en: 'Rate Optimization' + String get rate_optimization_title => 'Rate Optimization'; + + /// en: 'Save $amount/month by switching 3 shifts' + String rate_optimization_body({required Object amount}) => 'Save ${amount}/month by switching 3 shifts'; + + /// en: 'View Details' + String get view_details => 'View Details'; + + /// en: 'Invoice History' + String get invoice_history => 'Invoice History'; + + /// en: 'View all' + String get view_all => 'View all'; + + /// en: 'Export All Invoices' + String get export_button => 'Export All Invoices'; + + /// en: 'PENDING APPROVAL' + String get pending_badge => 'PENDING APPROVAL'; + + /// en: 'PAID' + String get paid_badge => 'PAID'; +} + +// Path: staff +class TranslationsStaffEn { + TranslationsStaffEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + late final TranslationsStaffMainEn main = TranslationsStaffMainEn._(_root); + late final TranslationsStaffHomeEn home = TranslationsStaffHomeEn._(_root); + late final TranslationsStaffProfileEn profile = TranslationsStaffProfileEn._(_root); + late final TranslationsStaffOnboardingEn onboarding = TranslationsStaffOnboardingEn._(_root); +} + +// Path: staff_documents +class TranslationsStaffDocumentsEn { + TranslationsStaffDocumentsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Documents' + String get title => 'Documents'; + + late final TranslationsStaffDocumentsVerificationCardEn verification_card = TranslationsStaffDocumentsVerificationCardEn._(_root); + late final TranslationsStaffDocumentsListEn list = TranslationsStaffDocumentsListEn._(_root); + late final TranslationsStaffDocumentsCardEn card = TranslationsStaffDocumentsCardEn._(_root); +} + +// Path: staff_certificates +class TranslationsStaffCertificatesEn { + TranslationsStaffCertificatesEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Certificates' + String get title => 'Certificates'; + + late final TranslationsStaffCertificatesProgressEn progress = TranslationsStaffCertificatesProgressEn._(_root); + late final TranslationsStaffCertificatesCardEn card = TranslationsStaffCertificatesCardEn._(_root); + late final TranslationsStaffCertificatesAddMoreEn add_more = TranslationsStaffCertificatesAddMoreEn._(_root); + late final TranslationsStaffCertificatesUploadModalEn upload_modal = TranslationsStaffCertificatesUploadModalEn._(_root); + late final TranslationsStaffCertificatesDeleteModalEn delete_modal = TranslationsStaffCertificatesDeleteModalEn._(_root); +} + +// Path: staff_profile_attire +class TranslationsStaffProfileAttireEn { + TranslationsStaffProfileAttireEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Attire' + String get title => 'Attire'; + + late final TranslationsStaffProfileAttireInfoCardEn info_card = TranslationsStaffProfileAttireInfoCardEn._(_root); + late final TranslationsStaffProfileAttireStatusEn status = TranslationsStaffProfileAttireStatusEn._(_root); + + /// en: 'I certify that I own these items and will wear them to my shifts. I understand that items are pending manager verification at my first shift.' + String get attestation => 'I certify that I own these items and will wear them to my shifts. I understand that items are pending manager verification at my first shift.'; + + late final TranslationsStaffProfileAttireActionsEn actions = TranslationsStaffProfileAttireActionsEn._(_root); + late final TranslationsStaffProfileAttireValidationEn validation = TranslationsStaffProfileAttireValidationEn._(_root); +} + +// Path: staff_shifts +class TranslationsStaffShiftsEn { + TranslationsStaffShiftsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Shifts' + String get title => 'Shifts'; + + late final TranslationsStaffShiftsTabsEn tabs = TranslationsStaffShiftsTabsEn._(_root); + late final TranslationsStaffShiftsListEn list = TranslationsStaffShiftsListEn._(_root); + late final TranslationsStaffShiftsFilterEn filter = TranslationsStaffShiftsFilterEn._(_root); + late final TranslationsStaffShiftsStatusEn status = TranslationsStaffShiftsStatusEn._(_root); + late final TranslationsStaffShiftsActionEn action = TranslationsStaffShiftsActionEn._(_root); + late final TranslationsStaffShiftsDetailsEn details = TranslationsStaffShiftsDetailsEn._(_root); + late final TranslationsStaffShiftsTagsEn tags = TranslationsStaffShiftsTagsEn._(_root); +} + +// Path: staff_authentication.get_started_page +class TranslationsStaffAuthenticationGetStartedPageEn { + TranslationsStaffAuthenticationGetStartedPageEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Work, Grow, ' + String get title_part1 => 'Work, Grow, '; + + /// en: 'Elevate' + String get title_part2 => 'Elevate'; + + /// en: 'Build your career in hospitality with flexibility and freedom.' + String get subtitle => 'Build your career in hospitality with \nflexibility and freedom.'; + + /// en: 'Sign Up' + String get sign_up_button => 'Sign Up'; + + /// en: 'Log In' + String get log_in_button => 'Log In'; +} + +// Path: staff_authentication.phone_verification_page +class TranslationsStaffAuthenticationPhoneVerificationPageEn { + TranslationsStaffAuthenticationPhoneVerificationPageEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Please enter a valid 10-digit phone number' + String get validation_error => 'Please enter a valid 10-digit phone number'; + + /// en: 'Send Code' + String get send_code_button => 'Send Code'; + + /// en: 'Enter verification code' + String get enter_code_title => 'Enter verification code'; + + /// en: 'We sent a 6-digit code to ' + String get code_sent_message => 'We sent a 6-digit code to '; + + /// en: '. Enter it below to verify your account.' + String get code_sent_instruction => '. Enter it below to verify your account.'; +} + +// Path: staff_authentication.phone_input +class TranslationsStaffAuthenticationPhoneInputEn { + TranslationsStaffAuthenticationPhoneInputEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Verify your phone number' + String get title => 'Verify your phone number'; + + /// en: 'We'll send you a verification code to get started.' + String get subtitle => 'We\'ll send you a verification code to get started.'; + + /// en: 'Phone Number' + String get label => 'Phone Number'; + + /// en: 'Enter your number' + String get hint => 'Enter your number'; +} + +// Path: staff_authentication.otp_verification +class TranslationsStaffAuthenticationOtpVerificationEn { + TranslationsStaffAuthenticationOtpVerificationEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Didn't get the code ?' + String get did_not_get_code => 'Didn\'t get the code ?'; + + /// en: 'Resend in $seconds s' + String resend_in({required Object seconds}) => 'Resend in ${seconds} s'; + + /// en: 'Resend code' + String get resend_code => 'Resend code'; +} + +// Path: staff_authentication.profile_setup_page +class TranslationsStaffAuthenticationProfileSetupPageEn { + TranslationsStaffAuthenticationProfileSetupPageEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Step $current of $total' + String step_indicator({required Object current, required Object total}) => 'Step ${current} of ${total}'; + + /// en: 'An error occurred' + String get error_occurred => 'An error occurred'; + + /// en: 'Complete Setup' + String get complete_setup_button => 'Complete Setup'; + + late final TranslationsStaffAuthenticationProfileSetupPageStepsEn steps = TranslationsStaffAuthenticationProfileSetupPageStepsEn._(_root); + late final TranslationsStaffAuthenticationProfileSetupPageBasicInfoEn basic_info = TranslationsStaffAuthenticationProfileSetupPageBasicInfoEn._(_root); + late final TranslationsStaffAuthenticationProfileSetupPageLocationEn location = TranslationsStaffAuthenticationProfileSetupPageLocationEn._(_root); + late final TranslationsStaffAuthenticationProfileSetupPageExperienceEn experience = TranslationsStaffAuthenticationProfileSetupPageExperienceEn._(_root); +} + +// Path: staff_authentication.common +class TranslationsStaffAuthenticationCommonEn { + TranslationsStaffAuthenticationCommonEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Having trouble? ' + String get trouble_question => 'Having trouble? '; + + /// en: 'Contact Support' + String get contact_support => 'Contact Support'; +} + +// Path: client_authentication.get_started_page +class TranslationsClientAuthenticationGetStartedPageEn { + TranslationsClientAuthenticationGetStartedPageEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Take Control of Your Shifts and Events' + String get title => 'Take Control of Your\nShifts and Events'; + + /// en: 'Streamline your operations with powerful tools to manage schedules, track performance, and keep your team on the same pageβ€”all in one place' + String get subtitle => 'Streamline your operations with powerful tools to manage schedules, track performance, and keep your team on the same pageβ€”all in one place'; + + /// en: 'Sign In' + String get sign_in_button => 'Sign In'; + + /// en: 'Create Account' + String get create_account_button => 'Create Account'; +} + +// Path: client_authentication.sign_in_page +class TranslationsClientAuthenticationSignInPageEn { + TranslationsClientAuthenticationSignInPageEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Welcome Back' + String get title => 'Welcome Back'; + + /// en: 'Sign in to manage your shifts and workers' + String get subtitle => 'Sign in to manage your shifts and workers'; + + /// en: 'Email' + String get email_label => 'Email'; + + /// en: 'Enter your email' + String get email_hint => 'Enter your email'; + + /// en: 'Password' + String get password_label => 'Password'; + + /// en: 'Enter your password' + String get password_hint => 'Enter your password'; + + /// en: 'Forgot Password?' + String get forgot_password => 'Forgot Password?'; + + /// en: 'Sign In' + String get sign_in_button => 'Sign In'; + + /// en: 'or' + String get or_divider => 'or'; + + /// en: 'Sign In with Apple' + String get social_apple => 'Sign In with Apple'; + + /// en: 'Sign In with Google' + String get social_google => 'Sign In with Google'; + + /// en: 'Don't have an account? ' + String get no_account => 'Don\'t have an account? '; + + /// en: 'Sign Up' + String get sign_up_link => 'Sign Up'; +} + +// Path: client_authentication.sign_up_page +class TranslationsClientAuthenticationSignUpPageEn { + TranslationsClientAuthenticationSignUpPageEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Create Account' + String get title => 'Create Account'; + + /// en: 'Get started with Krow for your business' + String get subtitle => 'Get started with Krow for your business'; + + /// en: 'Company Name' + String get company_label => 'Company Name'; + + /// en: 'Enter company name' + String get company_hint => 'Enter company name'; + + /// en: 'Email' + String get email_label => 'Email'; + + /// en: 'Enter your email' + String get email_hint => 'Enter your email'; + + /// en: 'Password' + String get password_label => 'Password'; + + /// en: 'Create a password' + String get password_hint => 'Create a password'; + + /// en: 'Confirm Password' + String get confirm_password_label => 'Confirm Password'; + + /// en: 'Confirm your password' + String get confirm_password_hint => 'Confirm your password'; + + /// en: 'Create Account' + String get create_account_button => 'Create Account'; + + /// en: 'or' + String get or_divider => 'or'; + + /// en: 'Sign Up with Apple' + String get social_apple => 'Sign Up with Apple'; + + /// en: 'Sign Up with Google' + String get social_google => 'Sign Up with Google'; + + /// en: 'Already have an account? ' + String get has_account => 'Already have an account? '; + + /// en: 'Sign In' + String get sign_in_link => 'Sign In'; +} + +// Path: client_home.dashboard +class TranslationsClientHomeDashboardEn { + TranslationsClientHomeDashboardEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Welcome back' + String get welcome_back => 'Welcome back'; + + /// en: 'Edit Mode Active' + String get edit_mode_active => 'Edit Mode Active'; + + /// en: 'Drag to reorder, toggle visibility' + String get drag_instruction => 'Drag to reorder, toggle visibility'; + + /// en: 'Reset' + String get reset => 'Reset'; + + /// en: 'Needed' + String get metric_needed => 'Needed'; + + /// en: 'Filled' + String get metric_filled => 'Filled'; + + /// en: 'Open' + String get metric_open => 'Open'; + + /// en: 'View all' + String get view_all => 'View all'; + + /// en: 'Save $amount/month' + String insight_lightbulb({required Object amount}) => 'Save ${amount}/month'; + + /// en: 'Book 48hrs ahead for better rates' + String get insight_tip => 'Book 48hrs ahead for better rates'; +} + +// Path: client_home.widgets +class TranslationsClientHomeWidgetsEn { + TranslationsClientHomeWidgetsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Quick Actions' + String get actions => 'Quick Actions'; + + /// en: 'Reorder' + String get reorder => 'Reorder'; + + /// en: 'Today's Coverage' + String get coverage => 'Today\'s Coverage'; + + /// en: 'Spending Insights' + String get spending => 'Spending Insights'; + + /// en: 'Live Activity' + String get live_activity => 'Live Activity'; +} + +// Path: client_home.actions +class TranslationsClientHomeActionsEn { + TranslationsClientHomeActionsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'RAPID' + String get rapid => 'RAPID'; + + /// en: 'Urgent same-day' + String get rapid_subtitle => 'Urgent same-day'; + + /// en: 'Create Order' + String get create_order => 'Create Order'; + + /// en: 'Schedule shifts' + String get create_order_subtitle => 'Schedule shifts'; + + /// en: 'Hubs' + String get hubs => 'Hubs'; + + /// en: 'Clock-in points' + String get hubs_subtitle => 'Clock-in points'; +} + +// Path: client_home.reorder +class TranslationsClientHomeReorderEn { + TranslationsClientHomeReorderEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'REORDER' + String get title => 'REORDER'; + + /// en: 'Reorder' + String get reorder_button => 'Reorder'; + + /// en: '$amount/hr' + String per_hr({required Object amount}) => '${amount}/hr'; +} + +// Path: client_home.form +class TranslationsClientHomeFormEn { + TranslationsClientHomeFormEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Edit & Reorder' + String get edit_reorder => 'Edit & Reorder'; + + /// en: 'Post a New Shift' + String get post_new => 'Post a New Shift'; + + /// en: 'Review and edit the details before posting' + String get review_subtitle => 'Review and edit the details before posting'; + + /// en: 'Date *' + String get date_label => 'Date *'; + + /// en: 'mm/dd/yyyy' + String get date_hint => 'mm/dd/yyyy'; + + /// en: 'Location *' + String get location_label => 'Location *'; + + /// en: 'Business address' + String get location_hint => 'Business address'; + + /// en: 'Positions' + String get positions_title => 'Positions'; + + /// en: 'Add Position' + String get add_position => 'Add Position'; + + /// en: 'Role *' + String get role_label => 'Role *'; + + /// en: 'Select role' + String get role_hint => 'Select role'; + + /// en: 'Start Time *' + String get start_time => 'Start Time *'; + + /// en: 'End Time *' + String get end_time => 'End Time *'; + + /// en: 'Workers Needed *' + String get workers_needed => 'Workers Needed *'; + + /// en: 'Hourly Rate (\$) *' + String get hourly_rate => 'Hourly Rate (\$) *'; + + /// en: 'Post Shift' + String get post_shift => 'Post Shift'; +} + +// Path: client_settings.profile +class TranslationsClientSettingsProfileEn { + TranslationsClientSettingsProfileEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Profile' + String get title => 'Profile'; + + /// en: 'Edit Profile' + String get edit_profile => 'Edit Profile'; + + /// en: 'Hubs' + String get hubs => 'Hubs'; + + /// en: 'Log Out' + String get log_out => 'Log Out'; + + /// en: 'Quick Links' + String get quick_links => 'Quick Links'; + + /// en: 'Clock-In Hubs' + String get clock_in_hubs => 'Clock-In Hubs'; + + /// en: 'Billing & Payments' + String get billing_payments => 'Billing & Payments'; +} + +// Path: client_hubs.empty_state +class TranslationsClientHubsEmptyStateEn { + TranslationsClientHubsEmptyStateEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'No hubs yet' + String get title => 'No hubs yet'; + + /// en: 'Create clock-in stations for your locations' + String get description => 'Create clock-in stations for your locations'; + + /// en: 'Add Your First Hub' + String get button => 'Add Your First Hub'; +} + +// Path: client_hubs.about_hubs +class TranslationsClientHubsAboutHubsEn { + TranslationsClientHubsAboutHubsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'About Hubs' + String get title => 'About Hubs'; + + /// en: 'Hubs are clock-in stations at your locations. Assign NFC tags to each hub so workers can quickly clock in/out using their phones.' + String get description => 'Hubs are clock-in stations at your locations. Assign NFC tags to each hub so workers can quickly clock in/out using their phones.'; +} + +// Path: client_hubs.hub_card +class TranslationsClientHubsHubCardEn { + TranslationsClientHubsHubCardEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Tag: $id' + String tag_label({required Object id}) => 'Tag: ${id}'; +} + +// Path: client_hubs.add_hub_dialog +class TranslationsClientHubsAddHubDialogEn { + TranslationsClientHubsAddHubDialogEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Add New Hub' + String get title => 'Add New Hub'; + + /// en: 'Hub Name *' + String get name_label => 'Hub Name *'; + + /// en: 'e.g., Main Kitchen, Front Desk' + String get name_hint => 'e.g., Main Kitchen, Front Desk'; + + /// en: 'Location Name' + String get location_label => 'Location Name'; + + /// en: 'e.g., Downtown Restaurant' + String get location_hint => 'e.g., Downtown Restaurant'; + + /// en: 'Address' + String get address_label => 'Address'; + + /// en: 'Full address' + String get address_hint => 'Full address'; + + /// en: 'Create Hub' + String get create_button => 'Create Hub'; +} + +// Path: client_hubs.nfc_dialog +class TranslationsClientHubsNfcDialogEn { + TranslationsClientHubsNfcDialogEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Identify NFC Tag' + String get title => 'Identify NFC Tag'; + + /// en: 'Tap your phone to the NFC tag to identify it' + String get instruction => 'Tap your phone to the NFC tag to identify it'; + + /// en: 'Scan NFC Tag' + String get scan_button => 'Scan NFC Tag'; + + /// en: 'Tag Identified' + String get tag_identified => 'Tag Identified'; + + /// en: 'Assign Tag' + String get assign_button => 'Assign Tag'; +} + +// Path: client_create_order.types +class TranslationsClientCreateOrderTypesEn { + TranslationsClientCreateOrderTypesEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'RAPID' + String get rapid => 'RAPID'; + + /// en: 'URGENT same-day Coverage' + String get rapid_desc => 'URGENT same-day Coverage'; + + /// en: 'One-Time' + String get one_time => 'One-Time'; + + /// en: 'Single Event or Shift Request' + String get one_time_desc => 'Single Event or Shift Request'; + + /// en: 'Recurring' + String get recurring => 'Recurring'; + + /// en: 'Ongoing Weekly / Monthly Coverage' + String get recurring_desc => 'Ongoing Weekly / Monthly Coverage'; + + /// en: 'Permanent' + String get permanent => 'Permanent'; + + /// en: 'Long-Term Staffing Placement' + String get permanent_desc => 'Long-Term Staffing Placement'; +} + +// Path: client_create_order.rapid +class TranslationsClientCreateOrderRapidEn { + TranslationsClientCreateOrderRapidEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'RAPID Order' + String get title => 'RAPID Order'; + + /// en: 'Emergency staffing in minutes' + String get subtitle => 'Emergency staffing in minutes'; + + /// en: 'URGENT' + String get urgent_badge => 'URGENT'; + + /// en: 'Tell us what you need' + String get tell_us => 'Tell us what you need'; + + /// en: 'Need staff urgently?' + String get need_staff => 'Need staff urgently?'; + + /// en: 'Type or speak what you need. I'll handle the rest' + String get type_or_speak => 'Type or speak what you need. I\'ll handle the rest'; + + /// en: 'Example: ' + String get example => 'Example: '; + + /// en: 'Type or speak... (e.g., "Need 5 cooks ASAP until 5am")' + String get hint => 'Type or speak... (e.g., "Need 5 cooks ASAP until 5am")'; + + /// en: 'Speak' + String get speak => 'Speak'; + + /// en: 'Listening...' + String get listening => 'Listening...'; + + /// en: 'Send Message' + String get send => 'Send Message'; + + /// en: 'Sending...' + String get sending => 'Sending...'; + + /// en: 'Request Sent!' + String get success_title => 'Request Sent!'; + + /// en: 'We're finding available workers for you right now. You'll be notified as they accept.' + String get success_message => 'We\'re finding available workers for you right now. You\'ll be notified as they accept.'; + + /// en: 'Back to Orders' + String get back_to_orders => 'Back to Orders'; +} + +// Path: client_create_order.one_time +class TranslationsClientCreateOrderOneTimeEn { + TranslationsClientCreateOrderOneTimeEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'One-Time Order' + String get title => 'One-Time Order'; + + /// en: 'Single event or shift request' + String get subtitle => 'Single event or shift request'; + + /// en: 'Create Your Order' + String get create_your_order => 'Create Your Order'; + + /// en: 'Date' + String get date_label => 'Date'; + + /// en: 'Select date' + String get date_hint => 'Select date'; + + /// en: 'Location' + String get location_label => 'Location'; + + /// en: 'Enter address' + String get location_hint => 'Enter address'; + + /// en: 'Positions' + String get positions_title => 'Positions'; + + /// en: 'Add Position' + String get add_position => 'Add Position'; + + /// en: 'Position $number' + String position_number({required Object number}) => 'Position ${number}'; + + /// en: 'Remove' + String get remove => 'Remove'; + + /// en: 'Select role' + String get select_role => 'Select role'; + + /// en: 'Start' + String get start_label => 'Start'; + + /// en: 'End' + String get end_label => 'End'; + + /// en: 'Workers' + String get workers_label => 'Workers'; + + /// en: 'Lunch Break' + String get lunch_break_label => 'Lunch Break'; + + /// en: 'No break' + String get no_break => 'No break'; + + /// en: 'min (Paid)' + String get paid_break => 'min (Paid)'; + + /// en: 'min (Unpaid)' + String get unpaid_break => 'min (Unpaid)'; + + /// en: 'Use different location for this position' + String get different_location => 'Use different location for this position'; + + /// en: 'Different Location' + String get different_location_title => 'Different Location'; + + /// en: 'Enter different address' + String get different_location_hint => 'Enter different address'; + + /// en: 'Create Order' + String get create_order => 'Create Order'; + + /// en: 'Creating...' + String get creating => 'Creating...'; + + /// en: 'Order Created!' + String get success_title => 'Order Created!'; + + /// en: 'Your shift request has been posted. Workers will start applying soon.' + String get success_message => 'Your shift request has been posted. Workers will start applying soon.'; + + /// en: 'Back to Orders' + String get back_to_orders => 'Back to Orders'; +} + +// Path: client_create_order.recurring +class TranslationsClientCreateOrderRecurringEn { + TranslationsClientCreateOrderRecurringEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Recurring Order' + String get title => 'Recurring Order'; + + /// en: 'Ongoing weekly/monthly coverage' + String get subtitle => 'Ongoing weekly/monthly coverage'; + + /// en: 'Recurring Order Flow (Work in Progress)' + String get placeholder => 'Recurring Order Flow (Work in Progress)'; +} + +// Path: client_create_order.permanent +class TranslationsClientCreateOrderPermanentEn { + TranslationsClientCreateOrderPermanentEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Permanent Order' + String get title => 'Permanent Order'; + + /// en: 'Long-term staffing placement' + String get subtitle => 'Long-term staffing placement'; + + /// en: 'Permanent Order Flow (Work in Progress)' + String get placeholder => 'Permanent Order Flow (Work in Progress)'; +} + +// Path: client_main.tabs +class TranslationsClientMainTabsEn { + TranslationsClientMainTabsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Coverage' + String get coverage => 'Coverage'; + + /// en: 'Billing' + String get billing => 'Billing'; + + /// en: 'Home' + String get home => 'Home'; + + /// en: 'Orders' + String get orders => 'Orders'; + + /// en: 'Reports' + String get reports => 'Reports'; +} + +// Path: client_view_orders.tabs +class TranslationsClientViewOrdersTabsEn { + TranslationsClientViewOrdersTabsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Up Next' + String get up_next => 'Up Next'; + + /// en: 'Active' + String get active => 'Active'; + + /// en: 'Completed' + String get completed => 'Completed'; +} + +// Path: client_view_orders.card +class TranslationsClientViewOrdersCardEn { + TranslationsClientViewOrdersCardEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'OPEN' + String get open => 'OPEN'; + + /// en: 'FILLED' + String get filled => 'FILLED'; + + /// en: 'CONFIRMED' + String get confirmed => 'CONFIRMED'; + + /// en: 'IN PROGRESS' + String get in_progress => 'IN PROGRESS'; + + /// en: 'COMPLETED' + String get completed => 'COMPLETED'; + + /// en: 'CANCELLED' + String get cancelled => 'CANCELLED'; + + /// en: 'Get direction' + String get get_direction => 'Get direction'; + + /// en: 'Total' + String get total => 'Total'; + + /// en: 'HRS' + String get hrs => 'HRS'; + + /// en: '$count workers' + String workers({required Object count}) => '${count} workers'; + + /// en: 'CLOCK IN' + String get clock_in => 'CLOCK IN'; + + /// en: 'CLOCK OUT' + String get clock_out => 'CLOCK OUT'; + + /// en: 'Coverage' + String get coverage => 'Coverage'; + + /// en: '$filled/$needed Workers' + String workers_label({required Object filled, required Object needed}) => '${filled}/${needed} Workers'; + + /// en: 'Workers Confirmed' + String get confirmed_workers => 'Workers Confirmed'; + + /// en: 'No workers confirmed yet.' + String get no_workers => 'No workers confirmed yet.'; +} + +// Path: staff.main +class TranslationsStaffMainEn { + TranslationsStaffMainEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + late final TranslationsStaffMainTabsEn tabs = TranslationsStaffMainTabsEn._(_root); +} + +// Path: staff.home +class TranslationsStaffHomeEn { + TranslationsStaffHomeEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + late final TranslationsStaffHomeHeaderEn header = TranslationsStaffHomeHeaderEn._(_root); + late final TranslationsStaffHomeBannersEn banners = TranslationsStaffHomeBannersEn._(_root); + late final TranslationsStaffHomeQuickActionsEn quick_actions = TranslationsStaffHomeQuickActionsEn._(_root); + late final TranslationsStaffHomeSectionsEn sections = TranslationsStaffHomeSectionsEn._(_root); + late final TranslationsStaffHomeEmptyStatesEn empty_states = TranslationsStaffHomeEmptyStatesEn._(_root); + late final TranslationsStaffHomePendingPaymentEn pending_payment = TranslationsStaffHomePendingPaymentEn._(_root); + late final TranslationsStaffHomeRecommendedCardEn recommended_card = TranslationsStaffHomeRecommendedCardEn._(_root); + late final TranslationsStaffHomeBenefitsEn benefits = TranslationsStaffHomeBenefitsEn._(_root); + late final TranslationsStaffHomeAutoMatchEn auto_match = TranslationsStaffHomeAutoMatchEn._(_root); + late final TranslationsStaffHomeImproveEn improve = TranslationsStaffHomeImproveEn._(_root); + late final TranslationsStaffHomeMoreWaysEn more_ways = TranslationsStaffHomeMoreWaysEn._(_root); +} + +// Path: staff.profile +class TranslationsStaffProfileEn { + TranslationsStaffProfileEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + late final TranslationsStaffProfileHeaderEn header = TranslationsStaffProfileHeaderEn._(_root); + late final TranslationsStaffProfileReliabilityStatsEn reliability_stats = TranslationsStaffProfileReliabilityStatsEn._(_root); + late final TranslationsStaffProfileReliabilityScoreEn reliability_score = TranslationsStaffProfileReliabilityScoreEn._(_root); + late final TranslationsStaffProfileSectionsEn sections = TranslationsStaffProfileSectionsEn._(_root); + late final TranslationsStaffProfileMenuItemsEn menu_items = TranslationsStaffProfileMenuItemsEn._(_root); + late final TranslationsStaffProfileBankAccountPageEn bank_account_page = TranslationsStaffProfileBankAccountPageEn._(_root); + late final TranslationsStaffProfileLogoutEn logout = TranslationsStaffProfileLogoutEn._(_root); +} + +// Path: staff.onboarding +class TranslationsStaffOnboardingEn { + TranslationsStaffOnboardingEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + late final TranslationsStaffOnboardingPersonalInfoEn personal_info = TranslationsStaffOnboardingPersonalInfoEn._(_root); + late final TranslationsStaffOnboardingExperienceEn experience = TranslationsStaffOnboardingExperienceEn._(_root); +} + +// Path: staff_documents.verification_card +class TranslationsStaffDocumentsVerificationCardEn { + TranslationsStaffDocumentsVerificationCardEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Document Verification' + String get title => 'Document Verification'; + + /// en: '$completed/$total Complete' + String progress({required Object completed, required Object total}) => '${completed}/${total} Complete'; +} + +// Path: staff_documents.list +class TranslationsStaffDocumentsListEn { + TranslationsStaffDocumentsListEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'No documents found' + String get empty => 'No documents found'; + + /// en: 'Error: $message' + String error({required Object message}) => 'Error: ${message}'; +} + +// Path: staff_documents.card +class TranslationsStaffDocumentsCardEn { + TranslationsStaffDocumentsCardEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'View' + String get view => 'View'; + + /// en: 'Upload' + String get upload => 'Upload'; + + /// en: 'Verified' + String get verified => 'Verified'; + + /// en: 'Pending' + String get pending => 'Pending'; + + /// en: 'Missing' + String get missing => 'Missing'; + + /// en: 'Rejected' + String get rejected => 'Rejected'; +} + +// Path: staff_certificates.progress +class TranslationsStaffCertificatesProgressEn { + TranslationsStaffCertificatesProgressEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Your Progress' + String get title => 'Your Progress'; + + /// en: '$completed of $total verified' + String verified_count({required Object completed, required Object total}) => '${completed} of ${total} verified'; + + /// en: 'Compliance Active' + String get active => 'Compliance Active'; +} + +// Path: staff_certificates.card +class TranslationsStaffCertificatesCardEn { + TranslationsStaffCertificatesCardEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Expires in $days days - Renew now' + String expires_in_days({required Object days}) => 'Expires in ${days} days - Renew now'; + + /// en: 'Expired - Renew now' + String get expired => 'Expired - Renew now'; + + /// en: 'Verified' + String get verified => 'Verified'; + + /// en: 'Expiring Soon' + String get expiring_soon => 'Expiring Soon'; + + /// en: 'Exp: $date' + String exp({required Object date}) => 'Exp: ${date}'; + + /// en: 'Upload Certificate' + String get upload_button => 'Upload Certificate'; + + /// en: 'Edit Expiration Date' + String get edit_expiry => 'Edit Expiration Date'; + + /// en: 'Remove Certificate' + String get remove => 'Remove Certificate'; + + /// en: 'Renew' + String get renew => 'Renew'; + + /// en: 'Certificate opened in new tab' + String get opened_snackbar => 'Certificate opened in new tab'; +} + +// Path: staff_certificates.add_more +class TranslationsStaffCertificatesAddMoreEn { + TranslationsStaffCertificatesAddMoreEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Add Another Certificate' + String get title => 'Add Another Certificate'; + + /// en: 'Upload additional certifications' + String get subtitle => 'Upload additional certifications'; +} + +// Path: staff_certificates.upload_modal +class TranslationsStaffCertificatesUploadModalEn { + TranslationsStaffCertificatesUploadModalEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Upload Certificate' + String get title => 'Upload Certificate'; + + /// en: 'Expiration Date (Optional)' + String get expiry_label => 'Expiration Date (Optional)'; + + /// en: 'Select date' + String get select_date => 'Select date'; + + /// en: 'Upload File' + String get upload_file => 'Upload File'; + + /// en: 'Drag and drop or click to upload' + String get drag_drop => 'Drag and drop or click to upload'; + + /// en: 'PDF, JPG, PNG up to 10MB' + String get supported_formats => 'PDF, JPG, PNG up to 10MB'; + + /// en: 'Cancel' + String get cancel => 'Cancel'; + + /// en: 'Save Certificate' + String get save => 'Save Certificate'; +} + +// Path: staff_certificates.delete_modal +class TranslationsStaffCertificatesDeleteModalEn { + TranslationsStaffCertificatesDeleteModalEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Remove Certificate?' + String get title => 'Remove Certificate?'; + + /// en: 'This action cannot be undone.' + String get message => 'This action cannot be undone.'; + + /// en: 'Cancel' + String get cancel => 'Cancel'; + + /// en: 'Remove' + String get confirm => 'Remove'; +} + +// Path: staff_profile_attire.info_card +class TranslationsStaffProfileAttireInfoCardEn { + TranslationsStaffProfileAttireInfoCardEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Your Wardrobe' + String get title => 'Your Wardrobe'; + + /// en: 'Select the attire items you own. This helps us match you with shifts that fit your wardrobe.' + String get description => 'Select the attire items you own. This helps us match you with shifts that fit your wardrobe.'; +} + +// Path: staff_profile_attire.status +class TranslationsStaffProfileAttireStatusEn { + TranslationsStaffProfileAttireStatusEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'REQUIRED' + String get required => 'REQUIRED'; + + /// en: 'Add Photo' + String get add_photo => 'Add Photo'; + + /// en: 'Added' + String get added => 'Added'; + + /// en: '⏳ Pending verification' + String get pending => '⏳ Pending verification'; +} + +// Path: staff_profile_attire.actions +class TranslationsStaffProfileAttireActionsEn { + TranslationsStaffProfileAttireActionsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Save Attire' + String get save => 'Save Attire'; +} + +// Path: staff_profile_attire.validation +class TranslationsStaffProfileAttireValidationEn { + TranslationsStaffProfileAttireValidationEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'βœ“ Select all required items' + String get select_required => 'βœ“ Select all required items'; + + /// en: 'βœ“ Upload photos of required items' + String get upload_required => 'βœ“ Upload photos of required items'; + + /// en: 'βœ“ Accept attestation' + String get accept_attestation => 'βœ“ Accept attestation'; +} + +// Path: staff_shifts.tabs +class TranslationsStaffShiftsTabsEn { + TranslationsStaffShiftsTabsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'My Shifts' + String get my_shifts => 'My Shifts'; + + /// en: 'Find Work' + String get find_work => 'Find Work'; +} + +// Path: staff_shifts.list +class TranslationsStaffShiftsListEn { + TranslationsStaffShiftsListEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'No shifts found' + String get no_shifts => 'No shifts found'; + + /// en: 'PENDING OFFERS' + String get pending_offers => 'PENDING OFFERS'; + + /// en: '$count AVAILABLE JOBS' + String available_jobs({required Object count}) => '${count} AVAILABLE JOBS'; + + /// en: 'Search jobs...' + String get search_hint => 'Search jobs...'; +} + +// Path: staff_shifts.filter +class TranslationsStaffShiftsFilterEn { + TranslationsStaffShiftsFilterEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'All Jobs' + String get all => 'All Jobs'; + + /// en: 'One Day' + String get one_day => 'One Day'; + + /// en: 'Multi Day' + String get multi_day => 'Multi Day'; + + /// en: 'Long Term' + String get long_term => 'Long Term'; +} + +// Path: staff_shifts.status +class TranslationsStaffShiftsStatusEn { + TranslationsStaffShiftsStatusEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'CONFIRMED' + String get confirmed => 'CONFIRMED'; + + /// en: 'ACT NOW' + String get act_now => 'ACT NOW'; + + /// en: 'SWAP REQUESTED' + String get swap_requested => 'SWAP REQUESTED'; + + /// en: 'COMPLETED' + String get completed => 'COMPLETED'; + + /// en: 'NO SHOW' + String get no_show => 'NO SHOW'; + + /// en: 'Please confirm assignment' + String get pending_warning => 'Please confirm assignment'; +} + +// Path: staff_shifts.action +class TranslationsStaffShiftsActionEn { + TranslationsStaffShiftsActionEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Decline' + String get decline => 'Decline'; + + /// en: 'Confirm' + String get confirm => 'Confirm'; + + /// en: 'Request Swap' + String get request_swap => 'Request Swap'; +} + +// Path: staff_shifts.details +class TranslationsStaffShiftsDetailsEn { + TranslationsStaffShiftsDetailsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'ADDITIONAL DETAILS' + String get additional => 'ADDITIONAL DETAILS'; + + /// en: '$days Days' + String days({required Object days}) => '${days} Days'; + + /// en: '(exp.total \$$amount)' + String exp_total({required Object amount}) => '(exp.total \$${amount})'; + + /// en: 'Pending $time ago' + String pending_time({required Object time}) => 'Pending ${time} ago'; +} + +// Path: staff_shifts.tags +class TranslationsStaffShiftsTagsEn { + TranslationsStaffShiftsTagsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Immediate start' + String get immediate_start => 'Immediate start'; + + /// en: 'No experience' + String get no_experience => 'No experience'; +} + +// Path: staff_authentication.profile_setup_page.steps +class TranslationsStaffAuthenticationProfileSetupPageStepsEn { + TranslationsStaffAuthenticationProfileSetupPageStepsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Basic Info' + String get basic => 'Basic Info'; + + /// en: 'Location' + String get location => 'Location'; + + /// en: 'Experience' + String get experience => 'Experience'; +} + +// Path: staff_authentication.profile_setup_page.basic_info +class TranslationsStaffAuthenticationProfileSetupPageBasicInfoEn { + TranslationsStaffAuthenticationProfileSetupPageBasicInfoEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Let's get to know you' + String get title => 'Let\'s get to know you'; + + /// en: 'Tell us a bit about yourself' + String get subtitle => 'Tell us a bit about yourself'; + + /// en: 'Full Name *' + String get full_name_label => 'Full Name *'; + + /// en: 'John Smith' + String get full_name_hint => 'John Smith'; + + /// en: 'Short Bio' + String get bio_label => 'Short Bio'; + + /// en: 'Experienced hospitality professional...' + String get bio_hint => 'Experienced hospitality professional...'; +} + +// Path: staff_authentication.profile_setup_page.location +class TranslationsStaffAuthenticationProfileSetupPageLocationEn { + TranslationsStaffAuthenticationProfileSetupPageLocationEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Where do you want to work?' + String get title => 'Where do you want to work?'; + + /// en: 'Add your preferred work locations' + String get subtitle => 'Add your preferred work locations'; + + /// en: 'Full Name' + String get full_name_label => 'Full Name'; + + /// en: 'Add Location *' + String get add_location_label => 'Add Location *'; + + /// en: 'City or ZIP code' + String get add_location_hint => 'City or ZIP code'; + + /// en: 'Add' + String get add_button => 'Add'; + + /// en: 'Max Distance: $distance miles' + String max_distance({required Object distance}) => 'Max Distance: ${distance} miles'; + + /// en: '5 mi' + String get min_dist_label => '5 mi'; + + /// en: '50 mi' + String get max_dist_label => '50 mi'; +} + +// Path: staff_authentication.profile_setup_page.experience +class TranslationsStaffAuthenticationProfileSetupPageExperienceEn { + TranslationsStaffAuthenticationProfileSetupPageExperienceEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'What are your skills?' + String get title => 'What are your skills?'; + + /// en: 'Select all that apply' + String get subtitle => 'Select all that apply'; + + /// en: 'Skills *' + String get skills_label => 'Skills *'; + + /// en: 'Preferred Industries' + String get industries_label => 'Preferred Industries'; + + late final TranslationsStaffAuthenticationProfileSetupPageExperienceSkillsEn skills = TranslationsStaffAuthenticationProfileSetupPageExperienceSkillsEn._(_root); + late final TranslationsStaffAuthenticationProfileSetupPageExperienceIndustriesEn industries = TranslationsStaffAuthenticationProfileSetupPageExperienceIndustriesEn._(_root); +} + +// Path: staff.main.tabs +class TranslationsStaffMainTabsEn { + TranslationsStaffMainTabsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Shifts' + String get shifts => 'Shifts'; + + /// en: 'Payments' + String get payments => 'Payments'; + + /// en: 'Home' + String get home => 'Home'; + + /// en: 'Clock In' + String get clock_in => 'Clock In'; + + /// en: 'Profile' + String get profile => 'Profile'; +} + +// Path: staff.home.header +class TranslationsStaffHomeHeaderEn { + TranslationsStaffHomeHeaderEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Welcome back' + String get welcome_back => 'Welcome back'; + + /// en: 'Krower' + String get user_name_placeholder => 'Krower'; +} + +// Path: staff.home.banners +class TranslationsStaffHomeBannersEn { + TranslationsStaffHomeBannersEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Complete Your Profile' + String get complete_profile_title => 'Complete Your Profile'; + + /// en: 'Get verified to see more shifts' + String get complete_profile_subtitle => 'Get verified to see more shifts'; + + /// en: 'Availability' + String get availability_title => 'Availability'; + + /// en: 'Update your availability for next week' + String get availability_subtitle => 'Update your availability for next week'; +} + +// Path: staff.home.quick_actions +class TranslationsStaffHomeQuickActionsEn { + TranslationsStaffHomeQuickActionsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Find Shifts' + String get find_shifts => 'Find Shifts'; + + /// en: 'Availability' + String get availability => 'Availability'; + + /// en: 'Messages' + String get messages => 'Messages'; + + /// en: 'Earnings' + String get earnings => 'Earnings'; +} + +// Path: staff.home.sections +class TranslationsStaffHomeSectionsEn { + TranslationsStaffHomeSectionsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Today's Shift' + String get todays_shift => 'Today\'s Shift'; + + /// en: '$count scheduled' + String scheduled_count({required Object count}) => '${count} scheduled'; + + /// en: 'Tomorrow' + String get tomorrow => 'Tomorrow'; + + /// en: 'Recommended for You' + String get recommended_for_you => 'Recommended for You'; + + /// en: 'View all' + String get view_all => 'View all'; +} + +// Path: staff.home.empty_states +class TranslationsStaffHomeEmptyStatesEn { + TranslationsStaffHomeEmptyStatesEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'No shifts scheduled for today' + String get no_shifts_today => 'No shifts scheduled for today'; + + /// en: 'Find shifts β†’' + String get find_shifts_cta => 'Find shifts β†’'; + + /// en: 'No shifts for tomorrow' + String get no_shifts_tomorrow => 'No shifts for tomorrow'; + + /// en: 'No recommended shifts' + String get no_recommended_shifts => 'No recommended shifts'; +} + +// Path: staff.home.pending_payment +class TranslationsStaffHomePendingPaymentEn { + TranslationsStaffHomePendingPaymentEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Pending Payment' + String get title => 'Pending Payment'; + + /// en: 'Payment processing' + String get subtitle => 'Payment processing'; + + /// en: '$amount' + String amount({required Object amount}) => '${amount}'; +} + +// Path: staff.home.recommended_card +class TranslationsStaffHomeRecommendedCardEn { + TranslationsStaffHomeRecommendedCardEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'β€’ ACT NOW' + String get act_now => 'β€’ ACT NOW'; + + /// en: 'One Day' + String get one_day => 'One Day'; + + /// en: 'Today' + String get today => 'Today'; + + /// en: 'Applied for $title' + String applied_for({required Object title}) => 'Applied for ${title}'; + + /// en: '$start - $end' + String time_range({required Object start, required Object end}) => '${start} - ${end}'; +} + +// Path: staff.home.benefits +class TranslationsStaffHomeBenefitsEn { + TranslationsStaffHomeBenefitsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Your Benefits' + String get title => 'Your Benefits'; + + /// en: 'View all' + String get view_all => 'View all'; + + /// en: 'hours' + String get hours_label => 'hours'; + + late final TranslationsStaffHomeBenefitsItemsEn items = TranslationsStaffHomeBenefitsItemsEn._(_root); +} + +// Path: staff.home.auto_match +class TranslationsStaffHomeAutoMatchEn { + TranslationsStaffHomeAutoMatchEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Auto-Match' + String get title => 'Auto-Match'; + + /// en: 'Finding shifts for you' + String get finding_shifts => 'Finding shifts for you'; + + /// en: 'Get matched automatically' + String get get_matched => 'Get matched automatically'; + + /// en: 'Matching based on:' + String get matching_based_on => 'Matching based on:'; + + late final TranslationsStaffHomeAutoMatchChipsEn chips = TranslationsStaffHomeAutoMatchChipsEn._(_root); +} + +// Path: staff.home.improve +class TranslationsStaffHomeImproveEn { + TranslationsStaffHomeImproveEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Improve Yourself' + String get title => 'Improve Yourself'; + + late final TranslationsStaffHomeImproveItemsEn items = TranslationsStaffHomeImproveItemsEn._(_root); +} + +// Path: staff.home.more_ways +class TranslationsStaffHomeMoreWaysEn { + TranslationsStaffHomeMoreWaysEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'More Ways To Use Krow' + String get title => 'More Ways To Use Krow'; + + late final TranslationsStaffHomeMoreWaysItemsEn items = TranslationsStaffHomeMoreWaysItemsEn._(_root); +} + +// Path: staff.profile.header +class TranslationsStaffProfileHeaderEn { + TranslationsStaffProfileHeaderEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Profile' + String get title => 'Profile'; + + /// en: 'SIGN OUT' + String get sign_out => 'SIGN OUT'; +} + +// Path: staff.profile.reliability_stats +class TranslationsStaffProfileReliabilityStatsEn { + TranslationsStaffProfileReliabilityStatsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Shifts' + String get shifts => 'Shifts'; + + /// en: 'Rating' + String get rating => 'Rating'; + + /// en: 'On Time' + String get on_time => 'On Time'; + + /// en: 'No Shows' + String get no_shows => 'No Shows'; + + /// en: 'Cancel.' + String get cancellations => 'Cancel.'; +} + +// Path: staff.profile.reliability_score +class TranslationsStaffProfileReliabilityScoreEn { + TranslationsStaffProfileReliabilityScoreEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Reliability Score' + String get title => 'Reliability Score'; + + /// en: 'Keep your score above 45% to continue picking up shifts.' + String get description => 'Keep your score above 45% to continue picking up shifts.'; +} + +// Path: staff.profile.sections +class TranslationsStaffProfileSectionsEn { + TranslationsStaffProfileSectionsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'ONBOARDING' + String get onboarding => 'ONBOARDING'; + + /// en: 'COMPLIANCE' + String get compliance => 'COMPLIANCE'; + + /// en: 'LEVEL UP' + String get level_up => 'LEVEL UP'; + + /// en: 'FINANCE' + String get finance => 'FINANCE'; + + /// en: 'SUPPORT' + String get support => 'SUPPORT'; +} + +// Path: staff.profile.menu_items +class TranslationsStaffProfileMenuItemsEn { + TranslationsStaffProfileMenuItemsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Personal Info' + String get personal_info => 'Personal Info'; + + /// en: 'Emergency Contact' + String get emergency_contact => 'Emergency Contact'; + + /// en: 'Experience' + String get experience => 'Experience'; + + /// en: 'Attire' + String get attire => 'Attire'; + + /// en: 'Documents' + String get documents => 'Documents'; + + /// en: 'Certificates' + String get certificates => 'Certificates'; + + /// en: 'Tax Forms' + String get tax_forms => 'Tax Forms'; + + /// en: 'Krow University' + String get krow_university => 'Krow University'; + + /// en: 'Trainings' + String get trainings => 'Trainings'; + + /// en: 'Leaderboard' + String get leaderboard => 'Leaderboard'; + + /// en: 'Bank Account' + String get bank_account => 'Bank Account'; + + /// en: 'Payments' + String get payments => 'Payments'; + + /// en: 'Timecard' + String get timecard => 'Timecard'; + + /// en: 'FAQs' + String get faqs => 'FAQs'; + + /// en: 'Privacy & Security' + String get privacy_security => 'Privacy & Security'; + + /// en: 'Messages' + String get messages => 'Messages'; +} + +// Path: staff.profile.bank_account_page +class TranslationsStaffProfileBankAccountPageEn { + TranslationsStaffProfileBankAccountPageEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Bank Account' + String get title => 'Bank Account'; + + /// en: 'LINKED ACCOUNTS' + String get linked_accounts => 'LINKED ACCOUNTS'; + + /// en: 'Add New Account' + String get add_account => 'Add New Account'; + + /// en: '100% Secured' + String get secure_title => '100% Secured'; + + /// en: 'Your account details are encrypted and safe.' + String get secure_subtitle => 'Your account details are encrypted and safe.'; + + /// en: 'Primary' + String get primary => 'Primary'; + + /// en: 'Add New Account' + String get add_new_account => 'Add New Account'; + + /// en: 'Routing Number' + String get routing_number => 'Routing Number'; + + /// en: 'Enter routing number' + String get routing_hint => 'Enter routing number'; + + /// en: 'Account Number' + String get account_number => 'Account Number'; + + /// en: 'Enter account number' + String get account_hint => 'Enter account number'; + + /// en: 'Account Type' + String get account_type => 'Account Type'; + + /// en: 'Checking' + String get checking => 'Checking'; + + /// en: 'Savings' + String get savings => 'Savings'; + + /// en: 'Cancel' + String get cancel => 'Cancel'; + + /// en: 'Save' + String get save => 'Save'; + + /// en: 'Ending in $last4' + String account_ending({required Object last4}) => 'Ending in ${last4}'; +} + +// Path: staff.profile.logout +class TranslationsStaffProfileLogoutEn { + TranslationsStaffProfileLogoutEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Sign Out' + String get button => 'Sign Out'; +} + +// Path: staff.onboarding.personal_info +class TranslationsStaffOnboardingPersonalInfoEn { + TranslationsStaffOnboardingPersonalInfoEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Personal Info' + String get title => 'Personal Info'; + + /// en: 'Tap to change photo' + String get change_photo_hint => 'Tap to change photo'; + + /// en: 'Full Name' + String get full_name_label => 'Full Name'; + + /// en: 'Email' + String get email_label => 'Email'; + + /// en: 'Phone Number' + String get phone_label => 'Phone Number'; + + /// en: '+1 (555) 000-0000' + String get phone_hint => '+1 (555) 000-0000'; + + /// en: 'Bio' + String get bio_label => 'Bio'; + + /// en: 'Tell clients about yourself...' + String get bio_hint => 'Tell clients about yourself...'; + + /// en: 'Languages' + String get languages_label => 'Languages'; + + /// en: 'English, Spanish, French...' + String get languages_hint => 'English, Spanish, French...'; + + /// en: 'Preferred Locations' + String get locations_label => 'Preferred Locations'; + + /// en: 'Downtown, Midtown, Brooklyn...' + String get locations_hint => 'Downtown, Midtown, Brooklyn...'; + + /// en: 'Save Changes' + String get save_button => 'Save Changes'; + + /// en: 'Personal info saved successfully' + String get save_success => 'Personal info saved successfully'; +} + +// Path: staff.onboarding.experience +class TranslationsStaffOnboardingExperienceEn { + TranslationsStaffOnboardingExperienceEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Experience & Skills' + String get title => 'Experience & Skills'; + + /// en: 'Industries' + String get industries_title => 'Industries'; + + /// en: 'Select the industries you have experience in' + String get industries_subtitle => 'Select the industries you have experience in'; + + /// en: 'Skills' + String get skills_title => 'Skills'; + + /// en: 'Select your skills or add custom ones' + String get skills_subtitle => 'Select your skills or add custom ones'; + + /// en: 'Custom Skills:' + String get custom_skills_title => 'Custom Skills:'; + + /// en: 'Add custom skill...' + String get custom_skill_hint => 'Add custom skill...'; + + /// en: 'Save & Continue' + String get save_button => 'Save & Continue'; + + late final TranslationsStaffOnboardingExperienceIndustriesEn industries = TranslationsStaffOnboardingExperienceIndustriesEn._(_root); + late final TranslationsStaffOnboardingExperienceSkillsEn skills = TranslationsStaffOnboardingExperienceSkillsEn._(_root); +} + +// Path: staff_authentication.profile_setup_page.experience.skills +class TranslationsStaffAuthenticationProfileSetupPageExperienceSkillsEn { + TranslationsStaffAuthenticationProfileSetupPageExperienceSkillsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Food Service' + String get food_service => 'Food Service'; + + /// en: 'Bartending' + String get bartending => 'Bartending'; + + /// en: 'Warehouse' + String get warehouse => 'Warehouse'; + + /// en: 'Retail' + String get retail => 'Retail'; + + /// en: 'Events' + String get events => 'Events'; + + /// en: 'Customer Service' + String get customer_service => 'Customer Service'; + + /// en: 'Cleaning' + String get cleaning => 'Cleaning'; + + /// en: 'Security' + String get security => 'Security'; + + /// en: 'Driving' + String get driving => 'Driving'; + + /// en: 'Cooking' + String get cooking => 'Cooking'; +} + +// Path: staff_authentication.profile_setup_page.experience.industries +class TranslationsStaffAuthenticationProfileSetupPageExperienceIndustriesEn { + TranslationsStaffAuthenticationProfileSetupPageExperienceIndustriesEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Hospitality' + String get hospitality => 'Hospitality'; + + /// en: 'Food Service' + String get food_service => 'Food Service'; + + /// en: 'Warehouse' + String get warehouse => 'Warehouse'; + + /// en: 'Events' + String get events => 'Events'; + + /// en: 'Retail' + String get retail => 'Retail'; + + /// en: 'Healthcare' + String get healthcare => 'Healthcare'; +} + +// Path: staff.home.benefits.items +class TranslationsStaffHomeBenefitsItemsEn { + TranslationsStaffHomeBenefitsItemsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Sick Days' + String get sick_days => 'Sick Days'; + + /// en: 'Vacation' + String get vacation => 'Vacation'; + + /// en: 'Holidays' + String get holidays => 'Holidays'; +} + +// Path: staff.home.auto_match.chips +class TranslationsStaffHomeAutoMatchChipsEn { + TranslationsStaffHomeAutoMatchChipsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Location' + String get location => 'Location'; + + /// en: 'Availability' + String get availability => 'Availability'; + + /// en: 'Skills' + String get skills => 'Skills'; +} + +// Path: staff.home.improve.items +class TranslationsStaffHomeImproveItemsEn { + TranslationsStaffHomeImproveItemsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + late final TranslationsStaffHomeImproveItemsTrainingEn training = TranslationsStaffHomeImproveItemsTrainingEn._(_root); + late final TranslationsStaffHomeImproveItemsPodcastEn podcast = TranslationsStaffHomeImproveItemsPodcastEn._(_root); +} + +// Path: staff.home.more_ways.items +class TranslationsStaffHomeMoreWaysItemsEn { + TranslationsStaffHomeMoreWaysItemsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + late final TranslationsStaffHomeMoreWaysItemsBenefitsEn benefits = TranslationsStaffHomeMoreWaysItemsBenefitsEn._(_root); + late final TranslationsStaffHomeMoreWaysItemsReferEn refer = TranslationsStaffHomeMoreWaysItemsReferEn._(_root); +} + +// Path: staff.onboarding.experience.industries +class TranslationsStaffOnboardingExperienceIndustriesEn { + TranslationsStaffOnboardingExperienceIndustriesEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Hospitality' + String get hospitality => 'Hospitality'; + + /// en: 'Food Service' + String get food_service => 'Food Service'; + + /// en: 'Warehouse' + String get warehouse => 'Warehouse'; + + /// en: 'Events' + String get events => 'Events'; + + /// en: 'Retail' + String get retail => 'Retail'; + + /// en: 'Healthcare' + String get healthcare => 'Healthcare'; + + /// en: 'Other' + String get other => 'Other'; +} + +// Path: staff.onboarding.experience.skills +class TranslationsStaffOnboardingExperienceSkillsEn { + TranslationsStaffOnboardingExperienceSkillsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Food Service' + String get food_service => 'Food Service'; + + /// en: 'Bartending' + String get bartending => 'Bartending'; + + /// en: 'Event Setup' + String get event_setup => 'Event Setup'; + + /// en: 'Hospitality' + String get hospitality => 'Hospitality'; + + /// en: 'Warehouse' + String get warehouse => 'Warehouse'; + + /// en: 'Customer Service' + String get customer_service => 'Customer Service'; + + /// en: 'Cleaning' + String get cleaning => 'Cleaning'; + + /// en: 'Security' + String get security => 'Security'; + + /// en: 'Retail' + String get retail => 'Retail'; + + /// en: 'Cooking' + String get cooking => 'Cooking'; + + /// en: 'Cashier' + String get cashier => 'Cashier'; + + /// en: 'Server' + String get server => 'Server'; + + /// en: 'Barista' + String get barista => 'Barista'; + + /// en: 'Host/Hostess' + String get host_hostess => 'Host/Hostess'; + + /// en: 'Busser' + String get busser => 'Busser'; +} + +// Path: staff.home.improve.items.training +class TranslationsStaffHomeImproveItemsTrainingEn { + TranslationsStaffHomeImproveItemsTrainingEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Training Section' + String get title => 'Training Section'; + + /// en: 'Improve your skills and get certified.' + String get description => 'Improve your skills and get certified.'; + + /// en: '/krow-university' + String get page => '/krow-university'; +} + +// Path: staff.home.improve.items.podcast +class TranslationsStaffHomeImproveItemsPodcastEn { + TranslationsStaffHomeImproveItemsPodcastEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Krow Podcast' + String get title => 'Krow Podcast'; + + /// en: 'Listen to tips from top workers.' + String get description => 'Listen to tips from top workers.'; + + /// en: '/krow-university' + String get page => '/krow-university'; +} + +// Path: staff.home.more_ways.items.benefits +class TranslationsStaffHomeMoreWaysItemsBenefitsEn { + TranslationsStaffHomeMoreWaysItemsBenefitsEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Krow Benefits' + String get title => 'Krow Benefits'; + + /// en: '/benefits' + String get page => '/benefits'; +} + +// Path: staff.home.more_ways.items.refer +class TranslationsStaffHomeMoreWaysItemsReferEn { + TranslationsStaffHomeMoreWaysItemsReferEn._(this._root); + + final Translations _root; // ignore: unused_field + + // Translations + + /// en: 'Refer a Friend' + String get title => 'Refer a Friend'; + + /// en: '/worker-profile' + String get page => '/worker-profile'; +} + +/// The flat map containing all translations for locale . +/// Only for edge cases! For simple maps, use the map function of this library. +/// +/// The Dart AOT compiler has issues with very large switch statements, +/// so the map is split into smaller functions (512 entries each). +extension on Translations { + dynamic _flatMapFunction(String path) { + return switch (path) { + 'common.ok' => 'OK', + 'common.cancel' => 'Cancel', + 'common.save' => 'Save', + 'common.delete' => 'Delete', + 'common.continue_text' => 'Continue', + 'settings.language' => 'Language', + 'settings.change_language' => 'Change Language', + 'staff_authentication.get_started_page.title_part1' => 'Work, Grow, ', + 'staff_authentication.get_started_page.title_part2' => 'Elevate', + 'staff_authentication.get_started_page.subtitle' => 'Build your career in hospitality with \nflexibility and freedom.', + 'staff_authentication.get_started_page.sign_up_button' => 'Sign Up', + 'staff_authentication.get_started_page.log_in_button' => 'Log In', + 'staff_authentication.phone_verification_page.validation_error' => 'Please enter a valid 10-digit phone number', + 'staff_authentication.phone_verification_page.send_code_button' => 'Send Code', + 'staff_authentication.phone_verification_page.enter_code_title' => 'Enter verification code', + 'staff_authentication.phone_verification_page.code_sent_message' => 'We sent a 6-digit code to ', + 'staff_authentication.phone_verification_page.code_sent_instruction' => '. Enter it below to verify your account.', + 'staff_authentication.phone_input.title' => 'Verify your phone number', + 'staff_authentication.phone_input.subtitle' => 'We\'ll send you a verification code to get started.', + 'staff_authentication.phone_input.label' => 'Phone Number', + 'staff_authentication.phone_input.hint' => 'Enter your number', + 'staff_authentication.otp_verification.did_not_get_code' => 'Didn\'t get the code ?', + 'staff_authentication.otp_verification.resend_in' => ({required Object seconds}) => 'Resend in ${seconds} s', + 'staff_authentication.otp_verification.resend_code' => 'Resend code', + 'staff_authentication.profile_setup_page.step_indicator' => ({required Object current, required Object total}) => 'Step ${current} of ${total}', + 'staff_authentication.profile_setup_page.error_occurred' => 'An error occurred', + 'staff_authentication.profile_setup_page.complete_setup_button' => 'Complete Setup', + 'staff_authentication.profile_setup_page.steps.basic' => 'Basic Info', + 'staff_authentication.profile_setup_page.steps.location' => 'Location', + 'staff_authentication.profile_setup_page.steps.experience' => 'Experience', + 'staff_authentication.profile_setup_page.basic_info.title' => 'Let\'s get to know you', + 'staff_authentication.profile_setup_page.basic_info.subtitle' => 'Tell us a bit about yourself', + 'staff_authentication.profile_setup_page.basic_info.full_name_label' => 'Full Name *', + 'staff_authentication.profile_setup_page.basic_info.full_name_hint' => 'John Smith', + 'staff_authentication.profile_setup_page.basic_info.bio_label' => 'Short Bio', + 'staff_authentication.profile_setup_page.basic_info.bio_hint' => 'Experienced hospitality professional...', + 'staff_authentication.profile_setup_page.location.title' => 'Where do you want to work?', + 'staff_authentication.profile_setup_page.location.subtitle' => 'Add your preferred work locations', + 'staff_authentication.profile_setup_page.location.full_name_label' => 'Full Name', + 'staff_authentication.profile_setup_page.location.add_location_label' => 'Add Location *', + 'staff_authentication.profile_setup_page.location.add_location_hint' => 'City or ZIP code', + 'staff_authentication.profile_setup_page.location.add_button' => 'Add', + 'staff_authentication.profile_setup_page.location.max_distance' => ({required Object distance}) => 'Max Distance: ${distance} miles', + 'staff_authentication.profile_setup_page.location.min_dist_label' => '5 mi', + 'staff_authentication.profile_setup_page.location.max_dist_label' => '50 mi', + 'staff_authentication.profile_setup_page.experience.title' => 'What are your skills?', + 'staff_authentication.profile_setup_page.experience.subtitle' => 'Select all that apply', + 'staff_authentication.profile_setup_page.experience.skills_label' => 'Skills *', + 'staff_authentication.profile_setup_page.experience.industries_label' => 'Preferred Industries', + 'staff_authentication.profile_setup_page.experience.skills.food_service' => 'Food Service', + 'staff_authentication.profile_setup_page.experience.skills.bartending' => 'Bartending', + 'staff_authentication.profile_setup_page.experience.skills.warehouse' => 'Warehouse', + 'staff_authentication.profile_setup_page.experience.skills.retail' => 'Retail', + 'staff_authentication.profile_setup_page.experience.skills.events' => 'Events', + 'staff_authentication.profile_setup_page.experience.skills.customer_service' => 'Customer Service', + 'staff_authentication.profile_setup_page.experience.skills.cleaning' => 'Cleaning', + 'staff_authentication.profile_setup_page.experience.skills.security' => 'Security', + 'staff_authentication.profile_setup_page.experience.skills.driving' => 'Driving', + 'staff_authentication.profile_setup_page.experience.skills.cooking' => 'Cooking', + 'staff_authentication.profile_setup_page.experience.industries.hospitality' => 'Hospitality', + 'staff_authentication.profile_setup_page.experience.industries.food_service' => 'Food Service', + 'staff_authentication.profile_setup_page.experience.industries.warehouse' => 'Warehouse', + 'staff_authentication.profile_setup_page.experience.industries.events' => 'Events', + 'staff_authentication.profile_setup_page.experience.industries.retail' => 'Retail', + 'staff_authentication.profile_setup_page.experience.industries.healthcare' => 'Healthcare', + 'staff_authentication.common.trouble_question' => 'Having trouble? ', + 'staff_authentication.common.contact_support' => 'Contact Support', + 'client_authentication.get_started_page.title' => 'Take Control of Your\nShifts and Events', + 'client_authentication.get_started_page.subtitle' => 'Streamline your operations with powerful tools to manage schedules, track performance, and keep your team on the same pageβ€”all in one place', + 'client_authentication.get_started_page.sign_in_button' => 'Sign In', + 'client_authentication.get_started_page.create_account_button' => 'Create Account', + 'client_authentication.sign_in_page.title' => 'Welcome Back', + 'client_authentication.sign_in_page.subtitle' => 'Sign in to manage your shifts and workers', + 'client_authentication.sign_in_page.email_label' => 'Email', + 'client_authentication.sign_in_page.email_hint' => 'Enter your email', + 'client_authentication.sign_in_page.password_label' => 'Password', + 'client_authentication.sign_in_page.password_hint' => 'Enter your password', + 'client_authentication.sign_in_page.forgot_password' => 'Forgot Password?', + 'client_authentication.sign_in_page.sign_in_button' => 'Sign In', + 'client_authentication.sign_in_page.or_divider' => 'or', + 'client_authentication.sign_in_page.social_apple' => 'Sign In with Apple', + 'client_authentication.sign_in_page.social_google' => 'Sign In with Google', + 'client_authentication.sign_in_page.no_account' => 'Don\'t have an account? ', + 'client_authentication.sign_in_page.sign_up_link' => 'Sign Up', + 'client_authentication.sign_up_page.title' => 'Create Account', + 'client_authentication.sign_up_page.subtitle' => 'Get started with Krow for your business', + 'client_authentication.sign_up_page.company_label' => 'Company Name', + 'client_authentication.sign_up_page.company_hint' => 'Enter company name', + 'client_authentication.sign_up_page.email_label' => 'Email', + 'client_authentication.sign_up_page.email_hint' => 'Enter your email', + 'client_authentication.sign_up_page.password_label' => 'Password', + 'client_authentication.sign_up_page.password_hint' => 'Create a password', + 'client_authentication.sign_up_page.confirm_password_label' => 'Confirm Password', + 'client_authentication.sign_up_page.confirm_password_hint' => 'Confirm your password', + 'client_authentication.sign_up_page.create_account_button' => 'Create Account', + 'client_authentication.sign_up_page.or_divider' => 'or', + 'client_authentication.sign_up_page.social_apple' => 'Sign Up with Apple', + 'client_authentication.sign_up_page.social_google' => 'Sign Up with Google', + 'client_authentication.sign_up_page.has_account' => 'Already have an account? ', + 'client_authentication.sign_up_page.sign_in_link' => 'Sign In', + 'client_home.dashboard.welcome_back' => 'Welcome back', + 'client_home.dashboard.edit_mode_active' => 'Edit Mode Active', + 'client_home.dashboard.drag_instruction' => 'Drag to reorder, toggle visibility', + 'client_home.dashboard.reset' => 'Reset', + 'client_home.dashboard.metric_needed' => 'Needed', + 'client_home.dashboard.metric_filled' => 'Filled', + 'client_home.dashboard.metric_open' => 'Open', + 'client_home.dashboard.view_all' => 'View all', + 'client_home.dashboard.insight_lightbulb' => ({required Object amount}) => 'Save ${amount}/month', + 'client_home.dashboard.insight_tip' => 'Book 48hrs ahead for better rates', + 'client_home.widgets.actions' => 'Quick Actions', + 'client_home.widgets.reorder' => 'Reorder', + 'client_home.widgets.coverage' => 'Today\'s Coverage', + 'client_home.widgets.spending' => 'Spending Insights', + 'client_home.widgets.live_activity' => 'Live Activity', + 'client_home.actions.rapid' => 'RAPID', + 'client_home.actions.rapid_subtitle' => 'Urgent same-day', + 'client_home.actions.create_order' => 'Create Order', + 'client_home.actions.create_order_subtitle' => 'Schedule shifts', + 'client_home.actions.hubs' => 'Hubs', + 'client_home.actions.hubs_subtitle' => 'Clock-in points', + 'client_home.reorder.title' => 'REORDER', + 'client_home.reorder.reorder_button' => 'Reorder', + 'client_home.reorder.per_hr' => ({required Object amount}) => '${amount}/hr', + 'client_home.form.edit_reorder' => 'Edit & Reorder', + 'client_home.form.post_new' => 'Post a New Shift', + 'client_home.form.review_subtitle' => 'Review and edit the details before posting', + 'client_home.form.date_label' => 'Date *', + 'client_home.form.date_hint' => 'mm/dd/yyyy', + 'client_home.form.location_label' => 'Location *', + 'client_home.form.location_hint' => 'Business address', + 'client_home.form.positions_title' => 'Positions', + 'client_home.form.add_position' => 'Add Position', + 'client_home.form.role_label' => 'Role *', + 'client_home.form.role_hint' => 'Select role', + 'client_home.form.start_time' => 'Start Time *', + 'client_home.form.end_time' => 'End Time *', + 'client_home.form.workers_needed' => 'Workers Needed *', + 'client_home.form.hourly_rate' => 'Hourly Rate (\$) *', + 'client_home.form.post_shift' => 'Post Shift', + 'client_settings.profile.title' => 'Profile', + 'client_settings.profile.edit_profile' => 'Edit Profile', + 'client_settings.profile.hubs' => 'Hubs', + 'client_settings.profile.log_out' => 'Log Out', + 'client_settings.profile.quick_links' => 'Quick Links', + 'client_settings.profile.clock_in_hubs' => 'Clock-In Hubs', + 'client_settings.profile.billing_payments' => 'Billing & Payments', + 'client_hubs.title' => 'Hubs', + 'client_hubs.subtitle' => 'Manage clock-in locations', + 'client_hubs.add_hub' => 'Add Hub', + 'client_hubs.empty_state.title' => 'No hubs yet', + 'client_hubs.empty_state.description' => 'Create clock-in stations for your locations', + 'client_hubs.empty_state.button' => 'Add Your First Hub', + 'client_hubs.about_hubs.title' => 'About Hubs', + 'client_hubs.about_hubs.description' => 'Hubs are clock-in stations at your locations. Assign NFC tags to each hub so workers can quickly clock in/out using their phones.', + 'client_hubs.hub_card.tag_label' => ({required Object id}) => 'Tag: ${id}', + 'client_hubs.add_hub_dialog.title' => 'Add New Hub', + 'client_hubs.add_hub_dialog.name_label' => 'Hub Name *', + 'client_hubs.add_hub_dialog.name_hint' => 'e.g., Main Kitchen, Front Desk', + 'client_hubs.add_hub_dialog.location_label' => 'Location Name', + 'client_hubs.add_hub_dialog.location_hint' => 'e.g., Downtown Restaurant', + 'client_hubs.add_hub_dialog.address_label' => 'Address', + 'client_hubs.add_hub_dialog.address_hint' => 'Full address', + 'client_hubs.add_hub_dialog.create_button' => 'Create Hub', + 'client_hubs.nfc_dialog.title' => 'Identify NFC Tag', + 'client_hubs.nfc_dialog.instruction' => 'Tap your phone to the NFC tag to identify it', + 'client_hubs.nfc_dialog.scan_button' => 'Scan NFC Tag', + 'client_hubs.nfc_dialog.tag_identified' => 'Tag Identified', + 'client_hubs.nfc_dialog.assign_button' => 'Assign Tag', + 'client_create_order.title' => 'Create Order', + 'client_create_order.section_title' => 'ORDER TYPE', + 'client_create_order.types.rapid' => 'RAPID', + 'client_create_order.types.rapid_desc' => 'URGENT same-day Coverage', + 'client_create_order.types.one_time' => 'One-Time', + 'client_create_order.types.one_time_desc' => 'Single Event or Shift Request', + 'client_create_order.types.recurring' => 'Recurring', + 'client_create_order.types.recurring_desc' => 'Ongoing Weekly / Monthly Coverage', + 'client_create_order.types.permanent' => 'Permanent', + 'client_create_order.types.permanent_desc' => 'Long-Term Staffing Placement', + 'client_create_order.rapid.title' => 'RAPID Order', + 'client_create_order.rapid.subtitle' => 'Emergency staffing in minutes', + 'client_create_order.rapid.urgent_badge' => 'URGENT', + 'client_create_order.rapid.tell_us' => 'Tell us what you need', + 'client_create_order.rapid.need_staff' => 'Need staff urgently?', + 'client_create_order.rapid.type_or_speak' => 'Type or speak what you need. I\'ll handle the rest', + 'client_create_order.rapid.example' => 'Example: ', + 'client_create_order.rapid.hint' => 'Type or speak... (e.g., "Need 5 cooks ASAP until 5am")', + 'client_create_order.rapid.speak' => 'Speak', + 'client_create_order.rapid.listening' => 'Listening...', + 'client_create_order.rapid.send' => 'Send Message', + 'client_create_order.rapid.sending' => 'Sending...', + 'client_create_order.rapid.success_title' => 'Request Sent!', + 'client_create_order.rapid.success_message' => 'We\'re finding available workers for you right now. You\'ll be notified as they accept.', + 'client_create_order.rapid.back_to_orders' => 'Back to Orders', + 'client_create_order.one_time.title' => 'One-Time Order', + 'client_create_order.one_time.subtitle' => 'Single event or shift request', + 'client_create_order.one_time.create_your_order' => 'Create Your Order', + 'client_create_order.one_time.date_label' => 'Date', + 'client_create_order.one_time.date_hint' => 'Select date', + 'client_create_order.one_time.location_label' => 'Location', + 'client_create_order.one_time.location_hint' => 'Enter address', + 'client_create_order.one_time.positions_title' => 'Positions', + 'client_create_order.one_time.add_position' => 'Add Position', + 'client_create_order.one_time.position_number' => ({required Object number}) => 'Position ${number}', + 'client_create_order.one_time.remove' => 'Remove', + 'client_create_order.one_time.select_role' => 'Select role', + 'client_create_order.one_time.start_label' => 'Start', + 'client_create_order.one_time.end_label' => 'End', + 'client_create_order.one_time.workers_label' => 'Workers', + 'client_create_order.one_time.lunch_break_label' => 'Lunch Break', + 'client_create_order.one_time.no_break' => 'No break', + 'client_create_order.one_time.paid_break' => 'min (Paid)', + 'client_create_order.one_time.unpaid_break' => 'min (Unpaid)', + 'client_create_order.one_time.different_location' => 'Use different location for this position', + 'client_create_order.one_time.different_location_title' => 'Different Location', + 'client_create_order.one_time.different_location_hint' => 'Enter different address', + 'client_create_order.one_time.create_order' => 'Create Order', + 'client_create_order.one_time.creating' => 'Creating...', + 'client_create_order.one_time.success_title' => 'Order Created!', + 'client_create_order.one_time.success_message' => 'Your shift request has been posted. Workers will start applying soon.', + 'client_create_order.one_time.back_to_orders' => 'Back to Orders', + 'client_create_order.recurring.title' => 'Recurring Order', + 'client_create_order.recurring.subtitle' => 'Ongoing weekly/monthly coverage', + 'client_create_order.recurring.placeholder' => 'Recurring Order Flow (Work in Progress)', + 'client_create_order.permanent.title' => 'Permanent Order', + 'client_create_order.permanent.subtitle' => 'Long-term staffing placement', + 'client_create_order.permanent.placeholder' => 'Permanent Order Flow (Work in Progress)', + 'client_main.tabs.coverage' => 'Coverage', + 'client_main.tabs.billing' => 'Billing', + 'client_main.tabs.home' => 'Home', + 'client_main.tabs.orders' => 'Orders', + 'client_main.tabs.reports' => 'Reports', + 'client_view_orders.title' => 'Orders', + 'client_view_orders.post_button' => 'Post', + 'client_view_orders.post_order' => 'Post an Order', + 'client_view_orders.no_orders' => ({required Object date}) => 'No orders for ${date}', + 'client_view_orders.tabs.up_next' => 'Up Next', + 'client_view_orders.tabs.active' => 'Active', + 'client_view_orders.tabs.completed' => 'Completed', + 'client_view_orders.card.open' => 'OPEN', + 'client_view_orders.card.filled' => 'FILLED', + 'client_view_orders.card.confirmed' => 'CONFIRMED', + 'client_view_orders.card.in_progress' => 'IN PROGRESS', + 'client_view_orders.card.completed' => 'COMPLETED', + 'client_view_orders.card.cancelled' => 'CANCELLED', + 'client_view_orders.card.get_direction' => 'Get direction', + 'client_view_orders.card.total' => 'Total', + 'client_view_orders.card.hrs' => 'HRS', + 'client_view_orders.card.workers' => ({required Object count}) => '${count} workers', + 'client_view_orders.card.clock_in' => 'CLOCK IN', + 'client_view_orders.card.clock_out' => 'CLOCK OUT', + 'client_view_orders.card.coverage' => 'Coverage', + 'client_view_orders.card.workers_label' => ({required Object filled, required Object needed}) => '${filled}/${needed} Workers', + 'client_view_orders.card.confirmed_workers' => 'Workers Confirmed', + 'client_view_orders.card.no_workers' => 'No workers confirmed yet.', + 'client_billing.title' => 'Billing', + 'client_billing.current_period' => 'Current Period', + 'client_billing.saved_amount' => ({required Object amount}) => '${amount} saved', + 'client_billing.awaiting_approval' => 'Awaiting Approval', + 'client_billing.payment_method' => 'Payment Method', + 'client_billing.add_payment' => 'Add', + 'client_billing.default_badge' => 'Default', + 'client_billing.expires' => ({required Object date}) => 'Expires ${date}', + 'client_billing.period_breakdown' => 'This Period Breakdown', + 'client_billing.week' => 'Week', + 'client_billing.month' => 'Month', + 'client_billing.total' => 'Total', + 'client_billing.hours' => ({required Object count}) => '${count} hours', + 'client_billing.rate_optimization_title' => 'Rate Optimization', + 'client_billing.rate_optimization_body' => ({required Object amount}) => 'Save ${amount}/month by switching 3 shifts', + 'client_billing.view_details' => 'View Details', + 'client_billing.invoice_history' => 'Invoice History', + 'client_billing.view_all' => 'View all', + 'client_billing.export_button' => 'Export All Invoices', + 'client_billing.pending_badge' => 'PENDING APPROVAL', + 'client_billing.paid_badge' => 'PAID', + 'staff.main.tabs.shifts' => 'Shifts', + 'staff.main.tabs.payments' => 'Payments', + 'staff.main.tabs.home' => 'Home', + 'staff.main.tabs.clock_in' => 'Clock In', + 'staff.main.tabs.profile' => 'Profile', + 'staff.home.header.welcome_back' => 'Welcome back', + 'staff.home.header.user_name_placeholder' => 'Krower', + 'staff.home.banners.complete_profile_title' => 'Complete Your Profile', + 'staff.home.banners.complete_profile_subtitle' => 'Get verified to see more shifts', + 'staff.home.banners.availability_title' => 'Availability', + 'staff.home.banners.availability_subtitle' => 'Update your availability for next week', + 'staff.home.quick_actions.find_shifts' => 'Find Shifts', + 'staff.home.quick_actions.availability' => 'Availability', + 'staff.home.quick_actions.messages' => 'Messages', + 'staff.home.quick_actions.earnings' => 'Earnings', + 'staff.home.sections.todays_shift' => 'Today\'s Shift', + 'staff.home.sections.scheduled_count' => ({required Object count}) => '${count} scheduled', + 'staff.home.sections.tomorrow' => 'Tomorrow', + 'staff.home.sections.recommended_for_you' => 'Recommended for You', + 'staff.home.sections.view_all' => 'View all', + 'staff.home.empty_states.no_shifts_today' => 'No shifts scheduled for today', + 'staff.home.empty_states.find_shifts_cta' => 'Find shifts β†’', + 'staff.home.empty_states.no_shifts_tomorrow' => 'No shifts for tomorrow', + 'staff.home.empty_states.no_recommended_shifts' => 'No recommended shifts', + 'staff.home.pending_payment.title' => 'Pending Payment', + 'staff.home.pending_payment.subtitle' => 'Payment processing', + 'staff.home.pending_payment.amount' => ({required Object amount}) => '${amount}', + 'staff.home.recommended_card.act_now' => 'β€’ ACT NOW', + 'staff.home.recommended_card.one_day' => 'One Day', + 'staff.home.recommended_card.today' => 'Today', + 'staff.home.recommended_card.applied_for' => ({required Object title}) => 'Applied for ${title}', + 'staff.home.recommended_card.time_range' => ({required Object start, required Object end}) => '${start} - ${end}', + 'staff.home.benefits.title' => 'Your Benefits', + 'staff.home.benefits.view_all' => 'View all', + 'staff.home.benefits.hours_label' => 'hours', + 'staff.home.benefits.items.sick_days' => 'Sick Days', + 'staff.home.benefits.items.vacation' => 'Vacation', + 'staff.home.benefits.items.holidays' => 'Holidays', + 'staff.home.auto_match.title' => 'Auto-Match', + 'staff.home.auto_match.finding_shifts' => 'Finding shifts for you', + 'staff.home.auto_match.get_matched' => 'Get matched automatically', + 'staff.home.auto_match.matching_based_on' => 'Matching based on:', + 'staff.home.auto_match.chips.location' => 'Location', + 'staff.home.auto_match.chips.availability' => 'Availability', + 'staff.home.auto_match.chips.skills' => 'Skills', + 'staff.home.improve.title' => 'Improve Yourself', + 'staff.home.improve.items.training.title' => 'Training Section', + 'staff.home.improve.items.training.description' => 'Improve your skills and get certified.', + 'staff.home.improve.items.training.page' => '/krow-university', + 'staff.home.improve.items.podcast.title' => 'Krow Podcast', + 'staff.home.improve.items.podcast.description' => 'Listen to tips from top workers.', + 'staff.home.improve.items.podcast.page' => '/krow-university', + 'staff.home.more_ways.title' => 'More Ways To Use Krow', + 'staff.home.more_ways.items.benefits.title' => 'Krow Benefits', + 'staff.home.more_ways.items.benefits.page' => '/benefits', + 'staff.home.more_ways.items.refer.title' => 'Refer a Friend', + 'staff.home.more_ways.items.refer.page' => '/worker-profile', + 'staff.profile.header.title' => 'Profile', + 'staff.profile.header.sign_out' => 'SIGN OUT', + 'staff.profile.reliability_stats.shifts' => 'Shifts', + 'staff.profile.reliability_stats.rating' => 'Rating', + 'staff.profile.reliability_stats.on_time' => 'On Time', + 'staff.profile.reliability_stats.no_shows' => 'No Shows', + 'staff.profile.reliability_stats.cancellations' => 'Cancel.', + 'staff.profile.reliability_score.title' => 'Reliability Score', + 'staff.profile.reliability_score.description' => 'Keep your score above 45% to continue picking up shifts.', + 'staff.profile.sections.onboarding' => 'ONBOARDING', + 'staff.profile.sections.compliance' => 'COMPLIANCE', + 'staff.profile.sections.level_up' => 'LEVEL UP', + 'staff.profile.sections.finance' => 'FINANCE', + 'staff.profile.sections.support' => 'SUPPORT', + 'staff.profile.menu_items.personal_info' => 'Personal Info', + 'staff.profile.menu_items.emergency_contact' => 'Emergency Contact', + 'staff.profile.menu_items.experience' => 'Experience', + 'staff.profile.menu_items.attire' => 'Attire', + 'staff.profile.menu_items.documents' => 'Documents', + 'staff.profile.menu_items.certificates' => 'Certificates', + 'staff.profile.menu_items.tax_forms' => 'Tax Forms', + 'staff.profile.menu_items.krow_university' => 'Krow University', + 'staff.profile.menu_items.trainings' => 'Trainings', + 'staff.profile.menu_items.leaderboard' => 'Leaderboard', + 'staff.profile.menu_items.bank_account' => 'Bank Account', + 'staff.profile.menu_items.payments' => 'Payments', + 'staff.profile.menu_items.timecard' => 'Timecard', + 'staff.profile.menu_items.faqs' => 'FAQs', + 'staff.profile.menu_items.privacy_security' => 'Privacy & Security', + 'staff.profile.menu_items.messages' => 'Messages', + 'staff.profile.bank_account_page.title' => 'Bank Account', + 'staff.profile.bank_account_page.linked_accounts' => 'LINKED ACCOUNTS', + 'staff.profile.bank_account_page.add_account' => 'Add New Account', + 'staff.profile.bank_account_page.secure_title' => '100% Secured', + 'staff.profile.bank_account_page.secure_subtitle' => 'Your account details are encrypted and safe.', + 'staff.profile.bank_account_page.primary' => 'Primary', + 'staff.profile.bank_account_page.add_new_account' => 'Add New Account', + 'staff.profile.bank_account_page.routing_number' => 'Routing Number', + 'staff.profile.bank_account_page.routing_hint' => 'Enter routing number', + 'staff.profile.bank_account_page.account_number' => 'Account Number', + 'staff.profile.bank_account_page.account_hint' => 'Enter account number', + 'staff.profile.bank_account_page.account_type' => 'Account Type', + 'staff.profile.bank_account_page.checking' => 'Checking', + 'staff.profile.bank_account_page.savings' => 'Savings', + 'staff.profile.bank_account_page.cancel' => 'Cancel', + 'staff.profile.bank_account_page.save' => 'Save', + 'staff.profile.bank_account_page.account_ending' => ({required Object last4}) => 'Ending in ${last4}', + 'staff.profile.logout.button' => 'Sign Out', + 'staff.onboarding.personal_info.title' => 'Personal Info', + 'staff.onboarding.personal_info.change_photo_hint' => 'Tap to change photo', + 'staff.onboarding.personal_info.full_name_label' => 'Full Name', + 'staff.onboarding.personal_info.email_label' => 'Email', + 'staff.onboarding.personal_info.phone_label' => 'Phone Number', + 'staff.onboarding.personal_info.phone_hint' => '+1 (555) 000-0000', + 'staff.onboarding.personal_info.bio_label' => 'Bio', + 'staff.onboarding.personal_info.bio_hint' => 'Tell clients about yourself...', + 'staff.onboarding.personal_info.languages_label' => 'Languages', + 'staff.onboarding.personal_info.languages_hint' => 'English, Spanish, French...', + 'staff.onboarding.personal_info.locations_label' => 'Preferred Locations', + 'staff.onboarding.personal_info.locations_hint' => 'Downtown, Midtown, Brooklyn...', + 'staff.onboarding.personal_info.save_button' => 'Save Changes', + 'staff.onboarding.personal_info.save_success' => 'Personal info saved successfully', + 'staff.onboarding.experience.title' => 'Experience & Skills', + 'staff.onboarding.experience.industries_title' => 'Industries', + 'staff.onboarding.experience.industries_subtitle' => 'Select the industries you have experience in', + 'staff.onboarding.experience.skills_title' => 'Skills', + 'staff.onboarding.experience.skills_subtitle' => 'Select your skills or add custom ones', + 'staff.onboarding.experience.custom_skills_title' => 'Custom Skills:', + 'staff.onboarding.experience.custom_skill_hint' => 'Add custom skill...', + 'staff.onboarding.experience.save_button' => 'Save & Continue', + 'staff.onboarding.experience.industries.hospitality' => 'Hospitality', + 'staff.onboarding.experience.industries.food_service' => 'Food Service', + 'staff.onboarding.experience.industries.warehouse' => 'Warehouse', + 'staff.onboarding.experience.industries.events' => 'Events', + 'staff.onboarding.experience.industries.retail' => 'Retail', + 'staff.onboarding.experience.industries.healthcare' => 'Healthcare', + 'staff.onboarding.experience.industries.other' => 'Other', + 'staff.onboarding.experience.skills.food_service' => 'Food Service', + 'staff.onboarding.experience.skills.bartending' => 'Bartending', + 'staff.onboarding.experience.skills.event_setup' => 'Event Setup', + 'staff.onboarding.experience.skills.hospitality' => 'Hospitality', + 'staff.onboarding.experience.skills.warehouse' => 'Warehouse', + 'staff.onboarding.experience.skills.customer_service' => 'Customer Service', + 'staff.onboarding.experience.skills.cleaning' => 'Cleaning', + 'staff.onboarding.experience.skills.security' => 'Security', + 'staff.onboarding.experience.skills.retail' => 'Retail', + 'staff.onboarding.experience.skills.cooking' => 'Cooking', + 'staff.onboarding.experience.skills.cashier' => 'Cashier', + 'staff.onboarding.experience.skills.server' => 'Server', + 'staff.onboarding.experience.skills.barista' => 'Barista', + 'staff.onboarding.experience.skills.host_hostess' => 'Host/Hostess', + 'staff.onboarding.experience.skills.busser' => 'Busser', + 'staff_documents.title' => 'Documents', + 'staff_documents.verification_card.title' => 'Document Verification', + 'staff_documents.verification_card.progress' => ({required Object completed, required Object total}) => '${completed}/${total} Complete', + 'staff_documents.list.empty' => 'No documents found', + 'staff_documents.list.error' => ({required Object message}) => 'Error: ${message}', + 'staff_documents.card.view' => 'View', + 'staff_documents.card.upload' => 'Upload', + 'staff_documents.card.verified' => 'Verified', + 'staff_documents.card.pending' => 'Pending', + 'staff_documents.card.missing' => 'Missing', + 'staff_documents.card.rejected' => 'Rejected', + 'staff_certificates.title' => 'Certificates', + 'staff_certificates.progress.title' => 'Your Progress', + 'staff_certificates.progress.verified_count' => ({required Object completed, required Object total}) => '${completed} of ${total} verified', + 'staff_certificates.progress.active' => 'Compliance Active', + 'staff_certificates.card.expires_in_days' => ({required Object days}) => 'Expires in ${days} days - Renew now', + 'staff_certificates.card.expired' => 'Expired - Renew now', + 'staff_certificates.card.verified' => 'Verified', + 'staff_certificates.card.expiring_soon' => 'Expiring Soon', + 'staff_certificates.card.exp' => ({required Object date}) => 'Exp: ${date}', + 'staff_certificates.card.upload_button' => 'Upload Certificate', + 'staff_certificates.card.edit_expiry' => 'Edit Expiration Date', + 'staff_certificates.card.remove' => 'Remove Certificate', + 'staff_certificates.card.renew' => 'Renew', + 'staff_certificates.card.opened_snackbar' => 'Certificate opened in new tab', + 'staff_certificates.add_more.title' => 'Add Another Certificate', + 'staff_certificates.add_more.subtitle' => 'Upload additional certifications', + 'staff_certificates.upload_modal.title' => 'Upload Certificate', + 'staff_certificates.upload_modal.expiry_label' => 'Expiration Date (Optional)', + 'staff_certificates.upload_modal.select_date' => 'Select date', + 'staff_certificates.upload_modal.upload_file' => 'Upload File', + 'staff_certificates.upload_modal.drag_drop' => 'Drag and drop or click to upload', + 'staff_certificates.upload_modal.supported_formats' => 'PDF, JPG, PNG up to 10MB', + 'staff_certificates.upload_modal.cancel' => 'Cancel', + 'staff_certificates.upload_modal.save' => 'Save Certificate', + 'staff_certificates.delete_modal.title' => 'Remove Certificate?', + 'staff_certificates.delete_modal.message' => 'This action cannot be undone.', + 'staff_certificates.delete_modal.cancel' => 'Cancel', + 'staff_certificates.delete_modal.confirm' => 'Remove', + 'staff_profile_attire.title' => 'Attire', + 'staff_profile_attire.info_card.title' => 'Your Wardrobe', + 'staff_profile_attire.info_card.description' => 'Select the attire items you own. This helps us match you with shifts that fit your wardrobe.', + 'staff_profile_attire.status.required' => 'REQUIRED', + 'staff_profile_attire.status.add_photo' => 'Add Photo', + 'staff_profile_attire.status.added' => 'Added', + 'staff_profile_attire.status.pending' => '⏳ Pending verification', + 'staff_profile_attire.attestation' => 'I certify that I own these items and will wear them to my shifts. I understand that items are pending manager verification at my first shift.', + 'staff_profile_attire.actions.save' => 'Save Attire', + 'staff_profile_attire.validation.select_required' => 'βœ“ Select all required items', + 'staff_profile_attire.validation.upload_required' => 'βœ“ Upload photos of required items', + 'staff_profile_attire.validation.accept_attestation' => 'βœ“ Accept attestation', + 'staff_shifts.title' => 'Shifts', + 'staff_shifts.tabs.my_shifts' => 'My Shifts', + 'staff_shifts.tabs.find_work' => 'Find Work', + 'staff_shifts.list.no_shifts' => 'No shifts found', + 'staff_shifts.list.pending_offers' => 'PENDING OFFERS', + 'staff_shifts.list.available_jobs' => ({required Object count}) => '${count} AVAILABLE JOBS', + 'staff_shifts.list.search_hint' => 'Search jobs...', + 'staff_shifts.filter.all' => 'All Jobs', + 'staff_shifts.filter.one_day' => 'One Day', + 'staff_shifts.filter.multi_day' => 'Multi Day', + 'staff_shifts.filter.long_term' => 'Long Term', + 'staff_shifts.status.confirmed' => 'CONFIRMED', + 'staff_shifts.status.act_now' => 'ACT NOW', + 'staff_shifts.status.swap_requested' => 'SWAP REQUESTED', + 'staff_shifts.status.completed' => 'COMPLETED', + 'staff_shifts.status.no_show' => 'NO SHOW', + 'staff_shifts.status.pending_warning' => 'Please confirm assignment', + 'staff_shifts.action.decline' => 'Decline', + 'staff_shifts.action.confirm' => 'Confirm', + 'staff_shifts.action.request_swap' => 'Request Swap', + 'staff_shifts.details.additional' => 'ADDITIONAL DETAILS', + 'staff_shifts.details.days' => ({required Object days}) => '${days} Days', + 'staff_shifts.details.exp_total' => ({required Object amount}) => '(exp.total \$${amount})', + 'staff_shifts.details.pending_time' => ({required Object time}) => 'Pending ${time} ago', + 'staff_shifts.tags.immediate_start' => 'Immediate start', + 'staff_shifts.tags.no_experience' => 'No experience', + _ => null, + }; + } +} diff --git a/apps/mobile/packages/core_localization/lib/src/l10n/strings_es.g.dart b/apps/mobile/packages/core_localization/lib/src/l10n/strings_es.g.dart new file mode 100644 index 00000000..3a47abcd --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/src/l10n/strings_es.g.dart @@ -0,0 +1,2097 @@ +/// +/// Generated file. Do not edit. +/// +// coverage:ignore-file +// ignore_for_file: type=lint, unused_import +// dart format off + +import 'package:flutter/widgets.dart'; +import 'package:intl/intl.dart'; +import 'package:slang/generated.dart'; +import 'strings.g.dart'; + +// Path: +class TranslationsEs with BaseTranslations implements Translations { + /// You can call this constructor and build your own translation instance of this locale. + /// Constructing via the enum [AppLocale.build] is preferred. + TranslationsEs({Map? overrides, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver, TranslationMetadata? meta}) + : assert(overrides == null, 'Set "translation_overrides: true" in order to enable this feature.'), + $meta = meta ?? TranslationMetadata( + locale: AppLocale.es, + overrides: overrides ?? {}, + cardinalResolver: cardinalResolver, + ordinalResolver: ordinalResolver, + ) { + $meta.setFlatMapFunction(_flatMapFunction); + } + + /// Metadata for the translations of . + @override final TranslationMetadata $meta; + + /// Access flat map + @override dynamic operator[](String key) => $meta.getTranslation(key); + + late final TranslationsEs _root = this; // ignore: unused_field + + @override + TranslationsEs $copyWith({TranslationMetadata? meta}) => TranslationsEs(meta: meta ?? this.$meta); + + // Translations + @override late final _TranslationsCommonEs common = _TranslationsCommonEs._(_root); + @override late final _TranslationsSettingsEs settings = _TranslationsSettingsEs._(_root); + @override late final _TranslationsStaffAuthenticationEs staff_authentication = _TranslationsStaffAuthenticationEs._(_root); + @override late final _TranslationsClientAuthenticationEs client_authentication = _TranslationsClientAuthenticationEs._(_root); + @override late final _TranslationsClientHomeEs client_home = _TranslationsClientHomeEs._(_root); + @override late final _TranslationsClientSettingsEs client_settings = _TranslationsClientSettingsEs._(_root); + @override late final _TranslationsClientHubsEs client_hubs = _TranslationsClientHubsEs._(_root); + @override late final _TranslationsClientCreateOrderEs client_create_order = _TranslationsClientCreateOrderEs._(_root); + @override late final _TranslationsClientMainEs client_main = _TranslationsClientMainEs._(_root); + @override late final _TranslationsClientViewOrdersEs client_view_orders = _TranslationsClientViewOrdersEs._(_root); + @override late final _TranslationsClientBillingEs client_billing = _TranslationsClientBillingEs._(_root); + @override late final _TranslationsStaffEs staff = _TranslationsStaffEs._(_root); + @override late final _TranslationsStaffDocumentsEs staff_documents = _TranslationsStaffDocumentsEs._(_root); + @override late final _TranslationsStaffCertificatesEs staff_certificates = _TranslationsStaffCertificatesEs._(_root); + @override late final _TranslationsStaffProfileAttireEs staff_profile_attire = _TranslationsStaffProfileAttireEs._(_root); + @override late final _TranslationsStaffShiftsEs staff_shifts = _TranslationsStaffShiftsEs._(_root); +} + +// Path: common +class _TranslationsCommonEs implements TranslationsCommonEn { + _TranslationsCommonEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get ok => 'Aceptar'; + @override String get cancel => 'Cancelar'; + @override String get save => 'Guardar'; + @override String get delete => 'Eliminar'; + @override String get continue_text => 'Continuar'; +} + +// Path: settings +class _TranslationsSettingsEs implements TranslationsSettingsEn { + _TranslationsSettingsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get language => 'Idioma'; + @override String get change_language => 'Cambiar Idioma'; +} + +// Path: staff_authentication +class _TranslationsStaffAuthenticationEs implements TranslationsStaffAuthenticationEn { + _TranslationsStaffAuthenticationEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override late final _TranslationsStaffAuthenticationGetStartedPageEs get_started_page = _TranslationsStaffAuthenticationGetStartedPageEs._(_root); + @override late final _TranslationsStaffAuthenticationPhoneVerificationPageEs phone_verification_page = _TranslationsStaffAuthenticationPhoneVerificationPageEs._(_root); + @override late final _TranslationsStaffAuthenticationPhoneInputEs phone_input = _TranslationsStaffAuthenticationPhoneInputEs._(_root); + @override late final _TranslationsStaffAuthenticationOtpVerificationEs otp_verification = _TranslationsStaffAuthenticationOtpVerificationEs._(_root); + @override late final _TranslationsStaffAuthenticationProfileSetupPageEs profile_setup_page = _TranslationsStaffAuthenticationProfileSetupPageEs._(_root); + @override late final _TranslationsStaffAuthenticationCommonEs common = _TranslationsStaffAuthenticationCommonEs._(_root); +} + +// Path: client_authentication +class _TranslationsClientAuthenticationEs implements TranslationsClientAuthenticationEn { + _TranslationsClientAuthenticationEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override late final _TranslationsClientAuthenticationGetStartedPageEs get_started_page = _TranslationsClientAuthenticationGetStartedPageEs._(_root); + @override late final _TranslationsClientAuthenticationSignInPageEs sign_in_page = _TranslationsClientAuthenticationSignInPageEs._(_root); + @override late final _TranslationsClientAuthenticationSignUpPageEs sign_up_page = _TranslationsClientAuthenticationSignUpPageEs._(_root); +} + +// Path: client_home +class _TranslationsClientHomeEs implements TranslationsClientHomeEn { + _TranslationsClientHomeEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override late final _TranslationsClientHomeDashboardEs dashboard = _TranslationsClientHomeDashboardEs._(_root); + @override late final _TranslationsClientHomeWidgetsEs widgets = _TranslationsClientHomeWidgetsEs._(_root); + @override late final _TranslationsClientHomeActionsEs actions = _TranslationsClientHomeActionsEs._(_root); + @override late final _TranslationsClientHomeReorderEs reorder = _TranslationsClientHomeReorderEs._(_root); + @override late final _TranslationsClientHomeFormEs form = _TranslationsClientHomeFormEs._(_root); +} + +// Path: client_settings +class _TranslationsClientSettingsEs implements TranslationsClientSettingsEn { + _TranslationsClientSettingsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override late final _TranslationsClientSettingsProfileEs profile = _TranslationsClientSettingsProfileEs._(_root); +} + +// Path: client_hubs +class _TranslationsClientHubsEs implements TranslationsClientHubsEn { + _TranslationsClientHubsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Hubs'; + @override String get subtitle => 'Gestionar ubicaciones de marcaje'; + @override String get add_hub => 'AΓ±adir Hub'; + @override late final _TranslationsClientHubsEmptyStateEs empty_state = _TranslationsClientHubsEmptyStateEs._(_root); + @override late final _TranslationsClientHubsAboutHubsEs about_hubs = _TranslationsClientHubsAboutHubsEs._(_root); + @override late final _TranslationsClientHubsHubCardEs hub_card = _TranslationsClientHubsHubCardEs._(_root); + @override late final _TranslationsClientHubsAddHubDialogEs add_hub_dialog = _TranslationsClientHubsAddHubDialogEs._(_root); + @override late final _TranslationsClientHubsNfcDialogEs nfc_dialog = _TranslationsClientHubsNfcDialogEs._(_root); +} + +// Path: client_create_order +class _TranslationsClientCreateOrderEs implements TranslationsClientCreateOrderEn { + _TranslationsClientCreateOrderEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Crear Orden'; + @override String get section_title => 'TIPO DE ORDEN'; + @override late final _TranslationsClientCreateOrderTypesEs types = _TranslationsClientCreateOrderTypesEs._(_root); + @override late final _TranslationsClientCreateOrderRapidEs rapid = _TranslationsClientCreateOrderRapidEs._(_root); + @override late final _TranslationsClientCreateOrderOneTimeEs one_time = _TranslationsClientCreateOrderOneTimeEs._(_root); + @override late final _TranslationsClientCreateOrderRecurringEs recurring = _TranslationsClientCreateOrderRecurringEs._(_root); + @override late final _TranslationsClientCreateOrderPermanentEs permanent = _TranslationsClientCreateOrderPermanentEs._(_root); +} + +// Path: client_main +class _TranslationsClientMainEs implements TranslationsClientMainEn { + _TranslationsClientMainEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override late final _TranslationsClientMainTabsEs tabs = _TranslationsClientMainTabsEs._(_root); +} + +// Path: client_view_orders +class _TranslationsClientViewOrdersEs implements TranslationsClientViewOrdersEn { + _TranslationsClientViewOrdersEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Γ“rdenes'; + @override String get post_button => 'Publicar'; + @override String get post_order => 'Publicar una Orden'; + @override String no_orders({required Object date}) => 'No hay Γ³rdenes para ${date}'; + @override late final _TranslationsClientViewOrdersTabsEs tabs = _TranslationsClientViewOrdersTabsEs._(_root); + @override late final _TranslationsClientViewOrdersCardEs card = _TranslationsClientViewOrdersCardEs._(_root); +} + +// Path: client_billing +class _TranslationsClientBillingEs implements TranslationsClientBillingEn { + _TranslationsClientBillingEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'FacturaciΓ³n'; + @override String get current_period => 'PerΓ­odo Actual'; + @override String saved_amount({required Object amount}) => '${amount} ahorrado'; + @override String get awaiting_approval => 'Esperando AprobaciΓ³n'; + @override String get payment_method => 'MΓ©todo de Pago'; + @override String get add_payment => 'AΓ±adir'; + @override String get default_badge => 'Predeterminado'; + @override String expires({required Object date}) => 'Expira ${date}'; + @override String get period_breakdown => 'Desglose de este PerΓ­odo'; + @override String get week => 'Semana'; + @override String get month => 'Mes'; + @override String get total => 'Total'; + @override String hours({required Object count}) => '${count} horas'; + @override String get rate_optimization_title => 'OptimizaciΓ³n de Tarifas'; + @override String rate_optimization_body({required Object amount}) => 'Ahorra ${amount}/mes cambiando 3 turnos'; + @override String get view_details => 'Ver Detalles'; + @override String get invoice_history => 'Historial de Facturas'; + @override String get view_all => 'Ver todo'; + @override String get export_button => 'Exportar Todas las Facturas'; + @override String get pending_badge => 'PENDIENTE APROBACIΓ“N'; + @override String get paid_badge => 'PAGADO'; +} + +// Path: staff +class _TranslationsStaffEs implements TranslationsStaffEn { + _TranslationsStaffEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override late final _TranslationsStaffMainEs main = _TranslationsStaffMainEs._(_root); + @override late final _TranslationsStaffHomeEs home = _TranslationsStaffHomeEs._(_root); + @override late final _TranslationsStaffProfileEs profile = _TranslationsStaffProfileEs._(_root); + @override late final _TranslationsStaffOnboardingEs onboarding = _TranslationsStaffOnboardingEs._(_root); +} + +// Path: staff_documents +class _TranslationsStaffDocumentsEs implements TranslationsStaffDocumentsEn { + _TranslationsStaffDocumentsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Documents'; + @override late final _TranslationsStaffDocumentsVerificationCardEs verification_card = _TranslationsStaffDocumentsVerificationCardEs._(_root); + @override late final _TranslationsStaffDocumentsListEs list = _TranslationsStaffDocumentsListEs._(_root); + @override late final _TranslationsStaffDocumentsCardEs card = _TranslationsStaffDocumentsCardEs._(_root); +} + +// Path: staff_certificates +class _TranslationsStaffCertificatesEs implements TranslationsStaffCertificatesEn { + _TranslationsStaffCertificatesEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Certificates'; + @override late final _TranslationsStaffCertificatesProgressEs progress = _TranslationsStaffCertificatesProgressEs._(_root); + @override late final _TranslationsStaffCertificatesCardEs card = _TranslationsStaffCertificatesCardEs._(_root); + @override late final _TranslationsStaffCertificatesAddMoreEs add_more = _TranslationsStaffCertificatesAddMoreEs._(_root); + @override late final _TranslationsStaffCertificatesUploadModalEs upload_modal = _TranslationsStaffCertificatesUploadModalEs._(_root); + @override late final _TranslationsStaffCertificatesDeleteModalEs delete_modal = _TranslationsStaffCertificatesDeleteModalEs._(_root); +} + +// Path: staff_profile_attire +class _TranslationsStaffProfileAttireEs implements TranslationsStaffProfileAttireEn { + _TranslationsStaffProfileAttireEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Vestimenta'; + @override late final _TranslationsStaffProfileAttireInfoCardEs info_card = _TranslationsStaffProfileAttireInfoCardEs._(_root); + @override late final _TranslationsStaffProfileAttireStatusEs status = _TranslationsStaffProfileAttireStatusEs._(_root); + @override String get attestation => 'Certifico que poseo estos artΓ­culos y los usarΓ© en mis turnos. Entiendo que los artΓ­culos estΓ‘n pendientes de verificaciΓ³n por el gerente en mi primer turno.'; + @override late final _TranslationsStaffProfileAttireActionsEs actions = _TranslationsStaffProfileAttireActionsEs._(_root); + @override late final _TranslationsStaffProfileAttireValidationEs validation = _TranslationsStaffProfileAttireValidationEs._(_root); +} + +// Path: staff_shifts +class _TranslationsStaffShiftsEs implements TranslationsStaffShiftsEn { + _TranslationsStaffShiftsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Shifts'; + @override late final _TranslationsStaffShiftsTabsEs tabs = _TranslationsStaffShiftsTabsEs._(_root); + @override late final _TranslationsStaffShiftsListEs list = _TranslationsStaffShiftsListEs._(_root); + @override late final _TranslationsStaffShiftsFilterEs filter = _TranslationsStaffShiftsFilterEs._(_root); + @override late final _TranslationsStaffShiftsStatusEs status = _TranslationsStaffShiftsStatusEs._(_root); + @override late final _TranslationsStaffShiftsActionEs action = _TranslationsStaffShiftsActionEs._(_root); + @override late final _TranslationsStaffShiftsDetailsEs details = _TranslationsStaffShiftsDetailsEs._(_root); + @override late final _TranslationsStaffShiftsTagsEs tags = _TranslationsStaffShiftsTagsEs._(_root); +} + +// Path: staff_authentication.get_started_page +class _TranslationsStaffAuthenticationGetStartedPageEs implements TranslationsStaffAuthenticationGetStartedPageEn { + _TranslationsStaffAuthenticationGetStartedPageEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title_part1 => 'Trabaja, Crece, '; + @override String get title_part2 => 'ElΓ©vate'; + @override String get subtitle => 'Construye tu carrera en hostelerΓ­a con \nflexibilidad y libertad.'; + @override String get sign_up_button => 'Registrarse'; + @override String get log_in_button => 'Iniciar sesiΓ³n'; +} + +// Path: staff_authentication.phone_verification_page +class _TranslationsStaffAuthenticationPhoneVerificationPageEs implements TranslationsStaffAuthenticationPhoneVerificationPageEn { + _TranslationsStaffAuthenticationPhoneVerificationPageEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get validation_error => 'Por favor, ingresa un nΓΊmero de telΓ©fono vΓ‘lido de 10 dΓ­gitos'; + @override String get send_code_button => 'Enviar cΓ³digo'; + @override String get enter_code_title => 'Ingresa el cΓ³digo de verificaciΓ³n'; + @override String get code_sent_message => 'Enviamos un cΓ³digo de 6 dΓ­gitos a '; + @override String get code_sent_instruction => '. IngrΓ©salo a continuaciΓ³n para verificar tu cuenta.'; +} + +// Path: staff_authentication.phone_input +class _TranslationsStaffAuthenticationPhoneInputEs implements TranslationsStaffAuthenticationPhoneInputEn { + _TranslationsStaffAuthenticationPhoneInputEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Verifica tu nΓΊmero de telΓ©fono'; + @override String get subtitle => 'Te enviaremos un cΓ³digo de verificaciΓ³n para comenzar.'; + @override String get label => 'NΓΊmero de telΓ©fono'; + @override String get hint => 'Ingresa tu nΓΊmero'; +} + +// Path: staff_authentication.otp_verification +class _TranslationsStaffAuthenticationOtpVerificationEs implements TranslationsStaffAuthenticationOtpVerificationEn { + _TranslationsStaffAuthenticationOtpVerificationEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get did_not_get_code => 'ΒΏNo recibiste el cΓ³digo?'; + @override String resend_in({required Object seconds}) => 'Reenviar en ${seconds} s'; + @override String get resend_code => 'Reenviar cΓ³digo'; +} + +// Path: staff_authentication.profile_setup_page +class _TranslationsStaffAuthenticationProfileSetupPageEs implements TranslationsStaffAuthenticationProfileSetupPageEn { + _TranslationsStaffAuthenticationProfileSetupPageEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String step_indicator({required Object current, required Object total}) => 'Paso ${current} de ${total}'; + @override String get error_occurred => 'OcurriΓ³ un error'; + @override String get complete_setup_button => 'Completar configuraciΓ³n'; + @override late final _TranslationsStaffAuthenticationProfileSetupPageStepsEs steps = _TranslationsStaffAuthenticationProfileSetupPageStepsEs._(_root); + @override late final _TranslationsStaffAuthenticationProfileSetupPageBasicInfoEs basic_info = _TranslationsStaffAuthenticationProfileSetupPageBasicInfoEs._(_root); + @override late final _TranslationsStaffAuthenticationProfileSetupPageLocationEs location = _TranslationsStaffAuthenticationProfileSetupPageLocationEs._(_root); + @override late final _TranslationsStaffAuthenticationProfileSetupPageExperienceEs experience = _TranslationsStaffAuthenticationProfileSetupPageExperienceEs._(_root); +} + +// Path: staff_authentication.common +class _TranslationsStaffAuthenticationCommonEs implements TranslationsStaffAuthenticationCommonEn { + _TranslationsStaffAuthenticationCommonEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get trouble_question => 'ΒΏTienes problemas? '; + @override String get contact_support => 'Contactar a soporte'; +} + +// Path: client_authentication.get_started_page +class _TranslationsClientAuthenticationGetStartedPageEs implements TranslationsClientAuthenticationGetStartedPageEn { + _TranslationsClientAuthenticationGetStartedPageEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Toma el control de tus\nturnos y eventos'; + @override String get subtitle => 'Optimiza tus operaciones con potentes herramientas para gestionar horarios, realizar un seguimiento del rendimiento y mantener a tu equipo en la misma pΓ‘gina, todo en un solo lugar'; + @override String get sign_in_button => 'Iniciar sesiΓ³n'; + @override String get create_account_button => 'Crear cuenta'; +} + +// Path: client_authentication.sign_in_page +class _TranslationsClientAuthenticationSignInPageEs implements TranslationsClientAuthenticationSignInPageEn { + _TranslationsClientAuthenticationSignInPageEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Bienvenido de nuevo'; + @override String get subtitle => 'Inicia sesiΓ³n para gestionar tus turnos y trabajadores'; + @override String get email_label => 'Correo electrΓ³nico'; + @override String get email_hint => 'Ingresa tu correo electrΓ³nico'; + @override String get password_label => 'ContraseΓ±a'; + @override String get password_hint => 'Ingresa tu contraseΓ±a'; + @override String get forgot_password => 'ΒΏOlvidaste tu contraseΓ±a?'; + @override String get sign_in_button => 'Iniciar sesiΓ³n'; + @override String get or_divider => 'o'; + @override String get social_apple => 'Iniciar sesiΓ³n con Apple'; + @override String get social_google => 'Iniciar sesiΓ³n con Google'; + @override String get no_account => 'ΒΏNo tienes una cuenta? '; + @override String get sign_up_link => 'RegΓ­strate'; +} + +// Path: client_authentication.sign_up_page +class _TranslationsClientAuthenticationSignUpPageEs implements TranslationsClientAuthenticationSignUpPageEn { + _TranslationsClientAuthenticationSignUpPageEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Crear cuenta'; + @override String get subtitle => 'Comienza con Krow para tu negocio'; + @override String get company_label => 'Nombre de la empresa'; + @override String get company_hint => 'Ingresa el nombre de la empresa'; + @override String get email_label => 'Correo electrΓ³nico'; + @override String get email_hint => 'Ingresa tu correo electrΓ³nico'; + @override String get password_label => 'ContraseΓ±a'; + @override String get password_hint => 'Crea una contraseΓ±a'; + @override String get confirm_password_label => 'Confirmar contraseΓ±a'; + @override String get confirm_password_hint => 'Confirma tu contraseΓ±a'; + @override String get create_account_button => 'Crear cuenta'; + @override String get or_divider => 'o'; + @override String get social_apple => 'RegΓ­strate con Apple'; + @override String get social_google => 'RegΓ­strate con Google'; + @override String get has_account => 'ΒΏYa tienes una cuenta? '; + @override String get sign_in_link => 'Iniciar sesiΓ³n'; +} + +// Path: client_home.dashboard +class _TranslationsClientHomeDashboardEs implements TranslationsClientHomeDashboardEn { + _TranslationsClientHomeDashboardEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get welcome_back => 'Bienvenido de nuevo'; + @override String get edit_mode_active => 'Modo EdiciΓ³n Activo'; + @override String get drag_instruction => 'Arrastra para reordenar, cambia la visibilidad'; + @override String get reset => 'Restablecer'; + @override String get metric_needed => 'Necesario'; + @override String get metric_filled => 'Lleno'; + @override String get metric_open => 'Abierto'; + @override String get view_all => 'Ver todo'; + @override String insight_lightbulb({required Object amount}) => 'Ahorra ${amount}/mes'; + @override String get insight_tip => 'Reserva con 48h de antelaciΓ³n para mejores tarifas'; +} + +// Path: client_home.widgets +class _TranslationsClientHomeWidgetsEs implements TranslationsClientHomeWidgetsEn { + _TranslationsClientHomeWidgetsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get actions => 'Acciones RΓ‘pidas'; + @override String get reorder => 'Reordenar'; + @override String get coverage => 'Cobertura de Hoy'; + @override String get spending => 'InformaciΓ³n de Gastos'; + @override String get live_activity => 'Actividad en Vivo'; +} + +// Path: client_home.actions +class _TranslationsClientHomeActionsEs implements TranslationsClientHomeActionsEn { + _TranslationsClientHomeActionsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get rapid => 'RÁPIDO'; + @override String get rapid_subtitle => 'Urgente mismo dΓ­a'; + @override String get create_order => 'Crear Orden'; + @override String get create_order_subtitle => 'Programar turnos'; + @override String get hubs => 'Hubs'; + @override String get hubs_subtitle => 'Puntos marcaje'; +} + +// Path: client_home.reorder +class _TranslationsClientHomeReorderEs implements TranslationsClientHomeReorderEn { + _TranslationsClientHomeReorderEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'REORDENAR'; + @override String get reorder_button => 'Reordenar'; + @override String per_hr({required Object amount}) => '${amount}/hr'; +} + +// Path: client_home.form +class _TranslationsClientHomeFormEs implements TranslationsClientHomeFormEn { + _TranslationsClientHomeFormEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get edit_reorder => 'Editar y Reordenar'; + @override String get post_new => 'Publicar un Nuevo Turno'; + @override String get review_subtitle => 'Revisa y edita los detalles antes de publicar'; + @override String get date_label => 'Fecha *'; + @override String get date_hint => 'mm/dd/aaaa'; + @override String get location_label => 'UbicaciΓ³n *'; + @override String get location_hint => 'DirecciΓ³n del negocio'; + @override String get positions_title => 'Posiciones'; + @override String get add_position => 'AΓ±adir PosiciΓ³n'; + @override String get role_label => 'Rol *'; + @override String get role_hint => 'Seleccionar rol'; + @override String get start_time => 'Hora de Inicio *'; + @override String get end_time => 'Hora de Fin *'; + @override String get workers_needed => 'Trabajadores Necesarios *'; + @override String get hourly_rate => 'Tarifa por hora (\$) *'; + @override String get post_shift => 'Publicar Turno'; +} + +// Path: client_settings.profile +class _TranslationsClientSettingsProfileEs implements TranslationsClientSettingsProfileEn { + _TranslationsClientSettingsProfileEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Perfil'; + @override String get edit_profile => 'Editar Perfil'; + @override String get hubs => 'Hubs'; + @override String get log_out => 'Cerrar sesiΓ³n'; + @override String get quick_links => 'Enlaces rΓ‘pidos'; + @override String get clock_in_hubs => 'Hubs de Marcaje'; + @override String get billing_payments => 'FacturaciΓ³n y Pagos'; +} + +// Path: client_hubs.empty_state +class _TranslationsClientHubsEmptyStateEs implements TranslationsClientHubsEmptyStateEn { + _TranslationsClientHubsEmptyStateEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'No hay hubs aΓΊn'; + @override String get description => 'Crea estaciones de marcaje para tus ubicaciones'; + @override String get button => 'AΓ±ade tu primer Hub'; +} + +// Path: client_hubs.about_hubs +class _TranslationsClientHubsAboutHubsEs implements TranslationsClientHubsAboutHubsEn { + _TranslationsClientHubsAboutHubsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Sobre los Hubs'; + @override String get description => 'Los Hubs son estaciones de marcaje en tus ubicaciones. Asigna etiquetas NFC a cada hub para que los trabajadores puedan marcar entrada/salida rΓ‘pidamente usando sus telΓ©fonos.'; +} + +// Path: client_hubs.hub_card +class _TranslationsClientHubsHubCardEs implements TranslationsClientHubsHubCardEn { + _TranslationsClientHubsHubCardEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String tag_label({required Object id}) => 'Etiqueta: ${id}'; +} + +// Path: client_hubs.add_hub_dialog +class _TranslationsClientHubsAddHubDialogEs implements TranslationsClientHubsAddHubDialogEn { + _TranslationsClientHubsAddHubDialogEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'AΓ±adir Nuevo Hub'; + @override String get name_label => 'Nombre del Hub *'; + @override String get name_hint => 'ej., Cocina Principal, RecepciΓ³n'; + @override String get location_label => 'Nombre de la UbicaciΓ³n'; + @override String get location_hint => 'ej., Restaurante Centro'; + @override String get address_label => 'DirecciΓ³n'; + @override String get address_hint => 'DirecciΓ³n completa'; + @override String get create_button => 'Crear Hub'; +} + +// Path: client_hubs.nfc_dialog +class _TranslationsClientHubsNfcDialogEs implements TranslationsClientHubsNfcDialogEn { + _TranslationsClientHubsNfcDialogEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Identificar Etiqueta NFC'; + @override String get instruction => 'Acerque su telΓ©fono a la etiqueta NFC para identificarla'; + @override String get scan_button => 'Escanear Etiqueta NFC'; + @override String get tag_identified => 'Etiqueta Identificada'; + @override String get assign_button => 'Asignar Etiqueta'; +} + +// Path: client_create_order.types +class _TranslationsClientCreateOrderTypesEs implements TranslationsClientCreateOrderTypesEn { + _TranslationsClientCreateOrderTypesEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get rapid => 'RÁPIDO'; + @override String get rapid_desc => 'Cobertura URGENTE mismo dΓ­a'; + @override String get one_time => 'Única Vez'; + @override String get one_time_desc => 'Evento Único o PeticiΓ³n de Turno'; + @override String get recurring => 'Recurrente'; + @override String get recurring_desc => 'Cobertura Continua Semanal / Mensual'; + @override String get permanent => 'Permanente'; + @override String get permanent_desc => 'ColocaciΓ³n de Personal a Largo Plazo'; +} + +// Path: client_create_order.rapid +class _TranslationsClientCreateOrderRapidEs implements TranslationsClientCreateOrderRapidEn { + _TranslationsClientCreateOrderRapidEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Orden RÁPIDA'; + @override String get subtitle => 'Personal de emergencia en minutos'; + @override String get urgent_badge => 'URGENTE'; + @override String get tell_us => 'Dinos quΓ© necesitas'; + @override String get need_staff => 'ΒΏNecesitas personal urgentemente?'; + @override String get type_or_speak => 'Escribe o habla lo que necesitas. Yo me encargo del resto'; + @override String get example => 'Ejemplo: '; + @override String get hint => 'Escribe o habla... (ej., "Necesito 5 cocineros YA hasta las 5am")'; + @override String get speak => 'Hablar'; + @override String get listening => 'Escuchando...'; + @override String get send => 'Enviar Mensaje'; + @override String get sending => 'Enviando...'; + @override String get success_title => 'Β‘Solicitud Enviada!'; + @override String get success_message => 'Estamos encontrando trabajadores disponibles para ti ahora mismo. Te notificaremos cuando acepten.'; + @override String get back_to_orders => 'Volver a Γ“rdenes'; +} + +// Path: client_create_order.one_time +class _TranslationsClientCreateOrderOneTimeEs implements TranslationsClientCreateOrderOneTimeEn { + _TranslationsClientCreateOrderOneTimeEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Orden Única Vez'; + @override String get subtitle => 'Evento ΓΊnico o peticiΓ³n de turno'; + @override String get create_your_order => 'Crea Tu Orden'; + @override String get date_label => 'Fecha'; + @override String get date_hint => 'Seleccionar fecha'; + @override String get location_label => 'UbicaciΓ³n'; + @override String get location_hint => 'Ingresar direcciΓ³n'; + @override String get positions_title => 'Posiciones'; + @override String get add_position => 'AΓ±adir PosiciΓ³n'; + @override String position_number({required Object number}) => 'PosiciΓ³n ${number}'; + @override String get remove => 'Eliminar'; + @override String get select_role => 'Seleccionar rol'; + @override String get start_label => 'Inicio'; + @override String get end_label => 'Fin'; + @override String get workers_label => 'Trabajadores'; + @override String get lunch_break_label => 'Descanso para Almuerzo'; + @override String get different_location => 'Usar ubicaciΓ³n diferente para esta posiciΓ³n'; + @override String get different_location_title => 'UbicaciΓ³n Diferente'; + @override String get different_location_hint => 'Ingresar direcciΓ³n diferente'; + @override String get create_order => 'Crear Orden'; + @override String get creating => 'Creando...'; + @override String get success_title => 'Β‘Orden Creada!'; + @override String get success_message => 'Tu solicitud de turno ha sido publicada. Los trabajadores comenzarΓ‘n a postularse pronto.'; + @override String get back_to_orders => 'Volver a Γ“rdenes'; + @override String get no_break => 'Sin descanso'; + @override String get paid_break => 'min (Pagado)'; + @override String get unpaid_break => 'min (No pagado)'; +} + +// Path: client_create_order.recurring +class _TranslationsClientCreateOrderRecurringEs implements TranslationsClientCreateOrderRecurringEn { + _TranslationsClientCreateOrderRecurringEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Orden Recurrente'; + @override String get subtitle => 'Cobertura continua semanal/mensual'; + @override String get placeholder => 'Flujo de Orden Recurrente (Trabajo en Progreso)'; +} + +// Path: client_create_order.permanent +class _TranslationsClientCreateOrderPermanentEs implements TranslationsClientCreateOrderPermanentEn { + _TranslationsClientCreateOrderPermanentEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Orden Permanente'; + @override String get subtitle => 'ColocaciΓ³n de personal a largo plazo'; + @override String get placeholder => 'Flujo de Orden Permanente (Trabajo en Progreso)'; +} + +// Path: client_main.tabs +class _TranslationsClientMainTabsEs implements TranslationsClientMainTabsEn { + _TranslationsClientMainTabsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get coverage => 'Cobertura'; + @override String get billing => 'FacturaciΓ³n'; + @override String get home => 'Inicio'; + @override String get orders => 'Γ“rdenes'; + @override String get reports => 'Reportes'; +} + +// Path: client_view_orders.tabs +class _TranslationsClientViewOrdersTabsEs implements TranslationsClientViewOrdersTabsEn { + _TranslationsClientViewOrdersTabsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get up_next => 'PrΓ³ximos'; + @override String get active => 'Activos'; + @override String get completed => 'Completados'; +} + +// Path: client_view_orders.card +class _TranslationsClientViewOrdersCardEs implements TranslationsClientViewOrdersCardEn { + _TranslationsClientViewOrdersCardEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get open => 'ABIERTO'; + @override String get filled => 'LLENO'; + @override String get confirmed => 'CONFIRMADO'; + @override String get in_progress => 'EN PROGRESO'; + @override String get completed => 'COMPLETADO'; + @override String get cancelled => 'CANCELADO'; + @override String get get_direction => 'Obtener direcciΓ³n'; + @override String get total => 'Total'; + @override String get hrs => 'HRS'; + @override String workers({required Object count}) => '${count} trabajadores'; + @override String get clock_in => 'ENTRADA'; + @override String get clock_out => 'SALIDA'; + @override String get coverage => 'Cobertura'; + @override String workers_label({required Object filled, required Object needed}) => '${filled}/${needed} Trabajadores'; + @override String get confirmed_workers => 'Trabajadores Confirmados'; + @override String get no_workers => 'NingΓΊn trabajador confirmado aΓΊn.'; +} + +// Path: staff.main +class _TranslationsStaffMainEs implements TranslationsStaffMainEn { + _TranslationsStaffMainEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override late final _TranslationsStaffMainTabsEs tabs = _TranslationsStaffMainTabsEs._(_root); +} + +// Path: staff.home +class _TranslationsStaffHomeEs implements TranslationsStaffHomeEn { + _TranslationsStaffHomeEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override late final _TranslationsStaffHomeHeaderEs header = _TranslationsStaffHomeHeaderEs._(_root); + @override late final _TranslationsStaffHomeBannersEs banners = _TranslationsStaffHomeBannersEs._(_root); + @override late final _TranslationsStaffHomeQuickActionsEs quick_actions = _TranslationsStaffHomeQuickActionsEs._(_root); + @override late final _TranslationsStaffHomeSectionsEs sections = _TranslationsStaffHomeSectionsEs._(_root); + @override late final _TranslationsStaffHomeEmptyStatesEs empty_states = _TranslationsStaffHomeEmptyStatesEs._(_root); + @override late final _TranslationsStaffHomePendingPaymentEs pending_payment = _TranslationsStaffHomePendingPaymentEs._(_root); + @override late final _TranslationsStaffHomeRecommendedCardEs recommended_card = _TranslationsStaffHomeRecommendedCardEs._(_root); + @override late final _TranslationsStaffHomeBenefitsEs benefits = _TranslationsStaffHomeBenefitsEs._(_root); + @override late final _TranslationsStaffHomeAutoMatchEs auto_match = _TranslationsStaffHomeAutoMatchEs._(_root); + @override late final _TranslationsStaffHomeImproveEs improve = _TranslationsStaffHomeImproveEs._(_root); + @override late final _TranslationsStaffHomeMoreWaysEs more_ways = _TranslationsStaffHomeMoreWaysEs._(_root); +} + +// Path: staff.profile +class _TranslationsStaffProfileEs implements TranslationsStaffProfileEn { + _TranslationsStaffProfileEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override late final _TranslationsStaffProfileHeaderEs header = _TranslationsStaffProfileHeaderEs._(_root); + @override late final _TranslationsStaffProfileReliabilityStatsEs reliability_stats = _TranslationsStaffProfileReliabilityStatsEs._(_root); + @override late final _TranslationsStaffProfileReliabilityScoreEs reliability_score = _TranslationsStaffProfileReliabilityScoreEs._(_root); + @override late final _TranslationsStaffProfileSectionsEs sections = _TranslationsStaffProfileSectionsEs._(_root); + @override late final _TranslationsStaffProfileMenuItemsEs menu_items = _TranslationsStaffProfileMenuItemsEs._(_root); + @override late final _TranslationsStaffProfileBankAccountPageEs bank_account_page = _TranslationsStaffProfileBankAccountPageEs._(_root); + @override late final _TranslationsStaffProfileLogoutEs logout = _TranslationsStaffProfileLogoutEs._(_root); +} + +// Path: staff.onboarding +class _TranslationsStaffOnboardingEs implements TranslationsStaffOnboardingEn { + _TranslationsStaffOnboardingEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override late final _TranslationsStaffOnboardingPersonalInfoEs personal_info = _TranslationsStaffOnboardingPersonalInfoEs._(_root); + @override late final _TranslationsStaffOnboardingExperienceEs experience = _TranslationsStaffOnboardingExperienceEs._(_root); +} + +// Path: staff_documents.verification_card +class _TranslationsStaffDocumentsVerificationCardEs implements TranslationsStaffDocumentsVerificationCardEn { + _TranslationsStaffDocumentsVerificationCardEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Document Verification'; + @override String progress({required Object completed, required Object total}) => '${completed}/${total} Complete'; +} + +// Path: staff_documents.list +class _TranslationsStaffDocumentsListEs implements TranslationsStaffDocumentsListEn { + _TranslationsStaffDocumentsListEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get empty => 'No documents found'; + @override String error({required Object message}) => 'Error: ${message}'; +} + +// Path: staff_documents.card +class _TranslationsStaffDocumentsCardEs implements TranslationsStaffDocumentsCardEn { + _TranslationsStaffDocumentsCardEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get view => 'View'; + @override String get upload => 'Upload'; + @override String get verified => 'Verified'; + @override String get pending => 'Pending'; + @override String get missing => 'Missing'; + @override String get rejected => 'Rejected'; +} + +// Path: staff_certificates.progress +class _TranslationsStaffCertificatesProgressEs implements TranslationsStaffCertificatesProgressEn { + _TranslationsStaffCertificatesProgressEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Your Progress'; + @override String verified_count({required Object completed, required Object total}) => '${completed} of ${total} verified'; + @override String get active => 'Compliance Active'; +} + +// Path: staff_certificates.card +class _TranslationsStaffCertificatesCardEs implements TranslationsStaffCertificatesCardEn { + _TranslationsStaffCertificatesCardEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String expires_in_days({required Object days}) => 'Expires in ${days} days - Renew now'; + @override String get expired => 'Expired - Renew now'; + @override String get verified => 'Verified'; + @override String get expiring_soon => 'Expiring Soon'; + @override String exp({required Object date}) => 'Exp: ${date}'; + @override String get upload_button => 'Upload Certificate'; + @override String get edit_expiry => 'Edit Expiration Date'; + @override String get remove => 'Remove Certificate'; + @override String get renew => 'Renew'; + @override String get opened_snackbar => 'Certificate opened in new tab'; +} + +// Path: staff_certificates.add_more +class _TranslationsStaffCertificatesAddMoreEs implements TranslationsStaffCertificatesAddMoreEn { + _TranslationsStaffCertificatesAddMoreEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Add Another Certificate'; + @override String get subtitle => 'Upload additional certifications'; +} + +// Path: staff_certificates.upload_modal +class _TranslationsStaffCertificatesUploadModalEs implements TranslationsStaffCertificatesUploadModalEn { + _TranslationsStaffCertificatesUploadModalEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Upload Certificate'; + @override String get expiry_label => 'Expiration Date (Optional)'; + @override String get select_date => 'Select date'; + @override String get upload_file => 'Upload File'; + @override String get drag_drop => 'Drag and drop or click to upload'; + @override String get supported_formats => 'PDF, JPG, PNG up to 10MB'; + @override String get cancel => 'Cancel'; + @override String get save => 'Save Certificate'; +} + +// Path: staff_certificates.delete_modal +class _TranslationsStaffCertificatesDeleteModalEs implements TranslationsStaffCertificatesDeleteModalEn { + _TranslationsStaffCertificatesDeleteModalEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Remove Certificate?'; + @override String get message => 'This action cannot be undone.'; + @override String get cancel => 'Cancel'; + @override String get confirm => 'Remove'; +} + +// Path: staff_profile_attire.info_card +class _TranslationsStaffProfileAttireInfoCardEs implements TranslationsStaffProfileAttireInfoCardEn { + _TranslationsStaffProfileAttireInfoCardEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Tu Vestuario'; + @override String get description => 'Selecciona los artΓ­culos de vestimenta que posees. Esto nos ayuda a asignarte turnos que se ajusten a tu vestuario.'; +} + +// Path: staff_profile_attire.status +class _TranslationsStaffProfileAttireStatusEs implements TranslationsStaffProfileAttireStatusEn { + _TranslationsStaffProfileAttireStatusEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get required => 'REQUERIDO'; + @override String get add_photo => 'AΓ±adir Foto'; + @override String get added => 'AΓ±adido'; + @override String get pending => '⏳ VerificaciΓ³n pendiente'; +} + +// Path: staff_profile_attire.actions +class _TranslationsStaffProfileAttireActionsEs implements TranslationsStaffProfileAttireActionsEn { + _TranslationsStaffProfileAttireActionsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get save => 'Guardar Vestimenta'; +} + +// Path: staff_profile_attire.validation +class _TranslationsStaffProfileAttireValidationEs implements TranslationsStaffProfileAttireValidationEn { + _TranslationsStaffProfileAttireValidationEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get select_required => 'βœ“ Seleccionar todos los artΓ­culos requeridos'; + @override String get upload_required => 'βœ“ Subir fotos de artΓ­culos requeridos'; + @override String get accept_attestation => 'βœ“ Aceptar certificaciΓ³n'; +} + +// Path: staff_shifts.tabs +class _TranslationsStaffShiftsTabsEs implements TranslationsStaffShiftsTabsEn { + _TranslationsStaffShiftsTabsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get my_shifts => 'My Shifts'; + @override String get find_work => 'Find Work'; +} + +// Path: staff_shifts.list +class _TranslationsStaffShiftsListEs implements TranslationsStaffShiftsListEn { + _TranslationsStaffShiftsListEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get no_shifts => 'No shifts found'; + @override String get pending_offers => 'PENDING OFFERS'; + @override String available_jobs({required Object count}) => '${count} AVAILABLE JOBS'; + @override String get search_hint => 'Search jobs...'; +} + +// Path: staff_shifts.filter +class _TranslationsStaffShiftsFilterEs implements TranslationsStaffShiftsFilterEn { + _TranslationsStaffShiftsFilterEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get all => 'All Jobs'; + @override String get one_day => 'One Day'; + @override String get multi_day => 'Multi Day'; + @override String get long_term => 'Long Term'; +} + +// Path: staff_shifts.status +class _TranslationsStaffShiftsStatusEs implements TranslationsStaffShiftsStatusEn { + _TranslationsStaffShiftsStatusEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get confirmed => 'CONFIRMED'; + @override String get act_now => 'ACT NOW'; + @override String get swap_requested => 'SWAP REQUESTED'; + @override String get completed => 'COMPLETED'; + @override String get no_show => 'NO SHOW'; + @override String get pending_warning => 'Please confirm assignment'; +} + +// Path: staff_shifts.action +class _TranslationsStaffShiftsActionEs implements TranslationsStaffShiftsActionEn { + _TranslationsStaffShiftsActionEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get decline => 'Decline'; + @override String get confirm => 'Confirm'; + @override String get request_swap => 'Request Swap'; +} + +// Path: staff_shifts.details +class _TranslationsStaffShiftsDetailsEs implements TranslationsStaffShiftsDetailsEn { + _TranslationsStaffShiftsDetailsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get additional => 'ADDITIONAL DETAILS'; + @override String days({required Object days}) => '${days} Days'; + @override String exp_total({required Object amount}) => '(exp.total \$${amount})'; + @override String pending_time({required Object time}) => 'Pending ${time} ago'; +} + +// Path: staff_shifts.tags +class _TranslationsStaffShiftsTagsEs implements TranslationsStaffShiftsTagsEn { + _TranslationsStaffShiftsTagsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get immediate_start => 'Immediate start'; + @override String get no_experience => 'No experience'; +} + +// Path: staff_authentication.profile_setup_page.steps +class _TranslationsStaffAuthenticationProfileSetupPageStepsEs implements TranslationsStaffAuthenticationProfileSetupPageStepsEn { + _TranslationsStaffAuthenticationProfileSetupPageStepsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get basic => 'InformaciΓ³n bΓ‘sica'; + @override String get location => 'UbicaciΓ³n'; + @override String get experience => 'Experiencia'; +} + +// Path: staff_authentication.profile_setup_page.basic_info +class _TranslationsStaffAuthenticationProfileSetupPageBasicInfoEs implements TranslationsStaffAuthenticationProfileSetupPageBasicInfoEn { + _TranslationsStaffAuthenticationProfileSetupPageBasicInfoEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'ConozcΓ‘monos'; + @override String get subtitle => 'CuΓ©ntanos un poco sobre ti'; + @override String get full_name_label => 'Nombre completo *'; + @override String get full_name_hint => 'Juan PΓ©rez'; + @override String get bio_label => 'BiografΓ­a corta'; + @override String get bio_hint => 'Profesional experimentado en hostelerΓ­a...'; +} + +// Path: staff_authentication.profile_setup_page.location +class _TranslationsStaffAuthenticationProfileSetupPageLocationEs implements TranslationsStaffAuthenticationProfileSetupPageLocationEn { + _TranslationsStaffAuthenticationProfileSetupPageLocationEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'ΒΏDΓ³nde quieres trabajar?'; + @override String get subtitle => 'Agrega tus ubicaciones de trabajo preferidas'; + @override String get full_name_label => 'Nombre completo'; + @override String get add_location_label => 'Agregar ubicaciΓ³n *'; + @override String get add_location_hint => 'Ciudad o cΓ³digo postal'; + @override String get add_button => 'Agregar'; + @override String max_distance({required Object distance}) => 'Distancia mΓ‘xima: ${distance} millas'; + @override String get min_dist_label => '5 mi'; + @override String get max_dist_label => '50 mi'; +} + +// Path: staff_authentication.profile_setup_page.experience +class _TranslationsStaffAuthenticationProfileSetupPageExperienceEs implements TranslationsStaffAuthenticationProfileSetupPageExperienceEn { + _TranslationsStaffAuthenticationProfileSetupPageExperienceEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'ΒΏCuΓ‘les son tus habilidades?'; + @override String get subtitle => 'Selecciona todas las que correspondan'; + @override String get skills_label => 'Habilidades *'; + @override String get industries_label => 'Industrias preferidas'; + @override late final _TranslationsStaffAuthenticationProfileSetupPageExperienceSkillsEs skills = _TranslationsStaffAuthenticationProfileSetupPageExperienceSkillsEs._(_root); + @override late final _TranslationsStaffAuthenticationProfileSetupPageExperienceIndustriesEs industries = _TranslationsStaffAuthenticationProfileSetupPageExperienceIndustriesEs._(_root); +} + +// Path: staff.main.tabs +class _TranslationsStaffMainTabsEs implements TranslationsStaffMainTabsEn { + _TranslationsStaffMainTabsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get shifts => 'Turnos'; + @override String get payments => 'Pagos'; + @override String get home => 'Inicio'; + @override String get clock_in => 'Marcar Entrada'; + @override String get profile => 'Perfil'; +} + +// Path: staff.home.header +class _TranslationsStaffHomeHeaderEs implements TranslationsStaffHomeHeaderEn { + _TranslationsStaffHomeHeaderEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get welcome_back => 'Welcome back'; + @override String get user_name_placeholder => 'Krower'; +} + +// Path: staff.home.banners +class _TranslationsStaffHomeBannersEs implements TranslationsStaffHomeBannersEn { + _TranslationsStaffHomeBannersEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get complete_profile_title => 'Complete Your Profile'; + @override String get complete_profile_subtitle => 'Get verified to see more shifts'; + @override String get availability_title => 'Availability'; + @override String get availability_subtitle => 'Update your availability for next week'; +} + +// Path: staff.home.quick_actions +class _TranslationsStaffHomeQuickActionsEs implements TranslationsStaffHomeQuickActionsEn { + _TranslationsStaffHomeQuickActionsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get find_shifts => 'Find Shifts'; + @override String get availability => 'Availability'; + @override String get messages => 'Messages'; + @override String get earnings => 'Earnings'; +} + +// Path: staff.home.sections +class _TranslationsStaffHomeSectionsEs implements TranslationsStaffHomeSectionsEn { + _TranslationsStaffHomeSectionsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get todays_shift => 'Today\'s Shift'; + @override String scheduled_count({required Object count}) => '${count} scheduled'; + @override String get tomorrow => 'Tomorrow'; + @override String get recommended_for_you => 'Recommended for You'; + @override String get view_all => 'View all'; +} + +// Path: staff.home.empty_states +class _TranslationsStaffHomeEmptyStatesEs implements TranslationsStaffHomeEmptyStatesEn { + _TranslationsStaffHomeEmptyStatesEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get no_shifts_today => 'No shifts scheduled for today'; + @override String get find_shifts_cta => 'Find shifts β†’'; + @override String get no_shifts_tomorrow => 'No shifts for tomorrow'; + @override String get no_recommended_shifts => 'No recommended shifts'; +} + +// Path: staff.home.pending_payment +class _TranslationsStaffHomePendingPaymentEs implements TranslationsStaffHomePendingPaymentEn { + _TranslationsStaffHomePendingPaymentEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Pending Payment'; + @override String get subtitle => 'Payment processing'; + @override String amount({required Object amount}) => '${amount}'; +} + +// Path: staff.home.recommended_card +class _TranslationsStaffHomeRecommendedCardEs implements TranslationsStaffHomeRecommendedCardEn { + _TranslationsStaffHomeRecommendedCardEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get act_now => 'β€’ ACT NOW'; + @override String get one_day => 'One Day'; + @override String get today => 'Today'; + @override String applied_for({required Object title}) => 'Applied for ${title}'; + @override String time_range({required Object start, required Object end}) => '${start} - ${end}'; +} + +// Path: staff.home.benefits +class _TranslationsStaffHomeBenefitsEs implements TranslationsStaffHomeBenefitsEn { + _TranslationsStaffHomeBenefitsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Your Benefits'; + @override String get view_all => 'View all'; + @override String get hours_label => 'hours'; + @override late final _TranslationsStaffHomeBenefitsItemsEs items = _TranslationsStaffHomeBenefitsItemsEs._(_root); +} + +// Path: staff.home.auto_match +class _TranslationsStaffHomeAutoMatchEs implements TranslationsStaffHomeAutoMatchEn { + _TranslationsStaffHomeAutoMatchEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Auto-Match'; + @override String get finding_shifts => 'Finding shifts for you'; + @override String get get_matched => 'Get matched automatically'; + @override String get matching_based_on => 'Matching based on:'; + @override late final _TranslationsStaffHomeAutoMatchChipsEs chips = _TranslationsStaffHomeAutoMatchChipsEs._(_root); +} + +// Path: staff.home.improve +class _TranslationsStaffHomeImproveEs implements TranslationsStaffHomeImproveEn { + _TranslationsStaffHomeImproveEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Improve Yourself'; + @override late final _TranslationsStaffHomeImproveItemsEs items = _TranslationsStaffHomeImproveItemsEs._(_root); +} + +// Path: staff.home.more_ways +class _TranslationsStaffHomeMoreWaysEs implements TranslationsStaffHomeMoreWaysEn { + _TranslationsStaffHomeMoreWaysEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'More Ways To Use Krow'; + @override late final _TranslationsStaffHomeMoreWaysItemsEs items = _TranslationsStaffHomeMoreWaysItemsEs._(_root); +} + +// Path: staff.profile.header +class _TranslationsStaffProfileHeaderEs implements TranslationsStaffProfileHeaderEn { + _TranslationsStaffProfileHeaderEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Perfil'; + @override String get sign_out => 'CERRAR SESIΓ“N'; +} + +// Path: staff.profile.reliability_stats +class _TranslationsStaffProfileReliabilityStatsEs implements TranslationsStaffProfileReliabilityStatsEn { + _TranslationsStaffProfileReliabilityStatsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get shifts => 'Turnos'; + @override String get rating => 'CalificaciΓ³n'; + @override String get on_time => 'A Tiempo'; + @override String get no_shows => 'Faltas'; + @override String get cancellations => 'Cancel.'; +} + +// Path: staff.profile.reliability_score +class _TranslationsStaffProfileReliabilityScoreEs implements TranslationsStaffProfileReliabilityScoreEn { + _TranslationsStaffProfileReliabilityScoreEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'PuntuaciΓ³n de Confiabilidad'; + @override String get description => 'MantΓ©n tu puntuaciΓ³n por encima del 45% para continuar aceptando turnos.'; +} + +// Path: staff.profile.sections +class _TranslationsStaffProfileSectionsEs implements TranslationsStaffProfileSectionsEn { + _TranslationsStaffProfileSectionsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get onboarding => 'INCORPORACIΓ“N'; + @override String get compliance => 'CUMPLIMIENTO'; + @override String get level_up => 'MEJORAR NIVEL'; + @override String get finance => 'FINANZAS'; + @override String get support => 'SOPORTE'; +} + +// Path: staff.profile.menu_items +class _TranslationsStaffProfileMenuItemsEs implements TranslationsStaffProfileMenuItemsEn { + _TranslationsStaffProfileMenuItemsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get personal_info => 'InformaciΓ³n Personal'; + @override String get emergency_contact => 'Contacto de Emergencia'; + @override String get experience => 'Experiencia'; + @override String get attire => 'Vestimenta'; + @override String get documents => 'Documentos'; + @override String get certificates => 'Certificados'; + @override String get tax_forms => 'Formularios Fiscales'; + @override String get krow_university => 'Krow University'; + @override String get trainings => 'Capacitaciones'; + @override String get leaderboard => 'Tabla de ClasificaciΓ³n'; + @override String get bank_account => 'Cuenta Bancaria'; + @override String get payments => 'Pagos'; + @override String get timecard => 'Tarjeta de Tiempo'; + @override String get faqs => 'Preguntas Frecuentes'; + @override String get privacy_security => 'Privacidad y Seguridad'; + @override String get messages => 'Mensajes'; +} + +// Path: staff.profile.bank_account_page +class _TranslationsStaffProfileBankAccountPageEs implements TranslationsStaffProfileBankAccountPageEn { + _TranslationsStaffProfileBankAccountPageEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Cuenta Bancaria'; + @override String get linked_accounts => 'Cuentas Vinculadas'; + @override String get add_account => 'Agregar Cuenta Bancaria'; + @override String get secure_title => 'Seguro y Cifrado'; + @override String get secure_subtitle => 'Su informaciΓ³n bancaria estΓ‘ cifrada y almacenada de forma segura. Nunca compartimos sus detalles.'; + @override String get add_new_account => 'Agregar Nueva Cuenta'; + @override String get routing_number => 'NΓΊmero de Ruta'; + @override String get routing_hint => '9 dΓ­gitos'; + @override String get account_number => 'NΓΊmero de Cuenta'; + @override String get account_hint => 'Ingrese nΓΊmero de cuenta'; + @override String get account_type => 'Tipo de Cuenta'; + @override String get checking => 'CORRIENTE'; + @override String get savings => 'AHORROS'; + @override String get cancel => 'Cancelar'; + @override String get save => 'Guardar'; + @override String get primary => 'Principal'; + @override String account_ending({required Object last4}) => 'Termina en ${last4}'; +} + +// Path: staff.profile.logout +class _TranslationsStaffProfileLogoutEs implements TranslationsStaffProfileLogoutEn { + _TranslationsStaffProfileLogoutEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get button => 'Cerrar SesiΓ³n'; +} + +// Path: staff.onboarding.personal_info +class _TranslationsStaffOnboardingPersonalInfoEs implements TranslationsStaffOnboardingPersonalInfoEn { + _TranslationsStaffOnboardingPersonalInfoEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'InformaciΓ³n Personal'; + @override String get change_photo_hint => 'Toca para cambiar foto'; + @override String get full_name_label => 'Nombre Completo'; + @override String get email_label => 'Correo ElectrΓ³nico'; + @override String get phone_label => 'NΓΊmero de TelΓ©fono'; + @override String get phone_hint => '+1 (555) 000-0000'; + @override String get bio_label => 'BiografΓ­a'; + @override String get bio_hint => 'CuΓ©ntales a los clientes sobre ti...'; + @override String get languages_label => 'Idiomas'; + @override String get languages_hint => 'InglΓ©s, EspaΓ±ol, FrancΓ©s...'; + @override String get locations_label => 'Ubicaciones Preferidas'; + @override String get locations_hint => 'Centro, Midtown, Brooklyn...'; + @override String get save_button => 'Guardar Cambios'; + @override String get save_success => 'InformaciΓ³n personal guardada exitosamente'; +} + +// Path: staff.onboarding.experience +class _TranslationsStaffOnboardingExperienceEs implements TranslationsStaffOnboardingExperienceEn { + _TranslationsStaffOnboardingExperienceEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Experience & Skills'; + @override String get industries_title => 'Industries'; + @override String get industries_subtitle => 'Select the industries you have experience in'; + @override String get skills_title => 'Skills'; + @override String get skills_subtitle => 'Select your skills or add custom ones'; + @override String get custom_skills_title => 'Custom Skills:'; + @override String get custom_skill_hint => 'Add custom skill...'; + @override String get save_button => 'Save & Continue'; + @override late final _TranslationsStaffOnboardingExperienceIndustriesEs industries = _TranslationsStaffOnboardingExperienceIndustriesEs._(_root); + @override late final _TranslationsStaffOnboardingExperienceSkillsEs skills = _TranslationsStaffOnboardingExperienceSkillsEs._(_root); +} + +// Path: staff_authentication.profile_setup_page.experience.skills +class _TranslationsStaffAuthenticationProfileSetupPageExperienceSkillsEs implements TranslationsStaffAuthenticationProfileSetupPageExperienceSkillsEn { + _TranslationsStaffAuthenticationProfileSetupPageExperienceSkillsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get food_service => 'Servicio de comida'; + @override String get bartending => 'PreparaciΓ³n de bebidas'; + @override String get warehouse => 'AlmacΓ©n'; + @override String get retail => 'Venta minorista'; + @override String get events => 'Eventos'; + @override String get customer_service => 'Servicio al cliente'; + @override String get cleaning => 'Limpieza'; + @override String get security => 'Seguridad'; + @override String get driving => 'ConducciΓ³n'; + @override String get cooking => 'Cocina'; +} + +// Path: staff_authentication.profile_setup_page.experience.industries +class _TranslationsStaffAuthenticationProfileSetupPageExperienceIndustriesEs implements TranslationsStaffAuthenticationProfileSetupPageExperienceIndustriesEn { + _TranslationsStaffAuthenticationProfileSetupPageExperienceIndustriesEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get hospitality => 'HostelerΓ­a'; + @override String get food_service => 'Servicio de comida'; + @override String get warehouse => 'AlmacΓ©n'; + @override String get events => 'Eventos'; + @override String get retail => 'Venta minorista'; + @override String get healthcare => 'AtenciΓ³n mΓ©dica'; +} + +// Path: staff.home.benefits.items +class _TranslationsStaffHomeBenefitsItemsEs implements TranslationsStaffHomeBenefitsItemsEn { + _TranslationsStaffHomeBenefitsItemsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get sick_days => 'Sick Days'; + @override String get vacation => 'Vacation'; + @override String get holidays => 'Holidays'; +} + +// Path: staff.home.auto_match.chips +class _TranslationsStaffHomeAutoMatchChipsEs implements TranslationsStaffHomeAutoMatchChipsEn { + _TranslationsStaffHomeAutoMatchChipsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get location => 'Location'; + @override String get availability => 'Availability'; + @override String get skills => 'Skills'; +} + +// Path: staff.home.improve.items +class _TranslationsStaffHomeImproveItemsEs implements TranslationsStaffHomeImproveItemsEn { + _TranslationsStaffHomeImproveItemsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override late final _TranslationsStaffHomeImproveItemsTrainingEs training = _TranslationsStaffHomeImproveItemsTrainingEs._(_root); + @override late final _TranslationsStaffHomeImproveItemsPodcastEs podcast = _TranslationsStaffHomeImproveItemsPodcastEs._(_root); +} + +// Path: staff.home.more_ways.items +class _TranslationsStaffHomeMoreWaysItemsEs implements TranslationsStaffHomeMoreWaysItemsEn { + _TranslationsStaffHomeMoreWaysItemsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override late final _TranslationsStaffHomeMoreWaysItemsBenefitsEs benefits = _TranslationsStaffHomeMoreWaysItemsBenefitsEs._(_root); + @override late final _TranslationsStaffHomeMoreWaysItemsReferEs refer = _TranslationsStaffHomeMoreWaysItemsReferEs._(_root); +} + +// Path: staff.onboarding.experience.industries +class _TranslationsStaffOnboardingExperienceIndustriesEs implements TranslationsStaffOnboardingExperienceIndustriesEn { + _TranslationsStaffOnboardingExperienceIndustriesEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get hospitality => 'Hospitality'; + @override String get food_service => 'Food Service'; + @override String get warehouse => 'Warehouse'; + @override String get events => 'Events'; + @override String get retail => 'Retail'; + @override String get healthcare => 'Healthcare'; + @override String get other => 'Other'; +} + +// Path: staff.onboarding.experience.skills +class _TranslationsStaffOnboardingExperienceSkillsEs implements TranslationsStaffOnboardingExperienceSkillsEn { + _TranslationsStaffOnboardingExperienceSkillsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get food_service => 'Food Service'; + @override String get bartending => 'Bartending'; + @override String get event_setup => 'Event Setup'; + @override String get hospitality => 'Hospitality'; + @override String get warehouse => 'Warehouse'; + @override String get customer_service => 'Customer Service'; + @override String get cleaning => 'Cleaning'; + @override String get security => 'Security'; + @override String get retail => 'Retail'; + @override String get cooking => 'Cooking'; + @override String get cashier => 'Cashier'; + @override String get server => 'Server'; + @override String get barista => 'Barista'; + @override String get host_hostess => 'Host/Hostess'; + @override String get busser => 'Busser'; +} + +// Path: staff.home.improve.items.training +class _TranslationsStaffHomeImproveItemsTrainingEs implements TranslationsStaffHomeImproveItemsTrainingEn { + _TranslationsStaffHomeImproveItemsTrainingEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Training Section'; + @override String get description => 'Improve your skills and get certified.'; + @override String get page => '/krow-university'; +} + +// Path: staff.home.improve.items.podcast +class _TranslationsStaffHomeImproveItemsPodcastEs implements TranslationsStaffHomeImproveItemsPodcastEn { + _TranslationsStaffHomeImproveItemsPodcastEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Krow Podcast'; + @override String get description => 'Listen to tips from top workers.'; + @override String get page => '/krow-university'; +} + +// Path: staff.home.more_ways.items.benefits +class _TranslationsStaffHomeMoreWaysItemsBenefitsEs implements TranslationsStaffHomeMoreWaysItemsBenefitsEn { + _TranslationsStaffHomeMoreWaysItemsBenefitsEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Krow Benefits'; + @override String get page => '/benefits'; +} + +// Path: staff.home.more_ways.items.refer +class _TranslationsStaffHomeMoreWaysItemsReferEs implements TranslationsStaffHomeMoreWaysItemsReferEn { + _TranslationsStaffHomeMoreWaysItemsReferEs._(this._root); + + final TranslationsEs _root; // ignore: unused_field + + // Translations + @override String get title => 'Refer a Friend'; + @override String get page => '/worker-profile'; +} + +/// The flat map containing all translations for locale . +/// Only for edge cases! For simple maps, use the map function of this library. +/// +/// The Dart AOT compiler has issues with very large switch statements, +/// so the map is split into smaller functions (512 entries each). +extension on TranslationsEs { + dynamic _flatMapFunction(String path) { + return switch (path) { + 'common.ok' => 'Aceptar', + 'common.cancel' => 'Cancelar', + 'common.save' => 'Guardar', + 'common.delete' => 'Eliminar', + 'common.continue_text' => 'Continuar', + 'settings.language' => 'Idioma', + 'settings.change_language' => 'Cambiar Idioma', + 'staff_authentication.get_started_page.title_part1' => 'Trabaja, Crece, ', + 'staff_authentication.get_started_page.title_part2' => 'ElΓ©vate', + 'staff_authentication.get_started_page.subtitle' => 'Construye tu carrera en hostelerΓ­a con \nflexibilidad y libertad.', + 'staff_authentication.get_started_page.sign_up_button' => 'Registrarse', + 'staff_authentication.get_started_page.log_in_button' => 'Iniciar sesiΓ³n', + 'staff_authentication.phone_verification_page.validation_error' => 'Por favor, ingresa un nΓΊmero de telΓ©fono vΓ‘lido de 10 dΓ­gitos', + 'staff_authentication.phone_verification_page.send_code_button' => 'Enviar cΓ³digo', + 'staff_authentication.phone_verification_page.enter_code_title' => 'Ingresa el cΓ³digo de verificaciΓ³n', + 'staff_authentication.phone_verification_page.code_sent_message' => 'Enviamos un cΓ³digo de 6 dΓ­gitos a ', + 'staff_authentication.phone_verification_page.code_sent_instruction' => '. IngrΓ©salo a continuaciΓ³n para verificar tu cuenta.', + 'staff_authentication.phone_input.title' => 'Verifica tu nΓΊmero de telΓ©fono', + 'staff_authentication.phone_input.subtitle' => 'Te enviaremos un cΓ³digo de verificaciΓ³n para comenzar.', + 'staff_authentication.phone_input.label' => 'NΓΊmero de telΓ©fono', + 'staff_authentication.phone_input.hint' => 'Ingresa tu nΓΊmero', + 'staff_authentication.otp_verification.did_not_get_code' => 'ΒΏNo recibiste el cΓ³digo?', + 'staff_authentication.otp_verification.resend_in' => ({required Object seconds}) => 'Reenviar en ${seconds} s', + 'staff_authentication.otp_verification.resend_code' => 'Reenviar cΓ³digo', + 'staff_authentication.profile_setup_page.step_indicator' => ({required Object current, required Object total}) => 'Paso ${current} de ${total}', + 'staff_authentication.profile_setup_page.error_occurred' => 'OcurriΓ³ un error', + 'staff_authentication.profile_setup_page.complete_setup_button' => 'Completar configuraciΓ³n', + 'staff_authentication.profile_setup_page.steps.basic' => 'InformaciΓ³n bΓ‘sica', + 'staff_authentication.profile_setup_page.steps.location' => 'UbicaciΓ³n', + 'staff_authentication.profile_setup_page.steps.experience' => 'Experiencia', + 'staff_authentication.profile_setup_page.basic_info.title' => 'ConozcΓ‘monos', + 'staff_authentication.profile_setup_page.basic_info.subtitle' => 'CuΓ©ntanos un poco sobre ti', + 'staff_authentication.profile_setup_page.basic_info.full_name_label' => 'Nombre completo *', + 'staff_authentication.profile_setup_page.basic_info.full_name_hint' => 'Juan PΓ©rez', + 'staff_authentication.profile_setup_page.basic_info.bio_label' => 'BiografΓ­a corta', + 'staff_authentication.profile_setup_page.basic_info.bio_hint' => 'Profesional experimentado en hostelerΓ­a...', + 'staff_authentication.profile_setup_page.location.title' => 'ΒΏDΓ³nde quieres trabajar?', + 'staff_authentication.profile_setup_page.location.subtitle' => 'Agrega tus ubicaciones de trabajo preferidas', + 'staff_authentication.profile_setup_page.location.full_name_label' => 'Nombre completo', + 'staff_authentication.profile_setup_page.location.add_location_label' => 'Agregar ubicaciΓ³n *', + 'staff_authentication.profile_setup_page.location.add_location_hint' => 'Ciudad o cΓ³digo postal', + 'staff_authentication.profile_setup_page.location.add_button' => 'Agregar', + 'staff_authentication.profile_setup_page.location.max_distance' => ({required Object distance}) => 'Distancia mΓ‘xima: ${distance} millas', + 'staff_authentication.profile_setup_page.location.min_dist_label' => '5 mi', + 'staff_authentication.profile_setup_page.location.max_dist_label' => '50 mi', + 'staff_authentication.profile_setup_page.experience.title' => 'ΒΏCuΓ‘les son tus habilidades?', + 'staff_authentication.profile_setup_page.experience.subtitle' => 'Selecciona todas las que correspondan', + 'staff_authentication.profile_setup_page.experience.skills_label' => 'Habilidades *', + 'staff_authentication.profile_setup_page.experience.industries_label' => 'Industrias preferidas', + 'staff_authentication.profile_setup_page.experience.skills.food_service' => 'Servicio de comida', + 'staff_authentication.profile_setup_page.experience.skills.bartending' => 'PreparaciΓ³n de bebidas', + 'staff_authentication.profile_setup_page.experience.skills.warehouse' => 'AlmacΓ©n', + 'staff_authentication.profile_setup_page.experience.skills.retail' => 'Venta minorista', + 'staff_authentication.profile_setup_page.experience.skills.events' => 'Eventos', + 'staff_authentication.profile_setup_page.experience.skills.customer_service' => 'Servicio al cliente', + 'staff_authentication.profile_setup_page.experience.skills.cleaning' => 'Limpieza', + 'staff_authentication.profile_setup_page.experience.skills.security' => 'Seguridad', + 'staff_authentication.profile_setup_page.experience.skills.driving' => 'ConducciΓ³n', + 'staff_authentication.profile_setup_page.experience.skills.cooking' => 'Cocina', + 'staff_authentication.profile_setup_page.experience.industries.hospitality' => 'HostelerΓ­a', + 'staff_authentication.profile_setup_page.experience.industries.food_service' => 'Servicio de comida', + 'staff_authentication.profile_setup_page.experience.industries.warehouse' => 'AlmacΓ©n', + 'staff_authentication.profile_setup_page.experience.industries.events' => 'Eventos', + 'staff_authentication.profile_setup_page.experience.industries.retail' => 'Venta minorista', + 'staff_authentication.profile_setup_page.experience.industries.healthcare' => 'AtenciΓ³n mΓ©dica', + 'staff_authentication.common.trouble_question' => 'ΒΏTienes problemas? ', + 'staff_authentication.common.contact_support' => 'Contactar a soporte', + 'client_authentication.get_started_page.title' => 'Toma el control de tus\nturnos y eventos', + 'client_authentication.get_started_page.subtitle' => 'Optimiza tus operaciones con potentes herramientas para gestionar horarios, realizar un seguimiento del rendimiento y mantener a tu equipo en la misma pΓ‘gina, todo en un solo lugar', + 'client_authentication.get_started_page.sign_in_button' => 'Iniciar sesiΓ³n', + 'client_authentication.get_started_page.create_account_button' => 'Crear cuenta', + 'client_authentication.sign_in_page.title' => 'Bienvenido de nuevo', + 'client_authentication.sign_in_page.subtitle' => 'Inicia sesiΓ³n para gestionar tus turnos y trabajadores', + 'client_authentication.sign_in_page.email_label' => 'Correo electrΓ³nico', + 'client_authentication.sign_in_page.email_hint' => 'Ingresa tu correo electrΓ³nico', + 'client_authentication.sign_in_page.password_label' => 'ContraseΓ±a', + 'client_authentication.sign_in_page.password_hint' => 'Ingresa tu contraseΓ±a', + 'client_authentication.sign_in_page.forgot_password' => 'ΒΏOlvidaste tu contraseΓ±a?', + 'client_authentication.sign_in_page.sign_in_button' => 'Iniciar sesiΓ³n', + 'client_authentication.sign_in_page.or_divider' => 'o', + 'client_authentication.sign_in_page.social_apple' => 'Iniciar sesiΓ³n con Apple', + 'client_authentication.sign_in_page.social_google' => 'Iniciar sesiΓ³n con Google', + 'client_authentication.sign_in_page.no_account' => 'ΒΏNo tienes una cuenta? ', + 'client_authentication.sign_in_page.sign_up_link' => 'RegΓ­strate', + 'client_authentication.sign_up_page.title' => 'Crear cuenta', + 'client_authentication.sign_up_page.subtitle' => 'Comienza con Krow para tu negocio', + 'client_authentication.sign_up_page.company_label' => 'Nombre de la empresa', + 'client_authentication.sign_up_page.company_hint' => 'Ingresa el nombre de la empresa', + 'client_authentication.sign_up_page.email_label' => 'Correo electrΓ³nico', + 'client_authentication.sign_up_page.email_hint' => 'Ingresa tu correo electrΓ³nico', + 'client_authentication.sign_up_page.password_label' => 'ContraseΓ±a', + 'client_authentication.sign_up_page.password_hint' => 'Crea una contraseΓ±a', + 'client_authentication.sign_up_page.confirm_password_label' => 'Confirmar contraseΓ±a', + 'client_authentication.sign_up_page.confirm_password_hint' => 'Confirma tu contraseΓ±a', + 'client_authentication.sign_up_page.create_account_button' => 'Crear cuenta', + 'client_authentication.sign_up_page.or_divider' => 'o', + 'client_authentication.sign_up_page.social_apple' => 'RegΓ­strate con Apple', + 'client_authentication.sign_up_page.social_google' => 'RegΓ­strate con Google', + 'client_authentication.sign_up_page.has_account' => 'ΒΏYa tienes una cuenta? ', + 'client_authentication.sign_up_page.sign_in_link' => 'Iniciar sesiΓ³n', + 'client_home.dashboard.welcome_back' => 'Bienvenido de nuevo', + 'client_home.dashboard.edit_mode_active' => 'Modo EdiciΓ³n Activo', + 'client_home.dashboard.drag_instruction' => 'Arrastra para reordenar, cambia la visibilidad', + 'client_home.dashboard.reset' => 'Restablecer', + 'client_home.dashboard.metric_needed' => 'Necesario', + 'client_home.dashboard.metric_filled' => 'Lleno', + 'client_home.dashboard.metric_open' => 'Abierto', + 'client_home.dashboard.view_all' => 'Ver todo', + 'client_home.dashboard.insight_lightbulb' => ({required Object amount}) => 'Ahorra ${amount}/mes', + 'client_home.dashboard.insight_tip' => 'Reserva con 48h de antelaciΓ³n para mejores tarifas', + 'client_home.widgets.actions' => 'Acciones RΓ‘pidas', + 'client_home.widgets.reorder' => 'Reordenar', + 'client_home.widgets.coverage' => 'Cobertura de Hoy', + 'client_home.widgets.spending' => 'InformaciΓ³n de Gastos', + 'client_home.widgets.live_activity' => 'Actividad en Vivo', + 'client_home.actions.rapid' => 'RÁPIDO', + 'client_home.actions.rapid_subtitle' => 'Urgente mismo dΓ­a', + 'client_home.actions.create_order' => 'Crear Orden', + 'client_home.actions.create_order_subtitle' => 'Programar turnos', + 'client_home.actions.hubs' => 'Hubs', + 'client_home.actions.hubs_subtitle' => 'Puntos marcaje', + 'client_home.reorder.title' => 'REORDENAR', + 'client_home.reorder.reorder_button' => 'Reordenar', + 'client_home.reorder.per_hr' => ({required Object amount}) => '${amount}/hr', + 'client_home.form.edit_reorder' => 'Editar y Reordenar', + 'client_home.form.post_new' => 'Publicar un Nuevo Turno', + 'client_home.form.review_subtitle' => 'Revisa y edita los detalles antes de publicar', + 'client_home.form.date_label' => 'Fecha *', + 'client_home.form.date_hint' => 'mm/dd/aaaa', + 'client_home.form.location_label' => 'UbicaciΓ³n *', + 'client_home.form.location_hint' => 'DirecciΓ³n del negocio', + 'client_home.form.positions_title' => 'Posiciones', + 'client_home.form.add_position' => 'AΓ±adir PosiciΓ³n', + 'client_home.form.role_label' => 'Rol *', + 'client_home.form.role_hint' => 'Seleccionar rol', + 'client_home.form.start_time' => 'Hora de Inicio *', + 'client_home.form.end_time' => 'Hora de Fin *', + 'client_home.form.workers_needed' => 'Trabajadores Necesarios *', + 'client_home.form.hourly_rate' => 'Tarifa por hora (\$) *', + 'client_home.form.post_shift' => 'Publicar Turno', + 'client_settings.profile.title' => 'Perfil', + 'client_settings.profile.edit_profile' => 'Editar Perfil', + 'client_settings.profile.hubs' => 'Hubs', + 'client_settings.profile.log_out' => 'Cerrar sesiΓ³n', + 'client_settings.profile.quick_links' => 'Enlaces rΓ‘pidos', + 'client_settings.profile.clock_in_hubs' => 'Hubs de Marcaje', + 'client_settings.profile.billing_payments' => 'FacturaciΓ³n y Pagos', + 'client_hubs.title' => 'Hubs', + 'client_hubs.subtitle' => 'Gestionar ubicaciones de marcaje', + 'client_hubs.add_hub' => 'AΓ±adir Hub', + 'client_hubs.empty_state.title' => 'No hay hubs aΓΊn', + 'client_hubs.empty_state.description' => 'Crea estaciones de marcaje para tus ubicaciones', + 'client_hubs.empty_state.button' => 'AΓ±ade tu primer Hub', + 'client_hubs.about_hubs.title' => 'Sobre los Hubs', + 'client_hubs.about_hubs.description' => 'Los Hubs son estaciones de marcaje en tus ubicaciones. Asigna etiquetas NFC a cada hub para que los trabajadores puedan marcar entrada/salida rΓ‘pidamente usando sus telΓ©fonos.', + 'client_hubs.hub_card.tag_label' => ({required Object id}) => 'Etiqueta: ${id}', + 'client_hubs.add_hub_dialog.title' => 'AΓ±adir Nuevo Hub', + 'client_hubs.add_hub_dialog.name_label' => 'Nombre del Hub *', + 'client_hubs.add_hub_dialog.name_hint' => 'ej., Cocina Principal, RecepciΓ³n', + 'client_hubs.add_hub_dialog.location_label' => 'Nombre de la UbicaciΓ³n', + 'client_hubs.add_hub_dialog.location_hint' => 'ej., Restaurante Centro', + 'client_hubs.add_hub_dialog.address_label' => 'DirecciΓ³n', + 'client_hubs.add_hub_dialog.address_hint' => 'DirecciΓ³n completa', + 'client_hubs.add_hub_dialog.create_button' => 'Crear Hub', + 'client_hubs.nfc_dialog.title' => 'Identificar Etiqueta NFC', + 'client_hubs.nfc_dialog.instruction' => 'Acerque su telΓ©fono a la etiqueta NFC para identificarla', + 'client_hubs.nfc_dialog.scan_button' => 'Escanear Etiqueta NFC', + 'client_hubs.nfc_dialog.tag_identified' => 'Etiqueta Identificada', + 'client_hubs.nfc_dialog.assign_button' => 'Asignar Etiqueta', + 'client_create_order.title' => 'Crear Orden', + 'client_create_order.section_title' => 'TIPO DE ORDEN', + 'client_create_order.types.rapid' => 'RÁPIDO', + 'client_create_order.types.rapid_desc' => 'Cobertura URGENTE mismo dΓ­a', + 'client_create_order.types.one_time' => 'Única Vez', + 'client_create_order.types.one_time_desc' => 'Evento Único o PeticiΓ³n de Turno', + 'client_create_order.types.recurring' => 'Recurrente', + 'client_create_order.types.recurring_desc' => 'Cobertura Continua Semanal / Mensual', + 'client_create_order.types.permanent' => 'Permanente', + 'client_create_order.types.permanent_desc' => 'ColocaciΓ³n de Personal a Largo Plazo', + 'client_create_order.rapid.title' => 'Orden RÁPIDA', + 'client_create_order.rapid.subtitle' => 'Personal de emergencia en minutos', + 'client_create_order.rapid.urgent_badge' => 'URGENTE', + 'client_create_order.rapid.tell_us' => 'Dinos quΓ© necesitas', + 'client_create_order.rapid.need_staff' => 'ΒΏNecesitas personal urgentemente?', + 'client_create_order.rapid.type_or_speak' => 'Escribe o habla lo que necesitas. Yo me encargo del resto', + 'client_create_order.rapid.example' => 'Ejemplo: ', + 'client_create_order.rapid.hint' => 'Escribe o habla... (ej., "Necesito 5 cocineros YA hasta las 5am")', + 'client_create_order.rapid.speak' => 'Hablar', + 'client_create_order.rapid.listening' => 'Escuchando...', + 'client_create_order.rapid.send' => 'Enviar Mensaje', + 'client_create_order.rapid.sending' => 'Enviando...', + 'client_create_order.rapid.success_title' => 'Β‘Solicitud Enviada!', + 'client_create_order.rapid.success_message' => 'Estamos encontrando trabajadores disponibles para ti ahora mismo. Te notificaremos cuando acepten.', + 'client_create_order.rapid.back_to_orders' => 'Volver a Γ“rdenes', + 'client_create_order.one_time.title' => 'Orden Única Vez', + 'client_create_order.one_time.subtitle' => 'Evento ΓΊnico o peticiΓ³n de turno', + 'client_create_order.one_time.create_your_order' => 'Crea Tu Orden', + 'client_create_order.one_time.date_label' => 'Fecha', + 'client_create_order.one_time.date_hint' => 'Seleccionar fecha', + 'client_create_order.one_time.location_label' => 'UbicaciΓ³n', + 'client_create_order.one_time.location_hint' => 'Ingresar direcciΓ³n', + 'client_create_order.one_time.positions_title' => 'Posiciones', + 'client_create_order.one_time.add_position' => 'AΓ±adir PosiciΓ³n', + 'client_create_order.one_time.position_number' => ({required Object number}) => 'PosiciΓ³n ${number}', + 'client_create_order.one_time.remove' => 'Eliminar', + 'client_create_order.one_time.select_role' => 'Seleccionar rol', + 'client_create_order.one_time.start_label' => 'Inicio', + 'client_create_order.one_time.end_label' => 'Fin', + 'client_create_order.one_time.workers_label' => 'Trabajadores', + 'client_create_order.one_time.lunch_break_label' => 'Descanso para Almuerzo', + 'client_create_order.one_time.different_location' => 'Usar ubicaciΓ³n diferente para esta posiciΓ³n', + 'client_create_order.one_time.different_location_title' => 'UbicaciΓ³n Diferente', + 'client_create_order.one_time.different_location_hint' => 'Ingresar direcciΓ³n diferente', + 'client_create_order.one_time.create_order' => 'Crear Orden', + 'client_create_order.one_time.creating' => 'Creando...', + 'client_create_order.one_time.success_title' => 'Β‘Orden Creada!', + 'client_create_order.one_time.success_message' => 'Tu solicitud de turno ha sido publicada. Los trabajadores comenzarΓ‘n a postularse pronto.', + 'client_create_order.one_time.back_to_orders' => 'Volver a Γ“rdenes', + 'client_create_order.one_time.no_break' => 'Sin descanso', + 'client_create_order.one_time.paid_break' => 'min (Pagado)', + 'client_create_order.one_time.unpaid_break' => 'min (No pagado)', + 'client_create_order.recurring.title' => 'Orden Recurrente', + 'client_create_order.recurring.subtitle' => 'Cobertura continua semanal/mensual', + 'client_create_order.recurring.placeholder' => 'Flujo de Orden Recurrente (Trabajo en Progreso)', + 'client_create_order.permanent.title' => 'Orden Permanente', + 'client_create_order.permanent.subtitle' => 'ColocaciΓ³n de personal a largo plazo', + 'client_create_order.permanent.placeholder' => 'Flujo de Orden Permanente (Trabajo en Progreso)', + 'client_main.tabs.coverage' => 'Cobertura', + 'client_main.tabs.billing' => 'FacturaciΓ³n', + 'client_main.tabs.home' => 'Inicio', + 'client_main.tabs.orders' => 'Γ“rdenes', + 'client_main.tabs.reports' => 'Reportes', + 'client_view_orders.title' => 'Γ“rdenes', + 'client_view_orders.post_button' => 'Publicar', + 'client_view_orders.post_order' => 'Publicar una Orden', + 'client_view_orders.no_orders' => ({required Object date}) => 'No hay Γ³rdenes para ${date}', + 'client_view_orders.tabs.up_next' => 'PrΓ³ximos', + 'client_view_orders.tabs.active' => 'Activos', + 'client_view_orders.tabs.completed' => 'Completados', + 'client_view_orders.card.open' => 'ABIERTO', + 'client_view_orders.card.filled' => 'LLENO', + 'client_view_orders.card.confirmed' => 'CONFIRMADO', + 'client_view_orders.card.in_progress' => 'EN PROGRESO', + 'client_view_orders.card.completed' => 'COMPLETADO', + 'client_view_orders.card.cancelled' => 'CANCELADO', + 'client_view_orders.card.get_direction' => 'Obtener direcciΓ³n', + 'client_view_orders.card.total' => 'Total', + 'client_view_orders.card.hrs' => 'HRS', + 'client_view_orders.card.workers' => ({required Object count}) => '${count} trabajadores', + 'client_view_orders.card.clock_in' => 'ENTRADA', + 'client_view_orders.card.clock_out' => 'SALIDA', + 'client_view_orders.card.coverage' => 'Cobertura', + 'client_view_orders.card.workers_label' => ({required Object filled, required Object needed}) => '${filled}/${needed} Trabajadores', + 'client_view_orders.card.confirmed_workers' => 'Trabajadores Confirmados', + 'client_view_orders.card.no_workers' => 'NingΓΊn trabajador confirmado aΓΊn.', + 'client_billing.title' => 'FacturaciΓ³n', + 'client_billing.current_period' => 'PerΓ­odo Actual', + 'client_billing.saved_amount' => ({required Object amount}) => '${amount} ahorrado', + 'client_billing.awaiting_approval' => 'Esperando AprobaciΓ³n', + 'client_billing.payment_method' => 'MΓ©todo de Pago', + 'client_billing.add_payment' => 'AΓ±adir', + 'client_billing.default_badge' => 'Predeterminado', + 'client_billing.expires' => ({required Object date}) => 'Expira ${date}', + 'client_billing.period_breakdown' => 'Desglose de este PerΓ­odo', + 'client_billing.week' => 'Semana', + 'client_billing.month' => 'Mes', + 'client_billing.total' => 'Total', + 'client_billing.hours' => ({required Object count}) => '${count} horas', + 'client_billing.rate_optimization_title' => 'OptimizaciΓ³n de Tarifas', + 'client_billing.rate_optimization_body' => ({required Object amount}) => 'Ahorra ${amount}/mes cambiando 3 turnos', + 'client_billing.view_details' => 'Ver Detalles', + 'client_billing.invoice_history' => 'Historial de Facturas', + 'client_billing.view_all' => 'Ver todo', + 'client_billing.export_button' => 'Exportar Todas las Facturas', + 'client_billing.pending_badge' => 'PENDIENTE APROBACIΓ“N', + 'client_billing.paid_badge' => 'PAGADO', + 'staff.main.tabs.shifts' => 'Turnos', + 'staff.main.tabs.payments' => 'Pagos', + 'staff.main.tabs.home' => 'Inicio', + 'staff.main.tabs.clock_in' => 'Marcar Entrada', + 'staff.main.tabs.profile' => 'Perfil', + 'staff.home.header.welcome_back' => 'Welcome back', + 'staff.home.header.user_name_placeholder' => 'Krower', + 'staff.home.banners.complete_profile_title' => 'Complete Your Profile', + 'staff.home.banners.complete_profile_subtitle' => 'Get verified to see more shifts', + 'staff.home.banners.availability_title' => 'Availability', + 'staff.home.banners.availability_subtitle' => 'Update your availability for next week', + 'staff.home.quick_actions.find_shifts' => 'Find Shifts', + 'staff.home.quick_actions.availability' => 'Availability', + 'staff.home.quick_actions.messages' => 'Messages', + 'staff.home.quick_actions.earnings' => 'Earnings', + 'staff.home.sections.todays_shift' => 'Today\'s Shift', + 'staff.home.sections.scheduled_count' => ({required Object count}) => '${count} scheduled', + 'staff.home.sections.tomorrow' => 'Tomorrow', + 'staff.home.sections.recommended_for_you' => 'Recommended for You', + 'staff.home.sections.view_all' => 'View all', + 'staff.home.empty_states.no_shifts_today' => 'No shifts scheduled for today', + 'staff.home.empty_states.find_shifts_cta' => 'Find shifts β†’', + 'staff.home.empty_states.no_shifts_tomorrow' => 'No shifts for tomorrow', + 'staff.home.empty_states.no_recommended_shifts' => 'No recommended shifts', + 'staff.home.pending_payment.title' => 'Pending Payment', + 'staff.home.pending_payment.subtitle' => 'Payment processing', + 'staff.home.pending_payment.amount' => ({required Object amount}) => '${amount}', + 'staff.home.recommended_card.act_now' => 'β€’ ACT NOW', + 'staff.home.recommended_card.one_day' => 'One Day', + 'staff.home.recommended_card.today' => 'Today', + 'staff.home.recommended_card.applied_for' => ({required Object title}) => 'Applied for ${title}', + 'staff.home.recommended_card.time_range' => ({required Object start, required Object end}) => '${start} - ${end}', + 'staff.home.benefits.title' => 'Your Benefits', + 'staff.home.benefits.view_all' => 'View all', + 'staff.home.benefits.hours_label' => 'hours', + 'staff.home.benefits.items.sick_days' => 'Sick Days', + 'staff.home.benefits.items.vacation' => 'Vacation', + 'staff.home.benefits.items.holidays' => 'Holidays', + 'staff.home.auto_match.title' => 'Auto-Match', + 'staff.home.auto_match.finding_shifts' => 'Finding shifts for you', + 'staff.home.auto_match.get_matched' => 'Get matched automatically', + 'staff.home.auto_match.matching_based_on' => 'Matching based on:', + 'staff.home.auto_match.chips.location' => 'Location', + 'staff.home.auto_match.chips.availability' => 'Availability', + 'staff.home.auto_match.chips.skills' => 'Skills', + 'staff.home.improve.title' => 'Improve Yourself', + 'staff.home.improve.items.training.title' => 'Training Section', + 'staff.home.improve.items.training.description' => 'Improve your skills and get certified.', + 'staff.home.improve.items.training.page' => '/krow-university', + 'staff.home.improve.items.podcast.title' => 'Krow Podcast', + 'staff.home.improve.items.podcast.description' => 'Listen to tips from top workers.', + 'staff.home.improve.items.podcast.page' => '/krow-university', + 'staff.home.more_ways.title' => 'More Ways To Use Krow', + 'staff.home.more_ways.items.benefits.title' => 'Krow Benefits', + 'staff.home.more_ways.items.benefits.page' => '/benefits', + 'staff.home.more_ways.items.refer.title' => 'Refer a Friend', + 'staff.home.more_ways.items.refer.page' => '/worker-profile', + 'staff.profile.header.title' => 'Perfil', + 'staff.profile.header.sign_out' => 'CERRAR SESIΓ“N', + 'staff.profile.reliability_stats.shifts' => 'Turnos', + 'staff.profile.reliability_stats.rating' => 'CalificaciΓ³n', + 'staff.profile.reliability_stats.on_time' => 'A Tiempo', + 'staff.profile.reliability_stats.no_shows' => 'Faltas', + 'staff.profile.reliability_stats.cancellations' => 'Cancel.', + 'staff.profile.reliability_score.title' => 'PuntuaciΓ³n de Confiabilidad', + 'staff.profile.reliability_score.description' => 'MantΓ©n tu puntuaciΓ³n por encima del 45% para continuar aceptando turnos.', + 'staff.profile.sections.onboarding' => 'INCORPORACIΓ“N', + 'staff.profile.sections.compliance' => 'CUMPLIMIENTO', + 'staff.profile.sections.level_up' => 'MEJORAR NIVEL', + 'staff.profile.sections.finance' => 'FINANZAS', + 'staff.profile.sections.support' => 'SOPORTE', + 'staff.profile.menu_items.personal_info' => 'InformaciΓ³n Personal', + 'staff.profile.menu_items.emergency_contact' => 'Contacto de Emergencia', + 'staff.profile.menu_items.experience' => 'Experiencia', + 'staff.profile.menu_items.attire' => 'Vestimenta', + 'staff.profile.menu_items.documents' => 'Documentos', + 'staff.profile.menu_items.certificates' => 'Certificados', + 'staff.profile.menu_items.tax_forms' => 'Formularios Fiscales', + 'staff.profile.menu_items.krow_university' => 'Krow University', + 'staff.profile.menu_items.trainings' => 'Capacitaciones', + 'staff.profile.menu_items.leaderboard' => 'Tabla de ClasificaciΓ³n', + 'staff.profile.menu_items.bank_account' => 'Cuenta Bancaria', + 'staff.profile.menu_items.payments' => 'Pagos', + 'staff.profile.menu_items.timecard' => 'Tarjeta de Tiempo', + 'staff.profile.menu_items.faqs' => 'Preguntas Frecuentes', + 'staff.profile.menu_items.privacy_security' => 'Privacidad y Seguridad', + 'staff.profile.menu_items.messages' => 'Mensajes', + 'staff.profile.bank_account_page.title' => 'Cuenta Bancaria', + 'staff.profile.bank_account_page.linked_accounts' => 'Cuentas Vinculadas', + 'staff.profile.bank_account_page.add_account' => 'Agregar Cuenta Bancaria', + 'staff.profile.bank_account_page.secure_title' => 'Seguro y Cifrado', + 'staff.profile.bank_account_page.secure_subtitle' => 'Su informaciΓ³n bancaria estΓ‘ cifrada y almacenada de forma segura. Nunca compartimos sus detalles.', + 'staff.profile.bank_account_page.add_new_account' => 'Agregar Nueva Cuenta', + 'staff.profile.bank_account_page.routing_number' => 'NΓΊmero de Ruta', + 'staff.profile.bank_account_page.routing_hint' => '9 dΓ­gitos', + 'staff.profile.bank_account_page.account_number' => 'NΓΊmero de Cuenta', + 'staff.profile.bank_account_page.account_hint' => 'Ingrese nΓΊmero de cuenta', + 'staff.profile.bank_account_page.account_type' => 'Tipo de Cuenta', + 'staff.profile.bank_account_page.checking' => 'CORRIENTE', + 'staff.profile.bank_account_page.savings' => 'AHORROS', + 'staff.profile.bank_account_page.cancel' => 'Cancelar', + 'staff.profile.bank_account_page.save' => 'Guardar', + 'staff.profile.bank_account_page.primary' => 'Principal', + 'staff.profile.bank_account_page.account_ending' => ({required Object last4}) => 'Termina en ${last4}', + 'staff.profile.logout.button' => 'Cerrar SesiΓ³n', + 'staff.onboarding.personal_info.title' => 'InformaciΓ³n Personal', + 'staff.onboarding.personal_info.change_photo_hint' => 'Toca para cambiar foto', + 'staff.onboarding.personal_info.full_name_label' => 'Nombre Completo', + 'staff.onboarding.personal_info.email_label' => 'Correo ElectrΓ³nico', + 'staff.onboarding.personal_info.phone_label' => 'NΓΊmero de TelΓ©fono', + 'staff.onboarding.personal_info.phone_hint' => '+1 (555) 000-0000', + 'staff.onboarding.personal_info.bio_label' => 'BiografΓ­a', + 'staff.onboarding.personal_info.bio_hint' => 'CuΓ©ntales a los clientes sobre ti...', + 'staff.onboarding.personal_info.languages_label' => 'Idiomas', + 'staff.onboarding.personal_info.languages_hint' => 'InglΓ©s, EspaΓ±ol, FrancΓ©s...', + 'staff.onboarding.personal_info.locations_label' => 'Ubicaciones Preferidas', + 'staff.onboarding.personal_info.locations_hint' => 'Centro, Midtown, Brooklyn...', + 'staff.onboarding.personal_info.save_button' => 'Guardar Cambios', + 'staff.onboarding.personal_info.save_success' => 'InformaciΓ³n personal guardada exitosamente', + 'staff.onboarding.experience.title' => 'Experience & Skills', + 'staff.onboarding.experience.industries_title' => 'Industries', + 'staff.onboarding.experience.industries_subtitle' => 'Select the industries you have experience in', + 'staff.onboarding.experience.skills_title' => 'Skills', + 'staff.onboarding.experience.skills_subtitle' => 'Select your skills or add custom ones', + 'staff.onboarding.experience.custom_skills_title' => 'Custom Skills:', + 'staff.onboarding.experience.custom_skill_hint' => 'Add custom skill...', + 'staff.onboarding.experience.save_button' => 'Save & Continue', + 'staff.onboarding.experience.industries.hospitality' => 'Hospitality', + 'staff.onboarding.experience.industries.food_service' => 'Food Service', + 'staff.onboarding.experience.industries.warehouse' => 'Warehouse', + 'staff.onboarding.experience.industries.events' => 'Events', + 'staff.onboarding.experience.industries.retail' => 'Retail', + 'staff.onboarding.experience.industries.healthcare' => 'Healthcare', + 'staff.onboarding.experience.industries.other' => 'Other', + 'staff.onboarding.experience.skills.food_service' => 'Food Service', + 'staff.onboarding.experience.skills.bartending' => 'Bartending', + 'staff.onboarding.experience.skills.event_setup' => 'Event Setup', + 'staff.onboarding.experience.skills.hospitality' => 'Hospitality', + 'staff.onboarding.experience.skills.warehouse' => 'Warehouse', + 'staff.onboarding.experience.skills.customer_service' => 'Customer Service', + 'staff.onboarding.experience.skills.cleaning' => 'Cleaning', + 'staff.onboarding.experience.skills.security' => 'Security', + 'staff.onboarding.experience.skills.retail' => 'Retail', + 'staff.onboarding.experience.skills.cooking' => 'Cooking', + 'staff.onboarding.experience.skills.cashier' => 'Cashier', + 'staff.onboarding.experience.skills.server' => 'Server', + 'staff.onboarding.experience.skills.barista' => 'Barista', + 'staff.onboarding.experience.skills.host_hostess' => 'Host/Hostess', + 'staff.onboarding.experience.skills.busser' => 'Busser', + 'staff_documents.title' => 'Documents', + 'staff_documents.verification_card.title' => 'Document Verification', + 'staff_documents.verification_card.progress' => ({required Object completed, required Object total}) => '${completed}/${total} Complete', + 'staff_documents.list.empty' => 'No documents found', + 'staff_documents.list.error' => ({required Object message}) => 'Error: ${message}', + 'staff_documents.card.view' => 'View', + 'staff_documents.card.upload' => 'Upload', + 'staff_documents.card.verified' => 'Verified', + 'staff_documents.card.pending' => 'Pending', + 'staff_documents.card.missing' => 'Missing', + 'staff_documents.card.rejected' => 'Rejected', + 'staff_certificates.title' => 'Certificates', + 'staff_certificates.progress.title' => 'Your Progress', + 'staff_certificates.progress.verified_count' => ({required Object completed, required Object total}) => '${completed} of ${total} verified', + 'staff_certificates.progress.active' => 'Compliance Active', + 'staff_certificates.card.expires_in_days' => ({required Object days}) => 'Expires in ${days} days - Renew now', + 'staff_certificates.card.expired' => 'Expired - Renew now', + 'staff_certificates.card.verified' => 'Verified', + 'staff_certificates.card.expiring_soon' => 'Expiring Soon', + 'staff_certificates.card.exp' => ({required Object date}) => 'Exp: ${date}', + 'staff_certificates.card.upload_button' => 'Upload Certificate', + 'staff_certificates.card.edit_expiry' => 'Edit Expiration Date', + 'staff_certificates.card.remove' => 'Remove Certificate', + 'staff_certificates.card.renew' => 'Renew', + 'staff_certificates.card.opened_snackbar' => 'Certificate opened in new tab', + 'staff_certificates.add_more.title' => 'Add Another Certificate', + 'staff_certificates.add_more.subtitle' => 'Upload additional certifications', + 'staff_certificates.upload_modal.title' => 'Upload Certificate', + 'staff_certificates.upload_modal.expiry_label' => 'Expiration Date (Optional)', + 'staff_certificates.upload_modal.select_date' => 'Select date', + 'staff_certificates.upload_modal.upload_file' => 'Upload File', + 'staff_certificates.upload_modal.drag_drop' => 'Drag and drop or click to upload', + 'staff_certificates.upload_modal.supported_formats' => 'PDF, JPG, PNG up to 10MB', + 'staff_certificates.upload_modal.cancel' => 'Cancel', + 'staff_certificates.upload_modal.save' => 'Save Certificate', + 'staff_certificates.delete_modal.title' => 'Remove Certificate?', + 'staff_certificates.delete_modal.message' => 'This action cannot be undone.', + 'staff_certificates.delete_modal.cancel' => 'Cancel', + 'staff_certificates.delete_modal.confirm' => 'Remove', + 'staff_profile_attire.title' => 'Vestimenta', + 'staff_profile_attire.info_card.title' => 'Tu Vestuario', + 'staff_profile_attire.info_card.description' => 'Selecciona los artΓ­culos de vestimenta que posees. Esto nos ayuda a asignarte turnos que se ajusten a tu vestuario.', + 'staff_profile_attire.status.required' => 'REQUERIDO', + 'staff_profile_attire.status.add_photo' => 'AΓ±adir Foto', + 'staff_profile_attire.status.added' => 'AΓ±adido', + 'staff_profile_attire.status.pending' => '⏳ VerificaciΓ³n pendiente', + 'staff_profile_attire.attestation' => 'Certifico que poseo estos artΓ­culos y los usarΓ© en mis turnos. Entiendo que los artΓ­culos estΓ‘n pendientes de verificaciΓ³n por el gerente en mi primer turno.', + 'staff_profile_attire.actions.save' => 'Guardar Vestimenta', + 'staff_profile_attire.validation.select_required' => 'βœ“ Seleccionar todos los artΓ­culos requeridos', + 'staff_profile_attire.validation.upload_required' => 'βœ“ Subir fotos de artΓ­culos requeridos', + 'staff_profile_attire.validation.accept_attestation' => 'βœ“ Aceptar certificaciΓ³n', + 'staff_shifts.title' => 'Shifts', + 'staff_shifts.tabs.my_shifts' => 'My Shifts', + 'staff_shifts.tabs.find_work' => 'Find Work', + 'staff_shifts.list.no_shifts' => 'No shifts found', + 'staff_shifts.list.pending_offers' => 'PENDING OFFERS', + 'staff_shifts.list.available_jobs' => ({required Object count}) => '${count} AVAILABLE JOBS', + 'staff_shifts.list.search_hint' => 'Search jobs...', + 'staff_shifts.filter.all' => 'All Jobs', + 'staff_shifts.filter.one_day' => 'One Day', + 'staff_shifts.filter.multi_day' => 'Multi Day', + 'staff_shifts.filter.long_term' => 'Long Term', + 'staff_shifts.status.confirmed' => 'CONFIRMED', + 'staff_shifts.status.act_now' => 'ACT NOW', + 'staff_shifts.status.swap_requested' => 'SWAP REQUESTED', + 'staff_shifts.status.completed' => 'COMPLETED', + 'staff_shifts.status.no_show' => 'NO SHOW', + 'staff_shifts.status.pending_warning' => 'Please confirm assignment', + 'staff_shifts.action.decline' => 'Decline', + 'staff_shifts.action.confirm' => 'Confirm', + 'staff_shifts.action.request_swap' => 'Request Swap', + 'staff_shifts.details.additional' => 'ADDITIONAL DETAILS', + 'staff_shifts.details.days' => ({required Object days}) => '${days} Days', + 'staff_shifts.details.exp_total' => ({required Object amount}) => '(exp.total \$${amount})', + 'staff_shifts.details.pending_time' => ({required Object time}) => 'Pending ${time} ago', + 'staff_shifts.tags.immediate_start' => 'Immediate start', + 'staff_shifts.tags.no_experience' => 'No experience', + _ => null, + }; + } +} diff --git a/apps/mobile/packages/core_localization/lib/src/localization_module.dart b/apps/mobile/packages/core_localization/lib/src/localization_module.dart new file mode 100644 index 00000000..bbc87c6d --- /dev/null +++ b/apps/mobile/packages/core_localization/lib/src/localization_module.dart @@ -0,0 +1,46 @@ +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'data/datasources/locale_local_data_source.dart'; +import 'data/repositories_impl/locale_repository_impl.dart'; +import 'domain/repositories/locale_repository_interface.dart'; +import 'domain/usecases/get_locale_use_case.dart'; +import 'domain/usecases/set_locale_use_case.dart'; +import 'bloc/locale_bloc.dart'; + +/// A [ModularModule] that manages localization dependencies. +/// +/// This module registers all necessary data sources, repositories, use cases, +/// and the BLoC required for application-wide localization management. +class LocalizationModule extends Module { + @override + void binds(Injector i) { + // External Dependencies + i.addInstance(SharedPreferencesAsync()); + + // Data Sources + i.addSingleton( + () => LocaleLocalDataSourceImpl(i.get()), + ); + + // Repositories + i.addSingleton( + () => LocaleRepositoryImpl(i.get()), + ); + + // Use Cases + i.addSingleton( + () => GetLocaleUseCase(i.get()), + ); + i.addSingleton( + () => SetLocaleUseCase(i.get()), + ); + + // BLoCs + i.addSingleton( + () => LocaleBloc( + getLocaleUseCase: i.get(), + setLocaleUseCase: i.get(), + ), + ); + } +} diff --git a/apps/mobile/packages/core_localization/pubspec.yaml b/apps/mobile/packages/core_localization/pubspec.yaml new file mode 100644 index 00000000..7b12cda7 --- /dev/null +++ b/apps/mobile/packages/core_localization/pubspec.yaml @@ -0,0 +1,38 @@ +name: core_localization +description: "Core localization package using Slang." +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + krow_core: + path: ../core + flutter_bloc: ^8.1.0 + flutter_modular: ^6.3.2 + slang: ^4.12.0 + slang_flutter: ^4.12.0 + shared_preferences: ^2.5.0 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + build_runner: ^2.4.15 + slang_build_runner: ^4.12.0 + +flutter: + uses-material-design: true + +slang: + base_locale: en + fallback_strategy: base_locale + input_directory: lib/src/l10n + input_file_pattern: .i18n.json + output_directory: lib/src/l10n + output_file_name: strings.g.dart diff --git a/apps/mobile/packages/core_localization/test/localization_test.dart b/apps/mobile/packages/core_localization/test/localization_test.dart new file mode 100644 index 00000000..0d7a0e1e --- /dev/null +++ b/apps/mobile/packages/core_localization/test/localization_test.dart @@ -0,0 +1,12 @@ +import 'package:flutter_test/flutter_test.dart'; + +import 'package:localization/localization.dart'; + +void main() { + test('adds one to input values', () { + final calculator = Calculator(); + expect(calculator.addOne(2), 3); + expect(calculator.addOne(-7), -6); + expect(calculator.addOne(0), 1); + }); +} diff --git a/apps/mobile/packages/data_connect/lib/krow_data_connect.dart b/apps/mobile/packages/data_connect/lib/krow_data_connect.dart new file mode 100644 index 00000000..429cf0f1 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/krow_data_connect.dart @@ -0,0 +1,26 @@ +/// The Data Connect layer. +/// +/// This package provides mock implementations of domain repository interfaces +/// for development and testing purposes. +/// +/// TODO: These mocks currently do not implement any specific interfaces. +/// They will implement interfaces defined in feature packages once those are created. +library; + +export 'src/mocks/auth_repository_mock.dart'; +export 'src/mocks/shifts_repository_mock.dart'; +export 'src/mocks/staff_repository_mock.dart'; +export 'src/mocks/profile_repository_mock.dart'; +export 'src/mocks/event_repository_mock.dart'; +export 'src/mocks/skill_repository_mock.dart'; +export 'src/mocks/financial_repository_mock.dart'; +export 'src/mocks/rating_repository_mock.dart'; +export 'src/mocks/support_repository_mock.dart'; +export 'src/mocks/home_repository_mock.dart'; +export 'src/mocks/business_repository_mock.dart'; +export 'src/mocks/order_repository_mock.dart'; +export 'src/data_connect_module.dart'; +export 'src/session/client_session_store.dart'; + +// Export the generated Data Connect SDK +export 'src/dataconnect_generated/generated.dart'; diff --git a/apps/mobile/packages/data_connect/lib/src/data_connect_module.dart b/apps/mobile/packages/data_connect/lib/src/data_connect_module.dart new file mode 100644 index 00000000..984db50d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/data_connect_module.dart @@ -0,0 +1,19 @@ +import 'package:flutter_modular/flutter_modular.dart'; +import 'mocks/auth_repository_mock.dart'; +import 'mocks/business_repository_mock.dart'; +import 'mocks/home_repository_mock.dart'; +import 'mocks/order_repository_mock.dart'; +import 'mocks/profile_repository_mock.dart'; + +/// A module that provides Data Connect dependencies, including mocks. +class DataConnectModule extends Module { + @override + void exportedBinds(Injector i) { + // Make these mocks available to any module that imports this one. + i.addLazySingleton(AuthRepositoryMock.new); + i.addLazySingleton(ProfileRepositoryMock.new); + i.addLazySingleton(HomeRepositoryMock.new); + i.addLazySingleton(BusinessRepositoryMock.new); + i.addLazySingleton(OrderRepositoryMock.new); + } +} diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/.guides/config.json b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/.guides/config.json new file mode 100644 index 00000000..e37ed06f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/.guides/config.json @@ -0,0 +1,9 @@ +{ + "description": "A set of guides for interacting with the generated firebase dataconnect sdk", + "mcpServers": { + "firebase": { + "command": "npx", + "args": ["-y", "firebase-tools@latest", "experimental:mcp"] + } + } +} diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/.guides/setup.md b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/.guides/setup.md new file mode 100644 index 00000000..4a3737fe --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/.guides/setup.md @@ -0,0 +1,15 @@ +# Setup + +This guide will walk you through setting up your environment to use the Firebase Data Connect SDK. Mostly using +documentation listed [here](https://firebase.google.com/docs/flutter/setup?platform=ios#install-cli-tools). + +1. Make sure you have the latest Firebase CLI tools installed. Follow the instructions [here](https://firebase.google.com/docs/cli#setup_update_cli) to install. +2. Log into your Firebase account: +```sh +firebase login +``` +3. Install the FlutterFire CLI by running the following command from any directory: +```sh +dart pub global activate flutterfire_cli +``` +4. Make sure the user has initialized Firebase already based on the instructions [here](https://firebase.google.com/docs/flutter/setup?platform=ios#initialize-firebase). diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/.guides/usage.md b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/.guides/usage.md new file mode 100644 index 00000000..492ad9d6 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/.guides/usage.md @@ -0,0 +1,32 @@ +# Basic Usage + +```dart +ExampleConnector.instance.createTeamMember(createTeamMemberVariables).execute(); +ExampleConnector.instance.updateTeamMember(updateTeamMemberVariables).execute(); +ExampleConnector.instance.updateTeamMemberInviteStatus(updateTeamMemberInviteStatusVariables).execute(); +ExampleConnector.instance.acceptInviteByCode(acceptInviteByCodeVariables).execute(); +ExampleConnector.instance.cancelInviteByCode(cancelInviteByCodeVariables).execute(); +ExampleConnector.instance.deleteTeamMember(deleteTeamMemberVariables).execute(); +ExampleConnector.instance.listActivityLogs(listActivityLogsVariables).execute(); +ExampleConnector.instance.getActivityLogById(getActivityLogByIdVariables).execute(); +ExampleConnector.instance.listActivityLogsByUserId(listActivityLogsByUserIdVariables).execute(); +ExampleConnector.instance.listUnreadActivityLogsByUserId(listUnreadActivityLogsByUserIdVariables).execute(); + +``` + +## Optional Fields + +Some operations may have optional fields. In these cases, the Flutter SDK exposes a builder method, and will have to be set separately. + +Optional fields can be discovered based on classes that have `Optional` object types. + +This is an example of a mutation with an optional field: + +```dart +await ExampleConnector.instance.getRapidOrders({ ... }) +.offset(...) +.execute(); +``` + +Note: the above example is a mutation, but the same logic applies to query operations as well. Additionally, `createMovie` is an example, and may not be available to the user. + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/README.md b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/README.md new file mode 100644 index 00000000..258fbed5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/README.md @@ -0,0 +1,24150 @@ +# dataconnect_generated SDK + +## Installation +```sh +flutter pub get firebase_data_connect +flutterfire configure +``` +For more information, see [Flutter for Firebase installation documentation](https://firebase.google.com/docs/data-connect/flutter-sdk#use-core). + +## Data Connect instance +Each connector creates a static class, with an instance of the `DataConnect` class that can be used to connect to your Data Connect backend and call operations. + +### Connecting to the emulator + +```dart +String host = 'localhost'; // or your host name +int port = 9399; // or your port number +ExampleConnector.instance.dataConnect.useDataConnectEmulator(host, port); +``` + +You can also call queries and mutations by using the connector class. +## Queries + +### listActivityLogs +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listActivityLogs().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listActivityLogs, we created `listActivityLogsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListActivityLogsVariablesBuilder { + ... + + ListActivityLogsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListActivityLogsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listActivityLogs() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listActivityLogs(); +listActivityLogsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listActivityLogs().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getActivityLogById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getActivityLogById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getActivityLogById( + id: id, +); +getActivityLogByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getActivityLogById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listActivityLogsByUserId +#### Required Arguments +```dart +String userId = ...; +ExampleConnector.instance.listActivityLogsByUserId( + userId: userId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listActivityLogsByUserId, we created `listActivityLogsByUserIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListActivityLogsByUserIdVariablesBuilder { + ... + ListActivityLogsByUserIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListActivityLogsByUserIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listActivityLogsByUserId( + userId: userId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listActivityLogsByUserId( + userId: userId, +); +listActivityLogsByUserIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String userId = ...; + +final ref = ExampleConnector.instance.listActivityLogsByUserId( + userId: userId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listUnreadActivityLogsByUserId +#### Required Arguments +```dart +String userId = ...; +ExampleConnector.instance.listUnreadActivityLogsByUserId( + userId: userId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listUnreadActivityLogsByUserId, we created `listUnreadActivityLogsByUserIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListUnreadActivityLogsByUserIdVariablesBuilder { + ... + ListUnreadActivityLogsByUserIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListUnreadActivityLogsByUserIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listUnreadActivityLogsByUserId( + userId: userId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listUnreadActivityLogsByUserId( + userId: userId, +); +listUnreadActivityLogsByUserIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String userId = ...; + +final ref = ExampleConnector.instance.listUnreadActivityLogsByUserId( + userId: userId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterActivityLogs +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterActivityLogs().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterActivityLogs, we created `filterActivityLogsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterActivityLogsVariablesBuilder { + ... + + FilterActivityLogsVariablesBuilder userId(String? t) { + _userId.value = t; + return this; + } + FilterActivityLogsVariablesBuilder dateFrom(Timestamp? t) { + _dateFrom.value = t; + return this; + } + FilterActivityLogsVariablesBuilder dateTo(Timestamp? t) { + _dateTo.value = t; + return this; + } + FilterActivityLogsVariablesBuilder isRead(bool? t) { + _isRead.value = t; + return this; + } + FilterActivityLogsVariablesBuilder activityType(ActivityType? t) { + _activityType.value = t; + return this; + } + FilterActivityLogsVariablesBuilder iconType(ActivityIconType? t) { + _iconType.value = t; + return this; + } + FilterActivityLogsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterActivityLogsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterActivityLogs() +.userId(userId) +.dateFrom(dateFrom) +.dateTo(dateTo) +.isRead(isRead) +.activityType(activityType) +.iconType(iconType) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterActivityLogs(); +filterActivityLogsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterActivityLogs().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listBusinesses +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listBusinesses().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listBusinesses(); +listBusinessesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listBusinesses().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getBusinessesByUserId +#### Required Arguments +```dart +String userId = ...; +ExampleConnector.instance.getBusinessesByUserId( + userId: userId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getBusinessesByUserId( + userId: userId, +); +getBusinessesByUserIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String userId = ...; + +final ref = ExampleConnector.instance.getBusinessesByUserId( + userId: userId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getBusinessById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getBusinessById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getBusinessById( + id: id, +); +getBusinessByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getBusinessById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftsForCoverage +#### Required Arguments +```dart +String businessId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; +ExampleConnector.instance.listShiftsForCoverage( + businessId: businessId, + startDate: startDate, + endDate: endDate, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftsForCoverage( + businessId: businessId, + startDate: startDate, + endDate: endDate, +); +listShiftsForCoverageData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; + +final ref = ExampleConnector.instance.listShiftsForCoverage( + businessId: businessId, + startDate: startDate, + endDate: endDate, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listApplicationsForCoverage +#### Required Arguments +```dart +String shiftIds = ...; +ExampleConnector.instance.listApplicationsForCoverage( + shiftIds: shiftIds, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listApplicationsForCoverage( + shiftIds: shiftIds, +); +listApplicationsForCoverageData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftIds = ...; + +final ref = ExampleConnector.instance.listApplicationsForCoverage( + shiftIds: shiftIds, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftsForDailyOpsByBusiness +#### Required Arguments +```dart +String businessId = ...; +Timestamp date = ...; +ExampleConnector.instance.listShiftsForDailyOpsByBusiness( + businessId: businessId, + date: date, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftsForDailyOpsByBusiness( + businessId: businessId, + date: date, +); +listShiftsForDailyOpsByBusinessData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; +Timestamp date = ...; + +final ref = ExampleConnector.instance.listShiftsForDailyOpsByBusiness( + businessId: businessId, + date: date, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftsForDailyOpsByVendor +#### Required Arguments +```dart +String vendorId = ...; +Timestamp date = ...; +ExampleConnector.instance.listShiftsForDailyOpsByVendor( + vendorId: vendorId, + date: date, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftsForDailyOpsByVendor( + vendorId: vendorId, + date: date, +); +listShiftsForDailyOpsByVendorData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; +Timestamp date = ...; + +final ref = ExampleConnector.instance.listShiftsForDailyOpsByVendor( + vendorId: vendorId, + date: date, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listApplicationsForDailyOps +#### Required Arguments +```dart +String shiftIds = ...; +ExampleConnector.instance.listApplicationsForDailyOps( + shiftIds: shiftIds, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listApplicationsForDailyOps( + shiftIds: shiftIds, +); +listApplicationsForDailyOpsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftIds = ...; + +final ref = ExampleConnector.instance.listApplicationsForDailyOps( + shiftIds: shiftIds, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftsForForecastByBusiness +#### Required Arguments +```dart +String businessId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; +ExampleConnector.instance.listShiftsForForecastByBusiness( + businessId: businessId, + startDate: startDate, + endDate: endDate, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftsForForecastByBusiness( + businessId: businessId, + startDate: startDate, + endDate: endDate, +); +listShiftsForForecastByBusinessData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; + +final ref = ExampleConnector.instance.listShiftsForForecastByBusiness( + businessId: businessId, + startDate: startDate, + endDate: endDate, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftsForForecastByVendor +#### Required Arguments +```dart +String vendorId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; +ExampleConnector.instance.listShiftsForForecastByVendor( + vendorId: vendorId, + startDate: startDate, + endDate: endDate, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftsForForecastByVendor( + vendorId: vendorId, + startDate: startDate, + endDate: endDate, +); +listShiftsForForecastByVendorData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; + +final ref = ExampleConnector.instance.listShiftsForForecastByVendor( + vendorId: vendorId, + startDate: startDate, + endDate: endDate, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftsForNoShowRangeByBusiness +#### Required Arguments +```dart +String businessId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; +ExampleConnector.instance.listShiftsForNoShowRangeByBusiness( + businessId: businessId, + startDate: startDate, + endDate: endDate, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftsForNoShowRangeByBusiness( + businessId: businessId, + startDate: startDate, + endDate: endDate, +); +listShiftsForNoShowRangeByBusinessData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; + +final ref = ExampleConnector.instance.listShiftsForNoShowRangeByBusiness( + businessId: businessId, + startDate: startDate, + endDate: endDate, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftsForNoShowRangeByVendor +#### Required Arguments +```dart +String vendorId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; +ExampleConnector.instance.listShiftsForNoShowRangeByVendor( + vendorId: vendorId, + startDate: startDate, + endDate: endDate, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftsForNoShowRangeByVendor( + vendorId: vendorId, + startDate: startDate, + endDate: endDate, +); +listShiftsForNoShowRangeByVendorData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; + +final ref = ExampleConnector.instance.listShiftsForNoShowRangeByVendor( + vendorId: vendorId, + startDate: startDate, + endDate: endDate, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listApplicationsForNoShowRange +#### Required Arguments +```dart +String shiftIds = ...; +ExampleConnector.instance.listApplicationsForNoShowRange( + shiftIds: shiftIds, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listApplicationsForNoShowRange( + shiftIds: shiftIds, +); +listApplicationsForNoShowRangeData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftIds = ...; + +final ref = ExampleConnector.instance.listApplicationsForNoShowRange( + shiftIds: shiftIds, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaffForNoShowReport +#### Required Arguments +```dart +String staffIds = ...; +ExampleConnector.instance.listStaffForNoShowReport( + staffIds: staffIds, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaffForNoShowReport( + staffIds: staffIds, +); +listStaffForNoShowReportData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffIds = ...; + +final ref = ExampleConnector.instance.listStaffForNoShowReport( + staffIds: staffIds, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listInvoicesForSpendByBusiness +#### Required Arguments +```dart +String businessId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; +ExampleConnector.instance.listInvoicesForSpendByBusiness( + businessId: businessId, + startDate: startDate, + endDate: endDate, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listInvoicesForSpendByBusiness( + businessId: businessId, + startDate: startDate, + endDate: endDate, +); +listInvoicesForSpendByBusinessData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; + +final ref = ExampleConnector.instance.listInvoicesForSpendByBusiness( + businessId: businessId, + startDate: startDate, + endDate: endDate, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listInvoicesForSpendByVendor +#### Required Arguments +```dart +String vendorId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; +ExampleConnector.instance.listInvoicesForSpendByVendor( + vendorId: vendorId, + startDate: startDate, + endDate: endDate, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listInvoicesForSpendByVendor( + vendorId: vendorId, + startDate: startDate, + endDate: endDate, +); +listInvoicesForSpendByVendorData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; + +final ref = ExampleConnector.instance.listInvoicesForSpendByVendor( + vendorId: vendorId, + startDate: startDate, + endDate: endDate, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listInvoicesForSpendByOrder +#### Required Arguments +```dart +String orderId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; +ExampleConnector.instance.listInvoicesForSpendByOrder( + orderId: orderId, + startDate: startDate, + endDate: endDate, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listInvoicesForSpendByOrder( + orderId: orderId, + startDate: startDate, + endDate: endDate, +); +listInvoicesForSpendByOrderData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String orderId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; + +final ref = ExampleConnector.instance.listInvoicesForSpendByOrder( + orderId: orderId, + startDate: startDate, + endDate: endDate, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listTimesheetsForSpend +#### Required Arguments +```dart +Timestamp startTime = ...; +Timestamp endTime = ...; +ExampleConnector.instance.listTimesheetsForSpend( + startTime: startTime, + endTime: endTime, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listTimesheetsForSpend( + startTime: startTime, + endTime: endTime, +); +listTimesheetsForSpendData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +Timestamp startTime = ...; +Timestamp endTime = ...; + +final ref = ExampleConnector.instance.listTimesheetsForSpend( + startTime: startTime, + endTime: endTime, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftsForPerformanceByBusiness +#### Required Arguments +```dart +String businessId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; +ExampleConnector.instance.listShiftsForPerformanceByBusiness( + businessId: businessId, + startDate: startDate, + endDate: endDate, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftsForPerformanceByBusiness( + businessId: businessId, + startDate: startDate, + endDate: endDate, +); +listShiftsForPerformanceByBusinessData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; + +final ref = ExampleConnector.instance.listShiftsForPerformanceByBusiness( + businessId: businessId, + startDate: startDate, + endDate: endDate, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftsForPerformanceByVendor +#### Required Arguments +```dart +String vendorId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; +ExampleConnector.instance.listShiftsForPerformanceByVendor( + vendorId: vendorId, + startDate: startDate, + endDate: endDate, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftsForPerformanceByVendor( + vendorId: vendorId, + startDate: startDate, + endDate: endDate, +); +listShiftsForPerformanceByVendorData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; +Timestamp startDate = ...; +Timestamp endDate = ...; + +final ref = ExampleConnector.instance.listShiftsForPerformanceByVendor( + vendorId: vendorId, + startDate: startDate, + endDate: endDate, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listApplicationsForPerformance +#### Required Arguments +```dart +String shiftIds = ...; +ExampleConnector.instance.listApplicationsForPerformance( + shiftIds: shiftIds, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listApplicationsForPerformance( + shiftIds: shiftIds, +); +listApplicationsForPerformanceData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftIds = ...; + +final ref = ExampleConnector.instance.listApplicationsForPerformance( + shiftIds: shiftIds, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaffForPerformance +#### Required Arguments +```dart +String staffIds = ...; +ExampleConnector.instance.listStaffForPerformance( + staffIds: staffIds, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaffForPerformance( + staffIds: staffIds, +); +listStaffForPerformanceData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffIds = ...; + +final ref = ExampleConnector.instance.listStaffForPerformance( + staffIds: staffIds, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaffAvailabilities +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listStaffAvailabilities().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listStaffAvailabilities, we created `listStaffAvailabilitiesBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListStaffAvailabilitiesVariablesBuilder { + ... + + ListStaffAvailabilitiesVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffAvailabilitiesVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listStaffAvailabilities() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaffAvailabilities(); +listStaffAvailabilitiesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listStaffAvailabilities().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaffAvailabilitiesByStaffId +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.listStaffAvailabilitiesByStaffId( + staffId: staffId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listStaffAvailabilitiesByStaffId, we created `listStaffAvailabilitiesByStaffIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListStaffAvailabilitiesByStaffIdVariablesBuilder { + ... + ListStaffAvailabilitiesByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffAvailabilitiesByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listStaffAvailabilitiesByStaffId( + staffId: staffId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaffAvailabilitiesByStaffId( + staffId: staffId, +); +listStaffAvailabilitiesByStaffIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.listStaffAvailabilitiesByStaffId( + staffId: staffId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getStaffAvailabilityByKey +#### Required Arguments +```dart +String staffId = ...; +DayOfWeek day = ...; +AvailabilitySlot slot = ...; +ExampleConnector.instance.getStaffAvailabilityByKey( + staffId: staffId, + day: day, + slot: slot, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getStaffAvailabilityByKey( + staffId: staffId, + day: day, + slot: slot, +); +getStaffAvailabilityByKeyData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +DayOfWeek day = ...; +AvailabilitySlot slot = ...; + +final ref = ExampleConnector.instance.getStaffAvailabilityByKey( + staffId: staffId, + day: day, + slot: slot, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaffAvailabilitiesByDay +#### Required Arguments +```dart +DayOfWeek day = ...; +ExampleConnector.instance.listStaffAvailabilitiesByDay( + day: day, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listStaffAvailabilitiesByDay, we created `listStaffAvailabilitiesByDayBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListStaffAvailabilitiesByDayVariablesBuilder { + ... + ListStaffAvailabilitiesByDayVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffAvailabilitiesByDayVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listStaffAvailabilitiesByDay( + day: day, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaffAvailabilitiesByDay( + day: day, +); +listStaffAvailabilitiesByDayData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +DayOfWeek day = ...; + +final ref = ExampleConnector.instance.listStaffAvailabilitiesByDay( + day: day, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listConversations +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listConversations().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listConversations, we created `listConversationsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListConversationsVariablesBuilder { + ... + + ListConversationsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListConversationsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listConversations() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listConversations(); +listConversationsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listConversations().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getConversationById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getConversationById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getConversationById( + id: id, +); +getConversationByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getConversationById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listConversationsByType +#### Required Arguments +```dart +ConversationType conversationType = ...; +ExampleConnector.instance.listConversationsByType( + conversationType: conversationType, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listConversationsByType, we created `listConversationsByTypeBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListConversationsByTypeVariablesBuilder { + ... + ListConversationsByTypeVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListConversationsByTypeVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listConversationsByType( + conversationType: conversationType, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listConversationsByType( + conversationType: conversationType, +); +listConversationsByTypeData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +ConversationType conversationType = ...; + +final ref = ExampleConnector.instance.listConversationsByType( + conversationType: conversationType, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listConversationsByStatus +#### Required Arguments +```dart +ConversationStatus status = ...; +ExampleConnector.instance.listConversationsByStatus( + status: status, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listConversationsByStatus, we created `listConversationsByStatusBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListConversationsByStatusVariablesBuilder { + ... + ListConversationsByStatusVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListConversationsByStatusVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listConversationsByStatus( + status: status, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listConversationsByStatus( + status: status, +); +listConversationsByStatusData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +ConversationStatus status = ...; + +final ref = ExampleConnector.instance.listConversationsByStatus( + status: status, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterConversations +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterConversations().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterConversations, we created `filterConversationsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterConversationsVariablesBuilder { + ... + + FilterConversationsVariablesBuilder status(ConversationStatus? t) { + _status.value = t; + return this; + } + FilterConversationsVariablesBuilder conversationType(ConversationType? t) { + _conversationType.value = t; + return this; + } + FilterConversationsVariablesBuilder isGroup(bool? t) { + _isGroup.value = t; + return this; + } + FilterConversationsVariablesBuilder lastMessageAfter(Timestamp? t) { + _lastMessageAfter.value = t; + return this; + } + FilterConversationsVariablesBuilder lastMessageBefore(Timestamp? t) { + _lastMessageBefore.value = t; + return this; + } + FilterConversationsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterConversationsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterConversations() +.status(status) +.conversationType(conversationType) +.isGroup(isGroup) +.lastMessageAfter(lastMessageAfter) +.lastMessageBefore(lastMessageBefore) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterConversations(); +filterConversationsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterConversations().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listTeams +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listTeams().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listTeams(); +listTeamsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listTeams().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getTeamById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getTeamById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getTeamById( + id: id, +); +getTeamByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getTeamById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getTeamsByOwnerId +#### Required Arguments +```dart +String ownerId = ...; +ExampleConnector.instance.getTeamsByOwnerId( + ownerId: ownerId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getTeamsByOwnerId( + ownerId: ownerId, +); +getTeamsByOwnerIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String ownerId = ...; + +final ref = ExampleConnector.instance.getTeamsByOwnerId( + ownerId: ownerId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listCategories +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listCategories().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listCategories(); +listCategoriesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listCategories().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getCategoryById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getCategoryById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getCategoryById( + id: id, +); +getCategoryByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getCategoryById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterCategories +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterCategories().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterCategories, we created `filterCategoriesBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterCategoriesVariablesBuilder { + ... + + FilterCategoriesVariablesBuilder categoryId(String? t) { + _categoryId.value = t; + return this; + } + FilterCategoriesVariablesBuilder label(String? t) { + _label.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterCategories() +.categoryId(categoryId) +.label(label) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterCategories(); +filterCategoriesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterCategories().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listVendorBenefitPlans +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listVendorBenefitPlans().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listVendorBenefitPlans, we created `listVendorBenefitPlansBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListVendorBenefitPlansVariablesBuilder { + ... + + ListVendorBenefitPlansVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListVendorBenefitPlansVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listVendorBenefitPlans() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listVendorBenefitPlans(); +listVendorBenefitPlansData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listVendorBenefitPlans().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getVendorBenefitPlanById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getVendorBenefitPlanById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getVendorBenefitPlanById( + id: id, +); +getVendorBenefitPlanByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getVendorBenefitPlanById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listVendorBenefitPlansByVendorId +#### Required Arguments +```dart +String vendorId = ...; +ExampleConnector.instance.listVendorBenefitPlansByVendorId( + vendorId: vendorId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listVendorBenefitPlansByVendorId, we created `listVendorBenefitPlansByVendorIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListVendorBenefitPlansByVendorIdVariablesBuilder { + ... + ListVendorBenefitPlansByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListVendorBenefitPlansByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listVendorBenefitPlansByVendorId( + vendorId: vendorId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listVendorBenefitPlansByVendorId( + vendorId: vendorId, +); +listVendorBenefitPlansByVendorIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; + +final ref = ExampleConnector.instance.listVendorBenefitPlansByVendorId( + vendorId: vendorId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listActiveVendorBenefitPlansByVendorId +#### Required Arguments +```dart +String vendorId = ...; +ExampleConnector.instance.listActiveVendorBenefitPlansByVendorId( + vendorId: vendorId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listActiveVendorBenefitPlansByVendorId, we created `listActiveVendorBenefitPlansByVendorIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListActiveVendorBenefitPlansByVendorIdVariablesBuilder { + ... + ListActiveVendorBenefitPlansByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListActiveVendorBenefitPlansByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listActiveVendorBenefitPlansByVendorId( + vendorId: vendorId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listActiveVendorBenefitPlansByVendorId( + vendorId: vendorId, +); +listActiveVendorBenefitPlansByVendorIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; + +final ref = ExampleConnector.instance.listActiveVendorBenefitPlansByVendorId( + vendorId: vendorId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterVendorBenefitPlans +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterVendorBenefitPlans().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterVendorBenefitPlans, we created `filterVendorBenefitPlansBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterVendorBenefitPlansVariablesBuilder { + ... + + FilterVendorBenefitPlansVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + FilterVendorBenefitPlansVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + FilterVendorBenefitPlansVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + FilterVendorBenefitPlansVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterVendorBenefitPlansVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterVendorBenefitPlans() +.vendorId(vendorId) +.title(title) +.isActive(isActive) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterVendorBenefitPlans(); +filterVendorBenefitPlansData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterVendorBenefitPlans().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listCourses +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listCourses().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listCourses(); +listCoursesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listCourses().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getCourseById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getCourseById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getCourseById( + id: id, +); +getCourseByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getCourseById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterCourses +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterCourses().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterCourses, we created `filterCoursesBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterCoursesVariablesBuilder { + ... + + FilterCoursesVariablesBuilder categoryId(String? t) { + _categoryId.value = t; + return this; + } + FilterCoursesVariablesBuilder isCertification(bool? t) { + _isCertification.value = t; + return this; + } + FilterCoursesVariablesBuilder levelRequired(String? t) { + _levelRequired.value = t; + return this; + } + FilterCoursesVariablesBuilder completed(bool? t) { + _completed.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterCourses() +.categoryId(categoryId) +.isCertification(isCertification) +.levelRequired(levelRequired) +.completed(completed) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterCourses(); +filterCoursesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterCourses().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listRoles +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listRoles().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listRoles(); +listRolesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listRoles().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getRoleById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getRoleById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getRoleById( + id: id, +); +getRoleByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getRoleById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listRolesByVendorId +#### Required Arguments +```dart +String vendorId = ...; +ExampleConnector.instance.listRolesByVendorId( + vendorId: vendorId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listRolesByVendorId( + vendorId: vendorId, +); +listRolesByVendorIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; + +final ref = ExampleConnector.instance.listRolesByVendorId( + vendorId: vendorId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listRolesByroleCategoryId +#### Required Arguments +```dart +String roleCategoryId = ...; +ExampleConnector.instance.listRolesByroleCategoryId( + roleCategoryId: roleCategoryId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listRolesByroleCategoryId( + roleCategoryId: roleCategoryId, +); +listRolesByroleCategoryIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String roleCategoryId = ...; + +final ref = ExampleConnector.instance.listRolesByroleCategoryId( + roleCategoryId: roleCategoryId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getStaffCourseById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getStaffCourseById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getStaffCourseById( + id: id, +); +getStaffCourseByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getStaffCourseById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaffCoursesByStaffId +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.listStaffCoursesByStaffId( + staffId: staffId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listStaffCoursesByStaffId, we created `listStaffCoursesByStaffIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListStaffCoursesByStaffIdVariablesBuilder { + ... + ListStaffCoursesByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffCoursesByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listStaffCoursesByStaffId( + staffId: staffId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaffCoursesByStaffId( + staffId: staffId, +); +listStaffCoursesByStaffIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.listStaffCoursesByStaffId( + staffId: staffId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaffCoursesByCourseId +#### Required Arguments +```dart +String courseId = ...; +ExampleConnector.instance.listStaffCoursesByCourseId( + courseId: courseId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listStaffCoursesByCourseId, we created `listStaffCoursesByCourseIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListStaffCoursesByCourseIdVariablesBuilder { + ... + ListStaffCoursesByCourseIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffCoursesByCourseIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listStaffCoursesByCourseId( + courseId: courseId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaffCoursesByCourseId( + courseId: courseId, +); +listStaffCoursesByCourseIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String courseId = ...; + +final ref = ExampleConnector.instance.listStaffCoursesByCourseId( + courseId: courseId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getStaffCourseByStaffAndCourse +#### Required Arguments +```dart +String staffId = ...; +String courseId = ...; +ExampleConnector.instance.getStaffCourseByStaffAndCourse( + staffId: staffId, + courseId: courseId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getStaffCourseByStaffAndCourse( + staffId: staffId, + courseId: courseId, +); +getStaffCourseByStaffAndCourseData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +String courseId = ...; + +final ref = ExampleConnector.instance.getStaffCourseByStaffAndCourse( + staffId: staffId, + courseId: courseId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getShiftRoleById +#### Required Arguments +```dart +String shiftId = ...; +String roleId = ...; +ExampleConnector.instance.getShiftRoleById( + shiftId: shiftId, + roleId: roleId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getShiftRoleById( + shiftId: shiftId, + roleId: roleId, +); +getShiftRoleByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftId = ...; +String roleId = ...; + +final ref = ExampleConnector.instance.getShiftRoleById( + shiftId: shiftId, + roleId: roleId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftRolesByShiftId +#### Required Arguments +```dart +String shiftId = ...; +ExampleConnector.instance.listShiftRolesByShiftId( + shiftId: shiftId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listShiftRolesByShiftId, we created `listShiftRolesByShiftIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListShiftRolesByShiftIdVariablesBuilder { + ... + ListShiftRolesByShiftIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftRolesByShiftIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listShiftRolesByShiftId( + shiftId: shiftId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftRolesByShiftId( + shiftId: shiftId, +); +listShiftRolesByShiftIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftId = ...; + +final ref = ExampleConnector.instance.listShiftRolesByShiftId( + shiftId: shiftId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftRolesByRoleId +#### Required Arguments +```dart +String roleId = ...; +ExampleConnector.instance.listShiftRolesByRoleId( + roleId: roleId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listShiftRolesByRoleId, we created `listShiftRolesByRoleIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListShiftRolesByRoleIdVariablesBuilder { + ... + ListShiftRolesByRoleIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftRolesByRoleIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listShiftRolesByRoleId( + roleId: roleId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftRolesByRoleId( + roleId: roleId, +); +listShiftRolesByRoleIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String roleId = ...; + +final ref = ExampleConnector.instance.listShiftRolesByRoleId( + roleId: roleId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftRolesByShiftIdAndTimeRange +#### Required Arguments +```dart +String shiftId = ...; +Timestamp start = ...; +Timestamp end = ...; +ExampleConnector.instance.listShiftRolesByShiftIdAndTimeRange( + shiftId: shiftId, + start: start, + end: end, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listShiftRolesByShiftIdAndTimeRange, we created `listShiftRolesByShiftIdAndTimeRangeBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListShiftRolesByShiftIdAndTimeRangeVariablesBuilder { + ... + ListShiftRolesByShiftIdAndTimeRangeVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftRolesByShiftIdAndTimeRangeVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listShiftRolesByShiftIdAndTimeRange( + shiftId: shiftId, + start: start, + end: end, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftRolesByShiftIdAndTimeRange( + shiftId: shiftId, + start: start, + end: end, +); +listShiftRolesByShiftIdAndTimeRangeData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftId = ...; +Timestamp start = ...; +Timestamp end = ...; + +final ref = ExampleConnector.instance.listShiftRolesByShiftIdAndTimeRange( + shiftId: shiftId, + start: start, + end: end, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftRolesByVendorId +#### Required Arguments +```dart +String vendorId = ...; +ExampleConnector.instance.listShiftRolesByVendorId( + vendorId: vendorId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listShiftRolesByVendorId, we created `listShiftRolesByVendorIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListShiftRolesByVendorIdVariablesBuilder { + ... + ListShiftRolesByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftRolesByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listShiftRolesByVendorId( + vendorId: vendorId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftRolesByVendorId( + vendorId: vendorId, +); +listShiftRolesByVendorIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; + +final ref = ExampleConnector.instance.listShiftRolesByVendorId( + vendorId: vendorId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftRolesByBusinessAndDateRange +#### Required Arguments +```dart +String businessId = ...; +Timestamp start = ...; +Timestamp end = ...; +ExampleConnector.instance.listShiftRolesByBusinessAndDateRange( + businessId: businessId, + start: start, + end: end, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listShiftRolesByBusinessAndDateRange, we created `listShiftRolesByBusinessAndDateRangeBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListShiftRolesByBusinessAndDateRangeVariablesBuilder { + ... + ListShiftRolesByBusinessAndDateRangeVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftRolesByBusinessAndDateRangeVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listShiftRolesByBusinessAndDateRange( + businessId: businessId, + start: start, + end: end, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftRolesByBusinessAndDateRange( + businessId: businessId, + start: start, + end: end, +); +listShiftRolesByBusinessAndDateRangeData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; +Timestamp start = ...; +Timestamp end = ...; + +final ref = ExampleConnector.instance.listShiftRolesByBusinessAndDateRange( + businessId: businessId, + start: start, + end: end, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftRolesByBusinessAndOrder +#### Required Arguments +```dart +String businessId = ...; +String orderId = ...; +ExampleConnector.instance.listShiftRolesByBusinessAndOrder( + businessId: businessId, + orderId: orderId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listShiftRolesByBusinessAndOrder, we created `listShiftRolesByBusinessAndOrderBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListShiftRolesByBusinessAndOrderVariablesBuilder { + ... + ListShiftRolesByBusinessAndOrderVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftRolesByBusinessAndOrderVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listShiftRolesByBusinessAndOrder( + businessId: businessId, + orderId: orderId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftRolesByBusinessAndOrder( + businessId: businessId, + orderId: orderId, +); +listShiftRolesByBusinessAndOrderData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; +String orderId = ...; + +final ref = ExampleConnector.instance.listShiftRolesByBusinessAndOrder( + businessId: businessId, + orderId: orderId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShiftRolesByBusinessDateRangeCompletedOrders +#### Required Arguments +```dart +String businessId = ...; +Timestamp start = ...; +Timestamp end = ...; +ExampleConnector.instance.listShiftRolesByBusinessDateRangeCompletedOrders( + businessId: businessId, + start: start, + end: end, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listShiftRolesByBusinessDateRangeCompletedOrders, we created `listShiftRolesByBusinessDateRangeCompletedOrdersBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListShiftRolesByBusinessDateRangeCompletedOrdersVariablesBuilder { + ... + ListShiftRolesByBusinessDateRangeCompletedOrdersVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftRolesByBusinessDateRangeCompletedOrdersVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listShiftRolesByBusinessDateRangeCompletedOrders( + businessId: businessId, + start: start, + end: end, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShiftRolesByBusinessDateRangeCompletedOrders( + businessId: businessId, + start: start, + end: end, +); +listShiftRolesByBusinessDateRangeCompletedOrdersData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; +Timestamp start = ...; +Timestamp end = ...; + +final ref = ExampleConnector.instance.listShiftRolesByBusinessDateRangeCompletedOrders( + businessId: businessId, + start: start, + end: end, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getVendorById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getVendorById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getVendorById( + id: id, +); +getVendorByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getVendorById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getVendorByUserId +#### Required Arguments +```dart +String userId = ...; +ExampleConnector.instance.getVendorByUserId( + userId: userId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getVendorByUserId( + userId: userId, +); +getVendorByUserIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String userId = ...; + +final ref = ExampleConnector.instance.getVendorByUserId( + userId: userId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listVendors +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listVendors().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listVendors(); +listVendorsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listVendors().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listVendorRates +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listVendorRates().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listVendorRates(); +listVendorRatesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listVendorRates().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getVendorRateById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getVendorRateById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getVendorRateById( + id: id, +); +getVendorRateByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getVendorRateById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listAccounts +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listAccounts().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listAccounts(); +listAccountsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listAccounts().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getAccountById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getAccountById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getAccountById( + id: id, +); +getAccountByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getAccountById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getAccountsByOwnerId +#### Required Arguments +```dart +String ownerId = ...; +ExampleConnector.instance.getAccountsByOwnerId( + ownerId: ownerId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getAccountsByOwnerId( + ownerId: ownerId, +); +getAccountsByOwnerIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String ownerId = ...; + +final ref = ExampleConnector.instance.getAccountsByOwnerId( + ownerId: ownerId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterAccounts +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterAccounts().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterAccounts, we created `filterAccountsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterAccountsVariablesBuilder { + ... + + FilterAccountsVariablesBuilder bank(String? t) { + _bank.value = t; + return this; + } + FilterAccountsVariablesBuilder type(AccountType? t) { + _type.value = t; + return this; + } + FilterAccountsVariablesBuilder isPrimary(bool? t) { + _isPrimary.value = t; + return this; + } + FilterAccountsVariablesBuilder ownerId(String? t) { + _ownerId.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterAccounts() +.bank(bank) +.type(type) +.isPrimary(isPrimary) +.ownerId(ownerId) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterAccounts(); +filterAccountsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterAccounts().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listHubs +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listHubs().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listHubs(); +listHubsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listHubs().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getHubById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getHubById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getHubById( + id: id, +); +getHubByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getHubById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getHubsByOwnerId +#### Required Arguments +```dart +String ownerId = ...; +ExampleConnector.instance.getHubsByOwnerId( + ownerId: ownerId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getHubsByOwnerId( + ownerId: ownerId, +); +getHubsByOwnerIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String ownerId = ...; + +final ref = ExampleConnector.instance.getHubsByOwnerId( + ownerId: ownerId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterHubs +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterHubs().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterHubs, we created `filterHubsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterHubsVariablesBuilder { + ... + + FilterHubsVariablesBuilder ownerId(String? t) { + _ownerId.value = t; + return this; + } + FilterHubsVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + FilterHubsVariablesBuilder nfcTagId(String? t) { + _nfcTagId.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterHubs() +.ownerId(ownerId) +.name(name) +.nfcTagId(nfcTagId) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterHubs(); +filterHubsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterHubs().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listRecentPayments +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listRecentPayments().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listRecentPayments, we created `listRecentPaymentsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListRecentPaymentsVariablesBuilder { + ... + + ListRecentPaymentsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListRecentPaymentsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listRecentPayments() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listRecentPayments(); +listRecentPaymentsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listRecentPayments().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getRecentPaymentById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getRecentPaymentById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getRecentPaymentById( + id: id, +); +getRecentPaymentByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getRecentPaymentById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listRecentPaymentsByStaffId +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.listRecentPaymentsByStaffId( + staffId: staffId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listRecentPaymentsByStaffId, we created `listRecentPaymentsByStaffIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListRecentPaymentsByStaffIdVariablesBuilder { + ... + ListRecentPaymentsByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListRecentPaymentsByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listRecentPaymentsByStaffId( + staffId: staffId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listRecentPaymentsByStaffId( + staffId: staffId, +); +listRecentPaymentsByStaffIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.listRecentPaymentsByStaffId( + staffId: staffId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listRecentPaymentsByApplicationId +#### Required Arguments +```dart +String applicationId = ...; +ExampleConnector.instance.listRecentPaymentsByApplicationId( + applicationId: applicationId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listRecentPaymentsByApplicationId, we created `listRecentPaymentsByApplicationIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListRecentPaymentsByApplicationIdVariablesBuilder { + ... + ListRecentPaymentsByApplicationIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListRecentPaymentsByApplicationIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listRecentPaymentsByApplicationId( + applicationId: applicationId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listRecentPaymentsByApplicationId( + applicationId: applicationId, +); +listRecentPaymentsByApplicationIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String applicationId = ...; + +final ref = ExampleConnector.instance.listRecentPaymentsByApplicationId( + applicationId: applicationId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listRecentPaymentsByInvoiceId +#### Required Arguments +```dart +String invoiceId = ...; +ExampleConnector.instance.listRecentPaymentsByInvoiceId( + invoiceId: invoiceId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listRecentPaymentsByInvoiceId, we created `listRecentPaymentsByInvoiceIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListRecentPaymentsByInvoiceIdVariablesBuilder { + ... + ListRecentPaymentsByInvoiceIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListRecentPaymentsByInvoiceIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listRecentPaymentsByInvoiceId( + invoiceId: invoiceId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listRecentPaymentsByInvoiceId( + invoiceId: invoiceId, +); +listRecentPaymentsByInvoiceIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String invoiceId = ...; + +final ref = ExampleConnector.instance.listRecentPaymentsByInvoiceId( + invoiceId: invoiceId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listRecentPaymentsByStatus +#### Required Arguments +```dart +RecentPaymentStatus status = ...; +ExampleConnector.instance.listRecentPaymentsByStatus( + status: status, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listRecentPaymentsByStatus, we created `listRecentPaymentsByStatusBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListRecentPaymentsByStatusVariablesBuilder { + ... + ListRecentPaymentsByStatusVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListRecentPaymentsByStatusVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listRecentPaymentsByStatus( + status: status, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listRecentPaymentsByStatus( + status: status, +); +listRecentPaymentsByStatusData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +RecentPaymentStatus status = ...; + +final ref = ExampleConnector.instance.listRecentPaymentsByStatus( + status: status, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listRecentPaymentsByInvoiceIds +#### Required Arguments +```dart +String invoiceIds = ...; +ExampleConnector.instance.listRecentPaymentsByInvoiceIds( + invoiceIds: invoiceIds, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listRecentPaymentsByInvoiceIds, we created `listRecentPaymentsByInvoiceIdsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListRecentPaymentsByInvoiceIdsVariablesBuilder { + ... + ListRecentPaymentsByInvoiceIdsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListRecentPaymentsByInvoiceIdsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listRecentPaymentsByInvoiceIds( + invoiceIds: invoiceIds, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listRecentPaymentsByInvoiceIds( + invoiceIds: invoiceIds, +); +listRecentPaymentsByInvoiceIdsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String invoiceIds = ...; + +final ref = ExampleConnector.instance.listRecentPaymentsByInvoiceIds( + invoiceIds: invoiceIds, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listRecentPaymentsByBusinessId +#### Required Arguments +```dart +String businessId = ...; +ExampleConnector.instance.listRecentPaymentsByBusinessId( + businessId: businessId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listRecentPaymentsByBusinessId, we created `listRecentPaymentsByBusinessIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListRecentPaymentsByBusinessIdVariablesBuilder { + ... + ListRecentPaymentsByBusinessIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListRecentPaymentsByBusinessIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listRecentPaymentsByBusinessId( + businessId: businessId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listRecentPaymentsByBusinessId( + businessId: businessId, +); +listRecentPaymentsByBusinessIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; + +final ref = ExampleConnector.instance.listRecentPaymentsByBusinessId( + businessId: businessId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getStaffDocumentByKey +#### Required Arguments +```dart +String staffId = ...; +String documentId = ...; +ExampleConnector.instance.getStaffDocumentByKey( + staffId: staffId, + documentId: documentId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getStaffDocumentByKey( + staffId: staffId, + documentId: documentId, +); +getStaffDocumentByKeyData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +String documentId = ...; + +final ref = ExampleConnector.instance.getStaffDocumentByKey( + staffId: staffId, + documentId: documentId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaffDocumentsByStaffId +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.listStaffDocumentsByStaffId( + staffId: staffId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listStaffDocumentsByStaffId, we created `listStaffDocumentsByStaffIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListStaffDocumentsByStaffIdVariablesBuilder { + ... + ListStaffDocumentsByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffDocumentsByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listStaffDocumentsByStaffId( + staffId: staffId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaffDocumentsByStaffId( + staffId: staffId, +); +listStaffDocumentsByStaffIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.listStaffDocumentsByStaffId( + staffId: staffId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaffDocumentsByDocumentType +#### Required Arguments +```dart +DocumentType documentType = ...; +ExampleConnector.instance.listStaffDocumentsByDocumentType( + documentType: documentType, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listStaffDocumentsByDocumentType, we created `listStaffDocumentsByDocumentTypeBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListStaffDocumentsByDocumentTypeVariablesBuilder { + ... + ListStaffDocumentsByDocumentTypeVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffDocumentsByDocumentTypeVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listStaffDocumentsByDocumentType( + documentType: documentType, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaffDocumentsByDocumentType( + documentType: documentType, +); +listStaffDocumentsByDocumentTypeData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +DocumentType documentType = ...; + +final ref = ExampleConnector.instance.listStaffDocumentsByDocumentType( + documentType: documentType, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaffDocumentsByStatus +#### Required Arguments +```dart +DocumentStatus status = ...; +ExampleConnector.instance.listStaffDocumentsByStatus( + status: status, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listStaffDocumentsByStatus, we created `listStaffDocumentsByStatusBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListStaffDocumentsByStatusVariablesBuilder { + ... + ListStaffDocumentsByStatusVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffDocumentsByStatusVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listStaffDocumentsByStatus( + status: status, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaffDocumentsByStatus( + status: status, +); +listStaffDocumentsByStatusData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +DocumentStatus status = ...; + +final ref = ExampleConnector.instance.listStaffDocumentsByStatus( + status: status, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listTasks +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listTasks().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listTasks(); +listTasksData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listTasks().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getTaskById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getTaskById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getTaskById( + id: id, +); +getTaskByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getTaskById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getTasksByOwnerId +#### Required Arguments +```dart +String ownerId = ...; +ExampleConnector.instance.getTasksByOwnerId( + ownerId: ownerId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getTasksByOwnerId( + ownerId: ownerId, +); +getTasksByOwnerIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String ownerId = ...; + +final ref = ExampleConnector.instance.getTasksByOwnerId( + ownerId: ownerId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterTasks +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterTasks().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterTasks, we created `filterTasksBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterTasksVariablesBuilder { + ... + + FilterTasksVariablesBuilder status(TaskStatus? t) { + _status.value = t; + return this; + } + FilterTasksVariablesBuilder priority(TaskPriority? t) { + _priority.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterTasks() +.status(status) +.priority(priority) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterTasks(); +filterTasksData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterTasks().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listTaskComments +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listTaskComments().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listTaskComments(); +listTaskCommentsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listTaskComments().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getTaskCommentById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getTaskCommentById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getTaskCommentById( + id: id, +); +getTaskCommentByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getTaskCommentById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getTaskCommentsByTaskId +#### Required Arguments +```dart +String taskId = ...; +ExampleConnector.instance.getTaskCommentsByTaskId( + taskId: taskId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getTaskCommentsByTaskId( + taskId: taskId, +); +getTaskCommentsByTaskIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String taskId = ...; + +final ref = ExampleConnector.instance.getTaskCommentsByTaskId( + taskId: taskId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listFaqDatas +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listFaqDatas().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listFaqDatas(); +listFaqDatasData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listFaqDatas().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getFaqDataById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getFaqDataById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getFaqDataById( + id: id, +); +getFaqDataByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getFaqDataById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterFaqDatas +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterFaqDatas().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterFaqDatas, we created `filterFaqDatasBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterFaqDatasVariablesBuilder { + ... + + FilterFaqDatasVariablesBuilder category(String? t) { + _category.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterFaqDatas() +.category(category) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterFaqDatas(); +filterFaqDatasData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterFaqDatas().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listInvoiceTemplates +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listInvoiceTemplates().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listInvoiceTemplates, we created `listInvoiceTemplatesBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListInvoiceTemplatesVariablesBuilder { + ... + + ListInvoiceTemplatesVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoiceTemplatesVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listInvoiceTemplates() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listInvoiceTemplates(); +listInvoiceTemplatesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listInvoiceTemplates().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getInvoiceTemplateById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getInvoiceTemplateById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getInvoiceTemplateById( + id: id, +); +getInvoiceTemplateByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getInvoiceTemplateById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listInvoiceTemplatesByOwnerId +#### Required Arguments +```dart +String ownerId = ...; +ExampleConnector.instance.listInvoiceTemplatesByOwnerId( + ownerId: ownerId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listInvoiceTemplatesByOwnerId, we created `listInvoiceTemplatesByOwnerIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListInvoiceTemplatesByOwnerIdVariablesBuilder { + ... + ListInvoiceTemplatesByOwnerIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoiceTemplatesByOwnerIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listInvoiceTemplatesByOwnerId( + ownerId: ownerId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listInvoiceTemplatesByOwnerId( + ownerId: ownerId, +); +listInvoiceTemplatesByOwnerIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String ownerId = ...; + +final ref = ExampleConnector.instance.listInvoiceTemplatesByOwnerId( + ownerId: ownerId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listInvoiceTemplatesByVendorId +#### Required Arguments +```dart +String vendorId = ...; +ExampleConnector.instance.listInvoiceTemplatesByVendorId( + vendorId: vendorId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listInvoiceTemplatesByVendorId, we created `listInvoiceTemplatesByVendorIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListInvoiceTemplatesByVendorIdVariablesBuilder { + ... + ListInvoiceTemplatesByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoiceTemplatesByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listInvoiceTemplatesByVendorId( + vendorId: vendorId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listInvoiceTemplatesByVendorId( + vendorId: vendorId, +); +listInvoiceTemplatesByVendorIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; + +final ref = ExampleConnector.instance.listInvoiceTemplatesByVendorId( + vendorId: vendorId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listInvoiceTemplatesByBusinessId +#### Required Arguments +```dart +String businessId = ...; +ExampleConnector.instance.listInvoiceTemplatesByBusinessId( + businessId: businessId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listInvoiceTemplatesByBusinessId, we created `listInvoiceTemplatesByBusinessIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListInvoiceTemplatesByBusinessIdVariablesBuilder { + ... + ListInvoiceTemplatesByBusinessIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoiceTemplatesByBusinessIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listInvoiceTemplatesByBusinessId( + businessId: businessId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listInvoiceTemplatesByBusinessId( + businessId: businessId, +); +listInvoiceTemplatesByBusinessIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; + +final ref = ExampleConnector.instance.listInvoiceTemplatesByBusinessId( + businessId: businessId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listInvoiceTemplatesByOrderId +#### Required Arguments +```dart +String orderId = ...; +ExampleConnector.instance.listInvoiceTemplatesByOrderId( + orderId: orderId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listInvoiceTemplatesByOrderId, we created `listInvoiceTemplatesByOrderIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListInvoiceTemplatesByOrderIdVariablesBuilder { + ... + ListInvoiceTemplatesByOrderIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoiceTemplatesByOrderIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listInvoiceTemplatesByOrderId( + orderId: orderId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listInvoiceTemplatesByOrderId( + orderId: orderId, +); +listInvoiceTemplatesByOrderIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String orderId = ...; + +final ref = ExampleConnector.instance.listInvoiceTemplatesByOrderId( + orderId: orderId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### searchInvoiceTemplatesByOwnerAndName +#### Required Arguments +```dart +String ownerId = ...; +String name = ...; +ExampleConnector.instance.searchInvoiceTemplatesByOwnerAndName( + ownerId: ownerId, + name: name, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For searchInvoiceTemplatesByOwnerAndName, we created `searchInvoiceTemplatesByOwnerAndNameBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class SearchInvoiceTemplatesByOwnerAndNameVariablesBuilder { + ... + SearchInvoiceTemplatesByOwnerAndNameVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + SearchInvoiceTemplatesByOwnerAndNameVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.searchInvoiceTemplatesByOwnerAndName( + ownerId: ownerId, + name: name, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.searchInvoiceTemplatesByOwnerAndName( + ownerId: ownerId, + name: name, +); +searchInvoiceTemplatesByOwnerAndNameData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String ownerId = ...; +String name = ...; + +final ref = ExampleConnector.instance.searchInvoiceTemplatesByOwnerAndName( + ownerId: ownerId, + name: name, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listMessages +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listMessages().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listMessages(); +listMessagesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listMessages().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getMessageById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getMessageById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getMessageById( + id: id, +); +getMessageByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getMessageById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getMessagesByConversationId +#### Required Arguments +```dart +String conversationId = ...; +ExampleConnector.instance.getMessagesByConversationId( + conversationId: conversationId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getMessagesByConversationId( + conversationId: conversationId, +); +getMessagesByConversationIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String conversationId = ...; + +final ref = ExampleConnector.instance.getMessagesByConversationId( + conversationId: conversationId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaff +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listStaff().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaff(); +listStaffData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listStaff().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getStaffById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getStaffById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getStaffById( + id: id, +); +getStaffByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getStaffById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getStaffByUserId +#### Required Arguments +```dart +String userId = ...; +ExampleConnector.instance.getStaffByUserId( + userId: userId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getStaffByUserId( + userId: userId, +); +getStaffByUserIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String userId = ...; + +final ref = ExampleConnector.instance.getStaffByUserId( + userId: userId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterStaff +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterStaff().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterStaff, we created `filterStaffBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterStaffVariablesBuilder { + ... + + FilterStaffVariablesBuilder ownerId(String? t) { + _ownerId.value = t; + return this; + } + FilterStaffVariablesBuilder fullName(String? t) { + _fullName.value = t; + return this; + } + FilterStaffVariablesBuilder level(String? t) { + _level.value = t; + return this; + } + FilterStaffVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterStaff() +.ownerId(ownerId) +.fullName(fullName) +.level(level) +.email(email) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterStaff(); +filterStaffData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterStaff().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listUserConversations +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listUserConversations().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listUserConversations, we created `listUserConversationsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListUserConversationsVariablesBuilder { + ... + + ListUserConversationsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListUserConversationsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listUserConversations() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listUserConversations(); +listUserConversationsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listUserConversations().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getUserConversationByKey +#### Required Arguments +```dart +String conversationId = ...; +String userId = ...; +ExampleConnector.instance.getUserConversationByKey( + conversationId: conversationId, + userId: userId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getUserConversationByKey( + conversationId: conversationId, + userId: userId, +); +getUserConversationByKeyData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String conversationId = ...; +String userId = ...; + +final ref = ExampleConnector.instance.getUserConversationByKey( + conversationId: conversationId, + userId: userId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listUserConversationsByUserId +#### Required Arguments +```dart +String userId = ...; +ExampleConnector.instance.listUserConversationsByUserId( + userId: userId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listUserConversationsByUserId, we created `listUserConversationsByUserIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListUserConversationsByUserIdVariablesBuilder { + ... + ListUserConversationsByUserIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListUserConversationsByUserIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listUserConversationsByUserId( + userId: userId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listUserConversationsByUserId( + userId: userId, +); +listUserConversationsByUserIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String userId = ...; + +final ref = ExampleConnector.instance.listUserConversationsByUserId( + userId: userId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listUnreadUserConversationsByUserId +#### Required Arguments +```dart +String userId = ...; +ExampleConnector.instance.listUnreadUserConversationsByUserId( + userId: userId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listUnreadUserConversationsByUserId, we created `listUnreadUserConversationsByUserIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListUnreadUserConversationsByUserIdVariablesBuilder { + ... + ListUnreadUserConversationsByUserIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListUnreadUserConversationsByUserIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listUnreadUserConversationsByUserId( + userId: userId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listUnreadUserConversationsByUserId( + userId: userId, +); +listUnreadUserConversationsByUserIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String userId = ...; + +final ref = ExampleConnector.instance.listUnreadUserConversationsByUserId( + userId: userId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listUserConversationsByConversationId +#### Required Arguments +```dart +String conversationId = ...; +ExampleConnector.instance.listUserConversationsByConversationId( + conversationId: conversationId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listUserConversationsByConversationId, we created `listUserConversationsByConversationIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListUserConversationsByConversationIdVariablesBuilder { + ... + ListUserConversationsByConversationIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListUserConversationsByConversationIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listUserConversationsByConversationId( + conversationId: conversationId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listUserConversationsByConversationId( + conversationId: conversationId, +); +listUserConversationsByConversationIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String conversationId = ...; + +final ref = ExampleConnector.instance.listUserConversationsByConversationId( + conversationId: conversationId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterUserConversations +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterUserConversations().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterUserConversations, we created `filterUserConversationsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterUserConversationsVariablesBuilder { + ... + + FilterUserConversationsVariablesBuilder userId(String? t) { + _userId.value = t; + return this; + } + FilterUserConversationsVariablesBuilder conversationId(String? t) { + _conversationId.value = t; + return this; + } + FilterUserConversationsVariablesBuilder unreadMin(int? t) { + _unreadMin.value = t; + return this; + } + FilterUserConversationsVariablesBuilder unreadMax(int? t) { + _unreadMax.value = t; + return this; + } + FilterUserConversationsVariablesBuilder lastReadAfter(Timestamp? t) { + _lastReadAfter.value = t; + return this; + } + FilterUserConversationsVariablesBuilder lastReadBefore(Timestamp? t) { + _lastReadBefore.value = t; + return this; + } + FilterUserConversationsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterUserConversationsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterUserConversations() +.userId(userId) +.conversationId(conversationId) +.unreadMin(unreadMin) +.unreadMax(unreadMax) +.lastReadAfter(lastReadAfter) +.lastReadBefore(lastReadBefore) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterUserConversations(); +filterUserConversationsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterUserConversations().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getMyTasks +#### Required Arguments +```dart +String teamMemberId = ...; +ExampleConnector.instance.getMyTasks( + teamMemberId: teamMemberId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getMyTasks( + teamMemberId: teamMemberId, +); +getMyTasksData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String teamMemberId = ...; + +final ref = ExampleConnector.instance.getMyTasks( + teamMemberId: teamMemberId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getMemberTaskByIdKey +#### Required Arguments +```dart +String teamMemberId = ...; +String taskId = ...; +ExampleConnector.instance.getMemberTaskByIdKey( + teamMemberId: teamMemberId, + taskId: taskId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getMemberTaskByIdKey( + teamMemberId: teamMemberId, + taskId: taskId, +); +getMemberTaskByIdKeyData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String teamMemberId = ...; +String taskId = ...; + +final ref = ExampleConnector.instance.getMemberTaskByIdKey( + teamMemberId: teamMemberId, + taskId: taskId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getMemberTasksByTaskId +#### Required Arguments +```dart +String taskId = ...; +ExampleConnector.instance.getMemberTasksByTaskId( + taskId: taskId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getMemberTasksByTaskId( + taskId: taskId, +); +getMemberTasksByTaskIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String taskId = ...; + +final ref = ExampleConnector.instance.getMemberTasksByTaskId( + taskId: taskId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listShifts +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listShifts().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listShifts, we created `listShiftsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListShiftsVariablesBuilder { + ... + + ListShiftsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listShifts() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listShifts(); +listShiftsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listShifts().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getShiftById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getShiftById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getShiftById( + id: id, +); +getShiftByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getShiftById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterShifts +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterShifts().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterShifts, we created `filterShiftsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterShiftsVariablesBuilder { + ... + + FilterShiftsVariablesBuilder status(ShiftStatus? t) { + _status.value = t; + return this; + } + FilterShiftsVariablesBuilder orderId(String? t) { + _orderId.value = t; + return this; + } + FilterShiftsVariablesBuilder dateFrom(Timestamp? t) { + _dateFrom.value = t; + return this; + } + FilterShiftsVariablesBuilder dateTo(Timestamp? t) { + _dateTo.value = t; + return this; + } + FilterShiftsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterShiftsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterShifts() +.status(status) +.orderId(orderId) +.dateFrom(dateFrom) +.dateTo(dateTo) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterShifts(); +filterShiftsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterShifts().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getShiftsByBusinessId +#### Required Arguments +```dart +String businessId = ...; +ExampleConnector.instance.getShiftsByBusinessId( + businessId: businessId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For getShiftsByBusinessId, we created `getShiftsByBusinessIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class GetShiftsByBusinessIdVariablesBuilder { + ... + GetShiftsByBusinessIdVariablesBuilder dateFrom(Timestamp? t) { + _dateFrom.value = t; + return this; + } + GetShiftsByBusinessIdVariablesBuilder dateTo(Timestamp? t) { + _dateTo.value = t; + return this; + } + GetShiftsByBusinessIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetShiftsByBusinessIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.getShiftsByBusinessId( + businessId: businessId, +) +.dateFrom(dateFrom) +.dateTo(dateTo) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getShiftsByBusinessId( + businessId: businessId, +); +getShiftsByBusinessIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; + +final ref = ExampleConnector.instance.getShiftsByBusinessId( + businessId: businessId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getShiftsByVendorId +#### Required Arguments +```dart +String vendorId = ...; +ExampleConnector.instance.getShiftsByVendorId( + vendorId: vendorId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For getShiftsByVendorId, we created `getShiftsByVendorIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class GetShiftsByVendorIdVariablesBuilder { + ... + GetShiftsByVendorIdVariablesBuilder dateFrom(Timestamp? t) { + _dateFrom.value = t; + return this; + } + GetShiftsByVendorIdVariablesBuilder dateTo(Timestamp? t) { + _dateTo.value = t; + return this; + } + GetShiftsByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetShiftsByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.getShiftsByVendorId( + vendorId: vendorId, +) +.dateFrom(dateFrom) +.dateTo(dateTo) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getShiftsByVendorId( + vendorId: vendorId, +); +getShiftsByVendorIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; + +final ref = ExampleConnector.instance.getShiftsByVendorId( + vendorId: vendorId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getWorkforceById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getWorkforceById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getWorkforceById( + id: id, +); +getWorkforceByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getWorkforceById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getWorkforceByVendorAndStaff +#### Required Arguments +```dart +String vendorId = ...; +String staffId = ...; +ExampleConnector.instance.getWorkforceByVendorAndStaff( + vendorId: vendorId, + staffId: staffId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getWorkforceByVendorAndStaff( + vendorId: vendorId, + staffId: staffId, +); +getWorkforceByVendorAndStaffData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; +String staffId = ...; + +final ref = ExampleConnector.instance.getWorkforceByVendorAndStaff( + vendorId: vendorId, + staffId: staffId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listWorkforceByVendorId +#### Required Arguments +```dart +String vendorId = ...; +ExampleConnector.instance.listWorkforceByVendorId( + vendorId: vendorId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listWorkforceByVendorId, we created `listWorkforceByVendorIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListWorkforceByVendorIdVariablesBuilder { + ... + ListWorkforceByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListWorkforceByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listWorkforceByVendorId( + vendorId: vendorId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listWorkforceByVendorId( + vendorId: vendorId, +); +listWorkforceByVendorIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; + +final ref = ExampleConnector.instance.listWorkforceByVendorId( + vendorId: vendorId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listWorkforceByStaffId +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.listWorkforceByStaffId( + staffId: staffId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listWorkforceByStaffId, we created `listWorkforceByStaffIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListWorkforceByStaffIdVariablesBuilder { + ... + ListWorkforceByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListWorkforceByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listWorkforceByStaffId( + staffId: staffId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listWorkforceByStaffId( + staffId: staffId, +); +listWorkforceByStaffIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.listWorkforceByStaffId( + staffId: staffId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getWorkforceByVendorAndNumber +#### Required Arguments +```dart +String vendorId = ...; +String workforceNumber = ...; +ExampleConnector.instance.getWorkforceByVendorAndNumber( + vendorId: vendorId, + workforceNumber: workforceNumber, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getWorkforceByVendorAndNumber( + vendorId: vendorId, + workforceNumber: workforceNumber, +); +getWorkforceByVendorAndNumberData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; +String workforceNumber = ...; + +final ref = ExampleConnector.instance.getWorkforceByVendorAndNumber( + vendorId: vendorId, + workforceNumber: workforceNumber, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listDocuments +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listDocuments().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listDocuments(); +listDocumentsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listDocuments().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getDocumentById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getDocumentById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getDocumentById( + id: id, +); +getDocumentByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getDocumentById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterDocuments +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterDocuments().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterDocuments, we created `filterDocumentsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterDocumentsVariablesBuilder { + ... + + FilterDocumentsVariablesBuilder documentType(DocumentType? t) { + _documentType.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterDocuments() +.documentType(documentType) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterDocuments(); +filterDocumentsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterDocuments().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listEmergencyContacts +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listEmergencyContacts().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listEmergencyContacts(); +listEmergencyContactsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listEmergencyContacts().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getEmergencyContactById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getEmergencyContactById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getEmergencyContactById( + id: id, +); +getEmergencyContactByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getEmergencyContactById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getEmergencyContactsByStaffId +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.getEmergencyContactsByStaffId( + staffId: staffId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getEmergencyContactsByStaffId( + staffId: staffId, +); +getEmergencyContactsByStaffIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.getEmergencyContactsByStaffId( + staffId: staffId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listLevels +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listLevels().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listLevels(); +listLevelsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listLevels().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getLevelById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getLevelById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getLevelById( + id: id, +); +getLevelByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getLevelById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterLevels +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterLevels().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterLevels, we created `filterLevelsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterLevelsVariablesBuilder { + ... + + FilterLevelsVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + FilterLevelsVariablesBuilder xpRequired(int? t) { + _xpRequired.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterLevels() +.name(name) +.xpRequired(xpRequired) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterLevels(); +filterLevelsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterLevels().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaffAvailabilityStats +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listStaffAvailabilityStats().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listStaffAvailabilityStats, we created `listStaffAvailabilityStatsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListStaffAvailabilityStatsVariablesBuilder { + ... + + ListStaffAvailabilityStatsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffAvailabilityStatsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listStaffAvailabilityStats() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaffAvailabilityStats(); +listStaffAvailabilityStatsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listStaffAvailabilityStats().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getStaffAvailabilityStatsByStaffId +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.getStaffAvailabilityStatsByStaffId( + staffId: staffId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getStaffAvailabilityStatsByStaffId( + staffId: staffId, +); +getStaffAvailabilityStatsByStaffIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.getStaffAvailabilityStatsByStaffId( + staffId: staffId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterStaffAvailabilityStats +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterStaffAvailabilityStats().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterStaffAvailabilityStats, we created `filterStaffAvailabilityStatsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterStaffAvailabilityStatsVariablesBuilder { + ... + + FilterStaffAvailabilityStatsVariablesBuilder needWorkIndexMin(int? t) { + _needWorkIndexMin.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder needWorkIndexMax(int? t) { + _needWorkIndexMax.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder utilizationMin(int? t) { + _utilizationMin.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder utilizationMax(int? t) { + _utilizationMax.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder acceptanceRateMin(int? t) { + _acceptanceRateMin.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder acceptanceRateMax(int? t) { + _acceptanceRateMax.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder lastShiftAfter(Timestamp? t) { + _lastShiftAfter.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder lastShiftBefore(Timestamp? t) { + _lastShiftBefore.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterStaffAvailabilityStats() +.needWorkIndexMin(needWorkIndexMin) +.needWorkIndexMax(needWorkIndexMax) +.utilizationMin(utilizationMin) +.utilizationMax(utilizationMax) +.acceptanceRateMin(acceptanceRateMin) +.acceptanceRateMax(acceptanceRateMax) +.lastShiftAfter(lastShiftAfter) +.lastShiftBefore(lastShiftBefore) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterStaffAvailabilityStats(); +filterStaffAvailabilityStatsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterStaffAvailabilityStats().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listAssignments +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listAssignments().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listAssignments, we created `listAssignmentsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListAssignmentsVariablesBuilder { + ... + + ListAssignmentsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListAssignmentsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listAssignments() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listAssignments(); +listAssignmentsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listAssignments().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getAssignmentById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getAssignmentById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getAssignmentById( + id: id, +); +getAssignmentByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getAssignmentById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listAssignmentsByWorkforceId +#### Required Arguments +```dart +String workforceId = ...; +ExampleConnector.instance.listAssignmentsByWorkforceId( + workforceId: workforceId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listAssignmentsByWorkforceId, we created `listAssignmentsByWorkforceIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListAssignmentsByWorkforceIdVariablesBuilder { + ... + ListAssignmentsByWorkforceIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListAssignmentsByWorkforceIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listAssignmentsByWorkforceId( + workforceId: workforceId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listAssignmentsByWorkforceId( + workforceId: workforceId, +); +listAssignmentsByWorkforceIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String workforceId = ...; + +final ref = ExampleConnector.instance.listAssignmentsByWorkforceId( + workforceId: workforceId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listAssignmentsByWorkforceIds +#### Required Arguments +```dart +String workforceIds = ...; +ExampleConnector.instance.listAssignmentsByWorkforceIds( + workforceIds: workforceIds, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listAssignmentsByWorkforceIds, we created `listAssignmentsByWorkforceIdsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListAssignmentsByWorkforceIdsVariablesBuilder { + ... + ListAssignmentsByWorkforceIdsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListAssignmentsByWorkforceIdsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listAssignmentsByWorkforceIds( + workforceIds: workforceIds, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listAssignmentsByWorkforceIds( + workforceIds: workforceIds, +); +listAssignmentsByWorkforceIdsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String workforceIds = ...; + +final ref = ExampleConnector.instance.listAssignmentsByWorkforceIds( + workforceIds: workforceIds, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listAssignmentsByShiftRole +#### Required Arguments +```dart +String shiftId = ...; +String roleId = ...; +ExampleConnector.instance.listAssignmentsByShiftRole( + shiftId: shiftId, + roleId: roleId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listAssignmentsByShiftRole, we created `listAssignmentsByShiftRoleBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListAssignmentsByShiftRoleVariablesBuilder { + ... + ListAssignmentsByShiftRoleVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListAssignmentsByShiftRoleVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listAssignmentsByShiftRole( + shiftId: shiftId, + roleId: roleId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listAssignmentsByShiftRole( + shiftId: shiftId, + roleId: roleId, +); +listAssignmentsByShiftRoleData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftId = ...; +String roleId = ...; + +final ref = ExampleConnector.instance.listAssignmentsByShiftRole( + shiftId: shiftId, + roleId: roleId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterAssignments +#### Required Arguments +```dart +String shiftIds = ...; +String roleIds = ...; +ExampleConnector.instance.filterAssignments( + shiftIds: shiftIds, + roleIds: roleIds, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterAssignments, we created `filterAssignmentsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterAssignmentsVariablesBuilder { + ... + FilterAssignmentsVariablesBuilder status(AssignmentStatus? t) { + _status.value = t; + return this; + } + FilterAssignmentsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterAssignmentsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterAssignments( + shiftIds: shiftIds, + roleIds: roleIds, +) +.status(status) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterAssignments( + shiftIds: shiftIds, + roleIds: roleIds, +); +filterAssignmentsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftIds = ...; +String roleIds = ...; + +final ref = ExampleConnector.instance.filterAssignments( + shiftIds: shiftIds, + roleIds: roleIds, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listCertificates +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listCertificates().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listCertificates(); +listCertificatesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listCertificates().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getCertificateById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getCertificateById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getCertificateById( + id: id, +); +getCertificateByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getCertificateById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listCertificatesByStaffId +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.listCertificatesByStaffId( + staffId: staffId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listCertificatesByStaffId( + staffId: staffId, +); +listCertificatesByStaffIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.listCertificatesByStaffId( + staffId: staffId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listApplications +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listApplications().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listApplications(); +listApplicationsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listApplications().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getApplicationById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getApplicationById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getApplicationById( + id: id, +); +getApplicationByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getApplicationById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getApplicationsByShiftId +#### Required Arguments +```dart +String shiftId = ...; +ExampleConnector.instance.getApplicationsByShiftId( + shiftId: shiftId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getApplicationsByShiftId( + shiftId: shiftId, +); +getApplicationsByShiftIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftId = ...; + +final ref = ExampleConnector.instance.getApplicationsByShiftId( + shiftId: shiftId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getApplicationsByShiftIdAndStatus +#### Required Arguments +```dart +String shiftId = ...; +ApplicationStatus status = ...; +ExampleConnector.instance.getApplicationsByShiftIdAndStatus( + shiftId: shiftId, + status: status, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For getApplicationsByShiftIdAndStatus, we created `getApplicationsByShiftIdAndStatusBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class GetApplicationsByShiftIdAndStatusVariablesBuilder { + ... + GetApplicationsByShiftIdAndStatusVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetApplicationsByShiftIdAndStatusVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.getApplicationsByShiftIdAndStatus( + shiftId: shiftId, + status: status, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getApplicationsByShiftIdAndStatus( + shiftId: shiftId, + status: status, +); +getApplicationsByShiftIdAndStatusData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftId = ...; +ApplicationStatus status = ...; + +final ref = ExampleConnector.instance.getApplicationsByShiftIdAndStatus( + shiftId: shiftId, + status: status, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getApplicationsByStaffId +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.getApplicationsByStaffId( + staffId: staffId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For getApplicationsByStaffId, we created `getApplicationsByStaffIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class GetApplicationsByStaffIdVariablesBuilder { + ... + GetApplicationsByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetApplicationsByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.getApplicationsByStaffId( + staffId: staffId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getApplicationsByStaffId( + staffId: staffId, +); +getApplicationsByStaffIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.getApplicationsByStaffId( + staffId: staffId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listAcceptedApplicationsByShiftRoleKey +#### Required Arguments +```dart +String shiftId = ...; +String roleId = ...; +ExampleConnector.instance.listAcceptedApplicationsByShiftRoleKey( + shiftId: shiftId, + roleId: roleId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listAcceptedApplicationsByShiftRoleKey, we created `listAcceptedApplicationsByShiftRoleKeyBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder { + ... + ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listAcceptedApplicationsByShiftRoleKey( + shiftId: shiftId, + roleId: roleId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listAcceptedApplicationsByShiftRoleKey( + shiftId: shiftId, + roleId: roleId, +); +listAcceptedApplicationsByShiftRoleKeyData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftId = ...; +String roleId = ...; + +final ref = ExampleConnector.instance.listAcceptedApplicationsByShiftRoleKey( + shiftId: shiftId, + roleId: roleId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listAcceptedApplicationsByBusinessForDay +#### Required Arguments +```dart +String businessId = ...; +Timestamp dayStart = ...; +Timestamp dayEnd = ...; +ExampleConnector.instance.listAcceptedApplicationsByBusinessForDay( + businessId: businessId, + dayStart: dayStart, + dayEnd: dayEnd, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listAcceptedApplicationsByBusinessForDay, we created `listAcceptedApplicationsByBusinessForDayBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListAcceptedApplicationsByBusinessForDayVariablesBuilder { + ... + ListAcceptedApplicationsByBusinessForDayVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListAcceptedApplicationsByBusinessForDayVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listAcceptedApplicationsByBusinessForDay( + businessId: businessId, + dayStart: dayStart, + dayEnd: dayEnd, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listAcceptedApplicationsByBusinessForDay( + businessId: businessId, + dayStart: dayStart, + dayEnd: dayEnd, +); +listAcceptedApplicationsByBusinessForDayData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; +Timestamp dayStart = ...; +Timestamp dayEnd = ...; + +final ref = ExampleConnector.instance.listAcceptedApplicationsByBusinessForDay( + businessId: businessId, + dayStart: dayStart, + dayEnd: dayEnd, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listAttireOptions +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listAttireOptions().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listAttireOptions(); +listAttireOptionsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listAttireOptions().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getAttireOptionById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getAttireOptionById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getAttireOptionById( + id: id, +); +getAttireOptionByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getAttireOptionById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterAttireOptions +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterAttireOptions().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterAttireOptions, we created `filterAttireOptionsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterAttireOptionsVariablesBuilder { + ... + + FilterAttireOptionsVariablesBuilder itemId(String? t) { + _itemId.value = t; + return this; + } + FilterAttireOptionsVariablesBuilder isMandatory(bool? t) { + _isMandatory.value = t; + return this; + } + FilterAttireOptionsVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterAttireOptions() +.itemId(itemId) +.isMandatory(isMandatory) +.vendorId(vendorId) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterAttireOptions(); +filterAttireOptionsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterAttireOptions().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listInvoices +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listInvoices().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listInvoices, we created `listInvoicesBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListInvoicesVariablesBuilder { + ... + + ListInvoicesVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoicesVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listInvoices() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listInvoices(); +listInvoicesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listInvoices().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getInvoiceById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getInvoiceById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getInvoiceById( + id: id, +); +getInvoiceByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getInvoiceById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listInvoicesByVendorId +#### Required Arguments +```dart +String vendorId = ...; +ExampleConnector.instance.listInvoicesByVendorId( + vendorId: vendorId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listInvoicesByVendorId, we created `listInvoicesByVendorIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListInvoicesByVendorIdVariablesBuilder { + ... + ListInvoicesByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoicesByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listInvoicesByVendorId( + vendorId: vendorId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listInvoicesByVendorId( + vendorId: vendorId, +); +listInvoicesByVendorIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; + +final ref = ExampleConnector.instance.listInvoicesByVendorId( + vendorId: vendorId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listInvoicesByBusinessId +#### Required Arguments +```dart +String businessId = ...; +ExampleConnector.instance.listInvoicesByBusinessId( + businessId: businessId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listInvoicesByBusinessId, we created `listInvoicesByBusinessIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListInvoicesByBusinessIdVariablesBuilder { + ... + ListInvoicesByBusinessIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoicesByBusinessIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listInvoicesByBusinessId( + businessId: businessId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listInvoicesByBusinessId( + businessId: businessId, +); +listInvoicesByBusinessIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; + +final ref = ExampleConnector.instance.listInvoicesByBusinessId( + businessId: businessId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listInvoicesByOrderId +#### Required Arguments +```dart +String orderId = ...; +ExampleConnector.instance.listInvoicesByOrderId( + orderId: orderId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listInvoicesByOrderId, we created `listInvoicesByOrderIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListInvoicesByOrderIdVariablesBuilder { + ... + ListInvoicesByOrderIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoicesByOrderIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listInvoicesByOrderId( + orderId: orderId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listInvoicesByOrderId( + orderId: orderId, +); +listInvoicesByOrderIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String orderId = ...; + +final ref = ExampleConnector.instance.listInvoicesByOrderId( + orderId: orderId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listInvoicesByStatus +#### Required Arguments +```dart +InvoiceStatus status = ...; +ExampleConnector.instance.listInvoicesByStatus( + status: status, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listInvoicesByStatus, we created `listInvoicesByStatusBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListInvoicesByStatusVariablesBuilder { + ... + ListInvoicesByStatusVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoicesByStatusVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listInvoicesByStatus( + status: status, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listInvoicesByStatus( + status: status, +); +listInvoicesByStatusData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +InvoiceStatus status = ...; + +final ref = ExampleConnector.instance.listInvoicesByStatus( + status: status, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterInvoices +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterInvoices().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterInvoices, we created `filterInvoicesBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterInvoicesVariablesBuilder { + ... + + FilterInvoicesVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + FilterInvoicesVariablesBuilder businessId(String? t) { + _businessId.value = t; + return this; + } + FilterInvoicesVariablesBuilder orderId(String? t) { + _orderId.value = t; + return this; + } + FilterInvoicesVariablesBuilder status(InvoiceStatus? t) { + _status.value = t; + return this; + } + FilterInvoicesVariablesBuilder issueDateFrom(Timestamp? t) { + _issueDateFrom.value = t; + return this; + } + FilterInvoicesVariablesBuilder issueDateTo(Timestamp? t) { + _issueDateTo.value = t; + return this; + } + FilterInvoicesVariablesBuilder dueDateFrom(Timestamp? t) { + _dueDateFrom.value = t; + return this; + } + FilterInvoicesVariablesBuilder dueDateTo(Timestamp? t) { + _dueDateTo.value = t; + return this; + } + FilterInvoicesVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterInvoicesVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterInvoices() +.vendorId(vendorId) +.businessId(businessId) +.orderId(orderId) +.status(status) +.issueDateFrom(issueDateFrom) +.issueDateTo(issueDateTo) +.dueDateFrom(dueDateFrom) +.dueDateTo(dueDateTo) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterInvoices(); +filterInvoicesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterInvoices().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listOverdueInvoices +#### Required Arguments +```dart +Timestamp now = ...; +ExampleConnector.instance.listOverdueInvoices( + now: now, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listOverdueInvoices, we created `listOverdueInvoicesBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListOverdueInvoicesVariablesBuilder { + ... + ListOverdueInvoicesVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListOverdueInvoicesVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listOverdueInvoices( + now: now, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listOverdueInvoices( + now: now, +); +listOverdueInvoicesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +Timestamp now = ...; + +final ref = ExampleConnector.instance.listOverdueInvoices( + now: now, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listUsers +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listUsers().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listUsers(); +listUsersData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listUsers().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getUserById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getUserById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getUserById( + id: id, +); +getUserByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getUserById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterUsers +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterUsers().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterUsers, we created `filterUsersBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterUsersVariablesBuilder { + ... + + FilterUsersVariablesBuilder id(String? t) { + _id.value = t; + return this; + } + FilterUsersVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + FilterUsersVariablesBuilder role(UserBaseRole? t) { + _role.value = t; + return this; + } + FilterUsersVariablesBuilder userRole(String? t) { + _userRole.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterUsers() +.id(id) +.email(email) +.role(role) +.userRole(userRole) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterUsers(); +filterUsersData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterUsers().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaffRoles +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listStaffRoles().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listStaffRoles, we created `listStaffRolesBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListStaffRolesVariablesBuilder { + ... + + ListStaffRolesVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffRolesVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listStaffRoles() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaffRoles(); +listStaffRolesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listStaffRoles().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getStaffRoleByKey +#### Required Arguments +```dart +String staffId = ...; +String roleId = ...; +ExampleConnector.instance.getStaffRoleByKey( + staffId: staffId, + roleId: roleId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getStaffRoleByKey( + staffId: staffId, + roleId: roleId, +); +getStaffRoleByKeyData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +String roleId = ...; + +final ref = ExampleConnector.instance.getStaffRoleByKey( + staffId: staffId, + roleId: roleId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaffRolesByStaffId +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.listStaffRolesByStaffId( + staffId: staffId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listStaffRolesByStaffId, we created `listStaffRolesByStaffIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListStaffRolesByStaffIdVariablesBuilder { + ... + ListStaffRolesByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffRolesByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listStaffRolesByStaffId( + staffId: staffId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaffRolesByStaffId( + staffId: staffId, +); +listStaffRolesByStaffIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.listStaffRolesByStaffId( + staffId: staffId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listStaffRolesByRoleId +#### Required Arguments +```dart +String roleId = ...; +ExampleConnector.instance.listStaffRolesByRoleId( + roleId: roleId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listStaffRolesByRoleId, we created `listStaffRolesByRoleIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListStaffRolesByRoleIdVariablesBuilder { + ... + ListStaffRolesByRoleIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffRolesByRoleIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listStaffRolesByRoleId( + roleId: roleId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listStaffRolesByRoleId( + roleId: roleId, +); +listStaffRolesByRoleIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String roleId = ...; + +final ref = ExampleConnector.instance.listStaffRolesByRoleId( + roleId: roleId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterStaffRoles +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterStaffRoles().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterStaffRoles, we created `filterStaffRolesBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterStaffRolesVariablesBuilder { + ... + + FilterStaffRolesVariablesBuilder staffId(String? t) { + _staffId.value = t; + return this; + } + FilterStaffRolesVariablesBuilder roleId(String? t) { + _roleId.value = t; + return this; + } + FilterStaffRolesVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterStaffRolesVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterStaffRoles() +.staffId(staffId) +.roleId(roleId) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterStaffRoles(); +filterStaffRolesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterStaffRoles().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listTeamHubs +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listTeamHubs().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listTeamHubs(); +listTeamHubsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listTeamHubs().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getTeamHubById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getTeamHubById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getTeamHubById( + id: id, +); +getTeamHubByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getTeamHubById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getTeamHubsByTeamId +#### Required Arguments +```dart +String teamId = ...; +ExampleConnector.instance.getTeamHubsByTeamId( + teamId: teamId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getTeamHubsByTeamId( + teamId: teamId, +); +getTeamHubsByTeamIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String teamId = ...; + +final ref = ExampleConnector.instance.getTeamHubsByTeamId( + teamId: teamId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listTeamHubsByOwnerId +#### Required Arguments +```dart +String ownerId = ...; +ExampleConnector.instance.listTeamHubsByOwnerId( + ownerId: ownerId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listTeamHubsByOwnerId( + ownerId: ownerId, +); +listTeamHubsByOwnerIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String ownerId = ...; + +final ref = ExampleConnector.instance.listTeamHubsByOwnerId( + ownerId: ownerId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listTeamHudDepartments +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listTeamHudDepartments().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listTeamHudDepartments, we created `listTeamHudDepartmentsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListTeamHudDepartmentsVariablesBuilder { + ... + + ListTeamHudDepartmentsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListTeamHudDepartmentsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listTeamHudDepartments() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listTeamHudDepartments(); +listTeamHudDepartmentsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listTeamHudDepartments().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getTeamHudDepartmentById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getTeamHudDepartmentById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getTeamHudDepartmentById( + id: id, +); +getTeamHudDepartmentByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getTeamHudDepartmentById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listTeamHudDepartmentsByTeamHubId +#### Required Arguments +```dart +String teamHubId = ...; +ExampleConnector.instance.listTeamHudDepartmentsByTeamHubId( + teamHubId: teamHubId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listTeamHudDepartmentsByTeamHubId, we created `listTeamHudDepartmentsByTeamHubIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListTeamHudDepartmentsByTeamHubIdVariablesBuilder { + ... + ListTeamHudDepartmentsByTeamHubIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListTeamHudDepartmentsByTeamHubIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listTeamHudDepartmentsByTeamHubId( + teamHubId: teamHubId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listTeamHudDepartmentsByTeamHubId( + teamHubId: teamHubId, +); +listTeamHudDepartmentsByTeamHubIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String teamHubId = ...; + +final ref = ExampleConnector.instance.listTeamHudDepartmentsByTeamHubId( + teamHubId: teamHubId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listTeamMembers +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listTeamMembers().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listTeamMembers(); +listTeamMembersData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listTeamMembers().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getTeamMemberById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getTeamMemberById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getTeamMemberById( + id: id, +); +getTeamMemberByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getTeamMemberById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getTeamMembersByTeamId +#### Required Arguments +```dart +String teamId = ...; +ExampleConnector.instance.getTeamMembersByTeamId( + teamId: teamId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getTeamMembersByTeamId( + teamId: teamId, +); +getTeamMembersByTeamIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String teamId = ...; + +final ref = ExampleConnector.instance.getTeamMembersByTeamId( + teamId: teamId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listClientFeedbacks +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listClientFeedbacks().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listClientFeedbacks, we created `listClientFeedbacksBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListClientFeedbacksVariablesBuilder { + ... + + ListClientFeedbacksVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListClientFeedbacksVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listClientFeedbacks() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listClientFeedbacks(); +listClientFeedbacksData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listClientFeedbacks().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getClientFeedbackById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getClientFeedbackById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getClientFeedbackById( + id: id, +); +getClientFeedbackByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getClientFeedbackById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listClientFeedbacksByBusinessId +#### Required Arguments +```dart +String businessId = ...; +ExampleConnector.instance.listClientFeedbacksByBusinessId( + businessId: businessId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listClientFeedbacksByBusinessId, we created `listClientFeedbacksByBusinessIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListClientFeedbacksByBusinessIdVariablesBuilder { + ... + ListClientFeedbacksByBusinessIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListClientFeedbacksByBusinessIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listClientFeedbacksByBusinessId( + businessId: businessId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listClientFeedbacksByBusinessId( + businessId: businessId, +); +listClientFeedbacksByBusinessIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; + +final ref = ExampleConnector.instance.listClientFeedbacksByBusinessId( + businessId: businessId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listClientFeedbacksByVendorId +#### Required Arguments +```dart +String vendorId = ...; +ExampleConnector.instance.listClientFeedbacksByVendorId( + vendorId: vendorId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listClientFeedbacksByVendorId, we created `listClientFeedbacksByVendorIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListClientFeedbacksByVendorIdVariablesBuilder { + ... + ListClientFeedbacksByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListClientFeedbacksByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listClientFeedbacksByVendorId( + vendorId: vendorId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listClientFeedbacksByVendorId( + vendorId: vendorId, +); +listClientFeedbacksByVendorIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; + +final ref = ExampleConnector.instance.listClientFeedbacksByVendorId( + vendorId: vendorId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listClientFeedbacksByBusinessAndVendor +#### Required Arguments +```dart +String businessId = ...; +String vendorId = ...; +ExampleConnector.instance.listClientFeedbacksByBusinessAndVendor( + businessId: businessId, + vendorId: vendorId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listClientFeedbacksByBusinessAndVendor, we created `listClientFeedbacksByBusinessAndVendorBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListClientFeedbacksByBusinessAndVendorVariablesBuilder { + ... + ListClientFeedbacksByBusinessAndVendorVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListClientFeedbacksByBusinessAndVendorVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listClientFeedbacksByBusinessAndVendor( + businessId: businessId, + vendorId: vendorId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listClientFeedbacksByBusinessAndVendor( + businessId: businessId, + vendorId: vendorId, +); +listClientFeedbacksByBusinessAndVendorData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; +String vendorId = ...; + +final ref = ExampleConnector.instance.listClientFeedbacksByBusinessAndVendor( + businessId: businessId, + vendorId: vendorId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterClientFeedbacks +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterClientFeedbacks().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterClientFeedbacks, we created `filterClientFeedbacksBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterClientFeedbacksVariablesBuilder { + ... + + FilterClientFeedbacksVariablesBuilder businessId(String? t) { + _businessId.value = t; + return this; + } + FilterClientFeedbacksVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + FilterClientFeedbacksVariablesBuilder ratingMin(int? t) { + _ratingMin.value = t; + return this; + } + FilterClientFeedbacksVariablesBuilder ratingMax(int? t) { + _ratingMax.value = t; + return this; + } + FilterClientFeedbacksVariablesBuilder dateFrom(Timestamp? t) { + _dateFrom.value = t; + return this; + } + FilterClientFeedbacksVariablesBuilder dateTo(Timestamp? t) { + _dateTo.value = t; + return this; + } + FilterClientFeedbacksVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterClientFeedbacksVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterClientFeedbacks() +.businessId(businessId) +.vendorId(vendorId) +.ratingMin(ratingMin) +.ratingMax(ratingMax) +.dateFrom(dateFrom) +.dateTo(dateTo) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterClientFeedbacks(); +filterClientFeedbacksData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterClientFeedbacks().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listClientFeedbackRatingsByVendorId +#### Required Arguments +```dart +String vendorId = ...; +ExampleConnector.instance.listClientFeedbackRatingsByVendorId( + vendorId: vendorId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listClientFeedbackRatingsByVendorId, we created `listClientFeedbackRatingsByVendorIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListClientFeedbackRatingsByVendorIdVariablesBuilder { + ... + ListClientFeedbackRatingsByVendorIdVariablesBuilder dateFrom(Timestamp? t) { + _dateFrom.value = t; + return this; + } + ListClientFeedbackRatingsByVendorIdVariablesBuilder dateTo(Timestamp? t) { + _dateTo.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listClientFeedbackRatingsByVendorId( + vendorId: vendorId, +) +.dateFrom(dateFrom) +.dateTo(dateTo) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listClientFeedbackRatingsByVendorId( + vendorId: vendorId, +); +listClientFeedbackRatingsByVendorIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; + +final ref = ExampleConnector.instance.listClientFeedbackRatingsByVendorId( + vendorId: vendorId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listCustomRateCards +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listCustomRateCards().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listCustomRateCards(); +listCustomRateCardsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listCustomRateCards().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getCustomRateCardById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getCustomRateCardById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getCustomRateCardById( + id: id, +); +getCustomRateCardByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getCustomRateCardById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listRoleCategories +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listRoleCategories().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listRoleCategories(); +listRoleCategoriesData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listRoleCategories().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getRoleCategoryById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getRoleCategoryById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getRoleCategoryById( + id: id, +); +getRoleCategoryByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getRoleCategoryById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getRoleCategoriesByCategory +#### Required Arguments +```dart +RoleCategoryType category = ...; +ExampleConnector.instance.getRoleCategoriesByCategory( + category: category, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getRoleCategoriesByCategory( + category: category, +); +getRoleCategoriesByCategoryData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +RoleCategoryType category = ...; + +final ref = ExampleConnector.instance.getRoleCategoriesByCategory( + category: category, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listTaxForms +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listTaxForms().execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listTaxForms(); +listTaxFormsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listTaxForms().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getTaxFormById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getTaxFormById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getTaxFormById( + id: id, +); +getTaxFormByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getTaxFormById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getTaxFormsBystaffId +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.getTaxFormsBystaffId( + staffId: staffId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getTaxFormsBystaffId( + staffId: staffId, +); +getTaxFormsBystaffIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.getTaxFormsBystaffId( + staffId: staffId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### filterTaxForms +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.filterTaxForms().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For filterTaxForms, we created `filterTaxFormsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class FilterTaxFormsVariablesBuilder { + ... + + FilterTaxFormsVariablesBuilder formType(TaxFormType? t) { + _formType.value = t; + return this; + } + FilterTaxFormsVariablesBuilder status(TaxFormStatus? t) { + _status.value = t; + return this; + } + FilterTaxFormsVariablesBuilder staffId(String? t) { + _staffId.value = t; + return this; + } + + ... +} +ExampleConnector.instance.filterTaxForms() +.formType(formType) +.status(status) +.staffId(staffId) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.filterTaxForms(); +filterTaxFormsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.filterTaxForms().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listBenefitsData +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listBenefitsData().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listBenefitsData, we created `listBenefitsDataBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListBenefitsDataVariablesBuilder { + ... + + ListBenefitsDataVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListBenefitsDataVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listBenefitsData() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listBenefitsData(); +listBenefitsDataData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listBenefitsData().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getBenefitsDataByKey +#### Required Arguments +```dart +String staffId = ...; +String vendorBenefitPlanId = ...; +ExampleConnector.instance.getBenefitsDataByKey( + staffId: staffId, + vendorBenefitPlanId: vendorBenefitPlanId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getBenefitsDataByKey( + staffId: staffId, + vendorBenefitPlanId: vendorBenefitPlanId, +); +getBenefitsDataByKeyData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +String vendorBenefitPlanId = ...; + +final ref = ExampleConnector.instance.getBenefitsDataByKey( + staffId: staffId, + vendorBenefitPlanId: vendorBenefitPlanId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listBenefitsDataByStaffId +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.listBenefitsDataByStaffId( + staffId: staffId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listBenefitsDataByStaffId, we created `listBenefitsDataByStaffIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListBenefitsDataByStaffIdVariablesBuilder { + ... + ListBenefitsDataByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListBenefitsDataByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listBenefitsDataByStaffId( + staffId: staffId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listBenefitsDataByStaffId( + staffId: staffId, +); +listBenefitsDataByStaffIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.listBenefitsDataByStaffId( + staffId: staffId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listBenefitsDataByVendorBenefitPlanId +#### Required Arguments +```dart +String vendorBenefitPlanId = ...; +ExampleConnector.instance.listBenefitsDataByVendorBenefitPlanId( + vendorBenefitPlanId: vendorBenefitPlanId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listBenefitsDataByVendorBenefitPlanId, we created `listBenefitsDataByVendorBenefitPlanIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListBenefitsDataByVendorBenefitPlanIdVariablesBuilder { + ... + ListBenefitsDataByVendorBenefitPlanIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListBenefitsDataByVendorBenefitPlanIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listBenefitsDataByVendorBenefitPlanId( + vendorBenefitPlanId: vendorBenefitPlanId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listBenefitsDataByVendorBenefitPlanId( + vendorBenefitPlanId: vendorBenefitPlanId, +); +listBenefitsDataByVendorBenefitPlanIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorBenefitPlanId = ...; + +final ref = ExampleConnector.instance.listBenefitsDataByVendorBenefitPlanId( + vendorBenefitPlanId: vendorBenefitPlanId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listBenefitsDataByVendorBenefitPlanIds +#### Required Arguments +```dart +String vendorBenefitPlanIds = ...; +ExampleConnector.instance.listBenefitsDataByVendorBenefitPlanIds( + vendorBenefitPlanIds: vendorBenefitPlanIds, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listBenefitsDataByVendorBenefitPlanIds, we created `listBenefitsDataByVendorBenefitPlanIdsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListBenefitsDataByVendorBenefitPlanIdsVariablesBuilder { + ... + ListBenefitsDataByVendorBenefitPlanIdsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListBenefitsDataByVendorBenefitPlanIdsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listBenefitsDataByVendorBenefitPlanIds( + vendorBenefitPlanIds: vendorBenefitPlanIds, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listBenefitsDataByVendorBenefitPlanIds( + vendorBenefitPlanIds: vendorBenefitPlanIds, +); +listBenefitsDataByVendorBenefitPlanIdsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorBenefitPlanIds = ...; + +final ref = ExampleConnector.instance.listBenefitsDataByVendorBenefitPlanIds( + vendorBenefitPlanIds: vendorBenefitPlanIds, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### listOrders +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.listOrders().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For listOrders, we created `listOrdersBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class ListOrdersVariablesBuilder { + ... + + ListOrdersVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListOrdersVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.listOrders() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.listOrders(); +listOrdersData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.listOrders().ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getOrderById +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.getOrderById( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getOrderById( + id: id, +); +getOrderByIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.getOrderById( + id: id, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getOrdersByBusinessId +#### Required Arguments +```dart +String businessId = ...; +ExampleConnector.instance.getOrdersByBusinessId( + businessId: businessId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For getOrdersByBusinessId, we created `getOrdersByBusinessIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class GetOrdersByBusinessIdVariablesBuilder { + ... + GetOrdersByBusinessIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetOrdersByBusinessIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.getOrdersByBusinessId( + businessId: businessId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getOrdersByBusinessId( + businessId: businessId, +); +getOrdersByBusinessIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; + +final ref = ExampleConnector.instance.getOrdersByBusinessId( + businessId: businessId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getOrdersByVendorId +#### Required Arguments +```dart +String vendorId = ...; +ExampleConnector.instance.getOrdersByVendorId( + vendorId: vendorId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For getOrdersByVendorId, we created `getOrdersByVendorIdBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class GetOrdersByVendorIdVariablesBuilder { + ... + GetOrdersByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetOrdersByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.getOrdersByVendorId( + vendorId: vendorId, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getOrdersByVendorId( + vendorId: vendorId, +); +getOrdersByVendorIdData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; + +final ref = ExampleConnector.instance.getOrdersByVendorId( + vendorId: vendorId, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getOrdersByStatus +#### Required Arguments +```dart +OrderStatus status = ...; +ExampleConnector.instance.getOrdersByStatus( + status: status, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For getOrdersByStatus, we created `getOrdersByStatusBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class GetOrdersByStatusVariablesBuilder { + ... + GetOrdersByStatusVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetOrdersByStatusVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.getOrdersByStatus( + status: status, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getOrdersByStatus( + status: status, +); +getOrdersByStatusData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +OrderStatus status = ...; + +final ref = ExampleConnector.instance.getOrdersByStatus( + status: status, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getOrdersByDateRange +#### Required Arguments +```dart +Timestamp start = ...; +Timestamp end = ...; +ExampleConnector.instance.getOrdersByDateRange( + start: start, + end: end, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For getOrdersByDateRange, we created `getOrdersByDateRangeBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class GetOrdersByDateRangeVariablesBuilder { + ... + GetOrdersByDateRangeVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetOrdersByDateRangeVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.getOrdersByDateRange( + start: start, + end: end, +) +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getOrdersByDateRange( + start: start, + end: end, +); +getOrdersByDateRangeData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +Timestamp start = ...; +Timestamp end = ...; + +final ref = ExampleConnector.instance.getOrdersByDateRange( + start: start, + end: end, +).ref(); +ref.execute(); + +ref.subscribe(...); +``` + + +### getRapidOrders +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.getRapidOrders().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For getRapidOrders, we created `getRapidOrdersBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class GetRapidOrdersVariablesBuilder { + ... + + GetRapidOrdersVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetRapidOrdersVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ... +} +ExampleConnector.instance.getRapidOrders() +.offset(offset) +.limit(limit) +.execute(); +``` + +#### Return Type +`execute()` returns a `QueryResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +/// Result of a query request. Created to hold extra variables in the future. +class QueryResult extends OperationResult { + QueryResult(super.dataConnect, super.data, super.ref); +} + +final result = await ExampleConnector.instance.getRapidOrders(); +getRapidOrdersData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.getRapidOrders().ref(); +ref.execute(); + +ref.subscribe(...); +``` + +## Mutations + +### createTeamMember +#### Required Arguments +```dart +String teamId = ...; +TeamMemberRole role = ...; +String userId = ...; +ExampleConnector.instance.createTeamMember( + teamId: teamId, + role: role, + userId: userId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createTeamMember, we created `createTeamMemberBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateTeamMemberVariablesBuilder { + ... + CreateTeamMemberVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + CreateTeamMemberVariablesBuilder department(String? t) { + _department.value = t; + return this; + } + CreateTeamMemberVariablesBuilder teamHubId(String? t) { + _teamHubId.value = t; + return this; + } + CreateTeamMemberVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + CreateTeamMemberVariablesBuilder inviteStatus(TeamMemberInviteStatus? t) { + _inviteStatus.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createTeamMember( + teamId: teamId, + role: role, + userId: userId, +) +.title(title) +.department(department) +.teamHubId(teamHubId) +.isActive(isActive) +.inviteStatus(inviteStatus) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createTeamMember( + teamId: teamId, + role: role, + userId: userId, +); +createTeamMemberData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String teamId = ...; +TeamMemberRole role = ...; +String userId = ...; + +final ref = ExampleConnector.instance.createTeamMember( + teamId: teamId, + role: role, + userId: userId, +).ref(); +ref.execute(); +``` + + +### updateTeamMember +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateTeamMember( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateTeamMember, we created `updateTeamMemberBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateTeamMemberVariablesBuilder { + ... + UpdateTeamMemberVariablesBuilder role(TeamMemberRole? t) { + _role.value = t; + return this; + } + UpdateTeamMemberVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + UpdateTeamMemberVariablesBuilder department(String? t) { + _department.value = t; + return this; + } + UpdateTeamMemberVariablesBuilder teamHubId(String? t) { + _teamHubId.value = t; + return this; + } + UpdateTeamMemberVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + UpdateTeamMemberVariablesBuilder inviteStatus(TeamMemberInviteStatus? t) { + _inviteStatus.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateTeamMember( + id: id, +) +.role(role) +.title(title) +.department(department) +.teamHubId(teamHubId) +.isActive(isActive) +.inviteStatus(inviteStatus) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateTeamMember( + id: id, +); +updateTeamMemberData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateTeamMember( + id: id, +).ref(); +ref.execute(); +``` + + +### updateTeamMemberInviteStatus +#### Required Arguments +```dart +String id = ...; +TeamMemberInviteStatus inviteStatus = ...; +ExampleConnector.instance.updateTeamMemberInviteStatus( + id: id, + inviteStatus: inviteStatus, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateTeamMemberInviteStatus( + id: id, + inviteStatus: inviteStatus, +); +updateTeamMemberInviteStatusData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; +TeamMemberInviteStatus inviteStatus = ...; + +final ref = ExampleConnector.instance.updateTeamMemberInviteStatus( + id: id, + inviteStatus: inviteStatus, +).ref(); +ref.execute(); +``` + + +### acceptInviteByCode +#### Required Arguments +```dart +String inviteCode = ...; +ExampleConnector.instance.acceptInviteByCode( + inviteCode: inviteCode, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.acceptInviteByCode( + inviteCode: inviteCode, +); +acceptInviteByCodeData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String inviteCode = ...; + +final ref = ExampleConnector.instance.acceptInviteByCode( + inviteCode: inviteCode, +).ref(); +ref.execute(); +``` + + +### cancelInviteByCode +#### Required Arguments +```dart +String inviteCode = ...; +ExampleConnector.instance.cancelInviteByCode( + inviteCode: inviteCode, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.cancelInviteByCode( + inviteCode: inviteCode, +); +cancelInviteByCodeData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String inviteCode = ...; + +final ref = ExampleConnector.instance.cancelInviteByCode( + inviteCode: inviteCode, +).ref(); +ref.execute(); +``` + + +### deleteTeamMember +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteTeamMember( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteTeamMember( + id: id, +); +deleteTeamMemberData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteTeamMember( + id: id, +).ref(); +ref.execute(); +``` + + +### createBenefitsData +#### Required Arguments +```dart +String vendorBenefitPlanId = ...; +String staffId = ...; +int current = ...; +ExampleConnector.instance.createBenefitsData( + vendorBenefitPlanId: vendorBenefitPlanId, + staffId: staffId, + current: current, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createBenefitsData( + vendorBenefitPlanId: vendorBenefitPlanId, + staffId: staffId, + current: current, +); +createBenefitsDataData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorBenefitPlanId = ...; +String staffId = ...; +int current = ...; + +final ref = ExampleConnector.instance.createBenefitsData( + vendorBenefitPlanId: vendorBenefitPlanId, + staffId: staffId, + current: current, +).ref(); +ref.execute(); +``` + + +### updateBenefitsData +#### Required Arguments +```dart +String staffId = ...; +String vendorBenefitPlanId = ...; +ExampleConnector.instance.updateBenefitsData( + staffId: staffId, + vendorBenefitPlanId: vendorBenefitPlanId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateBenefitsData, we created `updateBenefitsDataBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateBenefitsDataVariablesBuilder { + ... + UpdateBenefitsDataVariablesBuilder current(int? t) { + _current.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateBenefitsData( + staffId: staffId, + vendorBenefitPlanId: vendorBenefitPlanId, +) +.current(current) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateBenefitsData( + staffId: staffId, + vendorBenefitPlanId: vendorBenefitPlanId, +); +updateBenefitsDataData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +String vendorBenefitPlanId = ...; + +final ref = ExampleConnector.instance.updateBenefitsData( + staffId: staffId, + vendorBenefitPlanId: vendorBenefitPlanId, +).ref(); +ref.execute(); +``` + + +### deleteBenefitsData +#### Required Arguments +```dart +String staffId = ...; +String vendorBenefitPlanId = ...; +ExampleConnector.instance.deleteBenefitsData( + staffId: staffId, + vendorBenefitPlanId: vendorBenefitPlanId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteBenefitsData( + staffId: staffId, + vendorBenefitPlanId: vendorBenefitPlanId, +); +deleteBenefitsDataData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +String vendorBenefitPlanId = ...; + +final ref = ExampleConnector.instance.deleteBenefitsData( + staffId: staffId, + vendorBenefitPlanId: vendorBenefitPlanId, +).ref(); +ref.execute(); +``` + + +### createStaffCourse +#### Required Arguments +```dart +String staffId = ...; +String courseId = ...; +ExampleConnector.instance.createStaffCourse( + staffId: staffId, + courseId: courseId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createStaffCourse, we created `createStaffCourseBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateStaffCourseVariablesBuilder { + ... + CreateStaffCourseVariablesBuilder progressPercent(int? t) { + _progressPercent.value = t; + return this; + } + CreateStaffCourseVariablesBuilder completed(bool? t) { + _completed.value = t; + return this; + } + CreateStaffCourseVariablesBuilder completedAt(Timestamp? t) { + _completedAt.value = t; + return this; + } + CreateStaffCourseVariablesBuilder startedAt(Timestamp? t) { + _startedAt.value = t; + return this; + } + CreateStaffCourseVariablesBuilder lastAccessedAt(Timestamp? t) { + _lastAccessedAt.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createStaffCourse( + staffId: staffId, + courseId: courseId, +) +.progressPercent(progressPercent) +.completed(completed) +.completedAt(completedAt) +.startedAt(startedAt) +.lastAccessedAt(lastAccessedAt) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createStaffCourse( + staffId: staffId, + courseId: courseId, +); +createStaffCourseData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +String courseId = ...; + +final ref = ExampleConnector.instance.createStaffCourse( + staffId: staffId, + courseId: courseId, +).ref(); +ref.execute(); +``` + + +### updateStaffCourse +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateStaffCourse( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateStaffCourse, we created `updateStaffCourseBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateStaffCourseVariablesBuilder { + ... + UpdateStaffCourseVariablesBuilder progressPercent(int? t) { + _progressPercent.value = t; + return this; + } + UpdateStaffCourseVariablesBuilder completed(bool? t) { + _completed.value = t; + return this; + } + UpdateStaffCourseVariablesBuilder completedAt(Timestamp? t) { + _completedAt.value = t; + return this; + } + UpdateStaffCourseVariablesBuilder startedAt(Timestamp? t) { + _startedAt.value = t; + return this; + } + UpdateStaffCourseVariablesBuilder lastAccessedAt(Timestamp? t) { + _lastAccessedAt.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateStaffCourse( + id: id, +) +.progressPercent(progressPercent) +.completed(completed) +.completedAt(completedAt) +.startedAt(startedAt) +.lastAccessedAt(lastAccessedAt) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateStaffCourse( + id: id, +); +updateStaffCourseData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateStaffCourse( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteStaffCourse +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteStaffCourse( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteStaffCourse( + id: id, +); +deleteStaffCourseData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteStaffCourse( + id: id, +).ref(); +ref.execute(); +``` + + +### createTeam +#### Required Arguments +```dart +String teamName = ...; +String ownerId = ...; +String ownerName = ...; +String ownerRole = ...; +ExampleConnector.instance.createTeam( + teamName: teamName, + ownerId: ownerId, + ownerName: ownerName, + ownerRole: ownerRole, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createTeam, we created `createTeamBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateTeamVariablesBuilder { + ... + CreateTeamVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + CreateTeamVariablesBuilder companyLogo(String? t) { + _companyLogo.value = t; + return this; + } + CreateTeamVariablesBuilder totalMembers(int? t) { + _totalMembers.value = t; + return this; + } + CreateTeamVariablesBuilder activeMembers(int? t) { + _activeMembers.value = t; + return this; + } + CreateTeamVariablesBuilder totalHubs(int? t) { + _totalHubs.value = t; + return this; + } + CreateTeamVariablesBuilder departments(AnyValue? t) { + _departments.value = t; + return this; + } + CreateTeamVariablesBuilder favoriteStaffCount(int? t) { + _favoriteStaffCount.value = t; + return this; + } + CreateTeamVariablesBuilder blockedStaffCount(int? t) { + _blockedStaffCount.value = t; + return this; + } + CreateTeamVariablesBuilder favoriteStaff(AnyValue? t) { + _favoriteStaff.value = t; + return this; + } + CreateTeamVariablesBuilder blockedStaff(AnyValue? t) { + _blockedStaff.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createTeam( + teamName: teamName, + ownerId: ownerId, + ownerName: ownerName, + ownerRole: ownerRole, +) +.email(email) +.companyLogo(companyLogo) +.totalMembers(totalMembers) +.activeMembers(activeMembers) +.totalHubs(totalHubs) +.departments(departments) +.favoriteStaffCount(favoriteStaffCount) +.blockedStaffCount(blockedStaffCount) +.favoriteStaff(favoriteStaff) +.blockedStaff(blockedStaff) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createTeam( + teamName: teamName, + ownerId: ownerId, + ownerName: ownerName, + ownerRole: ownerRole, +); +createTeamData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String teamName = ...; +String ownerId = ...; +String ownerName = ...; +String ownerRole = ...; + +final ref = ExampleConnector.instance.createTeam( + teamName: teamName, + ownerId: ownerId, + ownerName: ownerName, + ownerRole: ownerRole, +).ref(); +ref.execute(); +``` + + +### updateTeam +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateTeam( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateTeam, we created `updateTeamBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateTeamVariablesBuilder { + ... + UpdateTeamVariablesBuilder teamName(String? t) { + _teamName.value = t; + return this; + } + UpdateTeamVariablesBuilder ownerName(String? t) { + _ownerName.value = t; + return this; + } + UpdateTeamVariablesBuilder ownerRole(String? t) { + _ownerRole.value = t; + return this; + } + UpdateTeamVariablesBuilder companyLogo(String? t) { + _companyLogo.value = t; + return this; + } + UpdateTeamVariablesBuilder totalMembers(int? t) { + _totalMembers.value = t; + return this; + } + UpdateTeamVariablesBuilder activeMembers(int? t) { + _activeMembers.value = t; + return this; + } + UpdateTeamVariablesBuilder totalHubs(int? t) { + _totalHubs.value = t; + return this; + } + UpdateTeamVariablesBuilder departments(AnyValue? t) { + _departments.value = t; + return this; + } + UpdateTeamVariablesBuilder favoriteStaffCount(int? t) { + _favoriteStaffCount.value = t; + return this; + } + UpdateTeamVariablesBuilder blockedStaffCount(int? t) { + _blockedStaffCount.value = t; + return this; + } + UpdateTeamVariablesBuilder favoriteStaff(AnyValue? t) { + _favoriteStaff.value = t; + return this; + } + UpdateTeamVariablesBuilder blockedStaff(AnyValue? t) { + _blockedStaff.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateTeam( + id: id, +) +.teamName(teamName) +.ownerName(ownerName) +.ownerRole(ownerRole) +.companyLogo(companyLogo) +.totalMembers(totalMembers) +.activeMembers(activeMembers) +.totalHubs(totalHubs) +.departments(departments) +.favoriteStaffCount(favoriteStaffCount) +.blockedStaffCount(blockedStaffCount) +.favoriteStaff(favoriteStaff) +.blockedStaff(blockedStaff) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateTeam( + id: id, +); +updateTeamData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateTeam( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteTeam +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteTeam( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteTeam( + id: id, +); +deleteTeamData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteTeam( + id: id, +).ref(); +ref.execute(); +``` + + +### createTeamHub +#### Required Arguments +```dart +String teamId = ...; +String hubName = ...; +String address = ...; +ExampleConnector.instance.createTeamHub( + teamId: teamId, + hubName: hubName, + address: address, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createTeamHub, we created `createTeamHubBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateTeamHubVariablesBuilder { + ... + CreateTeamHubVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + CreateTeamHubVariablesBuilder state(String? t) { + _state.value = t; + return this; + } + CreateTeamHubVariablesBuilder zipCode(String? t) { + _zipCode.value = t; + return this; + } + CreateTeamHubVariablesBuilder managerName(String? t) { + _managerName.value = t; + return this; + } + CreateTeamHubVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + CreateTeamHubVariablesBuilder departments(AnyValue? t) { + _departments.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createTeamHub( + teamId: teamId, + hubName: hubName, + address: address, +) +.city(city) +.state(state) +.zipCode(zipCode) +.managerName(managerName) +.isActive(isActive) +.departments(departments) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createTeamHub( + teamId: teamId, + hubName: hubName, + address: address, +); +createTeamHubData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String teamId = ...; +String hubName = ...; +String address = ...; + +final ref = ExampleConnector.instance.createTeamHub( + teamId: teamId, + hubName: hubName, + address: address, +).ref(); +ref.execute(); +``` + + +### updateTeamHub +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateTeamHub( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateTeamHub, we created `updateTeamHubBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateTeamHubVariablesBuilder { + ... + UpdateTeamHubVariablesBuilder hubName(String? t) { + _hubName.value = t; + return this; + } + UpdateTeamHubVariablesBuilder address(String? t) { + _address.value = t; + return this; + } + UpdateTeamHubVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + UpdateTeamHubVariablesBuilder state(String? t) { + _state.value = t; + return this; + } + UpdateTeamHubVariablesBuilder zipCode(String? t) { + _zipCode.value = t; + return this; + } + UpdateTeamHubVariablesBuilder managerName(String? t) { + _managerName.value = t; + return this; + } + UpdateTeamHubVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + UpdateTeamHubVariablesBuilder departments(AnyValue? t) { + _departments.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateTeamHub( + id: id, +) +.hubName(hubName) +.address(address) +.city(city) +.state(state) +.zipCode(zipCode) +.managerName(managerName) +.isActive(isActive) +.departments(departments) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateTeamHub( + id: id, +); +updateTeamHubData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateTeamHub( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteTeamHub +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteTeamHub( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteTeamHub( + id: id, +); +deleteTeamHubData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteTeamHub( + id: id, +).ref(); +ref.execute(); +``` + + +### createApplication +#### Required Arguments +```dart +String shiftId = ...; +String staffId = ...; +ApplicationStatus status = ...; +ApplicationOrigin origin = ...; +String roleId = ...; +ExampleConnector.instance.createApplication( + shiftId: shiftId, + staffId: staffId, + status: status, + origin: origin, + roleId: roleId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createApplication, we created `createApplicationBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateApplicationVariablesBuilder { + ... + CreateApplicationVariablesBuilder checkInTime(Timestamp? t) { + _checkInTime.value = t; + return this; + } + CreateApplicationVariablesBuilder checkOutTime(Timestamp? t) { + _checkOutTime.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createApplication( + shiftId: shiftId, + staffId: staffId, + status: status, + origin: origin, + roleId: roleId, +) +.checkInTime(checkInTime) +.checkOutTime(checkOutTime) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createApplication( + shiftId: shiftId, + staffId: staffId, + status: status, + origin: origin, + roleId: roleId, +); +createApplicationData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftId = ...; +String staffId = ...; +ApplicationStatus status = ...; +ApplicationOrigin origin = ...; +String roleId = ...; + +final ref = ExampleConnector.instance.createApplication( + shiftId: shiftId, + staffId: staffId, + status: status, + origin: origin, + roleId: roleId, +).ref(); +ref.execute(); +``` + + +### updateApplicationStatus +#### Required Arguments +```dart +String id = ...; +String roleId = ...; +ExampleConnector.instance.updateApplicationStatus( + id: id, + roleId: roleId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateApplicationStatus, we created `updateApplicationStatusBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateApplicationStatusVariablesBuilder { + ... + UpdateApplicationStatusVariablesBuilder shiftId(String? t) { + _shiftId.value = t; + return this; + } + UpdateApplicationStatusVariablesBuilder staffId(String? t) { + _staffId.value = t; + return this; + } + UpdateApplicationStatusVariablesBuilder status(ApplicationStatus? t) { + _status.value = t; + return this; + } + UpdateApplicationStatusVariablesBuilder checkInTime(Timestamp? t) { + _checkInTime.value = t; + return this; + } + UpdateApplicationStatusVariablesBuilder checkOutTime(Timestamp? t) { + _checkOutTime.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateApplicationStatus( + id: id, + roleId: roleId, +) +.shiftId(shiftId) +.staffId(staffId) +.status(status) +.checkInTime(checkInTime) +.checkOutTime(checkOutTime) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateApplicationStatus( + id: id, + roleId: roleId, +); +updateApplicationStatusData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; +String roleId = ...; + +final ref = ExampleConnector.instance.updateApplicationStatus( + id: id, + roleId: roleId, +).ref(); +ref.execute(); +``` + + +### deleteApplication +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteApplication( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteApplication( + id: id, +); +deleteApplicationData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteApplication( + id: id, +).ref(); +ref.execute(); +``` + + +### createShift +#### Required Arguments +```dart +String title = ...; +String orderId = ...; +ExampleConnector.instance.createShift( + title: title, + orderId: orderId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createShift, we created `createShiftBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateShiftVariablesBuilder { + ... + CreateShiftVariablesBuilder date(Timestamp? t) { + _date.value = t; + return this; + } + CreateShiftVariablesBuilder startTime(Timestamp? t) { + _startTime.value = t; + return this; + } + CreateShiftVariablesBuilder endTime(Timestamp? t) { + _endTime.value = t; + return this; + } + CreateShiftVariablesBuilder hours(double? t) { + _hours.value = t; + return this; + } + CreateShiftVariablesBuilder cost(double? t) { + _cost.value = t; + return this; + } + CreateShiftVariablesBuilder location(String? t) { + _location.value = t; + return this; + } + CreateShiftVariablesBuilder locationAddress(String? t) { + _locationAddress.value = t; + return this; + } + CreateShiftVariablesBuilder latitude(double? t) { + _latitude.value = t; + return this; + } + CreateShiftVariablesBuilder longitude(double? t) { + _longitude.value = t; + return this; + } + CreateShiftVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + CreateShiftVariablesBuilder status(ShiftStatus? t) { + _status.value = t; + return this; + } + CreateShiftVariablesBuilder workersNeeded(int? t) { + _workersNeeded.value = t; + return this; + } + CreateShiftVariablesBuilder filled(int? t) { + _filled.value = t; + return this; + } + CreateShiftVariablesBuilder filledAt(Timestamp? t) { + _filledAt.value = t; + return this; + } + CreateShiftVariablesBuilder managers(List? t) { + _managers.value = t; + return this; + } + CreateShiftVariablesBuilder durationDays(int? t) { + _durationDays.value = t; + return this; + } + CreateShiftVariablesBuilder createdBy(String? t) { + _createdBy.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createShift( + title: title, + orderId: orderId, +) +.date(date) +.startTime(startTime) +.endTime(endTime) +.hours(hours) +.cost(cost) +.location(location) +.locationAddress(locationAddress) +.latitude(latitude) +.longitude(longitude) +.description(description) +.status(status) +.workersNeeded(workersNeeded) +.filled(filled) +.filledAt(filledAt) +.managers(managers) +.durationDays(durationDays) +.createdBy(createdBy) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createShift( + title: title, + orderId: orderId, +); +createShiftData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String title = ...; +String orderId = ...; + +final ref = ExampleConnector.instance.createShift( + title: title, + orderId: orderId, +).ref(); +ref.execute(); +``` + + +### updateShift +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateShift( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateShift, we created `updateShiftBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateShiftVariablesBuilder { + ... + UpdateShiftVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + UpdateShiftVariablesBuilder orderId(String? t) { + _orderId.value = t; + return this; + } + UpdateShiftVariablesBuilder date(Timestamp? t) { + _date.value = t; + return this; + } + UpdateShiftVariablesBuilder startTime(Timestamp? t) { + _startTime.value = t; + return this; + } + UpdateShiftVariablesBuilder endTime(Timestamp? t) { + _endTime.value = t; + return this; + } + UpdateShiftVariablesBuilder hours(double? t) { + _hours.value = t; + return this; + } + UpdateShiftVariablesBuilder cost(double? t) { + _cost.value = t; + return this; + } + UpdateShiftVariablesBuilder location(String? t) { + _location.value = t; + return this; + } + UpdateShiftVariablesBuilder locationAddress(String? t) { + _locationAddress.value = t; + return this; + } + UpdateShiftVariablesBuilder latitude(double? t) { + _latitude.value = t; + return this; + } + UpdateShiftVariablesBuilder longitude(double? t) { + _longitude.value = t; + return this; + } + UpdateShiftVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + UpdateShiftVariablesBuilder status(ShiftStatus? t) { + _status.value = t; + return this; + } + UpdateShiftVariablesBuilder workersNeeded(int? t) { + _workersNeeded.value = t; + return this; + } + UpdateShiftVariablesBuilder filled(int? t) { + _filled.value = t; + return this; + } + UpdateShiftVariablesBuilder filledAt(Timestamp? t) { + _filledAt.value = t; + return this; + } + UpdateShiftVariablesBuilder managers(List? t) { + _managers.value = t; + return this; + } + UpdateShiftVariablesBuilder durationDays(int? t) { + _durationDays.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateShift( + id: id, +) +.title(title) +.orderId(orderId) +.date(date) +.startTime(startTime) +.endTime(endTime) +.hours(hours) +.cost(cost) +.location(location) +.locationAddress(locationAddress) +.latitude(latitude) +.longitude(longitude) +.description(description) +.status(status) +.workersNeeded(workersNeeded) +.filled(filled) +.filledAt(filledAt) +.managers(managers) +.durationDays(durationDays) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateShift( + id: id, +); +updateShiftData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateShift( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteShift +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteShift( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteShift( + id: id, +); +deleteShiftData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteShift( + id: id, +).ref(); +ref.execute(); +``` + + +### createUserConversation +#### Required Arguments +```dart +String conversationId = ...; +String userId = ...; +ExampleConnector.instance.createUserConversation( + conversationId: conversationId, + userId: userId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createUserConversation, we created `createUserConversationBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateUserConversationVariablesBuilder { + ... + CreateUserConversationVariablesBuilder unreadCount(int? t) { + _unreadCount.value = t; + return this; + } + CreateUserConversationVariablesBuilder lastReadAt(Timestamp? t) { + _lastReadAt.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createUserConversation( + conversationId: conversationId, + userId: userId, +) +.unreadCount(unreadCount) +.lastReadAt(lastReadAt) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createUserConversation( + conversationId: conversationId, + userId: userId, +); +createUserConversationData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String conversationId = ...; +String userId = ...; + +final ref = ExampleConnector.instance.createUserConversation( + conversationId: conversationId, + userId: userId, +).ref(); +ref.execute(); +``` + + +### updateUserConversation +#### Required Arguments +```dart +String conversationId = ...; +String userId = ...; +ExampleConnector.instance.updateUserConversation( + conversationId: conversationId, + userId: userId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateUserConversation, we created `updateUserConversationBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateUserConversationVariablesBuilder { + ... + UpdateUserConversationVariablesBuilder unreadCount(int? t) { + _unreadCount.value = t; + return this; + } + UpdateUserConversationVariablesBuilder lastReadAt(Timestamp? t) { + _lastReadAt.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateUserConversation( + conversationId: conversationId, + userId: userId, +) +.unreadCount(unreadCount) +.lastReadAt(lastReadAt) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateUserConversation( + conversationId: conversationId, + userId: userId, +); +updateUserConversationData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String conversationId = ...; +String userId = ...; + +final ref = ExampleConnector.instance.updateUserConversation( + conversationId: conversationId, + userId: userId, +).ref(); +ref.execute(); +``` + + +### markConversationAsRead +#### Required Arguments +```dart +String conversationId = ...; +String userId = ...; +ExampleConnector.instance.markConversationAsRead( + conversationId: conversationId, + userId: userId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For markConversationAsRead, we created `markConversationAsReadBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class MarkConversationAsReadVariablesBuilder { + ... + MarkConversationAsReadVariablesBuilder lastReadAt(Timestamp? t) { + _lastReadAt.value = t; + return this; + } + + ... +} +ExampleConnector.instance.markConversationAsRead( + conversationId: conversationId, + userId: userId, +) +.lastReadAt(lastReadAt) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.markConversationAsRead( + conversationId: conversationId, + userId: userId, +); +markConversationAsReadData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String conversationId = ...; +String userId = ...; + +final ref = ExampleConnector.instance.markConversationAsRead( + conversationId: conversationId, + userId: userId, +).ref(); +ref.execute(); +``` + + +### incrementUnreadForUser +#### Required Arguments +```dart +String conversationId = ...; +String userId = ...; +int unreadCount = ...; +ExampleConnector.instance.incrementUnreadForUser( + conversationId: conversationId, + userId: userId, + unreadCount: unreadCount, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.incrementUnreadForUser( + conversationId: conversationId, + userId: userId, + unreadCount: unreadCount, +); +incrementUnreadForUserData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String conversationId = ...; +String userId = ...; +int unreadCount = ...; + +final ref = ExampleConnector.instance.incrementUnreadForUser( + conversationId: conversationId, + userId: userId, + unreadCount: unreadCount, +).ref(); +ref.execute(); +``` + + +### deleteUserConversation +#### Required Arguments +```dart +String conversationId = ...; +String userId = ...; +ExampleConnector.instance.deleteUserConversation( + conversationId: conversationId, + userId: userId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteUserConversation( + conversationId: conversationId, + userId: userId, +); +deleteUserConversationData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String conversationId = ...; +String userId = ...; + +final ref = ExampleConnector.instance.deleteUserConversation( + conversationId: conversationId, + userId: userId, +).ref(); +ref.execute(); +``` + + +### CreateUser +#### Required Arguments +```dart +String id = ...; +UserBaseRole role = ...; +ExampleConnector.instance.createUser( + id: id, + role: role, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For CreateUser, we created `CreateUserBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateUserVariablesBuilder { + ... + CreateUserVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + CreateUserVariablesBuilder fullName(String? t) { + _fullName.value = t; + return this; + } + CreateUserVariablesBuilder userRole(String? t) { + _userRole.value = t; + return this; + } + CreateUserVariablesBuilder photoUrl(String? t) { + _photoUrl.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createUser( + id: id, + role: role, +) +.email(email) +.fullName(fullName) +.userRole(userRole) +.photoUrl(photoUrl) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createUser( + id: id, + role: role, +); +CreateUserData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; +UserBaseRole role = ...; + +final ref = ExampleConnector.instance.createUser( + id: id, + role: role, +).ref(); +ref.execute(); +``` + + +### UpdateUser +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateUser( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For UpdateUser, we created `UpdateUserBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateUserVariablesBuilder { + ... + UpdateUserVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + UpdateUserVariablesBuilder fullName(String? t) { + _fullName.value = t; + return this; + } + UpdateUserVariablesBuilder role(UserBaseRole? t) { + _role.value = t; + return this; + } + UpdateUserVariablesBuilder userRole(String? t) { + _userRole.value = t; + return this; + } + UpdateUserVariablesBuilder photoUrl(String? t) { + _photoUrl.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateUser( + id: id, +) +.email(email) +.fullName(fullName) +.role(role) +.userRole(userRole) +.photoUrl(photoUrl) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateUser( + id: id, +); +UpdateUserData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateUser( + id: id, +).ref(); +ref.execute(); +``` + + +### DeleteUser +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteUser( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteUser( + id: id, +); +DeleteUserData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteUser( + id: id, +).ref(); +ref.execute(); +``` + + +### createClientFeedback +#### Required Arguments +```dart +String businessId = ...; +String vendorId = ...; +ExampleConnector.instance.createClientFeedback( + businessId: businessId, + vendorId: vendorId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createClientFeedback, we created `createClientFeedbackBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateClientFeedbackVariablesBuilder { + ... + CreateClientFeedbackVariablesBuilder rating(int? t) { + _rating.value = t; + return this; + } + CreateClientFeedbackVariablesBuilder comment(String? t) { + _comment.value = t; + return this; + } + CreateClientFeedbackVariablesBuilder date(Timestamp? t) { + _date.value = t; + return this; + } + CreateClientFeedbackVariablesBuilder createdBy(String? t) { + _createdBy.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createClientFeedback( + businessId: businessId, + vendorId: vendorId, +) +.rating(rating) +.comment(comment) +.date(date) +.createdBy(createdBy) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createClientFeedback( + businessId: businessId, + vendorId: vendorId, +); +createClientFeedbackData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; +String vendorId = ...; + +final ref = ExampleConnector.instance.createClientFeedback( + businessId: businessId, + vendorId: vendorId, +).ref(); +ref.execute(); +``` + + +### updateClientFeedback +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateClientFeedback( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateClientFeedback, we created `updateClientFeedbackBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateClientFeedbackVariablesBuilder { + ... + UpdateClientFeedbackVariablesBuilder businessId(String? t) { + _businessId.value = t; + return this; + } + UpdateClientFeedbackVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + UpdateClientFeedbackVariablesBuilder rating(int? t) { + _rating.value = t; + return this; + } + UpdateClientFeedbackVariablesBuilder comment(String? t) { + _comment.value = t; + return this; + } + UpdateClientFeedbackVariablesBuilder date(Timestamp? t) { + _date.value = t; + return this; + } + UpdateClientFeedbackVariablesBuilder createdBy(String? t) { + _createdBy.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateClientFeedback( + id: id, +) +.businessId(businessId) +.vendorId(vendorId) +.rating(rating) +.comment(comment) +.date(date) +.createdBy(createdBy) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateClientFeedback( + id: id, +); +updateClientFeedbackData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateClientFeedback( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteClientFeedback +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteClientFeedback( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteClientFeedback( + id: id, +); +deleteClientFeedbackData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteClientFeedback( + id: id, +).ref(); +ref.execute(); +``` + + +### createStaffAvailability +#### Required Arguments +```dart +String staffId = ...; +DayOfWeek day = ...; +AvailabilitySlot slot = ...; +ExampleConnector.instance.createStaffAvailability( + staffId: staffId, + day: day, + slot: slot, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createStaffAvailability, we created `createStaffAvailabilityBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateStaffAvailabilityVariablesBuilder { + ... + CreateStaffAvailabilityVariablesBuilder status(AvailabilityStatus? t) { + _status.value = t; + return this; + } + CreateStaffAvailabilityVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createStaffAvailability( + staffId: staffId, + day: day, + slot: slot, +) +.status(status) +.notes(notes) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createStaffAvailability( + staffId: staffId, + day: day, + slot: slot, +); +createStaffAvailabilityData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +DayOfWeek day = ...; +AvailabilitySlot slot = ...; + +final ref = ExampleConnector.instance.createStaffAvailability( + staffId: staffId, + day: day, + slot: slot, +).ref(); +ref.execute(); +``` + + +### updateStaffAvailability +#### Required Arguments +```dart +String staffId = ...; +DayOfWeek day = ...; +AvailabilitySlot slot = ...; +ExampleConnector.instance.updateStaffAvailability( + staffId: staffId, + day: day, + slot: slot, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateStaffAvailability, we created `updateStaffAvailabilityBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateStaffAvailabilityVariablesBuilder { + ... + UpdateStaffAvailabilityVariablesBuilder status(AvailabilityStatus? t) { + _status.value = t; + return this; + } + UpdateStaffAvailabilityVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateStaffAvailability( + staffId: staffId, + day: day, + slot: slot, +) +.status(status) +.notes(notes) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateStaffAvailability( + staffId: staffId, + day: day, + slot: slot, +); +updateStaffAvailabilityData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +DayOfWeek day = ...; +AvailabilitySlot slot = ...; + +final ref = ExampleConnector.instance.updateStaffAvailability( + staffId: staffId, + day: day, + slot: slot, +).ref(); +ref.execute(); +``` + + +### deleteStaffAvailability +#### Required Arguments +```dart +String staffId = ...; +DayOfWeek day = ...; +AvailabilitySlot slot = ...; +ExampleConnector.instance.deleteStaffAvailability( + staffId: staffId, + day: day, + slot: slot, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteStaffAvailability( + staffId: staffId, + day: day, + slot: slot, +); +deleteStaffAvailabilityData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +DayOfWeek day = ...; +AvailabilitySlot slot = ...; + +final ref = ExampleConnector.instance.deleteStaffAvailability( + staffId: staffId, + day: day, + slot: slot, +).ref(); +ref.execute(); +``` + + +### createConversation +#### Required Arguments +```dart +// No required arguments +ExampleConnector.instance.createConversation().execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createConversation, we created `createConversationBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateConversationVariablesBuilder { + ... + + CreateConversationVariablesBuilder subject(String? t) { + _subject.value = t; + return this; + } + CreateConversationVariablesBuilder status(ConversationStatus? t) { + _status.value = t; + return this; + } + CreateConversationVariablesBuilder conversationType(ConversationType? t) { + _conversationType.value = t; + return this; + } + CreateConversationVariablesBuilder isGroup(bool? t) { + _isGroup.value = t; + return this; + } + CreateConversationVariablesBuilder groupName(String? t) { + _groupName.value = t; + return this; + } + CreateConversationVariablesBuilder lastMessage(String? t) { + _lastMessage.value = t; + return this; + } + CreateConversationVariablesBuilder lastMessageAt(Timestamp? t) { + _lastMessageAt.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createConversation() +.subject(subject) +.status(status) +.conversationType(conversationType) +.isGroup(isGroup) +.groupName(groupName) +.lastMessage(lastMessage) +.lastMessageAt(lastMessageAt) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createConversation(); +createConversationData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +final ref = ExampleConnector.instance.createConversation().ref(); +ref.execute(); +``` + + +### updateConversation +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateConversation( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateConversation, we created `updateConversationBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateConversationVariablesBuilder { + ... + UpdateConversationVariablesBuilder subject(String? t) { + _subject.value = t; + return this; + } + UpdateConversationVariablesBuilder status(ConversationStatus? t) { + _status.value = t; + return this; + } + UpdateConversationVariablesBuilder conversationType(ConversationType? t) { + _conversationType.value = t; + return this; + } + UpdateConversationVariablesBuilder isGroup(bool? t) { + _isGroup.value = t; + return this; + } + UpdateConversationVariablesBuilder groupName(String? t) { + _groupName.value = t; + return this; + } + UpdateConversationVariablesBuilder lastMessage(String? t) { + _lastMessage.value = t; + return this; + } + UpdateConversationVariablesBuilder lastMessageAt(Timestamp? t) { + _lastMessageAt.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateConversation( + id: id, +) +.subject(subject) +.status(status) +.conversationType(conversationType) +.isGroup(isGroup) +.groupName(groupName) +.lastMessage(lastMessage) +.lastMessageAt(lastMessageAt) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateConversation( + id: id, +); +updateConversationData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateConversation( + id: id, +).ref(); +ref.execute(); +``` + + +### updateConversationLastMessage +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateConversationLastMessage( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateConversationLastMessage, we created `updateConversationLastMessageBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateConversationLastMessageVariablesBuilder { + ... + UpdateConversationLastMessageVariablesBuilder lastMessage(String? t) { + _lastMessage.value = t; + return this; + } + UpdateConversationLastMessageVariablesBuilder lastMessageAt(Timestamp? t) { + _lastMessageAt.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateConversationLastMessage( + id: id, +) +.lastMessage(lastMessage) +.lastMessageAt(lastMessageAt) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateConversationLastMessage( + id: id, +); +updateConversationLastMessageData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateConversationLastMessage( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteConversation +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteConversation( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteConversation( + id: id, +); +deleteConversationData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteConversation( + id: id, +).ref(); +ref.execute(); +``` + + +### createTaxForm +#### Required Arguments +```dart +TaxFormType formType = ...; +String title = ...; +String staffId = ...; +ExampleConnector.instance.createTaxForm( + formType: formType, + title: title, + staffId: staffId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createTaxForm, we created `createTaxFormBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateTaxFormVariablesBuilder { + ... + CreateTaxFormVariablesBuilder subtitle(String? t) { + _subtitle.value = t; + return this; + } + CreateTaxFormVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + CreateTaxFormVariablesBuilder status(TaxFormStatus? t) { + _status.value = t; + return this; + } + CreateTaxFormVariablesBuilder formData(AnyValue? t) { + _formData.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createTaxForm( + formType: formType, + title: title, + staffId: staffId, +) +.subtitle(subtitle) +.description(description) +.status(status) +.formData(formData) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createTaxForm( + formType: formType, + title: title, + staffId: staffId, +); +createTaxFormData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +TaxFormType formType = ...; +String title = ...; +String staffId = ...; + +final ref = ExampleConnector.instance.createTaxForm( + formType: formType, + title: title, + staffId: staffId, +).ref(); +ref.execute(); +``` + + +### updateTaxForm +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateTaxForm( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateTaxForm, we created `updateTaxFormBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateTaxFormVariablesBuilder { + ... + UpdateTaxFormVariablesBuilder status(TaxFormStatus? t) { + _status.value = t; + return this; + } + UpdateTaxFormVariablesBuilder formData(AnyValue? t) { + _formData.value = t; + return this; + } + UpdateTaxFormVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + UpdateTaxFormVariablesBuilder subtitle(String? t) { + _subtitle.value = t; + return this; + } + UpdateTaxFormVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateTaxForm( + id: id, +) +.status(status) +.formData(formData) +.title(title) +.subtitle(subtitle) +.description(description) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateTaxForm( + id: id, +); +updateTaxFormData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateTaxForm( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteTaxForm +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteTaxForm( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteTaxForm( + id: id, +); +deleteTaxFormData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteTaxForm( + id: id, +).ref(); +ref.execute(); +``` + + +### createTeamHudDepartment +#### Required Arguments +```dart +String name = ...; +String teamHubId = ...; +ExampleConnector.instance.createTeamHudDepartment( + name: name, + teamHubId: teamHubId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createTeamHudDepartment, we created `createTeamHudDepartmentBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateTeamHudDepartmentVariablesBuilder { + ... + CreateTeamHudDepartmentVariablesBuilder costCenter(String? t) { + _costCenter.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createTeamHudDepartment( + name: name, + teamHubId: teamHubId, +) +.costCenter(costCenter) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createTeamHudDepartment( + name: name, + teamHubId: teamHubId, +); +createTeamHudDepartmentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String name = ...; +String teamHubId = ...; + +final ref = ExampleConnector.instance.createTeamHudDepartment( + name: name, + teamHubId: teamHubId, +).ref(); +ref.execute(); +``` + + +### updateTeamHudDepartment +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateTeamHudDepartment( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateTeamHudDepartment, we created `updateTeamHudDepartmentBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateTeamHudDepartmentVariablesBuilder { + ... + UpdateTeamHudDepartmentVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateTeamHudDepartmentVariablesBuilder costCenter(String? t) { + _costCenter.value = t; + return this; + } + UpdateTeamHudDepartmentVariablesBuilder teamHubId(String? t) { + _teamHubId.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateTeamHudDepartment( + id: id, +) +.name(name) +.costCenter(costCenter) +.teamHubId(teamHubId) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateTeamHudDepartment( + id: id, +); +updateTeamHudDepartmentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateTeamHudDepartment( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteTeamHudDepartment +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteTeamHudDepartment( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteTeamHudDepartment( + id: id, +); +deleteTeamHudDepartmentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteTeamHudDepartment( + id: id, +).ref(); +ref.execute(); +``` + + +### createBusiness +#### Required Arguments +```dart +String businessName = ...; +String userId = ...; +BusinessRateGroup rateGroup = ...; +BusinessStatus status = ...; +ExampleConnector.instance.createBusiness( + businessName: businessName, + userId: userId, + rateGroup: rateGroup, + status: status, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createBusiness, we created `createBusinessBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateBusinessVariablesBuilder { + ... + CreateBusinessVariablesBuilder contactName(String? t) { + _contactName.value = t; + return this; + } + CreateBusinessVariablesBuilder companyLogoUrl(String? t) { + _companyLogoUrl.value = t; + return this; + } + CreateBusinessVariablesBuilder phone(String? t) { + _phone.value = t; + return this; + } + CreateBusinessVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + CreateBusinessVariablesBuilder hubBuilding(String? t) { + _hubBuilding.value = t; + return this; + } + CreateBusinessVariablesBuilder address(String? t) { + _address.value = t; + return this; + } + CreateBusinessVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + CreateBusinessVariablesBuilder area(BusinessArea? t) { + _area.value = t; + return this; + } + CreateBusinessVariablesBuilder sector(BusinessSector? t) { + _sector.value = t; + return this; + } + CreateBusinessVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createBusiness( + businessName: businessName, + userId: userId, + rateGroup: rateGroup, + status: status, +) +.contactName(contactName) +.companyLogoUrl(companyLogoUrl) +.phone(phone) +.email(email) +.hubBuilding(hubBuilding) +.address(address) +.city(city) +.area(area) +.sector(sector) +.notes(notes) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createBusiness( + businessName: businessName, + userId: userId, + rateGroup: rateGroup, + status: status, +); +createBusinessData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessName = ...; +String userId = ...; +BusinessRateGroup rateGroup = ...; +BusinessStatus status = ...; + +final ref = ExampleConnector.instance.createBusiness( + businessName: businessName, + userId: userId, + rateGroup: rateGroup, + status: status, +).ref(); +ref.execute(); +``` + + +### updateBusiness +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateBusiness( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateBusiness, we created `updateBusinessBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateBusinessVariablesBuilder { + ... + UpdateBusinessVariablesBuilder businessName(String? t) { + _businessName.value = t; + return this; + } + UpdateBusinessVariablesBuilder contactName(String? t) { + _contactName.value = t; + return this; + } + UpdateBusinessVariablesBuilder companyLogoUrl(String? t) { + _companyLogoUrl.value = t; + return this; + } + UpdateBusinessVariablesBuilder phone(String? t) { + _phone.value = t; + return this; + } + UpdateBusinessVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + UpdateBusinessVariablesBuilder hubBuilding(String? t) { + _hubBuilding.value = t; + return this; + } + UpdateBusinessVariablesBuilder address(String? t) { + _address.value = t; + return this; + } + UpdateBusinessVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + UpdateBusinessVariablesBuilder area(BusinessArea? t) { + _area.value = t; + return this; + } + UpdateBusinessVariablesBuilder sector(BusinessSector? t) { + _sector.value = t; + return this; + } + UpdateBusinessVariablesBuilder rateGroup(BusinessRateGroup? t) { + _rateGroup.value = t; + return this; + } + UpdateBusinessVariablesBuilder status(BusinessStatus? t) { + _status.value = t; + return this; + } + UpdateBusinessVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateBusiness( + id: id, +) +.businessName(businessName) +.contactName(contactName) +.companyLogoUrl(companyLogoUrl) +.phone(phone) +.email(email) +.hubBuilding(hubBuilding) +.address(address) +.city(city) +.area(area) +.sector(sector) +.rateGroup(rateGroup) +.status(status) +.notes(notes) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateBusiness( + id: id, +); +updateBusinessData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateBusiness( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteBusiness +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteBusiness( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteBusiness( + id: id, +); +deleteBusinessData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteBusiness( + id: id, +).ref(); +ref.execute(); +``` + + +### createRole +#### Required Arguments +```dart +String name = ...; +double costPerHour = ...; +String vendorId = ...; +String roleCategoryId = ...; +ExampleConnector.instance.createRole( + name: name, + costPerHour: costPerHour, + vendorId: vendorId, + roleCategoryId: roleCategoryId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createRole( + name: name, + costPerHour: costPerHour, + vendorId: vendorId, + roleCategoryId: roleCategoryId, +); +createRoleData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String name = ...; +double costPerHour = ...; +String vendorId = ...; +String roleCategoryId = ...; + +final ref = ExampleConnector.instance.createRole( + name: name, + costPerHour: costPerHour, + vendorId: vendorId, + roleCategoryId: roleCategoryId, +).ref(); +ref.execute(); +``` + + +### updateRole +#### Required Arguments +```dart +String id = ...; +String roleCategoryId = ...; +ExampleConnector.instance.updateRole( + id: id, + roleCategoryId: roleCategoryId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateRole, we created `updateRoleBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateRoleVariablesBuilder { + ... + UpdateRoleVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateRoleVariablesBuilder costPerHour(double? t) { + _costPerHour.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateRole( + id: id, + roleCategoryId: roleCategoryId, +) +.name(name) +.costPerHour(costPerHour) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateRole( + id: id, + roleCategoryId: roleCategoryId, +); +updateRoleData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; +String roleCategoryId = ...; + +final ref = ExampleConnector.instance.updateRole( + id: id, + roleCategoryId: roleCategoryId, +).ref(); +ref.execute(); +``` + + +### deleteRole +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteRole( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteRole( + id: id, +); +deleteRoleData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteRole( + id: id, +).ref(); +ref.execute(); +``` + + +### createEmergencyContact +#### Required Arguments +```dart +String name = ...; +String phone = ...; +RelationshipType relationship = ...; +String staffId = ...; +ExampleConnector.instance.createEmergencyContact( + name: name, + phone: phone, + relationship: relationship, + staffId: staffId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createEmergencyContact( + name: name, + phone: phone, + relationship: relationship, + staffId: staffId, +); +createEmergencyContactData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String name = ...; +String phone = ...; +RelationshipType relationship = ...; +String staffId = ...; + +final ref = ExampleConnector.instance.createEmergencyContact( + name: name, + phone: phone, + relationship: relationship, + staffId: staffId, +).ref(); +ref.execute(); +``` + + +### updateEmergencyContact +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateEmergencyContact( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateEmergencyContact, we created `updateEmergencyContactBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateEmergencyContactVariablesBuilder { + ... + UpdateEmergencyContactVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateEmergencyContactVariablesBuilder phone(String? t) { + _phone.value = t; + return this; + } + UpdateEmergencyContactVariablesBuilder relationship(RelationshipType? t) { + _relationship.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateEmergencyContact( + id: id, +) +.name(name) +.phone(phone) +.relationship(relationship) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateEmergencyContact( + id: id, +); +updateEmergencyContactData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateEmergencyContact( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteEmergencyContact +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteEmergencyContact( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteEmergencyContact( + id: id, +); +deleteEmergencyContactData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteEmergencyContact( + id: id, +).ref(); +ref.execute(); +``` + + +### createOrder +#### Required Arguments +```dart +String businessId = ...; +OrderType orderType = ...; +ExampleConnector.instance.createOrder( + businessId: businessId, + orderType: orderType, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createOrder, we created `createOrderBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateOrderVariablesBuilder { + ... + + CreateOrderVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + CreateOrderVariablesBuilder location(String? t) { + _location.value = t; + return this; + } + CreateOrderVariablesBuilder status(OrderStatus? t) { + _status.value = t; + return this; + } + CreateOrderVariablesBuilder date(Timestamp? t) { + _date.value = t; + return this; + } + CreateOrderVariablesBuilder startDate(Timestamp? t) { + _startDate.value = t; + return this; + } + CreateOrderVariablesBuilder endDate(Timestamp? t) { + _endDate.value = t; + return this; + } + CreateOrderVariablesBuilder duration(OrderDuration? t) { + _duration.value = t; + return this; + } + CreateOrderVariablesBuilder lunchBreak(int? t) { + _lunchBreak.value = t; + return this; + } + CreateOrderVariablesBuilder total(double? t) { + _total.value = t; + return this; + } + CreateOrderVariablesBuilder eventName(String? t) { + _eventName.value = t; + return this; + } + CreateOrderVariablesBuilder assignedStaff(AnyValue? t) { + _assignedStaff.value = t; + return this; + } + CreateOrderVariablesBuilder shifts(AnyValue? t) { + _shifts.value = t; + return this; + } + CreateOrderVariablesBuilder requested(int? t) { + _requested.value = t; + return this; + } + CreateOrderVariablesBuilder hub(String? t) { + _hub.value = t; + return this; + } + CreateOrderVariablesBuilder recurringDays(AnyValue? t) { + _recurringDays.value = t; + return this; + } + CreateOrderVariablesBuilder permanentStartDate(Timestamp? t) { + _permanentStartDate.value = t; + return this; + } + CreateOrderVariablesBuilder permanentDays(AnyValue? t) { + _permanentDays.value = t; + return this; + } + CreateOrderVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + CreateOrderVariablesBuilder detectedConflicts(AnyValue? t) { + _detectedConflicts.value = t; + return this; + } + CreateOrderVariablesBuilder poReference(String? t) { + _poReference.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createOrder( + businessId: businessId, + orderType: orderType, +) +.vendorId(vendorId) +.location(location) +.status(status) +.date(date) +.startDate(startDate) +.endDate(endDate) +.duration(duration) +.lunchBreak(lunchBreak) +.total(total) +.eventName(eventName) +.assignedStaff(assignedStaff) +.shifts(shifts) +.requested(requested) +.hub(hub) +.recurringDays(recurringDays) +.permanentStartDate(permanentStartDate) +.permanentDays(permanentDays) +.notes(notes) +.detectedConflicts(detectedConflicts) +.poReference(poReference) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createOrder( + businessId: businessId, + orderType: orderType, +); +createOrderData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String businessId = ...; +OrderType orderType = ...; + +final ref = ExampleConnector.instance.createOrder( + businessId: businessId, + orderType: orderType, +).ref(); +ref.execute(); +``` + + +### updateOrder +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateOrder( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateOrder, we created `updateOrderBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateOrderVariablesBuilder { + ... + UpdateOrderVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + UpdateOrderVariablesBuilder businessId(String? t) { + _businessId.value = t; + return this; + } + UpdateOrderVariablesBuilder location(String? t) { + _location.value = t; + return this; + } + UpdateOrderVariablesBuilder status(OrderStatus? t) { + _status.value = t; + return this; + } + UpdateOrderVariablesBuilder date(Timestamp? t) { + _date.value = t; + return this; + } + UpdateOrderVariablesBuilder startDate(Timestamp? t) { + _startDate.value = t; + return this; + } + UpdateOrderVariablesBuilder endDate(Timestamp? t) { + _endDate.value = t; + return this; + } + UpdateOrderVariablesBuilder total(double? t) { + _total.value = t; + return this; + } + UpdateOrderVariablesBuilder eventName(String? t) { + _eventName.value = t; + return this; + } + UpdateOrderVariablesBuilder assignedStaff(AnyValue? t) { + _assignedStaff.value = t; + return this; + } + UpdateOrderVariablesBuilder shifts(AnyValue? t) { + _shifts.value = t; + return this; + } + UpdateOrderVariablesBuilder requested(int? t) { + _requested.value = t; + return this; + } + UpdateOrderVariablesBuilder hub(String? t) { + _hub.value = t; + return this; + } + UpdateOrderVariablesBuilder recurringDays(AnyValue? t) { + _recurringDays.value = t; + return this; + } + UpdateOrderVariablesBuilder permanentDays(AnyValue? t) { + _permanentDays.value = t; + return this; + } + UpdateOrderVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + UpdateOrderVariablesBuilder detectedConflicts(AnyValue? t) { + _detectedConflicts.value = t; + return this; + } + UpdateOrderVariablesBuilder poReference(String? t) { + _poReference.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateOrder( + id: id, +) +.vendorId(vendorId) +.businessId(businessId) +.location(location) +.status(status) +.date(date) +.startDate(startDate) +.endDate(endDate) +.total(total) +.eventName(eventName) +.assignedStaff(assignedStaff) +.shifts(shifts) +.requested(requested) +.hub(hub) +.recurringDays(recurringDays) +.permanentDays(permanentDays) +.notes(notes) +.detectedConflicts(detectedConflicts) +.poReference(poReference) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateOrder( + id: id, +); +updateOrderData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateOrder( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteOrder +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteOrder( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteOrder( + id: id, +); +deleteOrderData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteOrder( + id: id, +).ref(); +ref.execute(); +``` + + +### createShiftRole +#### Required Arguments +```dart +String shiftId = ...; +String roleId = ...; +int count = ...; +ExampleConnector.instance.createShiftRole( + shiftId: shiftId, + roleId: roleId, + count: count, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createShiftRole, we created `createShiftRoleBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateShiftRoleVariablesBuilder { + ... + CreateShiftRoleVariablesBuilder assigned(int? t) { + _assigned.value = t; + return this; + } + CreateShiftRoleVariablesBuilder startTime(Timestamp? t) { + _startTime.value = t; + return this; + } + CreateShiftRoleVariablesBuilder endTime(Timestamp? t) { + _endTime.value = t; + return this; + } + CreateShiftRoleVariablesBuilder hours(double? t) { + _hours.value = t; + return this; + } + CreateShiftRoleVariablesBuilder department(String? t) { + _department.value = t; + return this; + } + CreateShiftRoleVariablesBuilder uniform(String? t) { + _uniform.value = t; + return this; + } + CreateShiftRoleVariablesBuilder breakType(BreakDuration? t) { + _breakType.value = t; + return this; + } + CreateShiftRoleVariablesBuilder totalValue(double? t) { + _totalValue.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createShiftRole( + shiftId: shiftId, + roleId: roleId, + count: count, +) +.assigned(assigned) +.startTime(startTime) +.endTime(endTime) +.hours(hours) +.department(department) +.uniform(uniform) +.breakType(breakType) +.totalValue(totalValue) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createShiftRole( + shiftId: shiftId, + roleId: roleId, + count: count, +); +createShiftRoleData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftId = ...; +String roleId = ...; +int count = ...; + +final ref = ExampleConnector.instance.createShiftRole( + shiftId: shiftId, + roleId: roleId, + count: count, +).ref(); +ref.execute(); +``` + + +### updateShiftRole +#### Required Arguments +```dart +String shiftId = ...; +String roleId = ...; +ExampleConnector.instance.updateShiftRole( + shiftId: shiftId, + roleId: roleId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateShiftRole, we created `updateShiftRoleBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateShiftRoleVariablesBuilder { + ... + UpdateShiftRoleVariablesBuilder count(int? t) { + _count.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder assigned(int? t) { + _assigned.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder startTime(Timestamp? t) { + _startTime.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder endTime(Timestamp? t) { + _endTime.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder hours(double? t) { + _hours.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder department(String? t) { + _department.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder uniform(String? t) { + _uniform.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder breakType(BreakDuration? t) { + _breakType.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder totalValue(double? t) { + _totalValue.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateShiftRole( + shiftId: shiftId, + roleId: roleId, +) +.count(count) +.assigned(assigned) +.startTime(startTime) +.endTime(endTime) +.hours(hours) +.department(department) +.uniform(uniform) +.breakType(breakType) +.totalValue(totalValue) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateShiftRole( + shiftId: shiftId, + roleId: roleId, +); +updateShiftRoleData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftId = ...; +String roleId = ...; + +final ref = ExampleConnector.instance.updateShiftRole( + shiftId: shiftId, + roleId: roleId, +).ref(); +ref.execute(); +``` + + +### deleteShiftRole +#### Required Arguments +```dart +String shiftId = ...; +String roleId = ...; +ExampleConnector.instance.deleteShiftRole( + shiftId: shiftId, + roleId: roleId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteShiftRole( + shiftId: shiftId, + roleId: roleId, +); +deleteShiftRoleData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String shiftId = ...; +String roleId = ...; + +final ref = ExampleConnector.instance.deleteShiftRole( + shiftId: shiftId, + roleId: roleId, +).ref(); +ref.execute(); +``` + + +### createAttireOption +#### Required Arguments +```dart +String itemId = ...; +String label = ...; +ExampleConnector.instance.createAttireOption( + itemId: itemId, + label: label, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createAttireOption, we created `createAttireOptionBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateAttireOptionVariablesBuilder { + ... + CreateAttireOptionVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + CreateAttireOptionVariablesBuilder imageUrl(String? t) { + _imageUrl.value = t; + return this; + } + CreateAttireOptionVariablesBuilder isMandatory(bool? t) { + _isMandatory.value = t; + return this; + } + CreateAttireOptionVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createAttireOption( + itemId: itemId, + label: label, +) +.icon(icon) +.imageUrl(imageUrl) +.isMandatory(isMandatory) +.vendorId(vendorId) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createAttireOption( + itemId: itemId, + label: label, +); +createAttireOptionData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String itemId = ...; +String label = ...; + +final ref = ExampleConnector.instance.createAttireOption( + itemId: itemId, + label: label, +).ref(); +ref.execute(); +``` + + +### updateAttireOption +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateAttireOption( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateAttireOption, we created `updateAttireOptionBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateAttireOptionVariablesBuilder { + ... + UpdateAttireOptionVariablesBuilder itemId(String? t) { + _itemId.value = t; + return this; + } + UpdateAttireOptionVariablesBuilder label(String? t) { + _label.value = t; + return this; + } + UpdateAttireOptionVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + UpdateAttireOptionVariablesBuilder imageUrl(String? t) { + _imageUrl.value = t; + return this; + } + UpdateAttireOptionVariablesBuilder isMandatory(bool? t) { + _isMandatory.value = t; + return this; + } + UpdateAttireOptionVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateAttireOption( + id: id, +) +.itemId(itemId) +.label(label) +.icon(icon) +.imageUrl(imageUrl) +.isMandatory(isMandatory) +.vendorId(vendorId) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateAttireOption( + id: id, +); +updateAttireOptionData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateAttireOption( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteAttireOption +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteAttireOption( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteAttireOption( + id: id, +); +deleteAttireOptionData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteAttireOption( + id: id, +).ref(); +ref.execute(); +``` + + +### createInvoice +#### Required Arguments +```dart +InvoiceStatus status = ...; +String vendorId = ...; +String businessId = ...; +String orderId = ...; +String invoiceNumber = ...; +Timestamp issueDate = ...; +Timestamp dueDate = ...; +double amount = ...; +ExampleConnector.instance.createInvoice( + status: status, + vendorId: vendorId, + businessId: businessId, + orderId: orderId, + invoiceNumber: invoiceNumber, + issueDate: issueDate, + dueDate: dueDate, + amount: amount, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createInvoice, we created `createInvoiceBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateInvoiceVariablesBuilder { + ... + CreateInvoiceVariablesBuilder paymentTerms(InovicePaymentTerms? t) { + _paymentTerms.value = t; + return this; + } + CreateInvoiceVariablesBuilder hub(String? t) { + _hub.value = t; + return this; + } + CreateInvoiceVariablesBuilder managerName(String? t) { + _managerName.value = t; + return this; + } + CreateInvoiceVariablesBuilder vendorNumber(String? t) { + _vendorNumber.value = t; + return this; + } + CreateInvoiceVariablesBuilder roles(AnyValue? t) { + _roles.value = t; + return this; + } + CreateInvoiceVariablesBuilder charges(AnyValue? t) { + _charges.value = t; + return this; + } + CreateInvoiceVariablesBuilder otherCharges(double? t) { + _otherCharges.value = t; + return this; + } + CreateInvoiceVariablesBuilder subtotal(double? t) { + _subtotal.value = t; + return this; + } + CreateInvoiceVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + CreateInvoiceVariablesBuilder staffCount(int? t) { + _staffCount.value = t; + return this; + } + CreateInvoiceVariablesBuilder chargesCount(int? t) { + _chargesCount.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createInvoice( + status: status, + vendorId: vendorId, + businessId: businessId, + orderId: orderId, + invoiceNumber: invoiceNumber, + issueDate: issueDate, + dueDate: dueDate, + amount: amount, +) +.paymentTerms(paymentTerms) +.hub(hub) +.managerName(managerName) +.vendorNumber(vendorNumber) +.roles(roles) +.charges(charges) +.otherCharges(otherCharges) +.subtotal(subtotal) +.notes(notes) +.staffCount(staffCount) +.chargesCount(chargesCount) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createInvoice( + status: status, + vendorId: vendorId, + businessId: businessId, + orderId: orderId, + invoiceNumber: invoiceNumber, + issueDate: issueDate, + dueDate: dueDate, + amount: amount, +); +createInvoiceData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +InvoiceStatus status = ...; +String vendorId = ...; +String businessId = ...; +String orderId = ...; +String invoiceNumber = ...; +Timestamp issueDate = ...; +Timestamp dueDate = ...; +double amount = ...; + +final ref = ExampleConnector.instance.createInvoice( + status: status, + vendorId: vendorId, + businessId: businessId, + orderId: orderId, + invoiceNumber: invoiceNumber, + issueDate: issueDate, + dueDate: dueDate, + amount: amount, +).ref(); +ref.execute(); +``` + + +### updateInvoice +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateInvoice( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateInvoice, we created `updateInvoiceBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateInvoiceVariablesBuilder { + ... + UpdateInvoiceVariablesBuilder status(InvoiceStatus? t) { + _status.value = t; + return this; + } + UpdateInvoiceVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + UpdateInvoiceVariablesBuilder businessId(String? t) { + _businessId.value = t; + return this; + } + UpdateInvoiceVariablesBuilder orderId(String? t) { + _orderId.value = t; + return this; + } + UpdateInvoiceVariablesBuilder paymentTerms(InovicePaymentTerms? t) { + _paymentTerms.value = t; + return this; + } + UpdateInvoiceVariablesBuilder invoiceNumber(String? t) { + _invoiceNumber.value = t; + return this; + } + UpdateInvoiceVariablesBuilder issueDate(Timestamp? t) { + _issueDate.value = t; + return this; + } + UpdateInvoiceVariablesBuilder dueDate(Timestamp? t) { + _dueDate.value = t; + return this; + } + UpdateInvoiceVariablesBuilder hub(String? t) { + _hub.value = t; + return this; + } + UpdateInvoiceVariablesBuilder managerName(String? t) { + _managerName.value = t; + return this; + } + UpdateInvoiceVariablesBuilder vendorNumber(String? t) { + _vendorNumber.value = t; + return this; + } + UpdateInvoiceVariablesBuilder roles(AnyValue? t) { + _roles.value = t; + return this; + } + UpdateInvoiceVariablesBuilder charges(AnyValue? t) { + _charges.value = t; + return this; + } + UpdateInvoiceVariablesBuilder otherCharges(double? t) { + _otherCharges.value = t; + return this; + } + UpdateInvoiceVariablesBuilder subtotal(double? t) { + _subtotal.value = t; + return this; + } + UpdateInvoiceVariablesBuilder amount(double? t) { + _amount.value = t; + return this; + } + UpdateInvoiceVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + UpdateInvoiceVariablesBuilder staffCount(int? t) { + _staffCount.value = t; + return this; + } + UpdateInvoiceVariablesBuilder chargesCount(int? t) { + _chargesCount.value = t; + return this; + } + UpdateInvoiceVariablesBuilder disputedItems(AnyValue? t) { + _disputedItems.value = t; + return this; + } + UpdateInvoiceVariablesBuilder disputeReason(String? t) { + _disputeReason.value = t; + return this; + } + UpdateInvoiceVariablesBuilder disputeDetails(String? t) { + _disputeDetails.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateInvoice( + id: id, +) +.status(status) +.vendorId(vendorId) +.businessId(businessId) +.orderId(orderId) +.paymentTerms(paymentTerms) +.invoiceNumber(invoiceNumber) +.issueDate(issueDate) +.dueDate(dueDate) +.hub(hub) +.managerName(managerName) +.vendorNumber(vendorNumber) +.roles(roles) +.charges(charges) +.otherCharges(otherCharges) +.subtotal(subtotal) +.amount(amount) +.notes(notes) +.staffCount(staffCount) +.chargesCount(chargesCount) +.disputedItems(disputedItems) +.disputeReason(disputeReason) +.disputeDetails(disputeDetails) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateInvoice( + id: id, +); +updateInvoiceData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateInvoice( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteInvoice +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteInvoice( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteInvoice( + id: id, +); +deleteInvoiceData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteInvoice( + id: id, +).ref(); +ref.execute(); +``` + + +### createTask +#### Required Arguments +```dart +String taskName = ...; +TaskPriority priority = ...; +TaskStatus status = ...; +String ownerId = ...; +ExampleConnector.instance.createTask( + taskName: taskName, + priority: priority, + status: status, + ownerId: ownerId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createTask, we created `createTaskBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateTaskVariablesBuilder { + ... + CreateTaskVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + CreateTaskVariablesBuilder dueDate(Timestamp? t) { + _dueDate.value = t; + return this; + } + CreateTaskVariablesBuilder progress(int? t) { + _progress.value = t; + return this; + } + CreateTaskVariablesBuilder orderIndex(int? t) { + _orderIndex.value = t; + return this; + } + CreateTaskVariablesBuilder commentCount(int? t) { + _commentCount.value = t; + return this; + } + CreateTaskVariablesBuilder attachmentCount(int? t) { + _attachmentCount.value = t; + return this; + } + CreateTaskVariablesBuilder files(AnyValue? t) { + _files.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createTask( + taskName: taskName, + priority: priority, + status: status, + ownerId: ownerId, +) +.description(description) +.dueDate(dueDate) +.progress(progress) +.orderIndex(orderIndex) +.commentCount(commentCount) +.attachmentCount(attachmentCount) +.files(files) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createTask( + taskName: taskName, + priority: priority, + status: status, + ownerId: ownerId, +); +createTaskData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String taskName = ...; +TaskPriority priority = ...; +TaskStatus status = ...; +String ownerId = ...; + +final ref = ExampleConnector.instance.createTask( + taskName: taskName, + priority: priority, + status: status, + ownerId: ownerId, +).ref(); +ref.execute(); +``` + + +### updateTask +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateTask( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateTask, we created `updateTaskBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateTaskVariablesBuilder { + ... + UpdateTaskVariablesBuilder taskName(String? t) { + _taskName.value = t; + return this; + } + UpdateTaskVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + UpdateTaskVariablesBuilder priority(TaskPriority? t) { + _priority.value = t; + return this; + } + UpdateTaskVariablesBuilder status(TaskStatus? t) { + _status.value = t; + return this; + } + UpdateTaskVariablesBuilder dueDate(Timestamp? t) { + _dueDate.value = t; + return this; + } + UpdateTaskVariablesBuilder progress(int? t) { + _progress.value = t; + return this; + } + UpdateTaskVariablesBuilder assignedMembers(AnyValue? t) { + _assignedMembers.value = t; + return this; + } + UpdateTaskVariablesBuilder orderIndex(int? t) { + _orderIndex.value = t; + return this; + } + UpdateTaskVariablesBuilder commentCount(int? t) { + _commentCount.value = t; + return this; + } + UpdateTaskVariablesBuilder attachmentCount(int? t) { + _attachmentCount.value = t; + return this; + } + UpdateTaskVariablesBuilder files(AnyValue? t) { + _files.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateTask( + id: id, +) +.taskName(taskName) +.description(description) +.priority(priority) +.status(status) +.dueDate(dueDate) +.progress(progress) +.assignedMembers(assignedMembers) +.orderIndex(orderIndex) +.commentCount(commentCount) +.attachmentCount(attachmentCount) +.files(files) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateTask( + id: id, +); +updateTaskData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateTask( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteTask +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteTask( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteTask( + id: id, +); +deleteTaskData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteTask( + id: id, +).ref(); +ref.execute(); +``` + + +### createWorkforce +#### Required Arguments +```dart +String vendorId = ...; +String staffId = ...; +String workforceNumber = ...; +ExampleConnector.instance.createWorkforce( + vendorId: vendorId, + staffId: staffId, + workforceNumber: workforceNumber, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createWorkforce, we created `createWorkforceBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateWorkforceVariablesBuilder { + ... + CreateWorkforceVariablesBuilder employmentType(WorkforceEmploymentType? t) { + _employmentType.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createWorkforce( + vendorId: vendorId, + staffId: staffId, + workforceNumber: workforceNumber, +) +.employmentType(employmentType) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createWorkforce( + vendorId: vendorId, + staffId: staffId, + workforceNumber: workforceNumber, +); +createWorkforceData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; +String staffId = ...; +String workforceNumber = ...; + +final ref = ExampleConnector.instance.createWorkforce( + vendorId: vendorId, + staffId: staffId, + workforceNumber: workforceNumber, +).ref(); +ref.execute(); +``` + + +### updateWorkforce +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateWorkforce( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateWorkforce, we created `updateWorkforceBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateWorkforceVariablesBuilder { + ... + UpdateWorkforceVariablesBuilder workforceNumber(String? t) { + _workforceNumber.value = t; + return this; + } + UpdateWorkforceVariablesBuilder employmentType(WorkforceEmploymentType? t) { + _employmentType.value = t; + return this; + } + UpdateWorkforceVariablesBuilder status(WorkforceStatus? t) { + _status.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateWorkforce( + id: id, +) +.workforceNumber(workforceNumber) +.employmentType(employmentType) +.status(status) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateWorkforce( + id: id, +); +updateWorkforceData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateWorkforce( + id: id, +).ref(); +ref.execute(); +``` + + +### deactivateWorkforce +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deactivateWorkforce( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deactivateWorkforce( + id: id, +); +deactivateWorkforceData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deactivateWorkforce( + id: id, +).ref(); +ref.execute(); +``` + + +### createMemberTask +#### Required Arguments +```dart +String teamMemberId = ...; +String taskId = ...; +ExampleConnector.instance.createMemberTask( + teamMemberId: teamMemberId, + taskId: taskId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createMemberTask( + teamMemberId: teamMemberId, + taskId: taskId, +); +createMemberTaskData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String teamMemberId = ...; +String taskId = ...; + +final ref = ExampleConnector.instance.createMemberTask( + teamMemberId: teamMemberId, + taskId: taskId, +).ref(); +ref.execute(); +``` + + +### deleteMemberTask +#### Required Arguments +```dart +String teamMemberId = ...; +String taskId = ...; +ExampleConnector.instance.deleteMemberTask( + teamMemberId: teamMemberId, + taskId: taskId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteMemberTask( + teamMemberId: teamMemberId, + taskId: taskId, +); +deleteMemberTaskData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String teamMemberId = ...; +String taskId = ...; + +final ref = ExampleConnector.instance.deleteMemberTask( + teamMemberId: teamMemberId, + taskId: taskId, +).ref(); +ref.execute(); +``` + + +### createStaffAvailabilityStats +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.createStaffAvailabilityStats( + staffId: staffId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createStaffAvailabilityStats, we created `createStaffAvailabilityStatsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateStaffAvailabilityStatsVariablesBuilder { + ... + CreateStaffAvailabilityStatsVariablesBuilder needWorkIndex(int? t) { + _needWorkIndex.value = t; + return this; + } + CreateStaffAvailabilityStatsVariablesBuilder utilizationPercentage(int? t) { + _utilizationPercentage.value = t; + return this; + } + CreateStaffAvailabilityStatsVariablesBuilder predictedAvailabilityScore(int? t) { + _predictedAvailabilityScore.value = t; + return this; + } + CreateStaffAvailabilityStatsVariablesBuilder scheduledHoursThisPeriod(int? t) { + _scheduledHoursThisPeriod.value = t; + return this; + } + CreateStaffAvailabilityStatsVariablesBuilder desiredHoursThisPeriod(int? t) { + _desiredHoursThisPeriod.value = t; + return this; + } + CreateStaffAvailabilityStatsVariablesBuilder lastShiftDate(Timestamp? t) { + _lastShiftDate.value = t; + return this; + } + CreateStaffAvailabilityStatsVariablesBuilder acceptanceRate(int? t) { + _acceptanceRate.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createStaffAvailabilityStats( + staffId: staffId, +) +.needWorkIndex(needWorkIndex) +.utilizationPercentage(utilizationPercentage) +.predictedAvailabilityScore(predictedAvailabilityScore) +.scheduledHoursThisPeriod(scheduledHoursThisPeriod) +.desiredHoursThisPeriod(desiredHoursThisPeriod) +.lastShiftDate(lastShiftDate) +.acceptanceRate(acceptanceRate) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createStaffAvailabilityStats( + staffId: staffId, +); +createStaffAvailabilityStatsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.createStaffAvailabilityStats( + staffId: staffId, +).ref(); +ref.execute(); +``` + + +### updateStaffAvailabilityStats +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.updateStaffAvailabilityStats( + staffId: staffId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateStaffAvailabilityStats, we created `updateStaffAvailabilityStatsBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateStaffAvailabilityStatsVariablesBuilder { + ... + UpdateStaffAvailabilityStatsVariablesBuilder needWorkIndex(int? t) { + _needWorkIndex.value = t; + return this; + } + UpdateStaffAvailabilityStatsVariablesBuilder utilizationPercentage(int? t) { + _utilizationPercentage.value = t; + return this; + } + UpdateStaffAvailabilityStatsVariablesBuilder predictedAvailabilityScore(int? t) { + _predictedAvailabilityScore.value = t; + return this; + } + UpdateStaffAvailabilityStatsVariablesBuilder scheduledHoursThisPeriod(int? t) { + _scheduledHoursThisPeriod.value = t; + return this; + } + UpdateStaffAvailabilityStatsVariablesBuilder desiredHoursThisPeriod(int? t) { + _desiredHoursThisPeriod.value = t; + return this; + } + UpdateStaffAvailabilityStatsVariablesBuilder lastShiftDate(Timestamp? t) { + _lastShiftDate.value = t; + return this; + } + UpdateStaffAvailabilityStatsVariablesBuilder acceptanceRate(int? t) { + _acceptanceRate.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateStaffAvailabilityStats( + staffId: staffId, +) +.needWorkIndex(needWorkIndex) +.utilizationPercentage(utilizationPercentage) +.predictedAvailabilityScore(predictedAvailabilityScore) +.scheduledHoursThisPeriod(scheduledHoursThisPeriod) +.desiredHoursThisPeriod(desiredHoursThisPeriod) +.lastShiftDate(lastShiftDate) +.acceptanceRate(acceptanceRate) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateStaffAvailabilityStats( + staffId: staffId, +); +updateStaffAvailabilityStatsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.updateStaffAvailabilityStats( + staffId: staffId, +).ref(); +ref.execute(); +``` + + +### deleteStaffAvailabilityStats +#### Required Arguments +```dart +String staffId = ...; +ExampleConnector.instance.deleteStaffAvailabilityStats( + staffId: staffId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteStaffAvailabilityStats( + staffId: staffId, +); +deleteStaffAvailabilityStatsData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; + +final ref = ExampleConnector.instance.deleteStaffAvailabilityStats( + staffId: staffId, +).ref(); +ref.execute(); +``` + + +### createVendorBenefitPlan +#### Required Arguments +```dart +String vendorId = ...; +String title = ...; +ExampleConnector.instance.createVendorBenefitPlan( + vendorId: vendorId, + title: title, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createVendorBenefitPlan, we created `createVendorBenefitPlanBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateVendorBenefitPlanVariablesBuilder { + ... + CreateVendorBenefitPlanVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + CreateVendorBenefitPlanVariablesBuilder requestLabel(String? t) { + _requestLabel.value = t; + return this; + } + CreateVendorBenefitPlanVariablesBuilder total(int? t) { + _total.value = t; + return this; + } + CreateVendorBenefitPlanVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + CreateVendorBenefitPlanVariablesBuilder createdBy(String? t) { + _createdBy.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createVendorBenefitPlan( + vendorId: vendorId, + title: title, +) +.description(description) +.requestLabel(requestLabel) +.total(total) +.isActive(isActive) +.createdBy(createdBy) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createVendorBenefitPlan( + vendorId: vendorId, + title: title, +); +createVendorBenefitPlanData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; +String title = ...; + +final ref = ExampleConnector.instance.createVendorBenefitPlan( + vendorId: vendorId, + title: title, +).ref(); +ref.execute(); +``` + + +### updateVendorBenefitPlan +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateVendorBenefitPlan( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateVendorBenefitPlan, we created `updateVendorBenefitPlanBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateVendorBenefitPlanVariablesBuilder { + ... + UpdateVendorBenefitPlanVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + UpdateVendorBenefitPlanVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + UpdateVendorBenefitPlanVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + UpdateVendorBenefitPlanVariablesBuilder requestLabel(String? t) { + _requestLabel.value = t; + return this; + } + UpdateVendorBenefitPlanVariablesBuilder total(int? t) { + _total.value = t; + return this; + } + UpdateVendorBenefitPlanVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + UpdateVendorBenefitPlanVariablesBuilder createdBy(String? t) { + _createdBy.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateVendorBenefitPlan( + id: id, +) +.vendorId(vendorId) +.title(title) +.description(description) +.requestLabel(requestLabel) +.total(total) +.isActive(isActive) +.createdBy(createdBy) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateVendorBenefitPlan( + id: id, +); +updateVendorBenefitPlanData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateVendorBenefitPlan( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteVendorBenefitPlan +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteVendorBenefitPlan( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteVendorBenefitPlan( + id: id, +); +deleteVendorBenefitPlanData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteVendorBenefitPlan( + id: id, +).ref(); +ref.execute(); +``` + + +### createVendorRate +#### Required Arguments +```dart +String vendorId = ...; +ExampleConnector.instance.createVendorRate( + vendorId: vendorId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createVendorRate, we created `createVendorRateBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateVendorRateVariablesBuilder { + ... + CreateVendorRateVariablesBuilder roleName(String? t) { + _roleName.value = t; + return this; + } + CreateVendorRateVariablesBuilder category(CategoryType? t) { + _category.value = t; + return this; + } + CreateVendorRateVariablesBuilder clientRate(double? t) { + _clientRate.value = t; + return this; + } + CreateVendorRateVariablesBuilder employeeWage(double? t) { + _employeeWage.value = t; + return this; + } + CreateVendorRateVariablesBuilder markupPercentage(double? t) { + _markupPercentage.value = t; + return this; + } + CreateVendorRateVariablesBuilder vendorFeePercentage(double? t) { + _vendorFeePercentage.value = t; + return this; + } + CreateVendorRateVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + CreateVendorRateVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createVendorRate( + vendorId: vendorId, +) +.roleName(roleName) +.category(category) +.clientRate(clientRate) +.employeeWage(employeeWage) +.markupPercentage(markupPercentage) +.vendorFeePercentage(vendorFeePercentage) +.isActive(isActive) +.notes(notes) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createVendorRate( + vendorId: vendorId, +); +createVendorRateData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String vendorId = ...; + +final ref = ExampleConnector.instance.createVendorRate( + vendorId: vendorId, +).ref(); +ref.execute(); +``` + + +### updateVendorRate +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateVendorRate( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateVendorRate, we created `updateVendorRateBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateVendorRateVariablesBuilder { + ... + UpdateVendorRateVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + UpdateVendorRateVariablesBuilder roleName(String? t) { + _roleName.value = t; + return this; + } + UpdateVendorRateVariablesBuilder category(CategoryType? t) { + _category.value = t; + return this; + } + UpdateVendorRateVariablesBuilder clientRate(double? t) { + _clientRate.value = t; + return this; + } + UpdateVendorRateVariablesBuilder employeeWage(double? t) { + _employeeWage.value = t; + return this; + } + UpdateVendorRateVariablesBuilder markupPercentage(double? t) { + _markupPercentage.value = t; + return this; + } + UpdateVendorRateVariablesBuilder vendorFeePercentage(double? t) { + _vendorFeePercentage.value = t; + return this; + } + UpdateVendorRateVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + UpdateVendorRateVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateVendorRate( + id: id, +) +.vendorId(vendorId) +.roleName(roleName) +.category(category) +.clientRate(clientRate) +.employeeWage(employeeWage) +.markupPercentage(markupPercentage) +.vendorFeePercentage(vendorFeePercentage) +.isActive(isActive) +.notes(notes) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateVendorRate( + id: id, +); +updateVendorRateData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateVendorRate( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteVendorRate +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteVendorRate( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteVendorRate( + id: id, +); +deleteVendorRateData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteVendorRate( + id: id, +).ref(); +ref.execute(); +``` + + +### CreateCertificate +#### Required Arguments +```dart +String name = ...; +CertificateStatus status = ...; +String staffId = ...; +ExampleConnector.instance.createCertificate( + name: name, + status: status, + staffId: staffId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For CreateCertificate, we created `CreateCertificateBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateCertificateVariablesBuilder { + ... + CreateCertificateVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + CreateCertificateVariablesBuilder expiry(Timestamp? t) { + _expiry.value = t; + return this; + } + CreateCertificateVariablesBuilder fileUrl(String? t) { + _fileUrl.value = t; + return this; + } + CreateCertificateVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + CreateCertificateVariablesBuilder certificationType(ComplianceType? t) { + _certificationType.value = t; + return this; + } + CreateCertificateVariablesBuilder issuer(String? t) { + _issuer.value = t; + return this; + } + CreateCertificateVariablesBuilder validationStatus(ValidationStatus? t) { + _validationStatus.value = t; + return this; + } + CreateCertificateVariablesBuilder certificateNumber(String? t) { + _certificateNumber.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createCertificate( + name: name, + status: status, + staffId: staffId, +) +.description(description) +.expiry(expiry) +.fileUrl(fileUrl) +.icon(icon) +.certificationType(certificationType) +.issuer(issuer) +.validationStatus(validationStatus) +.certificateNumber(certificateNumber) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createCertificate( + name: name, + status: status, + staffId: staffId, +); +CreateCertificateData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String name = ...; +CertificateStatus status = ...; +String staffId = ...; + +final ref = ExampleConnector.instance.createCertificate( + name: name, + status: status, + staffId: staffId, +).ref(); +ref.execute(); +``` + + +### UpdateCertificate +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateCertificate( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For UpdateCertificate, we created `UpdateCertificateBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateCertificateVariablesBuilder { + ... + UpdateCertificateVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateCertificateVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + UpdateCertificateVariablesBuilder expiry(Timestamp? t) { + _expiry.value = t; + return this; + } + UpdateCertificateVariablesBuilder status(CertificateStatus? t) { + _status.value = t; + return this; + } + UpdateCertificateVariablesBuilder fileUrl(String? t) { + _fileUrl.value = t; + return this; + } + UpdateCertificateVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + UpdateCertificateVariablesBuilder staffId(String? t) { + _staffId.value = t; + return this; + } + UpdateCertificateVariablesBuilder certificationType(ComplianceType? t) { + _certificationType.value = t; + return this; + } + UpdateCertificateVariablesBuilder issuer(String? t) { + _issuer.value = t; + return this; + } + UpdateCertificateVariablesBuilder validationStatus(ValidationStatus? t) { + _validationStatus.value = t; + return this; + } + UpdateCertificateVariablesBuilder certificateNumber(String? t) { + _certificateNumber.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateCertificate( + id: id, +) +.name(name) +.description(description) +.expiry(expiry) +.status(status) +.fileUrl(fileUrl) +.icon(icon) +.staffId(staffId) +.certificationType(certificationType) +.issuer(issuer) +.validationStatus(validationStatus) +.certificateNumber(certificateNumber) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateCertificate( + id: id, +); +UpdateCertificateData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateCertificate( + id: id, +).ref(); +ref.execute(); +``` + + +### DeleteCertificate +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteCertificate( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteCertificate( + id: id, +); +DeleteCertificateData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteCertificate( + id: id, +).ref(); +ref.execute(); +``` + + +### createCourse +#### Required Arguments +```dart +String categoryId = ...; +ExampleConnector.instance.createCourse( + categoryId: categoryId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createCourse, we created `createCourseBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateCourseVariablesBuilder { + ... + + CreateCourseVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + CreateCourseVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + CreateCourseVariablesBuilder thumbnailUrl(String? t) { + _thumbnailUrl.value = t; + return this; + } + CreateCourseVariablesBuilder durationMinutes(int? t) { + _durationMinutes.value = t; + return this; + } + CreateCourseVariablesBuilder xpReward(int? t) { + _xpReward.value = t; + return this; + } + CreateCourseVariablesBuilder levelRequired(String? t) { + _levelRequired.value = t; + return this; + } + CreateCourseVariablesBuilder isCertification(bool? t) { + _isCertification.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createCourse( + categoryId: categoryId, +) +.title(title) +.description(description) +.thumbnailUrl(thumbnailUrl) +.durationMinutes(durationMinutes) +.xpReward(xpReward) +.levelRequired(levelRequired) +.isCertification(isCertification) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createCourse( + categoryId: categoryId, +); +createCourseData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String categoryId = ...; + +final ref = ExampleConnector.instance.createCourse( + categoryId: categoryId, +).ref(); +ref.execute(); +``` + + +### updateCourse +#### Required Arguments +```dart +String id = ...; +String categoryId = ...; +ExampleConnector.instance.updateCourse( + id: id, + categoryId: categoryId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateCourse, we created `updateCourseBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateCourseVariablesBuilder { + ... + UpdateCourseVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + UpdateCourseVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + UpdateCourseVariablesBuilder thumbnailUrl(String? t) { + _thumbnailUrl.value = t; + return this; + } + UpdateCourseVariablesBuilder durationMinutes(int? t) { + _durationMinutes.value = t; + return this; + } + UpdateCourseVariablesBuilder xpReward(int? t) { + _xpReward.value = t; + return this; + } + UpdateCourseVariablesBuilder levelRequired(String? t) { + _levelRequired.value = t; + return this; + } + UpdateCourseVariablesBuilder isCertification(bool? t) { + _isCertification.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateCourse( + id: id, + categoryId: categoryId, +) +.title(title) +.description(description) +.thumbnailUrl(thumbnailUrl) +.durationMinutes(durationMinutes) +.xpReward(xpReward) +.levelRequired(levelRequired) +.isCertification(isCertification) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateCourse( + id: id, + categoryId: categoryId, +); +updateCourseData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; +String categoryId = ...; + +final ref = ExampleConnector.instance.updateCourse( + id: id, + categoryId: categoryId, +).ref(); +ref.execute(); +``` + + +### deleteCourse +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteCourse( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteCourse( + id: id, +); +deleteCourseData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteCourse( + id: id, +).ref(); +ref.execute(); +``` + + +### createRoleCategory +#### Required Arguments +```dart +String roleName = ...; +RoleCategoryType category = ...; +ExampleConnector.instance.createRoleCategory( + roleName: roleName, + category: category, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createRoleCategory( + roleName: roleName, + category: category, +); +createRoleCategoryData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String roleName = ...; +RoleCategoryType category = ...; + +final ref = ExampleConnector.instance.createRoleCategory( + roleName: roleName, + category: category, +).ref(); +ref.execute(); +``` + + +### updateRoleCategory +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateRoleCategory( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateRoleCategory, we created `updateRoleCategoryBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateRoleCategoryVariablesBuilder { + ... + UpdateRoleCategoryVariablesBuilder roleName(String? t) { + _roleName.value = t; + return this; + } + UpdateRoleCategoryVariablesBuilder category(RoleCategoryType? t) { + _category.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateRoleCategory( + id: id, +) +.roleName(roleName) +.category(category) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateRoleCategory( + id: id, +); +updateRoleCategoryData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateRoleCategory( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteRoleCategory +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteRoleCategory( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteRoleCategory( + id: id, +); +deleteRoleCategoryData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteRoleCategory( + id: id, +).ref(); +ref.execute(); +``` + + +### CreateStaff +#### Required Arguments +```dart +String userId = ...; +String fullName = ...; +ExampleConnector.instance.createStaff( + userId: userId, + fullName: fullName, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For CreateStaff, we created `CreateStaffBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateStaffVariablesBuilder { + ... + CreateStaffVariablesBuilder level(String? t) { + _level.value = t; + return this; + } + CreateStaffVariablesBuilder role(String? t) { + _role.value = t; + return this; + } + CreateStaffVariablesBuilder phone(String? t) { + _phone.value = t; + return this; + } + CreateStaffVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + CreateStaffVariablesBuilder photoUrl(String? t) { + _photoUrl.value = t; + return this; + } + CreateStaffVariablesBuilder totalShifts(int? t) { + _totalShifts.value = t; + return this; + } + CreateStaffVariablesBuilder averageRating(double? t) { + _averageRating.value = t; + return this; + } + CreateStaffVariablesBuilder onTimeRate(int? t) { + _onTimeRate.value = t; + return this; + } + CreateStaffVariablesBuilder noShowCount(int? t) { + _noShowCount.value = t; + return this; + } + CreateStaffVariablesBuilder cancellationCount(int? t) { + _cancellationCount.value = t; + return this; + } + CreateStaffVariablesBuilder reliabilityScore(int? t) { + _reliabilityScore.value = t; + return this; + } + CreateStaffVariablesBuilder bio(String? t) { + _bio.value = t; + return this; + } + CreateStaffVariablesBuilder industries(AnyValue? t) { + _industries.value = t; + return this; + } + CreateStaffVariablesBuilder preferredLocations(AnyValue? t) { + _preferredLocations.value = t; + return this; + } + CreateStaffVariablesBuilder maxDistanceMiles(int? t) { + _maxDistanceMiles.value = t; + return this; + } + CreateStaffVariablesBuilder languages(AnyValue? t) { + _languages.value = t; + return this; + } + CreateStaffVariablesBuilder itemsAttire(AnyValue? t) { + _itemsAttire.value = t; + return this; + } + CreateStaffVariablesBuilder xp(int? t) { + _xp.value = t; + return this; + } + CreateStaffVariablesBuilder badges(AnyValue? t) { + _badges.value = t; + return this; + } + CreateStaffVariablesBuilder isRecommended(bool? t) { + _isRecommended.value = t; + return this; + } + CreateStaffVariablesBuilder ownerId(String? t) { + _ownerId.value = t; + return this; + } + CreateStaffVariablesBuilder department(DepartmentType? t) { + _department.value = t; + return this; + } + CreateStaffVariablesBuilder hubId(String? t) { + _hubId.value = t; + return this; + } + CreateStaffVariablesBuilder manager(String? t) { + _manager.value = t; + return this; + } + CreateStaffVariablesBuilder english(EnglishProficiency? t) { + _english.value = t; + return this; + } + CreateStaffVariablesBuilder backgroundCheckStatus(BackgroundCheckStatus? t) { + _backgroundCheckStatus.value = t; + return this; + } + CreateStaffVariablesBuilder employmentType(EmploymentType? t) { + _employmentType.value = t; + return this; + } + CreateStaffVariablesBuilder initial(String? t) { + _initial.value = t; + return this; + } + CreateStaffVariablesBuilder englishRequired(bool? t) { + _englishRequired.value = t; + return this; + } + CreateStaffVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + CreateStaffVariablesBuilder addres(String? t) { + _addres.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createStaff( + userId: userId, + fullName: fullName, +) +.level(level) +.role(role) +.phone(phone) +.email(email) +.photoUrl(photoUrl) +.totalShifts(totalShifts) +.averageRating(averageRating) +.onTimeRate(onTimeRate) +.noShowCount(noShowCount) +.cancellationCount(cancellationCount) +.reliabilityScore(reliabilityScore) +.bio(bio) +.industries(industries) +.preferredLocations(preferredLocations) +.maxDistanceMiles(maxDistanceMiles) +.languages(languages) +.itemsAttire(itemsAttire) +.xp(xp) +.badges(badges) +.isRecommended(isRecommended) +.ownerId(ownerId) +.department(department) +.hubId(hubId) +.manager(manager) +.english(english) +.backgroundCheckStatus(backgroundCheckStatus) +.employmentType(employmentType) +.initial(initial) +.englishRequired(englishRequired) +.city(city) +.addres(addres) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createStaff( + userId: userId, + fullName: fullName, +); +CreateStaffData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String userId = ...; +String fullName = ...; + +final ref = ExampleConnector.instance.createStaff( + userId: userId, + fullName: fullName, +).ref(); +ref.execute(); +``` + + +### UpdateStaff +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateStaff( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For UpdateStaff, we created `UpdateStaffBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateStaffVariablesBuilder { + ... + UpdateStaffVariablesBuilder userId(String? t) { + _userId.value = t; + return this; + } + UpdateStaffVariablesBuilder fullName(String? t) { + _fullName.value = t; + return this; + } + UpdateStaffVariablesBuilder level(String? t) { + _level.value = t; + return this; + } + UpdateStaffVariablesBuilder role(String? t) { + _role.value = t; + return this; + } + UpdateStaffVariablesBuilder phone(String? t) { + _phone.value = t; + return this; + } + UpdateStaffVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + UpdateStaffVariablesBuilder photoUrl(String? t) { + _photoUrl.value = t; + return this; + } + UpdateStaffVariablesBuilder totalShifts(int? t) { + _totalShifts.value = t; + return this; + } + UpdateStaffVariablesBuilder averageRating(double? t) { + _averageRating.value = t; + return this; + } + UpdateStaffVariablesBuilder onTimeRate(int? t) { + _onTimeRate.value = t; + return this; + } + UpdateStaffVariablesBuilder noShowCount(int? t) { + _noShowCount.value = t; + return this; + } + UpdateStaffVariablesBuilder cancellationCount(int? t) { + _cancellationCount.value = t; + return this; + } + UpdateStaffVariablesBuilder reliabilityScore(int? t) { + _reliabilityScore.value = t; + return this; + } + UpdateStaffVariablesBuilder bio(String? t) { + _bio.value = t; + return this; + } + UpdateStaffVariablesBuilder industries(AnyValue? t) { + _industries.value = t; + return this; + } + UpdateStaffVariablesBuilder preferredLocations(AnyValue? t) { + _preferredLocations.value = t; + return this; + } + UpdateStaffVariablesBuilder maxDistanceMiles(int? t) { + _maxDistanceMiles.value = t; + return this; + } + UpdateStaffVariablesBuilder languages(AnyValue? t) { + _languages.value = t; + return this; + } + UpdateStaffVariablesBuilder itemsAttire(AnyValue? t) { + _itemsAttire.value = t; + return this; + } + UpdateStaffVariablesBuilder xp(int? t) { + _xp.value = t; + return this; + } + UpdateStaffVariablesBuilder badges(AnyValue? t) { + _badges.value = t; + return this; + } + UpdateStaffVariablesBuilder isRecommended(bool? t) { + _isRecommended.value = t; + return this; + } + UpdateStaffVariablesBuilder ownerId(String? t) { + _ownerId.value = t; + return this; + } + UpdateStaffVariablesBuilder department(DepartmentType? t) { + _department.value = t; + return this; + } + UpdateStaffVariablesBuilder hubId(String? t) { + _hubId.value = t; + return this; + } + UpdateStaffVariablesBuilder manager(String? t) { + _manager.value = t; + return this; + } + UpdateStaffVariablesBuilder english(EnglishProficiency? t) { + _english.value = t; + return this; + } + UpdateStaffVariablesBuilder backgroundCheckStatus(BackgroundCheckStatus? t) { + _backgroundCheckStatus.value = t; + return this; + } + UpdateStaffVariablesBuilder employmentType(EmploymentType? t) { + _employmentType.value = t; + return this; + } + UpdateStaffVariablesBuilder initial(String? t) { + _initial.value = t; + return this; + } + UpdateStaffVariablesBuilder englishRequired(bool? t) { + _englishRequired.value = t; + return this; + } + UpdateStaffVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + UpdateStaffVariablesBuilder addres(String? t) { + _addres.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateStaff( + id: id, +) +.userId(userId) +.fullName(fullName) +.level(level) +.role(role) +.phone(phone) +.email(email) +.photoUrl(photoUrl) +.totalShifts(totalShifts) +.averageRating(averageRating) +.onTimeRate(onTimeRate) +.noShowCount(noShowCount) +.cancellationCount(cancellationCount) +.reliabilityScore(reliabilityScore) +.bio(bio) +.industries(industries) +.preferredLocations(preferredLocations) +.maxDistanceMiles(maxDistanceMiles) +.languages(languages) +.itemsAttire(itemsAttire) +.xp(xp) +.badges(badges) +.isRecommended(isRecommended) +.ownerId(ownerId) +.department(department) +.hubId(hubId) +.manager(manager) +.english(english) +.backgroundCheckStatus(backgroundCheckStatus) +.employmentType(employmentType) +.initial(initial) +.englishRequired(englishRequired) +.city(city) +.addres(addres) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateStaff( + id: id, +); +UpdateStaffData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateStaff( + id: id, +).ref(); +ref.execute(); +``` + + +### DeleteStaff +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteStaff( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteStaff( + id: id, +); +DeleteStaffData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteStaff( + id: id, +).ref(); +ref.execute(); +``` + + +### createAccount +#### Required Arguments +```dart +String bank = ...; +AccountType type = ...; +String last4 = ...; +String ownerId = ...; +ExampleConnector.instance.createAccount( + bank: bank, + type: type, + last4: last4, + ownerId: ownerId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createAccount, we created `createAccountBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateAccountVariablesBuilder { + ... + CreateAccountVariablesBuilder isPrimary(bool? t) { + _isPrimary.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createAccount( + bank: bank, + type: type, + last4: last4, + ownerId: ownerId, +) +.isPrimary(isPrimary) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createAccount( + bank: bank, + type: type, + last4: last4, + ownerId: ownerId, +); +createAccountData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String bank = ...; +AccountType type = ...; +String last4 = ...; +String ownerId = ...; + +final ref = ExampleConnector.instance.createAccount( + bank: bank, + type: type, + last4: last4, + ownerId: ownerId, +).ref(); +ref.execute(); +``` + + +### updateAccount +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateAccount( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateAccount, we created `updateAccountBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateAccountVariablesBuilder { + ... + UpdateAccountVariablesBuilder bank(String? t) { + _bank.value = t; + return this; + } + UpdateAccountVariablesBuilder type(AccountType? t) { + _type.value = t; + return this; + } + UpdateAccountVariablesBuilder last4(String? t) { + _last4.value = t; + return this; + } + UpdateAccountVariablesBuilder isPrimary(bool? t) { + _isPrimary.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateAccount( + id: id, +) +.bank(bank) +.type(type) +.last4(last4) +.isPrimary(isPrimary) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateAccount( + id: id, +); +updateAccountData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateAccount( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteAccount +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteAccount( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteAccount( + id: id, +); +deleteAccountData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteAccount( + id: id, +).ref(); +ref.execute(); +``` + + +### createActivityLog +#### Required Arguments +```dart +String userId = ...; +Timestamp date = ...; +String title = ...; +String description = ...; +ActivityType activityType = ...; +ExampleConnector.instance.createActivityLog( + userId: userId, + date: date, + title: title, + description: description, + activityType: activityType, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createActivityLog, we created `createActivityLogBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateActivityLogVariablesBuilder { + ... + CreateActivityLogVariablesBuilder hourStart(String? t) { + _hourStart.value = t; + return this; + } + CreateActivityLogVariablesBuilder hourEnd(String? t) { + _hourEnd.value = t; + return this; + } + CreateActivityLogVariablesBuilder totalhours(String? t) { + _totalhours.value = t; + return this; + } + CreateActivityLogVariablesBuilder iconType(ActivityIconType? t) { + _iconType.value = t; + return this; + } + CreateActivityLogVariablesBuilder iconColor(String? t) { + _iconColor.value = t; + return this; + } + CreateActivityLogVariablesBuilder isRead(bool? t) { + _isRead.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createActivityLog( + userId: userId, + date: date, + title: title, + description: description, + activityType: activityType, +) +.hourStart(hourStart) +.hourEnd(hourEnd) +.totalhours(totalhours) +.iconType(iconType) +.iconColor(iconColor) +.isRead(isRead) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createActivityLog( + userId: userId, + date: date, + title: title, + description: description, + activityType: activityType, +); +createActivityLogData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String userId = ...; +Timestamp date = ...; +String title = ...; +String description = ...; +ActivityType activityType = ...; + +final ref = ExampleConnector.instance.createActivityLog( + userId: userId, + date: date, + title: title, + description: description, + activityType: activityType, +).ref(); +ref.execute(); +``` + + +### updateActivityLog +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateActivityLog( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateActivityLog, we created `updateActivityLogBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateActivityLogVariablesBuilder { + ... + UpdateActivityLogVariablesBuilder userId(String? t) { + _userId.value = t; + return this; + } + UpdateActivityLogVariablesBuilder date(Timestamp? t) { + _date.value = t; + return this; + } + UpdateActivityLogVariablesBuilder hourStart(String? t) { + _hourStart.value = t; + return this; + } + UpdateActivityLogVariablesBuilder hourEnd(String? t) { + _hourEnd.value = t; + return this; + } + UpdateActivityLogVariablesBuilder totalhours(String? t) { + _totalhours.value = t; + return this; + } + UpdateActivityLogVariablesBuilder iconType(ActivityIconType? t) { + _iconType.value = t; + return this; + } + UpdateActivityLogVariablesBuilder iconColor(String? t) { + _iconColor.value = t; + return this; + } + UpdateActivityLogVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + UpdateActivityLogVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + UpdateActivityLogVariablesBuilder isRead(bool? t) { + _isRead.value = t; + return this; + } + UpdateActivityLogVariablesBuilder activityType(ActivityType? t) { + _activityType.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateActivityLog( + id: id, +) +.userId(userId) +.date(date) +.hourStart(hourStart) +.hourEnd(hourEnd) +.totalhours(totalhours) +.iconType(iconType) +.iconColor(iconColor) +.title(title) +.description(description) +.isRead(isRead) +.activityType(activityType) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateActivityLog( + id: id, +); +updateActivityLogData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateActivityLog( + id: id, +).ref(); +ref.execute(); +``` + + +### markActivityLogAsRead +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.markActivityLogAsRead( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.markActivityLogAsRead( + id: id, +); +markActivityLogAsReadData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.markActivityLogAsRead( + id: id, +).ref(); +ref.execute(); +``` + + +### markActivityLogsAsRead +#### Required Arguments +```dart +String ids = ...; +ExampleConnector.instance.markActivityLogsAsRead( + ids: ids, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.markActivityLogsAsRead( + ids: ids, +); +markActivityLogsAsReadData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String ids = ...; + +final ref = ExampleConnector.instance.markActivityLogsAsRead( + ids: ids, +).ref(); +ref.execute(); +``` + + +### deleteActivityLog +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteActivityLog( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteActivityLog( + id: id, +); +deleteActivityLogData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteActivityLog( + id: id, +).ref(); +ref.execute(); +``` + + +### createLevel +#### Required Arguments +```dart +String name = ...; +int xpRequired = ...; +ExampleConnector.instance.createLevel( + name: name, + xpRequired: xpRequired, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createLevel, we created `createLevelBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateLevelVariablesBuilder { + ... + CreateLevelVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + CreateLevelVariablesBuilder colors(AnyValue? t) { + _colors.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createLevel( + name: name, + xpRequired: xpRequired, +) +.icon(icon) +.colors(colors) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createLevel( + name: name, + xpRequired: xpRequired, +); +createLevelData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String name = ...; +int xpRequired = ...; + +final ref = ExampleConnector.instance.createLevel( + name: name, + xpRequired: xpRequired, +).ref(); +ref.execute(); +``` + + +### updateLevel +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateLevel( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateLevel, we created `updateLevelBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateLevelVariablesBuilder { + ... + UpdateLevelVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateLevelVariablesBuilder xpRequired(int? t) { + _xpRequired.value = t; + return this; + } + UpdateLevelVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + UpdateLevelVariablesBuilder colors(AnyValue? t) { + _colors.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateLevel( + id: id, +) +.name(name) +.xpRequired(xpRequired) +.icon(icon) +.colors(colors) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateLevel( + id: id, +); +updateLevelData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateLevel( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteLevel +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteLevel( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteLevel( + id: id, +); +deleteLevelData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteLevel( + id: id, +).ref(); +ref.execute(); +``` + + +### createMessage +#### Required Arguments +```dart +String conversationId = ...; +String senderId = ...; +String content = ...; +ExampleConnector.instance.createMessage( + conversationId: conversationId, + senderId: senderId, + content: content, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createMessage, we created `createMessageBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateMessageVariablesBuilder { + ... + CreateMessageVariablesBuilder isSystem(bool? t) { + _isSystem.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createMessage( + conversationId: conversationId, + senderId: senderId, + content: content, +) +.isSystem(isSystem) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createMessage( + conversationId: conversationId, + senderId: senderId, + content: content, +); +createMessageData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String conversationId = ...; +String senderId = ...; +String content = ...; + +final ref = ExampleConnector.instance.createMessage( + conversationId: conversationId, + senderId: senderId, + content: content, +).ref(); +ref.execute(); +``` + + +### updateMessage +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateMessage( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateMessage, we created `updateMessageBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateMessageVariablesBuilder { + ... + UpdateMessageVariablesBuilder conversationId(String? t) { + _conversationId.value = t; + return this; + } + UpdateMessageVariablesBuilder senderId(String? t) { + _senderId.value = t; + return this; + } + UpdateMessageVariablesBuilder content(String? t) { + _content.value = t; + return this; + } + UpdateMessageVariablesBuilder isSystem(bool? t) { + _isSystem.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateMessage( + id: id, +) +.conversationId(conversationId) +.senderId(senderId) +.content(content) +.isSystem(isSystem) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateMessage( + id: id, +); +updateMessageData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateMessage( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteMessage +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteMessage( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteMessage( + id: id, +); +deleteMessageData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteMessage( + id: id, +).ref(); +ref.execute(); +``` + + +### createRecentPayment +#### Required Arguments +```dart +String staffId = ...; +String applicationId = ...; +String invoiceId = ...; +ExampleConnector.instance.createRecentPayment( + staffId: staffId, + applicationId: applicationId, + invoiceId: invoiceId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createRecentPayment, we created `createRecentPaymentBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateRecentPaymentVariablesBuilder { + ... + + CreateRecentPaymentVariablesBuilder workedTime(String? t) { + _workedTime.value = t; + return this; + } + CreateRecentPaymentVariablesBuilder status(RecentPaymentStatus? t) { + _status.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createRecentPayment( + staffId: staffId, + applicationId: applicationId, + invoiceId: invoiceId, +) +.workedTime(workedTime) +.status(status) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createRecentPayment( + staffId: staffId, + applicationId: applicationId, + invoiceId: invoiceId, +); +createRecentPaymentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +String applicationId = ...; +String invoiceId = ...; + +final ref = ExampleConnector.instance.createRecentPayment( + staffId: staffId, + applicationId: applicationId, + invoiceId: invoiceId, +).ref(); +ref.execute(); +``` + + +### updateRecentPayment +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateRecentPayment( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateRecentPayment, we created `updateRecentPaymentBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateRecentPaymentVariablesBuilder { + ... + UpdateRecentPaymentVariablesBuilder workedTime(String? t) { + _workedTime.value = t; + return this; + } + UpdateRecentPaymentVariablesBuilder status(RecentPaymentStatus? t) { + _status.value = t; + return this; + } + UpdateRecentPaymentVariablesBuilder staffId(String? t) { + _staffId.value = t; + return this; + } + UpdateRecentPaymentVariablesBuilder applicationId(String? t) { + _applicationId.value = t; + return this; + } + UpdateRecentPaymentVariablesBuilder invoiceId(String? t) { + _invoiceId.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateRecentPayment( + id: id, +) +.workedTime(workedTime) +.status(status) +.staffId(staffId) +.applicationId(applicationId) +.invoiceId(invoiceId) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateRecentPayment( + id: id, +); +updateRecentPaymentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateRecentPayment( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteRecentPayment +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteRecentPayment( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteRecentPayment( + id: id, +); +deleteRecentPaymentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteRecentPayment( + id: id, +).ref(); +ref.execute(); +``` + + +### createStaffRole +#### Required Arguments +```dart +String staffId = ...; +String roleId = ...; +ExampleConnector.instance.createStaffRole( + staffId: staffId, + roleId: roleId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createStaffRole, we created `createStaffRoleBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateStaffRoleVariablesBuilder { + ... + CreateStaffRoleVariablesBuilder roleType(RoleType? t) { + _roleType.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createStaffRole( + staffId: staffId, + roleId: roleId, +) +.roleType(roleType) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createStaffRole( + staffId: staffId, + roleId: roleId, +); +createStaffRoleData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +String roleId = ...; + +final ref = ExampleConnector.instance.createStaffRole( + staffId: staffId, + roleId: roleId, +).ref(); +ref.execute(); +``` + + +### deleteStaffRole +#### Required Arguments +```dart +String staffId = ...; +String roleId = ...; +ExampleConnector.instance.deleteStaffRole( + staffId: staffId, + roleId: roleId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteStaffRole( + staffId: staffId, + roleId: roleId, +); +deleteStaffRoleData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +String roleId = ...; + +final ref = ExampleConnector.instance.deleteStaffRole( + staffId: staffId, + roleId: roleId, +).ref(); +ref.execute(); +``` + + +### CreateAssignment +#### Required Arguments +```dart +String workforceId = ...; +String roleId = ...; +String shiftId = ...; +ExampleConnector.instance.createAssignment( + workforceId: workforceId, + roleId: roleId, + shiftId: shiftId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For CreateAssignment, we created `CreateAssignmentBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateAssignmentVariablesBuilder { + ... + CreateAssignmentVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + CreateAssignmentVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + CreateAssignmentVariablesBuilder instructions(String? t) { + _instructions.value = t; + return this; + } + CreateAssignmentVariablesBuilder status(AssignmentStatus? t) { + _status.value = t; + return this; + } + CreateAssignmentVariablesBuilder tipsAvailable(bool? t) { + _tipsAvailable.value = t; + return this; + } + CreateAssignmentVariablesBuilder travelTime(bool? t) { + _travelTime.value = t; + return this; + } + CreateAssignmentVariablesBuilder mealProvided(bool? t) { + _mealProvided.value = t; + return this; + } + CreateAssignmentVariablesBuilder parkingAvailable(bool? t) { + _parkingAvailable.value = t; + return this; + } + CreateAssignmentVariablesBuilder gasCompensation(bool? t) { + _gasCompensation.value = t; + return this; + } + CreateAssignmentVariablesBuilder managers(List? t) { + _managers.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createAssignment( + workforceId: workforceId, + roleId: roleId, + shiftId: shiftId, +) +.title(title) +.description(description) +.instructions(instructions) +.status(status) +.tipsAvailable(tipsAvailable) +.travelTime(travelTime) +.mealProvided(mealProvided) +.parkingAvailable(parkingAvailable) +.gasCompensation(gasCompensation) +.managers(managers) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createAssignment( + workforceId: workforceId, + roleId: roleId, + shiftId: shiftId, +); +CreateAssignmentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String workforceId = ...; +String roleId = ...; +String shiftId = ...; + +final ref = ExampleConnector.instance.createAssignment( + workforceId: workforceId, + roleId: roleId, + shiftId: shiftId, +).ref(); +ref.execute(); +``` + + +### UpdateAssignment +#### Required Arguments +```dart +String id = ...; +String roleId = ...; +String shiftId = ...; +ExampleConnector.instance.updateAssignment( + id: id, + roleId: roleId, + shiftId: shiftId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For UpdateAssignment, we created `UpdateAssignmentBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateAssignmentVariablesBuilder { + ... + UpdateAssignmentVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + UpdateAssignmentVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + UpdateAssignmentVariablesBuilder instructions(String? t) { + _instructions.value = t; + return this; + } + UpdateAssignmentVariablesBuilder status(AssignmentStatus? t) { + _status.value = t; + return this; + } + UpdateAssignmentVariablesBuilder tipsAvailable(bool? t) { + _tipsAvailable.value = t; + return this; + } + UpdateAssignmentVariablesBuilder travelTime(bool? t) { + _travelTime.value = t; + return this; + } + UpdateAssignmentVariablesBuilder mealProvided(bool? t) { + _mealProvided.value = t; + return this; + } + UpdateAssignmentVariablesBuilder parkingAvailable(bool? t) { + _parkingAvailable.value = t; + return this; + } + UpdateAssignmentVariablesBuilder gasCompensation(bool? t) { + _gasCompensation.value = t; + return this; + } + UpdateAssignmentVariablesBuilder managers(List? t) { + _managers.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateAssignment( + id: id, + roleId: roleId, + shiftId: shiftId, +) +.title(title) +.description(description) +.instructions(instructions) +.status(status) +.tipsAvailable(tipsAvailable) +.travelTime(travelTime) +.mealProvided(mealProvided) +.parkingAvailable(parkingAvailable) +.gasCompensation(gasCompensation) +.managers(managers) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateAssignment( + id: id, + roleId: roleId, + shiftId: shiftId, +); +UpdateAssignmentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; +String roleId = ...; +String shiftId = ...; + +final ref = ExampleConnector.instance.updateAssignment( + id: id, + roleId: roleId, + shiftId: shiftId, +).ref(); +ref.execute(); +``` + + +### DeleteAssignment +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteAssignment( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteAssignment( + id: id, +); +DeleteAssignmentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteAssignment( + id: id, +).ref(); +ref.execute(); +``` + + +### createCustomRateCard +#### Required Arguments +```dart +String name = ...; +ExampleConnector.instance.createCustomRateCard( + name: name, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createCustomRateCard, we created `createCustomRateCardBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateCustomRateCardVariablesBuilder { + ... + CreateCustomRateCardVariablesBuilder baseBook(String? t) { + _baseBook.value = t; + return this; + } + CreateCustomRateCardVariablesBuilder discount(double? t) { + _discount.value = t; + return this; + } + CreateCustomRateCardVariablesBuilder isDefault(bool? t) { + _isDefault.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createCustomRateCard( + name: name, +) +.baseBook(baseBook) +.discount(discount) +.isDefault(isDefault) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createCustomRateCard( + name: name, +); +createCustomRateCardData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String name = ...; + +final ref = ExampleConnector.instance.createCustomRateCard( + name: name, +).ref(); +ref.execute(); +``` + + +### updateCustomRateCard +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateCustomRateCard( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateCustomRateCard, we created `updateCustomRateCardBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateCustomRateCardVariablesBuilder { + ... + UpdateCustomRateCardVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateCustomRateCardVariablesBuilder baseBook(String? t) { + _baseBook.value = t; + return this; + } + UpdateCustomRateCardVariablesBuilder discount(double? t) { + _discount.value = t; + return this; + } + UpdateCustomRateCardVariablesBuilder isDefault(bool? t) { + _isDefault.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateCustomRateCard( + id: id, +) +.name(name) +.baseBook(baseBook) +.discount(discount) +.isDefault(isDefault) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateCustomRateCard( + id: id, +); +updateCustomRateCardData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateCustomRateCard( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteCustomRateCard +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteCustomRateCard( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteCustomRateCard( + id: id, +); +deleteCustomRateCardData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteCustomRateCard( + id: id, +).ref(); +ref.execute(); +``` + + +### createInvoiceTemplate +#### Required Arguments +```dart +String name = ...; +String ownerId = ...; +ExampleConnector.instance.createInvoiceTemplate( + name: name, + ownerId: ownerId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createInvoiceTemplate, we created `createInvoiceTemplateBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateInvoiceTemplateVariablesBuilder { + ... + CreateInvoiceTemplateVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder businessId(String? t) { + _businessId.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder orderId(String? t) { + _orderId.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder paymentTerms(InovicePaymentTermsTemp? t) { + _paymentTerms.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder invoiceNumber(String? t) { + _invoiceNumber.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder issueDate(Timestamp? t) { + _issueDate.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder dueDate(Timestamp? t) { + _dueDate.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder hub(String? t) { + _hub.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder managerName(String? t) { + _managerName.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder vendorNumber(String? t) { + _vendorNumber.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder roles(AnyValue? t) { + _roles.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder charges(AnyValue? t) { + _charges.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder otherCharges(double? t) { + _otherCharges.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder subtotal(double? t) { + _subtotal.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder amount(double? t) { + _amount.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder staffCount(int? t) { + _staffCount.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder chargesCount(int? t) { + _chargesCount.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createInvoiceTemplate( + name: name, + ownerId: ownerId, +) +.vendorId(vendorId) +.businessId(businessId) +.orderId(orderId) +.paymentTerms(paymentTerms) +.invoiceNumber(invoiceNumber) +.issueDate(issueDate) +.dueDate(dueDate) +.hub(hub) +.managerName(managerName) +.vendorNumber(vendorNumber) +.roles(roles) +.charges(charges) +.otherCharges(otherCharges) +.subtotal(subtotal) +.amount(amount) +.notes(notes) +.staffCount(staffCount) +.chargesCount(chargesCount) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createInvoiceTemplate( + name: name, + ownerId: ownerId, +); +createInvoiceTemplateData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String name = ...; +String ownerId = ...; + +final ref = ExampleConnector.instance.createInvoiceTemplate( + name: name, + ownerId: ownerId, +).ref(); +ref.execute(); +``` + + +### updateInvoiceTemplate +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateInvoiceTemplate( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateInvoiceTemplate, we created `updateInvoiceTemplateBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateInvoiceTemplateVariablesBuilder { + ... + UpdateInvoiceTemplateVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder ownerId(String? t) { + _ownerId.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder businessId(String? t) { + _businessId.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder orderId(String? t) { + _orderId.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder paymentTerms(InovicePaymentTermsTemp? t) { + _paymentTerms.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder invoiceNumber(String? t) { + _invoiceNumber.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder issueDate(Timestamp? t) { + _issueDate.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder dueDate(Timestamp? t) { + _dueDate.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder hub(String? t) { + _hub.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder managerName(String? t) { + _managerName.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder vendorNumber(String? t) { + _vendorNumber.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder roles(AnyValue? t) { + _roles.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder charges(AnyValue? t) { + _charges.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder otherCharges(double? t) { + _otherCharges.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder subtotal(double? t) { + _subtotal.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder amount(double? t) { + _amount.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder staffCount(int? t) { + _staffCount.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder chargesCount(int? t) { + _chargesCount.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateInvoiceTemplate( + id: id, +) +.name(name) +.ownerId(ownerId) +.vendorId(vendorId) +.businessId(businessId) +.orderId(orderId) +.paymentTerms(paymentTerms) +.invoiceNumber(invoiceNumber) +.issueDate(issueDate) +.dueDate(dueDate) +.hub(hub) +.managerName(managerName) +.vendorNumber(vendorNumber) +.roles(roles) +.charges(charges) +.otherCharges(otherCharges) +.subtotal(subtotal) +.amount(amount) +.notes(notes) +.staffCount(staffCount) +.chargesCount(chargesCount) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateInvoiceTemplate( + id: id, +); +updateInvoiceTemplateData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateInvoiceTemplate( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteInvoiceTemplate +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteInvoiceTemplate( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteInvoiceTemplate( + id: id, +); +deleteInvoiceTemplateData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteInvoiceTemplate( + id: id, +).ref(); +ref.execute(); +``` + + +### createStaffDocument +#### Required Arguments +```dart +String staffId = ...; +String staffName = ...; +String documentId = ...; +DocumentStatus status = ...; +ExampleConnector.instance.createStaffDocument( + staffId: staffId, + staffName: staffName, + documentId: documentId, + status: status, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createStaffDocument, we created `createStaffDocumentBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateStaffDocumentVariablesBuilder { + ... + CreateStaffDocumentVariablesBuilder documentUrl(String? t) { + _documentUrl.value = t; + return this; + } + CreateStaffDocumentVariablesBuilder expiryDate(Timestamp? t) { + _expiryDate.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createStaffDocument( + staffId: staffId, + staffName: staffName, + documentId: documentId, + status: status, +) +.documentUrl(documentUrl) +.expiryDate(expiryDate) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createStaffDocument( + staffId: staffId, + staffName: staffName, + documentId: documentId, + status: status, +); +createStaffDocumentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +String staffName = ...; +String documentId = ...; +DocumentStatus status = ...; + +final ref = ExampleConnector.instance.createStaffDocument( + staffId: staffId, + staffName: staffName, + documentId: documentId, + status: status, +).ref(); +ref.execute(); +``` + + +### updateStaffDocument +#### Required Arguments +```dart +String staffId = ...; +String documentId = ...; +ExampleConnector.instance.updateStaffDocument( + staffId: staffId, + documentId: documentId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateStaffDocument, we created `updateStaffDocumentBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateStaffDocumentVariablesBuilder { + ... + UpdateStaffDocumentVariablesBuilder status(DocumentStatus? t) { + _status.value = t; + return this; + } + UpdateStaffDocumentVariablesBuilder documentUrl(String? t) { + _documentUrl.value = t; + return this; + } + UpdateStaffDocumentVariablesBuilder expiryDate(Timestamp? t) { + _expiryDate.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateStaffDocument( + staffId: staffId, + documentId: documentId, +) +.status(status) +.documentUrl(documentUrl) +.expiryDate(expiryDate) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateStaffDocument( + staffId: staffId, + documentId: documentId, +); +updateStaffDocumentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +String documentId = ...; + +final ref = ExampleConnector.instance.updateStaffDocument( + staffId: staffId, + documentId: documentId, +).ref(); +ref.execute(); +``` + + +### deleteStaffDocument +#### Required Arguments +```dart +String staffId = ...; +String documentId = ...; +ExampleConnector.instance.deleteStaffDocument( + staffId: staffId, + documentId: documentId, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteStaffDocument( + staffId: staffId, + documentId: documentId, +); +deleteStaffDocumentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String staffId = ...; +String documentId = ...; + +final ref = ExampleConnector.instance.deleteStaffDocument( + staffId: staffId, + documentId: documentId, +).ref(); +ref.execute(); +``` + + +### createCategory +#### Required Arguments +```dart +String categoryId = ...; +String label = ...; +ExampleConnector.instance.createCategory( + categoryId: categoryId, + label: label, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createCategory, we created `createCategoryBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateCategoryVariablesBuilder { + ... + CreateCategoryVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createCategory( + categoryId: categoryId, + label: label, +) +.icon(icon) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createCategory( + categoryId: categoryId, + label: label, +); +createCategoryData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String categoryId = ...; +String label = ...; + +final ref = ExampleConnector.instance.createCategory( + categoryId: categoryId, + label: label, +).ref(); +ref.execute(); +``` + + +### updateCategory +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateCategory( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateCategory, we created `updateCategoryBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateCategoryVariablesBuilder { + ... + UpdateCategoryVariablesBuilder categoryId(String? t) { + _categoryId.value = t; + return this; + } + UpdateCategoryVariablesBuilder label(String? t) { + _label.value = t; + return this; + } + UpdateCategoryVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateCategory( + id: id, +) +.categoryId(categoryId) +.label(label) +.icon(icon) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateCategory( + id: id, +); +updateCategoryData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateCategory( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteCategory +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteCategory( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteCategory( + id: id, +); +deleteCategoryData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteCategory( + id: id, +).ref(); +ref.execute(); +``` + + +### createHub +#### Required Arguments +```dart +String name = ...; +String ownerId = ...; +ExampleConnector.instance.createHub( + name: name, + ownerId: ownerId, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createHub, we created `createHubBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateHubVariablesBuilder { + ... + CreateHubVariablesBuilder locationName(String? t) { + _locationName.value = t; + return this; + } + CreateHubVariablesBuilder address(String? t) { + _address.value = t; + return this; + } + CreateHubVariablesBuilder nfcTagId(String? t) { + _nfcTagId.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createHub( + name: name, + ownerId: ownerId, +) +.locationName(locationName) +.address(address) +.nfcTagId(nfcTagId) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createHub( + name: name, + ownerId: ownerId, +); +createHubData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String name = ...; +String ownerId = ...; + +final ref = ExampleConnector.instance.createHub( + name: name, + ownerId: ownerId, +).ref(); +ref.execute(); +``` + + +### updateHub +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateHub( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateHub, we created `updateHubBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateHubVariablesBuilder { + ... + UpdateHubVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateHubVariablesBuilder locationName(String? t) { + _locationName.value = t; + return this; + } + UpdateHubVariablesBuilder address(String? t) { + _address.value = t; + return this; + } + UpdateHubVariablesBuilder nfcTagId(String? t) { + _nfcTagId.value = t; + return this; + } + UpdateHubVariablesBuilder ownerId(String? t) { + _ownerId.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateHub( + id: id, +) +.name(name) +.locationName(locationName) +.address(address) +.nfcTagId(nfcTagId) +.ownerId(ownerId) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateHub( + id: id, +); +updateHubData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateHub( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteHub +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteHub( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteHub( + id: id, +); +deleteHubData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteHub( + id: id, +).ref(); +ref.execute(); +``` + + +### createTaskComment +#### Required Arguments +```dart +String taskId = ...; +String teamMemberId = ...; +String comment = ...; +ExampleConnector.instance.createTaskComment( + taskId: taskId, + teamMemberId: teamMemberId, + comment: comment, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createTaskComment, we created `createTaskCommentBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateTaskCommentVariablesBuilder { + ... + CreateTaskCommentVariablesBuilder isSystem(bool? t) { + _isSystem.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createTaskComment( + taskId: taskId, + teamMemberId: teamMemberId, + comment: comment, +) +.isSystem(isSystem) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createTaskComment( + taskId: taskId, + teamMemberId: teamMemberId, + comment: comment, +); +createTaskCommentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String taskId = ...; +String teamMemberId = ...; +String comment = ...; + +final ref = ExampleConnector.instance.createTaskComment( + taskId: taskId, + teamMemberId: teamMemberId, + comment: comment, +).ref(); +ref.execute(); +``` + + +### updateTaskComment +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateTaskComment( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateTaskComment, we created `updateTaskCommentBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateTaskCommentVariablesBuilder { + ... + UpdateTaskCommentVariablesBuilder comment(String? t) { + _comment.value = t; + return this; + } + UpdateTaskCommentVariablesBuilder isSystem(bool? t) { + _isSystem.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateTaskComment( + id: id, +) +.comment(comment) +.isSystem(isSystem) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateTaskComment( + id: id, +); +updateTaskCommentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateTaskComment( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteTaskComment +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteTaskComment( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteTaskComment( + id: id, +); +deleteTaskCommentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteTaskComment( + id: id, +).ref(); +ref.execute(); +``` + + +### createDocument +#### Required Arguments +```dart +DocumentType documentType = ...; +String name = ...; +ExampleConnector.instance.createDocument( + documentType: documentType, + name: name, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createDocument, we created `createDocumentBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateDocumentVariablesBuilder { + ... + CreateDocumentVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createDocument( + documentType: documentType, + name: name, +) +.description(description) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createDocument( + documentType: documentType, + name: name, +); +createDocumentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +DocumentType documentType = ...; +String name = ...; + +final ref = ExampleConnector.instance.createDocument( + documentType: documentType, + name: name, +).ref(); +ref.execute(); +``` + + +### updateDocument +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateDocument( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateDocument, we created `updateDocumentBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateDocumentVariablesBuilder { + ... + UpdateDocumentVariablesBuilder documentType(DocumentType? t) { + _documentType.value = t; + return this; + } + UpdateDocumentVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateDocumentVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateDocument( + id: id, +) +.documentType(documentType) +.name(name) +.description(description) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateDocument( + id: id, +); +updateDocumentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateDocument( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteDocument +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteDocument( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteDocument( + id: id, +); +deleteDocumentData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteDocument( + id: id, +).ref(); +ref.execute(); +``` + + +### createVendor +#### Required Arguments +```dart +String userId = ...; +String companyName = ...; +ExampleConnector.instance.createVendor( + userId: userId, + companyName: companyName, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createVendor, we created `createVendorBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateVendorVariablesBuilder { + ... + CreateVendorVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + CreateVendorVariablesBuilder phone(String? t) { + _phone.value = t; + return this; + } + CreateVendorVariablesBuilder photoUrl(String? t) { + _photoUrl.value = t; + return this; + } + CreateVendorVariablesBuilder address(String? t) { + _address.value = t; + return this; + } + CreateVendorVariablesBuilder billingAddress(String? t) { + _billingAddress.value = t; + return this; + } + CreateVendorVariablesBuilder timezone(String? t) { + _timezone.value = t; + return this; + } + CreateVendorVariablesBuilder legalName(String? t) { + _legalName.value = t; + return this; + } + CreateVendorVariablesBuilder doingBusinessAs(String? t) { + _doingBusinessAs.value = t; + return this; + } + CreateVendorVariablesBuilder region(String? t) { + _region.value = t; + return this; + } + CreateVendorVariablesBuilder state(String? t) { + _state.value = t; + return this; + } + CreateVendorVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + CreateVendorVariablesBuilder serviceSpecialty(String? t) { + _serviceSpecialty.value = t; + return this; + } + CreateVendorVariablesBuilder approvalStatus(ApprovalStatus? t) { + _approvalStatus.value = t; + return this; + } + CreateVendorVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + CreateVendorVariablesBuilder markup(double? t) { + _markup.value = t; + return this; + } + CreateVendorVariablesBuilder fee(double? t) { + _fee.value = t; + return this; + } + CreateVendorVariablesBuilder csat(double? t) { + _csat.value = t; + return this; + } + CreateVendorVariablesBuilder tier(VendorTier? t) { + _tier.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createVendor( + userId: userId, + companyName: companyName, +) +.email(email) +.phone(phone) +.photoUrl(photoUrl) +.address(address) +.billingAddress(billingAddress) +.timezone(timezone) +.legalName(legalName) +.doingBusinessAs(doingBusinessAs) +.region(region) +.state(state) +.city(city) +.serviceSpecialty(serviceSpecialty) +.approvalStatus(approvalStatus) +.isActive(isActive) +.markup(markup) +.fee(fee) +.csat(csat) +.tier(tier) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createVendor( + userId: userId, + companyName: companyName, +); +createVendorData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String userId = ...; +String companyName = ...; + +final ref = ExampleConnector.instance.createVendor( + userId: userId, + companyName: companyName, +).ref(); +ref.execute(); +``` + + +### updateVendor +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateVendor( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateVendor, we created `updateVendorBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateVendorVariablesBuilder { + ... + UpdateVendorVariablesBuilder companyName(String? t) { + _companyName.value = t; + return this; + } + UpdateVendorVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + UpdateVendorVariablesBuilder phone(String? t) { + _phone.value = t; + return this; + } + UpdateVendorVariablesBuilder photoUrl(String? t) { + _photoUrl.value = t; + return this; + } + UpdateVendorVariablesBuilder address(String? t) { + _address.value = t; + return this; + } + UpdateVendorVariablesBuilder billingAddress(String? t) { + _billingAddress.value = t; + return this; + } + UpdateVendorVariablesBuilder timezone(String? t) { + _timezone.value = t; + return this; + } + UpdateVendorVariablesBuilder legalName(String? t) { + _legalName.value = t; + return this; + } + UpdateVendorVariablesBuilder doingBusinessAs(String? t) { + _doingBusinessAs.value = t; + return this; + } + UpdateVendorVariablesBuilder region(String? t) { + _region.value = t; + return this; + } + UpdateVendorVariablesBuilder state(String? t) { + _state.value = t; + return this; + } + UpdateVendorVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + UpdateVendorVariablesBuilder serviceSpecialty(String? t) { + _serviceSpecialty.value = t; + return this; + } + UpdateVendorVariablesBuilder approvalStatus(ApprovalStatus? t) { + _approvalStatus.value = t; + return this; + } + UpdateVendorVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + UpdateVendorVariablesBuilder markup(double? t) { + _markup.value = t; + return this; + } + UpdateVendorVariablesBuilder fee(double? t) { + _fee.value = t; + return this; + } + UpdateVendorVariablesBuilder csat(double? t) { + _csat.value = t; + return this; + } + UpdateVendorVariablesBuilder tier(VendorTier? t) { + _tier.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateVendor( + id: id, +) +.companyName(companyName) +.email(email) +.phone(phone) +.photoUrl(photoUrl) +.address(address) +.billingAddress(billingAddress) +.timezone(timezone) +.legalName(legalName) +.doingBusinessAs(doingBusinessAs) +.region(region) +.state(state) +.city(city) +.serviceSpecialty(serviceSpecialty) +.approvalStatus(approvalStatus) +.isActive(isActive) +.markup(markup) +.fee(fee) +.csat(csat) +.tier(tier) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateVendor( + id: id, +); +updateVendorData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateVendor( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteVendor +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteVendor( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteVendor( + id: id, +); +deleteVendorData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteVendor( + id: id, +).ref(); +ref.execute(); +``` + + +### createFaqData +#### Required Arguments +```dart +String category = ...; +ExampleConnector.instance.createFaqData( + category: category, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For createFaqData, we created `createFaqDataBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class CreateFaqDataVariablesBuilder { + ... + CreateFaqDataVariablesBuilder questions(List? t) { + _questions.value = t; + return this; + } + + ... +} +ExampleConnector.instance.createFaqData( + category: category, +) +.questions(questions) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.createFaqData( + category: category, +); +createFaqDataData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String category = ...; + +final ref = ExampleConnector.instance.createFaqData( + category: category, +).ref(); +ref.execute(); +``` + + +### updateFaqData +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.updateFaqData( + id: id, +).execute(); +``` + +#### Optional Arguments +We return a builder for each query. For updateFaqData, we created `updateFaqDataBuilder`. For queries and mutations with optional parameters, we return a builder class. +The builder pattern allows Data Connect to distinguish between fields that haven't been set and fields that have been set to null. A field can be set by calling its respective setter method like below: +```dart +class UpdateFaqDataVariablesBuilder { + ... + UpdateFaqDataVariablesBuilder category(String? t) { + _category.value = t; + return this; + } + UpdateFaqDataVariablesBuilder questions(List? t) { + _questions.value = t; + return this; + } + + ... +} +ExampleConnector.instance.updateFaqData( + id: id, +) +.category(category) +.questions(questions) +.execute(); +``` + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.updateFaqData( + id: id, +); +updateFaqDataData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.updateFaqData( + id: id, +).ref(); +ref.execute(); +``` + + +### deleteFaqData +#### Required Arguments +```dart +String id = ...; +ExampleConnector.instance.deleteFaqData( + id: id, +).execute(); +``` + + + +#### Return Type +`execute()` returns a `OperationResult` +```dart +/// Result of an Operation Request (query/mutation). +class OperationResult { + OperationResult(this.dataConnect, this.data, this.ref); + Data data; + OperationRef ref; + FirebaseDataConnect dataConnect; +} + +final result = await ExampleConnector.instance.deleteFaqData( + id: id, +); +deleteFaqDataData data = result.data; +final ref = result.ref; +``` + +#### Getting the Ref +Each builder returns an `execute` function, which is a helper function that creates a `Ref` object, and executes the underlying operation. +An example of how to use the `Ref` object is shown below: +```dart +String id = ...; + +final ref = ExampleConnector.instance.deleteFaqData( + id: id, +).ref(); +ref.execute(); +``` + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/accept_invite_by_code.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/accept_invite_by_code.dart new file mode 100644 index 00000000..62eedb2c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/accept_invite_by_code.dart @@ -0,0 +1,88 @@ +part of 'generated.dart'; + +class AcceptInviteByCodeVariablesBuilder { + String inviteCode; + + final FirebaseDataConnect _dataConnect; + AcceptInviteByCodeVariablesBuilder(this._dataConnect, {required this.inviteCode,}); + Deserializer dataDeserializer = (dynamic json) => AcceptInviteByCodeData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (AcceptInviteByCodeVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + AcceptInviteByCodeVariables vars= AcceptInviteByCodeVariables(inviteCode: inviteCode,); + return _dataConnect.mutation("acceptInviteByCode", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class AcceptInviteByCodeData { + final int teamMember_updateMany; + AcceptInviteByCodeData.fromJson(dynamic json): + + teamMember_updateMany = nativeFromJson(json['teamMember_updateMany']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final AcceptInviteByCodeData otherTyped = other as AcceptInviteByCodeData; + return teamMember_updateMany == otherTyped.teamMember_updateMany; + + } + @override + int get hashCode => teamMember_updateMany.hashCode; + + + Map toJson() { + Map json = {}; + json['teamMember_updateMany'] = nativeToJson(teamMember_updateMany); + return json; + } + + AcceptInviteByCodeData({ + required this.teamMember_updateMany, + }); +} + +@immutable +class AcceptInviteByCodeVariables { + final String inviteCode; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + AcceptInviteByCodeVariables.fromJson(Map json): + + inviteCode = nativeFromJson(json['inviteCode']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final AcceptInviteByCodeVariables otherTyped = other as AcceptInviteByCodeVariables; + return inviteCode == otherTyped.inviteCode; + + } + @override + int get hashCode => inviteCode.hashCode; + + + Map toJson() { + Map json = {}; + json['inviteCode'] = nativeToJson(inviteCode); + return json; + } + + AcceptInviteByCodeVariables({ + required this.inviteCode, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/cancel_invite_by_code.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/cancel_invite_by_code.dart new file mode 100644 index 00000000..5ca855a8 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/cancel_invite_by_code.dart @@ -0,0 +1,88 @@ +part of 'generated.dart'; + +class CancelInviteByCodeVariablesBuilder { + String inviteCode; + + final FirebaseDataConnect _dataConnect; + CancelInviteByCodeVariablesBuilder(this._dataConnect, {required this.inviteCode,}); + Deserializer dataDeserializer = (dynamic json) => CancelInviteByCodeData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CancelInviteByCodeVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CancelInviteByCodeVariables vars= CancelInviteByCodeVariables(inviteCode: inviteCode,); + return _dataConnect.mutation("cancelInviteByCode", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CancelInviteByCodeData { + final int teamMember_updateMany; + CancelInviteByCodeData.fromJson(dynamic json): + + teamMember_updateMany = nativeFromJson(json['teamMember_updateMany']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CancelInviteByCodeData otherTyped = other as CancelInviteByCodeData; + return teamMember_updateMany == otherTyped.teamMember_updateMany; + + } + @override + int get hashCode => teamMember_updateMany.hashCode; + + + Map toJson() { + Map json = {}; + json['teamMember_updateMany'] = nativeToJson(teamMember_updateMany); + return json; + } + + CancelInviteByCodeData({ + required this.teamMember_updateMany, + }); +} + +@immutable +class CancelInviteByCodeVariables { + final String inviteCode; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CancelInviteByCodeVariables.fromJson(Map json): + + inviteCode = nativeFromJson(json['inviteCode']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CancelInviteByCodeVariables otherTyped = other as CancelInviteByCodeVariables; + return inviteCode == otherTyped.inviteCode; + + } + @override + int get hashCode => inviteCode.hashCode; + + + Map toJson() { + Map json = {}; + json['inviteCode'] = nativeToJson(inviteCode); + return json; + } + + CancelInviteByCodeVariables({ + required this.inviteCode, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_account.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_account.dart new file mode 100644 index 00000000..c1bc9a4d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_account.dart @@ -0,0 +1,163 @@ +part of 'generated.dart'; + +class CreateAccountVariablesBuilder { + String bank; + AccountType type; + String last4; + Optional _isPrimary = Optional.optional(nativeFromJson, nativeToJson); + String ownerId; + + final FirebaseDataConnect _dataConnect; CreateAccountVariablesBuilder isPrimary(bool? t) { + _isPrimary.value = t; + return this; + } + + CreateAccountVariablesBuilder(this._dataConnect, {required this.bank,required this.type,required this.last4,required this.ownerId,}); + Deserializer dataDeserializer = (dynamic json) => CreateAccountData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateAccountVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateAccountVariables vars= CreateAccountVariables(bank: bank,type: type,last4: last4,isPrimary: _isPrimary,ownerId: ownerId,); + return _dataConnect.mutation("createAccount", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateAccountAccountInsert { + final String id; + CreateAccountAccountInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateAccountAccountInsert otherTyped = other as CreateAccountAccountInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateAccountAccountInsert({ + required this.id, + }); +} + +@immutable +class CreateAccountData { + final CreateAccountAccountInsert account_insert; + CreateAccountData.fromJson(dynamic json): + + account_insert = CreateAccountAccountInsert.fromJson(json['account_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateAccountData otherTyped = other as CreateAccountData; + return account_insert == otherTyped.account_insert; + + } + @override + int get hashCode => account_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['account_insert'] = account_insert.toJson(); + return json; + } + + CreateAccountData({ + required this.account_insert, + }); +} + +@immutable +class CreateAccountVariables { + final String bank; + final AccountType type; + final String last4; + late final OptionalisPrimary; + final String ownerId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateAccountVariables.fromJson(Map json): + + bank = nativeFromJson(json['bank']), + type = AccountType.values.byName(json['type']), + last4 = nativeFromJson(json['last4']), + ownerId = nativeFromJson(json['ownerId']) { + + + + + + isPrimary = Optional.optional(nativeFromJson, nativeToJson); + isPrimary.value = json['isPrimary'] == null ? null : nativeFromJson(json['isPrimary']); + + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateAccountVariables otherTyped = other as CreateAccountVariables; + return bank == otherTyped.bank && + type == otherTyped.type && + last4 == otherTyped.last4 && + isPrimary == otherTyped.isPrimary && + ownerId == otherTyped.ownerId; + + } + @override + int get hashCode => Object.hashAll([bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode]); + + + Map toJson() { + Map json = {}; + json['bank'] = nativeToJson(bank); + json['type'] = + type.name + ; + json['last4'] = nativeToJson(last4); + if(isPrimary.state == OptionalState.set) { + json['isPrimary'] = isPrimary.toJson(); + } + json['ownerId'] = nativeToJson(ownerId); + return json; + } + + CreateAccountVariables({ + required this.bank, + required this.type, + required this.last4, + required this.isPrimary, + required this.ownerId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_activity_log.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_activity_log.dart new file mode 100644 index 00000000..223fce9b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_activity_log.dart @@ -0,0 +1,245 @@ +part of 'generated.dart'; + +class CreateActivityLogVariablesBuilder { + String userId; + Timestamp date; + Optional _hourStart = Optional.optional(nativeFromJson, nativeToJson); + Optional _hourEnd = Optional.optional(nativeFromJson, nativeToJson); + Optional _totalhours = Optional.optional(nativeFromJson, nativeToJson); + Optional _iconType = Optional.optional((data) => ActivityIconType.values.byName(data), enumSerializer); + Optional _iconColor = Optional.optional(nativeFromJson, nativeToJson); + String title; + String description; + Optional _isRead = Optional.optional(nativeFromJson, nativeToJson); + ActivityType activityType; + + final FirebaseDataConnect _dataConnect; CreateActivityLogVariablesBuilder hourStart(String? t) { + _hourStart.value = t; + return this; + } + CreateActivityLogVariablesBuilder hourEnd(String? t) { + _hourEnd.value = t; + return this; + } + CreateActivityLogVariablesBuilder totalhours(String? t) { + _totalhours.value = t; + return this; + } + CreateActivityLogVariablesBuilder iconType(ActivityIconType? t) { + _iconType.value = t; + return this; + } + CreateActivityLogVariablesBuilder iconColor(String? t) { + _iconColor.value = t; + return this; + } + CreateActivityLogVariablesBuilder isRead(bool? t) { + _isRead.value = t; + return this; + } + + CreateActivityLogVariablesBuilder(this._dataConnect, {required this.userId,required this.date,required this.title,required this.description,required this.activityType,}); + Deserializer dataDeserializer = (dynamic json) => CreateActivityLogData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateActivityLogVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateActivityLogVariables vars= CreateActivityLogVariables(userId: userId,date: date,hourStart: _hourStart,hourEnd: _hourEnd,totalhours: _totalhours,iconType: _iconType,iconColor: _iconColor,title: title,description: description,isRead: _isRead,activityType: activityType,); + return _dataConnect.mutation("createActivityLog", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateActivityLogActivityLogInsert { + final String id; + CreateActivityLogActivityLogInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateActivityLogActivityLogInsert otherTyped = other as CreateActivityLogActivityLogInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateActivityLogActivityLogInsert({ + required this.id, + }); +} + +@immutable +class CreateActivityLogData { + final CreateActivityLogActivityLogInsert activityLog_insert; + CreateActivityLogData.fromJson(dynamic json): + + activityLog_insert = CreateActivityLogActivityLogInsert.fromJson(json['activityLog_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateActivityLogData otherTyped = other as CreateActivityLogData; + return activityLog_insert == otherTyped.activityLog_insert; + + } + @override + int get hashCode => activityLog_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['activityLog_insert'] = activityLog_insert.toJson(); + return json; + } + + CreateActivityLogData({ + required this.activityLog_insert, + }); +} + +@immutable +class CreateActivityLogVariables { + final String userId; + final Timestamp date; + late final OptionalhourStart; + late final OptionalhourEnd; + late final Optionaltotalhours; + late final OptionaliconType; + late final OptionaliconColor; + final String title; + final String description; + late final OptionalisRead; + final ActivityType activityType; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateActivityLogVariables.fromJson(Map json): + + userId = nativeFromJson(json['userId']), + date = Timestamp.fromJson(json['date']), + title = nativeFromJson(json['title']), + description = nativeFromJson(json['description']), + activityType = ActivityType.values.byName(json['activityType']) { + + + + + hourStart = Optional.optional(nativeFromJson, nativeToJson); + hourStart.value = json['hourStart'] == null ? null : nativeFromJson(json['hourStart']); + + + hourEnd = Optional.optional(nativeFromJson, nativeToJson); + hourEnd.value = json['hourEnd'] == null ? null : nativeFromJson(json['hourEnd']); + + + totalhours = Optional.optional(nativeFromJson, nativeToJson); + totalhours.value = json['totalhours'] == null ? null : nativeFromJson(json['totalhours']); + + + iconType = Optional.optional((data) => ActivityIconType.values.byName(data), enumSerializer); + iconType.value = json['iconType'] == null ? null : ActivityIconType.values.byName(json['iconType']); + + + iconColor = Optional.optional(nativeFromJson, nativeToJson); + iconColor.value = json['iconColor'] == null ? null : nativeFromJson(json['iconColor']); + + + + + isRead = Optional.optional(nativeFromJson, nativeToJson); + isRead.value = json['isRead'] == null ? null : nativeFromJson(json['isRead']); + + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateActivityLogVariables otherTyped = other as CreateActivityLogVariables; + return userId == otherTyped.userId && + date == otherTyped.date && + hourStart == otherTyped.hourStart && + hourEnd == otherTyped.hourEnd && + totalhours == otherTyped.totalhours && + iconType == otherTyped.iconType && + iconColor == otherTyped.iconColor && + title == otherTyped.title && + description == otherTyped.description && + isRead == otherTyped.isRead && + activityType == otherTyped.activityType; + + } + @override + int get hashCode => Object.hashAll([userId.hashCode, date.hashCode, hourStart.hashCode, hourEnd.hashCode, totalhours.hashCode, iconType.hashCode, iconColor.hashCode, title.hashCode, description.hashCode, isRead.hashCode, activityType.hashCode]); + + + Map toJson() { + Map json = {}; + json['userId'] = nativeToJson(userId); + json['date'] = date.toJson(); + if(hourStart.state == OptionalState.set) { + json['hourStart'] = hourStart.toJson(); + } + if(hourEnd.state == OptionalState.set) { + json['hourEnd'] = hourEnd.toJson(); + } + if(totalhours.state == OptionalState.set) { + json['totalhours'] = totalhours.toJson(); + } + if(iconType.state == OptionalState.set) { + json['iconType'] = iconType.toJson(); + } + if(iconColor.state == OptionalState.set) { + json['iconColor'] = iconColor.toJson(); + } + json['title'] = nativeToJson(title); + json['description'] = nativeToJson(description); + if(isRead.state == OptionalState.set) { + json['isRead'] = isRead.toJson(); + } + json['activityType'] = + activityType.name + ; + return json; + } + + CreateActivityLogVariables({ + required this.userId, + required this.date, + required this.hourStart, + required this.hourEnd, + required this.totalhours, + required this.iconType, + required this.iconColor, + required this.title, + required this.description, + required this.isRead, + required this.activityType, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_application.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_application.dart new file mode 100644 index 00000000..8b4fd8f1 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_application.dart @@ -0,0 +1,187 @@ +part of 'generated.dart'; + +class CreateApplicationVariablesBuilder { + String shiftId; + String staffId; + ApplicationStatus status; + Optional _checkInTime = Optional.optional((json) => json['checkInTime'] = Timestamp.fromJson(json['checkInTime']), defaultSerializer); + Optional _checkOutTime = Optional.optional((json) => json['checkOutTime'] = Timestamp.fromJson(json['checkOutTime']), defaultSerializer); + ApplicationOrigin origin; + String roleId; + + final FirebaseDataConnect _dataConnect; CreateApplicationVariablesBuilder checkInTime(Timestamp? t) { + _checkInTime.value = t; + return this; + } + CreateApplicationVariablesBuilder checkOutTime(Timestamp? t) { + _checkOutTime.value = t; + return this; + } + + CreateApplicationVariablesBuilder(this._dataConnect, {required this.shiftId,required this.staffId,required this.status,required this.origin,required this.roleId,}); + Deserializer dataDeserializer = (dynamic json) => CreateApplicationData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateApplicationVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateApplicationVariables vars= CreateApplicationVariables(shiftId: shiftId,staffId: staffId,status: status,checkInTime: _checkInTime,checkOutTime: _checkOutTime,origin: origin,roleId: roleId,); + return _dataConnect.mutation("createApplication", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateApplicationApplicationInsert { + final String id; + CreateApplicationApplicationInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateApplicationApplicationInsert otherTyped = other as CreateApplicationApplicationInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateApplicationApplicationInsert({ + required this.id, + }); +} + +@immutable +class CreateApplicationData { + final CreateApplicationApplicationInsert application_insert; + CreateApplicationData.fromJson(dynamic json): + + application_insert = CreateApplicationApplicationInsert.fromJson(json['application_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateApplicationData otherTyped = other as CreateApplicationData; + return application_insert == otherTyped.application_insert; + + } + @override + int get hashCode => application_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['application_insert'] = application_insert.toJson(); + return json; + } + + CreateApplicationData({ + required this.application_insert, + }); +} + +@immutable +class CreateApplicationVariables { + final String shiftId; + final String staffId; + final ApplicationStatus status; + late final OptionalcheckInTime; + late final OptionalcheckOutTime; + final ApplicationOrigin origin; + final String roleId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateApplicationVariables.fromJson(Map json): + + shiftId = nativeFromJson(json['shiftId']), + staffId = nativeFromJson(json['staffId']), + status = ApplicationStatus.values.byName(json['status']), + origin = ApplicationOrigin.values.byName(json['origin']), + roleId = nativeFromJson(json['roleId']) { + + + + + + checkInTime = Optional.optional((json) => json['checkInTime'] = Timestamp.fromJson(json['checkInTime']), defaultSerializer); + checkInTime.value = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']); + + + checkOutTime = Optional.optional((json) => json['checkOutTime'] = Timestamp.fromJson(json['checkOutTime']), defaultSerializer); + checkOutTime.value = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']); + + + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateApplicationVariables otherTyped = other as CreateApplicationVariables; + return shiftId == otherTyped.shiftId && + staffId == otherTyped.staffId && + status == otherTyped.status && + checkInTime == otherTyped.checkInTime && + checkOutTime == otherTyped.checkOutTime && + origin == otherTyped.origin && + roleId == otherTyped.roleId; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, staffId.hashCode, status.hashCode, checkInTime.hashCode, checkOutTime.hashCode, origin.hashCode, roleId.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + json['staffId'] = nativeToJson(staffId); + json['status'] = + status.name + ; + if(checkInTime.state == OptionalState.set) { + json['checkInTime'] = checkInTime.toJson(); + } + if(checkOutTime.state == OptionalState.set) { + json['checkOutTime'] = checkOutTime.toJson(); + } + json['origin'] = + origin.name + ; + json['roleId'] = nativeToJson(roleId); + return json; + } + + CreateApplicationVariables({ + required this.shiftId, + required this.staffId, + required this.status, + required this.checkInTime, + required this.checkOutTime, + required this.origin, + required this.roleId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_assignment.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_assignment.dart new file mode 100644 index 00000000..b0417afb --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_assignment.dart @@ -0,0 +1,291 @@ +part of 'generated.dart'; + +class CreateAssignmentVariablesBuilder { + String workforceId; + Optional _title = Optional.optional(nativeFromJson, nativeToJson); + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + Optional _instructions = Optional.optional(nativeFromJson, nativeToJson); + Optional _status = Optional.optional((data) => AssignmentStatus.values.byName(data), enumSerializer); + Optional _tipsAvailable = Optional.optional(nativeFromJson, nativeToJson); + Optional _travelTime = Optional.optional(nativeFromJson, nativeToJson); + Optional _mealProvided = Optional.optional(nativeFromJson, nativeToJson); + Optional _parkingAvailable = Optional.optional(nativeFromJson, nativeToJson); + Optional _gasCompensation = Optional.optional(nativeFromJson, nativeToJson); + Optional> _managers = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer)); + String roleId; + String shiftId; + + final FirebaseDataConnect _dataConnect; CreateAssignmentVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + CreateAssignmentVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + CreateAssignmentVariablesBuilder instructions(String? t) { + _instructions.value = t; + return this; + } + CreateAssignmentVariablesBuilder status(AssignmentStatus? t) { + _status.value = t; + return this; + } + CreateAssignmentVariablesBuilder tipsAvailable(bool? t) { + _tipsAvailable.value = t; + return this; + } + CreateAssignmentVariablesBuilder travelTime(bool? t) { + _travelTime.value = t; + return this; + } + CreateAssignmentVariablesBuilder mealProvided(bool? t) { + _mealProvided.value = t; + return this; + } + CreateAssignmentVariablesBuilder parkingAvailable(bool? t) { + _parkingAvailable.value = t; + return this; + } + CreateAssignmentVariablesBuilder gasCompensation(bool? t) { + _gasCompensation.value = t; + return this; + } + CreateAssignmentVariablesBuilder managers(List? t) { + _managers.value = t; + return this; + } + + CreateAssignmentVariablesBuilder(this._dataConnect, {required this.workforceId,required this.roleId,required this.shiftId,}); + Deserializer dataDeserializer = (dynamic json) => CreateAssignmentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateAssignmentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateAssignmentVariables vars= CreateAssignmentVariables(workforceId: workforceId,title: _title,description: _description,instructions: _instructions,status: _status,tipsAvailable: _tipsAvailable,travelTime: _travelTime,mealProvided: _mealProvided,parkingAvailable: _parkingAvailable,gasCompensation: _gasCompensation,managers: _managers,roleId: roleId,shiftId: shiftId,); + return _dataConnect.mutation("CreateAssignment", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateAssignmentAssignmentInsert { + final String id; + CreateAssignmentAssignmentInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateAssignmentAssignmentInsert otherTyped = other as CreateAssignmentAssignmentInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateAssignmentAssignmentInsert({ + required this.id, + }); +} + +@immutable +class CreateAssignmentData { + final CreateAssignmentAssignmentInsert assignment_insert; + CreateAssignmentData.fromJson(dynamic json): + + assignment_insert = CreateAssignmentAssignmentInsert.fromJson(json['assignment_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateAssignmentData otherTyped = other as CreateAssignmentData; + return assignment_insert == otherTyped.assignment_insert; + + } + @override + int get hashCode => assignment_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['assignment_insert'] = assignment_insert.toJson(); + return json; + } + + CreateAssignmentData({ + required this.assignment_insert, + }); +} + +@immutable +class CreateAssignmentVariables { + final String workforceId; + late final Optionaltitle; + late final Optionaldescription; + late final Optionalinstructions; + late final Optionalstatus; + late final OptionaltipsAvailable; + late final OptionaltravelTime; + late final OptionalmealProvided; + late final OptionalparkingAvailable; + late final OptionalgasCompensation; + late final Optional>managers; + final String roleId; + final String shiftId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateAssignmentVariables.fromJson(Map json): + + workforceId = nativeFromJson(json['workforceId']), + roleId = nativeFromJson(json['roleId']), + shiftId = nativeFromJson(json['shiftId']) { + + + + title = Optional.optional(nativeFromJson, nativeToJson); + title.value = json['title'] == null ? null : nativeFromJson(json['title']); + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + + instructions = Optional.optional(nativeFromJson, nativeToJson); + instructions.value = json['instructions'] == null ? null : nativeFromJson(json['instructions']); + + + status = Optional.optional((data) => AssignmentStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : AssignmentStatus.values.byName(json['status']); + + + tipsAvailable = Optional.optional(nativeFromJson, nativeToJson); + tipsAvailable.value = json['tipsAvailable'] == null ? null : nativeFromJson(json['tipsAvailable']); + + + travelTime = Optional.optional(nativeFromJson, nativeToJson); + travelTime.value = json['travelTime'] == null ? null : nativeFromJson(json['travelTime']); + + + mealProvided = Optional.optional(nativeFromJson, nativeToJson); + mealProvided.value = json['mealProvided'] == null ? null : nativeFromJson(json['mealProvided']); + + + parkingAvailable = Optional.optional(nativeFromJson, nativeToJson); + parkingAvailable.value = json['parkingAvailable'] == null ? null : nativeFromJson(json['parkingAvailable']); + + + gasCompensation = Optional.optional(nativeFromJson, nativeToJson); + gasCompensation.value = json['gasCompensation'] == null ? null : nativeFromJson(json['gasCompensation']); + + + managers = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer)); + managers.value = json['managers'] == null ? null : (json['managers'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(); + + + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateAssignmentVariables otherTyped = other as CreateAssignmentVariables; + return workforceId == otherTyped.workforceId && + title == otherTyped.title && + description == otherTyped.description && + instructions == otherTyped.instructions && + status == otherTyped.status && + tipsAvailable == otherTyped.tipsAvailable && + travelTime == otherTyped.travelTime && + mealProvided == otherTyped.mealProvided && + parkingAvailable == otherTyped.parkingAvailable && + gasCompensation == otherTyped.gasCompensation && + managers == otherTyped.managers && + roleId == otherTyped.roleId && + shiftId == otherTyped.shiftId; + + } + @override + int get hashCode => Object.hashAll([workforceId.hashCode, title.hashCode, description.hashCode, instructions.hashCode, status.hashCode, tipsAvailable.hashCode, travelTime.hashCode, mealProvided.hashCode, parkingAvailable.hashCode, gasCompensation.hashCode, managers.hashCode, roleId.hashCode, shiftId.hashCode]); + + + Map toJson() { + Map json = {}; + json['workforceId'] = nativeToJson(workforceId); + if(title.state == OptionalState.set) { + json['title'] = title.toJson(); + } + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + if(instructions.state == OptionalState.set) { + json['instructions'] = instructions.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(tipsAvailable.state == OptionalState.set) { + json['tipsAvailable'] = tipsAvailable.toJson(); + } + if(travelTime.state == OptionalState.set) { + json['travelTime'] = travelTime.toJson(); + } + if(mealProvided.state == OptionalState.set) { + json['mealProvided'] = mealProvided.toJson(); + } + if(parkingAvailable.state == OptionalState.set) { + json['parkingAvailable'] = parkingAvailable.toJson(); + } + if(gasCompensation.state == OptionalState.set) { + json['gasCompensation'] = gasCompensation.toJson(); + } + if(managers.state == OptionalState.set) { + json['managers'] = managers.toJson(); + } + json['roleId'] = nativeToJson(roleId); + json['shiftId'] = nativeToJson(shiftId); + return json; + } + + CreateAssignmentVariables({ + required this.workforceId, + required this.title, + required this.description, + required this.instructions, + required this.status, + required this.tipsAvailable, + required this.travelTime, + required this.mealProvided, + required this.parkingAvailable, + required this.gasCompensation, + required this.managers, + required this.roleId, + required this.shiftId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_attire_option.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_attire_option.dart new file mode 100644 index 00000000..aaaa0b05 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_attire_option.dart @@ -0,0 +1,192 @@ +part of 'generated.dart'; + +class CreateAttireOptionVariablesBuilder { + String itemId; + String label; + Optional _icon = Optional.optional(nativeFromJson, nativeToJson); + Optional _imageUrl = Optional.optional(nativeFromJson, nativeToJson); + Optional _isMandatory = Optional.optional(nativeFromJson, nativeToJson); + Optional _vendorId = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateAttireOptionVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + CreateAttireOptionVariablesBuilder imageUrl(String? t) { + _imageUrl.value = t; + return this; + } + CreateAttireOptionVariablesBuilder isMandatory(bool? t) { + _isMandatory.value = t; + return this; + } + CreateAttireOptionVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + + CreateAttireOptionVariablesBuilder(this._dataConnect, {required this.itemId,required this.label,}); + Deserializer dataDeserializer = (dynamic json) => CreateAttireOptionData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateAttireOptionVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateAttireOptionVariables vars= CreateAttireOptionVariables(itemId: itemId,label: label,icon: _icon,imageUrl: _imageUrl,isMandatory: _isMandatory,vendorId: _vendorId,); + return _dataConnect.mutation("createAttireOption", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateAttireOptionAttireOptionInsert { + final String id; + CreateAttireOptionAttireOptionInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateAttireOptionAttireOptionInsert otherTyped = other as CreateAttireOptionAttireOptionInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateAttireOptionAttireOptionInsert({ + required this.id, + }); +} + +@immutable +class CreateAttireOptionData { + final CreateAttireOptionAttireOptionInsert attireOption_insert; + CreateAttireOptionData.fromJson(dynamic json): + + attireOption_insert = CreateAttireOptionAttireOptionInsert.fromJson(json['attireOption_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateAttireOptionData otherTyped = other as CreateAttireOptionData; + return attireOption_insert == otherTyped.attireOption_insert; + + } + @override + int get hashCode => attireOption_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['attireOption_insert'] = attireOption_insert.toJson(); + return json; + } + + CreateAttireOptionData({ + required this.attireOption_insert, + }); +} + +@immutable +class CreateAttireOptionVariables { + final String itemId; + final String label; + late final Optionalicon; + late final OptionalimageUrl; + late final OptionalisMandatory; + late final OptionalvendorId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateAttireOptionVariables.fromJson(Map json): + + itemId = nativeFromJson(json['itemId']), + label = nativeFromJson(json['label']) { + + + + + icon = Optional.optional(nativeFromJson, nativeToJson); + icon.value = json['icon'] == null ? null : nativeFromJson(json['icon']); + + + imageUrl = Optional.optional(nativeFromJson, nativeToJson); + imageUrl.value = json['imageUrl'] == null ? null : nativeFromJson(json['imageUrl']); + + + isMandatory = Optional.optional(nativeFromJson, nativeToJson); + isMandatory.value = json['isMandatory'] == null ? null : nativeFromJson(json['isMandatory']); + + + vendorId = Optional.optional(nativeFromJson, nativeToJson); + vendorId.value = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateAttireOptionVariables otherTyped = other as CreateAttireOptionVariables; + return itemId == otherTyped.itemId && + label == otherTyped.label && + icon == otherTyped.icon && + imageUrl == otherTyped.imageUrl && + isMandatory == otherTyped.isMandatory && + vendorId == otherTyped.vendorId; + + } + @override + int get hashCode => Object.hashAll([itemId.hashCode, label.hashCode, icon.hashCode, imageUrl.hashCode, isMandatory.hashCode, vendorId.hashCode]); + + + Map toJson() { + Map json = {}; + json['itemId'] = nativeToJson(itemId); + json['label'] = nativeToJson(label); + if(icon.state == OptionalState.set) { + json['icon'] = icon.toJson(); + } + if(imageUrl.state == OptionalState.set) { + json['imageUrl'] = imageUrl.toJson(); + } + if(isMandatory.state == OptionalState.set) { + json['isMandatory'] = isMandatory.toJson(); + } + if(vendorId.state == OptionalState.set) { + json['vendorId'] = vendorId.toJson(); + } + return json; + } + + CreateAttireOptionVariables({ + required this.itemId, + required this.label, + required this.icon, + required this.imageUrl, + required this.isMandatory, + required this.vendorId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_benefits_data.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_benefits_data.dart new file mode 100644 index 00000000..08e59038 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_benefits_data.dart @@ -0,0 +1,139 @@ +part of 'generated.dart'; + +class CreateBenefitsDataVariablesBuilder { + String vendorBenefitPlanId; + String staffId; + int current; + + final FirebaseDataConnect _dataConnect; + CreateBenefitsDataVariablesBuilder(this._dataConnect, {required this.vendorBenefitPlanId,required this.staffId,required this.current,}); + Deserializer dataDeserializer = (dynamic json) => CreateBenefitsDataData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateBenefitsDataVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateBenefitsDataVariables vars= CreateBenefitsDataVariables(vendorBenefitPlanId: vendorBenefitPlanId,staffId: staffId,current: current,); + return _dataConnect.mutation("createBenefitsData", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateBenefitsDataBenefitsDataInsert { + final String vendorBenefitPlanId; + final String staffId; + CreateBenefitsDataBenefitsDataInsert.fromJson(dynamic json): + + vendorBenefitPlanId = nativeFromJson(json['vendorBenefitPlanId']), + staffId = nativeFromJson(json['staffId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateBenefitsDataBenefitsDataInsert otherTyped = other as CreateBenefitsDataBenefitsDataInsert; + return vendorBenefitPlanId == otherTyped.vendorBenefitPlanId && + staffId == otherTyped.staffId; + + } + @override + int get hashCode => Object.hashAll([vendorBenefitPlanId.hashCode, staffId.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorBenefitPlanId'] = nativeToJson(vendorBenefitPlanId); + json['staffId'] = nativeToJson(staffId); + return json; + } + + CreateBenefitsDataBenefitsDataInsert({ + required this.vendorBenefitPlanId, + required this.staffId, + }); +} + +@immutable +class CreateBenefitsDataData { + final CreateBenefitsDataBenefitsDataInsert benefitsData_insert; + CreateBenefitsDataData.fromJson(dynamic json): + + benefitsData_insert = CreateBenefitsDataBenefitsDataInsert.fromJson(json['benefitsData_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateBenefitsDataData otherTyped = other as CreateBenefitsDataData; + return benefitsData_insert == otherTyped.benefitsData_insert; + + } + @override + int get hashCode => benefitsData_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['benefitsData_insert'] = benefitsData_insert.toJson(); + return json; + } + + CreateBenefitsDataData({ + required this.benefitsData_insert, + }); +} + +@immutable +class CreateBenefitsDataVariables { + final String vendorBenefitPlanId; + final String staffId; + final int current; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateBenefitsDataVariables.fromJson(Map json): + + vendorBenefitPlanId = nativeFromJson(json['vendorBenefitPlanId']), + staffId = nativeFromJson(json['staffId']), + current = nativeFromJson(json['current']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateBenefitsDataVariables otherTyped = other as CreateBenefitsDataVariables; + return vendorBenefitPlanId == otherTyped.vendorBenefitPlanId && + staffId == otherTyped.staffId && + current == otherTyped.current; + + } + @override + int get hashCode => Object.hashAll([vendorBenefitPlanId.hashCode, staffId.hashCode, current.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorBenefitPlanId'] = nativeToJson(vendorBenefitPlanId); + json['staffId'] = nativeToJson(staffId); + json['current'] = nativeToJson(current); + return json; + } + + CreateBenefitsDataVariables({ + required this.vendorBenefitPlanId, + required this.staffId, + required this.current, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_business.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_business.dart new file mode 100644 index 00000000..1deab447 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_business.dart @@ -0,0 +1,300 @@ +part of 'generated.dart'; + +class CreateBusinessVariablesBuilder { + String businessName; + Optional _contactName = Optional.optional(nativeFromJson, nativeToJson); + String userId; + Optional _companyLogoUrl = Optional.optional(nativeFromJson, nativeToJson); + Optional _phone = Optional.optional(nativeFromJson, nativeToJson); + Optional _email = Optional.optional(nativeFromJson, nativeToJson); + Optional _hubBuilding = Optional.optional(nativeFromJson, nativeToJson); + Optional _address = Optional.optional(nativeFromJson, nativeToJson); + Optional _city = Optional.optional(nativeFromJson, nativeToJson); + Optional _area = Optional.optional((data) => BusinessArea.values.byName(data), enumSerializer); + Optional _sector = Optional.optional((data) => BusinessSector.values.byName(data), enumSerializer); + BusinessRateGroup rateGroup; + BusinessStatus status; + Optional _notes = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateBusinessVariablesBuilder contactName(String? t) { + _contactName.value = t; + return this; + } + CreateBusinessVariablesBuilder companyLogoUrl(String? t) { + _companyLogoUrl.value = t; + return this; + } + CreateBusinessVariablesBuilder phone(String? t) { + _phone.value = t; + return this; + } + CreateBusinessVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + CreateBusinessVariablesBuilder hubBuilding(String? t) { + _hubBuilding.value = t; + return this; + } + CreateBusinessVariablesBuilder address(String? t) { + _address.value = t; + return this; + } + CreateBusinessVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + CreateBusinessVariablesBuilder area(BusinessArea? t) { + _area.value = t; + return this; + } + CreateBusinessVariablesBuilder sector(BusinessSector? t) { + _sector.value = t; + return this; + } + CreateBusinessVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + + CreateBusinessVariablesBuilder(this._dataConnect, {required this.businessName,required this.userId,required this.rateGroup,required this.status,}); + Deserializer dataDeserializer = (dynamic json) => CreateBusinessData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateBusinessVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateBusinessVariables vars= CreateBusinessVariables(businessName: businessName,contactName: _contactName,userId: userId,companyLogoUrl: _companyLogoUrl,phone: _phone,email: _email,hubBuilding: _hubBuilding,address: _address,city: _city,area: _area,sector: _sector,rateGroup: rateGroup,status: status,notes: _notes,); + return _dataConnect.mutation("createBusiness", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateBusinessBusinessInsert { + final String id; + CreateBusinessBusinessInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateBusinessBusinessInsert otherTyped = other as CreateBusinessBusinessInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateBusinessBusinessInsert({ + required this.id, + }); +} + +@immutable +class CreateBusinessData { + final CreateBusinessBusinessInsert business_insert; + CreateBusinessData.fromJson(dynamic json): + + business_insert = CreateBusinessBusinessInsert.fromJson(json['business_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateBusinessData otherTyped = other as CreateBusinessData; + return business_insert == otherTyped.business_insert; + + } + @override + int get hashCode => business_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['business_insert'] = business_insert.toJson(); + return json; + } + + CreateBusinessData({ + required this.business_insert, + }); +} + +@immutable +class CreateBusinessVariables { + final String businessName; + late final OptionalcontactName; + final String userId; + late final OptionalcompanyLogoUrl; + late final Optionalphone; + late final Optionalemail; + late final OptionalhubBuilding; + late final Optionaladdress; + late final Optionalcity; + late final Optionalarea; + late final Optionalsector; + final BusinessRateGroup rateGroup; + final BusinessStatus status; + late final Optionalnotes; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateBusinessVariables.fromJson(Map json): + + businessName = nativeFromJson(json['businessName']), + userId = nativeFromJson(json['userId']), + rateGroup = BusinessRateGroup.values.byName(json['rateGroup']), + status = BusinessStatus.values.byName(json['status']) { + + + + contactName = Optional.optional(nativeFromJson, nativeToJson); + contactName.value = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + + + + companyLogoUrl = Optional.optional(nativeFromJson, nativeToJson); + companyLogoUrl.value = json['companyLogoUrl'] == null ? null : nativeFromJson(json['companyLogoUrl']); + + + phone = Optional.optional(nativeFromJson, nativeToJson); + phone.value = json['phone'] == null ? null : nativeFromJson(json['phone']); + + + email = Optional.optional(nativeFromJson, nativeToJson); + email.value = json['email'] == null ? null : nativeFromJson(json['email']); + + + hubBuilding = Optional.optional(nativeFromJson, nativeToJson); + hubBuilding.value = json['hubBuilding'] == null ? null : nativeFromJson(json['hubBuilding']); + + + address = Optional.optional(nativeFromJson, nativeToJson); + address.value = json['address'] == null ? null : nativeFromJson(json['address']); + + + city = Optional.optional(nativeFromJson, nativeToJson); + city.value = json['city'] == null ? null : nativeFromJson(json['city']); + + + area = Optional.optional((data) => BusinessArea.values.byName(data), enumSerializer); + area.value = json['area'] == null ? null : BusinessArea.values.byName(json['area']); + + + sector = Optional.optional((data) => BusinessSector.values.byName(data), enumSerializer); + sector.value = json['sector'] == null ? null : BusinessSector.values.byName(json['sector']); + + + + + notes = Optional.optional(nativeFromJson, nativeToJson); + notes.value = json['notes'] == null ? null : nativeFromJson(json['notes']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateBusinessVariables otherTyped = other as CreateBusinessVariables; + return businessName == otherTyped.businessName && + contactName == otherTyped.contactName && + userId == otherTyped.userId && + companyLogoUrl == otherTyped.companyLogoUrl && + phone == otherTyped.phone && + email == otherTyped.email && + hubBuilding == otherTyped.hubBuilding && + address == otherTyped.address && + city == otherTyped.city && + area == otherTyped.area && + sector == otherTyped.sector && + rateGroup == otherTyped.rateGroup && + status == otherTyped.status && + notes == otherTyped.notes; + + } + @override + int get hashCode => Object.hashAll([businessName.hashCode, contactName.hashCode, userId.hashCode, companyLogoUrl.hashCode, phone.hashCode, email.hashCode, hubBuilding.hashCode, address.hashCode, city.hashCode, area.hashCode, sector.hashCode, rateGroup.hashCode, status.hashCode, notes.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessName'] = nativeToJson(businessName); + if(contactName.state == OptionalState.set) { + json['contactName'] = contactName.toJson(); + } + json['userId'] = nativeToJson(userId); + if(companyLogoUrl.state == OptionalState.set) { + json['companyLogoUrl'] = companyLogoUrl.toJson(); + } + if(phone.state == OptionalState.set) { + json['phone'] = phone.toJson(); + } + if(email.state == OptionalState.set) { + json['email'] = email.toJson(); + } + if(hubBuilding.state == OptionalState.set) { + json['hubBuilding'] = hubBuilding.toJson(); + } + if(address.state == OptionalState.set) { + json['address'] = address.toJson(); + } + if(city.state == OptionalState.set) { + json['city'] = city.toJson(); + } + if(area.state == OptionalState.set) { + json['area'] = area.toJson(); + } + if(sector.state == OptionalState.set) { + json['sector'] = sector.toJson(); + } + json['rateGroup'] = + rateGroup.name + ; + json['status'] = + status.name + ; + if(notes.state == OptionalState.set) { + json['notes'] = notes.toJson(); + } + return json; + } + + CreateBusinessVariables({ + required this.businessName, + required this.contactName, + required this.userId, + required this.companyLogoUrl, + required this.phone, + required this.email, + required this.hubBuilding, + required this.address, + required this.city, + required this.area, + required this.sector, + required this.rateGroup, + required this.status, + required this.notes, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_category.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_category.dart new file mode 100644 index 00000000..407400a5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_category.dart @@ -0,0 +1,147 @@ +part of 'generated.dart'; + +class CreateCategoryVariablesBuilder { + String categoryId; + String label; + Optional _icon = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateCategoryVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + + CreateCategoryVariablesBuilder(this._dataConnect, {required this.categoryId,required this.label,}); + Deserializer dataDeserializer = (dynamic json) => CreateCategoryData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateCategoryVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateCategoryVariables vars= CreateCategoryVariables(categoryId: categoryId,label: label,icon: _icon,); + return _dataConnect.mutation("createCategory", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateCategoryCategoryInsert { + final String id; + CreateCategoryCategoryInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateCategoryCategoryInsert otherTyped = other as CreateCategoryCategoryInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateCategoryCategoryInsert({ + required this.id, + }); +} + +@immutable +class CreateCategoryData { + final CreateCategoryCategoryInsert category_insert; + CreateCategoryData.fromJson(dynamic json): + + category_insert = CreateCategoryCategoryInsert.fromJson(json['category_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateCategoryData otherTyped = other as CreateCategoryData; + return category_insert == otherTyped.category_insert; + + } + @override + int get hashCode => category_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['category_insert'] = category_insert.toJson(); + return json; + } + + CreateCategoryData({ + required this.category_insert, + }); +} + +@immutable +class CreateCategoryVariables { + final String categoryId; + final String label; + late final Optionalicon; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateCategoryVariables.fromJson(Map json): + + categoryId = nativeFromJson(json['categoryId']), + label = nativeFromJson(json['label']) { + + + + + icon = Optional.optional(nativeFromJson, nativeToJson); + icon.value = json['icon'] == null ? null : nativeFromJson(json['icon']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateCategoryVariables otherTyped = other as CreateCategoryVariables; + return categoryId == otherTyped.categoryId && + label == otherTyped.label && + icon == otherTyped.icon; + + } + @override + int get hashCode => Object.hashAll([categoryId.hashCode, label.hashCode, icon.hashCode]); + + + Map toJson() { + Map json = {}; + json['categoryId'] = nativeToJson(categoryId); + json['label'] = nativeToJson(label); + if(icon.state == OptionalState.set) { + json['icon'] = icon.toJson(); + } + return json; + } + + CreateCategoryVariables({ + required this.categoryId, + required this.label, + required this.icon, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_certificate.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_certificate.dart new file mode 100644 index 00000000..0d6b45e2 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_certificate.dart @@ -0,0 +1,261 @@ +part of 'generated.dart'; + +class CreateCertificateVariablesBuilder { + String name; + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + Optional _expiry = Optional.optional((json) => json['expiry'] = Timestamp.fromJson(json['expiry']), defaultSerializer); + CertificateStatus status; + Optional _fileUrl = Optional.optional(nativeFromJson, nativeToJson); + Optional _icon = Optional.optional(nativeFromJson, nativeToJson); + Optional _certificationType = Optional.optional((data) => ComplianceType.values.byName(data), enumSerializer); + Optional _issuer = Optional.optional(nativeFromJson, nativeToJson); + String staffId; + Optional _validationStatus = Optional.optional((data) => ValidationStatus.values.byName(data), enumSerializer); + Optional _certificateNumber = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateCertificateVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + CreateCertificateVariablesBuilder expiry(Timestamp? t) { + _expiry.value = t; + return this; + } + CreateCertificateVariablesBuilder fileUrl(String? t) { + _fileUrl.value = t; + return this; + } + CreateCertificateVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + CreateCertificateVariablesBuilder certificationType(ComplianceType? t) { + _certificationType.value = t; + return this; + } + CreateCertificateVariablesBuilder issuer(String? t) { + _issuer.value = t; + return this; + } + CreateCertificateVariablesBuilder validationStatus(ValidationStatus? t) { + _validationStatus.value = t; + return this; + } + CreateCertificateVariablesBuilder certificateNumber(String? t) { + _certificateNumber.value = t; + return this; + } + + CreateCertificateVariablesBuilder(this._dataConnect, {required this.name,required this.status,required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => CreateCertificateData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateCertificateVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateCertificateVariables vars= CreateCertificateVariables(name: name,description: _description,expiry: _expiry,status: status,fileUrl: _fileUrl,icon: _icon,certificationType: _certificationType,issuer: _issuer,staffId: staffId,validationStatus: _validationStatus,certificateNumber: _certificateNumber,); + return _dataConnect.mutation("CreateCertificate", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateCertificateCertificateInsert { + final String id; + CreateCertificateCertificateInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateCertificateCertificateInsert otherTyped = other as CreateCertificateCertificateInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateCertificateCertificateInsert({ + required this.id, + }); +} + +@immutable +class CreateCertificateData { + final CreateCertificateCertificateInsert certificate_insert; + CreateCertificateData.fromJson(dynamic json): + + certificate_insert = CreateCertificateCertificateInsert.fromJson(json['certificate_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateCertificateData otherTyped = other as CreateCertificateData; + return certificate_insert == otherTyped.certificate_insert; + + } + @override + int get hashCode => certificate_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['certificate_insert'] = certificate_insert.toJson(); + return json; + } + + CreateCertificateData({ + required this.certificate_insert, + }); +} + +@immutable +class CreateCertificateVariables { + final String name; + late final Optionaldescription; + late final Optionalexpiry; + final CertificateStatus status; + late final OptionalfileUrl; + late final Optionalicon; + late final OptionalcertificationType; + late final Optionalissuer; + final String staffId; + late final OptionalvalidationStatus; + late final OptionalcertificateNumber; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateCertificateVariables.fromJson(Map json): + + name = nativeFromJson(json['name']), + status = CertificateStatus.values.byName(json['status']), + staffId = nativeFromJson(json['staffId']) { + + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + + expiry = Optional.optional((json) => json['expiry'] = Timestamp.fromJson(json['expiry']), defaultSerializer); + expiry.value = json['expiry'] == null ? null : Timestamp.fromJson(json['expiry']); + + + + fileUrl = Optional.optional(nativeFromJson, nativeToJson); + fileUrl.value = json['fileUrl'] == null ? null : nativeFromJson(json['fileUrl']); + + + icon = Optional.optional(nativeFromJson, nativeToJson); + icon.value = json['icon'] == null ? null : nativeFromJson(json['icon']); + + + certificationType = Optional.optional((data) => ComplianceType.values.byName(data), enumSerializer); + certificationType.value = json['certificationType'] == null ? null : ComplianceType.values.byName(json['certificationType']); + + + issuer = Optional.optional(nativeFromJson, nativeToJson); + issuer.value = json['issuer'] == null ? null : nativeFromJson(json['issuer']); + + + + validationStatus = Optional.optional((data) => ValidationStatus.values.byName(data), enumSerializer); + validationStatus.value = json['validationStatus'] == null ? null : ValidationStatus.values.byName(json['validationStatus']); + + + certificateNumber = Optional.optional(nativeFromJson, nativeToJson); + certificateNumber.value = json['certificateNumber'] == null ? null : nativeFromJson(json['certificateNumber']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateCertificateVariables otherTyped = other as CreateCertificateVariables; + return name == otherTyped.name && + description == otherTyped.description && + expiry == otherTyped.expiry && + status == otherTyped.status && + fileUrl == otherTyped.fileUrl && + icon == otherTyped.icon && + certificationType == otherTyped.certificationType && + issuer == otherTyped.issuer && + staffId == otherTyped.staffId && + validationStatus == otherTyped.validationStatus && + certificateNumber == otherTyped.certificateNumber; + + } + @override + int get hashCode => Object.hashAll([name.hashCode, description.hashCode, expiry.hashCode, status.hashCode, fileUrl.hashCode, icon.hashCode, certificationType.hashCode, issuer.hashCode, staffId.hashCode, validationStatus.hashCode, certificateNumber.hashCode]); + + + Map toJson() { + Map json = {}; + json['name'] = nativeToJson(name); + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + if(expiry.state == OptionalState.set) { + json['expiry'] = expiry.toJson(); + } + json['status'] = + status.name + ; + if(fileUrl.state == OptionalState.set) { + json['fileUrl'] = fileUrl.toJson(); + } + if(icon.state == OptionalState.set) { + json['icon'] = icon.toJson(); + } + if(certificationType.state == OptionalState.set) { + json['certificationType'] = certificationType.toJson(); + } + if(issuer.state == OptionalState.set) { + json['issuer'] = issuer.toJson(); + } + json['staffId'] = nativeToJson(staffId); + if(validationStatus.state == OptionalState.set) { + json['validationStatus'] = validationStatus.toJson(); + } + if(certificateNumber.state == OptionalState.set) { + json['certificateNumber'] = certificateNumber.toJson(); + } + return json; + } + + CreateCertificateVariables({ + required this.name, + required this.description, + required this.expiry, + required this.status, + required this.fileUrl, + required this.icon, + required this.certificationType, + required this.issuer, + required this.staffId, + required this.validationStatus, + required this.certificateNumber, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_client_feedback.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_client_feedback.dart new file mode 100644 index 00000000..407a98ae --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_client_feedback.dart @@ -0,0 +1,192 @@ +part of 'generated.dart'; + +class CreateClientFeedbackVariablesBuilder { + String businessId; + String vendorId; + Optional _rating = Optional.optional(nativeFromJson, nativeToJson); + Optional _comment = Optional.optional(nativeFromJson, nativeToJson); + Optional _date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer); + Optional _createdBy = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateClientFeedbackVariablesBuilder rating(int? t) { + _rating.value = t; + return this; + } + CreateClientFeedbackVariablesBuilder comment(String? t) { + _comment.value = t; + return this; + } + CreateClientFeedbackVariablesBuilder date(Timestamp? t) { + _date.value = t; + return this; + } + CreateClientFeedbackVariablesBuilder createdBy(String? t) { + _createdBy.value = t; + return this; + } + + CreateClientFeedbackVariablesBuilder(this._dataConnect, {required this.businessId,required this.vendorId,}); + Deserializer dataDeserializer = (dynamic json) => CreateClientFeedbackData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateClientFeedbackVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateClientFeedbackVariables vars= CreateClientFeedbackVariables(businessId: businessId,vendorId: vendorId,rating: _rating,comment: _comment,date: _date,createdBy: _createdBy,); + return _dataConnect.mutation("createClientFeedback", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateClientFeedbackClientFeedbackInsert { + final String id; + CreateClientFeedbackClientFeedbackInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateClientFeedbackClientFeedbackInsert otherTyped = other as CreateClientFeedbackClientFeedbackInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateClientFeedbackClientFeedbackInsert({ + required this.id, + }); +} + +@immutable +class CreateClientFeedbackData { + final CreateClientFeedbackClientFeedbackInsert clientFeedback_insert; + CreateClientFeedbackData.fromJson(dynamic json): + + clientFeedback_insert = CreateClientFeedbackClientFeedbackInsert.fromJson(json['clientFeedback_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateClientFeedbackData otherTyped = other as CreateClientFeedbackData; + return clientFeedback_insert == otherTyped.clientFeedback_insert; + + } + @override + int get hashCode => clientFeedback_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['clientFeedback_insert'] = clientFeedback_insert.toJson(); + return json; + } + + CreateClientFeedbackData({ + required this.clientFeedback_insert, + }); +} + +@immutable +class CreateClientFeedbackVariables { + final String businessId; + final String vendorId; + late final Optionalrating; + late final Optionalcomment; + late final Optionaldate; + late final OptionalcreatedBy; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateClientFeedbackVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']), + vendorId = nativeFromJson(json['vendorId']) { + + + + + rating = Optional.optional(nativeFromJson, nativeToJson); + rating.value = json['rating'] == null ? null : nativeFromJson(json['rating']); + + + comment = Optional.optional(nativeFromJson, nativeToJson); + comment.value = json['comment'] == null ? null : nativeFromJson(json['comment']); + + + date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer); + date.value = json['date'] == null ? null : Timestamp.fromJson(json['date']); + + + createdBy = Optional.optional(nativeFromJson, nativeToJson); + createdBy.value = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateClientFeedbackVariables otherTyped = other as CreateClientFeedbackVariables; + return businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + rating == otherTyped.rating && + comment == otherTyped.comment && + date == otherTyped.date && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, vendorId.hashCode, rating.hashCode, comment.hashCode, date.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + json['vendorId'] = nativeToJson(vendorId); + if(rating.state == OptionalState.set) { + json['rating'] = rating.toJson(); + } + if(comment.state == OptionalState.set) { + json['comment'] = comment.toJson(); + } + if(date.state == OptionalState.set) { + json['date'] = date.toJson(); + } + if(createdBy.state == OptionalState.set) { + json['createdBy'] = createdBy.toJson(); + } + return json; + } + + CreateClientFeedbackVariables({ + required this.businessId, + required this.vendorId, + required this.rating, + required this.comment, + required this.date, + required this.createdBy, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_conversation.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_conversation.dart new file mode 100644 index 00000000..edbdbfbd --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_conversation.dart @@ -0,0 +1,223 @@ +part of 'generated.dart'; + +class CreateConversationVariablesBuilder { + Optional _subject = Optional.optional(nativeFromJson, nativeToJson); + Optional _status = Optional.optional((data) => ConversationStatus.values.byName(data), enumSerializer); + Optional _conversationType = Optional.optional((data) => ConversationType.values.byName(data), enumSerializer); + Optional _isGroup = Optional.optional(nativeFromJson, nativeToJson); + Optional _groupName = Optional.optional(nativeFromJson, nativeToJson); + Optional _lastMessage = Optional.optional(nativeFromJson, nativeToJson); + Optional _lastMessageAt = Optional.optional((json) => json['lastMessageAt'] = Timestamp.fromJson(json['lastMessageAt']), defaultSerializer); + + final FirebaseDataConnect _dataConnect; + CreateConversationVariablesBuilder subject(String? t) { + _subject.value = t; + return this; + } + CreateConversationVariablesBuilder status(ConversationStatus? t) { + _status.value = t; + return this; + } + CreateConversationVariablesBuilder conversationType(ConversationType? t) { + _conversationType.value = t; + return this; + } + CreateConversationVariablesBuilder isGroup(bool? t) { + _isGroup.value = t; + return this; + } + CreateConversationVariablesBuilder groupName(String? t) { + _groupName.value = t; + return this; + } + CreateConversationVariablesBuilder lastMessage(String? t) { + _lastMessage.value = t; + return this; + } + CreateConversationVariablesBuilder lastMessageAt(Timestamp? t) { + _lastMessageAt.value = t; + return this; + } + + CreateConversationVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => CreateConversationData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateConversationVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateConversationVariables vars= CreateConversationVariables(subject: _subject,status: _status,conversationType: _conversationType,isGroup: _isGroup,groupName: _groupName,lastMessage: _lastMessage,lastMessageAt: _lastMessageAt,); + return _dataConnect.mutation("createConversation", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateConversationConversationInsert { + final String id; + CreateConversationConversationInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateConversationConversationInsert otherTyped = other as CreateConversationConversationInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateConversationConversationInsert({ + required this.id, + }); +} + +@immutable +class CreateConversationData { + final CreateConversationConversationInsert conversation_insert; + CreateConversationData.fromJson(dynamic json): + + conversation_insert = CreateConversationConversationInsert.fromJson(json['conversation_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateConversationData otherTyped = other as CreateConversationData; + return conversation_insert == otherTyped.conversation_insert; + + } + @override + int get hashCode => conversation_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['conversation_insert'] = conversation_insert.toJson(); + return json; + } + + CreateConversationData({ + required this.conversation_insert, + }); +} + +@immutable +class CreateConversationVariables { + late final Optionalsubject; + late final Optionalstatus; + late final OptionalconversationType; + late final OptionalisGroup; + late final OptionalgroupName; + late final OptionallastMessage; + late final OptionallastMessageAt; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateConversationVariables.fromJson(Map json) { + + + subject = Optional.optional(nativeFromJson, nativeToJson); + subject.value = json['subject'] == null ? null : nativeFromJson(json['subject']); + + + status = Optional.optional((data) => ConversationStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : ConversationStatus.values.byName(json['status']); + + + conversationType = Optional.optional((data) => ConversationType.values.byName(data), enumSerializer); + conversationType.value = json['conversationType'] == null ? null : ConversationType.values.byName(json['conversationType']); + + + isGroup = Optional.optional(nativeFromJson, nativeToJson); + isGroup.value = json['isGroup'] == null ? null : nativeFromJson(json['isGroup']); + + + groupName = Optional.optional(nativeFromJson, nativeToJson); + groupName.value = json['groupName'] == null ? null : nativeFromJson(json['groupName']); + + + lastMessage = Optional.optional(nativeFromJson, nativeToJson); + lastMessage.value = json['lastMessage'] == null ? null : nativeFromJson(json['lastMessage']); + + + lastMessageAt = Optional.optional((json) => json['lastMessageAt'] = Timestamp.fromJson(json['lastMessageAt']), defaultSerializer); + lastMessageAt.value = json['lastMessageAt'] == null ? null : Timestamp.fromJson(json['lastMessageAt']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateConversationVariables otherTyped = other as CreateConversationVariables; + return subject == otherTyped.subject && + status == otherTyped.status && + conversationType == otherTyped.conversationType && + isGroup == otherTyped.isGroup && + groupName == otherTyped.groupName && + lastMessage == otherTyped.lastMessage && + lastMessageAt == otherTyped.lastMessageAt; + + } + @override + int get hashCode => Object.hashAll([subject.hashCode, status.hashCode, conversationType.hashCode, isGroup.hashCode, groupName.hashCode, lastMessage.hashCode, lastMessageAt.hashCode]); + + + Map toJson() { + Map json = {}; + if(subject.state == OptionalState.set) { + json['subject'] = subject.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(conversationType.state == OptionalState.set) { + json['conversationType'] = conversationType.toJson(); + } + if(isGroup.state == OptionalState.set) { + json['isGroup'] = isGroup.toJson(); + } + if(groupName.state == OptionalState.set) { + json['groupName'] = groupName.toJson(); + } + if(lastMessage.state == OptionalState.set) { + json['lastMessage'] = lastMessage.toJson(); + } + if(lastMessageAt.state == OptionalState.set) { + json['lastMessageAt'] = lastMessageAt.toJson(); + } + return json; + } + + CreateConversationVariables({ + required this.subject, + required this.status, + required this.conversationType, + required this.isGroup, + required this.groupName, + required this.lastMessage, + required this.lastMessageAt, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_course.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_course.dart new file mode 100644 index 00000000..40892dad --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_course.dart @@ -0,0 +1,231 @@ +part of 'generated.dart'; + +class CreateCourseVariablesBuilder { + Optional _title = Optional.optional(nativeFromJson, nativeToJson); + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + Optional _thumbnailUrl = Optional.optional(nativeFromJson, nativeToJson); + Optional _durationMinutes = Optional.optional(nativeFromJson, nativeToJson); + Optional _xpReward = Optional.optional(nativeFromJson, nativeToJson); + String categoryId; + Optional _levelRequired = Optional.optional(nativeFromJson, nativeToJson); + Optional _isCertification = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + CreateCourseVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + CreateCourseVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + CreateCourseVariablesBuilder thumbnailUrl(String? t) { + _thumbnailUrl.value = t; + return this; + } + CreateCourseVariablesBuilder durationMinutes(int? t) { + _durationMinutes.value = t; + return this; + } + CreateCourseVariablesBuilder xpReward(int? t) { + _xpReward.value = t; + return this; + } + CreateCourseVariablesBuilder levelRequired(String? t) { + _levelRequired.value = t; + return this; + } + CreateCourseVariablesBuilder isCertification(bool? t) { + _isCertification.value = t; + return this; + } + + CreateCourseVariablesBuilder(this._dataConnect, {required this.categoryId,}); + Deserializer dataDeserializer = (dynamic json) => CreateCourseData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateCourseVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateCourseVariables vars= CreateCourseVariables(title: _title,description: _description,thumbnailUrl: _thumbnailUrl,durationMinutes: _durationMinutes,xpReward: _xpReward,categoryId: categoryId,levelRequired: _levelRequired,isCertification: _isCertification,); + return _dataConnect.mutation("createCourse", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateCourseCourseInsert { + final String id; + CreateCourseCourseInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateCourseCourseInsert otherTyped = other as CreateCourseCourseInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateCourseCourseInsert({ + required this.id, + }); +} + +@immutable +class CreateCourseData { + final CreateCourseCourseInsert course_insert; + CreateCourseData.fromJson(dynamic json): + + course_insert = CreateCourseCourseInsert.fromJson(json['course_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateCourseData otherTyped = other as CreateCourseData; + return course_insert == otherTyped.course_insert; + + } + @override + int get hashCode => course_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['course_insert'] = course_insert.toJson(); + return json; + } + + CreateCourseData({ + required this.course_insert, + }); +} + +@immutable +class CreateCourseVariables { + late final Optionaltitle; + late final Optionaldescription; + late final OptionalthumbnailUrl; + late final OptionaldurationMinutes; + late final OptionalxpReward; + final String categoryId; + late final OptionallevelRequired; + late final OptionalisCertification; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateCourseVariables.fromJson(Map json): + + categoryId = nativeFromJson(json['categoryId']) { + + + title = Optional.optional(nativeFromJson, nativeToJson); + title.value = json['title'] == null ? null : nativeFromJson(json['title']); + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + + thumbnailUrl = Optional.optional(nativeFromJson, nativeToJson); + thumbnailUrl.value = json['thumbnailUrl'] == null ? null : nativeFromJson(json['thumbnailUrl']); + + + durationMinutes = Optional.optional(nativeFromJson, nativeToJson); + durationMinutes.value = json['durationMinutes'] == null ? null : nativeFromJson(json['durationMinutes']); + + + xpReward = Optional.optional(nativeFromJson, nativeToJson); + xpReward.value = json['xpReward'] == null ? null : nativeFromJson(json['xpReward']); + + + + levelRequired = Optional.optional(nativeFromJson, nativeToJson); + levelRequired.value = json['levelRequired'] == null ? null : nativeFromJson(json['levelRequired']); + + + isCertification = Optional.optional(nativeFromJson, nativeToJson); + isCertification.value = json['isCertification'] == null ? null : nativeFromJson(json['isCertification']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateCourseVariables otherTyped = other as CreateCourseVariables; + return title == otherTyped.title && + description == otherTyped.description && + thumbnailUrl == otherTyped.thumbnailUrl && + durationMinutes == otherTyped.durationMinutes && + xpReward == otherTyped.xpReward && + categoryId == otherTyped.categoryId && + levelRequired == otherTyped.levelRequired && + isCertification == otherTyped.isCertification; + + } + @override + int get hashCode => Object.hashAll([title.hashCode, description.hashCode, thumbnailUrl.hashCode, durationMinutes.hashCode, xpReward.hashCode, categoryId.hashCode, levelRequired.hashCode, isCertification.hashCode]); + + + Map toJson() { + Map json = {}; + if(title.state == OptionalState.set) { + json['title'] = title.toJson(); + } + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + if(thumbnailUrl.state == OptionalState.set) { + json['thumbnailUrl'] = thumbnailUrl.toJson(); + } + if(durationMinutes.state == OptionalState.set) { + json['durationMinutes'] = durationMinutes.toJson(); + } + if(xpReward.state == OptionalState.set) { + json['xpReward'] = xpReward.toJson(); + } + json['categoryId'] = nativeToJson(categoryId); + if(levelRequired.state == OptionalState.set) { + json['levelRequired'] = levelRequired.toJson(); + } + if(isCertification.state == OptionalState.set) { + json['isCertification'] = isCertification.toJson(); + } + return json; + } + + CreateCourseVariables({ + required this.title, + required this.description, + required this.thumbnailUrl, + required this.durationMinutes, + required this.xpReward, + required this.categoryId, + required this.levelRequired, + required this.isCertification, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_custom_rate_card.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_custom_rate_card.dart new file mode 100644 index 00000000..28ac8eb7 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_custom_rate_card.dart @@ -0,0 +1,170 @@ +part of 'generated.dart'; + +class CreateCustomRateCardVariablesBuilder { + String name; + Optional _baseBook = Optional.optional(nativeFromJson, nativeToJson); + Optional _discount = Optional.optional(nativeFromJson, nativeToJson); + Optional _isDefault = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateCustomRateCardVariablesBuilder baseBook(String? t) { + _baseBook.value = t; + return this; + } + CreateCustomRateCardVariablesBuilder discount(double? t) { + _discount.value = t; + return this; + } + CreateCustomRateCardVariablesBuilder isDefault(bool? t) { + _isDefault.value = t; + return this; + } + + CreateCustomRateCardVariablesBuilder(this._dataConnect, {required this.name,}); + Deserializer dataDeserializer = (dynamic json) => CreateCustomRateCardData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateCustomRateCardVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateCustomRateCardVariables vars= CreateCustomRateCardVariables(name: name,baseBook: _baseBook,discount: _discount,isDefault: _isDefault,); + return _dataConnect.mutation("createCustomRateCard", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateCustomRateCardCustomRateCardInsert { + final String id; + CreateCustomRateCardCustomRateCardInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateCustomRateCardCustomRateCardInsert otherTyped = other as CreateCustomRateCardCustomRateCardInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateCustomRateCardCustomRateCardInsert({ + required this.id, + }); +} + +@immutable +class CreateCustomRateCardData { + final CreateCustomRateCardCustomRateCardInsert customRateCard_insert; + CreateCustomRateCardData.fromJson(dynamic json): + + customRateCard_insert = CreateCustomRateCardCustomRateCardInsert.fromJson(json['customRateCard_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateCustomRateCardData otherTyped = other as CreateCustomRateCardData; + return customRateCard_insert == otherTyped.customRateCard_insert; + + } + @override + int get hashCode => customRateCard_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['customRateCard_insert'] = customRateCard_insert.toJson(); + return json; + } + + CreateCustomRateCardData({ + required this.customRateCard_insert, + }); +} + +@immutable +class CreateCustomRateCardVariables { + final String name; + late final OptionalbaseBook; + late final Optionaldiscount; + late final OptionalisDefault; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateCustomRateCardVariables.fromJson(Map json): + + name = nativeFromJson(json['name']) { + + + + baseBook = Optional.optional(nativeFromJson, nativeToJson); + baseBook.value = json['baseBook'] == null ? null : nativeFromJson(json['baseBook']); + + + discount = Optional.optional(nativeFromJson, nativeToJson); + discount.value = json['discount'] == null ? null : nativeFromJson(json['discount']); + + + isDefault = Optional.optional(nativeFromJson, nativeToJson); + isDefault.value = json['isDefault'] == null ? null : nativeFromJson(json['isDefault']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateCustomRateCardVariables otherTyped = other as CreateCustomRateCardVariables; + return name == otherTyped.name && + baseBook == otherTyped.baseBook && + discount == otherTyped.discount && + isDefault == otherTyped.isDefault; + + } + @override + int get hashCode => Object.hashAll([name.hashCode, baseBook.hashCode, discount.hashCode, isDefault.hashCode]); + + + Map toJson() { + Map json = {}; + json['name'] = nativeToJson(name); + if(baseBook.state == OptionalState.set) { + json['baseBook'] = baseBook.toJson(); + } + if(discount.state == OptionalState.set) { + json['discount'] = discount.toJson(); + } + if(isDefault.state == OptionalState.set) { + json['isDefault'] = isDefault.toJson(); + } + return json; + } + + CreateCustomRateCardVariables({ + required this.name, + required this.baseBook, + required this.discount, + required this.isDefault, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_document.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_document.dart new file mode 100644 index 00000000..1e8735c0 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_document.dart @@ -0,0 +1,149 @@ +part of 'generated.dart'; + +class CreateDocumentVariablesBuilder { + DocumentType documentType; + String name; + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateDocumentVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + + CreateDocumentVariablesBuilder(this._dataConnect, {required this.documentType,required this.name,}); + Deserializer dataDeserializer = (dynamic json) => CreateDocumentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateDocumentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateDocumentVariables vars= CreateDocumentVariables(documentType: documentType,name: name,description: _description,); + return _dataConnect.mutation("createDocument", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateDocumentDocumentInsert { + final String id; + CreateDocumentDocumentInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateDocumentDocumentInsert otherTyped = other as CreateDocumentDocumentInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateDocumentDocumentInsert({ + required this.id, + }); +} + +@immutable +class CreateDocumentData { + final CreateDocumentDocumentInsert document_insert; + CreateDocumentData.fromJson(dynamic json): + + document_insert = CreateDocumentDocumentInsert.fromJson(json['document_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateDocumentData otherTyped = other as CreateDocumentData; + return document_insert == otherTyped.document_insert; + + } + @override + int get hashCode => document_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['document_insert'] = document_insert.toJson(); + return json; + } + + CreateDocumentData({ + required this.document_insert, + }); +} + +@immutable +class CreateDocumentVariables { + final DocumentType documentType; + final String name; + late final Optionaldescription; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateDocumentVariables.fromJson(Map json): + + documentType = DocumentType.values.byName(json['documentType']), + name = nativeFromJson(json['name']) { + + + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateDocumentVariables otherTyped = other as CreateDocumentVariables; + return documentType == otherTyped.documentType && + name == otherTyped.name && + description == otherTyped.description; + + } + @override + int get hashCode => Object.hashAll([documentType.hashCode, name.hashCode, description.hashCode]); + + + Map toJson() { + Map json = {}; + json['documentType'] = + documentType.name + ; + json['name'] = nativeToJson(name); + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + return json; + } + + CreateDocumentVariables({ + required this.documentType, + required this.name, + required this.description, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_emergency_contact.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_emergency_contact.dart new file mode 100644 index 00000000..f843e41f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_emergency_contact.dart @@ -0,0 +1,142 @@ +part of 'generated.dart'; + +class CreateEmergencyContactVariablesBuilder { + String name; + String phone; + RelationshipType relationship; + String staffId; + + final FirebaseDataConnect _dataConnect; + CreateEmergencyContactVariablesBuilder(this._dataConnect, {required this.name,required this.phone,required this.relationship,required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => CreateEmergencyContactData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateEmergencyContactVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateEmergencyContactVariables vars= CreateEmergencyContactVariables(name: name,phone: phone,relationship: relationship,staffId: staffId,); + return _dataConnect.mutation("createEmergencyContact", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateEmergencyContactEmergencyContactInsert { + final String id; + CreateEmergencyContactEmergencyContactInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateEmergencyContactEmergencyContactInsert otherTyped = other as CreateEmergencyContactEmergencyContactInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateEmergencyContactEmergencyContactInsert({ + required this.id, + }); +} + +@immutable +class CreateEmergencyContactData { + final CreateEmergencyContactEmergencyContactInsert emergencyContact_insert; + CreateEmergencyContactData.fromJson(dynamic json): + + emergencyContact_insert = CreateEmergencyContactEmergencyContactInsert.fromJson(json['emergencyContact_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateEmergencyContactData otherTyped = other as CreateEmergencyContactData; + return emergencyContact_insert == otherTyped.emergencyContact_insert; + + } + @override + int get hashCode => emergencyContact_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['emergencyContact_insert'] = emergencyContact_insert.toJson(); + return json; + } + + CreateEmergencyContactData({ + required this.emergencyContact_insert, + }); +} + +@immutable +class CreateEmergencyContactVariables { + final String name; + final String phone; + final RelationshipType relationship; + final String staffId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateEmergencyContactVariables.fromJson(Map json): + + name = nativeFromJson(json['name']), + phone = nativeFromJson(json['phone']), + relationship = RelationshipType.values.byName(json['relationship']), + staffId = nativeFromJson(json['staffId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateEmergencyContactVariables otherTyped = other as CreateEmergencyContactVariables; + return name == otherTyped.name && + phone == otherTyped.phone && + relationship == otherTyped.relationship && + staffId == otherTyped.staffId; + + } + @override + int get hashCode => Object.hashAll([name.hashCode, phone.hashCode, relationship.hashCode, staffId.hashCode]); + + + Map toJson() { + Map json = {}; + json['name'] = nativeToJson(name); + json['phone'] = nativeToJson(phone); + json['relationship'] = + relationship.name + ; + json['staffId'] = nativeToJson(staffId); + return json; + } + + CreateEmergencyContactVariables({ + required this.name, + required this.phone, + required this.relationship, + required this.staffId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_faq_data.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_faq_data.dart new file mode 100644 index 00000000..7f57359f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_faq_data.dart @@ -0,0 +1,142 @@ +part of 'generated.dart'; + +class CreateFaqDataVariablesBuilder { + String category; + Optional> _questions = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer)); + + final FirebaseDataConnect _dataConnect; CreateFaqDataVariablesBuilder questions(List? t) { + _questions.value = t; + return this; + } + + CreateFaqDataVariablesBuilder(this._dataConnect, {required this.category,}); + Deserializer dataDeserializer = (dynamic json) => CreateFaqDataData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateFaqDataVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateFaqDataVariables vars= CreateFaqDataVariables(category: category,questions: _questions,); + return _dataConnect.mutation("createFaqData", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateFaqDataFaqDataInsert { + final String id; + CreateFaqDataFaqDataInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateFaqDataFaqDataInsert otherTyped = other as CreateFaqDataFaqDataInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateFaqDataFaqDataInsert({ + required this.id, + }); +} + +@immutable +class CreateFaqDataData { + final CreateFaqDataFaqDataInsert faqData_insert; + CreateFaqDataData.fromJson(dynamic json): + + faqData_insert = CreateFaqDataFaqDataInsert.fromJson(json['faqData_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateFaqDataData otherTyped = other as CreateFaqDataData; + return faqData_insert == otherTyped.faqData_insert; + + } + @override + int get hashCode => faqData_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['faqData_insert'] = faqData_insert.toJson(); + return json; + } + + CreateFaqDataData({ + required this.faqData_insert, + }); +} + +@immutable +class CreateFaqDataVariables { + final String category; + late final Optional>questions; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateFaqDataVariables.fromJson(Map json): + + category = nativeFromJson(json['category']) { + + + + questions = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer)); + questions.value = json['questions'] == null ? null : (json['questions'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateFaqDataVariables otherTyped = other as CreateFaqDataVariables; + return category == otherTyped.category && + questions == otherTyped.questions; + + } + @override + int get hashCode => Object.hashAll([category.hashCode, questions.hashCode]); + + + Map toJson() { + Map json = {}; + json['category'] = nativeToJson(category); + if(questions.state == OptionalState.set) { + json['questions'] = questions.toJson(); + } + return json; + } + + CreateFaqDataVariables({ + required this.category, + required this.questions, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_hub.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_hub.dart new file mode 100644 index 00000000..b418f9bc --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_hub.dart @@ -0,0 +1,177 @@ +part of 'generated.dart'; + +class CreateHubVariablesBuilder { + String name; + Optional _locationName = Optional.optional(nativeFromJson, nativeToJson); + Optional _address = Optional.optional(nativeFromJson, nativeToJson); + Optional _nfcTagId = Optional.optional(nativeFromJson, nativeToJson); + String ownerId; + + final FirebaseDataConnect _dataConnect; CreateHubVariablesBuilder locationName(String? t) { + _locationName.value = t; + return this; + } + CreateHubVariablesBuilder address(String? t) { + _address.value = t; + return this; + } + CreateHubVariablesBuilder nfcTagId(String? t) { + _nfcTagId.value = t; + return this; + } + + CreateHubVariablesBuilder(this._dataConnect, {required this.name,required this.ownerId,}); + Deserializer dataDeserializer = (dynamic json) => CreateHubData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateHubVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateHubVariables vars= CreateHubVariables(name: name,locationName: _locationName,address: _address,nfcTagId: _nfcTagId,ownerId: ownerId,); + return _dataConnect.mutation("createHub", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateHubHubInsert { + final String id; + CreateHubHubInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateHubHubInsert otherTyped = other as CreateHubHubInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateHubHubInsert({ + required this.id, + }); +} + +@immutable +class CreateHubData { + final CreateHubHubInsert hub_insert; + CreateHubData.fromJson(dynamic json): + + hub_insert = CreateHubHubInsert.fromJson(json['hub_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateHubData otherTyped = other as CreateHubData; + return hub_insert == otherTyped.hub_insert; + + } + @override + int get hashCode => hub_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['hub_insert'] = hub_insert.toJson(); + return json; + } + + CreateHubData({ + required this.hub_insert, + }); +} + +@immutable +class CreateHubVariables { + final String name; + late final OptionallocationName; + late final Optionaladdress; + late final OptionalnfcTagId; + final String ownerId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateHubVariables.fromJson(Map json): + + name = nativeFromJson(json['name']), + ownerId = nativeFromJson(json['ownerId']) { + + + + locationName = Optional.optional(nativeFromJson, nativeToJson); + locationName.value = json['locationName'] == null ? null : nativeFromJson(json['locationName']); + + + address = Optional.optional(nativeFromJson, nativeToJson); + address.value = json['address'] == null ? null : nativeFromJson(json['address']); + + + nfcTagId = Optional.optional(nativeFromJson, nativeToJson); + nfcTagId.value = json['nfcTagId'] == null ? null : nativeFromJson(json['nfcTagId']); + + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateHubVariables otherTyped = other as CreateHubVariables; + return name == otherTyped.name && + locationName == otherTyped.locationName && + address == otherTyped.address && + nfcTagId == otherTyped.nfcTagId && + ownerId == otherTyped.ownerId; + + } + @override + int get hashCode => Object.hashAll([name.hashCode, locationName.hashCode, address.hashCode, nfcTagId.hashCode, ownerId.hashCode]); + + + Map toJson() { + Map json = {}; + json['name'] = nativeToJson(name); + if(locationName.state == OptionalState.set) { + json['locationName'] = locationName.toJson(); + } + if(address.state == OptionalState.set) { + json['address'] = address.toJson(); + } + if(nfcTagId.state == OptionalState.set) { + json['nfcTagId'] = nfcTagId.toJson(); + } + json['ownerId'] = nativeToJson(ownerId); + return json; + } + + CreateHubVariables({ + required this.name, + required this.locationName, + required this.address, + required this.nfcTagId, + required this.ownerId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_invoice.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_invoice.dart new file mode 100644 index 00000000..02946656 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_invoice.dart @@ -0,0 +1,341 @@ +part of 'generated.dart'; + +class CreateInvoiceVariablesBuilder { + InvoiceStatus status; + String vendorId; + String businessId; + String orderId; + Optional _paymentTerms = Optional.optional((data) => InovicePaymentTerms.values.byName(data), enumSerializer); + String invoiceNumber; + Timestamp issueDate; + Timestamp dueDate; + Optional _hub = Optional.optional(nativeFromJson, nativeToJson); + Optional _managerName = Optional.optional(nativeFromJson, nativeToJson); + Optional _vendorNumber = Optional.optional(nativeFromJson, nativeToJson); + Optional _roles = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _charges = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _otherCharges = Optional.optional(nativeFromJson, nativeToJson); + Optional _subtotal = Optional.optional(nativeFromJson, nativeToJson); + double amount; + Optional _notes = Optional.optional(nativeFromJson, nativeToJson); + Optional _staffCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _chargesCount = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateInvoiceVariablesBuilder paymentTerms(InovicePaymentTerms? t) { + _paymentTerms.value = t; + return this; + } + CreateInvoiceVariablesBuilder hub(String? t) { + _hub.value = t; + return this; + } + CreateInvoiceVariablesBuilder managerName(String? t) { + _managerName.value = t; + return this; + } + CreateInvoiceVariablesBuilder vendorNumber(String? t) { + _vendorNumber.value = t; + return this; + } + CreateInvoiceVariablesBuilder roles(AnyValue? t) { + _roles.value = t; + return this; + } + CreateInvoiceVariablesBuilder charges(AnyValue? t) { + _charges.value = t; + return this; + } + CreateInvoiceVariablesBuilder otherCharges(double? t) { + _otherCharges.value = t; + return this; + } + CreateInvoiceVariablesBuilder subtotal(double? t) { + _subtotal.value = t; + return this; + } + CreateInvoiceVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + CreateInvoiceVariablesBuilder staffCount(int? t) { + _staffCount.value = t; + return this; + } + CreateInvoiceVariablesBuilder chargesCount(int? t) { + _chargesCount.value = t; + return this; + } + + CreateInvoiceVariablesBuilder(this._dataConnect, {required this.status,required this.vendorId,required this.businessId,required this.orderId,required this.invoiceNumber,required this.issueDate,required this.dueDate,required this.amount,}); + Deserializer dataDeserializer = (dynamic json) => CreateInvoiceData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateInvoiceVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateInvoiceVariables vars= CreateInvoiceVariables(status: status,vendorId: vendorId,businessId: businessId,orderId: orderId,paymentTerms: _paymentTerms,invoiceNumber: invoiceNumber,issueDate: issueDate,dueDate: dueDate,hub: _hub,managerName: _managerName,vendorNumber: _vendorNumber,roles: _roles,charges: _charges,otherCharges: _otherCharges,subtotal: _subtotal,amount: amount,notes: _notes,staffCount: _staffCount,chargesCount: _chargesCount,); + return _dataConnect.mutation("createInvoice", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateInvoiceInvoiceInsert { + final String id; + CreateInvoiceInvoiceInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateInvoiceInvoiceInsert otherTyped = other as CreateInvoiceInvoiceInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateInvoiceInvoiceInsert({ + required this.id, + }); +} + +@immutable +class CreateInvoiceData { + final CreateInvoiceInvoiceInsert invoice_insert; + CreateInvoiceData.fromJson(dynamic json): + + invoice_insert = CreateInvoiceInvoiceInsert.fromJson(json['invoice_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateInvoiceData otherTyped = other as CreateInvoiceData; + return invoice_insert == otherTyped.invoice_insert; + + } + @override + int get hashCode => invoice_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['invoice_insert'] = invoice_insert.toJson(); + return json; + } + + CreateInvoiceData({ + required this.invoice_insert, + }); +} + +@immutable +class CreateInvoiceVariables { + final InvoiceStatus status; + final String vendorId; + final String businessId; + final String orderId; + late final OptionalpaymentTerms; + final String invoiceNumber; + final Timestamp issueDate; + final Timestamp dueDate; + late final Optionalhub; + late final OptionalmanagerName; + late final OptionalvendorNumber; + late final Optionalroles; + late final Optionalcharges; + late final OptionalotherCharges; + late final Optionalsubtotal; + final double amount; + late final Optionalnotes; + late final OptionalstaffCount; + late final OptionalchargesCount; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateInvoiceVariables.fromJson(Map json): + + status = InvoiceStatus.values.byName(json['status']), + vendorId = nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderId = nativeFromJson(json['orderId']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + issueDate = Timestamp.fromJson(json['issueDate']), + dueDate = Timestamp.fromJson(json['dueDate']), + amount = nativeFromJson(json['amount']) { + + + + + + + paymentTerms = Optional.optional((data) => InovicePaymentTerms.values.byName(data), enumSerializer); + paymentTerms.value = json['paymentTerms'] == null ? null : InovicePaymentTerms.values.byName(json['paymentTerms']); + + + + + + hub = Optional.optional(nativeFromJson, nativeToJson); + hub.value = json['hub'] == null ? null : nativeFromJson(json['hub']); + + + managerName = Optional.optional(nativeFromJson, nativeToJson); + managerName.value = json['managerName'] == null ? null : nativeFromJson(json['managerName']); + + + vendorNumber = Optional.optional(nativeFromJson, nativeToJson); + vendorNumber.value = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']); + + + roles = Optional.optional(AnyValue.fromJson, defaultSerializer); + roles.value = json['roles'] == null ? null : AnyValue.fromJson(json['roles']); + + + charges = Optional.optional(AnyValue.fromJson, defaultSerializer); + charges.value = json['charges'] == null ? null : AnyValue.fromJson(json['charges']); + + + otherCharges = Optional.optional(nativeFromJson, nativeToJson); + otherCharges.value = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']); + + + subtotal = Optional.optional(nativeFromJson, nativeToJson); + subtotal.value = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']); + + + + notes = Optional.optional(nativeFromJson, nativeToJson); + notes.value = json['notes'] == null ? null : nativeFromJson(json['notes']); + + + staffCount = Optional.optional(nativeFromJson, nativeToJson); + staffCount.value = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']); + + + chargesCount = Optional.optional(nativeFromJson, nativeToJson); + chargesCount.value = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateInvoiceVariables otherTyped = other as CreateInvoiceVariables; + return status == otherTyped.status && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount; + + } + @override + int get hashCode => Object.hashAll([status.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode]); + + + Map toJson() { + Map json = {}; + json['status'] = + status.name + ; + json['vendorId'] = nativeToJson(vendorId); + json['businessId'] = nativeToJson(businessId); + json['orderId'] = nativeToJson(orderId); + if(paymentTerms.state == OptionalState.set) { + json['paymentTerms'] = paymentTerms.toJson(); + } + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['issueDate'] = issueDate.toJson(); + json['dueDate'] = dueDate.toJson(); + if(hub.state == OptionalState.set) { + json['hub'] = hub.toJson(); + } + if(managerName.state == OptionalState.set) { + json['managerName'] = managerName.toJson(); + } + if(vendorNumber.state == OptionalState.set) { + json['vendorNumber'] = vendorNumber.toJson(); + } + if(roles.state == OptionalState.set) { + json['roles'] = roles.toJson(); + } + if(charges.state == OptionalState.set) { + json['charges'] = charges.toJson(); + } + if(otherCharges.state == OptionalState.set) { + json['otherCharges'] = otherCharges.toJson(); + } + if(subtotal.state == OptionalState.set) { + json['subtotal'] = subtotal.toJson(); + } + json['amount'] = nativeToJson(amount); + if(notes.state == OptionalState.set) { + json['notes'] = notes.toJson(); + } + if(staffCount.state == OptionalState.set) { + json['staffCount'] = staffCount.toJson(); + } + if(chargesCount.state == OptionalState.set) { + json['chargesCount'] = chargesCount.toJson(); + } + return json; + } + + CreateInvoiceVariables({ + required this.status, + required this.vendorId, + required this.businessId, + required this.orderId, + required this.paymentTerms, + required this.invoiceNumber, + required this.issueDate, + required this.dueDate, + required this.hub, + required this.managerName, + required this.vendorNumber, + required this.roles, + required this.charges, + required this.otherCharges, + required this.subtotal, + required this.amount, + required this.notes, + required this.staffCount, + required this.chargesCount, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_invoice_template.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_invoice_template.dart new file mode 100644 index 00000000..317d2fd7 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_invoice_template.dart @@ -0,0 +1,402 @@ +part of 'generated.dart'; + +class CreateInvoiceTemplateVariablesBuilder { + String name; + String ownerId; + Optional _vendorId = Optional.optional(nativeFromJson, nativeToJson); + Optional _businessId = Optional.optional(nativeFromJson, nativeToJson); + Optional _orderId = Optional.optional(nativeFromJson, nativeToJson); + Optional _paymentTerms = Optional.optional((data) => InovicePaymentTermsTemp.values.byName(data), enumSerializer); + Optional _invoiceNumber = Optional.optional(nativeFromJson, nativeToJson); + Optional _issueDate = Optional.optional((json) => json['issueDate'] = Timestamp.fromJson(json['issueDate']), defaultSerializer); + Optional _dueDate = Optional.optional((json) => json['dueDate'] = Timestamp.fromJson(json['dueDate']), defaultSerializer); + Optional _hub = Optional.optional(nativeFromJson, nativeToJson); + Optional _managerName = Optional.optional(nativeFromJson, nativeToJson); + Optional _vendorNumber = Optional.optional(nativeFromJson, nativeToJson); + Optional _roles = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _charges = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _otherCharges = Optional.optional(nativeFromJson, nativeToJson); + Optional _subtotal = Optional.optional(nativeFromJson, nativeToJson); + Optional _amount = Optional.optional(nativeFromJson, nativeToJson); + Optional _notes = Optional.optional(nativeFromJson, nativeToJson); + Optional _staffCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _chargesCount = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateInvoiceTemplateVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder businessId(String? t) { + _businessId.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder orderId(String? t) { + _orderId.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder paymentTerms(InovicePaymentTermsTemp? t) { + _paymentTerms.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder invoiceNumber(String? t) { + _invoiceNumber.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder issueDate(Timestamp? t) { + _issueDate.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder dueDate(Timestamp? t) { + _dueDate.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder hub(String? t) { + _hub.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder managerName(String? t) { + _managerName.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder vendorNumber(String? t) { + _vendorNumber.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder roles(AnyValue? t) { + _roles.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder charges(AnyValue? t) { + _charges.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder otherCharges(double? t) { + _otherCharges.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder subtotal(double? t) { + _subtotal.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder amount(double? t) { + _amount.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder staffCount(int? t) { + _staffCount.value = t; + return this; + } + CreateInvoiceTemplateVariablesBuilder chargesCount(int? t) { + _chargesCount.value = t; + return this; + } + + CreateInvoiceTemplateVariablesBuilder(this._dataConnect, {required this.name,required this.ownerId,}); + Deserializer dataDeserializer = (dynamic json) => CreateInvoiceTemplateData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateInvoiceTemplateVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateInvoiceTemplateVariables vars= CreateInvoiceTemplateVariables(name: name,ownerId: ownerId,vendorId: _vendorId,businessId: _businessId,orderId: _orderId,paymentTerms: _paymentTerms,invoiceNumber: _invoiceNumber,issueDate: _issueDate,dueDate: _dueDate,hub: _hub,managerName: _managerName,vendorNumber: _vendorNumber,roles: _roles,charges: _charges,otherCharges: _otherCharges,subtotal: _subtotal,amount: _amount,notes: _notes,staffCount: _staffCount,chargesCount: _chargesCount,); + return _dataConnect.mutation("createInvoiceTemplate", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateInvoiceTemplateInvoiceTemplateInsert { + final String id; + CreateInvoiceTemplateInvoiceTemplateInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateInvoiceTemplateInvoiceTemplateInsert otherTyped = other as CreateInvoiceTemplateInvoiceTemplateInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateInvoiceTemplateInvoiceTemplateInsert({ + required this.id, + }); +} + +@immutable +class CreateInvoiceTemplateData { + final CreateInvoiceTemplateInvoiceTemplateInsert invoiceTemplate_insert; + CreateInvoiceTemplateData.fromJson(dynamic json): + + invoiceTemplate_insert = CreateInvoiceTemplateInvoiceTemplateInsert.fromJson(json['invoiceTemplate_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateInvoiceTemplateData otherTyped = other as CreateInvoiceTemplateData; + return invoiceTemplate_insert == otherTyped.invoiceTemplate_insert; + + } + @override + int get hashCode => invoiceTemplate_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['invoiceTemplate_insert'] = invoiceTemplate_insert.toJson(); + return json; + } + + CreateInvoiceTemplateData({ + required this.invoiceTemplate_insert, + }); +} + +@immutable +class CreateInvoiceTemplateVariables { + final String name; + final String ownerId; + late final OptionalvendorId; + late final OptionalbusinessId; + late final OptionalorderId; + late final OptionalpaymentTerms; + late final OptionalinvoiceNumber; + late final OptionalissueDate; + late final OptionaldueDate; + late final Optionalhub; + late final OptionalmanagerName; + late final OptionalvendorNumber; + late final Optionalroles; + late final Optionalcharges; + late final OptionalotherCharges; + late final Optionalsubtotal; + late final Optionalamount; + late final Optionalnotes; + late final OptionalstaffCount; + late final OptionalchargesCount; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateInvoiceTemplateVariables.fromJson(Map json): + + name = nativeFromJson(json['name']), + ownerId = nativeFromJson(json['ownerId']) { + + + + + vendorId = Optional.optional(nativeFromJson, nativeToJson); + vendorId.value = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + + + businessId = Optional.optional(nativeFromJson, nativeToJson); + businessId.value = json['businessId'] == null ? null : nativeFromJson(json['businessId']); + + + orderId = Optional.optional(nativeFromJson, nativeToJson); + orderId.value = json['orderId'] == null ? null : nativeFromJson(json['orderId']); + + + paymentTerms = Optional.optional((data) => InovicePaymentTermsTemp.values.byName(data), enumSerializer); + paymentTerms.value = json['paymentTerms'] == null ? null : InovicePaymentTermsTemp.values.byName(json['paymentTerms']); + + + invoiceNumber = Optional.optional(nativeFromJson, nativeToJson); + invoiceNumber.value = json['invoiceNumber'] == null ? null : nativeFromJson(json['invoiceNumber']); + + + issueDate = Optional.optional((json) => json['issueDate'] = Timestamp.fromJson(json['issueDate']), defaultSerializer); + issueDate.value = json['issueDate'] == null ? null : Timestamp.fromJson(json['issueDate']); + + + dueDate = Optional.optional((json) => json['dueDate'] = Timestamp.fromJson(json['dueDate']), defaultSerializer); + dueDate.value = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']); + + + hub = Optional.optional(nativeFromJson, nativeToJson); + hub.value = json['hub'] == null ? null : nativeFromJson(json['hub']); + + + managerName = Optional.optional(nativeFromJson, nativeToJson); + managerName.value = json['managerName'] == null ? null : nativeFromJson(json['managerName']); + + + vendorNumber = Optional.optional(nativeFromJson, nativeToJson); + vendorNumber.value = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']); + + + roles = Optional.optional(AnyValue.fromJson, defaultSerializer); + roles.value = json['roles'] == null ? null : AnyValue.fromJson(json['roles']); + + + charges = Optional.optional(AnyValue.fromJson, defaultSerializer); + charges.value = json['charges'] == null ? null : AnyValue.fromJson(json['charges']); + + + otherCharges = Optional.optional(nativeFromJson, nativeToJson); + otherCharges.value = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']); + + + subtotal = Optional.optional(nativeFromJson, nativeToJson); + subtotal.value = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']); + + + amount = Optional.optional(nativeFromJson, nativeToJson); + amount.value = json['amount'] == null ? null : nativeFromJson(json['amount']); + + + notes = Optional.optional(nativeFromJson, nativeToJson); + notes.value = json['notes'] == null ? null : nativeFromJson(json['notes']); + + + staffCount = Optional.optional(nativeFromJson, nativeToJson); + staffCount.value = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']); + + + chargesCount = Optional.optional(nativeFromJson, nativeToJson); + chargesCount.value = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateInvoiceTemplateVariables otherTyped = other as CreateInvoiceTemplateVariables; + return name == otherTyped.name && + ownerId == otherTyped.ownerId && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount; + + } + @override + int get hashCode => Object.hashAll([name.hashCode, ownerId.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode]); + + + Map toJson() { + Map json = {}; + json['name'] = nativeToJson(name); + json['ownerId'] = nativeToJson(ownerId); + if(vendorId.state == OptionalState.set) { + json['vendorId'] = vendorId.toJson(); + } + if(businessId.state == OptionalState.set) { + json['businessId'] = businessId.toJson(); + } + if(orderId.state == OptionalState.set) { + json['orderId'] = orderId.toJson(); + } + if(paymentTerms.state == OptionalState.set) { + json['paymentTerms'] = paymentTerms.toJson(); + } + if(invoiceNumber.state == OptionalState.set) { + json['invoiceNumber'] = invoiceNumber.toJson(); + } + if(issueDate.state == OptionalState.set) { + json['issueDate'] = issueDate.toJson(); + } + if(dueDate.state == OptionalState.set) { + json['dueDate'] = dueDate.toJson(); + } + if(hub.state == OptionalState.set) { + json['hub'] = hub.toJson(); + } + if(managerName.state == OptionalState.set) { + json['managerName'] = managerName.toJson(); + } + if(vendorNumber.state == OptionalState.set) { + json['vendorNumber'] = vendorNumber.toJson(); + } + if(roles.state == OptionalState.set) { + json['roles'] = roles.toJson(); + } + if(charges.state == OptionalState.set) { + json['charges'] = charges.toJson(); + } + if(otherCharges.state == OptionalState.set) { + json['otherCharges'] = otherCharges.toJson(); + } + if(subtotal.state == OptionalState.set) { + json['subtotal'] = subtotal.toJson(); + } + if(amount.state == OptionalState.set) { + json['amount'] = amount.toJson(); + } + if(notes.state == OptionalState.set) { + json['notes'] = notes.toJson(); + } + if(staffCount.state == OptionalState.set) { + json['staffCount'] = staffCount.toJson(); + } + if(chargesCount.state == OptionalState.set) { + json['chargesCount'] = chargesCount.toJson(); + } + return json; + } + + CreateInvoiceTemplateVariables({ + required this.name, + required this.ownerId, + required this.vendorId, + required this.businessId, + required this.orderId, + required this.paymentTerms, + required this.invoiceNumber, + required this.issueDate, + required this.dueDate, + required this.hub, + required this.managerName, + required this.vendorNumber, + required this.roles, + required this.charges, + required this.otherCharges, + required this.subtotal, + required this.amount, + required this.notes, + required this.staffCount, + required this.chargesCount, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_level.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_level.dart new file mode 100644 index 00000000..6813ff81 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_level.dart @@ -0,0 +1,162 @@ +part of 'generated.dart'; + +class CreateLevelVariablesBuilder { + String name; + int xpRequired; + Optional _icon = Optional.optional(nativeFromJson, nativeToJson); + Optional _colors = Optional.optional(AnyValue.fromJson, defaultSerializer); + + final FirebaseDataConnect _dataConnect; CreateLevelVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + CreateLevelVariablesBuilder colors(AnyValue? t) { + _colors.value = t; + return this; + } + + CreateLevelVariablesBuilder(this._dataConnect, {required this.name,required this.xpRequired,}); + Deserializer dataDeserializer = (dynamic json) => CreateLevelData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateLevelVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateLevelVariables vars= CreateLevelVariables(name: name,xpRequired: xpRequired,icon: _icon,colors: _colors,); + return _dataConnect.mutation("createLevel", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateLevelLevelInsert { + final String id; + CreateLevelLevelInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateLevelLevelInsert otherTyped = other as CreateLevelLevelInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateLevelLevelInsert({ + required this.id, + }); +} + +@immutable +class CreateLevelData { + final CreateLevelLevelInsert level_insert; + CreateLevelData.fromJson(dynamic json): + + level_insert = CreateLevelLevelInsert.fromJson(json['level_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateLevelData otherTyped = other as CreateLevelData; + return level_insert == otherTyped.level_insert; + + } + @override + int get hashCode => level_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['level_insert'] = level_insert.toJson(); + return json; + } + + CreateLevelData({ + required this.level_insert, + }); +} + +@immutable +class CreateLevelVariables { + final String name; + final int xpRequired; + late final Optionalicon; + late final Optionalcolors; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateLevelVariables.fromJson(Map json): + + name = nativeFromJson(json['name']), + xpRequired = nativeFromJson(json['xpRequired']) { + + + + + icon = Optional.optional(nativeFromJson, nativeToJson); + icon.value = json['icon'] == null ? null : nativeFromJson(json['icon']); + + + colors = Optional.optional(AnyValue.fromJson, defaultSerializer); + colors.value = json['colors'] == null ? null : AnyValue.fromJson(json['colors']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateLevelVariables otherTyped = other as CreateLevelVariables; + return name == otherTyped.name && + xpRequired == otherTyped.xpRequired && + icon == otherTyped.icon && + colors == otherTyped.colors; + + } + @override + int get hashCode => Object.hashAll([name.hashCode, xpRequired.hashCode, icon.hashCode, colors.hashCode]); + + + Map toJson() { + Map json = {}; + json['name'] = nativeToJson(name); + json['xpRequired'] = nativeToJson(xpRequired); + if(icon.state == OptionalState.set) { + json['icon'] = icon.toJson(); + } + if(colors.state == OptionalState.set) { + json['colors'] = colors.toJson(); + } + return json; + } + + CreateLevelVariables({ + required this.name, + required this.xpRequired, + required this.icon, + required this.colors, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_member_task.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_member_task.dart new file mode 100644 index 00000000..526c491e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_member_task.dart @@ -0,0 +1,133 @@ +part of 'generated.dart'; + +class CreateMemberTaskVariablesBuilder { + String teamMemberId; + String taskId; + + final FirebaseDataConnect _dataConnect; + CreateMemberTaskVariablesBuilder(this._dataConnect, {required this.teamMemberId,required this.taskId,}); + Deserializer dataDeserializer = (dynamic json) => CreateMemberTaskData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateMemberTaskVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateMemberTaskVariables vars= CreateMemberTaskVariables(teamMemberId: teamMemberId,taskId: taskId,); + return _dataConnect.mutation("createMemberTask", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateMemberTaskMemberTaskInsert { + final String teamMemberId; + final String taskId; + CreateMemberTaskMemberTaskInsert.fromJson(dynamic json): + + teamMemberId = nativeFromJson(json['teamMemberId']), + taskId = nativeFromJson(json['taskId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateMemberTaskMemberTaskInsert otherTyped = other as CreateMemberTaskMemberTaskInsert; + return teamMemberId == otherTyped.teamMemberId && + taskId == otherTyped.taskId; + + } + @override + int get hashCode => Object.hashAll([teamMemberId.hashCode, taskId.hashCode]); + + + Map toJson() { + Map json = {}; + json['teamMemberId'] = nativeToJson(teamMemberId); + json['taskId'] = nativeToJson(taskId); + return json; + } + + CreateMemberTaskMemberTaskInsert({ + required this.teamMemberId, + required this.taskId, + }); +} + +@immutable +class CreateMemberTaskData { + final CreateMemberTaskMemberTaskInsert memberTask_insert; + CreateMemberTaskData.fromJson(dynamic json): + + memberTask_insert = CreateMemberTaskMemberTaskInsert.fromJson(json['memberTask_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateMemberTaskData otherTyped = other as CreateMemberTaskData; + return memberTask_insert == otherTyped.memberTask_insert; + + } + @override + int get hashCode => memberTask_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['memberTask_insert'] = memberTask_insert.toJson(); + return json; + } + + CreateMemberTaskData({ + required this.memberTask_insert, + }); +} + +@immutable +class CreateMemberTaskVariables { + final String teamMemberId; + final String taskId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateMemberTaskVariables.fromJson(Map json): + + teamMemberId = nativeFromJson(json['teamMemberId']), + taskId = nativeFromJson(json['taskId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateMemberTaskVariables otherTyped = other as CreateMemberTaskVariables; + return teamMemberId == otherTyped.teamMemberId && + taskId == otherTyped.taskId; + + } + @override + int get hashCode => Object.hashAll([teamMemberId.hashCode, taskId.hashCode]); + + + Map toJson() { + Map json = {}; + json['teamMemberId'] = nativeToJson(teamMemberId); + json['taskId'] = nativeToJson(taskId); + return json; + } + + CreateMemberTaskVariables({ + required this.teamMemberId, + required this.taskId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_message.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_message.dart new file mode 100644 index 00000000..00c46728 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_message.dart @@ -0,0 +1,154 @@ +part of 'generated.dart'; + +class CreateMessageVariablesBuilder { + String conversationId; + String senderId; + String content; + Optional _isSystem = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateMessageVariablesBuilder isSystem(bool? t) { + _isSystem.value = t; + return this; + } + + CreateMessageVariablesBuilder(this._dataConnect, {required this.conversationId,required this.senderId,required this.content,}); + Deserializer dataDeserializer = (dynamic json) => CreateMessageData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateMessageVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateMessageVariables vars= CreateMessageVariables(conversationId: conversationId,senderId: senderId,content: content,isSystem: _isSystem,); + return _dataConnect.mutation("createMessage", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateMessageMessageInsert { + final String id; + CreateMessageMessageInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateMessageMessageInsert otherTyped = other as CreateMessageMessageInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateMessageMessageInsert({ + required this.id, + }); +} + +@immutable +class CreateMessageData { + final CreateMessageMessageInsert message_insert; + CreateMessageData.fromJson(dynamic json): + + message_insert = CreateMessageMessageInsert.fromJson(json['message_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateMessageData otherTyped = other as CreateMessageData; + return message_insert == otherTyped.message_insert; + + } + @override + int get hashCode => message_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['message_insert'] = message_insert.toJson(); + return json; + } + + CreateMessageData({ + required this.message_insert, + }); +} + +@immutable +class CreateMessageVariables { + final String conversationId; + final String senderId; + final String content; + late final OptionalisSystem; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateMessageVariables.fromJson(Map json): + + conversationId = nativeFromJson(json['conversationId']), + senderId = nativeFromJson(json['senderId']), + content = nativeFromJson(json['content']) { + + + + + + isSystem = Optional.optional(nativeFromJson, nativeToJson); + isSystem.value = json['isSystem'] == null ? null : nativeFromJson(json['isSystem']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateMessageVariables otherTyped = other as CreateMessageVariables; + return conversationId == otherTyped.conversationId && + senderId == otherTyped.senderId && + content == otherTyped.content && + isSystem == otherTyped.isSystem; + + } + @override + int get hashCode => Object.hashAll([conversationId.hashCode, senderId.hashCode, content.hashCode, isSystem.hashCode]); + + + Map toJson() { + Map json = {}; + json['conversationId'] = nativeToJson(conversationId); + json['senderId'] = nativeToJson(senderId); + json['content'] = nativeToJson(content); + if(isSystem.state == OptionalState.set) { + json['isSystem'] = isSystem.toJson(); + } + return json; + } + + CreateMessageVariables({ + required this.conversationId, + required this.senderId, + required this.content, + required this.isSystem, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_order.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_order.dart new file mode 100644 index 00000000..6cbe2419 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_order.dart @@ -0,0 +1,435 @@ +part of 'generated.dart'; + +class CreateOrderVariablesBuilder { + Optional _vendorId = Optional.optional(nativeFromJson, nativeToJson); + String businessId; + OrderType orderType; + Optional _location = Optional.optional(nativeFromJson, nativeToJson); + Optional _status = Optional.optional((data) => OrderStatus.values.byName(data), enumSerializer); + Optional _date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer); + Optional _startDate = Optional.optional((json) => json['startDate'] = Timestamp.fromJson(json['startDate']), defaultSerializer); + Optional _endDate = Optional.optional((json) => json['endDate'] = Timestamp.fromJson(json['endDate']), defaultSerializer); + Optional _duration = Optional.optional((data) => OrderDuration.values.byName(data), enumSerializer); + Optional _lunchBreak = Optional.optional(nativeFromJson, nativeToJson); + Optional _total = Optional.optional(nativeFromJson, nativeToJson); + Optional _eventName = Optional.optional(nativeFromJson, nativeToJson); + Optional _assignedStaff = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _shifts = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _requested = Optional.optional(nativeFromJson, nativeToJson); + Optional _hub = Optional.optional(nativeFromJson, nativeToJson); + Optional _recurringDays = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _permanentStartDate = Optional.optional((json) => json['permanentStartDate'] = Timestamp.fromJson(json['permanentStartDate']), defaultSerializer); + Optional _permanentDays = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _notes = Optional.optional(nativeFromJson, nativeToJson); + Optional _detectedConflicts = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _poReference = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + CreateOrderVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + CreateOrderVariablesBuilder location(String? t) { + _location.value = t; + return this; + } + CreateOrderVariablesBuilder status(OrderStatus? t) { + _status.value = t; + return this; + } + CreateOrderVariablesBuilder date(Timestamp? t) { + _date.value = t; + return this; + } + CreateOrderVariablesBuilder startDate(Timestamp? t) { + _startDate.value = t; + return this; + } + CreateOrderVariablesBuilder endDate(Timestamp? t) { + _endDate.value = t; + return this; + } + CreateOrderVariablesBuilder duration(OrderDuration? t) { + _duration.value = t; + return this; + } + CreateOrderVariablesBuilder lunchBreak(int? t) { + _lunchBreak.value = t; + return this; + } + CreateOrderVariablesBuilder total(double? t) { + _total.value = t; + return this; + } + CreateOrderVariablesBuilder eventName(String? t) { + _eventName.value = t; + return this; + } + CreateOrderVariablesBuilder assignedStaff(AnyValue? t) { + _assignedStaff.value = t; + return this; + } + CreateOrderVariablesBuilder shifts(AnyValue? t) { + _shifts.value = t; + return this; + } + CreateOrderVariablesBuilder requested(int? t) { + _requested.value = t; + return this; + } + CreateOrderVariablesBuilder hub(String? t) { + _hub.value = t; + return this; + } + CreateOrderVariablesBuilder recurringDays(AnyValue? t) { + _recurringDays.value = t; + return this; + } + CreateOrderVariablesBuilder permanentStartDate(Timestamp? t) { + _permanentStartDate.value = t; + return this; + } + CreateOrderVariablesBuilder permanentDays(AnyValue? t) { + _permanentDays.value = t; + return this; + } + CreateOrderVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + CreateOrderVariablesBuilder detectedConflicts(AnyValue? t) { + _detectedConflicts.value = t; + return this; + } + CreateOrderVariablesBuilder poReference(String? t) { + _poReference.value = t; + return this; + } + + CreateOrderVariablesBuilder(this._dataConnect, {required this.businessId,required this.orderType,}); + Deserializer dataDeserializer = (dynamic json) => CreateOrderData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateOrderVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateOrderVariables vars= CreateOrderVariables(vendorId: _vendorId,businessId: businessId,orderType: orderType,location: _location,status: _status,date: _date,startDate: _startDate,endDate: _endDate,duration: _duration,lunchBreak: _lunchBreak,total: _total,eventName: _eventName,assignedStaff: _assignedStaff,shifts: _shifts,requested: _requested,hub: _hub,recurringDays: _recurringDays,permanentStartDate: _permanentStartDate,permanentDays: _permanentDays,notes: _notes,detectedConflicts: _detectedConflicts,poReference: _poReference,); + return _dataConnect.mutation("createOrder", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateOrderOrderInsert { + final String id; + CreateOrderOrderInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateOrderOrderInsert otherTyped = other as CreateOrderOrderInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateOrderOrderInsert({ + required this.id, + }); +} + +@immutable +class CreateOrderData { + final CreateOrderOrderInsert order_insert; + CreateOrderData.fromJson(dynamic json): + + order_insert = CreateOrderOrderInsert.fromJson(json['order_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateOrderData otherTyped = other as CreateOrderData; + return order_insert == otherTyped.order_insert; + + } + @override + int get hashCode => order_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['order_insert'] = order_insert.toJson(); + return json; + } + + CreateOrderData({ + required this.order_insert, + }); +} + +@immutable +class CreateOrderVariables { + late final OptionalvendorId; + final String businessId; + final OrderType orderType; + late final Optionallocation; + late final Optionalstatus; + late final Optionaldate; + late final OptionalstartDate; + late final OptionalendDate; + late final Optionalduration; + late final OptionallunchBreak; + late final Optionaltotal; + late final OptionaleventName; + late final OptionalassignedStaff; + late final Optionalshifts; + late final Optionalrequested; + late final Optionalhub; + late final OptionalrecurringDays; + late final OptionalpermanentStartDate; + late final OptionalpermanentDays; + late final Optionalnotes; + late final OptionaldetectedConflicts; + late final OptionalpoReference; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateOrderVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']), + orderType = OrderType.values.byName(json['orderType']) { + + + vendorId = Optional.optional(nativeFromJson, nativeToJson); + vendorId.value = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + + + + + location = Optional.optional(nativeFromJson, nativeToJson); + location.value = json['location'] == null ? null : nativeFromJson(json['location']); + + + status = Optional.optional((data) => OrderStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : OrderStatus.values.byName(json['status']); + + + date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer); + date.value = json['date'] == null ? null : Timestamp.fromJson(json['date']); + + + startDate = Optional.optional((json) => json['startDate'] = Timestamp.fromJson(json['startDate']), defaultSerializer); + startDate.value = json['startDate'] == null ? null : Timestamp.fromJson(json['startDate']); + + + endDate = Optional.optional((json) => json['endDate'] = Timestamp.fromJson(json['endDate']), defaultSerializer); + endDate.value = json['endDate'] == null ? null : Timestamp.fromJson(json['endDate']); + + + duration = Optional.optional((data) => OrderDuration.values.byName(data), enumSerializer); + duration.value = json['duration'] == null ? null : OrderDuration.values.byName(json['duration']); + + + lunchBreak = Optional.optional(nativeFromJson, nativeToJson); + lunchBreak.value = json['lunchBreak'] == null ? null : nativeFromJson(json['lunchBreak']); + + + total = Optional.optional(nativeFromJson, nativeToJson); + total.value = json['total'] == null ? null : nativeFromJson(json['total']); + + + eventName = Optional.optional(nativeFromJson, nativeToJson); + eventName.value = json['eventName'] == null ? null : nativeFromJson(json['eventName']); + + + assignedStaff = Optional.optional(AnyValue.fromJson, defaultSerializer); + assignedStaff.value = json['assignedStaff'] == null ? null : AnyValue.fromJson(json['assignedStaff']); + + + shifts = Optional.optional(AnyValue.fromJson, defaultSerializer); + shifts.value = json['shifts'] == null ? null : AnyValue.fromJson(json['shifts']); + + + requested = Optional.optional(nativeFromJson, nativeToJson); + requested.value = json['requested'] == null ? null : nativeFromJson(json['requested']); + + + hub = Optional.optional(nativeFromJson, nativeToJson); + hub.value = json['hub'] == null ? null : nativeFromJson(json['hub']); + + + recurringDays = Optional.optional(AnyValue.fromJson, defaultSerializer); + recurringDays.value = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']); + + + permanentStartDate = Optional.optional((json) => json['permanentStartDate'] = Timestamp.fromJson(json['permanentStartDate']), defaultSerializer); + permanentStartDate.value = json['permanentStartDate'] == null ? null : Timestamp.fromJson(json['permanentStartDate']); + + + permanentDays = Optional.optional(AnyValue.fromJson, defaultSerializer); + permanentDays.value = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']); + + + notes = Optional.optional(nativeFromJson, nativeToJson); + notes.value = json['notes'] == null ? null : nativeFromJson(json['notes']); + + + detectedConflicts = Optional.optional(AnyValue.fromJson, defaultSerializer); + detectedConflicts.value = json['detectedConflicts'] == null ? null : AnyValue.fromJson(json['detectedConflicts']); + + + poReference = Optional.optional(nativeFromJson, nativeToJson); + poReference.value = json['poReference'] == null ? null : nativeFromJson(json['poReference']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateOrderVariables otherTyped = other as CreateOrderVariables; + return vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderType == otherTyped.orderType && + location == otherTyped.location && + status == otherTyped.status && + date == otherTyped.date && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate && + duration == otherTyped.duration && + lunchBreak == otherTyped.lunchBreak && + total == otherTyped.total && + eventName == otherTyped.eventName && + assignedStaff == otherTyped.assignedStaff && + shifts == otherTyped.shifts && + requested == otherTyped.requested && + hub == otherTyped.hub && + recurringDays == otherTyped.recurringDays && + permanentStartDate == otherTyped.permanentStartDate && + permanentDays == otherTyped.permanentDays && + notes == otherTyped.notes && + detectedConflicts == otherTyped.detectedConflicts && + poReference == otherTyped.poReference; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, businessId.hashCode, orderType.hashCode, location.hashCode, status.hashCode, date.hashCode, startDate.hashCode, endDate.hashCode, duration.hashCode, lunchBreak.hashCode, total.hashCode, eventName.hashCode, assignedStaff.hashCode, shifts.hashCode, requested.hashCode, hub.hashCode, recurringDays.hashCode, permanentStartDate.hashCode, permanentDays.hashCode, notes.hashCode, detectedConflicts.hashCode, poReference.hashCode]); + + + Map toJson() { + Map json = {}; + if(vendorId.state == OptionalState.set) { + json['vendorId'] = vendorId.toJson(); + } + json['businessId'] = nativeToJson(businessId); + json['orderType'] = + orderType.name + ; + if(location.state == OptionalState.set) { + json['location'] = location.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(date.state == OptionalState.set) { + json['date'] = date.toJson(); + } + if(startDate.state == OptionalState.set) { + json['startDate'] = startDate.toJson(); + } + if(endDate.state == OptionalState.set) { + json['endDate'] = endDate.toJson(); + } + if(duration.state == OptionalState.set) { + json['duration'] = duration.toJson(); + } + if(lunchBreak.state == OptionalState.set) { + json['lunchBreak'] = lunchBreak.toJson(); + } + if(total.state == OptionalState.set) { + json['total'] = total.toJson(); + } + if(eventName.state == OptionalState.set) { + json['eventName'] = eventName.toJson(); + } + if(assignedStaff.state == OptionalState.set) { + json['assignedStaff'] = assignedStaff.toJson(); + } + if(shifts.state == OptionalState.set) { + json['shifts'] = shifts.toJson(); + } + if(requested.state == OptionalState.set) { + json['requested'] = requested.toJson(); + } + if(hub.state == OptionalState.set) { + json['hub'] = hub.toJson(); + } + if(recurringDays.state == OptionalState.set) { + json['recurringDays'] = recurringDays.toJson(); + } + if(permanentStartDate.state == OptionalState.set) { + json['permanentStartDate'] = permanentStartDate.toJson(); + } + if(permanentDays.state == OptionalState.set) { + json['permanentDays'] = permanentDays.toJson(); + } + if(notes.state == OptionalState.set) { + json['notes'] = notes.toJson(); + } + if(detectedConflicts.state == OptionalState.set) { + json['detectedConflicts'] = detectedConflicts.toJson(); + } + if(poReference.state == OptionalState.set) { + json['poReference'] = poReference.toJson(); + } + return json; + } + + CreateOrderVariables({ + required this.vendorId, + required this.businessId, + required this.orderType, + required this.location, + required this.status, + required this.date, + required this.startDate, + required this.endDate, + required this.duration, + required this.lunchBreak, + required this.total, + required this.eventName, + required this.assignedStaff, + required this.shifts, + required this.requested, + required this.hub, + required this.recurringDays, + required this.permanentStartDate, + required this.permanentDays, + required this.notes, + required this.detectedConflicts, + required this.poReference, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_recent_payment.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_recent_payment.dart new file mode 100644 index 00000000..8ea91831 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_recent_payment.dart @@ -0,0 +1,170 @@ +part of 'generated.dart'; + +class CreateRecentPaymentVariablesBuilder { + Optional _workedTime = Optional.optional(nativeFromJson, nativeToJson); + Optional _status = Optional.optional((data) => RecentPaymentStatus.values.byName(data), enumSerializer); + String staffId; + String applicationId; + String invoiceId; + + final FirebaseDataConnect _dataConnect; + CreateRecentPaymentVariablesBuilder workedTime(String? t) { + _workedTime.value = t; + return this; + } + CreateRecentPaymentVariablesBuilder status(RecentPaymentStatus? t) { + _status.value = t; + return this; + } + + CreateRecentPaymentVariablesBuilder(this._dataConnect, {required this.staffId,required this.applicationId,required this.invoiceId,}); + Deserializer dataDeserializer = (dynamic json) => CreateRecentPaymentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateRecentPaymentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateRecentPaymentVariables vars= CreateRecentPaymentVariables(workedTime: _workedTime,status: _status,staffId: staffId,applicationId: applicationId,invoiceId: invoiceId,); + return _dataConnect.mutation("createRecentPayment", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateRecentPaymentRecentPaymentInsert { + final String id; + CreateRecentPaymentRecentPaymentInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateRecentPaymentRecentPaymentInsert otherTyped = other as CreateRecentPaymentRecentPaymentInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateRecentPaymentRecentPaymentInsert({ + required this.id, + }); +} + +@immutable +class CreateRecentPaymentData { + final CreateRecentPaymentRecentPaymentInsert recentPayment_insert; + CreateRecentPaymentData.fromJson(dynamic json): + + recentPayment_insert = CreateRecentPaymentRecentPaymentInsert.fromJson(json['recentPayment_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateRecentPaymentData otherTyped = other as CreateRecentPaymentData; + return recentPayment_insert == otherTyped.recentPayment_insert; + + } + @override + int get hashCode => recentPayment_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['recentPayment_insert'] = recentPayment_insert.toJson(); + return json; + } + + CreateRecentPaymentData({ + required this.recentPayment_insert, + }); +} + +@immutable +class CreateRecentPaymentVariables { + late final OptionalworkedTime; + late final Optionalstatus; + final String staffId; + final String applicationId; + final String invoiceId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateRecentPaymentVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + applicationId = nativeFromJson(json['applicationId']), + invoiceId = nativeFromJson(json['invoiceId']) { + + + workedTime = Optional.optional(nativeFromJson, nativeToJson); + workedTime.value = json['workedTime'] == null ? null : nativeFromJson(json['workedTime']); + + + status = Optional.optional((data) => RecentPaymentStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : RecentPaymentStatus.values.byName(json['status']); + + + + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateRecentPaymentVariables otherTyped = other as CreateRecentPaymentVariables; + return workedTime == otherTyped.workedTime && + status == otherTyped.status && + staffId == otherTyped.staffId && + applicationId == otherTyped.applicationId && + invoiceId == otherTyped.invoiceId; + + } + @override + int get hashCode => Object.hashAll([workedTime.hashCode, status.hashCode, staffId.hashCode, applicationId.hashCode, invoiceId.hashCode]); + + + Map toJson() { + Map json = {}; + if(workedTime.state == OptionalState.set) { + json['workedTime'] = workedTime.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + json['staffId'] = nativeToJson(staffId); + json['applicationId'] = nativeToJson(applicationId); + json['invoiceId'] = nativeToJson(invoiceId); + return json; + } + + CreateRecentPaymentVariables({ + required this.workedTime, + required this.status, + required this.staffId, + required this.applicationId, + required this.invoiceId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_role.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_role.dart new file mode 100644 index 00000000..23bedc4e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_role.dart @@ -0,0 +1,140 @@ +part of 'generated.dart'; + +class CreateRoleVariablesBuilder { + String name; + double costPerHour; + String vendorId; + String roleCategoryId; + + final FirebaseDataConnect _dataConnect; + CreateRoleVariablesBuilder(this._dataConnect, {required this.name,required this.costPerHour,required this.vendorId,required this.roleCategoryId,}); + Deserializer dataDeserializer = (dynamic json) => CreateRoleData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateRoleVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateRoleVariables vars= CreateRoleVariables(name: name,costPerHour: costPerHour,vendorId: vendorId,roleCategoryId: roleCategoryId,); + return _dataConnect.mutation("createRole", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateRoleRoleInsert { + final String id; + CreateRoleRoleInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateRoleRoleInsert otherTyped = other as CreateRoleRoleInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateRoleRoleInsert({ + required this.id, + }); +} + +@immutable +class CreateRoleData { + final CreateRoleRoleInsert role_insert; + CreateRoleData.fromJson(dynamic json): + + role_insert = CreateRoleRoleInsert.fromJson(json['role_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateRoleData otherTyped = other as CreateRoleData; + return role_insert == otherTyped.role_insert; + + } + @override + int get hashCode => role_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['role_insert'] = role_insert.toJson(); + return json; + } + + CreateRoleData({ + required this.role_insert, + }); +} + +@immutable +class CreateRoleVariables { + final String name; + final double costPerHour; + final String vendorId; + final String roleCategoryId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateRoleVariables.fromJson(Map json): + + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']), + vendorId = nativeFromJson(json['vendorId']), + roleCategoryId = nativeFromJson(json['roleCategoryId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateRoleVariables otherTyped = other as CreateRoleVariables; + return name == otherTyped.name && + costPerHour == otherTyped.costPerHour && + vendorId == otherTyped.vendorId && + roleCategoryId == otherTyped.roleCategoryId; + + } + @override + int get hashCode => Object.hashAll([name.hashCode, costPerHour.hashCode, vendorId.hashCode, roleCategoryId.hashCode]); + + + Map toJson() { + Map json = {}; + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + json['vendorId'] = nativeToJson(vendorId); + json['roleCategoryId'] = nativeToJson(roleCategoryId); + return json; + } + + CreateRoleVariables({ + required this.name, + required this.costPerHour, + required this.vendorId, + required this.roleCategoryId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_role_category.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_role_category.dart new file mode 100644 index 00000000..2be167ee --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_role_category.dart @@ -0,0 +1,130 @@ +part of 'generated.dart'; + +class CreateRoleCategoryVariablesBuilder { + String roleName; + RoleCategoryType category; + + final FirebaseDataConnect _dataConnect; + CreateRoleCategoryVariablesBuilder(this._dataConnect, {required this.roleName,required this.category,}); + Deserializer dataDeserializer = (dynamic json) => CreateRoleCategoryData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateRoleCategoryVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateRoleCategoryVariables vars= CreateRoleCategoryVariables(roleName: roleName,category: category,); + return _dataConnect.mutation("createRoleCategory", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateRoleCategoryRoleCategoryInsert { + final String id; + CreateRoleCategoryRoleCategoryInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateRoleCategoryRoleCategoryInsert otherTyped = other as CreateRoleCategoryRoleCategoryInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateRoleCategoryRoleCategoryInsert({ + required this.id, + }); +} + +@immutable +class CreateRoleCategoryData { + final CreateRoleCategoryRoleCategoryInsert roleCategory_insert; + CreateRoleCategoryData.fromJson(dynamic json): + + roleCategory_insert = CreateRoleCategoryRoleCategoryInsert.fromJson(json['roleCategory_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateRoleCategoryData otherTyped = other as CreateRoleCategoryData; + return roleCategory_insert == otherTyped.roleCategory_insert; + + } + @override + int get hashCode => roleCategory_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['roleCategory_insert'] = roleCategory_insert.toJson(); + return json; + } + + CreateRoleCategoryData({ + required this.roleCategory_insert, + }); +} + +@immutable +class CreateRoleCategoryVariables { + final String roleName; + final RoleCategoryType category; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateRoleCategoryVariables.fromJson(Map json): + + roleName = nativeFromJson(json['roleName']), + category = RoleCategoryType.values.byName(json['category']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateRoleCategoryVariables otherTyped = other as CreateRoleCategoryVariables; + return roleName == otherTyped.roleName && + category == otherTyped.category; + + } + @override + int get hashCode => Object.hashAll([roleName.hashCode, category.hashCode]); + + + Map toJson() { + Map json = {}; + json['roleName'] = nativeToJson(roleName); + json['category'] = + category.name + ; + return json; + } + + CreateRoleCategoryVariables({ + required this.roleName, + required this.category, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_shift.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_shift.dart new file mode 100644 index 00000000..2f81c6de --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_shift.dart @@ -0,0 +1,389 @@ +part of 'generated.dart'; + +class CreateShiftVariablesBuilder { + String title; + String orderId; + Optional _date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer); + Optional _startTime = Optional.optional((json) => json['startTime'] = Timestamp.fromJson(json['startTime']), defaultSerializer); + Optional _endTime = Optional.optional((json) => json['endTime'] = Timestamp.fromJson(json['endTime']), defaultSerializer); + Optional _hours = Optional.optional(nativeFromJson, nativeToJson); + Optional _cost = Optional.optional(nativeFromJson, nativeToJson); + Optional _location = Optional.optional(nativeFromJson, nativeToJson); + Optional _locationAddress = Optional.optional(nativeFromJson, nativeToJson); + Optional _latitude = Optional.optional(nativeFromJson, nativeToJson); + Optional _longitude = Optional.optional(nativeFromJson, nativeToJson); + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + Optional _status = Optional.optional((data) => ShiftStatus.values.byName(data), enumSerializer); + Optional _workersNeeded = Optional.optional(nativeFromJson, nativeToJson); + Optional _filled = Optional.optional(nativeFromJson, nativeToJson); + Optional _filledAt = Optional.optional((json) => json['filledAt'] = Timestamp.fromJson(json['filledAt']), defaultSerializer); + Optional> _managers = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer)); + Optional _durationDays = Optional.optional(nativeFromJson, nativeToJson); + Optional _createdBy = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateShiftVariablesBuilder date(Timestamp? t) { + _date.value = t; + return this; + } + CreateShiftVariablesBuilder startTime(Timestamp? t) { + _startTime.value = t; + return this; + } + CreateShiftVariablesBuilder endTime(Timestamp? t) { + _endTime.value = t; + return this; + } + CreateShiftVariablesBuilder hours(double? t) { + _hours.value = t; + return this; + } + CreateShiftVariablesBuilder cost(double? t) { + _cost.value = t; + return this; + } + CreateShiftVariablesBuilder location(String? t) { + _location.value = t; + return this; + } + CreateShiftVariablesBuilder locationAddress(String? t) { + _locationAddress.value = t; + return this; + } + CreateShiftVariablesBuilder latitude(double? t) { + _latitude.value = t; + return this; + } + CreateShiftVariablesBuilder longitude(double? t) { + _longitude.value = t; + return this; + } + CreateShiftVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + CreateShiftVariablesBuilder status(ShiftStatus? t) { + _status.value = t; + return this; + } + CreateShiftVariablesBuilder workersNeeded(int? t) { + _workersNeeded.value = t; + return this; + } + CreateShiftVariablesBuilder filled(int? t) { + _filled.value = t; + return this; + } + CreateShiftVariablesBuilder filledAt(Timestamp? t) { + _filledAt.value = t; + return this; + } + CreateShiftVariablesBuilder managers(List? t) { + _managers.value = t; + return this; + } + CreateShiftVariablesBuilder durationDays(int? t) { + _durationDays.value = t; + return this; + } + CreateShiftVariablesBuilder createdBy(String? t) { + _createdBy.value = t; + return this; + } + + CreateShiftVariablesBuilder(this._dataConnect, {required this.title,required this.orderId,}); + Deserializer dataDeserializer = (dynamic json) => CreateShiftData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateShiftVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateShiftVariables vars= CreateShiftVariables(title: title,orderId: orderId,date: _date,startTime: _startTime,endTime: _endTime,hours: _hours,cost: _cost,location: _location,locationAddress: _locationAddress,latitude: _latitude,longitude: _longitude,description: _description,status: _status,workersNeeded: _workersNeeded,filled: _filled,filledAt: _filledAt,managers: _managers,durationDays: _durationDays,createdBy: _createdBy,); + return _dataConnect.mutation("createShift", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateShiftShiftInsert { + final String id; + CreateShiftShiftInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateShiftShiftInsert otherTyped = other as CreateShiftShiftInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateShiftShiftInsert({ + required this.id, + }); +} + +@immutable +class CreateShiftData { + final CreateShiftShiftInsert shift_insert; + CreateShiftData.fromJson(dynamic json): + + shift_insert = CreateShiftShiftInsert.fromJson(json['shift_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateShiftData otherTyped = other as CreateShiftData; + return shift_insert == otherTyped.shift_insert; + + } + @override + int get hashCode => shift_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['shift_insert'] = shift_insert.toJson(); + return json; + } + + CreateShiftData({ + required this.shift_insert, + }); +} + +@immutable +class CreateShiftVariables { + final String title; + final String orderId; + late final Optionaldate; + late final OptionalstartTime; + late final OptionalendTime; + late final Optionalhours; + late final Optionalcost; + late final Optionallocation; + late final OptionallocationAddress; + late final Optionallatitude; + late final Optionallongitude; + late final Optionaldescription; + late final Optionalstatus; + late final OptionalworkersNeeded; + late final Optionalfilled; + late final OptionalfilledAt; + late final Optional>managers; + late final OptionaldurationDays; + late final OptionalcreatedBy; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateShiftVariables.fromJson(Map json): + + title = nativeFromJson(json['title']), + orderId = nativeFromJson(json['orderId']) { + + + + + date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer); + date.value = json['date'] == null ? null : Timestamp.fromJson(json['date']); + + + startTime = Optional.optional((json) => json['startTime'] = Timestamp.fromJson(json['startTime']), defaultSerializer); + startTime.value = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']); + + + endTime = Optional.optional((json) => json['endTime'] = Timestamp.fromJson(json['endTime']), defaultSerializer); + endTime.value = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']); + + + hours = Optional.optional(nativeFromJson, nativeToJson); + hours.value = json['hours'] == null ? null : nativeFromJson(json['hours']); + + + cost = Optional.optional(nativeFromJson, nativeToJson); + cost.value = json['cost'] == null ? null : nativeFromJson(json['cost']); + + + location = Optional.optional(nativeFromJson, nativeToJson); + location.value = json['location'] == null ? null : nativeFromJson(json['location']); + + + locationAddress = Optional.optional(nativeFromJson, nativeToJson); + locationAddress.value = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']); + + + latitude = Optional.optional(nativeFromJson, nativeToJson); + latitude.value = json['latitude'] == null ? null : nativeFromJson(json['latitude']); + + + longitude = Optional.optional(nativeFromJson, nativeToJson); + longitude.value = json['longitude'] == null ? null : nativeFromJson(json['longitude']); + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + + status = Optional.optional((data) => ShiftStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : ShiftStatus.values.byName(json['status']); + + + workersNeeded = Optional.optional(nativeFromJson, nativeToJson); + workersNeeded.value = json['workersNeeded'] == null ? null : nativeFromJson(json['workersNeeded']); + + + filled = Optional.optional(nativeFromJson, nativeToJson); + filled.value = json['filled'] == null ? null : nativeFromJson(json['filled']); + + + filledAt = Optional.optional((json) => json['filledAt'] = Timestamp.fromJson(json['filledAt']), defaultSerializer); + filledAt.value = json['filledAt'] == null ? null : Timestamp.fromJson(json['filledAt']); + + + managers = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer)); + managers.value = json['managers'] == null ? null : (json['managers'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(); + + + durationDays = Optional.optional(nativeFromJson, nativeToJson); + durationDays.value = json['durationDays'] == null ? null : nativeFromJson(json['durationDays']); + + + createdBy = Optional.optional(nativeFromJson, nativeToJson); + createdBy.value = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateShiftVariables otherTyped = other as CreateShiftVariables; + return title == otherTyped.title && + orderId == otherTyped.orderId && + date == otherTyped.date && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + cost == otherTyped.cost && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + latitude == otherTyped.latitude && + longitude == otherTyped.longitude && + description == otherTyped.description && + status == otherTyped.status && + workersNeeded == otherTyped.workersNeeded && + filled == otherTyped.filled && + filledAt == otherTyped.filledAt && + managers == otherTyped.managers && + durationDays == otherTyped.durationDays && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['title'] = nativeToJson(title); + json['orderId'] = nativeToJson(orderId); + if(date.state == OptionalState.set) { + json['date'] = date.toJson(); + } + if(startTime.state == OptionalState.set) { + json['startTime'] = startTime.toJson(); + } + if(endTime.state == OptionalState.set) { + json['endTime'] = endTime.toJson(); + } + if(hours.state == OptionalState.set) { + json['hours'] = hours.toJson(); + } + if(cost.state == OptionalState.set) { + json['cost'] = cost.toJson(); + } + if(location.state == OptionalState.set) { + json['location'] = location.toJson(); + } + if(locationAddress.state == OptionalState.set) { + json['locationAddress'] = locationAddress.toJson(); + } + if(latitude.state == OptionalState.set) { + json['latitude'] = latitude.toJson(); + } + if(longitude.state == OptionalState.set) { + json['longitude'] = longitude.toJson(); + } + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(workersNeeded.state == OptionalState.set) { + json['workersNeeded'] = workersNeeded.toJson(); + } + if(filled.state == OptionalState.set) { + json['filled'] = filled.toJson(); + } + if(filledAt.state == OptionalState.set) { + json['filledAt'] = filledAt.toJson(); + } + if(managers.state == OptionalState.set) { + json['managers'] = managers.toJson(); + } + if(durationDays.state == OptionalState.set) { + json['durationDays'] = durationDays.toJson(); + } + if(createdBy.state == OptionalState.set) { + json['createdBy'] = createdBy.toJson(); + } + return json; + } + + CreateShiftVariables({ + required this.title, + required this.orderId, + required this.date, + required this.startTime, + required this.endTime, + required this.hours, + required this.cost, + required this.location, + required this.locationAddress, + required this.latitude, + required this.longitude, + required this.description, + required this.status, + required this.workersNeeded, + required this.filled, + required this.filledAt, + required this.managers, + required this.durationDays, + required this.createdBy, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_shift_role.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_shift_role.dart new file mode 100644 index 00000000..8ecf9b74 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_shift_role.dart @@ -0,0 +1,264 @@ +part of 'generated.dart'; + +class CreateShiftRoleVariablesBuilder { + String shiftId; + String roleId; + int count; + Optional _assigned = Optional.optional(nativeFromJson, nativeToJson); + Optional _startTime = Optional.optional((json) => json['startTime'] = Timestamp.fromJson(json['startTime']), defaultSerializer); + Optional _endTime = Optional.optional((json) => json['endTime'] = Timestamp.fromJson(json['endTime']), defaultSerializer); + Optional _hours = Optional.optional(nativeFromJson, nativeToJson); + Optional _department = Optional.optional(nativeFromJson, nativeToJson); + Optional _uniform = Optional.optional(nativeFromJson, nativeToJson); + Optional _breakType = Optional.optional((data) => BreakDuration.values.byName(data), enumSerializer); + Optional _totalValue = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateShiftRoleVariablesBuilder assigned(int? t) { + _assigned.value = t; + return this; + } + CreateShiftRoleVariablesBuilder startTime(Timestamp? t) { + _startTime.value = t; + return this; + } + CreateShiftRoleVariablesBuilder endTime(Timestamp? t) { + _endTime.value = t; + return this; + } + CreateShiftRoleVariablesBuilder hours(double? t) { + _hours.value = t; + return this; + } + CreateShiftRoleVariablesBuilder department(String? t) { + _department.value = t; + return this; + } + CreateShiftRoleVariablesBuilder uniform(String? t) { + _uniform.value = t; + return this; + } + CreateShiftRoleVariablesBuilder breakType(BreakDuration? t) { + _breakType.value = t; + return this; + } + CreateShiftRoleVariablesBuilder totalValue(double? t) { + _totalValue.value = t; + return this; + } + + CreateShiftRoleVariablesBuilder(this._dataConnect, {required this.shiftId,required this.roleId,required this.count,}); + Deserializer dataDeserializer = (dynamic json) => CreateShiftRoleData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateShiftRoleVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateShiftRoleVariables vars= CreateShiftRoleVariables(shiftId: shiftId,roleId: roleId,count: count,assigned: _assigned,startTime: _startTime,endTime: _endTime,hours: _hours,department: _department,uniform: _uniform,breakType: _breakType,totalValue: _totalValue,); + return _dataConnect.mutation("createShiftRole", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateShiftRoleShiftRoleInsert { + final String shiftId; + final String roleId; + CreateShiftRoleShiftRoleInsert.fromJson(dynamic json): + + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateShiftRoleShiftRoleInsert otherTyped = other as CreateShiftRoleShiftRoleInsert; + return shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + return json; + } + + CreateShiftRoleShiftRoleInsert({ + required this.shiftId, + required this.roleId, + }); +} + +@immutable +class CreateShiftRoleData { + final CreateShiftRoleShiftRoleInsert shiftRole_insert; + CreateShiftRoleData.fromJson(dynamic json): + + shiftRole_insert = CreateShiftRoleShiftRoleInsert.fromJson(json['shiftRole_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateShiftRoleData otherTyped = other as CreateShiftRoleData; + return shiftRole_insert == otherTyped.shiftRole_insert; + + } + @override + int get hashCode => shiftRole_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['shiftRole_insert'] = shiftRole_insert.toJson(); + return json; + } + + CreateShiftRoleData({ + required this.shiftRole_insert, + }); +} + +@immutable +class CreateShiftRoleVariables { + final String shiftId; + final String roleId; + final int count; + late final Optionalassigned; + late final OptionalstartTime; + late final OptionalendTime; + late final Optionalhours; + late final Optionaldepartment; + late final Optionaluniform; + late final OptionalbreakType; + late final OptionaltotalValue; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateShiftRoleVariables.fromJson(Map json): + + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']), + count = nativeFromJson(json['count']) { + + + + + + assigned = Optional.optional(nativeFromJson, nativeToJson); + assigned.value = json['assigned'] == null ? null : nativeFromJson(json['assigned']); + + + startTime = Optional.optional((json) => json['startTime'] = Timestamp.fromJson(json['startTime']), defaultSerializer); + startTime.value = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']); + + + endTime = Optional.optional((json) => json['endTime'] = Timestamp.fromJson(json['endTime']), defaultSerializer); + endTime.value = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']); + + + hours = Optional.optional(nativeFromJson, nativeToJson); + hours.value = json['hours'] == null ? null : nativeFromJson(json['hours']); + + + department = Optional.optional(nativeFromJson, nativeToJson); + department.value = json['department'] == null ? null : nativeFromJson(json['department']); + + + uniform = Optional.optional(nativeFromJson, nativeToJson); + uniform.value = json['uniform'] == null ? null : nativeFromJson(json['uniform']); + + + breakType = Optional.optional((data) => BreakDuration.values.byName(data), enumSerializer); + breakType.value = json['breakType'] == null ? null : BreakDuration.values.byName(json['breakType']); + + + totalValue = Optional.optional(nativeFromJson, nativeToJson); + totalValue.value = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateShiftRoleVariables otherTyped = other as CreateShiftRoleVariables; + return shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + department == otherTyped.department && + uniform == otherTyped.uniform && + breakType == otherTyped.breakType && + totalValue == otherTyped.totalValue; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, department.hashCode, uniform.hashCode, breakType.hashCode, totalValue.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + json['count'] = nativeToJson(count); + if(assigned.state == OptionalState.set) { + json['assigned'] = assigned.toJson(); + } + if(startTime.state == OptionalState.set) { + json['startTime'] = startTime.toJson(); + } + if(endTime.state == OptionalState.set) { + json['endTime'] = endTime.toJson(); + } + if(hours.state == OptionalState.set) { + json['hours'] = hours.toJson(); + } + if(department.state == OptionalState.set) { + json['department'] = department.toJson(); + } + if(uniform.state == OptionalState.set) { + json['uniform'] = uniform.toJson(); + } + if(breakType.state == OptionalState.set) { + json['breakType'] = breakType.toJson(); + } + if(totalValue.state == OptionalState.set) { + json['totalValue'] = totalValue.toJson(); + } + return json; + } + + CreateShiftRoleVariables({ + required this.shiftId, + required this.roleId, + required this.count, + required this.assigned, + required this.startTime, + required this.endTime, + required this.hours, + required this.department, + required this.uniform, + required this.breakType, + required this.totalValue, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff.dart new file mode 100644 index 00000000..67fa5264 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff.dart @@ -0,0 +1,597 @@ +part of 'generated.dart'; + +class CreateStaffVariablesBuilder { + String userId; + String fullName; + Optional _level = Optional.optional(nativeFromJson, nativeToJson); + Optional _role = Optional.optional(nativeFromJson, nativeToJson); + Optional _phone = Optional.optional(nativeFromJson, nativeToJson); + Optional _email = Optional.optional(nativeFromJson, nativeToJson); + Optional _photoUrl = Optional.optional(nativeFromJson, nativeToJson); + Optional _totalShifts = Optional.optional(nativeFromJson, nativeToJson); + Optional _averageRating = Optional.optional(nativeFromJson, nativeToJson); + Optional _onTimeRate = Optional.optional(nativeFromJson, nativeToJson); + Optional _noShowCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _cancellationCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _reliabilityScore = Optional.optional(nativeFromJson, nativeToJson); + Optional _bio = Optional.optional(nativeFromJson, nativeToJson); + Optional _industries = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _preferredLocations = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _maxDistanceMiles = Optional.optional(nativeFromJson, nativeToJson); + Optional _languages = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _itemsAttire = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _xp = Optional.optional(nativeFromJson, nativeToJson); + Optional _badges = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _isRecommended = Optional.optional(nativeFromJson, nativeToJson); + Optional _ownerId = Optional.optional(nativeFromJson, nativeToJson); + Optional _department = Optional.optional((data) => DepartmentType.values.byName(data), enumSerializer); + Optional _hubId = Optional.optional(nativeFromJson, nativeToJson); + Optional _manager = Optional.optional(nativeFromJson, nativeToJson); + Optional _english = Optional.optional((data) => EnglishProficiency.values.byName(data), enumSerializer); + Optional _backgroundCheckStatus = Optional.optional((data) => BackgroundCheckStatus.values.byName(data), enumSerializer); + Optional _employmentType = Optional.optional((data) => EmploymentType.values.byName(data), enumSerializer); + Optional _initial = Optional.optional(nativeFromJson, nativeToJson); + Optional _englishRequired = Optional.optional(nativeFromJson, nativeToJson); + Optional _city = Optional.optional(nativeFromJson, nativeToJson); + Optional _addres = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateStaffVariablesBuilder level(String? t) { + _level.value = t; + return this; + } + CreateStaffVariablesBuilder role(String? t) { + _role.value = t; + return this; + } + CreateStaffVariablesBuilder phone(String? t) { + _phone.value = t; + return this; + } + CreateStaffVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + CreateStaffVariablesBuilder photoUrl(String? t) { + _photoUrl.value = t; + return this; + } + CreateStaffVariablesBuilder totalShifts(int? t) { + _totalShifts.value = t; + return this; + } + CreateStaffVariablesBuilder averageRating(double? t) { + _averageRating.value = t; + return this; + } + CreateStaffVariablesBuilder onTimeRate(int? t) { + _onTimeRate.value = t; + return this; + } + CreateStaffVariablesBuilder noShowCount(int? t) { + _noShowCount.value = t; + return this; + } + CreateStaffVariablesBuilder cancellationCount(int? t) { + _cancellationCount.value = t; + return this; + } + CreateStaffVariablesBuilder reliabilityScore(int? t) { + _reliabilityScore.value = t; + return this; + } + CreateStaffVariablesBuilder bio(String? t) { + _bio.value = t; + return this; + } + CreateStaffVariablesBuilder industries(AnyValue? t) { + _industries.value = t; + return this; + } + CreateStaffVariablesBuilder preferredLocations(AnyValue? t) { + _preferredLocations.value = t; + return this; + } + CreateStaffVariablesBuilder maxDistanceMiles(int? t) { + _maxDistanceMiles.value = t; + return this; + } + CreateStaffVariablesBuilder languages(AnyValue? t) { + _languages.value = t; + return this; + } + CreateStaffVariablesBuilder itemsAttire(AnyValue? t) { + _itemsAttire.value = t; + return this; + } + CreateStaffVariablesBuilder xp(int? t) { + _xp.value = t; + return this; + } + CreateStaffVariablesBuilder badges(AnyValue? t) { + _badges.value = t; + return this; + } + CreateStaffVariablesBuilder isRecommended(bool? t) { + _isRecommended.value = t; + return this; + } + CreateStaffVariablesBuilder ownerId(String? t) { + _ownerId.value = t; + return this; + } + CreateStaffVariablesBuilder department(DepartmentType? t) { + _department.value = t; + return this; + } + CreateStaffVariablesBuilder hubId(String? t) { + _hubId.value = t; + return this; + } + CreateStaffVariablesBuilder manager(String? t) { + _manager.value = t; + return this; + } + CreateStaffVariablesBuilder english(EnglishProficiency? t) { + _english.value = t; + return this; + } + CreateStaffVariablesBuilder backgroundCheckStatus(BackgroundCheckStatus? t) { + _backgroundCheckStatus.value = t; + return this; + } + CreateStaffVariablesBuilder employmentType(EmploymentType? t) { + _employmentType.value = t; + return this; + } + CreateStaffVariablesBuilder initial(String? t) { + _initial.value = t; + return this; + } + CreateStaffVariablesBuilder englishRequired(bool? t) { + _englishRequired.value = t; + return this; + } + CreateStaffVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + CreateStaffVariablesBuilder addres(String? t) { + _addres.value = t; + return this; + } + + CreateStaffVariablesBuilder(this._dataConnect, {required this.userId,required this.fullName,}); + Deserializer dataDeserializer = (dynamic json) => CreateStaffData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateStaffVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateStaffVariables vars= CreateStaffVariables(userId: userId,fullName: fullName,level: _level,role: _role,phone: _phone,email: _email,photoUrl: _photoUrl,totalShifts: _totalShifts,averageRating: _averageRating,onTimeRate: _onTimeRate,noShowCount: _noShowCount,cancellationCount: _cancellationCount,reliabilityScore: _reliabilityScore,bio: _bio,industries: _industries,preferredLocations: _preferredLocations,maxDistanceMiles: _maxDistanceMiles,languages: _languages,itemsAttire: _itemsAttire,xp: _xp,badges: _badges,isRecommended: _isRecommended,ownerId: _ownerId,department: _department,hubId: _hubId,manager: _manager,english: _english,backgroundCheckStatus: _backgroundCheckStatus,employmentType: _employmentType,initial: _initial,englishRequired: _englishRequired,city: _city,addres: _addres,); + return _dataConnect.mutation("CreateStaff", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateStaffStaffInsert { + final String id; + CreateStaffStaffInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffStaffInsert otherTyped = other as CreateStaffStaffInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateStaffStaffInsert({ + required this.id, + }); +} + +@immutable +class CreateStaffData { + final CreateStaffStaffInsert staff_insert; + CreateStaffData.fromJson(dynamic json): + + staff_insert = CreateStaffStaffInsert.fromJson(json['staff_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffData otherTyped = other as CreateStaffData; + return staff_insert == otherTyped.staff_insert; + + } + @override + int get hashCode => staff_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['staff_insert'] = staff_insert.toJson(); + return json; + } + + CreateStaffData({ + required this.staff_insert, + }); +} + +@immutable +class CreateStaffVariables { + final String userId; + final String fullName; + late final Optionallevel; + late final Optionalrole; + late final Optionalphone; + late final Optionalemail; + late final OptionalphotoUrl; + late final OptionaltotalShifts; + late final OptionalaverageRating; + late final OptionalonTimeRate; + late final OptionalnoShowCount; + late final OptionalcancellationCount; + late final OptionalreliabilityScore; + late final Optionalbio; + late final Optionalindustries; + late final OptionalpreferredLocations; + late final OptionalmaxDistanceMiles; + late final Optionallanguages; + late final OptionalitemsAttire; + late final Optionalxp; + late final Optionalbadges; + late final OptionalisRecommended; + late final OptionalownerId; + late final Optionaldepartment; + late final OptionalhubId; + late final Optionalmanager; + late final Optionalenglish; + late final OptionalbackgroundCheckStatus; + late final OptionalemploymentType; + late final Optionalinitial; + late final OptionalenglishRequired; + late final Optionalcity; + late final Optionaladdres; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateStaffVariables.fromJson(Map json): + + userId = nativeFromJson(json['userId']), + fullName = nativeFromJson(json['fullName']) { + + + + + level = Optional.optional(nativeFromJson, nativeToJson); + level.value = json['level'] == null ? null : nativeFromJson(json['level']); + + + role = Optional.optional(nativeFromJson, nativeToJson); + role.value = json['role'] == null ? null : nativeFromJson(json['role']); + + + phone = Optional.optional(nativeFromJson, nativeToJson); + phone.value = json['phone'] == null ? null : nativeFromJson(json['phone']); + + + email = Optional.optional(nativeFromJson, nativeToJson); + email.value = json['email'] == null ? null : nativeFromJson(json['email']); + + + photoUrl = Optional.optional(nativeFromJson, nativeToJson); + photoUrl.value = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + + + totalShifts = Optional.optional(nativeFromJson, nativeToJson); + totalShifts.value = json['totalShifts'] == null ? null : nativeFromJson(json['totalShifts']); + + + averageRating = Optional.optional(nativeFromJson, nativeToJson); + averageRating.value = json['averageRating'] == null ? null : nativeFromJson(json['averageRating']); + + + onTimeRate = Optional.optional(nativeFromJson, nativeToJson); + onTimeRate.value = json['onTimeRate'] == null ? null : nativeFromJson(json['onTimeRate']); + + + noShowCount = Optional.optional(nativeFromJson, nativeToJson); + noShowCount.value = json['noShowCount'] == null ? null : nativeFromJson(json['noShowCount']); + + + cancellationCount = Optional.optional(nativeFromJson, nativeToJson); + cancellationCount.value = json['cancellationCount'] == null ? null : nativeFromJson(json['cancellationCount']); + + + reliabilityScore = Optional.optional(nativeFromJson, nativeToJson); + reliabilityScore.value = json['reliabilityScore'] == null ? null : nativeFromJson(json['reliabilityScore']); + + + bio = Optional.optional(nativeFromJson, nativeToJson); + bio.value = json['bio'] == null ? null : nativeFromJson(json['bio']); + + + industries = Optional.optional(AnyValue.fromJson, defaultSerializer); + industries.value = json['industries'] == null ? null : AnyValue.fromJson(json['industries']); + + + preferredLocations = Optional.optional(AnyValue.fromJson, defaultSerializer); + preferredLocations.value = json['preferredLocations'] == null ? null : AnyValue.fromJson(json['preferredLocations']); + + + maxDistanceMiles = Optional.optional(nativeFromJson, nativeToJson); + maxDistanceMiles.value = json['maxDistanceMiles'] == null ? null : nativeFromJson(json['maxDistanceMiles']); + + + languages = Optional.optional(AnyValue.fromJson, defaultSerializer); + languages.value = json['languages'] == null ? null : AnyValue.fromJson(json['languages']); + + + itemsAttire = Optional.optional(AnyValue.fromJson, defaultSerializer); + itemsAttire.value = json['itemsAttire'] == null ? null : AnyValue.fromJson(json['itemsAttire']); + + + xp = Optional.optional(nativeFromJson, nativeToJson); + xp.value = json['xp'] == null ? null : nativeFromJson(json['xp']); + + + badges = Optional.optional(AnyValue.fromJson, defaultSerializer); + badges.value = json['badges'] == null ? null : AnyValue.fromJson(json['badges']); + + + isRecommended = Optional.optional(nativeFromJson, nativeToJson); + isRecommended.value = json['isRecommended'] == null ? null : nativeFromJson(json['isRecommended']); + + + ownerId = Optional.optional(nativeFromJson, nativeToJson); + ownerId.value = json['ownerId'] == null ? null : nativeFromJson(json['ownerId']); + + + department = Optional.optional((data) => DepartmentType.values.byName(data), enumSerializer); + department.value = json['department'] == null ? null : DepartmentType.values.byName(json['department']); + + + hubId = Optional.optional(nativeFromJson, nativeToJson); + hubId.value = json['hubId'] == null ? null : nativeFromJson(json['hubId']); + + + manager = Optional.optional(nativeFromJson, nativeToJson); + manager.value = json['manager'] == null ? null : nativeFromJson(json['manager']); + + + english = Optional.optional((data) => EnglishProficiency.values.byName(data), enumSerializer); + english.value = json['english'] == null ? null : EnglishProficiency.values.byName(json['english']); + + + backgroundCheckStatus = Optional.optional((data) => BackgroundCheckStatus.values.byName(data), enumSerializer); + backgroundCheckStatus.value = json['backgroundCheckStatus'] == null ? null : BackgroundCheckStatus.values.byName(json['backgroundCheckStatus']); + + + employmentType = Optional.optional((data) => EmploymentType.values.byName(data), enumSerializer); + employmentType.value = json['employmentType'] == null ? null : EmploymentType.values.byName(json['employmentType']); + + + initial = Optional.optional(nativeFromJson, nativeToJson); + initial.value = json['initial'] == null ? null : nativeFromJson(json['initial']); + + + englishRequired = Optional.optional(nativeFromJson, nativeToJson); + englishRequired.value = json['englishRequired'] == null ? null : nativeFromJson(json['englishRequired']); + + + city = Optional.optional(nativeFromJson, nativeToJson); + city.value = json['city'] == null ? null : nativeFromJson(json['city']); + + + addres = Optional.optional(nativeFromJson, nativeToJson); + addres.value = json['addres'] == null ? null : nativeFromJson(json['addres']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffVariables otherTyped = other as CreateStaffVariables; + return userId == otherTyped.userId && + fullName == otherTyped.fullName && + level == otherTyped.level && + role == otherTyped.role && + phone == otherTyped.phone && + email == otherTyped.email && + photoUrl == otherTyped.photoUrl && + totalShifts == otherTyped.totalShifts && + averageRating == otherTyped.averageRating && + onTimeRate == otherTyped.onTimeRate && + noShowCount == otherTyped.noShowCount && + cancellationCount == otherTyped.cancellationCount && + reliabilityScore == otherTyped.reliabilityScore && + bio == otherTyped.bio && + industries == otherTyped.industries && + preferredLocations == otherTyped.preferredLocations && + maxDistanceMiles == otherTyped.maxDistanceMiles && + languages == otherTyped.languages && + itemsAttire == otherTyped.itemsAttire && + xp == otherTyped.xp && + badges == otherTyped.badges && + isRecommended == otherTyped.isRecommended && + ownerId == otherTyped.ownerId && + department == otherTyped.department && + hubId == otherTyped.hubId && + manager == otherTyped.manager && + english == otherTyped.english && + backgroundCheckStatus == otherTyped.backgroundCheckStatus && + employmentType == otherTyped.employmentType && + initial == otherTyped.initial && + englishRequired == otherTyped.englishRequired && + city == otherTyped.city && + addres == otherTyped.addres; + + } + @override + int get hashCode => Object.hashAll([userId.hashCode, fullName.hashCode, level.hashCode, role.hashCode, phone.hashCode, email.hashCode, photoUrl.hashCode, totalShifts.hashCode, averageRating.hashCode, onTimeRate.hashCode, noShowCount.hashCode, cancellationCount.hashCode, reliabilityScore.hashCode, bio.hashCode, industries.hashCode, preferredLocations.hashCode, maxDistanceMiles.hashCode, languages.hashCode, itemsAttire.hashCode, xp.hashCode, badges.hashCode, isRecommended.hashCode, ownerId.hashCode, department.hashCode, hubId.hashCode, manager.hashCode, english.hashCode, backgroundCheckStatus.hashCode, employmentType.hashCode, initial.hashCode, englishRequired.hashCode, city.hashCode, addres.hashCode]); + + + Map toJson() { + Map json = {}; + json['userId'] = nativeToJson(userId); + json['fullName'] = nativeToJson(fullName); + if(level.state == OptionalState.set) { + json['level'] = level.toJson(); + } + if(role.state == OptionalState.set) { + json['role'] = role.toJson(); + } + if(phone.state == OptionalState.set) { + json['phone'] = phone.toJson(); + } + if(email.state == OptionalState.set) { + json['email'] = email.toJson(); + } + if(photoUrl.state == OptionalState.set) { + json['photoUrl'] = photoUrl.toJson(); + } + if(totalShifts.state == OptionalState.set) { + json['totalShifts'] = totalShifts.toJson(); + } + if(averageRating.state == OptionalState.set) { + json['averageRating'] = averageRating.toJson(); + } + if(onTimeRate.state == OptionalState.set) { + json['onTimeRate'] = onTimeRate.toJson(); + } + if(noShowCount.state == OptionalState.set) { + json['noShowCount'] = noShowCount.toJson(); + } + if(cancellationCount.state == OptionalState.set) { + json['cancellationCount'] = cancellationCount.toJson(); + } + if(reliabilityScore.state == OptionalState.set) { + json['reliabilityScore'] = reliabilityScore.toJson(); + } + if(bio.state == OptionalState.set) { + json['bio'] = bio.toJson(); + } + if(industries.state == OptionalState.set) { + json['industries'] = industries.toJson(); + } + if(preferredLocations.state == OptionalState.set) { + json['preferredLocations'] = preferredLocations.toJson(); + } + if(maxDistanceMiles.state == OptionalState.set) { + json['maxDistanceMiles'] = maxDistanceMiles.toJson(); + } + if(languages.state == OptionalState.set) { + json['languages'] = languages.toJson(); + } + if(itemsAttire.state == OptionalState.set) { + json['itemsAttire'] = itemsAttire.toJson(); + } + if(xp.state == OptionalState.set) { + json['xp'] = xp.toJson(); + } + if(badges.state == OptionalState.set) { + json['badges'] = badges.toJson(); + } + if(isRecommended.state == OptionalState.set) { + json['isRecommended'] = isRecommended.toJson(); + } + if(ownerId.state == OptionalState.set) { + json['ownerId'] = ownerId.toJson(); + } + if(department.state == OptionalState.set) { + json['department'] = department.toJson(); + } + if(hubId.state == OptionalState.set) { + json['hubId'] = hubId.toJson(); + } + if(manager.state == OptionalState.set) { + json['manager'] = manager.toJson(); + } + if(english.state == OptionalState.set) { + json['english'] = english.toJson(); + } + if(backgroundCheckStatus.state == OptionalState.set) { + json['backgroundCheckStatus'] = backgroundCheckStatus.toJson(); + } + if(employmentType.state == OptionalState.set) { + json['employmentType'] = employmentType.toJson(); + } + if(initial.state == OptionalState.set) { + json['initial'] = initial.toJson(); + } + if(englishRequired.state == OptionalState.set) { + json['englishRequired'] = englishRequired.toJson(); + } + if(city.state == OptionalState.set) { + json['city'] = city.toJson(); + } + if(addres.state == OptionalState.set) { + json['addres'] = addres.toJson(); + } + return json; + } + + CreateStaffVariables({ + required this.userId, + required this.fullName, + required this.level, + required this.role, + required this.phone, + required this.email, + required this.photoUrl, + required this.totalShifts, + required this.averageRating, + required this.onTimeRate, + required this.noShowCount, + required this.cancellationCount, + required this.reliabilityScore, + required this.bio, + required this.industries, + required this.preferredLocations, + required this.maxDistanceMiles, + required this.languages, + required this.itemsAttire, + required this.xp, + required this.badges, + required this.isRecommended, + required this.ownerId, + required this.department, + required this.hubId, + required this.manager, + required this.english, + required this.backgroundCheckStatus, + required this.employmentType, + required this.initial, + required this.englishRequired, + required this.city, + required this.addres, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_availability.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_availability.dart new file mode 100644 index 00000000..54d2268e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_availability.dart @@ -0,0 +1,187 @@ +part of 'generated.dart'; + +class CreateStaffAvailabilityVariablesBuilder { + String staffId; + DayOfWeek day; + AvailabilitySlot slot; + Optional _status = Optional.optional((data) => AvailabilityStatus.values.byName(data), enumSerializer); + Optional _notes = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateStaffAvailabilityVariablesBuilder status(AvailabilityStatus? t) { + _status.value = t; + return this; + } + CreateStaffAvailabilityVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + + CreateStaffAvailabilityVariablesBuilder(this._dataConnect, {required this.staffId,required this.day,required this.slot,}); + Deserializer dataDeserializer = (dynamic json) => CreateStaffAvailabilityData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateStaffAvailabilityVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateStaffAvailabilityVariables vars= CreateStaffAvailabilityVariables(staffId: staffId,day: day,slot: slot,status: _status,notes: _notes,); + return _dataConnect.mutation("createStaffAvailability", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateStaffAvailabilityStaffAvailabilityInsert { + final String staffId; + final EnumValue day; + final EnumValue slot; + CreateStaffAvailabilityStaffAvailabilityInsert.fromJson(dynamic json): + + staffId = nativeFromJson(json['staffId']), + day = dayOfWeekDeserializer(json['day']), + slot = availabilitySlotDeserializer(json['slot']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffAvailabilityStaffAvailabilityInsert otherTyped = other as CreateStaffAvailabilityStaffAvailabilityInsert; + return staffId == otherTyped.staffId && + day == otherTyped.day && + slot == otherTyped.slot; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, day.hashCode, slot.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['day'] = + dayOfWeekSerializer(day) + ; + json['slot'] = + availabilitySlotSerializer(slot) + ; + return json; + } + + CreateStaffAvailabilityStaffAvailabilityInsert({ + required this.staffId, + required this.day, + required this.slot, + }); +} + +@immutable +class CreateStaffAvailabilityData { + final CreateStaffAvailabilityStaffAvailabilityInsert staffAvailability_insert; + CreateStaffAvailabilityData.fromJson(dynamic json): + + staffAvailability_insert = CreateStaffAvailabilityStaffAvailabilityInsert.fromJson(json['staffAvailability_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffAvailabilityData otherTyped = other as CreateStaffAvailabilityData; + return staffAvailability_insert == otherTyped.staffAvailability_insert; + + } + @override + int get hashCode => staffAvailability_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['staffAvailability_insert'] = staffAvailability_insert.toJson(); + return json; + } + + CreateStaffAvailabilityData({ + required this.staffAvailability_insert, + }); +} + +@immutable +class CreateStaffAvailabilityVariables { + final String staffId; + final DayOfWeek day; + final AvailabilitySlot slot; + late final Optionalstatus; + late final Optionalnotes; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateStaffAvailabilityVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + day = DayOfWeek.values.byName(json['day']), + slot = AvailabilitySlot.values.byName(json['slot']) { + + + + + + status = Optional.optional((data) => AvailabilityStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : AvailabilityStatus.values.byName(json['status']); + + + notes = Optional.optional(nativeFromJson, nativeToJson); + notes.value = json['notes'] == null ? null : nativeFromJson(json['notes']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffAvailabilityVariables otherTyped = other as CreateStaffAvailabilityVariables; + return staffId == otherTyped.staffId && + day == otherTyped.day && + slot == otherTyped.slot && + status == otherTyped.status && + notes == otherTyped.notes; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, day.hashCode, slot.hashCode, status.hashCode, notes.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['day'] = + day.name + ; + json['slot'] = + slot.name + ; + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(notes.state == OptionalState.set) { + json['notes'] = notes.toJson(); + } + return json; + } + + CreateStaffAvailabilityVariables({ + required this.staffId, + required this.day, + required this.slot, + required this.status, + required this.notes, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_availability_stats.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_availability_stats.dart new file mode 100644 index 00000000..2b267e0f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_availability_stats.dart @@ -0,0 +1,230 @@ +part of 'generated.dart'; + +class CreateStaffAvailabilityStatsVariablesBuilder { + String staffId; + Optional _needWorkIndex = Optional.optional(nativeFromJson, nativeToJson); + Optional _utilizationPercentage = Optional.optional(nativeFromJson, nativeToJson); + Optional _predictedAvailabilityScore = Optional.optional(nativeFromJson, nativeToJson); + Optional _scheduledHoursThisPeriod = Optional.optional(nativeFromJson, nativeToJson); + Optional _desiredHoursThisPeriod = Optional.optional(nativeFromJson, nativeToJson); + Optional _lastShiftDate = Optional.optional((json) => json['lastShiftDate'] = Timestamp.fromJson(json['lastShiftDate']), defaultSerializer); + Optional _acceptanceRate = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateStaffAvailabilityStatsVariablesBuilder needWorkIndex(int? t) { + _needWorkIndex.value = t; + return this; + } + CreateStaffAvailabilityStatsVariablesBuilder utilizationPercentage(int? t) { + _utilizationPercentage.value = t; + return this; + } + CreateStaffAvailabilityStatsVariablesBuilder predictedAvailabilityScore(int? t) { + _predictedAvailabilityScore.value = t; + return this; + } + CreateStaffAvailabilityStatsVariablesBuilder scheduledHoursThisPeriod(int? t) { + _scheduledHoursThisPeriod.value = t; + return this; + } + CreateStaffAvailabilityStatsVariablesBuilder desiredHoursThisPeriod(int? t) { + _desiredHoursThisPeriod.value = t; + return this; + } + CreateStaffAvailabilityStatsVariablesBuilder lastShiftDate(Timestamp? t) { + _lastShiftDate.value = t; + return this; + } + CreateStaffAvailabilityStatsVariablesBuilder acceptanceRate(int? t) { + _acceptanceRate.value = t; + return this; + } + + CreateStaffAvailabilityStatsVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => CreateStaffAvailabilityStatsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateStaffAvailabilityStatsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateStaffAvailabilityStatsVariables vars= CreateStaffAvailabilityStatsVariables(staffId: staffId,needWorkIndex: _needWorkIndex,utilizationPercentage: _utilizationPercentage,predictedAvailabilityScore: _predictedAvailabilityScore,scheduledHoursThisPeriod: _scheduledHoursThisPeriod,desiredHoursThisPeriod: _desiredHoursThisPeriod,lastShiftDate: _lastShiftDate,acceptanceRate: _acceptanceRate,); + return _dataConnect.mutation("createStaffAvailabilityStats", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateStaffAvailabilityStatsStaffAvailabilityStatsInsert { + final String staffId; + CreateStaffAvailabilityStatsStaffAvailabilityStatsInsert.fromJson(dynamic json): + + staffId = nativeFromJson(json['staffId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffAvailabilityStatsStaffAvailabilityStatsInsert otherTyped = other as CreateStaffAvailabilityStatsStaffAvailabilityStatsInsert; + return staffId == otherTyped.staffId; + + } + @override + int get hashCode => staffId.hashCode; + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + return json; + } + + CreateStaffAvailabilityStatsStaffAvailabilityStatsInsert({ + required this.staffId, + }); +} + +@immutable +class CreateStaffAvailabilityStatsData { + final CreateStaffAvailabilityStatsStaffAvailabilityStatsInsert staffAvailabilityStats_insert; + CreateStaffAvailabilityStatsData.fromJson(dynamic json): + + staffAvailabilityStats_insert = CreateStaffAvailabilityStatsStaffAvailabilityStatsInsert.fromJson(json['staffAvailabilityStats_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffAvailabilityStatsData otherTyped = other as CreateStaffAvailabilityStatsData; + return staffAvailabilityStats_insert == otherTyped.staffAvailabilityStats_insert; + + } + @override + int get hashCode => staffAvailabilityStats_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['staffAvailabilityStats_insert'] = staffAvailabilityStats_insert.toJson(); + return json; + } + + CreateStaffAvailabilityStatsData({ + required this.staffAvailabilityStats_insert, + }); +} + +@immutable +class CreateStaffAvailabilityStatsVariables { + final String staffId; + late final OptionalneedWorkIndex; + late final OptionalutilizationPercentage; + late final OptionalpredictedAvailabilityScore; + late final OptionalscheduledHoursThisPeriod; + late final OptionaldesiredHoursThisPeriod; + late final OptionallastShiftDate; + late final OptionalacceptanceRate; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateStaffAvailabilityStatsVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']) { + + + + needWorkIndex = Optional.optional(nativeFromJson, nativeToJson); + needWorkIndex.value = json['needWorkIndex'] == null ? null : nativeFromJson(json['needWorkIndex']); + + + utilizationPercentage = Optional.optional(nativeFromJson, nativeToJson); + utilizationPercentage.value = json['utilizationPercentage'] == null ? null : nativeFromJson(json['utilizationPercentage']); + + + predictedAvailabilityScore = Optional.optional(nativeFromJson, nativeToJson); + predictedAvailabilityScore.value = json['predictedAvailabilityScore'] == null ? null : nativeFromJson(json['predictedAvailabilityScore']); + + + scheduledHoursThisPeriod = Optional.optional(nativeFromJson, nativeToJson); + scheduledHoursThisPeriod.value = json['scheduledHoursThisPeriod'] == null ? null : nativeFromJson(json['scheduledHoursThisPeriod']); + + + desiredHoursThisPeriod = Optional.optional(nativeFromJson, nativeToJson); + desiredHoursThisPeriod.value = json['desiredHoursThisPeriod'] == null ? null : nativeFromJson(json['desiredHoursThisPeriod']); + + + lastShiftDate = Optional.optional((json) => json['lastShiftDate'] = Timestamp.fromJson(json['lastShiftDate']), defaultSerializer); + lastShiftDate.value = json['lastShiftDate'] == null ? null : Timestamp.fromJson(json['lastShiftDate']); + + + acceptanceRate = Optional.optional(nativeFromJson, nativeToJson); + acceptanceRate.value = json['acceptanceRate'] == null ? null : nativeFromJson(json['acceptanceRate']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffAvailabilityStatsVariables otherTyped = other as CreateStaffAvailabilityStatsVariables; + return staffId == otherTyped.staffId && + needWorkIndex == otherTyped.needWorkIndex && + utilizationPercentage == otherTyped.utilizationPercentage && + predictedAvailabilityScore == otherTyped.predictedAvailabilityScore && + scheduledHoursThisPeriod == otherTyped.scheduledHoursThisPeriod && + desiredHoursThisPeriod == otherTyped.desiredHoursThisPeriod && + lastShiftDate == otherTyped.lastShiftDate && + acceptanceRate == otherTyped.acceptanceRate; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, needWorkIndex.hashCode, utilizationPercentage.hashCode, predictedAvailabilityScore.hashCode, scheduledHoursThisPeriod.hashCode, desiredHoursThisPeriod.hashCode, lastShiftDate.hashCode, acceptanceRate.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + if(needWorkIndex.state == OptionalState.set) { + json['needWorkIndex'] = needWorkIndex.toJson(); + } + if(utilizationPercentage.state == OptionalState.set) { + json['utilizationPercentage'] = utilizationPercentage.toJson(); + } + if(predictedAvailabilityScore.state == OptionalState.set) { + json['predictedAvailabilityScore'] = predictedAvailabilityScore.toJson(); + } + if(scheduledHoursThisPeriod.state == OptionalState.set) { + json['scheduledHoursThisPeriod'] = scheduledHoursThisPeriod.toJson(); + } + if(desiredHoursThisPeriod.state == OptionalState.set) { + json['desiredHoursThisPeriod'] = desiredHoursThisPeriod.toJson(); + } + if(lastShiftDate.state == OptionalState.set) { + json['lastShiftDate'] = lastShiftDate.toJson(); + } + if(acceptanceRate.state == OptionalState.set) { + json['acceptanceRate'] = acceptanceRate.toJson(); + } + return json; + } + + CreateStaffAvailabilityStatsVariables({ + required this.staffId, + required this.needWorkIndex, + required this.utilizationPercentage, + required this.predictedAvailabilityScore, + required this.scheduledHoursThisPeriod, + required this.desiredHoursThisPeriod, + required this.lastShiftDate, + required this.acceptanceRate, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_course.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_course.dart new file mode 100644 index 00000000..5228f652 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_course.dart @@ -0,0 +1,207 @@ +part of 'generated.dart'; + +class CreateStaffCourseVariablesBuilder { + String staffId; + String courseId; + Optional _progressPercent = Optional.optional(nativeFromJson, nativeToJson); + Optional _completed = Optional.optional(nativeFromJson, nativeToJson); + Optional _completedAt = Optional.optional((json) => json['completedAt'] = Timestamp.fromJson(json['completedAt']), defaultSerializer); + Optional _startedAt = Optional.optional((json) => json['startedAt'] = Timestamp.fromJson(json['startedAt']), defaultSerializer); + Optional _lastAccessedAt = Optional.optional((json) => json['lastAccessedAt'] = Timestamp.fromJson(json['lastAccessedAt']), defaultSerializer); + + final FirebaseDataConnect _dataConnect; CreateStaffCourseVariablesBuilder progressPercent(int? t) { + _progressPercent.value = t; + return this; + } + CreateStaffCourseVariablesBuilder completed(bool? t) { + _completed.value = t; + return this; + } + CreateStaffCourseVariablesBuilder completedAt(Timestamp? t) { + _completedAt.value = t; + return this; + } + CreateStaffCourseVariablesBuilder startedAt(Timestamp? t) { + _startedAt.value = t; + return this; + } + CreateStaffCourseVariablesBuilder lastAccessedAt(Timestamp? t) { + _lastAccessedAt.value = t; + return this; + } + + CreateStaffCourseVariablesBuilder(this._dataConnect, {required this.staffId,required this.courseId,}); + Deserializer dataDeserializer = (dynamic json) => CreateStaffCourseData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateStaffCourseVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateStaffCourseVariables vars= CreateStaffCourseVariables(staffId: staffId,courseId: courseId,progressPercent: _progressPercent,completed: _completed,completedAt: _completedAt,startedAt: _startedAt,lastAccessedAt: _lastAccessedAt,); + return _dataConnect.mutation("createStaffCourse", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateStaffCourseStaffCourseInsert { + final String id; + CreateStaffCourseStaffCourseInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffCourseStaffCourseInsert otherTyped = other as CreateStaffCourseStaffCourseInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateStaffCourseStaffCourseInsert({ + required this.id, + }); +} + +@immutable +class CreateStaffCourseData { + final CreateStaffCourseStaffCourseInsert staffCourse_insert; + CreateStaffCourseData.fromJson(dynamic json): + + staffCourse_insert = CreateStaffCourseStaffCourseInsert.fromJson(json['staffCourse_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffCourseData otherTyped = other as CreateStaffCourseData; + return staffCourse_insert == otherTyped.staffCourse_insert; + + } + @override + int get hashCode => staffCourse_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['staffCourse_insert'] = staffCourse_insert.toJson(); + return json; + } + + CreateStaffCourseData({ + required this.staffCourse_insert, + }); +} + +@immutable +class CreateStaffCourseVariables { + final String staffId; + final String courseId; + late final OptionalprogressPercent; + late final Optionalcompleted; + late final OptionalcompletedAt; + late final OptionalstartedAt; + late final OptionallastAccessedAt; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateStaffCourseVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + courseId = nativeFromJson(json['courseId']) { + + + + + progressPercent = Optional.optional(nativeFromJson, nativeToJson); + progressPercent.value = json['progressPercent'] == null ? null : nativeFromJson(json['progressPercent']); + + + completed = Optional.optional(nativeFromJson, nativeToJson); + completed.value = json['completed'] == null ? null : nativeFromJson(json['completed']); + + + completedAt = Optional.optional((json) => json['completedAt'] = Timestamp.fromJson(json['completedAt']), defaultSerializer); + completedAt.value = json['completedAt'] == null ? null : Timestamp.fromJson(json['completedAt']); + + + startedAt = Optional.optional((json) => json['startedAt'] = Timestamp.fromJson(json['startedAt']), defaultSerializer); + startedAt.value = json['startedAt'] == null ? null : Timestamp.fromJson(json['startedAt']); + + + lastAccessedAt = Optional.optional((json) => json['lastAccessedAt'] = Timestamp.fromJson(json['lastAccessedAt']), defaultSerializer); + lastAccessedAt.value = json['lastAccessedAt'] == null ? null : Timestamp.fromJson(json['lastAccessedAt']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffCourseVariables otherTyped = other as CreateStaffCourseVariables; + return staffId == otherTyped.staffId && + courseId == otherTyped.courseId && + progressPercent == otherTyped.progressPercent && + completed == otherTyped.completed && + completedAt == otherTyped.completedAt && + startedAt == otherTyped.startedAt && + lastAccessedAt == otherTyped.lastAccessedAt; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, courseId.hashCode, progressPercent.hashCode, completed.hashCode, completedAt.hashCode, startedAt.hashCode, lastAccessedAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['courseId'] = nativeToJson(courseId); + if(progressPercent.state == OptionalState.set) { + json['progressPercent'] = progressPercent.toJson(); + } + if(completed.state == OptionalState.set) { + json['completed'] = completed.toJson(); + } + if(completedAt.state == OptionalState.set) { + json['completedAt'] = completedAt.toJson(); + } + if(startedAt.state == OptionalState.set) { + json['startedAt'] = startedAt.toJson(); + } + if(lastAccessedAt.state == OptionalState.set) { + json['lastAccessedAt'] = lastAccessedAt.toJson(); + } + return json; + } + + CreateStaffCourseVariables({ + required this.staffId, + required this.courseId, + required this.progressPercent, + required this.completed, + required this.completedAt, + required this.startedAt, + required this.lastAccessedAt, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_document.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_document.dart new file mode 100644 index 00000000..58af2e49 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_document.dart @@ -0,0 +1,183 @@ +part of 'generated.dart'; + +class CreateStaffDocumentVariablesBuilder { + String staffId; + String staffName; + String documentId; + DocumentStatus status; + Optional _documentUrl = Optional.optional(nativeFromJson, nativeToJson); + Optional _expiryDate = Optional.optional((json) => json['expiryDate'] = Timestamp.fromJson(json['expiryDate']), defaultSerializer); + + final FirebaseDataConnect _dataConnect; CreateStaffDocumentVariablesBuilder documentUrl(String? t) { + _documentUrl.value = t; + return this; + } + CreateStaffDocumentVariablesBuilder expiryDate(Timestamp? t) { + _expiryDate.value = t; + return this; + } + + CreateStaffDocumentVariablesBuilder(this._dataConnect, {required this.staffId,required this.staffName,required this.documentId,required this.status,}); + Deserializer dataDeserializer = (dynamic json) => CreateStaffDocumentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateStaffDocumentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateStaffDocumentVariables vars= CreateStaffDocumentVariables(staffId: staffId,staffName: staffName,documentId: documentId,status: status,documentUrl: _documentUrl,expiryDate: _expiryDate,); + return _dataConnect.mutation("createStaffDocument", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateStaffDocumentStaffDocumentInsert { + final String staffId; + final String documentId; + CreateStaffDocumentStaffDocumentInsert.fromJson(dynamic json): + + staffId = nativeFromJson(json['staffId']), + documentId = nativeFromJson(json['documentId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffDocumentStaffDocumentInsert otherTyped = other as CreateStaffDocumentStaffDocumentInsert; + return staffId == otherTyped.staffId && + documentId == otherTyped.documentId; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, documentId.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['documentId'] = nativeToJson(documentId); + return json; + } + + CreateStaffDocumentStaffDocumentInsert({ + required this.staffId, + required this.documentId, + }); +} + +@immutable +class CreateStaffDocumentData { + final CreateStaffDocumentStaffDocumentInsert staffDocument_insert; + CreateStaffDocumentData.fromJson(dynamic json): + + staffDocument_insert = CreateStaffDocumentStaffDocumentInsert.fromJson(json['staffDocument_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffDocumentData otherTyped = other as CreateStaffDocumentData; + return staffDocument_insert == otherTyped.staffDocument_insert; + + } + @override + int get hashCode => staffDocument_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['staffDocument_insert'] = staffDocument_insert.toJson(); + return json; + } + + CreateStaffDocumentData({ + required this.staffDocument_insert, + }); +} + +@immutable +class CreateStaffDocumentVariables { + final String staffId; + final String staffName; + final String documentId; + final DocumentStatus status; + late final OptionaldocumentUrl; + late final OptionalexpiryDate; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateStaffDocumentVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + staffName = nativeFromJson(json['staffName']), + documentId = nativeFromJson(json['documentId']), + status = DocumentStatus.values.byName(json['status']) { + + + + + + + documentUrl = Optional.optional(nativeFromJson, nativeToJson); + documentUrl.value = json['documentUrl'] == null ? null : nativeFromJson(json['documentUrl']); + + + expiryDate = Optional.optional((json) => json['expiryDate'] = Timestamp.fromJson(json['expiryDate']), defaultSerializer); + expiryDate.value = json['expiryDate'] == null ? null : Timestamp.fromJson(json['expiryDate']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffDocumentVariables otherTyped = other as CreateStaffDocumentVariables; + return staffId == otherTyped.staffId && + staffName == otherTyped.staffName && + documentId == otherTyped.documentId && + status == otherTyped.status && + documentUrl == otherTyped.documentUrl && + expiryDate == otherTyped.expiryDate; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, staffName.hashCode, documentId.hashCode, status.hashCode, documentUrl.hashCode, expiryDate.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['staffName'] = nativeToJson(staffName); + json['documentId'] = nativeToJson(documentId); + json['status'] = + status.name + ; + if(documentUrl.state == OptionalState.set) { + json['documentUrl'] = documentUrl.toJson(); + } + if(expiryDate.state == OptionalState.set) { + json['expiryDate'] = expiryDate.toJson(); + } + return json; + } + + CreateStaffDocumentVariables({ + required this.staffId, + required this.staffName, + required this.documentId, + required this.status, + required this.documentUrl, + required this.expiryDate, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_role.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_role.dart new file mode 100644 index 00000000..321b96e0 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_staff_role.dart @@ -0,0 +1,152 @@ +part of 'generated.dart'; + +class CreateStaffRoleVariablesBuilder { + String staffId; + String roleId; + Optional _roleType = Optional.optional((data) => RoleType.values.byName(data), enumSerializer); + + final FirebaseDataConnect _dataConnect; CreateStaffRoleVariablesBuilder roleType(RoleType? t) { + _roleType.value = t; + return this; + } + + CreateStaffRoleVariablesBuilder(this._dataConnect, {required this.staffId,required this.roleId,}); + Deserializer dataDeserializer = (dynamic json) => CreateStaffRoleData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateStaffRoleVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateStaffRoleVariables vars= CreateStaffRoleVariables(staffId: staffId,roleId: roleId,roleType: _roleType,); + return _dataConnect.mutation("createStaffRole", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateStaffRoleStaffRoleInsert { + final String staffId; + final String roleId; + CreateStaffRoleStaffRoleInsert.fromJson(dynamic json): + + staffId = nativeFromJson(json['staffId']), + roleId = nativeFromJson(json['roleId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffRoleStaffRoleInsert otherTyped = other as CreateStaffRoleStaffRoleInsert; + return staffId == otherTyped.staffId && + roleId == otherTyped.roleId; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, roleId.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['roleId'] = nativeToJson(roleId); + return json; + } + + CreateStaffRoleStaffRoleInsert({ + required this.staffId, + required this.roleId, + }); +} + +@immutable +class CreateStaffRoleData { + final CreateStaffRoleStaffRoleInsert staffRole_insert; + CreateStaffRoleData.fromJson(dynamic json): + + staffRole_insert = CreateStaffRoleStaffRoleInsert.fromJson(json['staffRole_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffRoleData otherTyped = other as CreateStaffRoleData; + return staffRole_insert == otherTyped.staffRole_insert; + + } + @override + int get hashCode => staffRole_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['staffRole_insert'] = staffRole_insert.toJson(); + return json; + } + + CreateStaffRoleData({ + required this.staffRole_insert, + }); +} + +@immutable +class CreateStaffRoleVariables { + final String staffId; + final String roleId; + late final OptionalroleType; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateStaffRoleVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + roleId = nativeFromJson(json['roleId']) { + + + + + roleType = Optional.optional((data) => RoleType.values.byName(data), enumSerializer); + roleType.value = json['roleType'] == null ? null : RoleType.values.byName(json['roleType']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateStaffRoleVariables otherTyped = other as CreateStaffRoleVariables; + return staffId == otherTyped.staffId && + roleId == otherTyped.roleId && + roleType == otherTyped.roleType; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, roleId.hashCode, roleType.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['roleId'] = nativeToJson(roleId); + if(roleType.state == OptionalState.set) { + json['roleType'] = roleType.toJson(); + } + return json; + } + + CreateStaffRoleVariables({ + required this.staffId, + required this.roleId, + required this.roleType, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_task.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_task.dart new file mode 100644 index 00000000..74d80bc4 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_task.dart @@ -0,0 +1,255 @@ +part of 'generated.dart'; + +class CreateTaskVariablesBuilder { + String taskName; + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + TaskPriority priority; + TaskStatus status; + Optional _dueDate = Optional.optional((json) => json['dueDate'] = Timestamp.fromJson(json['dueDate']), defaultSerializer); + Optional _progress = Optional.optional(nativeFromJson, nativeToJson); + Optional _orderIndex = Optional.optional(nativeFromJson, nativeToJson); + Optional _commentCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _attachmentCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _files = Optional.optional(AnyValue.fromJson, defaultSerializer); + String ownerId; + + final FirebaseDataConnect _dataConnect; CreateTaskVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + CreateTaskVariablesBuilder dueDate(Timestamp? t) { + _dueDate.value = t; + return this; + } + CreateTaskVariablesBuilder progress(int? t) { + _progress.value = t; + return this; + } + CreateTaskVariablesBuilder orderIndex(int? t) { + _orderIndex.value = t; + return this; + } + CreateTaskVariablesBuilder commentCount(int? t) { + _commentCount.value = t; + return this; + } + CreateTaskVariablesBuilder attachmentCount(int? t) { + _attachmentCount.value = t; + return this; + } + CreateTaskVariablesBuilder files(AnyValue? t) { + _files.value = t; + return this; + } + + CreateTaskVariablesBuilder(this._dataConnect, {required this.taskName,required this.priority,required this.status,required this.ownerId,}); + Deserializer dataDeserializer = (dynamic json) => CreateTaskData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateTaskVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateTaskVariables vars= CreateTaskVariables(taskName: taskName,description: _description,priority: priority,status: status,dueDate: _dueDate,progress: _progress,orderIndex: _orderIndex,commentCount: _commentCount,attachmentCount: _attachmentCount,files: _files,ownerId: ownerId,); + return _dataConnect.mutation("createTask", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateTaskTaskInsert { + final String id; + CreateTaskTaskInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTaskTaskInsert otherTyped = other as CreateTaskTaskInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateTaskTaskInsert({ + required this.id, + }); +} + +@immutable +class CreateTaskData { + final CreateTaskTaskInsert task_insert; + CreateTaskData.fromJson(dynamic json): + + task_insert = CreateTaskTaskInsert.fromJson(json['task_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTaskData otherTyped = other as CreateTaskData; + return task_insert == otherTyped.task_insert; + + } + @override + int get hashCode => task_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['task_insert'] = task_insert.toJson(); + return json; + } + + CreateTaskData({ + required this.task_insert, + }); +} + +@immutable +class CreateTaskVariables { + final String taskName; + late final Optionaldescription; + final TaskPriority priority; + final TaskStatus status; + late final OptionaldueDate; + late final Optionalprogress; + late final OptionalorderIndex; + late final OptionalcommentCount; + late final OptionalattachmentCount; + late final Optionalfiles; + final String ownerId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateTaskVariables.fromJson(Map json): + + taskName = nativeFromJson(json['taskName']), + priority = TaskPriority.values.byName(json['priority']), + status = TaskStatus.values.byName(json['status']), + ownerId = nativeFromJson(json['ownerId']) { + + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + + + + dueDate = Optional.optional((json) => json['dueDate'] = Timestamp.fromJson(json['dueDate']), defaultSerializer); + dueDate.value = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']); + + + progress = Optional.optional(nativeFromJson, nativeToJson); + progress.value = json['progress'] == null ? null : nativeFromJson(json['progress']); + + + orderIndex = Optional.optional(nativeFromJson, nativeToJson); + orderIndex.value = json['orderIndex'] == null ? null : nativeFromJson(json['orderIndex']); + + + commentCount = Optional.optional(nativeFromJson, nativeToJson); + commentCount.value = json['commentCount'] == null ? null : nativeFromJson(json['commentCount']); + + + attachmentCount = Optional.optional(nativeFromJson, nativeToJson); + attachmentCount.value = json['attachmentCount'] == null ? null : nativeFromJson(json['attachmentCount']); + + + files = Optional.optional(AnyValue.fromJson, defaultSerializer); + files.value = json['files'] == null ? null : AnyValue.fromJson(json['files']); + + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTaskVariables otherTyped = other as CreateTaskVariables; + return taskName == otherTyped.taskName && + description == otherTyped.description && + priority == otherTyped.priority && + status == otherTyped.status && + dueDate == otherTyped.dueDate && + progress == otherTyped.progress && + orderIndex == otherTyped.orderIndex && + commentCount == otherTyped.commentCount && + attachmentCount == otherTyped.attachmentCount && + files == otherTyped.files && + ownerId == otherTyped.ownerId; + + } + @override + int get hashCode => Object.hashAll([taskName.hashCode, description.hashCode, priority.hashCode, status.hashCode, dueDate.hashCode, progress.hashCode, orderIndex.hashCode, commentCount.hashCode, attachmentCount.hashCode, files.hashCode, ownerId.hashCode]); + + + Map toJson() { + Map json = {}; + json['taskName'] = nativeToJson(taskName); + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + json['priority'] = + priority.name + ; + json['status'] = + status.name + ; + if(dueDate.state == OptionalState.set) { + json['dueDate'] = dueDate.toJson(); + } + if(progress.state == OptionalState.set) { + json['progress'] = progress.toJson(); + } + if(orderIndex.state == OptionalState.set) { + json['orderIndex'] = orderIndex.toJson(); + } + if(commentCount.state == OptionalState.set) { + json['commentCount'] = commentCount.toJson(); + } + if(attachmentCount.state == OptionalState.set) { + json['attachmentCount'] = attachmentCount.toJson(); + } + if(files.state == OptionalState.set) { + json['files'] = files.toJson(); + } + json['ownerId'] = nativeToJson(ownerId); + return json; + } + + CreateTaskVariables({ + required this.taskName, + required this.description, + required this.priority, + required this.status, + required this.dueDate, + required this.progress, + required this.orderIndex, + required this.commentCount, + required this.attachmentCount, + required this.files, + required this.ownerId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_task_comment.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_task_comment.dart new file mode 100644 index 00000000..e17ba79f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_task_comment.dart @@ -0,0 +1,154 @@ +part of 'generated.dart'; + +class CreateTaskCommentVariablesBuilder { + String taskId; + String teamMemberId; + String comment; + Optional _isSystem = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateTaskCommentVariablesBuilder isSystem(bool? t) { + _isSystem.value = t; + return this; + } + + CreateTaskCommentVariablesBuilder(this._dataConnect, {required this.taskId,required this.teamMemberId,required this.comment,}); + Deserializer dataDeserializer = (dynamic json) => CreateTaskCommentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateTaskCommentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateTaskCommentVariables vars= CreateTaskCommentVariables(taskId: taskId,teamMemberId: teamMemberId,comment: comment,isSystem: _isSystem,); + return _dataConnect.mutation("createTaskComment", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateTaskCommentTaskCommentInsert { + final String id; + CreateTaskCommentTaskCommentInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTaskCommentTaskCommentInsert otherTyped = other as CreateTaskCommentTaskCommentInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateTaskCommentTaskCommentInsert({ + required this.id, + }); +} + +@immutable +class CreateTaskCommentData { + final CreateTaskCommentTaskCommentInsert taskComment_insert; + CreateTaskCommentData.fromJson(dynamic json): + + taskComment_insert = CreateTaskCommentTaskCommentInsert.fromJson(json['taskComment_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTaskCommentData otherTyped = other as CreateTaskCommentData; + return taskComment_insert == otherTyped.taskComment_insert; + + } + @override + int get hashCode => taskComment_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['taskComment_insert'] = taskComment_insert.toJson(); + return json; + } + + CreateTaskCommentData({ + required this.taskComment_insert, + }); +} + +@immutable +class CreateTaskCommentVariables { + final String taskId; + final String teamMemberId; + final String comment; + late final OptionalisSystem; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateTaskCommentVariables.fromJson(Map json): + + taskId = nativeFromJson(json['taskId']), + teamMemberId = nativeFromJson(json['teamMemberId']), + comment = nativeFromJson(json['comment']) { + + + + + + isSystem = Optional.optional(nativeFromJson, nativeToJson); + isSystem.value = json['isSystem'] == null ? null : nativeFromJson(json['isSystem']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTaskCommentVariables otherTyped = other as CreateTaskCommentVariables; + return taskId == otherTyped.taskId && + teamMemberId == otherTyped.teamMemberId && + comment == otherTyped.comment && + isSystem == otherTyped.isSystem; + + } + @override + int get hashCode => Object.hashAll([taskId.hashCode, teamMemberId.hashCode, comment.hashCode, isSystem.hashCode]); + + + Map toJson() { + Map json = {}; + json['taskId'] = nativeToJson(taskId); + json['teamMemberId'] = nativeToJson(teamMemberId); + json['comment'] = nativeToJson(comment); + if(isSystem.state == OptionalState.set) { + json['isSystem'] = isSystem.toJson(); + } + return json; + } + + CreateTaskCommentVariables({ + required this.taskId, + required this.teamMemberId, + required this.comment, + required this.isSystem, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_tax_form.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_tax_form.dart new file mode 100644 index 00000000..62723cd5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_tax_form.dart @@ -0,0 +1,201 @@ +part of 'generated.dart'; + +class CreateTaxFormVariablesBuilder { + TaxFormType formType; + String title; + Optional _subtitle = Optional.optional(nativeFromJson, nativeToJson); + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + Optional _status = Optional.optional((data) => TaxFormStatus.values.byName(data), enumSerializer); + String staffId; + Optional _formData = Optional.optional(AnyValue.fromJson, defaultSerializer); + + final FirebaseDataConnect _dataConnect; CreateTaxFormVariablesBuilder subtitle(String? t) { + _subtitle.value = t; + return this; + } + CreateTaxFormVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + CreateTaxFormVariablesBuilder status(TaxFormStatus? t) { + _status.value = t; + return this; + } + CreateTaxFormVariablesBuilder formData(AnyValue? t) { + _formData.value = t; + return this; + } + + CreateTaxFormVariablesBuilder(this._dataConnect, {required this.formType,required this.title,required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => CreateTaxFormData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateTaxFormVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateTaxFormVariables vars= CreateTaxFormVariables(formType: formType,title: title,subtitle: _subtitle,description: _description,status: _status,staffId: staffId,formData: _formData,); + return _dataConnect.mutation("createTaxForm", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateTaxFormTaxFormInsert { + final String id; + CreateTaxFormTaxFormInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTaxFormTaxFormInsert otherTyped = other as CreateTaxFormTaxFormInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateTaxFormTaxFormInsert({ + required this.id, + }); +} + +@immutable +class CreateTaxFormData { + final CreateTaxFormTaxFormInsert taxForm_insert; + CreateTaxFormData.fromJson(dynamic json): + + taxForm_insert = CreateTaxFormTaxFormInsert.fromJson(json['taxForm_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTaxFormData otherTyped = other as CreateTaxFormData; + return taxForm_insert == otherTyped.taxForm_insert; + + } + @override + int get hashCode => taxForm_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['taxForm_insert'] = taxForm_insert.toJson(); + return json; + } + + CreateTaxFormData({ + required this.taxForm_insert, + }); +} + +@immutable +class CreateTaxFormVariables { + final TaxFormType formType; + final String title; + late final Optionalsubtitle; + late final Optionaldescription; + late final Optionalstatus; + final String staffId; + late final OptionalformData; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateTaxFormVariables.fromJson(Map json): + + formType = TaxFormType.values.byName(json['formType']), + title = nativeFromJson(json['title']), + staffId = nativeFromJson(json['staffId']) { + + + + + subtitle = Optional.optional(nativeFromJson, nativeToJson); + subtitle.value = json['subtitle'] == null ? null : nativeFromJson(json['subtitle']); + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + + status = Optional.optional((data) => TaxFormStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : TaxFormStatus.values.byName(json['status']); + + + + formData = Optional.optional(AnyValue.fromJson, defaultSerializer); + formData.value = json['formData'] == null ? null : AnyValue.fromJson(json['formData']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTaxFormVariables otherTyped = other as CreateTaxFormVariables; + return formType == otherTyped.formType && + title == otherTyped.title && + subtitle == otherTyped.subtitle && + description == otherTyped.description && + status == otherTyped.status && + staffId == otherTyped.staffId && + formData == otherTyped.formData; + + } + @override + int get hashCode => Object.hashAll([formType.hashCode, title.hashCode, subtitle.hashCode, description.hashCode, status.hashCode, staffId.hashCode, formData.hashCode]); + + + Map toJson() { + Map json = {}; + json['formType'] = + formType.name + ; + json['title'] = nativeToJson(title); + if(subtitle.state == OptionalState.set) { + json['subtitle'] = subtitle.toJson(); + } + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + json['staffId'] = nativeToJson(staffId); + if(formData.state == OptionalState.set) { + json['formData'] = formData.toJson(); + } + return json; + } + + CreateTaxFormVariables({ + required this.formType, + required this.title, + required this.subtitle, + required this.description, + required this.status, + required this.staffId, + required this.formData, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_team.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_team.dart new file mode 100644 index 00000000..f179e58d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_team.dart @@ -0,0 +1,296 @@ +part of 'generated.dart'; + +class CreateTeamVariablesBuilder { + String teamName; + String ownerId; + String ownerName; + String ownerRole; + Optional _email = Optional.optional(nativeFromJson, nativeToJson); + Optional _companyLogo = Optional.optional(nativeFromJson, nativeToJson); + Optional _totalMembers = Optional.optional(nativeFromJson, nativeToJson); + Optional _activeMembers = Optional.optional(nativeFromJson, nativeToJson); + Optional _totalHubs = Optional.optional(nativeFromJson, nativeToJson); + Optional _departments = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _favoriteStaffCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _blockedStaffCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _favoriteStaff = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _blockedStaff = Optional.optional(AnyValue.fromJson, defaultSerializer); + + final FirebaseDataConnect _dataConnect; CreateTeamVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + CreateTeamVariablesBuilder companyLogo(String? t) { + _companyLogo.value = t; + return this; + } + CreateTeamVariablesBuilder totalMembers(int? t) { + _totalMembers.value = t; + return this; + } + CreateTeamVariablesBuilder activeMembers(int? t) { + _activeMembers.value = t; + return this; + } + CreateTeamVariablesBuilder totalHubs(int? t) { + _totalHubs.value = t; + return this; + } + CreateTeamVariablesBuilder departments(AnyValue? t) { + _departments.value = t; + return this; + } + CreateTeamVariablesBuilder favoriteStaffCount(int? t) { + _favoriteStaffCount.value = t; + return this; + } + CreateTeamVariablesBuilder blockedStaffCount(int? t) { + _blockedStaffCount.value = t; + return this; + } + CreateTeamVariablesBuilder favoriteStaff(AnyValue? t) { + _favoriteStaff.value = t; + return this; + } + CreateTeamVariablesBuilder blockedStaff(AnyValue? t) { + _blockedStaff.value = t; + return this; + } + + CreateTeamVariablesBuilder(this._dataConnect, {required this.teamName,required this.ownerId,required this.ownerName,required this.ownerRole,}); + Deserializer dataDeserializer = (dynamic json) => CreateTeamData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateTeamVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateTeamVariables vars= CreateTeamVariables(teamName: teamName,ownerId: ownerId,ownerName: ownerName,ownerRole: ownerRole,email: _email,companyLogo: _companyLogo,totalMembers: _totalMembers,activeMembers: _activeMembers,totalHubs: _totalHubs,departments: _departments,favoriteStaffCount: _favoriteStaffCount,blockedStaffCount: _blockedStaffCount,favoriteStaff: _favoriteStaff,blockedStaff: _blockedStaff,); + return _dataConnect.mutation("createTeam", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateTeamTeamInsert { + final String id; + CreateTeamTeamInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTeamTeamInsert otherTyped = other as CreateTeamTeamInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateTeamTeamInsert({ + required this.id, + }); +} + +@immutable +class CreateTeamData { + final CreateTeamTeamInsert team_insert; + CreateTeamData.fromJson(dynamic json): + + team_insert = CreateTeamTeamInsert.fromJson(json['team_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTeamData otherTyped = other as CreateTeamData; + return team_insert == otherTyped.team_insert; + + } + @override + int get hashCode => team_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['team_insert'] = team_insert.toJson(); + return json; + } + + CreateTeamData({ + required this.team_insert, + }); +} + +@immutable +class CreateTeamVariables { + final String teamName; + final String ownerId; + final String ownerName; + final String ownerRole; + late final Optionalemail; + late final OptionalcompanyLogo; + late final OptionaltotalMembers; + late final OptionalactiveMembers; + late final OptionaltotalHubs; + late final Optionaldepartments; + late final OptionalfavoriteStaffCount; + late final OptionalblockedStaffCount; + late final OptionalfavoriteStaff; + late final OptionalblockedStaff; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateTeamVariables.fromJson(Map json): + + teamName = nativeFromJson(json['teamName']), + ownerId = nativeFromJson(json['ownerId']), + ownerName = nativeFromJson(json['ownerName']), + ownerRole = nativeFromJson(json['ownerRole']) { + + + + + + + email = Optional.optional(nativeFromJson, nativeToJson); + email.value = json['email'] == null ? null : nativeFromJson(json['email']); + + + companyLogo = Optional.optional(nativeFromJson, nativeToJson); + companyLogo.value = json['companyLogo'] == null ? null : nativeFromJson(json['companyLogo']); + + + totalMembers = Optional.optional(nativeFromJson, nativeToJson); + totalMembers.value = json['totalMembers'] == null ? null : nativeFromJson(json['totalMembers']); + + + activeMembers = Optional.optional(nativeFromJson, nativeToJson); + activeMembers.value = json['activeMembers'] == null ? null : nativeFromJson(json['activeMembers']); + + + totalHubs = Optional.optional(nativeFromJson, nativeToJson); + totalHubs.value = json['totalHubs'] == null ? null : nativeFromJson(json['totalHubs']); + + + departments = Optional.optional(AnyValue.fromJson, defaultSerializer); + departments.value = json['departments'] == null ? null : AnyValue.fromJson(json['departments']); + + + favoriteStaffCount = Optional.optional(nativeFromJson, nativeToJson); + favoriteStaffCount.value = json['favoriteStaffCount'] == null ? null : nativeFromJson(json['favoriteStaffCount']); + + + blockedStaffCount = Optional.optional(nativeFromJson, nativeToJson); + blockedStaffCount.value = json['blockedStaffCount'] == null ? null : nativeFromJson(json['blockedStaffCount']); + + + favoriteStaff = Optional.optional(AnyValue.fromJson, defaultSerializer); + favoriteStaff.value = json['favoriteStaff'] == null ? null : AnyValue.fromJson(json['favoriteStaff']); + + + blockedStaff = Optional.optional(AnyValue.fromJson, defaultSerializer); + blockedStaff.value = json['blockedStaff'] == null ? null : AnyValue.fromJson(json['blockedStaff']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTeamVariables otherTyped = other as CreateTeamVariables; + return teamName == otherTyped.teamName && + ownerId == otherTyped.ownerId && + ownerName == otherTyped.ownerName && + ownerRole == otherTyped.ownerRole && + email == otherTyped.email && + companyLogo == otherTyped.companyLogo && + totalMembers == otherTyped.totalMembers && + activeMembers == otherTyped.activeMembers && + totalHubs == otherTyped.totalHubs && + departments == otherTyped.departments && + favoriteStaffCount == otherTyped.favoriteStaffCount && + blockedStaffCount == otherTyped.blockedStaffCount && + favoriteStaff == otherTyped.favoriteStaff && + blockedStaff == otherTyped.blockedStaff; + + } + @override + int get hashCode => Object.hashAll([teamName.hashCode, ownerId.hashCode, ownerName.hashCode, ownerRole.hashCode, email.hashCode, companyLogo.hashCode, totalMembers.hashCode, activeMembers.hashCode, totalHubs.hashCode, departments.hashCode, favoriteStaffCount.hashCode, blockedStaffCount.hashCode, favoriteStaff.hashCode, blockedStaff.hashCode]); + + + Map toJson() { + Map json = {}; + json['teamName'] = nativeToJson(teamName); + json['ownerId'] = nativeToJson(ownerId); + json['ownerName'] = nativeToJson(ownerName); + json['ownerRole'] = nativeToJson(ownerRole); + if(email.state == OptionalState.set) { + json['email'] = email.toJson(); + } + if(companyLogo.state == OptionalState.set) { + json['companyLogo'] = companyLogo.toJson(); + } + if(totalMembers.state == OptionalState.set) { + json['totalMembers'] = totalMembers.toJson(); + } + if(activeMembers.state == OptionalState.set) { + json['activeMembers'] = activeMembers.toJson(); + } + if(totalHubs.state == OptionalState.set) { + json['totalHubs'] = totalHubs.toJson(); + } + if(departments.state == OptionalState.set) { + json['departments'] = departments.toJson(); + } + if(favoriteStaffCount.state == OptionalState.set) { + json['favoriteStaffCount'] = favoriteStaffCount.toJson(); + } + if(blockedStaffCount.state == OptionalState.set) { + json['blockedStaffCount'] = blockedStaffCount.toJson(); + } + if(favoriteStaff.state == OptionalState.set) { + json['favoriteStaff'] = favoriteStaff.toJson(); + } + if(blockedStaff.state == OptionalState.set) { + json['blockedStaff'] = blockedStaff.toJson(); + } + return json; + } + + CreateTeamVariables({ + required this.teamName, + required this.ownerId, + required this.ownerName, + required this.ownerRole, + required this.email, + required this.companyLogo, + required this.totalMembers, + required this.activeMembers, + required this.totalHubs, + required this.departments, + required this.favoriteStaffCount, + required this.blockedStaffCount, + required this.favoriteStaff, + required this.blockedStaff, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_team_hub.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_team_hub.dart new file mode 100644 index 00000000..c7d51d5b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_team_hub.dart @@ -0,0 +1,229 @@ +part of 'generated.dart'; + +class CreateTeamHubVariablesBuilder { + String teamId; + String hubName; + String address; + Optional _city = Optional.optional(nativeFromJson, nativeToJson); + Optional _state = Optional.optional(nativeFromJson, nativeToJson); + Optional _zipCode = Optional.optional(nativeFromJson, nativeToJson); + Optional _managerName = Optional.optional(nativeFromJson, nativeToJson); + Optional _isActive = Optional.optional(nativeFromJson, nativeToJson); + Optional _departments = Optional.optional(AnyValue.fromJson, defaultSerializer); + + final FirebaseDataConnect _dataConnect; CreateTeamHubVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + CreateTeamHubVariablesBuilder state(String? t) { + _state.value = t; + return this; + } + CreateTeamHubVariablesBuilder zipCode(String? t) { + _zipCode.value = t; + return this; + } + CreateTeamHubVariablesBuilder managerName(String? t) { + _managerName.value = t; + return this; + } + CreateTeamHubVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + CreateTeamHubVariablesBuilder departments(AnyValue? t) { + _departments.value = t; + return this; + } + + CreateTeamHubVariablesBuilder(this._dataConnect, {required this.teamId,required this.hubName,required this.address,}); + Deserializer dataDeserializer = (dynamic json) => CreateTeamHubData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateTeamHubVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateTeamHubVariables vars= CreateTeamHubVariables(teamId: teamId,hubName: hubName,address: address,city: _city,state: _state,zipCode: _zipCode,managerName: _managerName,isActive: _isActive,departments: _departments,); + return _dataConnect.mutation("createTeamHub", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateTeamHubTeamHubInsert { + final String id; + CreateTeamHubTeamHubInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTeamHubTeamHubInsert otherTyped = other as CreateTeamHubTeamHubInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateTeamHubTeamHubInsert({ + required this.id, + }); +} + +@immutable +class CreateTeamHubData { + final CreateTeamHubTeamHubInsert teamHub_insert; + CreateTeamHubData.fromJson(dynamic json): + + teamHub_insert = CreateTeamHubTeamHubInsert.fromJson(json['teamHub_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTeamHubData otherTyped = other as CreateTeamHubData; + return teamHub_insert == otherTyped.teamHub_insert; + + } + @override + int get hashCode => teamHub_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['teamHub_insert'] = teamHub_insert.toJson(); + return json; + } + + CreateTeamHubData({ + required this.teamHub_insert, + }); +} + +@immutable +class CreateTeamHubVariables { + final String teamId; + final String hubName; + final String address; + late final Optionalcity; + late final Optionalstate; + late final OptionalzipCode; + late final OptionalmanagerName; + late final OptionalisActive; + late final Optionaldepartments; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateTeamHubVariables.fromJson(Map json): + + teamId = nativeFromJson(json['teamId']), + hubName = nativeFromJson(json['hubName']), + address = nativeFromJson(json['address']) { + + + + + + city = Optional.optional(nativeFromJson, nativeToJson); + city.value = json['city'] == null ? null : nativeFromJson(json['city']); + + + state = Optional.optional(nativeFromJson, nativeToJson); + state.value = json['state'] == null ? null : nativeFromJson(json['state']); + + + zipCode = Optional.optional(nativeFromJson, nativeToJson); + zipCode.value = json['zipCode'] == null ? null : nativeFromJson(json['zipCode']); + + + managerName = Optional.optional(nativeFromJson, nativeToJson); + managerName.value = json['managerName'] == null ? null : nativeFromJson(json['managerName']); + + + isActive = Optional.optional(nativeFromJson, nativeToJson); + isActive.value = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + + + departments = Optional.optional(AnyValue.fromJson, defaultSerializer); + departments.value = json['departments'] == null ? null : AnyValue.fromJson(json['departments']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTeamHubVariables otherTyped = other as CreateTeamHubVariables; + return teamId == otherTyped.teamId && + hubName == otherTyped.hubName && + address == otherTyped.address && + city == otherTyped.city && + state == otherTyped.state && + zipCode == otherTyped.zipCode && + managerName == otherTyped.managerName && + isActive == otherTyped.isActive && + departments == otherTyped.departments; + + } + @override + int get hashCode => Object.hashAll([teamId.hashCode, hubName.hashCode, address.hashCode, city.hashCode, state.hashCode, zipCode.hashCode, managerName.hashCode, isActive.hashCode, departments.hashCode]); + + + Map toJson() { + Map json = {}; + json['teamId'] = nativeToJson(teamId); + json['hubName'] = nativeToJson(hubName); + json['address'] = nativeToJson(address); + if(city.state == OptionalState.set) { + json['city'] = city.toJson(); + } + if(state.state == OptionalState.set) { + json['state'] = state.toJson(); + } + if(zipCode.state == OptionalState.set) { + json['zipCode'] = zipCode.toJson(); + } + if(managerName.state == OptionalState.set) { + json['managerName'] = managerName.toJson(); + } + if(isActive.state == OptionalState.set) { + json['isActive'] = isActive.toJson(); + } + if(departments.state == OptionalState.set) { + json['departments'] = departments.toJson(); + } + return json; + } + + CreateTeamHubVariables({ + required this.teamId, + required this.hubName, + required this.address, + required this.city, + required this.state, + required this.zipCode, + required this.managerName, + required this.isActive, + required this.departments, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_team_hud_department.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_team_hud_department.dart new file mode 100644 index 00000000..b1cd4d32 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_team_hud_department.dart @@ -0,0 +1,147 @@ +part of 'generated.dart'; + +class CreateTeamHudDepartmentVariablesBuilder { + String name; + Optional _costCenter = Optional.optional(nativeFromJson, nativeToJson); + String teamHubId; + + final FirebaseDataConnect _dataConnect; CreateTeamHudDepartmentVariablesBuilder costCenter(String? t) { + _costCenter.value = t; + return this; + } + + CreateTeamHudDepartmentVariablesBuilder(this._dataConnect, {required this.name,required this.teamHubId,}); + Deserializer dataDeserializer = (dynamic json) => CreateTeamHudDepartmentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateTeamHudDepartmentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateTeamHudDepartmentVariables vars= CreateTeamHudDepartmentVariables(name: name,costCenter: _costCenter,teamHubId: teamHubId,); + return _dataConnect.mutation("createTeamHudDepartment", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateTeamHudDepartmentTeamHudDepartmentInsert { + final String id; + CreateTeamHudDepartmentTeamHudDepartmentInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTeamHudDepartmentTeamHudDepartmentInsert otherTyped = other as CreateTeamHudDepartmentTeamHudDepartmentInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateTeamHudDepartmentTeamHudDepartmentInsert({ + required this.id, + }); +} + +@immutable +class CreateTeamHudDepartmentData { + final CreateTeamHudDepartmentTeamHudDepartmentInsert teamHudDepartment_insert; + CreateTeamHudDepartmentData.fromJson(dynamic json): + + teamHudDepartment_insert = CreateTeamHudDepartmentTeamHudDepartmentInsert.fromJson(json['teamHudDepartment_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTeamHudDepartmentData otherTyped = other as CreateTeamHudDepartmentData; + return teamHudDepartment_insert == otherTyped.teamHudDepartment_insert; + + } + @override + int get hashCode => teamHudDepartment_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['teamHudDepartment_insert'] = teamHudDepartment_insert.toJson(); + return json; + } + + CreateTeamHudDepartmentData({ + required this.teamHudDepartment_insert, + }); +} + +@immutable +class CreateTeamHudDepartmentVariables { + final String name; + late final OptionalcostCenter; + final String teamHubId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateTeamHudDepartmentVariables.fromJson(Map json): + + name = nativeFromJson(json['name']), + teamHubId = nativeFromJson(json['teamHubId']) { + + + + costCenter = Optional.optional(nativeFromJson, nativeToJson); + costCenter.value = json['costCenter'] == null ? null : nativeFromJson(json['costCenter']); + + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTeamHudDepartmentVariables otherTyped = other as CreateTeamHudDepartmentVariables; + return name == otherTyped.name && + costCenter == otherTyped.costCenter && + teamHubId == otherTyped.teamHubId; + + } + @override + int get hashCode => Object.hashAll([name.hashCode, costCenter.hashCode, teamHubId.hashCode]); + + + Map toJson() { + Map json = {}; + json['name'] = nativeToJson(name); + if(costCenter.state == OptionalState.set) { + json['costCenter'] = costCenter.toJson(); + } + json['teamHubId'] = nativeToJson(teamHubId); + return json; + } + + CreateTeamHudDepartmentVariables({ + required this.name, + required this.costCenter, + required this.teamHubId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_team_member.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_team_member.dart new file mode 100644 index 00000000..273877e3 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_team_member.dart @@ -0,0 +1,216 @@ +part of 'generated.dart'; + +class CreateTeamMemberVariablesBuilder { + String teamId; + TeamMemberRole role; + Optional _title = Optional.optional(nativeFromJson, nativeToJson); + Optional _department = Optional.optional(nativeFromJson, nativeToJson); + Optional _teamHubId = Optional.optional(nativeFromJson, nativeToJson); + Optional _isActive = Optional.optional(nativeFromJson, nativeToJson); + String userId; + Optional _inviteStatus = Optional.optional((data) => TeamMemberInviteStatus.values.byName(data), enumSerializer); + + final FirebaseDataConnect _dataConnect; CreateTeamMemberVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + CreateTeamMemberVariablesBuilder department(String? t) { + _department.value = t; + return this; + } + CreateTeamMemberVariablesBuilder teamHubId(String? t) { + _teamHubId.value = t; + return this; + } + CreateTeamMemberVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + CreateTeamMemberVariablesBuilder inviteStatus(TeamMemberInviteStatus? t) { + _inviteStatus.value = t; + return this; + } + + CreateTeamMemberVariablesBuilder(this._dataConnect, {required this.teamId,required this.role,required this.userId,}); + Deserializer dataDeserializer = (dynamic json) => CreateTeamMemberData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateTeamMemberVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateTeamMemberVariables vars= CreateTeamMemberVariables(teamId: teamId,role: role,title: _title,department: _department,teamHubId: _teamHubId,isActive: _isActive,userId: userId,inviteStatus: _inviteStatus,); + return _dataConnect.mutation("createTeamMember", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateTeamMemberTeamMemberInsert { + final String id; + CreateTeamMemberTeamMemberInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTeamMemberTeamMemberInsert otherTyped = other as CreateTeamMemberTeamMemberInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateTeamMemberTeamMemberInsert({ + required this.id, + }); +} + +@immutable +class CreateTeamMemberData { + final CreateTeamMemberTeamMemberInsert teamMember_insert; + CreateTeamMemberData.fromJson(dynamic json): + + teamMember_insert = CreateTeamMemberTeamMemberInsert.fromJson(json['teamMember_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTeamMemberData otherTyped = other as CreateTeamMemberData; + return teamMember_insert == otherTyped.teamMember_insert; + + } + @override + int get hashCode => teamMember_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['teamMember_insert'] = teamMember_insert.toJson(); + return json; + } + + CreateTeamMemberData({ + required this.teamMember_insert, + }); +} + +@immutable +class CreateTeamMemberVariables { + final String teamId; + final TeamMemberRole role; + late final Optionaltitle; + late final Optionaldepartment; + late final OptionalteamHubId; + late final OptionalisActive; + final String userId; + late final OptionalinviteStatus; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateTeamMemberVariables.fromJson(Map json): + + teamId = nativeFromJson(json['teamId']), + role = TeamMemberRole.values.byName(json['role']), + userId = nativeFromJson(json['userId']) { + + + + + title = Optional.optional(nativeFromJson, nativeToJson); + title.value = json['title'] == null ? null : nativeFromJson(json['title']); + + + department = Optional.optional(nativeFromJson, nativeToJson); + department.value = json['department'] == null ? null : nativeFromJson(json['department']); + + + teamHubId = Optional.optional(nativeFromJson, nativeToJson); + teamHubId.value = json['teamHubId'] == null ? null : nativeFromJson(json['teamHubId']); + + + isActive = Optional.optional(nativeFromJson, nativeToJson); + isActive.value = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + + + + inviteStatus = Optional.optional((data) => TeamMemberInviteStatus.values.byName(data), enumSerializer); + inviteStatus.value = json['inviteStatus'] == null ? null : TeamMemberInviteStatus.values.byName(json['inviteStatus']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateTeamMemberVariables otherTyped = other as CreateTeamMemberVariables; + return teamId == otherTyped.teamId && + role == otherTyped.role && + title == otherTyped.title && + department == otherTyped.department && + teamHubId == otherTyped.teamHubId && + isActive == otherTyped.isActive && + userId == otherTyped.userId && + inviteStatus == otherTyped.inviteStatus; + + } + @override + int get hashCode => Object.hashAll([teamId.hashCode, role.hashCode, title.hashCode, department.hashCode, teamHubId.hashCode, isActive.hashCode, userId.hashCode, inviteStatus.hashCode]); + + + Map toJson() { + Map json = {}; + json['teamId'] = nativeToJson(teamId); + json['role'] = + role.name + ; + if(title.state == OptionalState.set) { + json['title'] = title.toJson(); + } + if(department.state == OptionalState.set) { + json['department'] = department.toJson(); + } + if(teamHubId.state == OptionalState.set) { + json['teamHubId'] = teamHubId.toJson(); + } + if(isActive.state == OptionalState.set) { + json['isActive'] = isActive.toJson(); + } + json['userId'] = nativeToJson(userId); + if(inviteStatus.state == OptionalState.set) { + json['inviteStatus'] = inviteStatus.toJson(); + } + return json; + } + + CreateTeamMemberVariables({ + required this.teamId, + required this.role, + required this.title, + required this.department, + required this.teamHubId, + required this.isActive, + required this.userId, + required this.inviteStatus, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_user.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_user.dart new file mode 100644 index 00000000..4bd0d2f5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_user.dart @@ -0,0 +1,194 @@ +part of 'generated.dart'; + +class CreateUserVariablesBuilder { + String id; + Optional _email = Optional.optional(nativeFromJson, nativeToJson); + Optional _fullName = Optional.optional(nativeFromJson, nativeToJson); + UserBaseRole role; + Optional _userRole = Optional.optional(nativeFromJson, nativeToJson); + Optional _photoUrl = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateUserVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + CreateUserVariablesBuilder fullName(String? t) { + _fullName.value = t; + return this; + } + CreateUserVariablesBuilder userRole(String? t) { + _userRole.value = t; + return this; + } + CreateUserVariablesBuilder photoUrl(String? t) { + _photoUrl.value = t; + return this; + } + + CreateUserVariablesBuilder(this._dataConnect, {required this.id,required this.role,}); + Deserializer dataDeserializer = (dynamic json) => CreateUserData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateUserVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateUserVariables vars= CreateUserVariables(id: id,email: _email,fullName: _fullName,role: role,userRole: _userRole,photoUrl: _photoUrl,); + return _dataConnect.mutation("CreateUser", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateUserUserInsert { + final String id; + CreateUserUserInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateUserUserInsert otherTyped = other as CreateUserUserInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateUserUserInsert({ + required this.id, + }); +} + +@immutable +class CreateUserData { + final CreateUserUserInsert user_insert; + CreateUserData.fromJson(dynamic json): + + user_insert = CreateUserUserInsert.fromJson(json['user_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateUserData otherTyped = other as CreateUserData; + return user_insert == otherTyped.user_insert; + + } + @override + int get hashCode => user_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['user_insert'] = user_insert.toJson(); + return json; + } + + CreateUserData({ + required this.user_insert, + }); +} + +@immutable +class CreateUserVariables { + final String id; + late final Optionalemail; + late final OptionalfullName; + final UserBaseRole role; + late final OptionaluserRole; + late final OptionalphotoUrl; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateUserVariables.fromJson(Map json): + + id = nativeFromJson(json['id']), + role = UserBaseRole.values.byName(json['role']) { + + + + email = Optional.optional(nativeFromJson, nativeToJson); + email.value = json['email'] == null ? null : nativeFromJson(json['email']); + + + fullName = Optional.optional(nativeFromJson, nativeToJson); + fullName.value = json['fullName'] == null ? null : nativeFromJson(json['fullName']); + + + + userRole = Optional.optional(nativeFromJson, nativeToJson); + userRole.value = json['userRole'] == null ? null : nativeFromJson(json['userRole']); + + + photoUrl = Optional.optional(nativeFromJson, nativeToJson); + photoUrl.value = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateUserVariables otherTyped = other as CreateUserVariables; + return id == otherTyped.id && + email == otherTyped.email && + fullName == otherTyped.fullName && + role == otherTyped.role && + userRole == otherTyped.userRole && + photoUrl == otherTyped.photoUrl; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, email.hashCode, fullName.hashCode, role.hashCode, userRole.hashCode, photoUrl.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(email.state == OptionalState.set) { + json['email'] = email.toJson(); + } + if(fullName.state == OptionalState.set) { + json['fullName'] = fullName.toJson(); + } + json['role'] = + role.name + ; + if(userRole.state == OptionalState.set) { + json['userRole'] = userRole.toJson(); + } + if(photoUrl.state == OptionalState.set) { + json['photoUrl'] = photoUrl.toJson(); + } + return json; + } + + CreateUserVariables({ + required this.id, + required this.email, + required this.fullName, + required this.role, + required this.userRole, + required this.photoUrl, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_user_conversation.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_user_conversation.dart new file mode 100644 index 00000000..40cb1a70 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_user_conversation.dart @@ -0,0 +1,167 @@ +part of 'generated.dart'; + +class CreateUserConversationVariablesBuilder { + String conversationId; + String userId; + Optional _unreadCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _lastReadAt = Optional.optional((json) => json['lastReadAt'] = Timestamp.fromJson(json['lastReadAt']), defaultSerializer); + + final FirebaseDataConnect _dataConnect; CreateUserConversationVariablesBuilder unreadCount(int? t) { + _unreadCount.value = t; + return this; + } + CreateUserConversationVariablesBuilder lastReadAt(Timestamp? t) { + _lastReadAt.value = t; + return this; + } + + CreateUserConversationVariablesBuilder(this._dataConnect, {required this.conversationId,required this.userId,}); + Deserializer dataDeserializer = (dynamic json) => CreateUserConversationData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateUserConversationVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateUserConversationVariables vars= CreateUserConversationVariables(conversationId: conversationId,userId: userId,unreadCount: _unreadCount,lastReadAt: _lastReadAt,); + return _dataConnect.mutation("createUserConversation", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateUserConversationUserConversationInsert { + final String conversationId; + final String userId; + CreateUserConversationUserConversationInsert.fromJson(dynamic json): + + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateUserConversationUserConversationInsert otherTyped = other as CreateUserConversationUserConversationInsert; + return conversationId == otherTyped.conversationId && + userId == otherTyped.userId; + + } + @override + int get hashCode => Object.hashAll([conversationId.hashCode, userId.hashCode]); + + + Map toJson() { + Map json = {}; + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + return json; + } + + CreateUserConversationUserConversationInsert({ + required this.conversationId, + required this.userId, + }); +} + +@immutable +class CreateUserConversationData { + final CreateUserConversationUserConversationInsert userConversation_insert; + CreateUserConversationData.fromJson(dynamic json): + + userConversation_insert = CreateUserConversationUserConversationInsert.fromJson(json['userConversation_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateUserConversationData otherTyped = other as CreateUserConversationData; + return userConversation_insert == otherTyped.userConversation_insert; + + } + @override + int get hashCode => userConversation_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['userConversation_insert'] = userConversation_insert.toJson(); + return json; + } + + CreateUserConversationData({ + required this.userConversation_insert, + }); +} + +@immutable +class CreateUserConversationVariables { + final String conversationId; + final String userId; + late final OptionalunreadCount; + late final OptionallastReadAt; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateUserConversationVariables.fromJson(Map json): + + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']) { + + + + + unreadCount = Optional.optional(nativeFromJson, nativeToJson); + unreadCount.value = json['unreadCount'] == null ? null : nativeFromJson(json['unreadCount']); + + + lastReadAt = Optional.optional((json) => json['lastReadAt'] = Timestamp.fromJson(json['lastReadAt']), defaultSerializer); + lastReadAt.value = json['lastReadAt'] == null ? null : Timestamp.fromJson(json['lastReadAt']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateUserConversationVariables otherTyped = other as CreateUserConversationVariables; + return conversationId == otherTyped.conversationId && + userId == otherTyped.userId && + unreadCount == otherTyped.unreadCount && + lastReadAt == otherTyped.lastReadAt; + + } + @override + int get hashCode => Object.hashAll([conversationId.hashCode, userId.hashCode, unreadCount.hashCode, lastReadAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + if(unreadCount.state == OptionalState.set) { + json['unreadCount'] = unreadCount.toJson(); + } + if(lastReadAt.state == OptionalState.set) { + json['lastReadAt'] = lastReadAt.toJson(); + } + return json; + } + + CreateUserConversationVariables({ + required this.conversationId, + required this.userId, + required this.unreadCount, + required this.lastReadAt, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_vendor.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_vendor.dart new file mode 100644 index 00000000..28dcd037 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_vendor.dart @@ -0,0 +1,402 @@ +part of 'generated.dart'; + +class CreateVendorVariablesBuilder { + String userId; + String companyName; + Optional _email = Optional.optional(nativeFromJson, nativeToJson); + Optional _phone = Optional.optional(nativeFromJson, nativeToJson); + Optional _photoUrl = Optional.optional(nativeFromJson, nativeToJson); + Optional _address = Optional.optional(nativeFromJson, nativeToJson); + Optional _billingAddress = Optional.optional(nativeFromJson, nativeToJson); + Optional _timezone = Optional.optional(nativeFromJson, nativeToJson); + Optional _legalName = Optional.optional(nativeFromJson, nativeToJson); + Optional _doingBusinessAs = Optional.optional(nativeFromJson, nativeToJson); + Optional _region = Optional.optional(nativeFromJson, nativeToJson); + Optional _state = Optional.optional(nativeFromJson, nativeToJson); + Optional _city = Optional.optional(nativeFromJson, nativeToJson); + Optional _serviceSpecialty = Optional.optional(nativeFromJson, nativeToJson); + Optional _approvalStatus = Optional.optional((data) => ApprovalStatus.values.byName(data), enumSerializer); + Optional _isActive = Optional.optional(nativeFromJson, nativeToJson); + Optional _markup = Optional.optional(nativeFromJson, nativeToJson); + Optional _fee = Optional.optional(nativeFromJson, nativeToJson); + Optional _csat = Optional.optional(nativeFromJson, nativeToJson); + Optional _tier = Optional.optional((data) => VendorTier.values.byName(data), enumSerializer); + + final FirebaseDataConnect _dataConnect; CreateVendorVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + CreateVendorVariablesBuilder phone(String? t) { + _phone.value = t; + return this; + } + CreateVendorVariablesBuilder photoUrl(String? t) { + _photoUrl.value = t; + return this; + } + CreateVendorVariablesBuilder address(String? t) { + _address.value = t; + return this; + } + CreateVendorVariablesBuilder billingAddress(String? t) { + _billingAddress.value = t; + return this; + } + CreateVendorVariablesBuilder timezone(String? t) { + _timezone.value = t; + return this; + } + CreateVendorVariablesBuilder legalName(String? t) { + _legalName.value = t; + return this; + } + CreateVendorVariablesBuilder doingBusinessAs(String? t) { + _doingBusinessAs.value = t; + return this; + } + CreateVendorVariablesBuilder region(String? t) { + _region.value = t; + return this; + } + CreateVendorVariablesBuilder state(String? t) { + _state.value = t; + return this; + } + CreateVendorVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + CreateVendorVariablesBuilder serviceSpecialty(String? t) { + _serviceSpecialty.value = t; + return this; + } + CreateVendorVariablesBuilder approvalStatus(ApprovalStatus? t) { + _approvalStatus.value = t; + return this; + } + CreateVendorVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + CreateVendorVariablesBuilder markup(double? t) { + _markup.value = t; + return this; + } + CreateVendorVariablesBuilder fee(double? t) { + _fee.value = t; + return this; + } + CreateVendorVariablesBuilder csat(double? t) { + _csat.value = t; + return this; + } + CreateVendorVariablesBuilder tier(VendorTier? t) { + _tier.value = t; + return this; + } + + CreateVendorVariablesBuilder(this._dataConnect, {required this.userId,required this.companyName,}); + Deserializer dataDeserializer = (dynamic json) => CreateVendorData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateVendorVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateVendorVariables vars= CreateVendorVariables(userId: userId,companyName: companyName,email: _email,phone: _phone,photoUrl: _photoUrl,address: _address,billingAddress: _billingAddress,timezone: _timezone,legalName: _legalName,doingBusinessAs: _doingBusinessAs,region: _region,state: _state,city: _city,serviceSpecialty: _serviceSpecialty,approvalStatus: _approvalStatus,isActive: _isActive,markup: _markup,fee: _fee,csat: _csat,tier: _tier,); + return _dataConnect.mutation("createVendor", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateVendorVendorInsert { + final String id; + CreateVendorVendorInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateVendorVendorInsert otherTyped = other as CreateVendorVendorInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateVendorVendorInsert({ + required this.id, + }); +} + +@immutable +class CreateVendorData { + final CreateVendorVendorInsert vendor_insert; + CreateVendorData.fromJson(dynamic json): + + vendor_insert = CreateVendorVendorInsert.fromJson(json['vendor_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateVendorData otherTyped = other as CreateVendorData; + return vendor_insert == otherTyped.vendor_insert; + + } + @override + int get hashCode => vendor_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['vendor_insert'] = vendor_insert.toJson(); + return json; + } + + CreateVendorData({ + required this.vendor_insert, + }); +} + +@immutable +class CreateVendorVariables { + final String userId; + final String companyName; + late final Optionalemail; + late final Optionalphone; + late final OptionalphotoUrl; + late final Optionaladdress; + late final OptionalbillingAddress; + late final Optionaltimezone; + late final OptionallegalName; + late final OptionaldoingBusinessAs; + late final Optionalregion; + late final Optionalstate; + late final Optionalcity; + late final OptionalserviceSpecialty; + late final OptionalapprovalStatus; + late final OptionalisActive; + late final Optionalmarkup; + late final Optionalfee; + late final Optionalcsat; + late final Optionaltier; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateVendorVariables.fromJson(Map json): + + userId = nativeFromJson(json['userId']), + companyName = nativeFromJson(json['companyName']) { + + + + + email = Optional.optional(nativeFromJson, nativeToJson); + email.value = json['email'] == null ? null : nativeFromJson(json['email']); + + + phone = Optional.optional(nativeFromJson, nativeToJson); + phone.value = json['phone'] == null ? null : nativeFromJson(json['phone']); + + + photoUrl = Optional.optional(nativeFromJson, nativeToJson); + photoUrl.value = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + + + address = Optional.optional(nativeFromJson, nativeToJson); + address.value = json['address'] == null ? null : nativeFromJson(json['address']); + + + billingAddress = Optional.optional(nativeFromJson, nativeToJson); + billingAddress.value = json['billingAddress'] == null ? null : nativeFromJson(json['billingAddress']); + + + timezone = Optional.optional(nativeFromJson, nativeToJson); + timezone.value = json['timezone'] == null ? null : nativeFromJson(json['timezone']); + + + legalName = Optional.optional(nativeFromJson, nativeToJson); + legalName.value = json['legalName'] == null ? null : nativeFromJson(json['legalName']); + + + doingBusinessAs = Optional.optional(nativeFromJson, nativeToJson); + doingBusinessAs.value = json['doingBusinessAs'] == null ? null : nativeFromJson(json['doingBusinessAs']); + + + region = Optional.optional(nativeFromJson, nativeToJson); + region.value = json['region'] == null ? null : nativeFromJson(json['region']); + + + state = Optional.optional(nativeFromJson, nativeToJson); + state.value = json['state'] == null ? null : nativeFromJson(json['state']); + + + city = Optional.optional(nativeFromJson, nativeToJson); + city.value = json['city'] == null ? null : nativeFromJson(json['city']); + + + serviceSpecialty = Optional.optional(nativeFromJson, nativeToJson); + serviceSpecialty.value = json['serviceSpecialty'] == null ? null : nativeFromJson(json['serviceSpecialty']); + + + approvalStatus = Optional.optional((data) => ApprovalStatus.values.byName(data), enumSerializer); + approvalStatus.value = json['approvalStatus'] == null ? null : ApprovalStatus.values.byName(json['approvalStatus']); + + + isActive = Optional.optional(nativeFromJson, nativeToJson); + isActive.value = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + + + markup = Optional.optional(nativeFromJson, nativeToJson); + markup.value = json['markup'] == null ? null : nativeFromJson(json['markup']); + + + fee = Optional.optional(nativeFromJson, nativeToJson); + fee.value = json['fee'] == null ? null : nativeFromJson(json['fee']); + + + csat = Optional.optional(nativeFromJson, nativeToJson); + csat.value = json['csat'] == null ? null : nativeFromJson(json['csat']); + + + tier = Optional.optional((data) => VendorTier.values.byName(data), enumSerializer); + tier.value = json['tier'] == null ? null : VendorTier.values.byName(json['tier']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateVendorVariables otherTyped = other as CreateVendorVariables; + return userId == otherTyped.userId && + companyName == otherTyped.companyName && + email == otherTyped.email && + phone == otherTyped.phone && + photoUrl == otherTyped.photoUrl && + address == otherTyped.address && + billingAddress == otherTyped.billingAddress && + timezone == otherTyped.timezone && + legalName == otherTyped.legalName && + doingBusinessAs == otherTyped.doingBusinessAs && + region == otherTyped.region && + state == otherTyped.state && + city == otherTyped.city && + serviceSpecialty == otherTyped.serviceSpecialty && + approvalStatus == otherTyped.approvalStatus && + isActive == otherTyped.isActive && + markup == otherTyped.markup && + fee == otherTyped.fee && + csat == otherTyped.csat && + tier == otherTyped.tier; + + } + @override + int get hashCode => Object.hashAll([userId.hashCode, companyName.hashCode, email.hashCode, phone.hashCode, photoUrl.hashCode, address.hashCode, billingAddress.hashCode, timezone.hashCode, legalName.hashCode, doingBusinessAs.hashCode, region.hashCode, state.hashCode, city.hashCode, serviceSpecialty.hashCode, approvalStatus.hashCode, isActive.hashCode, markup.hashCode, fee.hashCode, csat.hashCode, tier.hashCode]); + + + Map toJson() { + Map json = {}; + json['userId'] = nativeToJson(userId); + json['companyName'] = nativeToJson(companyName); + if(email.state == OptionalState.set) { + json['email'] = email.toJson(); + } + if(phone.state == OptionalState.set) { + json['phone'] = phone.toJson(); + } + if(photoUrl.state == OptionalState.set) { + json['photoUrl'] = photoUrl.toJson(); + } + if(address.state == OptionalState.set) { + json['address'] = address.toJson(); + } + if(billingAddress.state == OptionalState.set) { + json['billingAddress'] = billingAddress.toJson(); + } + if(timezone.state == OptionalState.set) { + json['timezone'] = timezone.toJson(); + } + if(legalName.state == OptionalState.set) { + json['legalName'] = legalName.toJson(); + } + if(doingBusinessAs.state == OptionalState.set) { + json['doingBusinessAs'] = doingBusinessAs.toJson(); + } + if(region.state == OptionalState.set) { + json['region'] = region.toJson(); + } + if(state.state == OptionalState.set) { + json['state'] = state.toJson(); + } + if(city.state == OptionalState.set) { + json['city'] = city.toJson(); + } + if(serviceSpecialty.state == OptionalState.set) { + json['serviceSpecialty'] = serviceSpecialty.toJson(); + } + if(approvalStatus.state == OptionalState.set) { + json['approvalStatus'] = approvalStatus.toJson(); + } + if(isActive.state == OptionalState.set) { + json['isActive'] = isActive.toJson(); + } + if(markup.state == OptionalState.set) { + json['markup'] = markup.toJson(); + } + if(fee.state == OptionalState.set) { + json['fee'] = fee.toJson(); + } + if(csat.state == OptionalState.set) { + json['csat'] = csat.toJson(); + } + if(tier.state == OptionalState.set) { + json['tier'] = tier.toJson(); + } + return json; + } + + CreateVendorVariables({ + required this.userId, + required this.companyName, + required this.email, + required this.phone, + required this.photoUrl, + required this.address, + required this.billingAddress, + required this.timezone, + required this.legalName, + required this.doingBusinessAs, + required this.region, + required this.state, + required this.city, + required this.serviceSpecialty, + required this.approvalStatus, + required this.isActive, + required this.markup, + required this.fee, + required this.csat, + required this.tier, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_vendor_benefit_plan.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_vendor_benefit_plan.dart new file mode 100644 index 00000000..8b3bb46d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_vendor_benefit_plan.dart @@ -0,0 +1,207 @@ +part of 'generated.dart'; + +class CreateVendorBenefitPlanVariablesBuilder { + String vendorId; + String title; + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + Optional _requestLabel = Optional.optional(nativeFromJson, nativeToJson); + Optional _total = Optional.optional(nativeFromJson, nativeToJson); + Optional _isActive = Optional.optional(nativeFromJson, nativeToJson); + Optional _createdBy = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateVendorBenefitPlanVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + CreateVendorBenefitPlanVariablesBuilder requestLabel(String? t) { + _requestLabel.value = t; + return this; + } + CreateVendorBenefitPlanVariablesBuilder total(int? t) { + _total.value = t; + return this; + } + CreateVendorBenefitPlanVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + CreateVendorBenefitPlanVariablesBuilder createdBy(String? t) { + _createdBy.value = t; + return this; + } + + CreateVendorBenefitPlanVariablesBuilder(this._dataConnect, {required this.vendorId,required this.title,}); + Deserializer dataDeserializer = (dynamic json) => CreateVendorBenefitPlanData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateVendorBenefitPlanVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateVendorBenefitPlanVariables vars= CreateVendorBenefitPlanVariables(vendorId: vendorId,title: title,description: _description,requestLabel: _requestLabel,total: _total,isActive: _isActive,createdBy: _createdBy,); + return _dataConnect.mutation("createVendorBenefitPlan", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateVendorBenefitPlanVendorBenefitPlanInsert { + final String id; + CreateVendorBenefitPlanVendorBenefitPlanInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateVendorBenefitPlanVendorBenefitPlanInsert otherTyped = other as CreateVendorBenefitPlanVendorBenefitPlanInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateVendorBenefitPlanVendorBenefitPlanInsert({ + required this.id, + }); +} + +@immutable +class CreateVendorBenefitPlanData { + final CreateVendorBenefitPlanVendorBenefitPlanInsert vendorBenefitPlan_insert; + CreateVendorBenefitPlanData.fromJson(dynamic json): + + vendorBenefitPlan_insert = CreateVendorBenefitPlanVendorBenefitPlanInsert.fromJson(json['vendorBenefitPlan_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateVendorBenefitPlanData otherTyped = other as CreateVendorBenefitPlanData; + return vendorBenefitPlan_insert == otherTyped.vendorBenefitPlan_insert; + + } + @override + int get hashCode => vendorBenefitPlan_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['vendorBenefitPlan_insert'] = vendorBenefitPlan_insert.toJson(); + return json; + } + + CreateVendorBenefitPlanData({ + required this.vendorBenefitPlan_insert, + }); +} + +@immutable +class CreateVendorBenefitPlanVariables { + final String vendorId; + final String title; + late final Optionaldescription; + late final OptionalrequestLabel; + late final Optionaltotal; + late final OptionalisActive; + late final OptionalcreatedBy; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateVendorBenefitPlanVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']), + title = nativeFromJson(json['title']) { + + + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + + requestLabel = Optional.optional(nativeFromJson, nativeToJson); + requestLabel.value = json['requestLabel'] == null ? null : nativeFromJson(json['requestLabel']); + + + total = Optional.optional(nativeFromJson, nativeToJson); + total.value = json['total'] == null ? null : nativeFromJson(json['total']); + + + isActive = Optional.optional(nativeFromJson, nativeToJson); + isActive.value = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + + + createdBy = Optional.optional(nativeFromJson, nativeToJson); + createdBy.value = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateVendorBenefitPlanVariables otherTyped = other as CreateVendorBenefitPlanVariables; + return vendorId == otherTyped.vendorId && + title == otherTyped.title && + description == otherTyped.description && + requestLabel == otherTyped.requestLabel && + total == otherTyped.total && + isActive == otherTyped.isActive && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, title.hashCode, description.hashCode, requestLabel.hashCode, total.hashCode, isActive.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + json['title'] = nativeToJson(title); + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + if(requestLabel.state == OptionalState.set) { + json['requestLabel'] = requestLabel.toJson(); + } + if(total.state == OptionalState.set) { + json['total'] = total.toJson(); + } + if(isActive.state == OptionalState.set) { + json['isActive'] = isActive.toJson(); + } + if(createdBy.state == OptionalState.set) { + json['createdBy'] = createdBy.toJson(); + } + return json; + } + + CreateVendorBenefitPlanVariables({ + required this.vendorId, + required this.title, + required this.description, + required this.requestLabel, + required this.total, + required this.isActive, + required this.createdBy, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_vendor_rate.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_vendor_rate.dart new file mode 100644 index 00000000..52085bbc --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_vendor_rate.dart @@ -0,0 +1,245 @@ +part of 'generated.dart'; + +class CreateVendorRateVariablesBuilder { + String vendorId; + Optional _roleName = Optional.optional(nativeFromJson, nativeToJson); + Optional _category = Optional.optional((data) => CategoryType.values.byName(data), enumSerializer); + Optional _clientRate = Optional.optional(nativeFromJson, nativeToJson); + Optional _employeeWage = Optional.optional(nativeFromJson, nativeToJson); + Optional _markupPercentage = Optional.optional(nativeFromJson, nativeToJson); + Optional _vendorFeePercentage = Optional.optional(nativeFromJson, nativeToJson); + Optional _isActive = Optional.optional(nativeFromJson, nativeToJson); + Optional _notes = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; CreateVendorRateVariablesBuilder roleName(String? t) { + _roleName.value = t; + return this; + } + CreateVendorRateVariablesBuilder category(CategoryType? t) { + _category.value = t; + return this; + } + CreateVendorRateVariablesBuilder clientRate(double? t) { + _clientRate.value = t; + return this; + } + CreateVendorRateVariablesBuilder employeeWage(double? t) { + _employeeWage.value = t; + return this; + } + CreateVendorRateVariablesBuilder markupPercentage(double? t) { + _markupPercentage.value = t; + return this; + } + CreateVendorRateVariablesBuilder vendorFeePercentage(double? t) { + _vendorFeePercentage.value = t; + return this; + } + CreateVendorRateVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + CreateVendorRateVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + + CreateVendorRateVariablesBuilder(this._dataConnect, {required this.vendorId,}); + Deserializer dataDeserializer = (dynamic json) => CreateVendorRateData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateVendorRateVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateVendorRateVariables vars= CreateVendorRateVariables(vendorId: vendorId,roleName: _roleName,category: _category,clientRate: _clientRate,employeeWage: _employeeWage,markupPercentage: _markupPercentage,vendorFeePercentage: _vendorFeePercentage,isActive: _isActive,notes: _notes,); + return _dataConnect.mutation("createVendorRate", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateVendorRateVendorRateInsert { + final String id; + CreateVendorRateVendorRateInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateVendorRateVendorRateInsert otherTyped = other as CreateVendorRateVendorRateInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateVendorRateVendorRateInsert({ + required this.id, + }); +} + +@immutable +class CreateVendorRateData { + final CreateVendorRateVendorRateInsert vendorRate_insert; + CreateVendorRateData.fromJson(dynamic json): + + vendorRate_insert = CreateVendorRateVendorRateInsert.fromJson(json['vendorRate_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateVendorRateData otherTyped = other as CreateVendorRateData; + return vendorRate_insert == otherTyped.vendorRate_insert; + + } + @override + int get hashCode => vendorRate_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['vendorRate_insert'] = vendorRate_insert.toJson(); + return json; + } + + CreateVendorRateData({ + required this.vendorRate_insert, + }); +} + +@immutable +class CreateVendorRateVariables { + final String vendorId; + late final OptionalroleName; + late final Optionalcategory; + late final OptionalclientRate; + late final OptionalemployeeWage; + late final OptionalmarkupPercentage; + late final OptionalvendorFeePercentage; + late final OptionalisActive; + late final Optionalnotes; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateVendorRateVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']) { + + + + roleName = Optional.optional(nativeFromJson, nativeToJson); + roleName.value = json['roleName'] == null ? null : nativeFromJson(json['roleName']); + + + category = Optional.optional((data) => CategoryType.values.byName(data), enumSerializer); + category.value = json['category'] == null ? null : CategoryType.values.byName(json['category']); + + + clientRate = Optional.optional(nativeFromJson, nativeToJson); + clientRate.value = json['clientRate'] == null ? null : nativeFromJson(json['clientRate']); + + + employeeWage = Optional.optional(nativeFromJson, nativeToJson); + employeeWage.value = json['employeeWage'] == null ? null : nativeFromJson(json['employeeWage']); + + + markupPercentage = Optional.optional(nativeFromJson, nativeToJson); + markupPercentage.value = json['markupPercentage'] == null ? null : nativeFromJson(json['markupPercentage']); + + + vendorFeePercentage = Optional.optional(nativeFromJson, nativeToJson); + vendorFeePercentage.value = json['vendorFeePercentage'] == null ? null : nativeFromJson(json['vendorFeePercentage']); + + + isActive = Optional.optional(nativeFromJson, nativeToJson); + isActive.value = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + + + notes = Optional.optional(nativeFromJson, nativeToJson); + notes.value = json['notes'] == null ? null : nativeFromJson(json['notes']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateVendorRateVariables otherTyped = other as CreateVendorRateVariables; + return vendorId == otherTyped.vendorId && + roleName == otherTyped.roleName && + category == otherTyped.category && + clientRate == otherTyped.clientRate && + employeeWage == otherTyped.employeeWage && + markupPercentage == otherTyped.markupPercentage && + vendorFeePercentage == otherTyped.vendorFeePercentage && + isActive == otherTyped.isActive && + notes == otherTyped.notes; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, roleName.hashCode, category.hashCode, clientRate.hashCode, employeeWage.hashCode, markupPercentage.hashCode, vendorFeePercentage.hashCode, isActive.hashCode, notes.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + if(roleName.state == OptionalState.set) { + json['roleName'] = roleName.toJson(); + } + if(category.state == OptionalState.set) { + json['category'] = category.toJson(); + } + if(clientRate.state == OptionalState.set) { + json['clientRate'] = clientRate.toJson(); + } + if(employeeWage.state == OptionalState.set) { + json['employeeWage'] = employeeWage.toJson(); + } + if(markupPercentage.state == OptionalState.set) { + json['markupPercentage'] = markupPercentage.toJson(); + } + if(vendorFeePercentage.state == OptionalState.set) { + json['vendorFeePercentage'] = vendorFeePercentage.toJson(); + } + if(isActive.state == OptionalState.set) { + json['isActive'] = isActive.toJson(); + } + if(notes.state == OptionalState.set) { + json['notes'] = notes.toJson(); + } + return json; + } + + CreateVendorRateVariables({ + required this.vendorId, + required this.roleName, + required this.category, + required this.clientRate, + required this.employeeWage, + required this.markupPercentage, + required this.vendorFeePercentage, + required this.isActive, + required this.notes, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_workforce.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_workforce.dart new file mode 100644 index 00000000..b2735b6c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/create_workforce.dart @@ -0,0 +1,154 @@ +part of 'generated.dart'; + +class CreateWorkforceVariablesBuilder { + String vendorId; + String staffId; + String workforceNumber; + Optional _employmentType = Optional.optional((data) => WorkforceEmploymentType.values.byName(data), enumSerializer); + + final FirebaseDataConnect _dataConnect; CreateWorkforceVariablesBuilder employmentType(WorkforceEmploymentType? t) { + _employmentType.value = t; + return this; + } + + CreateWorkforceVariablesBuilder(this._dataConnect, {required this.vendorId,required this.staffId,required this.workforceNumber,}); + Deserializer dataDeserializer = (dynamic json) => CreateWorkforceData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (CreateWorkforceVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + CreateWorkforceVariables vars= CreateWorkforceVariables(vendorId: vendorId,staffId: staffId,workforceNumber: workforceNumber,employmentType: _employmentType,); + return _dataConnect.mutation("createWorkforce", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class CreateWorkforceWorkforceInsert { + final String id; + CreateWorkforceWorkforceInsert.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateWorkforceWorkforceInsert otherTyped = other as CreateWorkforceWorkforceInsert; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + CreateWorkforceWorkforceInsert({ + required this.id, + }); +} + +@immutable +class CreateWorkforceData { + final CreateWorkforceWorkforceInsert workforce_insert; + CreateWorkforceData.fromJson(dynamic json): + + workforce_insert = CreateWorkforceWorkforceInsert.fromJson(json['workforce_insert']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateWorkforceData otherTyped = other as CreateWorkforceData; + return workforce_insert == otherTyped.workforce_insert; + + } + @override + int get hashCode => workforce_insert.hashCode; + + + Map toJson() { + Map json = {}; + json['workforce_insert'] = workforce_insert.toJson(); + return json; + } + + CreateWorkforceData({ + required this.workforce_insert, + }); +} + +@immutable +class CreateWorkforceVariables { + final String vendorId; + final String staffId; + final String workforceNumber; + late final OptionalemploymentType; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + CreateWorkforceVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']), + staffId = nativeFromJson(json['staffId']), + workforceNumber = nativeFromJson(json['workforceNumber']) { + + + + + + employmentType = Optional.optional((data) => WorkforceEmploymentType.values.byName(data), enumSerializer); + employmentType.value = json['employmentType'] == null ? null : WorkforceEmploymentType.values.byName(json['employmentType']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final CreateWorkforceVariables otherTyped = other as CreateWorkforceVariables; + return vendorId == otherTyped.vendorId && + staffId == otherTyped.staffId && + workforceNumber == otherTyped.workforceNumber && + employmentType == otherTyped.employmentType; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, staffId.hashCode, workforceNumber.hashCode, employmentType.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + json['staffId'] = nativeToJson(staffId); + json['workforceNumber'] = nativeToJson(workforceNumber); + if(employmentType.state == OptionalState.set) { + json['employmentType'] = employmentType.toJson(); + } + return json; + } + + CreateWorkforceVariables({ + required this.vendorId, + required this.staffId, + required this.workforceNumber, + required this.employmentType, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/deactivate_workforce.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/deactivate_workforce.dart new file mode 100644 index 00000000..14af2597 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/deactivate_workforce.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeactivateWorkforceVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeactivateWorkforceVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeactivateWorkforceData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeactivateWorkforceVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeactivateWorkforceVariables vars= DeactivateWorkforceVariables(id: id,); + return _dataConnect.mutation("deactivateWorkforce", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeactivateWorkforceWorkforceUpdate { + final String id; + DeactivateWorkforceWorkforceUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeactivateWorkforceWorkforceUpdate otherTyped = other as DeactivateWorkforceWorkforceUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeactivateWorkforceWorkforceUpdate({ + required this.id, + }); +} + +@immutable +class DeactivateWorkforceData { + final DeactivateWorkforceWorkforceUpdate? workforce_update; + DeactivateWorkforceData.fromJson(dynamic json): + + workforce_update = json['workforce_update'] == null ? null : DeactivateWorkforceWorkforceUpdate.fromJson(json['workforce_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeactivateWorkforceData otherTyped = other as DeactivateWorkforceData; + return workforce_update == otherTyped.workforce_update; + + } + @override + int get hashCode => workforce_update.hashCode; + + + Map toJson() { + Map json = {}; + if (workforce_update != null) { + json['workforce_update'] = workforce_update!.toJson(); + } + return json; + } + + DeactivateWorkforceData({ + this.workforce_update, + }); +} + +@immutable +class DeactivateWorkforceVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeactivateWorkforceVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeactivateWorkforceVariables otherTyped = other as DeactivateWorkforceVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeactivateWorkforceVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_account.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_account.dart new file mode 100644 index 00000000..a152983c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_account.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteAccountVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteAccountVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteAccountData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteAccountVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteAccountVariables vars= DeleteAccountVariables(id: id,); + return _dataConnect.mutation("deleteAccount", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteAccountAccountDelete { + final String id; + DeleteAccountAccountDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteAccountAccountDelete otherTyped = other as DeleteAccountAccountDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteAccountAccountDelete({ + required this.id, + }); +} + +@immutable +class DeleteAccountData { + final DeleteAccountAccountDelete? account_delete; + DeleteAccountData.fromJson(dynamic json): + + account_delete = json['account_delete'] == null ? null : DeleteAccountAccountDelete.fromJson(json['account_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteAccountData otherTyped = other as DeleteAccountData; + return account_delete == otherTyped.account_delete; + + } + @override + int get hashCode => account_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (account_delete != null) { + json['account_delete'] = account_delete!.toJson(); + } + return json; + } + + DeleteAccountData({ + this.account_delete, + }); +} + +@immutable +class DeleteAccountVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteAccountVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteAccountVariables otherTyped = other as DeleteAccountVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteAccountVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_activity_log.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_activity_log.dart new file mode 100644 index 00000000..b0a1c076 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_activity_log.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteActivityLogVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteActivityLogVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteActivityLogData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteActivityLogVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteActivityLogVariables vars= DeleteActivityLogVariables(id: id,); + return _dataConnect.mutation("deleteActivityLog", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteActivityLogActivityLogDelete { + final String id; + DeleteActivityLogActivityLogDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteActivityLogActivityLogDelete otherTyped = other as DeleteActivityLogActivityLogDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteActivityLogActivityLogDelete({ + required this.id, + }); +} + +@immutable +class DeleteActivityLogData { + final DeleteActivityLogActivityLogDelete? activityLog_delete; + DeleteActivityLogData.fromJson(dynamic json): + + activityLog_delete = json['activityLog_delete'] == null ? null : DeleteActivityLogActivityLogDelete.fromJson(json['activityLog_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteActivityLogData otherTyped = other as DeleteActivityLogData; + return activityLog_delete == otherTyped.activityLog_delete; + + } + @override + int get hashCode => activityLog_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (activityLog_delete != null) { + json['activityLog_delete'] = activityLog_delete!.toJson(); + } + return json; + } + + DeleteActivityLogData({ + this.activityLog_delete, + }); +} + +@immutable +class DeleteActivityLogVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteActivityLogVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteActivityLogVariables otherTyped = other as DeleteActivityLogVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteActivityLogVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_application.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_application.dart new file mode 100644 index 00000000..400f440e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_application.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteApplicationVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteApplicationVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteApplicationData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteApplicationVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteApplicationVariables vars= DeleteApplicationVariables(id: id,); + return _dataConnect.mutation("deleteApplication", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteApplicationApplicationDelete { + final String id; + DeleteApplicationApplicationDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteApplicationApplicationDelete otherTyped = other as DeleteApplicationApplicationDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteApplicationApplicationDelete({ + required this.id, + }); +} + +@immutable +class DeleteApplicationData { + final DeleteApplicationApplicationDelete? application_delete; + DeleteApplicationData.fromJson(dynamic json): + + application_delete = json['application_delete'] == null ? null : DeleteApplicationApplicationDelete.fromJson(json['application_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteApplicationData otherTyped = other as DeleteApplicationData; + return application_delete == otherTyped.application_delete; + + } + @override + int get hashCode => application_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (application_delete != null) { + json['application_delete'] = application_delete!.toJson(); + } + return json; + } + + DeleteApplicationData({ + this.application_delete, + }); +} + +@immutable +class DeleteApplicationVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteApplicationVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteApplicationVariables otherTyped = other as DeleteApplicationVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteApplicationVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_assignment.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_assignment.dart new file mode 100644 index 00000000..a9b043d3 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_assignment.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteAssignmentVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteAssignmentVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteAssignmentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteAssignmentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteAssignmentVariables vars= DeleteAssignmentVariables(id: id,); + return _dataConnect.mutation("DeleteAssignment", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteAssignmentAssignmentDelete { + final String id; + DeleteAssignmentAssignmentDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteAssignmentAssignmentDelete otherTyped = other as DeleteAssignmentAssignmentDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteAssignmentAssignmentDelete({ + required this.id, + }); +} + +@immutable +class DeleteAssignmentData { + final DeleteAssignmentAssignmentDelete? assignment_delete; + DeleteAssignmentData.fromJson(dynamic json): + + assignment_delete = json['assignment_delete'] == null ? null : DeleteAssignmentAssignmentDelete.fromJson(json['assignment_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteAssignmentData otherTyped = other as DeleteAssignmentData; + return assignment_delete == otherTyped.assignment_delete; + + } + @override + int get hashCode => assignment_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (assignment_delete != null) { + json['assignment_delete'] = assignment_delete!.toJson(); + } + return json; + } + + DeleteAssignmentData({ + this.assignment_delete, + }); +} + +@immutable +class DeleteAssignmentVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteAssignmentVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteAssignmentVariables otherTyped = other as DeleteAssignmentVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteAssignmentVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_attire_option.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_attire_option.dart new file mode 100644 index 00000000..9dd40295 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_attire_option.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteAttireOptionVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteAttireOptionVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteAttireOptionData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteAttireOptionVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteAttireOptionVariables vars= DeleteAttireOptionVariables(id: id,); + return _dataConnect.mutation("deleteAttireOption", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteAttireOptionAttireOptionDelete { + final String id; + DeleteAttireOptionAttireOptionDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteAttireOptionAttireOptionDelete otherTyped = other as DeleteAttireOptionAttireOptionDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteAttireOptionAttireOptionDelete({ + required this.id, + }); +} + +@immutable +class DeleteAttireOptionData { + final DeleteAttireOptionAttireOptionDelete? attireOption_delete; + DeleteAttireOptionData.fromJson(dynamic json): + + attireOption_delete = json['attireOption_delete'] == null ? null : DeleteAttireOptionAttireOptionDelete.fromJson(json['attireOption_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteAttireOptionData otherTyped = other as DeleteAttireOptionData; + return attireOption_delete == otherTyped.attireOption_delete; + + } + @override + int get hashCode => attireOption_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (attireOption_delete != null) { + json['attireOption_delete'] = attireOption_delete!.toJson(); + } + return json; + } + + DeleteAttireOptionData({ + this.attireOption_delete, + }); +} + +@immutable +class DeleteAttireOptionVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteAttireOptionVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteAttireOptionVariables otherTyped = other as DeleteAttireOptionVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteAttireOptionVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_benefits_data.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_benefits_data.dart new file mode 100644 index 00000000..5c74917d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_benefits_data.dart @@ -0,0 +1,135 @@ +part of 'generated.dart'; + +class DeleteBenefitsDataVariablesBuilder { + String staffId; + String vendorBenefitPlanId; + + final FirebaseDataConnect _dataConnect; + DeleteBenefitsDataVariablesBuilder(this._dataConnect, {required this.staffId,required this.vendorBenefitPlanId,}); + Deserializer dataDeserializer = (dynamic json) => DeleteBenefitsDataData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteBenefitsDataVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteBenefitsDataVariables vars= DeleteBenefitsDataVariables(staffId: staffId,vendorBenefitPlanId: vendorBenefitPlanId,); + return _dataConnect.mutation("deleteBenefitsData", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteBenefitsDataBenefitsDataDelete { + final String vendorBenefitPlanId; + final String staffId; + DeleteBenefitsDataBenefitsDataDelete.fromJson(dynamic json): + + vendorBenefitPlanId = nativeFromJson(json['vendorBenefitPlanId']), + staffId = nativeFromJson(json['staffId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteBenefitsDataBenefitsDataDelete otherTyped = other as DeleteBenefitsDataBenefitsDataDelete; + return vendorBenefitPlanId == otherTyped.vendorBenefitPlanId && + staffId == otherTyped.staffId; + + } + @override + int get hashCode => Object.hashAll([vendorBenefitPlanId.hashCode, staffId.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorBenefitPlanId'] = nativeToJson(vendorBenefitPlanId); + json['staffId'] = nativeToJson(staffId); + return json; + } + + DeleteBenefitsDataBenefitsDataDelete({ + required this.vendorBenefitPlanId, + required this.staffId, + }); +} + +@immutable +class DeleteBenefitsDataData { + final DeleteBenefitsDataBenefitsDataDelete? benefitsData_delete; + DeleteBenefitsDataData.fromJson(dynamic json): + + benefitsData_delete = json['benefitsData_delete'] == null ? null : DeleteBenefitsDataBenefitsDataDelete.fromJson(json['benefitsData_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteBenefitsDataData otherTyped = other as DeleteBenefitsDataData; + return benefitsData_delete == otherTyped.benefitsData_delete; + + } + @override + int get hashCode => benefitsData_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (benefitsData_delete != null) { + json['benefitsData_delete'] = benefitsData_delete!.toJson(); + } + return json; + } + + DeleteBenefitsDataData({ + this.benefitsData_delete, + }); +} + +@immutable +class DeleteBenefitsDataVariables { + final String staffId; + final String vendorBenefitPlanId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteBenefitsDataVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + vendorBenefitPlanId = nativeFromJson(json['vendorBenefitPlanId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteBenefitsDataVariables otherTyped = other as DeleteBenefitsDataVariables; + return staffId == otherTyped.staffId && + vendorBenefitPlanId == otherTyped.vendorBenefitPlanId; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, vendorBenefitPlanId.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['vendorBenefitPlanId'] = nativeToJson(vendorBenefitPlanId); + return json; + } + + DeleteBenefitsDataVariables({ + required this.staffId, + required this.vendorBenefitPlanId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_business.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_business.dart new file mode 100644 index 00000000..855347c5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_business.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteBusinessVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteBusinessVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteBusinessData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteBusinessVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteBusinessVariables vars= DeleteBusinessVariables(id: id,); + return _dataConnect.mutation("deleteBusiness", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteBusinessBusinessDelete { + final String id; + DeleteBusinessBusinessDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteBusinessBusinessDelete otherTyped = other as DeleteBusinessBusinessDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteBusinessBusinessDelete({ + required this.id, + }); +} + +@immutable +class DeleteBusinessData { + final DeleteBusinessBusinessDelete? business_delete; + DeleteBusinessData.fromJson(dynamic json): + + business_delete = json['business_delete'] == null ? null : DeleteBusinessBusinessDelete.fromJson(json['business_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteBusinessData otherTyped = other as DeleteBusinessData; + return business_delete == otherTyped.business_delete; + + } + @override + int get hashCode => business_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (business_delete != null) { + json['business_delete'] = business_delete!.toJson(); + } + return json; + } + + DeleteBusinessData({ + this.business_delete, + }); +} + +@immutable +class DeleteBusinessVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteBusinessVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteBusinessVariables otherTyped = other as DeleteBusinessVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteBusinessVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_category.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_category.dart new file mode 100644 index 00000000..76ebca82 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_category.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteCategoryVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteCategoryVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteCategoryData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteCategoryVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteCategoryVariables vars= DeleteCategoryVariables(id: id,); + return _dataConnect.mutation("deleteCategory", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteCategoryCategoryDelete { + final String id; + DeleteCategoryCategoryDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteCategoryCategoryDelete otherTyped = other as DeleteCategoryCategoryDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteCategoryCategoryDelete({ + required this.id, + }); +} + +@immutable +class DeleteCategoryData { + final DeleteCategoryCategoryDelete? category_delete; + DeleteCategoryData.fromJson(dynamic json): + + category_delete = json['category_delete'] == null ? null : DeleteCategoryCategoryDelete.fromJson(json['category_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteCategoryData otherTyped = other as DeleteCategoryData; + return category_delete == otherTyped.category_delete; + + } + @override + int get hashCode => category_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (category_delete != null) { + json['category_delete'] = category_delete!.toJson(); + } + return json; + } + + DeleteCategoryData({ + this.category_delete, + }); +} + +@immutable +class DeleteCategoryVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteCategoryVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteCategoryVariables otherTyped = other as DeleteCategoryVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteCategoryVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_certificate.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_certificate.dart new file mode 100644 index 00000000..b86d4e41 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_certificate.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteCertificateVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteCertificateVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteCertificateData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteCertificateVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteCertificateVariables vars= DeleteCertificateVariables(id: id,); + return _dataConnect.mutation("DeleteCertificate", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteCertificateCertificateDelete { + final String id; + DeleteCertificateCertificateDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteCertificateCertificateDelete otherTyped = other as DeleteCertificateCertificateDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteCertificateCertificateDelete({ + required this.id, + }); +} + +@immutable +class DeleteCertificateData { + final DeleteCertificateCertificateDelete? certificate_delete; + DeleteCertificateData.fromJson(dynamic json): + + certificate_delete = json['certificate_delete'] == null ? null : DeleteCertificateCertificateDelete.fromJson(json['certificate_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteCertificateData otherTyped = other as DeleteCertificateData; + return certificate_delete == otherTyped.certificate_delete; + + } + @override + int get hashCode => certificate_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (certificate_delete != null) { + json['certificate_delete'] = certificate_delete!.toJson(); + } + return json; + } + + DeleteCertificateData({ + this.certificate_delete, + }); +} + +@immutable +class DeleteCertificateVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteCertificateVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteCertificateVariables otherTyped = other as DeleteCertificateVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteCertificateVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_client_feedback.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_client_feedback.dart new file mode 100644 index 00000000..63d7f3cd --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_client_feedback.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteClientFeedbackVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteClientFeedbackVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteClientFeedbackData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteClientFeedbackVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteClientFeedbackVariables vars= DeleteClientFeedbackVariables(id: id,); + return _dataConnect.mutation("deleteClientFeedback", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteClientFeedbackClientFeedbackDelete { + final String id; + DeleteClientFeedbackClientFeedbackDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteClientFeedbackClientFeedbackDelete otherTyped = other as DeleteClientFeedbackClientFeedbackDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteClientFeedbackClientFeedbackDelete({ + required this.id, + }); +} + +@immutable +class DeleteClientFeedbackData { + final DeleteClientFeedbackClientFeedbackDelete? clientFeedback_delete; + DeleteClientFeedbackData.fromJson(dynamic json): + + clientFeedback_delete = json['clientFeedback_delete'] == null ? null : DeleteClientFeedbackClientFeedbackDelete.fromJson(json['clientFeedback_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteClientFeedbackData otherTyped = other as DeleteClientFeedbackData; + return clientFeedback_delete == otherTyped.clientFeedback_delete; + + } + @override + int get hashCode => clientFeedback_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (clientFeedback_delete != null) { + json['clientFeedback_delete'] = clientFeedback_delete!.toJson(); + } + return json; + } + + DeleteClientFeedbackData({ + this.clientFeedback_delete, + }); +} + +@immutable +class DeleteClientFeedbackVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteClientFeedbackVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteClientFeedbackVariables otherTyped = other as DeleteClientFeedbackVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteClientFeedbackVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_conversation.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_conversation.dart new file mode 100644 index 00000000..12302153 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_conversation.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteConversationVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteConversationVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteConversationData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteConversationVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteConversationVariables vars= DeleteConversationVariables(id: id,); + return _dataConnect.mutation("deleteConversation", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteConversationConversationDelete { + final String id; + DeleteConversationConversationDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteConversationConversationDelete otherTyped = other as DeleteConversationConversationDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteConversationConversationDelete({ + required this.id, + }); +} + +@immutable +class DeleteConversationData { + final DeleteConversationConversationDelete? conversation_delete; + DeleteConversationData.fromJson(dynamic json): + + conversation_delete = json['conversation_delete'] == null ? null : DeleteConversationConversationDelete.fromJson(json['conversation_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteConversationData otherTyped = other as DeleteConversationData; + return conversation_delete == otherTyped.conversation_delete; + + } + @override + int get hashCode => conversation_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (conversation_delete != null) { + json['conversation_delete'] = conversation_delete!.toJson(); + } + return json; + } + + DeleteConversationData({ + this.conversation_delete, + }); +} + +@immutable +class DeleteConversationVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteConversationVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteConversationVariables otherTyped = other as DeleteConversationVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteConversationVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_course.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_course.dart new file mode 100644 index 00000000..0be7dd56 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_course.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteCourseVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteCourseVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteCourseData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteCourseVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteCourseVariables vars= DeleteCourseVariables(id: id,); + return _dataConnect.mutation("deleteCourse", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteCourseCourseDelete { + final String id; + DeleteCourseCourseDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteCourseCourseDelete otherTyped = other as DeleteCourseCourseDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteCourseCourseDelete({ + required this.id, + }); +} + +@immutable +class DeleteCourseData { + final DeleteCourseCourseDelete? course_delete; + DeleteCourseData.fromJson(dynamic json): + + course_delete = json['course_delete'] == null ? null : DeleteCourseCourseDelete.fromJson(json['course_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteCourseData otherTyped = other as DeleteCourseData; + return course_delete == otherTyped.course_delete; + + } + @override + int get hashCode => course_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (course_delete != null) { + json['course_delete'] = course_delete!.toJson(); + } + return json; + } + + DeleteCourseData({ + this.course_delete, + }); +} + +@immutable +class DeleteCourseVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteCourseVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteCourseVariables otherTyped = other as DeleteCourseVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteCourseVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_custom_rate_card.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_custom_rate_card.dart new file mode 100644 index 00000000..04be409f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_custom_rate_card.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteCustomRateCardVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteCustomRateCardVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteCustomRateCardData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteCustomRateCardVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteCustomRateCardVariables vars= DeleteCustomRateCardVariables(id: id,); + return _dataConnect.mutation("deleteCustomRateCard", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteCustomRateCardCustomRateCardDelete { + final String id; + DeleteCustomRateCardCustomRateCardDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteCustomRateCardCustomRateCardDelete otherTyped = other as DeleteCustomRateCardCustomRateCardDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteCustomRateCardCustomRateCardDelete({ + required this.id, + }); +} + +@immutable +class DeleteCustomRateCardData { + final DeleteCustomRateCardCustomRateCardDelete? customRateCard_delete; + DeleteCustomRateCardData.fromJson(dynamic json): + + customRateCard_delete = json['customRateCard_delete'] == null ? null : DeleteCustomRateCardCustomRateCardDelete.fromJson(json['customRateCard_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteCustomRateCardData otherTyped = other as DeleteCustomRateCardData; + return customRateCard_delete == otherTyped.customRateCard_delete; + + } + @override + int get hashCode => customRateCard_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (customRateCard_delete != null) { + json['customRateCard_delete'] = customRateCard_delete!.toJson(); + } + return json; + } + + DeleteCustomRateCardData({ + this.customRateCard_delete, + }); +} + +@immutable +class DeleteCustomRateCardVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteCustomRateCardVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteCustomRateCardVariables otherTyped = other as DeleteCustomRateCardVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteCustomRateCardVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_document.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_document.dart new file mode 100644 index 00000000..087ef853 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_document.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteDocumentVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteDocumentVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteDocumentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteDocumentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteDocumentVariables vars= DeleteDocumentVariables(id: id,); + return _dataConnect.mutation("deleteDocument", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteDocumentDocumentDelete { + final String id; + DeleteDocumentDocumentDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteDocumentDocumentDelete otherTyped = other as DeleteDocumentDocumentDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteDocumentDocumentDelete({ + required this.id, + }); +} + +@immutable +class DeleteDocumentData { + final DeleteDocumentDocumentDelete? document_delete; + DeleteDocumentData.fromJson(dynamic json): + + document_delete = json['document_delete'] == null ? null : DeleteDocumentDocumentDelete.fromJson(json['document_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteDocumentData otherTyped = other as DeleteDocumentData; + return document_delete == otherTyped.document_delete; + + } + @override + int get hashCode => document_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (document_delete != null) { + json['document_delete'] = document_delete!.toJson(); + } + return json; + } + + DeleteDocumentData({ + this.document_delete, + }); +} + +@immutable +class DeleteDocumentVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteDocumentVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteDocumentVariables otherTyped = other as DeleteDocumentVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteDocumentVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_emergency_contact.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_emergency_contact.dart new file mode 100644 index 00000000..c663f30d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_emergency_contact.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteEmergencyContactVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteEmergencyContactVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteEmergencyContactData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteEmergencyContactVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteEmergencyContactVariables vars= DeleteEmergencyContactVariables(id: id,); + return _dataConnect.mutation("deleteEmergencyContact", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteEmergencyContactEmergencyContactDelete { + final String id; + DeleteEmergencyContactEmergencyContactDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteEmergencyContactEmergencyContactDelete otherTyped = other as DeleteEmergencyContactEmergencyContactDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteEmergencyContactEmergencyContactDelete({ + required this.id, + }); +} + +@immutable +class DeleteEmergencyContactData { + final DeleteEmergencyContactEmergencyContactDelete? emergencyContact_delete; + DeleteEmergencyContactData.fromJson(dynamic json): + + emergencyContact_delete = json['emergencyContact_delete'] == null ? null : DeleteEmergencyContactEmergencyContactDelete.fromJson(json['emergencyContact_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteEmergencyContactData otherTyped = other as DeleteEmergencyContactData; + return emergencyContact_delete == otherTyped.emergencyContact_delete; + + } + @override + int get hashCode => emergencyContact_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (emergencyContact_delete != null) { + json['emergencyContact_delete'] = emergencyContact_delete!.toJson(); + } + return json; + } + + DeleteEmergencyContactData({ + this.emergencyContact_delete, + }); +} + +@immutable +class DeleteEmergencyContactVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteEmergencyContactVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteEmergencyContactVariables otherTyped = other as DeleteEmergencyContactVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteEmergencyContactVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_faq_data.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_faq_data.dart new file mode 100644 index 00000000..d6889570 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_faq_data.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteFaqDataVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteFaqDataVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteFaqDataData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteFaqDataVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteFaqDataVariables vars= DeleteFaqDataVariables(id: id,); + return _dataConnect.mutation("deleteFaqData", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteFaqDataFaqDataDelete { + final String id; + DeleteFaqDataFaqDataDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteFaqDataFaqDataDelete otherTyped = other as DeleteFaqDataFaqDataDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteFaqDataFaqDataDelete({ + required this.id, + }); +} + +@immutable +class DeleteFaqDataData { + final DeleteFaqDataFaqDataDelete? faqData_delete; + DeleteFaqDataData.fromJson(dynamic json): + + faqData_delete = json['faqData_delete'] == null ? null : DeleteFaqDataFaqDataDelete.fromJson(json['faqData_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteFaqDataData otherTyped = other as DeleteFaqDataData; + return faqData_delete == otherTyped.faqData_delete; + + } + @override + int get hashCode => faqData_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (faqData_delete != null) { + json['faqData_delete'] = faqData_delete!.toJson(); + } + return json; + } + + DeleteFaqDataData({ + this.faqData_delete, + }); +} + +@immutable +class DeleteFaqDataVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteFaqDataVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteFaqDataVariables otherTyped = other as DeleteFaqDataVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteFaqDataVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_hub.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_hub.dart new file mode 100644 index 00000000..fc85f8b8 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_hub.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteHubVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteHubVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteHubData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteHubVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteHubVariables vars= DeleteHubVariables(id: id,); + return _dataConnect.mutation("deleteHub", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteHubHubDelete { + final String id; + DeleteHubHubDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteHubHubDelete otherTyped = other as DeleteHubHubDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteHubHubDelete({ + required this.id, + }); +} + +@immutable +class DeleteHubData { + final DeleteHubHubDelete? hub_delete; + DeleteHubData.fromJson(dynamic json): + + hub_delete = json['hub_delete'] == null ? null : DeleteHubHubDelete.fromJson(json['hub_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteHubData otherTyped = other as DeleteHubData; + return hub_delete == otherTyped.hub_delete; + + } + @override + int get hashCode => hub_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (hub_delete != null) { + json['hub_delete'] = hub_delete!.toJson(); + } + return json; + } + + DeleteHubData({ + this.hub_delete, + }); +} + +@immutable +class DeleteHubVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteHubVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteHubVariables otherTyped = other as DeleteHubVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteHubVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_invoice.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_invoice.dart new file mode 100644 index 00000000..515f4bfb --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_invoice.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteInvoiceVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteInvoiceVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteInvoiceData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteInvoiceVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteInvoiceVariables vars= DeleteInvoiceVariables(id: id,); + return _dataConnect.mutation("deleteInvoice", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteInvoiceInvoiceDelete { + final String id; + DeleteInvoiceInvoiceDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteInvoiceInvoiceDelete otherTyped = other as DeleteInvoiceInvoiceDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteInvoiceInvoiceDelete({ + required this.id, + }); +} + +@immutable +class DeleteInvoiceData { + final DeleteInvoiceInvoiceDelete? invoice_delete; + DeleteInvoiceData.fromJson(dynamic json): + + invoice_delete = json['invoice_delete'] == null ? null : DeleteInvoiceInvoiceDelete.fromJson(json['invoice_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteInvoiceData otherTyped = other as DeleteInvoiceData; + return invoice_delete == otherTyped.invoice_delete; + + } + @override + int get hashCode => invoice_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (invoice_delete != null) { + json['invoice_delete'] = invoice_delete!.toJson(); + } + return json; + } + + DeleteInvoiceData({ + this.invoice_delete, + }); +} + +@immutable +class DeleteInvoiceVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteInvoiceVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteInvoiceVariables otherTyped = other as DeleteInvoiceVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteInvoiceVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_invoice_template.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_invoice_template.dart new file mode 100644 index 00000000..2239ee3a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_invoice_template.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteInvoiceTemplateVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteInvoiceTemplateVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteInvoiceTemplateData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteInvoiceTemplateVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteInvoiceTemplateVariables vars= DeleteInvoiceTemplateVariables(id: id,); + return _dataConnect.mutation("deleteInvoiceTemplate", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteInvoiceTemplateInvoiceTemplateDelete { + final String id; + DeleteInvoiceTemplateInvoiceTemplateDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteInvoiceTemplateInvoiceTemplateDelete otherTyped = other as DeleteInvoiceTemplateInvoiceTemplateDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteInvoiceTemplateInvoiceTemplateDelete({ + required this.id, + }); +} + +@immutable +class DeleteInvoiceTemplateData { + final DeleteInvoiceTemplateInvoiceTemplateDelete? invoiceTemplate_delete; + DeleteInvoiceTemplateData.fromJson(dynamic json): + + invoiceTemplate_delete = json['invoiceTemplate_delete'] == null ? null : DeleteInvoiceTemplateInvoiceTemplateDelete.fromJson(json['invoiceTemplate_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteInvoiceTemplateData otherTyped = other as DeleteInvoiceTemplateData; + return invoiceTemplate_delete == otherTyped.invoiceTemplate_delete; + + } + @override + int get hashCode => invoiceTemplate_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (invoiceTemplate_delete != null) { + json['invoiceTemplate_delete'] = invoiceTemplate_delete!.toJson(); + } + return json; + } + + DeleteInvoiceTemplateData({ + this.invoiceTemplate_delete, + }); +} + +@immutable +class DeleteInvoiceTemplateVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteInvoiceTemplateVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteInvoiceTemplateVariables otherTyped = other as DeleteInvoiceTemplateVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteInvoiceTemplateVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_level.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_level.dart new file mode 100644 index 00000000..9f06598c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_level.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteLevelVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteLevelVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteLevelData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteLevelVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteLevelVariables vars= DeleteLevelVariables(id: id,); + return _dataConnect.mutation("deleteLevel", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteLevelLevelDelete { + final String id; + DeleteLevelLevelDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteLevelLevelDelete otherTyped = other as DeleteLevelLevelDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteLevelLevelDelete({ + required this.id, + }); +} + +@immutable +class DeleteLevelData { + final DeleteLevelLevelDelete? level_delete; + DeleteLevelData.fromJson(dynamic json): + + level_delete = json['level_delete'] == null ? null : DeleteLevelLevelDelete.fromJson(json['level_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteLevelData otherTyped = other as DeleteLevelData; + return level_delete == otherTyped.level_delete; + + } + @override + int get hashCode => level_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (level_delete != null) { + json['level_delete'] = level_delete!.toJson(); + } + return json; + } + + DeleteLevelData({ + this.level_delete, + }); +} + +@immutable +class DeleteLevelVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteLevelVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteLevelVariables otherTyped = other as DeleteLevelVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteLevelVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_member_task.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_member_task.dart new file mode 100644 index 00000000..addc7c94 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_member_task.dart @@ -0,0 +1,135 @@ +part of 'generated.dart'; + +class DeleteMemberTaskVariablesBuilder { + String teamMemberId; + String taskId; + + final FirebaseDataConnect _dataConnect; + DeleteMemberTaskVariablesBuilder(this._dataConnect, {required this.teamMemberId,required this.taskId,}); + Deserializer dataDeserializer = (dynamic json) => DeleteMemberTaskData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteMemberTaskVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteMemberTaskVariables vars= DeleteMemberTaskVariables(teamMemberId: teamMemberId,taskId: taskId,); + return _dataConnect.mutation("deleteMemberTask", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteMemberTaskMemberTaskDelete { + final String teamMemberId; + final String taskId; + DeleteMemberTaskMemberTaskDelete.fromJson(dynamic json): + + teamMemberId = nativeFromJson(json['teamMemberId']), + taskId = nativeFromJson(json['taskId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteMemberTaskMemberTaskDelete otherTyped = other as DeleteMemberTaskMemberTaskDelete; + return teamMemberId == otherTyped.teamMemberId && + taskId == otherTyped.taskId; + + } + @override + int get hashCode => Object.hashAll([teamMemberId.hashCode, taskId.hashCode]); + + + Map toJson() { + Map json = {}; + json['teamMemberId'] = nativeToJson(teamMemberId); + json['taskId'] = nativeToJson(taskId); + return json; + } + + DeleteMemberTaskMemberTaskDelete({ + required this.teamMemberId, + required this.taskId, + }); +} + +@immutable +class DeleteMemberTaskData { + final DeleteMemberTaskMemberTaskDelete? memberTask_delete; + DeleteMemberTaskData.fromJson(dynamic json): + + memberTask_delete = json['memberTask_delete'] == null ? null : DeleteMemberTaskMemberTaskDelete.fromJson(json['memberTask_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteMemberTaskData otherTyped = other as DeleteMemberTaskData; + return memberTask_delete == otherTyped.memberTask_delete; + + } + @override + int get hashCode => memberTask_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (memberTask_delete != null) { + json['memberTask_delete'] = memberTask_delete!.toJson(); + } + return json; + } + + DeleteMemberTaskData({ + this.memberTask_delete, + }); +} + +@immutable +class DeleteMemberTaskVariables { + final String teamMemberId; + final String taskId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteMemberTaskVariables.fromJson(Map json): + + teamMemberId = nativeFromJson(json['teamMemberId']), + taskId = nativeFromJson(json['taskId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteMemberTaskVariables otherTyped = other as DeleteMemberTaskVariables; + return teamMemberId == otherTyped.teamMemberId && + taskId == otherTyped.taskId; + + } + @override + int get hashCode => Object.hashAll([teamMemberId.hashCode, taskId.hashCode]); + + + Map toJson() { + Map json = {}; + json['teamMemberId'] = nativeToJson(teamMemberId); + json['taskId'] = nativeToJson(taskId); + return json; + } + + DeleteMemberTaskVariables({ + required this.teamMemberId, + required this.taskId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_message.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_message.dart new file mode 100644 index 00000000..f1b1921a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_message.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteMessageVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteMessageVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteMessageData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteMessageVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteMessageVariables vars= DeleteMessageVariables(id: id,); + return _dataConnect.mutation("deleteMessage", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteMessageMessageDelete { + final String id; + DeleteMessageMessageDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteMessageMessageDelete otherTyped = other as DeleteMessageMessageDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteMessageMessageDelete({ + required this.id, + }); +} + +@immutable +class DeleteMessageData { + final DeleteMessageMessageDelete? message_delete; + DeleteMessageData.fromJson(dynamic json): + + message_delete = json['message_delete'] == null ? null : DeleteMessageMessageDelete.fromJson(json['message_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteMessageData otherTyped = other as DeleteMessageData; + return message_delete == otherTyped.message_delete; + + } + @override + int get hashCode => message_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (message_delete != null) { + json['message_delete'] = message_delete!.toJson(); + } + return json; + } + + DeleteMessageData({ + this.message_delete, + }); +} + +@immutable +class DeleteMessageVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteMessageVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteMessageVariables otherTyped = other as DeleteMessageVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteMessageVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_order.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_order.dart new file mode 100644 index 00000000..f722da3d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_order.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteOrderVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteOrderVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteOrderData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteOrderVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteOrderVariables vars= DeleteOrderVariables(id: id,); + return _dataConnect.mutation("deleteOrder", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteOrderOrderDelete { + final String id; + DeleteOrderOrderDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteOrderOrderDelete otherTyped = other as DeleteOrderOrderDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteOrderOrderDelete({ + required this.id, + }); +} + +@immutable +class DeleteOrderData { + final DeleteOrderOrderDelete? order_delete; + DeleteOrderData.fromJson(dynamic json): + + order_delete = json['order_delete'] == null ? null : DeleteOrderOrderDelete.fromJson(json['order_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteOrderData otherTyped = other as DeleteOrderData; + return order_delete == otherTyped.order_delete; + + } + @override + int get hashCode => order_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (order_delete != null) { + json['order_delete'] = order_delete!.toJson(); + } + return json; + } + + DeleteOrderData({ + this.order_delete, + }); +} + +@immutable +class DeleteOrderVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteOrderVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteOrderVariables otherTyped = other as DeleteOrderVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteOrderVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_recent_payment.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_recent_payment.dart new file mode 100644 index 00000000..a4ff5b61 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_recent_payment.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteRecentPaymentVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteRecentPaymentVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteRecentPaymentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteRecentPaymentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteRecentPaymentVariables vars= DeleteRecentPaymentVariables(id: id,); + return _dataConnect.mutation("deleteRecentPayment", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteRecentPaymentRecentPaymentDelete { + final String id; + DeleteRecentPaymentRecentPaymentDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteRecentPaymentRecentPaymentDelete otherTyped = other as DeleteRecentPaymentRecentPaymentDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteRecentPaymentRecentPaymentDelete({ + required this.id, + }); +} + +@immutable +class DeleteRecentPaymentData { + final DeleteRecentPaymentRecentPaymentDelete? recentPayment_delete; + DeleteRecentPaymentData.fromJson(dynamic json): + + recentPayment_delete = json['recentPayment_delete'] == null ? null : DeleteRecentPaymentRecentPaymentDelete.fromJson(json['recentPayment_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteRecentPaymentData otherTyped = other as DeleteRecentPaymentData; + return recentPayment_delete == otherTyped.recentPayment_delete; + + } + @override + int get hashCode => recentPayment_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (recentPayment_delete != null) { + json['recentPayment_delete'] = recentPayment_delete!.toJson(); + } + return json; + } + + DeleteRecentPaymentData({ + this.recentPayment_delete, + }); +} + +@immutable +class DeleteRecentPaymentVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteRecentPaymentVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteRecentPaymentVariables otherTyped = other as DeleteRecentPaymentVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteRecentPaymentVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_role.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_role.dart new file mode 100644 index 00000000..50fdecf0 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_role.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteRoleVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteRoleVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteRoleData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteRoleVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteRoleVariables vars= DeleteRoleVariables(id: id,); + return _dataConnect.mutation("deleteRole", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteRoleRoleDelete { + final String id; + DeleteRoleRoleDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteRoleRoleDelete otherTyped = other as DeleteRoleRoleDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteRoleRoleDelete({ + required this.id, + }); +} + +@immutable +class DeleteRoleData { + final DeleteRoleRoleDelete? role_delete; + DeleteRoleData.fromJson(dynamic json): + + role_delete = json['role_delete'] == null ? null : DeleteRoleRoleDelete.fromJson(json['role_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteRoleData otherTyped = other as DeleteRoleData; + return role_delete == otherTyped.role_delete; + + } + @override + int get hashCode => role_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (role_delete != null) { + json['role_delete'] = role_delete!.toJson(); + } + return json; + } + + DeleteRoleData({ + this.role_delete, + }); +} + +@immutable +class DeleteRoleVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteRoleVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteRoleVariables otherTyped = other as DeleteRoleVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteRoleVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_role_category.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_role_category.dart new file mode 100644 index 00000000..2e9e3a05 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_role_category.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteRoleCategoryVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteRoleCategoryVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteRoleCategoryData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteRoleCategoryVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteRoleCategoryVariables vars= DeleteRoleCategoryVariables(id: id,); + return _dataConnect.mutation("deleteRoleCategory", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteRoleCategoryRoleCategoryDelete { + final String id; + DeleteRoleCategoryRoleCategoryDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteRoleCategoryRoleCategoryDelete otherTyped = other as DeleteRoleCategoryRoleCategoryDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteRoleCategoryRoleCategoryDelete({ + required this.id, + }); +} + +@immutable +class DeleteRoleCategoryData { + final DeleteRoleCategoryRoleCategoryDelete? roleCategory_delete; + DeleteRoleCategoryData.fromJson(dynamic json): + + roleCategory_delete = json['roleCategory_delete'] == null ? null : DeleteRoleCategoryRoleCategoryDelete.fromJson(json['roleCategory_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteRoleCategoryData otherTyped = other as DeleteRoleCategoryData; + return roleCategory_delete == otherTyped.roleCategory_delete; + + } + @override + int get hashCode => roleCategory_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (roleCategory_delete != null) { + json['roleCategory_delete'] = roleCategory_delete!.toJson(); + } + return json; + } + + DeleteRoleCategoryData({ + this.roleCategory_delete, + }); +} + +@immutable +class DeleteRoleCategoryVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteRoleCategoryVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteRoleCategoryVariables otherTyped = other as DeleteRoleCategoryVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteRoleCategoryVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_shift.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_shift.dart new file mode 100644 index 00000000..1f224bd1 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_shift.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteShiftVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteShiftVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteShiftData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteShiftVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteShiftVariables vars= DeleteShiftVariables(id: id,); + return _dataConnect.mutation("deleteShift", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteShiftShiftDelete { + final String id; + DeleteShiftShiftDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteShiftShiftDelete otherTyped = other as DeleteShiftShiftDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteShiftShiftDelete({ + required this.id, + }); +} + +@immutable +class DeleteShiftData { + final DeleteShiftShiftDelete? shift_delete; + DeleteShiftData.fromJson(dynamic json): + + shift_delete = json['shift_delete'] == null ? null : DeleteShiftShiftDelete.fromJson(json['shift_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteShiftData otherTyped = other as DeleteShiftData; + return shift_delete == otherTyped.shift_delete; + + } + @override + int get hashCode => shift_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (shift_delete != null) { + json['shift_delete'] = shift_delete!.toJson(); + } + return json; + } + + DeleteShiftData({ + this.shift_delete, + }); +} + +@immutable +class DeleteShiftVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteShiftVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteShiftVariables otherTyped = other as DeleteShiftVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteShiftVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_shift_role.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_shift_role.dart new file mode 100644 index 00000000..db0debf6 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_shift_role.dart @@ -0,0 +1,135 @@ +part of 'generated.dart'; + +class DeleteShiftRoleVariablesBuilder { + String shiftId; + String roleId; + + final FirebaseDataConnect _dataConnect; + DeleteShiftRoleVariablesBuilder(this._dataConnect, {required this.shiftId,required this.roleId,}); + Deserializer dataDeserializer = (dynamic json) => DeleteShiftRoleData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteShiftRoleVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteShiftRoleVariables vars= DeleteShiftRoleVariables(shiftId: shiftId,roleId: roleId,); + return _dataConnect.mutation("deleteShiftRole", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteShiftRoleShiftRoleDelete { + final String shiftId; + final String roleId; + DeleteShiftRoleShiftRoleDelete.fromJson(dynamic json): + + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteShiftRoleShiftRoleDelete otherTyped = other as DeleteShiftRoleShiftRoleDelete; + return shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + return json; + } + + DeleteShiftRoleShiftRoleDelete({ + required this.shiftId, + required this.roleId, + }); +} + +@immutable +class DeleteShiftRoleData { + final DeleteShiftRoleShiftRoleDelete? shiftRole_delete; + DeleteShiftRoleData.fromJson(dynamic json): + + shiftRole_delete = json['shiftRole_delete'] == null ? null : DeleteShiftRoleShiftRoleDelete.fromJson(json['shiftRole_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteShiftRoleData otherTyped = other as DeleteShiftRoleData; + return shiftRole_delete == otherTyped.shiftRole_delete; + + } + @override + int get hashCode => shiftRole_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (shiftRole_delete != null) { + json['shiftRole_delete'] = shiftRole_delete!.toJson(); + } + return json; + } + + DeleteShiftRoleData({ + this.shiftRole_delete, + }); +} + +@immutable +class DeleteShiftRoleVariables { + final String shiftId; + final String roleId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteShiftRoleVariables.fromJson(Map json): + + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteShiftRoleVariables otherTyped = other as DeleteShiftRoleVariables; + return shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + return json; + } + + DeleteShiftRoleVariables({ + required this.shiftId, + required this.roleId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff.dart new file mode 100644 index 00000000..dd23b035 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteStaffVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteStaffVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteStaffData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteStaffVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteStaffVariables vars= DeleteStaffVariables(id: id,); + return _dataConnect.mutation("DeleteStaff", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteStaffStaffDelete { + final String id; + DeleteStaffStaffDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffStaffDelete otherTyped = other as DeleteStaffStaffDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteStaffStaffDelete({ + required this.id, + }); +} + +@immutable +class DeleteStaffData { + final DeleteStaffStaffDelete? staff_delete; + DeleteStaffData.fromJson(dynamic json): + + staff_delete = json['staff_delete'] == null ? null : DeleteStaffStaffDelete.fromJson(json['staff_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffData otherTyped = other as DeleteStaffData; + return staff_delete == otherTyped.staff_delete; + + } + @override + int get hashCode => staff_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (staff_delete != null) { + json['staff_delete'] = staff_delete!.toJson(); + } + return json; + } + + DeleteStaffData({ + this.staff_delete, + }); +} + +@immutable +class DeleteStaffVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteStaffVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffVariables otherTyped = other as DeleteStaffVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteStaffVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_availability.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_availability.dart new file mode 100644 index 00000000..1f6e4bd4 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_availability.dart @@ -0,0 +1,154 @@ +part of 'generated.dart'; + +class DeleteStaffAvailabilityVariablesBuilder { + String staffId; + DayOfWeek day; + AvailabilitySlot slot; + + final FirebaseDataConnect _dataConnect; + DeleteStaffAvailabilityVariablesBuilder(this._dataConnect, {required this.staffId,required this.day,required this.slot,}); + Deserializer dataDeserializer = (dynamic json) => DeleteStaffAvailabilityData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteStaffAvailabilityVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteStaffAvailabilityVariables vars= DeleteStaffAvailabilityVariables(staffId: staffId,day: day,slot: slot,); + return _dataConnect.mutation("deleteStaffAvailability", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteStaffAvailabilityStaffAvailabilityDelete { + final String staffId; + final EnumValue day; + final EnumValue slot; + DeleteStaffAvailabilityStaffAvailabilityDelete.fromJson(dynamic json): + + staffId = nativeFromJson(json['staffId']), + day = dayOfWeekDeserializer(json['day']), + slot = availabilitySlotDeserializer(json['slot']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffAvailabilityStaffAvailabilityDelete otherTyped = other as DeleteStaffAvailabilityStaffAvailabilityDelete; + return staffId == otherTyped.staffId && + day == otherTyped.day && + slot == otherTyped.slot; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, day.hashCode, slot.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['day'] = + dayOfWeekSerializer(day) + ; + json['slot'] = + availabilitySlotSerializer(slot) + ; + return json; + } + + DeleteStaffAvailabilityStaffAvailabilityDelete({ + required this.staffId, + required this.day, + required this.slot, + }); +} + +@immutable +class DeleteStaffAvailabilityData { + final DeleteStaffAvailabilityStaffAvailabilityDelete? staffAvailability_delete; + DeleteStaffAvailabilityData.fromJson(dynamic json): + + staffAvailability_delete = json['staffAvailability_delete'] == null ? null : DeleteStaffAvailabilityStaffAvailabilityDelete.fromJson(json['staffAvailability_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffAvailabilityData otherTyped = other as DeleteStaffAvailabilityData; + return staffAvailability_delete == otherTyped.staffAvailability_delete; + + } + @override + int get hashCode => staffAvailability_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (staffAvailability_delete != null) { + json['staffAvailability_delete'] = staffAvailability_delete!.toJson(); + } + return json; + } + + DeleteStaffAvailabilityData({ + this.staffAvailability_delete, + }); +} + +@immutable +class DeleteStaffAvailabilityVariables { + final String staffId; + final DayOfWeek day; + final AvailabilitySlot slot; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteStaffAvailabilityVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + day = DayOfWeek.values.byName(json['day']), + slot = AvailabilitySlot.values.byName(json['slot']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffAvailabilityVariables otherTyped = other as DeleteStaffAvailabilityVariables; + return staffId == otherTyped.staffId && + day == otherTyped.day && + slot == otherTyped.slot; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, day.hashCode, slot.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['day'] = + day.name + ; + json['slot'] = + slot.name + ; + return json; + } + + DeleteStaffAvailabilityVariables({ + required this.staffId, + required this.day, + required this.slot, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_availability_stats.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_availability_stats.dart new file mode 100644 index 00000000..07670c1b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_availability_stats.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteStaffAvailabilityStatsVariablesBuilder { + String staffId; + + final FirebaseDataConnect _dataConnect; + DeleteStaffAvailabilityStatsVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => DeleteStaffAvailabilityStatsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteStaffAvailabilityStatsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteStaffAvailabilityStatsVariables vars= DeleteStaffAvailabilityStatsVariables(staffId: staffId,); + return _dataConnect.mutation("deleteStaffAvailabilityStats", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteStaffAvailabilityStatsStaffAvailabilityStatsDelete { + final String staffId; + DeleteStaffAvailabilityStatsStaffAvailabilityStatsDelete.fromJson(dynamic json): + + staffId = nativeFromJson(json['staffId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffAvailabilityStatsStaffAvailabilityStatsDelete otherTyped = other as DeleteStaffAvailabilityStatsStaffAvailabilityStatsDelete; + return staffId == otherTyped.staffId; + + } + @override + int get hashCode => staffId.hashCode; + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + return json; + } + + DeleteStaffAvailabilityStatsStaffAvailabilityStatsDelete({ + required this.staffId, + }); +} + +@immutable +class DeleteStaffAvailabilityStatsData { + final DeleteStaffAvailabilityStatsStaffAvailabilityStatsDelete? staffAvailabilityStats_delete; + DeleteStaffAvailabilityStatsData.fromJson(dynamic json): + + staffAvailabilityStats_delete = json['staffAvailabilityStats_delete'] == null ? null : DeleteStaffAvailabilityStatsStaffAvailabilityStatsDelete.fromJson(json['staffAvailabilityStats_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffAvailabilityStatsData otherTyped = other as DeleteStaffAvailabilityStatsData; + return staffAvailabilityStats_delete == otherTyped.staffAvailabilityStats_delete; + + } + @override + int get hashCode => staffAvailabilityStats_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (staffAvailabilityStats_delete != null) { + json['staffAvailabilityStats_delete'] = staffAvailabilityStats_delete!.toJson(); + } + return json; + } + + DeleteStaffAvailabilityStatsData({ + this.staffAvailabilityStats_delete, + }); +} + +@immutable +class DeleteStaffAvailabilityStatsVariables { + final String staffId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteStaffAvailabilityStatsVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffAvailabilityStatsVariables otherTyped = other as DeleteStaffAvailabilityStatsVariables; + return staffId == otherTyped.staffId; + + } + @override + int get hashCode => staffId.hashCode; + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + return json; + } + + DeleteStaffAvailabilityStatsVariables({ + required this.staffId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_course.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_course.dart new file mode 100644 index 00000000..bfc5814c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_course.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteStaffCourseVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteStaffCourseVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteStaffCourseData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteStaffCourseVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteStaffCourseVariables vars= DeleteStaffCourseVariables(id: id,); + return _dataConnect.mutation("deleteStaffCourse", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteStaffCourseStaffCourseDelete { + final String id; + DeleteStaffCourseStaffCourseDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffCourseStaffCourseDelete otherTyped = other as DeleteStaffCourseStaffCourseDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteStaffCourseStaffCourseDelete({ + required this.id, + }); +} + +@immutable +class DeleteStaffCourseData { + final DeleteStaffCourseStaffCourseDelete? staffCourse_delete; + DeleteStaffCourseData.fromJson(dynamic json): + + staffCourse_delete = json['staffCourse_delete'] == null ? null : DeleteStaffCourseStaffCourseDelete.fromJson(json['staffCourse_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffCourseData otherTyped = other as DeleteStaffCourseData; + return staffCourse_delete == otherTyped.staffCourse_delete; + + } + @override + int get hashCode => staffCourse_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (staffCourse_delete != null) { + json['staffCourse_delete'] = staffCourse_delete!.toJson(); + } + return json; + } + + DeleteStaffCourseData({ + this.staffCourse_delete, + }); +} + +@immutable +class DeleteStaffCourseVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteStaffCourseVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffCourseVariables otherTyped = other as DeleteStaffCourseVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteStaffCourseVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_document.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_document.dart new file mode 100644 index 00000000..aa0d603c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_document.dart @@ -0,0 +1,135 @@ +part of 'generated.dart'; + +class DeleteStaffDocumentVariablesBuilder { + String staffId; + String documentId; + + final FirebaseDataConnect _dataConnect; + DeleteStaffDocumentVariablesBuilder(this._dataConnect, {required this.staffId,required this.documentId,}); + Deserializer dataDeserializer = (dynamic json) => DeleteStaffDocumentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteStaffDocumentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteStaffDocumentVariables vars= DeleteStaffDocumentVariables(staffId: staffId,documentId: documentId,); + return _dataConnect.mutation("deleteStaffDocument", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteStaffDocumentStaffDocumentDelete { + final String staffId; + final String documentId; + DeleteStaffDocumentStaffDocumentDelete.fromJson(dynamic json): + + staffId = nativeFromJson(json['staffId']), + documentId = nativeFromJson(json['documentId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffDocumentStaffDocumentDelete otherTyped = other as DeleteStaffDocumentStaffDocumentDelete; + return staffId == otherTyped.staffId && + documentId == otherTyped.documentId; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, documentId.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['documentId'] = nativeToJson(documentId); + return json; + } + + DeleteStaffDocumentStaffDocumentDelete({ + required this.staffId, + required this.documentId, + }); +} + +@immutable +class DeleteStaffDocumentData { + final DeleteStaffDocumentStaffDocumentDelete? staffDocument_delete; + DeleteStaffDocumentData.fromJson(dynamic json): + + staffDocument_delete = json['staffDocument_delete'] == null ? null : DeleteStaffDocumentStaffDocumentDelete.fromJson(json['staffDocument_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffDocumentData otherTyped = other as DeleteStaffDocumentData; + return staffDocument_delete == otherTyped.staffDocument_delete; + + } + @override + int get hashCode => staffDocument_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (staffDocument_delete != null) { + json['staffDocument_delete'] = staffDocument_delete!.toJson(); + } + return json; + } + + DeleteStaffDocumentData({ + this.staffDocument_delete, + }); +} + +@immutable +class DeleteStaffDocumentVariables { + final String staffId; + final String documentId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteStaffDocumentVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + documentId = nativeFromJson(json['documentId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffDocumentVariables otherTyped = other as DeleteStaffDocumentVariables; + return staffId == otherTyped.staffId && + documentId == otherTyped.documentId; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, documentId.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['documentId'] = nativeToJson(documentId); + return json; + } + + DeleteStaffDocumentVariables({ + required this.staffId, + required this.documentId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_role.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_role.dart new file mode 100644 index 00000000..982ba03d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_staff_role.dart @@ -0,0 +1,135 @@ +part of 'generated.dart'; + +class DeleteStaffRoleVariablesBuilder { + String staffId; + String roleId; + + final FirebaseDataConnect _dataConnect; + DeleteStaffRoleVariablesBuilder(this._dataConnect, {required this.staffId,required this.roleId,}); + Deserializer dataDeserializer = (dynamic json) => DeleteStaffRoleData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteStaffRoleVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteStaffRoleVariables vars= DeleteStaffRoleVariables(staffId: staffId,roleId: roleId,); + return _dataConnect.mutation("deleteStaffRole", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteStaffRoleStaffRoleDelete { + final String staffId; + final String roleId; + DeleteStaffRoleStaffRoleDelete.fromJson(dynamic json): + + staffId = nativeFromJson(json['staffId']), + roleId = nativeFromJson(json['roleId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffRoleStaffRoleDelete otherTyped = other as DeleteStaffRoleStaffRoleDelete; + return staffId == otherTyped.staffId && + roleId == otherTyped.roleId; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, roleId.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['roleId'] = nativeToJson(roleId); + return json; + } + + DeleteStaffRoleStaffRoleDelete({ + required this.staffId, + required this.roleId, + }); +} + +@immutable +class DeleteStaffRoleData { + final DeleteStaffRoleStaffRoleDelete? staffRole_delete; + DeleteStaffRoleData.fromJson(dynamic json): + + staffRole_delete = json['staffRole_delete'] == null ? null : DeleteStaffRoleStaffRoleDelete.fromJson(json['staffRole_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffRoleData otherTyped = other as DeleteStaffRoleData; + return staffRole_delete == otherTyped.staffRole_delete; + + } + @override + int get hashCode => staffRole_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (staffRole_delete != null) { + json['staffRole_delete'] = staffRole_delete!.toJson(); + } + return json; + } + + DeleteStaffRoleData({ + this.staffRole_delete, + }); +} + +@immutable +class DeleteStaffRoleVariables { + final String staffId; + final String roleId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteStaffRoleVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + roleId = nativeFromJson(json['roleId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteStaffRoleVariables otherTyped = other as DeleteStaffRoleVariables; + return staffId == otherTyped.staffId && + roleId == otherTyped.roleId; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, roleId.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['roleId'] = nativeToJson(roleId); + return json; + } + + DeleteStaffRoleVariables({ + required this.staffId, + required this.roleId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_task.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_task.dart new file mode 100644 index 00000000..db5384e2 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_task.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteTaskVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteTaskVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteTaskData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteTaskVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteTaskVariables vars= DeleteTaskVariables(id: id,); + return _dataConnect.mutation("deleteTask", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteTaskTaskDelete { + final String id; + DeleteTaskTaskDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTaskTaskDelete otherTyped = other as DeleteTaskTaskDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteTaskTaskDelete({ + required this.id, + }); +} + +@immutable +class DeleteTaskData { + final DeleteTaskTaskDelete? task_delete; + DeleteTaskData.fromJson(dynamic json): + + task_delete = json['task_delete'] == null ? null : DeleteTaskTaskDelete.fromJson(json['task_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTaskData otherTyped = other as DeleteTaskData; + return task_delete == otherTyped.task_delete; + + } + @override + int get hashCode => task_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (task_delete != null) { + json['task_delete'] = task_delete!.toJson(); + } + return json; + } + + DeleteTaskData({ + this.task_delete, + }); +} + +@immutable +class DeleteTaskVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteTaskVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTaskVariables otherTyped = other as DeleteTaskVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteTaskVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_task_comment.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_task_comment.dart new file mode 100644 index 00000000..db31a5e8 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_task_comment.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteTaskCommentVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteTaskCommentVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteTaskCommentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteTaskCommentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteTaskCommentVariables vars= DeleteTaskCommentVariables(id: id,); + return _dataConnect.mutation("deleteTaskComment", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteTaskCommentTaskCommentDelete { + final String id; + DeleteTaskCommentTaskCommentDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTaskCommentTaskCommentDelete otherTyped = other as DeleteTaskCommentTaskCommentDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteTaskCommentTaskCommentDelete({ + required this.id, + }); +} + +@immutable +class DeleteTaskCommentData { + final DeleteTaskCommentTaskCommentDelete? taskComment_delete; + DeleteTaskCommentData.fromJson(dynamic json): + + taskComment_delete = json['taskComment_delete'] == null ? null : DeleteTaskCommentTaskCommentDelete.fromJson(json['taskComment_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTaskCommentData otherTyped = other as DeleteTaskCommentData; + return taskComment_delete == otherTyped.taskComment_delete; + + } + @override + int get hashCode => taskComment_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (taskComment_delete != null) { + json['taskComment_delete'] = taskComment_delete!.toJson(); + } + return json; + } + + DeleteTaskCommentData({ + this.taskComment_delete, + }); +} + +@immutable +class DeleteTaskCommentVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteTaskCommentVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTaskCommentVariables otherTyped = other as DeleteTaskCommentVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteTaskCommentVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_tax_form.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_tax_form.dart new file mode 100644 index 00000000..20511558 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_tax_form.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteTaxFormVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteTaxFormVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteTaxFormData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteTaxFormVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteTaxFormVariables vars= DeleteTaxFormVariables(id: id,); + return _dataConnect.mutation("deleteTaxForm", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteTaxFormTaxFormDelete { + final String id; + DeleteTaxFormTaxFormDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTaxFormTaxFormDelete otherTyped = other as DeleteTaxFormTaxFormDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteTaxFormTaxFormDelete({ + required this.id, + }); +} + +@immutable +class DeleteTaxFormData { + final DeleteTaxFormTaxFormDelete? taxForm_delete; + DeleteTaxFormData.fromJson(dynamic json): + + taxForm_delete = json['taxForm_delete'] == null ? null : DeleteTaxFormTaxFormDelete.fromJson(json['taxForm_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTaxFormData otherTyped = other as DeleteTaxFormData; + return taxForm_delete == otherTyped.taxForm_delete; + + } + @override + int get hashCode => taxForm_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (taxForm_delete != null) { + json['taxForm_delete'] = taxForm_delete!.toJson(); + } + return json; + } + + DeleteTaxFormData({ + this.taxForm_delete, + }); +} + +@immutable +class DeleteTaxFormVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteTaxFormVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTaxFormVariables otherTyped = other as DeleteTaxFormVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteTaxFormVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_team.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_team.dart new file mode 100644 index 00000000..a1b09e5a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_team.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteTeamVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteTeamVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteTeamData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteTeamVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteTeamVariables vars= DeleteTeamVariables(id: id,); + return _dataConnect.mutation("deleteTeam", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteTeamTeamDelete { + final String id; + DeleteTeamTeamDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTeamTeamDelete otherTyped = other as DeleteTeamTeamDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteTeamTeamDelete({ + required this.id, + }); +} + +@immutable +class DeleteTeamData { + final DeleteTeamTeamDelete? team_delete; + DeleteTeamData.fromJson(dynamic json): + + team_delete = json['team_delete'] == null ? null : DeleteTeamTeamDelete.fromJson(json['team_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTeamData otherTyped = other as DeleteTeamData; + return team_delete == otherTyped.team_delete; + + } + @override + int get hashCode => team_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (team_delete != null) { + json['team_delete'] = team_delete!.toJson(); + } + return json; + } + + DeleteTeamData({ + this.team_delete, + }); +} + +@immutable +class DeleteTeamVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteTeamVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTeamVariables otherTyped = other as DeleteTeamVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteTeamVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_team_hub.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_team_hub.dart new file mode 100644 index 00000000..bb91671a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_team_hub.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteTeamHubVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteTeamHubVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteTeamHubData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteTeamHubVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteTeamHubVariables vars= DeleteTeamHubVariables(id: id,); + return _dataConnect.mutation("deleteTeamHub", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteTeamHubTeamHubDelete { + final String id; + DeleteTeamHubTeamHubDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTeamHubTeamHubDelete otherTyped = other as DeleteTeamHubTeamHubDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteTeamHubTeamHubDelete({ + required this.id, + }); +} + +@immutable +class DeleteTeamHubData { + final DeleteTeamHubTeamHubDelete? teamHub_delete; + DeleteTeamHubData.fromJson(dynamic json): + + teamHub_delete = json['teamHub_delete'] == null ? null : DeleteTeamHubTeamHubDelete.fromJson(json['teamHub_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTeamHubData otherTyped = other as DeleteTeamHubData; + return teamHub_delete == otherTyped.teamHub_delete; + + } + @override + int get hashCode => teamHub_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (teamHub_delete != null) { + json['teamHub_delete'] = teamHub_delete!.toJson(); + } + return json; + } + + DeleteTeamHubData({ + this.teamHub_delete, + }); +} + +@immutable +class DeleteTeamHubVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteTeamHubVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTeamHubVariables otherTyped = other as DeleteTeamHubVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteTeamHubVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_team_hud_department.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_team_hud_department.dart new file mode 100644 index 00000000..cbb5ecb4 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_team_hud_department.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteTeamHudDepartmentVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteTeamHudDepartmentVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteTeamHudDepartmentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteTeamHudDepartmentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteTeamHudDepartmentVariables vars= DeleteTeamHudDepartmentVariables(id: id,); + return _dataConnect.mutation("deleteTeamHudDepartment", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteTeamHudDepartmentTeamHudDepartmentDelete { + final String id; + DeleteTeamHudDepartmentTeamHudDepartmentDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTeamHudDepartmentTeamHudDepartmentDelete otherTyped = other as DeleteTeamHudDepartmentTeamHudDepartmentDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteTeamHudDepartmentTeamHudDepartmentDelete({ + required this.id, + }); +} + +@immutable +class DeleteTeamHudDepartmentData { + final DeleteTeamHudDepartmentTeamHudDepartmentDelete? teamHudDepartment_delete; + DeleteTeamHudDepartmentData.fromJson(dynamic json): + + teamHudDepartment_delete = json['teamHudDepartment_delete'] == null ? null : DeleteTeamHudDepartmentTeamHudDepartmentDelete.fromJson(json['teamHudDepartment_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTeamHudDepartmentData otherTyped = other as DeleteTeamHudDepartmentData; + return teamHudDepartment_delete == otherTyped.teamHudDepartment_delete; + + } + @override + int get hashCode => teamHudDepartment_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (teamHudDepartment_delete != null) { + json['teamHudDepartment_delete'] = teamHudDepartment_delete!.toJson(); + } + return json; + } + + DeleteTeamHudDepartmentData({ + this.teamHudDepartment_delete, + }); +} + +@immutable +class DeleteTeamHudDepartmentVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteTeamHudDepartmentVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTeamHudDepartmentVariables otherTyped = other as DeleteTeamHudDepartmentVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteTeamHudDepartmentVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_team_member.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_team_member.dart new file mode 100644 index 00000000..b69de984 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_team_member.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteTeamMemberVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteTeamMemberVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteTeamMemberData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteTeamMemberVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteTeamMemberVariables vars= DeleteTeamMemberVariables(id: id,); + return _dataConnect.mutation("deleteTeamMember", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteTeamMemberTeamMemberDelete { + final String id; + DeleteTeamMemberTeamMemberDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTeamMemberTeamMemberDelete otherTyped = other as DeleteTeamMemberTeamMemberDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteTeamMemberTeamMemberDelete({ + required this.id, + }); +} + +@immutable +class DeleteTeamMemberData { + final DeleteTeamMemberTeamMemberDelete? teamMember_delete; + DeleteTeamMemberData.fromJson(dynamic json): + + teamMember_delete = json['teamMember_delete'] == null ? null : DeleteTeamMemberTeamMemberDelete.fromJson(json['teamMember_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTeamMemberData otherTyped = other as DeleteTeamMemberData; + return teamMember_delete == otherTyped.teamMember_delete; + + } + @override + int get hashCode => teamMember_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (teamMember_delete != null) { + json['teamMember_delete'] = teamMember_delete!.toJson(); + } + return json; + } + + DeleteTeamMemberData({ + this.teamMember_delete, + }); +} + +@immutable +class DeleteTeamMemberVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteTeamMemberVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteTeamMemberVariables otherTyped = other as DeleteTeamMemberVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteTeamMemberVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_user.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_user.dart new file mode 100644 index 00000000..d3f9b06f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_user.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteUserVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteUserVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteUserData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteUserVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteUserVariables vars= DeleteUserVariables(id: id,); + return _dataConnect.mutation("DeleteUser", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteUserUserDelete { + final String id; + DeleteUserUserDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteUserUserDelete otherTyped = other as DeleteUserUserDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteUserUserDelete({ + required this.id, + }); +} + +@immutable +class DeleteUserData { + final DeleteUserUserDelete? user_delete; + DeleteUserData.fromJson(dynamic json): + + user_delete = json['user_delete'] == null ? null : DeleteUserUserDelete.fromJson(json['user_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteUserData otherTyped = other as DeleteUserData; + return user_delete == otherTyped.user_delete; + + } + @override + int get hashCode => user_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (user_delete != null) { + json['user_delete'] = user_delete!.toJson(); + } + return json; + } + + DeleteUserData({ + this.user_delete, + }); +} + +@immutable +class DeleteUserVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteUserVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteUserVariables otherTyped = other as DeleteUserVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteUserVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_user_conversation.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_user_conversation.dart new file mode 100644 index 00000000..54606243 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_user_conversation.dart @@ -0,0 +1,135 @@ +part of 'generated.dart'; + +class DeleteUserConversationVariablesBuilder { + String conversationId; + String userId; + + final FirebaseDataConnect _dataConnect; + DeleteUserConversationVariablesBuilder(this._dataConnect, {required this.conversationId,required this.userId,}); + Deserializer dataDeserializer = (dynamic json) => DeleteUserConversationData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteUserConversationVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteUserConversationVariables vars= DeleteUserConversationVariables(conversationId: conversationId,userId: userId,); + return _dataConnect.mutation("deleteUserConversation", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteUserConversationUserConversationDelete { + final String conversationId; + final String userId; + DeleteUserConversationUserConversationDelete.fromJson(dynamic json): + + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteUserConversationUserConversationDelete otherTyped = other as DeleteUserConversationUserConversationDelete; + return conversationId == otherTyped.conversationId && + userId == otherTyped.userId; + + } + @override + int get hashCode => Object.hashAll([conversationId.hashCode, userId.hashCode]); + + + Map toJson() { + Map json = {}; + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + return json; + } + + DeleteUserConversationUserConversationDelete({ + required this.conversationId, + required this.userId, + }); +} + +@immutable +class DeleteUserConversationData { + final DeleteUserConversationUserConversationDelete? userConversation_delete; + DeleteUserConversationData.fromJson(dynamic json): + + userConversation_delete = json['userConversation_delete'] == null ? null : DeleteUserConversationUserConversationDelete.fromJson(json['userConversation_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteUserConversationData otherTyped = other as DeleteUserConversationData; + return userConversation_delete == otherTyped.userConversation_delete; + + } + @override + int get hashCode => userConversation_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (userConversation_delete != null) { + json['userConversation_delete'] = userConversation_delete!.toJson(); + } + return json; + } + + DeleteUserConversationData({ + this.userConversation_delete, + }); +} + +@immutable +class DeleteUserConversationVariables { + final String conversationId; + final String userId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteUserConversationVariables.fromJson(Map json): + + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteUserConversationVariables otherTyped = other as DeleteUserConversationVariables; + return conversationId == otherTyped.conversationId && + userId == otherTyped.userId; + + } + @override + int get hashCode => Object.hashAll([conversationId.hashCode, userId.hashCode]); + + + Map toJson() { + Map json = {}; + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + return json; + } + + DeleteUserConversationVariables({ + required this.conversationId, + required this.userId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_vendor.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_vendor.dart new file mode 100644 index 00000000..61a59821 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_vendor.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteVendorVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteVendorVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteVendorData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteVendorVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteVendorVariables vars= DeleteVendorVariables(id: id,); + return _dataConnect.mutation("deleteVendor", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteVendorVendorDelete { + final String id; + DeleteVendorVendorDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteVendorVendorDelete otherTyped = other as DeleteVendorVendorDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteVendorVendorDelete({ + required this.id, + }); +} + +@immutable +class DeleteVendorData { + final DeleteVendorVendorDelete? vendor_delete; + DeleteVendorData.fromJson(dynamic json): + + vendor_delete = json['vendor_delete'] == null ? null : DeleteVendorVendorDelete.fromJson(json['vendor_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteVendorData otherTyped = other as DeleteVendorData; + return vendor_delete == otherTyped.vendor_delete; + + } + @override + int get hashCode => vendor_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (vendor_delete != null) { + json['vendor_delete'] = vendor_delete!.toJson(); + } + return json; + } + + DeleteVendorData({ + this.vendor_delete, + }); +} + +@immutable +class DeleteVendorVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteVendorVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteVendorVariables otherTyped = other as DeleteVendorVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteVendorVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_vendor_benefit_plan.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_vendor_benefit_plan.dart new file mode 100644 index 00000000..76b99dcc --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_vendor_benefit_plan.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteVendorBenefitPlanVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteVendorBenefitPlanVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteVendorBenefitPlanData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteVendorBenefitPlanVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteVendorBenefitPlanVariables vars= DeleteVendorBenefitPlanVariables(id: id,); + return _dataConnect.mutation("deleteVendorBenefitPlan", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteVendorBenefitPlanVendorBenefitPlanDelete { + final String id; + DeleteVendorBenefitPlanVendorBenefitPlanDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteVendorBenefitPlanVendorBenefitPlanDelete otherTyped = other as DeleteVendorBenefitPlanVendorBenefitPlanDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteVendorBenefitPlanVendorBenefitPlanDelete({ + required this.id, + }); +} + +@immutable +class DeleteVendorBenefitPlanData { + final DeleteVendorBenefitPlanVendorBenefitPlanDelete? vendorBenefitPlan_delete; + DeleteVendorBenefitPlanData.fromJson(dynamic json): + + vendorBenefitPlan_delete = json['vendorBenefitPlan_delete'] == null ? null : DeleteVendorBenefitPlanVendorBenefitPlanDelete.fromJson(json['vendorBenefitPlan_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteVendorBenefitPlanData otherTyped = other as DeleteVendorBenefitPlanData; + return vendorBenefitPlan_delete == otherTyped.vendorBenefitPlan_delete; + + } + @override + int get hashCode => vendorBenefitPlan_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (vendorBenefitPlan_delete != null) { + json['vendorBenefitPlan_delete'] = vendorBenefitPlan_delete!.toJson(); + } + return json; + } + + DeleteVendorBenefitPlanData({ + this.vendorBenefitPlan_delete, + }); +} + +@immutable +class DeleteVendorBenefitPlanVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteVendorBenefitPlanVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteVendorBenefitPlanVariables otherTyped = other as DeleteVendorBenefitPlanVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteVendorBenefitPlanVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_vendor_rate.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_vendor_rate.dart new file mode 100644 index 00000000..4894a79f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/delete_vendor_rate.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class DeleteVendorRateVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + DeleteVendorRateVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => DeleteVendorRateData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (DeleteVendorRateVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + DeleteVendorRateVariables vars= DeleteVendorRateVariables(id: id,); + return _dataConnect.mutation("deleteVendorRate", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class DeleteVendorRateVendorRateDelete { + final String id; + DeleteVendorRateVendorRateDelete.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteVendorRateVendorRateDelete otherTyped = other as DeleteVendorRateVendorRateDelete; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteVendorRateVendorRateDelete({ + required this.id, + }); +} + +@immutable +class DeleteVendorRateData { + final DeleteVendorRateVendorRateDelete? vendorRate_delete; + DeleteVendorRateData.fromJson(dynamic json): + + vendorRate_delete = json['vendorRate_delete'] == null ? null : DeleteVendorRateVendorRateDelete.fromJson(json['vendorRate_delete']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteVendorRateData otherTyped = other as DeleteVendorRateData; + return vendorRate_delete == otherTyped.vendorRate_delete; + + } + @override + int get hashCode => vendorRate_delete.hashCode; + + + Map toJson() { + Map json = {}; + if (vendorRate_delete != null) { + json['vendorRate_delete'] = vendorRate_delete!.toJson(); + } + return json; + } + + DeleteVendorRateData({ + this.vendorRate_delete, + }); +} + +@immutable +class DeleteVendorRateVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + DeleteVendorRateVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final DeleteVendorRateVariables otherTyped = other as DeleteVendorRateVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + DeleteVendorRateVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_accounts.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_accounts.dart new file mode 100644 index 00000000..6c190c86 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_accounts.dart @@ -0,0 +1,209 @@ +part of 'generated.dart'; + +class FilterAccountsVariablesBuilder { + Optional _bank = Optional.optional(nativeFromJson, nativeToJson); + Optional _type = Optional.optional((data) => AccountType.values.byName(data), enumSerializer); + Optional _isPrimary = Optional.optional(nativeFromJson, nativeToJson); + Optional _ownerId = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterAccountsVariablesBuilder bank(String? t) { + _bank.value = t; + return this; + } + FilterAccountsVariablesBuilder type(AccountType? t) { + _type.value = t; + return this; + } + FilterAccountsVariablesBuilder isPrimary(bool? t) { + _isPrimary.value = t; + return this; + } + FilterAccountsVariablesBuilder ownerId(String? t) { + _ownerId.value = t; + return this; + } + + FilterAccountsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterAccountsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterAccountsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterAccountsVariables vars= FilterAccountsVariables(bank: _bank,type: _type,isPrimary: _isPrimary,ownerId: _ownerId,); + return _dataConnect.query("filterAccounts", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterAccountsAccounts { + final String id; + final String bank; + final EnumValue type; + final String last4; + final bool? isPrimary; + final String ownerId; + FilterAccountsAccounts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + bank = nativeFromJson(json['bank']), + type = accountTypeDeserializer(json['type']), + last4 = nativeFromJson(json['last4']), + isPrimary = json['isPrimary'] == null ? null : nativeFromJson(json['isPrimary']), + ownerId = nativeFromJson(json['ownerId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterAccountsAccounts otherTyped = other as FilterAccountsAccounts; + return id == otherTyped.id && + bank == otherTyped.bank && + type == otherTyped.type && + last4 == otherTyped.last4 && + isPrimary == otherTyped.isPrimary && + ownerId == otherTyped.ownerId; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['bank'] = nativeToJson(bank); + json['type'] = + accountTypeSerializer(type) + ; + json['last4'] = nativeToJson(last4); + if (isPrimary != null) { + json['isPrimary'] = nativeToJson(isPrimary); + } + json['ownerId'] = nativeToJson(ownerId); + return json; + } + + FilterAccountsAccounts({ + required this.id, + required this.bank, + required this.type, + required this.last4, + this.isPrimary, + required this.ownerId, + }); +} + +@immutable +class FilterAccountsData { + final List accounts; + FilterAccountsData.fromJson(dynamic json): + + accounts = (json['accounts'] as List) + .map((e) => FilterAccountsAccounts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterAccountsData otherTyped = other as FilterAccountsData; + return accounts == otherTyped.accounts; + + } + @override + int get hashCode => accounts.hashCode; + + + Map toJson() { + Map json = {}; + json['accounts'] = accounts.map((e) => e.toJson()).toList(); + return json; + } + + FilterAccountsData({ + required this.accounts, + }); +} + +@immutable +class FilterAccountsVariables { + late final Optionalbank; + late final Optionaltype; + late final OptionalisPrimary; + late final OptionalownerId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterAccountsVariables.fromJson(Map json) { + + + bank = Optional.optional(nativeFromJson, nativeToJson); + bank.value = json['bank'] == null ? null : nativeFromJson(json['bank']); + + + type = Optional.optional((data) => AccountType.values.byName(data), enumSerializer); + type.value = json['type'] == null ? null : AccountType.values.byName(json['type']); + + + isPrimary = Optional.optional(nativeFromJson, nativeToJson); + isPrimary.value = json['isPrimary'] == null ? null : nativeFromJson(json['isPrimary']); + + + ownerId = Optional.optional(nativeFromJson, nativeToJson); + ownerId.value = json['ownerId'] == null ? null : nativeFromJson(json['ownerId']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterAccountsVariables otherTyped = other as FilterAccountsVariables; + return bank == otherTyped.bank && + type == otherTyped.type && + isPrimary == otherTyped.isPrimary && + ownerId == otherTyped.ownerId; + + } + @override + int get hashCode => Object.hashAll([bank.hashCode, type.hashCode, isPrimary.hashCode, ownerId.hashCode]); + + + Map toJson() { + Map json = {}; + if(bank.state == OptionalState.set) { + json['bank'] = bank.toJson(); + } + if(type.state == OptionalState.set) { + json['type'] = type.toJson(); + } + if(isPrimary.state == OptionalState.set) { + json['isPrimary'] = isPrimary.toJson(); + } + if(ownerId.state == OptionalState.set) { + json['ownerId'] = ownerId.toJson(); + } + return json; + } + + FilterAccountsVariables({ + required this.bank, + required this.type, + required this.isPrimary, + required this.ownerId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_activity_logs.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_activity_logs.dart new file mode 100644 index 00000000..0298429e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_activity_logs.dart @@ -0,0 +1,332 @@ +part of 'generated.dart'; + +class FilterActivityLogsVariablesBuilder { + Optional _userId = Optional.optional(nativeFromJson, nativeToJson); + Optional _dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer); + Optional _dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer); + Optional _isRead = Optional.optional(nativeFromJson, nativeToJson); + Optional _activityType = Optional.optional((data) => ActivityType.values.byName(data), enumSerializer); + Optional _iconType = Optional.optional((data) => ActivityIconType.values.byName(data), enumSerializer); + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterActivityLogsVariablesBuilder userId(String? t) { + _userId.value = t; + return this; + } + FilterActivityLogsVariablesBuilder dateFrom(Timestamp? t) { + _dateFrom.value = t; + return this; + } + FilterActivityLogsVariablesBuilder dateTo(Timestamp? t) { + _dateTo.value = t; + return this; + } + FilterActivityLogsVariablesBuilder isRead(bool? t) { + _isRead.value = t; + return this; + } + FilterActivityLogsVariablesBuilder activityType(ActivityType? t) { + _activityType.value = t; + return this; + } + FilterActivityLogsVariablesBuilder iconType(ActivityIconType? t) { + _iconType.value = t; + return this; + } + FilterActivityLogsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterActivityLogsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + FilterActivityLogsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterActivityLogsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterActivityLogsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterActivityLogsVariables vars= FilterActivityLogsVariables(userId: _userId,dateFrom: _dateFrom,dateTo: _dateTo,isRead: _isRead,activityType: _activityType,iconType: _iconType,offset: _offset,limit: _limit,); + return _dataConnect.query("filterActivityLogs", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterActivityLogsActivityLogs { + final String id; + final String userId; + final Timestamp date; + final String? hourStart; + final String? hourEnd; + final String? totalhours; + final EnumValue? iconType; + final String? iconColor; + final String title; + final String description; + final bool? isRead; + final EnumValue activityType; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + FilterActivityLogsActivityLogs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + userId = nativeFromJson(json['userId']), + date = Timestamp.fromJson(json['date']), + hourStart = json['hourStart'] == null ? null : nativeFromJson(json['hourStart']), + hourEnd = json['hourEnd'] == null ? null : nativeFromJson(json['hourEnd']), + totalhours = json['totalhours'] == null ? null : nativeFromJson(json['totalhours']), + iconType = json['iconType'] == null ? null : activityIconTypeDeserializer(json['iconType']), + iconColor = json['iconColor'] == null ? null : nativeFromJson(json['iconColor']), + title = nativeFromJson(json['title']), + description = nativeFromJson(json['description']), + isRead = json['isRead'] == null ? null : nativeFromJson(json['isRead']), + activityType = activityTypeDeserializer(json['activityType']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterActivityLogsActivityLogs otherTyped = other as FilterActivityLogsActivityLogs; + return id == otherTyped.id && + userId == otherTyped.userId && + date == otherTyped.date && + hourStart == otherTyped.hourStart && + hourEnd == otherTyped.hourEnd && + totalhours == otherTyped.totalhours && + iconType == otherTyped.iconType && + iconColor == otherTyped.iconColor && + title == otherTyped.title && + description == otherTyped.description && + isRead == otherTyped.isRead && + activityType == otherTyped.activityType && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, date.hashCode, hourStart.hashCode, hourEnd.hashCode, totalhours.hashCode, iconType.hashCode, iconColor.hashCode, title.hashCode, description.hashCode, isRead.hashCode, activityType.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['userId'] = nativeToJson(userId); + json['date'] = date.toJson(); + if (hourStart != null) { + json['hourStart'] = nativeToJson(hourStart); + } + if (hourEnd != null) { + json['hourEnd'] = nativeToJson(hourEnd); + } + if (totalhours != null) { + json['totalhours'] = nativeToJson(totalhours); + } + if (iconType != null) { + json['iconType'] = + activityIconTypeSerializer(iconType!) + ; + } + if (iconColor != null) { + json['iconColor'] = nativeToJson(iconColor); + } + json['title'] = nativeToJson(title); + json['description'] = nativeToJson(description); + if (isRead != null) { + json['isRead'] = nativeToJson(isRead); + } + json['activityType'] = + activityTypeSerializer(activityType) + ; + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + FilterActivityLogsActivityLogs({ + required this.id, + required this.userId, + required this.date, + this.hourStart, + this.hourEnd, + this.totalhours, + this.iconType, + this.iconColor, + required this.title, + required this.description, + this.isRead, + required this.activityType, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class FilterActivityLogsData { + final List activityLogs; + FilterActivityLogsData.fromJson(dynamic json): + + activityLogs = (json['activityLogs'] as List) + .map((e) => FilterActivityLogsActivityLogs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterActivityLogsData otherTyped = other as FilterActivityLogsData; + return activityLogs == otherTyped.activityLogs; + + } + @override + int get hashCode => activityLogs.hashCode; + + + Map toJson() { + Map json = {}; + json['activityLogs'] = activityLogs.map((e) => e.toJson()).toList(); + return json; + } + + FilterActivityLogsData({ + required this.activityLogs, + }); +} + +@immutable +class FilterActivityLogsVariables { + late final OptionaluserId; + late final OptionaldateFrom; + late final OptionaldateTo; + late final OptionalisRead; + late final OptionalactivityType; + late final OptionaliconType; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterActivityLogsVariables.fromJson(Map json) { + + + userId = Optional.optional(nativeFromJson, nativeToJson); + userId.value = json['userId'] == null ? null : nativeFromJson(json['userId']); + + + dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer); + dateFrom.value = json['dateFrom'] == null ? null : Timestamp.fromJson(json['dateFrom']); + + + dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer); + dateTo.value = json['dateTo'] == null ? null : Timestamp.fromJson(json['dateTo']); + + + isRead = Optional.optional(nativeFromJson, nativeToJson); + isRead.value = json['isRead'] == null ? null : nativeFromJson(json['isRead']); + + + activityType = Optional.optional((data) => ActivityType.values.byName(data), enumSerializer); + activityType.value = json['activityType'] == null ? null : ActivityType.values.byName(json['activityType']); + + + iconType = Optional.optional((data) => ActivityIconType.values.byName(data), enumSerializer); + iconType.value = json['iconType'] == null ? null : ActivityIconType.values.byName(json['iconType']); + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterActivityLogsVariables otherTyped = other as FilterActivityLogsVariables; + return userId == otherTyped.userId && + dateFrom == otherTyped.dateFrom && + dateTo == otherTyped.dateTo && + isRead == otherTyped.isRead && + activityType == otherTyped.activityType && + iconType == otherTyped.iconType && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([userId.hashCode, dateFrom.hashCode, dateTo.hashCode, isRead.hashCode, activityType.hashCode, iconType.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(userId.state == OptionalState.set) { + json['userId'] = userId.toJson(); + } + if(dateFrom.state == OptionalState.set) { + json['dateFrom'] = dateFrom.toJson(); + } + if(dateTo.state == OptionalState.set) { + json['dateTo'] = dateTo.toJson(); + } + if(isRead.state == OptionalState.set) { + json['isRead'] = isRead.toJson(); + } + if(activityType.state == OptionalState.set) { + json['activityType'] = activityType.toJson(); + } + if(iconType.state == OptionalState.set) { + json['iconType'] = iconType.toJson(); + } + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + FilterActivityLogsVariables({ + required this.userId, + required this.dateFrom, + required this.dateTo, + required this.isRead, + required this.activityType, + required this.iconType, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_assignments.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_assignments.dart new file mode 100644 index 00000000..63e6ce4e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_assignments.dart @@ -0,0 +1,444 @@ +part of 'generated.dart'; + +class FilterAssignmentsVariablesBuilder { + List shiftIds; + List roleIds; + Optional _status = Optional.optional((data) => AssignmentStatus.values.byName(data), enumSerializer); + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; FilterAssignmentsVariablesBuilder status(AssignmentStatus? t) { + _status.value = t; + return this; + } + FilterAssignmentsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterAssignmentsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + FilterAssignmentsVariablesBuilder(this._dataConnect, {required this.shiftIds,required this.roleIds,}); + Deserializer dataDeserializer = (dynamic json) => FilterAssignmentsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterAssignmentsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterAssignmentsVariables vars= FilterAssignmentsVariables(shiftIds: shiftIds,roleIds: roleIds,status: _status,offset: _offset,limit: _limit,); + return _dataConnect.query("filterAssignments", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterAssignmentsAssignments { + final String id; + final String? title; + final EnumValue? status; + final Timestamp? createdAt; + final FilterAssignmentsAssignmentsWorkforce workforce; + final FilterAssignmentsAssignmentsShiftRole shiftRole; + FilterAssignmentsAssignments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = json['title'] == null ? null : nativeFromJson(json['title']), + status = json['status'] == null ? null : assignmentStatusDeserializer(json['status']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + workforce = FilterAssignmentsAssignmentsWorkforce.fromJson(json['workforce']), + shiftRole = FilterAssignmentsAssignmentsShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterAssignmentsAssignments otherTyped = other as FilterAssignmentsAssignments; + return id == otherTyped.id && + title == otherTyped.title && + status == otherTyped.status && + createdAt == otherTyped.createdAt && + workforce == otherTyped.workforce && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, status.hashCode, createdAt.hashCode, workforce.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (title != null) { + json['title'] = nativeToJson(title); + } + if (status != null) { + json['status'] = + assignmentStatusSerializer(status!) + ; + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['workforce'] = workforce.toJson(); + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + FilterAssignmentsAssignments({ + required this.id, + this.title, + this.status, + this.createdAt, + required this.workforce, + required this.shiftRole, + }); +} + +@immutable +class FilterAssignmentsAssignmentsWorkforce { + final String id; + final String workforceNumber; + final FilterAssignmentsAssignmentsWorkforceStaff staff; + FilterAssignmentsAssignmentsWorkforce.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workforceNumber = nativeFromJson(json['workforceNumber']), + staff = FilterAssignmentsAssignmentsWorkforceStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterAssignmentsAssignmentsWorkforce otherTyped = other as FilterAssignmentsAssignmentsWorkforce; + return id == otherTyped.id && + workforceNumber == otherTyped.workforceNumber && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workforceNumber.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['workforceNumber'] = nativeToJson(workforceNumber); + json['staff'] = staff.toJson(); + return json; + } + + FilterAssignmentsAssignmentsWorkforce({ + required this.id, + required this.workforceNumber, + required this.staff, + }); +} + +@immutable +class FilterAssignmentsAssignmentsWorkforceStaff { + final String id; + final String fullName; + FilterAssignmentsAssignmentsWorkforceStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterAssignmentsAssignmentsWorkforceStaff otherTyped = other as FilterAssignmentsAssignmentsWorkforceStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + FilterAssignmentsAssignmentsWorkforceStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class FilterAssignmentsAssignmentsShiftRole { + final String id; + final FilterAssignmentsAssignmentsShiftRoleRole role; + final FilterAssignmentsAssignmentsShiftRoleShift shift; + FilterAssignmentsAssignmentsShiftRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + role = FilterAssignmentsAssignmentsShiftRoleRole.fromJson(json['role']), + shift = FilterAssignmentsAssignmentsShiftRoleShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterAssignmentsAssignmentsShiftRole otherTyped = other as FilterAssignmentsAssignmentsShiftRole; + return id == otherTyped.id && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + FilterAssignmentsAssignmentsShiftRole({ + required this.id, + required this.role, + required this.shift, + }); +} + +@immutable +class FilterAssignmentsAssignmentsShiftRoleRole { + final String id; + final String name; + FilterAssignmentsAssignmentsShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterAssignmentsAssignmentsShiftRoleRole otherTyped = other as FilterAssignmentsAssignmentsShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + return json; + } + + FilterAssignmentsAssignmentsShiftRoleRole({ + required this.id, + required this.name, + }); +} + +@immutable +class FilterAssignmentsAssignmentsShiftRoleShift { + final String id; + final String title; + final Timestamp? date; + final String? location; + final EnumValue? status; + FilterAssignmentsAssignmentsShiftRoleShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterAssignmentsAssignmentsShiftRoleShift otherTyped = other as FilterAssignmentsAssignmentsShiftRoleShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + location == otherTyped.location && + status == otherTyped.status; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, location.hashCode, status.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + return json; + } + + FilterAssignmentsAssignmentsShiftRoleShift({ + required this.id, + required this.title, + this.date, + this.location, + this.status, + }); +} + +@immutable +class FilterAssignmentsData { + final List assignments; + FilterAssignmentsData.fromJson(dynamic json): + + assignments = (json['assignments'] as List) + .map((e) => FilterAssignmentsAssignments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterAssignmentsData otherTyped = other as FilterAssignmentsData; + return assignments == otherTyped.assignments; + + } + @override + int get hashCode => assignments.hashCode; + + + Map toJson() { + Map json = {}; + json['assignments'] = assignments.map((e) => e.toJson()).toList(); + return json; + } + + FilterAssignmentsData({ + required this.assignments, + }); +} + +@immutable +class FilterAssignmentsVariables { + final List shiftIds; + final List roleIds; + late final Optionalstatus; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterAssignmentsVariables.fromJson(Map json): + + shiftIds = (json['shiftIds'] as List) + .map((e) => nativeFromJson(e)) + .toList(), + roleIds = (json['roleIds'] as List) + .map((e) => nativeFromJson(e)) + .toList() { + + + + + status = Optional.optional((data) => AssignmentStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : AssignmentStatus.values.byName(json['status']); + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterAssignmentsVariables otherTyped = other as FilterAssignmentsVariables; + return shiftIds == otherTyped.shiftIds && + roleIds == otherTyped.roleIds && + status == otherTyped.status && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([shiftIds.hashCode, roleIds.hashCode, status.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftIds'] = shiftIds.map((e) => nativeToJson(e)).toList(); + json['roleIds'] = roleIds.map((e) => nativeToJson(e)).toList(); + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + FilterAssignmentsVariables({ + required this.shiftIds, + required this.roleIds, + required this.status, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_attire_options.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_attire_options.dart new file mode 100644 index 00000000..8df80758 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_attire_options.dart @@ -0,0 +1,203 @@ +part of 'generated.dart'; + +class FilterAttireOptionsVariablesBuilder { + Optional _itemId = Optional.optional(nativeFromJson, nativeToJson); + Optional _isMandatory = Optional.optional(nativeFromJson, nativeToJson); + Optional _vendorId = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterAttireOptionsVariablesBuilder itemId(String? t) { + _itemId.value = t; + return this; + } + FilterAttireOptionsVariablesBuilder isMandatory(bool? t) { + _isMandatory.value = t; + return this; + } + FilterAttireOptionsVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + + FilterAttireOptionsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterAttireOptionsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterAttireOptionsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterAttireOptionsVariables vars= FilterAttireOptionsVariables(itemId: _itemId,isMandatory: _isMandatory,vendorId: _vendorId,); + return _dataConnect.query("filterAttireOptions", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterAttireOptionsAttireOptions { + final String id; + final String itemId; + final String label; + final String? icon; + final String? imageUrl; + final bool? isMandatory; + final String? vendorId; + FilterAttireOptionsAttireOptions.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + itemId = nativeFromJson(json['itemId']), + label = nativeFromJson(json['label']), + icon = json['icon'] == null ? null : nativeFromJson(json['icon']), + imageUrl = json['imageUrl'] == null ? null : nativeFromJson(json['imageUrl']), + isMandatory = json['isMandatory'] == null ? null : nativeFromJson(json['isMandatory']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterAttireOptionsAttireOptions otherTyped = other as FilterAttireOptionsAttireOptions; + return id == otherTyped.id && + itemId == otherTyped.itemId && + label == otherTyped.label && + icon == otherTyped.icon && + imageUrl == otherTyped.imageUrl && + isMandatory == otherTyped.isMandatory && + vendorId == otherTyped.vendorId; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, itemId.hashCode, label.hashCode, icon.hashCode, imageUrl.hashCode, isMandatory.hashCode, vendorId.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['itemId'] = nativeToJson(itemId); + json['label'] = nativeToJson(label); + if (icon != null) { + json['icon'] = nativeToJson(icon); + } + if (imageUrl != null) { + json['imageUrl'] = nativeToJson(imageUrl); + } + if (isMandatory != null) { + json['isMandatory'] = nativeToJson(isMandatory); + } + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + return json; + } + + FilterAttireOptionsAttireOptions({ + required this.id, + required this.itemId, + required this.label, + this.icon, + this.imageUrl, + this.isMandatory, + this.vendorId, + }); +} + +@immutable +class FilterAttireOptionsData { + final List attireOptions; + FilterAttireOptionsData.fromJson(dynamic json): + + attireOptions = (json['attireOptions'] as List) + .map((e) => FilterAttireOptionsAttireOptions.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterAttireOptionsData otherTyped = other as FilterAttireOptionsData; + return attireOptions == otherTyped.attireOptions; + + } + @override + int get hashCode => attireOptions.hashCode; + + + Map toJson() { + Map json = {}; + json['attireOptions'] = attireOptions.map((e) => e.toJson()).toList(); + return json; + } + + FilterAttireOptionsData({ + required this.attireOptions, + }); +} + +@immutable +class FilterAttireOptionsVariables { + late final OptionalitemId; + late final OptionalisMandatory; + late final OptionalvendorId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterAttireOptionsVariables.fromJson(Map json) { + + + itemId = Optional.optional(nativeFromJson, nativeToJson); + itemId.value = json['itemId'] == null ? null : nativeFromJson(json['itemId']); + + + isMandatory = Optional.optional(nativeFromJson, nativeToJson); + isMandatory.value = json['isMandatory'] == null ? null : nativeFromJson(json['isMandatory']); + + + vendorId = Optional.optional(nativeFromJson, nativeToJson); + vendorId.value = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterAttireOptionsVariables otherTyped = other as FilterAttireOptionsVariables; + return itemId == otherTyped.itemId && + isMandatory == otherTyped.isMandatory && + vendorId == otherTyped.vendorId; + + } + @override + int get hashCode => Object.hashAll([itemId.hashCode, isMandatory.hashCode, vendorId.hashCode]); + + + Map toJson() { + Map json = {}; + if(itemId.state == OptionalState.set) { + json['itemId'] = itemId.toJson(); + } + if(isMandatory.state == OptionalState.set) { + json['isMandatory'] = isMandatory.toJson(); + } + if(vendorId.state == OptionalState.set) { + json['vendorId'] = vendorId.toJson(); + } + return json; + } + + FilterAttireOptionsVariables({ + required this.itemId, + required this.isMandatory, + required this.vendorId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_categories.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_categories.dart new file mode 100644 index 00000000..1b3d2ebc --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_categories.dart @@ -0,0 +1,188 @@ +part of 'generated.dart'; + +class FilterCategoriesVariablesBuilder { + Optional _categoryId = Optional.optional(nativeFromJson, nativeToJson); + Optional _label = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterCategoriesVariablesBuilder categoryId(String? t) { + _categoryId.value = t; + return this; + } + FilterCategoriesVariablesBuilder label(String? t) { + _label.value = t; + return this; + } + + FilterCategoriesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterCategoriesData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterCategoriesVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterCategoriesVariables vars= FilterCategoriesVariables(categoryId: _categoryId,label: _label,); + return _dataConnect.query("filterCategories", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterCategoriesCategories { + final String id; + final String categoryId; + final String label; + final String? icon; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + FilterCategoriesCategories.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + categoryId = nativeFromJson(json['categoryId']), + label = nativeFromJson(json['label']), + icon = json['icon'] == null ? null : nativeFromJson(json['icon']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterCategoriesCategories otherTyped = other as FilterCategoriesCategories; + return id == otherTyped.id && + categoryId == otherTyped.categoryId && + label == otherTyped.label && + icon == otherTyped.icon && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, categoryId.hashCode, label.hashCode, icon.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['categoryId'] = nativeToJson(categoryId); + json['label'] = nativeToJson(label); + if (icon != null) { + json['icon'] = nativeToJson(icon); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + FilterCategoriesCategories({ + required this.id, + required this.categoryId, + required this.label, + this.icon, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class FilterCategoriesData { + final List categories; + FilterCategoriesData.fromJson(dynamic json): + + categories = (json['categories'] as List) + .map((e) => FilterCategoriesCategories.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterCategoriesData otherTyped = other as FilterCategoriesData; + return categories == otherTyped.categories; + + } + @override + int get hashCode => categories.hashCode; + + + Map toJson() { + Map json = {}; + json['categories'] = categories.map((e) => e.toJson()).toList(); + return json; + } + + FilterCategoriesData({ + required this.categories, + }); +} + +@immutable +class FilterCategoriesVariables { + late final OptionalcategoryId; + late final Optionallabel; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterCategoriesVariables.fromJson(Map json) { + + + categoryId = Optional.optional(nativeFromJson, nativeToJson); + categoryId.value = json['categoryId'] == null ? null : nativeFromJson(json['categoryId']); + + + label = Optional.optional(nativeFromJson, nativeToJson); + label.value = json['label'] == null ? null : nativeFromJson(json['label']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterCategoriesVariables otherTyped = other as FilterCategoriesVariables; + return categoryId == otherTyped.categoryId && + label == otherTyped.label; + + } + @override + int get hashCode => Object.hashAll([categoryId.hashCode, label.hashCode]); + + + Map toJson() { + Map json = {}; + if(categoryId.state == OptionalState.set) { + json['categoryId'] = categoryId.toJson(); + } + if(label.state == OptionalState.set) { + json['label'] = label.toJson(); + } + return json; + } + + FilterCategoriesVariables({ + required this.categoryId, + required this.label, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_client_feedbacks.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_client_feedbacks.dart new file mode 100644 index 00000000..e7661cbe --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_client_feedbacks.dart @@ -0,0 +1,359 @@ +part of 'generated.dart'; + +class FilterClientFeedbacksVariablesBuilder { + Optional _businessId = Optional.optional(nativeFromJson, nativeToJson); + Optional _vendorId = Optional.optional(nativeFromJson, nativeToJson); + Optional _ratingMin = Optional.optional(nativeFromJson, nativeToJson); + Optional _ratingMax = Optional.optional(nativeFromJson, nativeToJson); + Optional _dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer); + Optional _dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer); + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterClientFeedbacksVariablesBuilder businessId(String? t) { + _businessId.value = t; + return this; + } + FilterClientFeedbacksVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + FilterClientFeedbacksVariablesBuilder ratingMin(int? t) { + _ratingMin.value = t; + return this; + } + FilterClientFeedbacksVariablesBuilder ratingMax(int? t) { + _ratingMax.value = t; + return this; + } + FilterClientFeedbacksVariablesBuilder dateFrom(Timestamp? t) { + _dateFrom.value = t; + return this; + } + FilterClientFeedbacksVariablesBuilder dateTo(Timestamp? t) { + _dateTo.value = t; + return this; + } + FilterClientFeedbacksVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterClientFeedbacksVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + FilterClientFeedbacksVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterClientFeedbacksData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterClientFeedbacksVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterClientFeedbacksVariables vars= FilterClientFeedbacksVariables(businessId: _businessId,vendorId: _vendorId,ratingMin: _ratingMin,ratingMax: _ratingMax,dateFrom: _dateFrom,dateTo: _dateTo,offset: _offset,limit: _limit,); + return _dataConnect.query("filterClientFeedbacks", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterClientFeedbacksClientFeedbacks { + final String id; + final String businessId; + final String vendorId; + final int? rating; + final String? comment; + final Timestamp? date; + final FilterClientFeedbacksClientFeedbacksBusiness business; + final FilterClientFeedbacksClientFeedbacksVendor vendor; + FilterClientFeedbacksClientFeedbacks.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessId = nativeFromJson(json['businessId']), + vendorId = nativeFromJson(json['vendorId']), + rating = json['rating'] == null ? null : nativeFromJson(json['rating']), + comment = json['comment'] == null ? null : nativeFromJson(json['comment']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + business = FilterClientFeedbacksClientFeedbacksBusiness.fromJson(json['business']), + vendor = FilterClientFeedbacksClientFeedbacksVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterClientFeedbacksClientFeedbacks otherTyped = other as FilterClientFeedbacksClientFeedbacks; + return id == otherTyped.id && + businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + rating == otherTyped.rating && + comment == otherTyped.comment && + date == otherTyped.date && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessId.hashCode, vendorId.hashCode, rating.hashCode, comment.hashCode, date.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessId'] = nativeToJson(businessId); + json['vendorId'] = nativeToJson(vendorId); + if (rating != null) { + json['rating'] = nativeToJson(rating); + } + if (comment != null) { + json['comment'] = nativeToJson(comment); + } + if (date != null) { + json['date'] = date!.toJson(); + } + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + return json; + } + + FilterClientFeedbacksClientFeedbacks({ + required this.id, + required this.businessId, + required this.vendorId, + this.rating, + this.comment, + this.date, + required this.business, + required this.vendor, + }); +} + +@immutable +class FilterClientFeedbacksClientFeedbacksBusiness { + final String id; + final String businessName; + FilterClientFeedbacksClientFeedbacksBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterClientFeedbacksClientFeedbacksBusiness otherTyped = other as FilterClientFeedbacksClientFeedbacksBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + FilterClientFeedbacksClientFeedbacksBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class FilterClientFeedbacksClientFeedbacksVendor { + final String id; + final String companyName; + FilterClientFeedbacksClientFeedbacksVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterClientFeedbacksClientFeedbacksVendor otherTyped = other as FilterClientFeedbacksClientFeedbacksVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + FilterClientFeedbacksClientFeedbacksVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class FilterClientFeedbacksData { + final List clientFeedbacks; + FilterClientFeedbacksData.fromJson(dynamic json): + + clientFeedbacks = (json['clientFeedbacks'] as List) + .map((e) => FilterClientFeedbacksClientFeedbacks.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterClientFeedbacksData otherTyped = other as FilterClientFeedbacksData; + return clientFeedbacks == otherTyped.clientFeedbacks; + + } + @override + int get hashCode => clientFeedbacks.hashCode; + + + Map toJson() { + Map json = {}; + json['clientFeedbacks'] = clientFeedbacks.map((e) => e.toJson()).toList(); + return json; + } + + FilterClientFeedbacksData({ + required this.clientFeedbacks, + }); +} + +@immutable +class FilterClientFeedbacksVariables { + late final OptionalbusinessId; + late final OptionalvendorId; + late final OptionalratingMin; + late final OptionalratingMax; + late final OptionaldateFrom; + late final OptionaldateTo; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterClientFeedbacksVariables.fromJson(Map json) { + + + businessId = Optional.optional(nativeFromJson, nativeToJson); + businessId.value = json['businessId'] == null ? null : nativeFromJson(json['businessId']); + + + vendorId = Optional.optional(nativeFromJson, nativeToJson); + vendorId.value = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + + + ratingMin = Optional.optional(nativeFromJson, nativeToJson); + ratingMin.value = json['ratingMin'] == null ? null : nativeFromJson(json['ratingMin']); + + + ratingMax = Optional.optional(nativeFromJson, nativeToJson); + ratingMax.value = json['ratingMax'] == null ? null : nativeFromJson(json['ratingMax']); + + + dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer); + dateFrom.value = json['dateFrom'] == null ? null : Timestamp.fromJson(json['dateFrom']); + + + dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer); + dateTo.value = json['dateTo'] == null ? null : Timestamp.fromJson(json['dateTo']); + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterClientFeedbacksVariables otherTyped = other as FilterClientFeedbacksVariables; + return businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + ratingMin == otherTyped.ratingMin && + ratingMax == otherTyped.ratingMax && + dateFrom == otherTyped.dateFrom && + dateTo == otherTyped.dateTo && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, vendorId.hashCode, ratingMin.hashCode, ratingMax.hashCode, dateFrom.hashCode, dateTo.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(businessId.state == OptionalState.set) { + json['businessId'] = businessId.toJson(); + } + if(vendorId.state == OptionalState.set) { + json['vendorId'] = vendorId.toJson(); + } + if(ratingMin.state == OptionalState.set) { + json['ratingMin'] = ratingMin.toJson(); + } + if(ratingMax.state == OptionalState.set) { + json['ratingMax'] = ratingMax.toJson(); + } + if(dateFrom.state == OptionalState.set) { + json['dateFrom'] = dateFrom.toJson(); + } + if(dateTo.state == OptionalState.set) { + json['dateTo'] = dateTo.toJson(); + } + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + FilterClientFeedbacksVariables({ + required this.businessId, + required this.vendorId, + required this.ratingMin, + required this.ratingMax, + required this.dateFrom, + required this.dateTo, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_conversations.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_conversations.dart new file mode 100644 index 00000000..779cbb30 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_conversations.dart @@ -0,0 +1,285 @@ +part of 'generated.dart'; + +class FilterConversationsVariablesBuilder { + Optional _status = Optional.optional((data) => ConversationStatus.values.byName(data), enumSerializer); + Optional _conversationType = Optional.optional((data) => ConversationType.values.byName(data), enumSerializer); + Optional _isGroup = Optional.optional(nativeFromJson, nativeToJson); + Optional _lastMessageAfter = Optional.optional((json) => json['lastMessageAfter'] = Timestamp.fromJson(json['lastMessageAfter']), defaultSerializer); + Optional _lastMessageBefore = Optional.optional((json) => json['lastMessageBefore'] = Timestamp.fromJson(json['lastMessageBefore']), defaultSerializer); + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterConversationsVariablesBuilder status(ConversationStatus? t) { + _status.value = t; + return this; + } + FilterConversationsVariablesBuilder conversationType(ConversationType? t) { + _conversationType.value = t; + return this; + } + FilterConversationsVariablesBuilder isGroup(bool? t) { + _isGroup.value = t; + return this; + } + FilterConversationsVariablesBuilder lastMessageAfter(Timestamp? t) { + _lastMessageAfter.value = t; + return this; + } + FilterConversationsVariablesBuilder lastMessageBefore(Timestamp? t) { + _lastMessageBefore.value = t; + return this; + } + FilterConversationsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterConversationsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + FilterConversationsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterConversationsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterConversationsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterConversationsVariables vars= FilterConversationsVariables(status: _status,conversationType: _conversationType,isGroup: _isGroup,lastMessageAfter: _lastMessageAfter,lastMessageBefore: _lastMessageBefore,offset: _offset,limit: _limit,); + return _dataConnect.query("filterConversations", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterConversationsConversations { + final String id; + final String? subject; + final EnumValue? status; + final EnumValue? conversationType; + final bool? isGroup; + final String? groupName; + final String? lastMessage; + final Timestamp? lastMessageAt; + final Timestamp? createdAt; + FilterConversationsConversations.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + subject = json['subject'] == null ? null : nativeFromJson(json['subject']), + status = json['status'] == null ? null : conversationStatusDeserializer(json['status']), + conversationType = json['conversationType'] == null ? null : conversationTypeDeserializer(json['conversationType']), + isGroup = json['isGroup'] == null ? null : nativeFromJson(json['isGroup']), + groupName = json['groupName'] == null ? null : nativeFromJson(json['groupName']), + lastMessage = json['lastMessage'] == null ? null : nativeFromJson(json['lastMessage']), + lastMessageAt = json['lastMessageAt'] == null ? null : Timestamp.fromJson(json['lastMessageAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterConversationsConversations otherTyped = other as FilterConversationsConversations; + return id == otherTyped.id && + subject == otherTyped.subject && + status == otherTyped.status && + conversationType == otherTyped.conversationType && + isGroup == otherTyped.isGroup && + groupName == otherTyped.groupName && + lastMessage == otherTyped.lastMessage && + lastMessageAt == otherTyped.lastMessageAt && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, subject.hashCode, status.hashCode, conversationType.hashCode, isGroup.hashCode, groupName.hashCode, lastMessage.hashCode, lastMessageAt.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (subject != null) { + json['subject'] = nativeToJson(subject); + } + if (status != null) { + json['status'] = + conversationStatusSerializer(status!) + ; + } + if (conversationType != null) { + json['conversationType'] = + conversationTypeSerializer(conversationType!) + ; + } + if (isGroup != null) { + json['isGroup'] = nativeToJson(isGroup); + } + if (groupName != null) { + json['groupName'] = nativeToJson(groupName); + } + if (lastMessage != null) { + json['lastMessage'] = nativeToJson(lastMessage); + } + if (lastMessageAt != null) { + json['lastMessageAt'] = lastMessageAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + FilterConversationsConversations({ + required this.id, + this.subject, + this.status, + this.conversationType, + this.isGroup, + this.groupName, + this.lastMessage, + this.lastMessageAt, + this.createdAt, + }); +} + +@immutable +class FilterConversationsData { + final List conversations; + FilterConversationsData.fromJson(dynamic json): + + conversations = (json['conversations'] as List) + .map((e) => FilterConversationsConversations.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterConversationsData otherTyped = other as FilterConversationsData; + return conversations == otherTyped.conversations; + + } + @override + int get hashCode => conversations.hashCode; + + + Map toJson() { + Map json = {}; + json['conversations'] = conversations.map((e) => e.toJson()).toList(); + return json; + } + + FilterConversationsData({ + required this.conversations, + }); +} + +@immutable +class FilterConversationsVariables { + late final Optionalstatus; + late final OptionalconversationType; + late final OptionalisGroup; + late final OptionallastMessageAfter; + late final OptionallastMessageBefore; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterConversationsVariables.fromJson(Map json) { + + + status = Optional.optional((data) => ConversationStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : ConversationStatus.values.byName(json['status']); + + + conversationType = Optional.optional((data) => ConversationType.values.byName(data), enumSerializer); + conversationType.value = json['conversationType'] == null ? null : ConversationType.values.byName(json['conversationType']); + + + isGroup = Optional.optional(nativeFromJson, nativeToJson); + isGroup.value = json['isGroup'] == null ? null : nativeFromJson(json['isGroup']); + + + lastMessageAfter = Optional.optional((json) => json['lastMessageAfter'] = Timestamp.fromJson(json['lastMessageAfter']), defaultSerializer); + lastMessageAfter.value = json['lastMessageAfter'] == null ? null : Timestamp.fromJson(json['lastMessageAfter']); + + + lastMessageBefore = Optional.optional((json) => json['lastMessageBefore'] = Timestamp.fromJson(json['lastMessageBefore']), defaultSerializer); + lastMessageBefore.value = json['lastMessageBefore'] == null ? null : Timestamp.fromJson(json['lastMessageBefore']); + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterConversationsVariables otherTyped = other as FilterConversationsVariables; + return status == otherTyped.status && + conversationType == otherTyped.conversationType && + isGroup == otherTyped.isGroup && + lastMessageAfter == otherTyped.lastMessageAfter && + lastMessageBefore == otherTyped.lastMessageBefore && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([status.hashCode, conversationType.hashCode, isGroup.hashCode, lastMessageAfter.hashCode, lastMessageBefore.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(conversationType.state == OptionalState.set) { + json['conversationType'] = conversationType.toJson(); + } + if(isGroup.state == OptionalState.set) { + json['isGroup'] = isGroup.toJson(); + } + if(lastMessageAfter.state == OptionalState.set) { + json['lastMessageAfter'] = lastMessageAfter.toJson(); + } + if(lastMessageBefore.state == OptionalState.set) { + json['lastMessageBefore'] = lastMessageBefore.toJson(); + } + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + FilterConversationsVariables({ + required this.status, + required this.conversationType, + required this.isGroup, + required this.lastMessageAfter, + required this.lastMessageBefore, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_courses.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_courses.dart new file mode 100644 index 00000000..0e0b44a3 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_courses.dart @@ -0,0 +1,250 @@ +part of 'generated.dart'; + +class FilterCoursesVariablesBuilder { + Optional _categoryId = Optional.optional(nativeFromJson, nativeToJson); + Optional _isCertification = Optional.optional(nativeFromJson, nativeToJson); + Optional _levelRequired = Optional.optional(nativeFromJson, nativeToJson); + Optional _completed = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterCoursesVariablesBuilder categoryId(String? t) { + _categoryId.value = t; + return this; + } + FilterCoursesVariablesBuilder isCertification(bool? t) { + _isCertification.value = t; + return this; + } + FilterCoursesVariablesBuilder levelRequired(String? t) { + _levelRequired.value = t; + return this; + } + FilterCoursesVariablesBuilder completed(bool? t) { + _completed.value = t; + return this; + } + + FilterCoursesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterCoursesData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterCoursesVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterCoursesVariables vars= FilterCoursesVariables(categoryId: _categoryId,isCertification: _isCertification,levelRequired: _levelRequired,completed: _completed,); + return _dataConnect.query("filterCourses", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterCoursesCourses { + final String id; + final String? title; + final String categoryId; + final String? levelRequired; + final bool? isCertification; + final FilterCoursesCoursesCategory category; + FilterCoursesCourses.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = json['title'] == null ? null : nativeFromJson(json['title']), + categoryId = nativeFromJson(json['categoryId']), + levelRequired = json['levelRequired'] == null ? null : nativeFromJson(json['levelRequired']), + isCertification = json['isCertification'] == null ? null : nativeFromJson(json['isCertification']), + category = FilterCoursesCoursesCategory.fromJson(json['category']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterCoursesCourses otherTyped = other as FilterCoursesCourses; + return id == otherTyped.id && + title == otherTyped.title && + categoryId == otherTyped.categoryId && + levelRequired == otherTyped.levelRequired && + isCertification == otherTyped.isCertification && + category == otherTyped.category; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, categoryId.hashCode, levelRequired.hashCode, isCertification.hashCode, category.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (title != null) { + json['title'] = nativeToJson(title); + } + json['categoryId'] = nativeToJson(categoryId); + if (levelRequired != null) { + json['levelRequired'] = nativeToJson(levelRequired); + } + if (isCertification != null) { + json['isCertification'] = nativeToJson(isCertification); + } + json['category'] = category.toJson(); + return json; + } + + FilterCoursesCourses({ + required this.id, + this.title, + required this.categoryId, + this.levelRequired, + this.isCertification, + required this.category, + }); +} + +@immutable +class FilterCoursesCoursesCategory { + final String id; + final String label; + FilterCoursesCoursesCategory.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + label = nativeFromJson(json['label']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterCoursesCoursesCategory otherTyped = other as FilterCoursesCoursesCategory; + return id == otherTyped.id && + label == otherTyped.label; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, label.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['label'] = nativeToJson(label); + return json; + } + + FilterCoursesCoursesCategory({ + required this.id, + required this.label, + }); +} + +@immutable +class FilterCoursesData { + final List courses; + FilterCoursesData.fromJson(dynamic json): + + courses = (json['courses'] as List) + .map((e) => FilterCoursesCourses.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterCoursesData otherTyped = other as FilterCoursesData; + return courses == otherTyped.courses; + + } + @override + int get hashCode => courses.hashCode; + + + Map toJson() { + Map json = {}; + json['courses'] = courses.map((e) => e.toJson()).toList(); + return json; + } + + FilterCoursesData({ + required this.courses, + }); +} + +@immutable +class FilterCoursesVariables { + late final OptionalcategoryId; + late final OptionalisCertification; + late final OptionallevelRequired; + late final Optionalcompleted; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterCoursesVariables.fromJson(Map json) { + + + categoryId = Optional.optional(nativeFromJson, nativeToJson); + categoryId.value = json['categoryId'] == null ? null : nativeFromJson(json['categoryId']); + + + isCertification = Optional.optional(nativeFromJson, nativeToJson); + isCertification.value = json['isCertification'] == null ? null : nativeFromJson(json['isCertification']); + + + levelRequired = Optional.optional(nativeFromJson, nativeToJson); + levelRequired.value = json['levelRequired'] == null ? null : nativeFromJson(json['levelRequired']); + + + completed = Optional.optional(nativeFromJson, nativeToJson); + completed.value = json['completed'] == null ? null : nativeFromJson(json['completed']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterCoursesVariables otherTyped = other as FilterCoursesVariables; + return categoryId == otherTyped.categoryId && + isCertification == otherTyped.isCertification && + levelRequired == otherTyped.levelRequired && + completed == otherTyped.completed; + + } + @override + int get hashCode => Object.hashAll([categoryId.hashCode, isCertification.hashCode, levelRequired.hashCode, completed.hashCode]); + + + Map toJson() { + Map json = {}; + if(categoryId.state == OptionalState.set) { + json['categoryId'] = categoryId.toJson(); + } + if(isCertification.state == OptionalState.set) { + json['isCertification'] = isCertification.toJson(); + } + if(levelRequired.state == OptionalState.set) { + json['levelRequired'] = levelRequired.toJson(); + } + if(completed.state == OptionalState.set) { + json['completed'] = completed.toJson(); + } + return json; + } + + FilterCoursesVariables({ + required this.categoryId, + required this.isCertification, + required this.levelRequired, + required this.completed, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_documents.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_documents.dart new file mode 100644 index 00000000..37bb2dec --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_documents.dart @@ -0,0 +1,161 @@ +part of 'generated.dart'; + +class FilterDocumentsVariablesBuilder { + Optional _documentType = Optional.optional((data) => DocumentType.values.byName(data), enumSerializer); + + final FirebaseDataConnect _dataConnect; + FilterDocumentsVariablesBuilder documentType(DocumentType? t) { + _documentType.value = t; + return this; + } + + FilterDocumentsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterDocumentsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterDocumentsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterDocumentsVariables vars= FilterDocumentsVariables(documentType: _documentType,); + return _dataConnect.query("filterDocuments", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterDocumentsDocuments { + final String id; + final EnumValue documentType; + final String name; + final String? description; + final Timestamp? createdAt; + FilterDocumentsDocuments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + documentType = documentTypeDeserializer(json['documentType']), + name = nativeFromJson(json['name']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterDocumentsDocuments otherTyped = other as FilterDocumentsDocuments; + return id == otherTyped.id && + documentType == otherTyped.documentType && + name == otherTyped.name && + description == otherTyped.description && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, documentType.hashCode, name.hashCode, description.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['documentType'] = + documentTypeSerializer(documentType) + ; + json['name'] = nativeToJson(name); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + FilterDocumentsDocuments({ + required this.id, + required this.documentType, + required this.name, + this.description, + this.createdAt, + }); +} + +@immutable +class FilterDocumentsData { + final List documents; + FilterDocumentsData.fromJson(dynamic json): + + documents = (json['documents'] as List) + .map((e) => FilterDocumentsDocuments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterDocumentsData otherTyped = other as FilterDocumentsData; + return documents == otherTyped.documents; + + } + @override + int get hashCode => documents.hashCode; + + + Map toJson() { + Map json = {}; + json['documents'] = documents.map((e) => e.toJson()).toList(); + return json; + } + + FilterDocumentsData({ + required this.documents, + }); +} + +@immutable +class FilterDocumentsVariables { + late final OptionaldocumentType; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterDocumentsVariables.fromJson(Map json) { + + + documentType = Optional.optional((data) => DocumentType.values.byName(data), enumSerializer); + documentType.value = json['documentType'] == null ? null : DocumentType.values.byName(json['documentType']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterDocumentsVariables otherTyped = other as FilterDocumentsVariables; + return documentType == otherTyped.documentType; + + } + @override + int get hashCode => documentType.hashCode; + + + Map toJson() { + Map json = {}; + if(documentType.state == OptionalState.set) { + json['documentType'] = documentType.toJson(); + } + return json; + } + + FilterDocumentsVariables({ + required this.documentType, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_faq_datas.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_faq_datas.dart new file mode 100644 index 00000000..dc3778b1 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_faq_datas.dart @@ -0,0 +1,149 @@ +part of 'generated.dart'; + +class FilterFaqDatasVariablesBuilder { + Optional _category = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterFaqDatasVariablesBuilder category(String? t) { + _category.value = t; + return this; + } + + FilterFaqDatasVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterFaqDatasData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterFaqDatasVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterFaqDatasVariables vars= FilterFaqDatasVariables(category: _category,); + return _dataConnect.query("filterFaqDatas", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterFaqDatasFaqDatas { + final String id; + final String category; + final List? questions; + FilterFaqDatasFaqDatas.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + category = nativeFromJson(json['category']), + questions = json['questions'] == null ? null : (json['questions'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterFaqDatasFaqDatas otherTyped = other as FilterFaqDatasFaqDatas; + return id == otherTyped.id && + category == otherTyped.category && + questions == otherTyped.questions; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, category.hashCode, questions.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['category'] = nativeToJson(category); + if (questions != null) { + json['questions'] = questions?.map((e) => e!.toJson()).toList(); + } + return json; + } + + FilterFaqDatasFaqDatas({ + required this.id, + required this.category, + this.questions, + }); +} + +@immutable +class FilterFaqDatasData { + final List faqDatas; + FilterFaqDatasData.fromJson(dynamic json): + + faqDatas = (json['faqDatas'] as List) + .map((e) => FilterFaqDatasFaqDatas.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterFaqDatasData otherTyped = other as FilterFaqDatasData; + return faqDatas == otherTyped.faqDatas; + + } + @override + int get hashCode => faqDatas.hashCode; + + + Map toJson() { + Map json = {}; + json['faqDatas'] = faqDatas.map((e) => e.toJson()).toList(); + return json; + } + + FilterFaqDatasData({ + required this.faqDatas, + }); +} + +@immutable +class FilterFaqDatasVariables { + late final Optionalcategory; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterFaqDatasVariables.fromJson(Map json) { + + + category = Optional.optional(nativeFromJson, nativeToJson); + category.value = json['category'] == null ? null : nativeFromJson(json['category']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterFaqDatasVariables otherTyped = other as FilterFaqDatasVariables; + return category == otherTyped.category; + + } + @override + int get hashCode => category.hashCode; + + + Map toJson() { + Map json = {}; + if(category.state == OptionalState.set) { + json['category'] = category.toJson(); + } + return json; + } + + FilterFaqDatasVariables({ + required this.category, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_hubs.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_hubs.dart new file mode 100644 index 00000000..cc3484c8 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_hubs.dart @@ -0,0 +1,196 @@ +part of 'generated.dart'; + +class FilterHubsVariablesBuilder { + Optional _ownerId = Optional.optional(nativeFromJson, nativeToJson); + Optional _name = Optional.optional(nativeFromJson, nativeToJson); + Optional _nfcTagId = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterHubsVariablesBuilder ownerId(String? t) { + _ownerId.value = t; + return this; + } + FilterHubsVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + FilterHubsVariablesBuilder nfcTagId(String? t) { + _nfcTagId.value = t; + return this; + } + + FilterHubsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterHubsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterHubsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterHubsVariables vars= FilterHubsVariables(ownerId: _ownerId,name: _name,nfcTagId: _nfcTagId,); + return _dataConnect.query("filterHubs", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterHubsHubs { + final String id; + final String name; + final String? locationName; + final String? address; + final String? nfcTagId; + final String ownerId; + FilterHubsHubs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + locationName = json['locationName'] == null ? null : nativeFromJson(json['locationName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + nfcTagId = json['nfcTagId'] == null ? null : nativeFromJson(json['nfcTagId']), + ownerId = nativeFromJson(json['ownerId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterHubsHubs otherTyped = other as FilterHubsHubs; + return id == otherTyped.id && + name == otherTyped.name && + locationName == otherTyped.locationName && + address == otherTyped.address && + nfcTagId == otherTyped.nfcTagId && + ownerId == otherTyped.ownerId; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, locationName.hashCode, address.hashCode, nfcTagId.hashCode, ownerId.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + if (locationName != null) { + json['locationName'] = nativeToJson(locationName); + } + if (address != null) { + json['address'] = nativeToJson(address); + } + if (nfcTagId != null) { + json['nfcTagId'] = nativeToJson(nfcTagId); + } + json['ownerId'] = nativeToJson(ownerId); + return json; + } + + FilterHubsHubs({ + required this.id, + required this.name, + this.locationName, + this.address, + this.nfcTagId, + required this.ownerId, + }); +} + +@immutable +class FilterHubsData { + final List hubs; + FilterHubsData.fromJson(dynamic json): + + hubs = (json['hubs'] as List) + .map((e) => FilterHubsHubs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterHubsData otherTyped = other as FilterHubsData; + return hubs == otherTyped.hubs; + + } + @override + int get hashCode => hubs.hashCode; + + + Map toJson() { + Map json = {}; + json['hubs'] = hubs.map((e) => e.toJson()).toList(); + return json; + } + + FilterHubsData({ + required this.hubs, + }); +} + +@immutable +class FilterHubsVariables { + late final OptionalownerId; + late final Optionalname; + late final OptionalnfcTagId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterHubsVariables.fromJson(Map json) { + + + ownerId = Optional.optional(nativeFromJson, nativeToJson); + ownerId.value = json['ownerId'] == null ? null : nativeFromJson(json['ownerId']); + + + name = Optional.optional(nativeFromJson, nativeToJson); + name.value = json['name'] == null ? null : nativeFromJson(json['name']); + + + nfcTagId = Optional.optional(nativeFromJson, nativeToJson); + nfcTagId.value = json['nfcTagId'] == null ? null : nativeFromJson(json['nfcTagId']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterHubsVariables otherTyped = other as FilterHubsVariables; + return ownerId == otherTyped.ownerId && + name == otherTyped.name && + nfcTagId == otherTyped.nfcTagId; + + } + @override + int get hashCode => Object.hashAll([ownerId.hashCode, name.hashCode, nfcTagId.hashCode]); + + + Map toJson() { + Map json = {}; + if(ownerId.state == OptionalState.set) { + json['ownerId'] = ownerId.toJson(); + } + if(name.state == OptionalState.set) { + json['name'] = name.toJson(); + } + if(nfcTagId.state == OptionalState.set) { + json['nfcTagId'] = nfcTagId.toJson(); + } + return json; + } + + FilterHubsVariables({ + required this.ownerId, + required this.name, + required this.nfcTagId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_invoices.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_invoices.dart new file mode 100644 index 00000000..6a4dd128 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_invoices.dart @@ -0,0 +1,594 @@ +part of 'generated.dart'; + +class FilterInvoicesVariablesBuilder { + Optional _vendorId = Optional.optional(nativeFromJson, nativeToJson); + Optional _businessId = Optional.optional(nativeFromJson, nativeToJson); + Optional _orderId = Optional.optional(nativeFromJson, nativeToJson); + Optional _status = Optional.optional((data) => InvoiceStatus.values.byName(data), enumSerializer); + Optional _issueDateFrom = Optional.optional((json) => json['issueDateFrom'] = Timestamp.fromJson(json['issueDateFrom']), defaultSerializer); + Optional _issueDateTo = Optional.optional((json) => json['issueDateTo'] = Timestamp.fromJson(json['issueDateTo']), defaultSerializer); + Optional _dueDateFrom = Optional.optional((json) => json['dueDateFrom'] = Timestamp.fromJson(json['dueDateFrom']), defaultSerializer); + Optional _dueDateTo = Optional.optional((json) => json['dueDateTo'] = Timestamp.fromJson(json['dueDateTo']), defaultSerializer); + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterInvoicesVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + FilterInvoicesVariablesBuilder businessId(String? t) { + _businessId.value = t; + return this; + } + FilterInvoicesVariablesBuilder orderId(String? t) { + _orderId.value = t; + return this; + } + FilterInvoicesVariablesBuilder status(InvoiceStatus? t) { + _status.value = t; + return this; + } + FilterInvoicesVariablesBuilder issueDateFrom(Timestamp? t) { + _issueDateFrom.value = t; + return this; + } + FilterInvoicesVariablesBuilder issueDateTo(Timestamp? t) { + _issueDateTo.value = t; + return this; + } + FilterInvoicesVariablesBuilder dueDateFrom(Timestamp? t) { + _dueDateFrom.value = t; + return this; + } + FilterInvoicesVariablesBuilder dueDateTo(Timestamp? t) { + _dueDateTo.value = t; + return this; + } + FilterInvoicesVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterInvoicesVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + FilterInvoicesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterInvoicesData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterInvoicesVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterInvoicesVariables vars= FilterInvoicesVariables(vendorId: _vendorId,businessId: _businessId,orderId: _orderId,status: _status,issueDateFrom: _issueDateFrom,issueDateTo: _issueDateTo,dueDateFrom: _dueDateFrom,dueDateTo: _dueDateTo,offset: _offset,limit: _limit,); + return _dataConnect.query("filterInvoices", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterInvoicesInvoices { + final String id; + final EnumValue status; + final String vendorId; + final String businessId; + final String orderId; + final EnumValue? paymentTerms; + final String invoiceNumber; + final Timestamp issueDate; + final Timestamp dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final AnyValue? disputedItems; + final String? disputeReason; + final String? disputeDetails; + final FilterInvoicesInvoicesVendor vendor; + final FilterInvoicesInvoicesBusiness business; + final FilterInvoicesInvoicesOrder order; + FilterInvoicesInvoices.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + status = invoiceStatusDeserializer(json['status']), + vendorId = nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderId = nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsDeserializer(json['paymentTerms']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + issueDate = Timestamp.fromJson(json['issueDate']), + dueDate = Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + disputedItems = json['disputedItems'] == null ? null : AnyValue.fromJson(json['disputedItems']), + disputeReason = json['disputeReason'] == null ? null : nativeFromJson(json['disputeReason']), + disputeDetails = json['disputeDetails'] == null ? null : nativeFromJson(json['disputeDetails']), + vendor = FilterInvoicesInvoicesVendor.fromJson(json['vendor']), + business = FilterInvoicesInvoicesBusiness.fromJson(json['business']), + order = FilterInvoicesInvoicesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterInvoicesInvoices otherTyped = other as FilterInvoicesInvoices; + return id == otherTyped.id && + status == otherTyped.status && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + disputedItems == otherTyped.disputedItems && + disputeReason == otherTyped.disputeReason && + disputeDetails == otherTyped.disputeDetails && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, status.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, disputedItems.hashCode, disputeReason.hashCode, disputeDetails.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['status'] = + invoiceStatusSerializer(status) + ; + json['vendorId'] = nativeToJson(vendorId); + json['businessId'] = nativeToJson(businessId); + json['orderId'] = nativeToJson(orderId); + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsSerializer(paymentTerms!) + ; + } + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['issueDate'] = issueDate.toJson(); + json['dueDate'] = dueDate.toJson(); + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + json['amount'] = nativeToJson(amount); + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (disputedItems != null) { + json['disputedItems'] = disputedItems!.toJson(); + } + if (disputeReason != null) { + json['disputeReason'] = nativeToJson(disputeReason); + } + if (disputeDetails != null) { + json['disputeDetails'] = nativeToJson(disputeDetails); + } + json['vendor'] = vendor.toJson(); + json['business'] = business.toJson(); + json['order'] = order.toJson(); + return json; + } + + FilterInvoicesInvoices({ + required this.id, + required this.status, + required this.vendorId, + required this.businessId, + required this.orderId, + this.paymentTerms, + required this.invoiceNumber, + required this.issueDate, + required this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + required this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.disputedItems, + this.disputeReason, + this.disputeDetails, + required this.vendor, + required this.business, + required this.order, + }); +} + +@immutable +class FilterInvoicesInvoicesVendor { + final String companyName; + final String? address; + final String? email; + final String? phone; + FilterInvoicesInvoicesVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterInvoicesInvoicesVendor otherTyped = other as FilterInvoicesInvoicesVendor; + return companyName == otherTyped.companyName && + address == otherTyped.address && + email == otherTyped.email && + phone == otherTyped.phone; + + } + @override + int get hashCode => Object.hashAll([companyName.hashCode, address.hashCode, email.hashCode, phone.hashCode]); + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + return json; + } + + FilterInvoicesInvoicesVendor({ + required this.companyName, + this.address, + this.email, + this.phone, + }); +} + +@immutable +class FilterInvoicesInvoicesBusiness { + final String businessName; + final String? address; + final String? phone; + final String? email; + FilterInvoicesInvoicesBusiness.fromJson(dynamic json): + + businessName = nativeFromJson(json['businessName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterInvoicesInvoicesBusiness otherTyped = other as FilterInvoicesInvoicesBusiness; + return businessName == otherTyped.businessName && + address == otherTyped.address && + phone == otherTyped.phone && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([businessName.hashCode, address.hashCode, phone.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessName'] = nativeToJson(businessName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + FilterInvoicesInvoicesBusiness({ + required this.businessName, + this.address, + this.phone, + this.email, + }); +} + +@immutable +class FilterInvoicesInvoicesOrder { + final String? eventName; + final String? hub; + final String? deparment; + final String? poReference; + FilterInvoicesInvoicesOrder.fromJson(dynamic json): + + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + deparment = json['deparment'] == null ? null : nativeFromJson(json['deparment']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterInvoicesInvoicesOrder otherTyped = other as FilterInvoicesInvoicesOrder; + return eventName == otherTyped.eventName && + hub == otherTyped.hub && + deparment == otherTyped.deparment && + poReference == otherTyped.poReference; + + } + @override + int get hashCode => Object.hashAll([eventName.hashCode, hub.hashCode, deparment.hashCode, poReference.hashCode]); + + + Map toJson() { + Map json = {}; + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (deparment != null) { + json['deparment'] = nativeToJson(deparment); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + return json; + } + + FilterInvoicesInvoicesOrder({ + this.eventName, + this.hub, + this.deparment, + this.poReference, + }); +} + +@immutable +class FilterInvoicesData { + final List invoices; + FilterInvoicesData.fromJson(dynamic json): + + invoices = (json['invoices'] as List) + .map((e) => FilterInvoicesInvoices.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterInvoicesData otherTyped = other as FilterInvoicesData; + return invoices == otherTyped.invoices; + + } + @override + int get hashCode => invoices.hashCode; + + + Map toJson() { + Map json = {}; + json['invoices'] = invoices.map((e) => e.toJson()).toList(); + return json; + } + + FilterInvoicesData({ + required this.invoices, + }); +} + +@immutable +class FilterInvoicesVariables { + late final OptionalvendorId; + late final OptionalbusinessId; + late final OptionalorderId; + late final Optionalstatus; + late final OptionalissueDateFrom; + late final OptionalissueDateTo; + late final OptionaldueDateFrom; + late final OptionaldueDateTo; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterInvoicesVariables.fromJson(Map json) { + + + vendorId = Optional.optional(nativeFromJson, nativeToJson); + vendorId.value = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + + + businessId = Optional.optional(nativeFromJson, nativeToJson); + businessId.value = json['businessId'] == null ? null : nativeFromJson(json['businessId']); + + + orderId = Optional.optional(nativeFromJson, nativeToJson); + orderId.value = json['orderId'] == null ? null : nativeFromJson(json['orderId']); + + + status = Optional.optional((data) => InvoiceStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : InvoiceStatus.values.byName(json['status']); + + + issueDateFrom = Optional.optional((json) => json['issueDateFrom'] = Timestamp.fromJson(json['issueDateFrom']), defaultSerializer); + issueDateFrom.value = json['issueDateFrom'] == null ? null : Timestamp.fromJson(json['issueDateFrom']); + + + issueDateTo = Optional.optional((json) => json['issueDateTo'] = Timestamp.fromJson(json['issueDateTo']), defaultSerializer); + issueDateTo.value = json['issueDateTo'] == null ? null : Timestamp.fromJson(json['issueDateTo']); + + + dueDateFrom = Optional.optional((json) => json['dueDateFrom'] = Timestamp.fromJson(json['dueDateFrom']), defaultSerializer); + dueDateFrom.value = json['dueDateFrom'] == null ? null : Timestamp.fromJson(json['dueDateFrom']); + + + dueDateTo = Optional.optional((json) => json['dueDateTo'] = Timestamp.fromJson(json['dueDateTo']), defaultSerializer); + dueDateTo.value = json['dueDateTo'] == null ? null : Timestamp.fromJson(json['dueDateTo']); + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterInvoicesVariables otherTyped = other as FilterInvoicesVariables; + return vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + status == otherTyped.status && + issueDateFrom == otherTyped.issueDateFrom && + issueDateTo == otherTyped.issueDateTo && + dueDateFrom == otherTyped.dueDateFrom && + dueDateTo == otherTyped.dueDateTo && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, businessId.hashCode, orderId.hashCode, status.hashCode, issueDateFrom.hashCode, issueDateTo.hashCode, dueDateFrom.hashCode, dueDateTo.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(vendorId.state == OptionalState.set) { + json['vendorId'] = vendorId.toJson(); + } + if(businessId.state == OptionalState.set) { + json['businessId'] = businessId.toJson(); + } + if(orderId.state == OptionalState.set) { + json['orderId'] = orderId.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(issueDateFrom.state == OptionalState.set) { + json['issueDateFrom'] = issueDateFrom.toJson(); + } + if(issueDateTo.state == OptionalState.set) { + json['issueDateTo'] = issueDateTo.toJson(); + } + if(dueDateFrom.state == OptionalState.set) { + json['dueDateFrom'] = dueDateFrom.toJson(); + } + if(dueDateTo.state == OptionalState.set) { + json['dueDateTo'] = dueDateTo.toJson(); + } + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + FilterInvoicesVariables({ + required this.vendorId, + required this.businessId, + required this.orderId, + required this.status, + required this.issueDateFrom, + required this.issueDateTo, + required this.dueDateFrom, + required this.dueDateTo, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_levels.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_levels.dart new file mode 100644 index 00000000..230ed4e5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_levels.dart @@ -0,0 +1,174 @@ +part of 'generated.dart'; + +class FilterLevelsVariablesBuilder { + Optional _name = Optional.optional(nativeFromJson, nativeToJson); + Optional _xpRequired = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterLevelsVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + FilterLevelsVariablesBuilder xpRequired(int? t) { + _xpRequired.value = t; + return this; + } + + FilterLevelsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterLevelsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterLevelsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterLevelsVariables vars= FilterLevelsVariables(name: _name,xpRequired: _xpRequired,); + return _dataConnect.query("filterLevels", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterLevelsLevels { + final String id; + final String name; + final int xpRequired; + final String? icon; + final AnyValue? colors; + FilterLevelsLevels.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + xpRequired = nativeFromJson(json['xpRequired']), + icon = json['icon'] == null ? null : nativeFromJson(json['icon']), + colors = json['colors'] == null ? null : AnyValue.fromJson(json['colors']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterLevelsLevels otherTyped = other as FilterLevelsLevels; + return id == otherTyped.id && + name == otherTyped.name && + xpRequired == otherTyped.xpRequired && + icon == otherTyped.icon && + colors == otherTyped.colors; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, xpRequired.hashCode, icon.hashCode, colors.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['xpRequired'] = nativeToJson(xpRequired); + if (icon != null) { + json['icon'] = nativeToJson(icon); + } + if (colors != null) { + json['colors'] = colors!.toJson(); + } + return json; + } + + FilterLevelsLevels({ + required this.id, + required this.name, + required this.xpRequired, + this.icon, + this.colors, + }); +} + +@immutable +class FilterLevelsData { + final List levels; + FilterLevelsData.fromJson(dynamic json): + + levels = (json['levels'] as List) + .map((e) => FilterLevelsLevels.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterLevelsData otherTyped = other as FilterLevelsData; + return levels == otherTyped.levels; + + } + @override + int get hashCode => levels.hashCode; + + + Map toJson() { + Map json = {}; + json['levels'] = levels.map((e) => e.toJson()).toList(); + return json; + } + + FilterLevelsData({ + required this.levels, + }); +} + +@immutable +class FilterLevelsVariables { + late final Optionalname; + late final OptionalxpRequired; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterLevelsVariables.fromJson(Map json) { + + + name = Optional.optional(nativeFromJson, nativeToJson); + name.value = json['name'] == null ? null : nativeFromJson(json['name']); + + + xpRequired = Optional.optional(nativeFromJson, nativeToJson); + xpRequired.value = json['xpRequired'] == null ? null : nativeFromJson(json['xpRequired']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterLevelsVariables otherTyped = other as FilterLevelsVariables; + return name == otherTyped.name && + xpRequired == otherTyped.xpRequired; + + } + @override + int get hashCode => Object.hashAll([name.hashCode, xpRequired.hashCode]); + + + Map toJson() { + Map json = {}; + if(name.state == OptionalState.set) { + json['name'] = name.toJson(); + } + if(xpRequired.state == OptionalState.set) { + json['xpRequired'] = xpRequired.toJson(); + } + return json; + } + + FilterLevelsVariables({ + required this.name, + required this.xpRequired, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_shifts.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_shifts.dart new file mode 100644 index 00000000..c82e41c4 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_shifts.dart @@ -0,0 +1,533 @@ +part of 'generated.dart'; + +class FilterShiftsVariablesBuilder { + Optional _status = Optional.optional((data) => ShiftStatus.values.byName(data), enumSerializer); + Optional _orderId = Optional.optional(nativeFromJson, nativeToJson); + Optional _dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer); + Optional _dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer); + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterShiftsVariablesBuilder status(ShiftStatus? t) { + _status.value = t; + return this; + } + FilterShiftsVariablesBuilder orderId(String? t) { + _orderId.value = t; + return this; + } + FilterShiftsVariablesBuilder dateFrom(Timestamp? t) { + _dateFrom.value = t; + return this; + } + FilterShiftsVariablesBuilder dateTo(Timestamp? t) { + _dateTo.value = t; + return this; + } + FilterShiftsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterShiftsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + FilterShiftsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterShiftsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterShiftsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterShiftsVariables vars= FilterShiftsVariables(status: _status,orderId: _orderId,dateFrom: _dateFrom,dateTo: _dateTo,offset: _offset,limit: _limit,); + return _dataConnect.query("filterShifts", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterShiftsShifts { + final String id; + final String title; + final String orderId; + final Timestamp? date; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? cost; + final String? location; + final String? locationAddress; + final double? latitude; + final double? longitude; + final String? description; + final EnumValue? status; + final int? workersNeeded; + final int? filled; + final Timestamp? filledAt; + final List? managers; + final int? durationDays; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final FilterShiftsShiftsOrder order; + FilterShiftsShifts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + orderId = nativeFromJson(json['orderId']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + cost = json['cost'] == null ? null : nativeFromJson(json['cost']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + latitude = json['latitude'] == null ? null : nativeFromJson(json['latitude']), + longitude = json['longitude'] == null ? null : nativeFromJson(json['longitude']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson(json['workersNeeded']), + filled = json['filled'] == null ? null : nativeFromJson(json['filled']), + filledAt = json['filledAt'] == null ? null : Timestamp.fromJson(json['filledAt']), + managers = json['managers'] == null ? null : (json['managers'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(), + durationDays = json['durationDays'] == null ? null : nativeFromJson(json['durationDays']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + order = FilterShiftsShiftsOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterShiftsShifts otherTyped = other as FilterShiftsShifts; + return id == otherTyped.id && + title == otherTyped.title && + orderId == otherTyped.orderId && + date == otherTyped.date && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + cost == otherTyped.cost && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + latitude == otherTyped.latitude && + longitude == otherTyped.longitude && + description == otherTyped.description && + status == otherTyped.status && + workersNeeded == otherTyped.workersNeeded && + filled == otherTyped.filled && + filledAt == otherTyped.filledAt && + managers == otherTyped.managers && + durationDays == otherTyped.durationDays && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + json['orderId'] = nativeToJson(orderId); + if (date != null) { + json['date'] = date!.toJson(); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (cost != null) { + json['cost'] = nativeToJson(cost); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (latitude != null) { + json['latitude'] = nativeToJson(latitude); + } + if (longitude != null) { + json['longitude'] = nativeToJson(longitude); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + if (workersNeeded != null) { + json['workersNeeded'] = nativeToJson(workersNeeded); + } + if (filled != null) { + json['filled'] = nativeToJson(filled); + } + if (filledAt != null) { + json['filledAt'] = filledAt!.toJson(); + } + if (managers != null) { + json['managers'] = managers?.map((e) => e!.toJson()).toList(); + } + if (durationDays != null) { + json['durationDays'] = nativeToJson(durationDays); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['order'] = order.toJson(); + return json; + } + + FilterShiftsShifts({ + required this.id, + required this.title, + required this.orderId, + this.date, + this.startTime, + this.endTime, + this.hours, + this.cost, + this.location, + this.locationAddress, + this.latitude, + this.longitude, + this.description, + this.status, + this.workersNeeded, + this.filled, + this.filledAt, + this.managers, + this.durationDays, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.order, + }); +} + +@immutable +class FilterShiftsShiftsOrder { + final String id; + final String? eventName; + final EnumValue status; + final EnumValue orderType; + final String businessId; + final String? vendorId; + final FilterShiftsShiftsOrderBusiness business; + final FilterShiftsShiftsOrderVendor? vendor; + FilterShiftsShiftsOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + status = orderStatusDeserializer(json['status']), + orderType = orderTypeDeserializer(json['orderType']), + businessId = nativeFromJson(json['businessId']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + business = FilterShiftsShiftsOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : FilterShiftsShiftsOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterShiftsShiftsOrder otherTyped = other as FilterShiftsShiftsOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + status == otherTyped.status && + orderType == otherTyped.orderType && + businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, status.hashCode, orderType.hashCode, businessId.hashCode, vendorId.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['status'] = + orderStatusSerializer(status) + ; + json['orderType'] = + orderTypeSerializer(orderType) + ; + json['businessId'] = nativeToJson(businessId); + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + FilterShiftsShiftsOrder({ + required this.id, + this.eventName, + required this.status, + required this.orderType, + required this.businessId, + this.vendorId, + required this.business, + this.vendor, + }); +} + +@immutable +class FilterShiftsShiftsOrderBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + FilterShiftsShiftsOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterShiftsShiftsOrderBusiness otherTyped = other as FilterShiftsShiftsOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + FilterShiftsShiftsOrderBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class FilterShiftsShiftsOrderVendor { + final String id; + final String companyName; + FilterShiftsShiftsOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterShiftsShiftsOrderVendor otherTyped = other as FilterShiftsShiftsOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + FilterShiftsShiftsOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class FilterShiftsData { + final List shifts; + FilterShiftsData.fromJson(dynamic json): + + shifts = (json['shifts'] as List) + .map((e) => FilterShiftsShifts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterShiftsData otherTyped = other as FilterShiftsData; + return shifts == otherTyped.shifts; + + } + @override + int get hashCode => shifts.hashCode; + + + Map toJson() { + Map json = {}; + json['shifts'] = shifts.map((e) => e.toJson()).toList(); + return json; + } + + FilterShiftsData({ + required this.shifts, + }); +} + +@immutable +class FilterShiftsVariables { + late final Optionalstatus; + late final OptionalorderId; + late final OptionaldateFrom; + late final OptionaldateTo; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterShiftsVariables.fromJson(Map json) { + + + status = Optional.optional((data) => ShiftStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : ShiftStatus.values.byName(json['status']); + + + orderId = Optional.optional(nativeFromJson, nativeToJson); + orderId.value = json['orderId'] == null ? null : nativeFromJson(json['orderId']); + + + dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer); + dateFrom.value = json['dateFrom'] == null ? null : Timestamp.fromJson(json['dateFrom']); + + + dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer); + dateTo.value = json['dateTo'] == null ? null : Timestamp.fromJson(json['dateTo']); + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterShiftsVariables otherTyped = other as FilterShiftsVariables; + return status == otherTyped.status && + orderId == otherTyped.orderId && + dateFrom == otherTyped.dateFrom && + dateTo == otherTyped.dateTo && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([status.hashCode, orderId.hashCode, dateFrom.hashCode, dateTo.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(orderId.state == OptionalState.set) { + json['orderId'] = orderId.toJson(); + } + if(dateFrom.state == OptionalState.set) { + json['dateFrom'] = dateFrom.toJson(); + } + if(dateTo.state == OptionalState.set) { + json['dateTo'] = dateTo.toJson(); + } + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + FilterShiftsVariables({ + required this.status, + required this.orderId, + required this.dateFrom, + required this.dateTo, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_staff.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_staff.dart new file mode 100644 index 00000000..a3df674f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_staff.dart @@ -0,0 +1,299 @@ +part of 'generated.dart'; + +class FilterStaffVariablesBuilder { + Optional _ownerId = Optional.optional(nativeFromJson, nativeToJson); + Optional _fullName = Optional.optional(nativeFromJson, nativeToJson); + Optional _level = Optional.optional(nativeFromJson, nativeToJson); + Optional _email = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterStaffVariablesBuilder ownerId(String? t) { + _ownerId.value = t; + return this; + } + FilterStaffVariablesBuilder fullName(String? t) { + _fullName.value = t; + return this; + } + FilterStaffVariablesBuilder level(String? t) { + _level.value = t; + return this; + } + FilterStaffVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + + FilterStaffVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterStaffData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterStaffVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterStaffVariables vars= FilterStaffVariables(ownerId: _ownerId,fullName: _fullName,level: _level,email: _email,); + return _dataConnect.query("filterStaff", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterStaffStaffs { + final String id; + final String userId; + final String fullName; + final String? level; + final String? phone; + final String? email; + final String? photoUrl; + final double? averageRating; + final int? reliabilityScore; + final int? totalShifts; + final String? ownerId; + final bool? isRecommended; + final EnumValue? backgroundCheckStatus; + final EnumValue? employmentType; + final String? initial; + final bool? englishRequired; + final String? city; + final String? addres; + FilterStaffStaffs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + userId = nativeFromJson(json['userId']), + fullName = nativeFromJson(json['fullName']), + level = json['level'] == null ? null : nativeFromJson(json['level']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']), + averageRating = json['averageRating'] == null ? null : nativeFromJson(json['averageRating']), + reliabilityScore = json['reliabilityScore'] == null ? null : nativeFromJson(json['reliabilityScore']), + totalShifts = json['totalShifts'] == null ? null : nativeFromJson(json['totalShifts']), + ownerId = json['ownerId'] == null ? null : nativeFromJson(json['ownerId']), + isRecommended = json['isRecommended'] == null ? null : nativeFromJson(json['isRecommended']), + backgroundCheckStatus = json['backgroundCheckStatus'] == null ? null : backgroundCheckStatusDeserializer(json['backgroundCheckStatus']), + employmentType = json['employmentType'] == null ? null : employmentTypeDeserializer(json['employmentType']), + initial = json['initial'] == null ? null : nativeFromJson(json['initial']), + englishRequired = json['englishRequired'] == null ? null : nativeFromJson(json['englishRequired']), + city = json['city'] == null ? null : nativeFromJson(json['city']), + addres = json['addres'] == null ? null : nativeFromJson(json['addres']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterStaffStaffs otherTyped = other as FilterStaffStaffs; + return id == otherTyped.id && + userId == otherTyped.userId && + fullName == otherTyped.fullName && + level == otherTyped.level && + phone == otherTyped.phone && + email == otherTyped.email && + photoUrl == otherTyped.photoUrl && + averageRating == otherTyped.averageRating && + reliabilityScore == otherTyped.reliabilityScore && + totalShifts == otherTyped.totalShifts && + ownerId == otherTyped.ownerId && + isRecommended == otherTyped.isRecommended && + backgroundCheckStatus == otherTyped.backgroundCheckStatus && + employmentType == otherTyped.employmentType && + initial == otherTyped.initial && + englishRequired == otherTyped.englishRequired && + city == otherTyped.city && + addres == otherTyped.addres; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, fullName.hashCode, level.hashCode, phone.hashCode, email.hashCode, photoUrl.hashCode, averageRating.hashCode, reliabilityScore.hashCode, totalShifts.hashCode, ownerId.hashCode, isRecommended.hashCode, backgroundCheckStatus.hashCode, employmentType.hashCode, initial.hashCode, englishRequired.hashCode, city.hashCode, addres.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['userId'] = nativeToJson(userId); + json['fullName'] = nativeToJson(fullName); + if (level != null) { + json['level'] = nativeToJson(level); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + if (averageRating != null) { + json['averageRating'] = nativeToJson(averageRating); + } + if (reliabilityScore != null) { + json['reliabilityScore'] = nativeToJson(reliabilityScore); + } + if (totalShifts != null) { + json['totalShifts'] = nativeToJson(totalShifts); + } + if (ownerId != null) { + json['ownerId'] = nativeToJson(ownerId); + } + if (isRecommended != null) { + json['isRecommended'] = nativeToJson(isRecommended); + } + if (backgroundCheckStatus != null) { + json['backgroundCheckStatus'] = + backgroundCheckStatusSerializer(backgroundCheckStatus!) + ; + } + if (employmentType != null) { + json['employmentType'] = + employmentTypeSerializer(employmentType!) + ; + } + if (initial != null) { + json['initial'] = nativeToJson(initial); + } + if (englishRequired != null) { + json['englishRequired'] = nativeToJson(englishRequired); + } + if (city != null) { + json['city'] = nativeToJson(city); + } + if (addres != null) { + json['addres'] = nativeToJson(addres); + } + return json; + } + + FilterStaffStaffs({ + required this.id, + required this.userId, + required this.fullName, + this.level, + this.phone, + this.email, + this.photoUrl, + this.averageRating, + this.reliabilityScore, + this.totalShifts, + this.ownerId, + this.isRecommended, + this.backgroundCheckStatus, + this.employmentType, + this.initial, + this.englishRequired, + this.city, + this.addres, + }); +} + +@immutable +class FilterStaffData { + final List staffs; + FilterStaffData.fromJson(dynamic json): + + staffs = (json['staffs'] as List) + .map((e) => FilterStaffStaffs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterStaffData otherTyped = other as FilterStaffData; + return staffs == otherTyped.staffs; + + } + @override + int get hashCode => staffs.hashCode; + + + Map toJson() { + Map json = {}; + json['staffs'] = staffs.map((e) => e.toJson()).toList(); + return json; + } + + FilterStaffData({ + required this.staffs, + }); +} + +@immutable +class FilterStaffVariables { + late final OptionalownerId; + late final OptionalfullName; + late final Optionallevel; + late final Optionalemail; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterStaffVariables.fromJson(Map json) { + + + ownerId = Optional.optional(nativeFromJson, nativeToJson); + ownerId.value = json['ownerId'] == null ? null : nativeFromJson(json['ownerId']); + + + fullName = Optional.optional(nativeFromJson, nativeToJson); + fullName.value = json['fullName'] == null ? null : nativeFromJson(json['fullName']); + + + level = Optional.optional(nativeFromJson, nativeToJson); + level.value = json['level'] == null ? null : nativeFromJson(json['level']); + + + email = Optional.optional(nativeFromJson, nativeToJson); + email.value = json['email'] == null ? null : nativeFromJson(json['email']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterStaffVariables otherTyped = other as FilterStaffVariables; + return ownerId == otherTyped.ownerId && + fullName == otherTyped.fullName && + level == otherTyped.level && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([ownerId.hashCode, fullName.hashCode, level.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + if(ownerId.state == OptionalState.set) { + json['ownerId'] = ownerId.toJson(); + } + if(fullName.state == OptionalState.set) { + json['fullName'] = fullName.toJson(); + } + if(level.state == OptionalState.set) { + json['level'] = level.toJson(); + } + if(email.state == OptionalState.set) { + json['email'] = email.toJson(); + } + return json; + } + + FilterStaffVariables({ + required this.ownerId, + required this.fullName, + required this.level, + required this.email, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_staff_availability_stats.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_staff_availability_stats.dart new file mode 100644 index 00000000..56c8cd85 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_staff_availability_stats.dart @@ -0,0 +1,389 @@ +part of 'generated.dart'; + +class FilterStaffAvailabilityStatsVariablesBuilder { + Optional _needWorkIndexMin = Optional.optional(nativeFromJson, nativeToJson); + Optional _needWorkIndexMax = Optional.optional(nativeFromJson, nativeToJson); + Optional _utilizationMin = Optional.optional(nativeFromJson, nativeToJson); + Optional _utilizationMax = Optional.optional(nativeFromJson, nativeToJson); + Optional _acceptanceRateMin = Optional.optional(nativeFromJson, nativeToJson); + Optional _acceptanceRateMax = Optional.optional(nativeFromJson, nativeToJson); + Optional _lastShiftAfter = Optional.optional((json) => json['lastShiftAfter'] = Timestamp.fromJson(json['lastShiftAfter']), defaultSerializer); + Optional _lastShiftBefore = Optional.optional((json) => json['lastShiftBefore'] = Timestamp.fromJson(json['lastShiftBefore']), defaultSerializer); + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterStaffAvailabilityStatsVariablesBuilder needWorkIndexMin(int? t) { + _needWorkIndexMin.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder needWorkIndexMax(int? t) { + _needWorkIndexMax.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder utilizationMin(int? t) { + _utilizationMin.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder utilizationMax(int? t) { + _utilizationMax.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder acceptanceRateMin(int? t) { + _acceptanceRateMin.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder acceptanceRateMax(int? t) { + _acceptanceRateMax.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder lastShiftAfter(Timestamp? t) { + _lastShiftAfter.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder lastShiftBefore(Timestamp? t) { + _lastShiftBefore.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterStaffAvailabilityStatsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + FilterStaffAvailabilityStatsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterStaffAvailabilityStatsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterStaffAvailabilityStatsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterStaffAvailabilityStatsVariables vars= FilterStaffAvailabilityStatsVariables(needWorkIndexMin: _needWorkIndexMin,needWorkIndexMax: _needWorkIndexMax,utilizationMin: _utilizationMin,utilizationMax: _utilizationMax,acceptanceRateMin: _acceptanceRateMin,acceptanceRateMax: _acceptanceRateMax,lastShiftAfter: _lastShiftAfter,lastShiftBefore: _lastShiftBefore,offset: _offset,limit: _limit,); + return _dataConnect.query("filterStaffAvailabilityStats", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterStaffAvailabilityStatsStaffAvailabilityStatss { + final String id; + final String staffId; + final int? needWorkIndex; + final int? utilizationPercentage; + final int? predictedAvailabilityScore; + final int? scheduledHoursThisPeriod; + final int? desiredHoursThisPeriod; + final Timestamp? lastShiftDate; + final int? acceptanceRate; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final FilterStaffAvailabilityStatsStaffAvailabilityStatssStaff staff; + FilterStaffAvailabilityStatsStaffAvailabilityStatss.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + needWorkIndex = json['needWorkIndex'] == null ? null : nativeFromJson(json['needWorkIndex']), + utilizationPercentage = json['utilizationPercentage'] == null ? null : nativeFromJson(json['utilizationPercentage']), + predictedAvailabilityScore = json['predictedAvailabilityScore'] == null ? null : nativeFromJson(json['predictedAvailabilityScore']), + scheduledHoursThisPeriod = json['scheduledHoursThisPeriod'] == null ? null : nativeFromJson(json['scheduledHoursThisPeriod']), + desiredHoursThisPeriod = json['desiredHoursThisPeriod'] == null ? null : nativeFromJson(json['desiredHoursThisPeriod']), + lastShiftDate = json['lastShiftDate'] == null ? null : Timestamp.fromJson(json['lastShiftDate']), + acceptanceRate = json['acceptanceRate'] == null ? null : nativeFromJson(json['acceptanceRate']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + staff = FilterStaffAvailabilityStatsStaffAvailabilityStatssStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterStaffAvailabilityStatsStaffAvailabilityStatss otherTyped = other as FilterStaffAvailabilityStatsStaffAvailabilityStatss; + return id == otherTyped.id && + staffId == otherTyped.staffId && + needWorkIndex == otherTyped.needWorkIndex && + utilizationPercentage == otherTyped.utilizationPercentage && + predictedAvailabilityScore == otherTyped.predictedAvailabilityScore && + scheduledHoursThisPeriod == otherTyped.scheduledHoursThisPeriod && + desiredHoursThisPeriod == otherTyped.desiredHoursThisPeriod && + lastShiftDate == otherTyped.lastShiftDate && + acceptanceRate == otherTyped.acceptanceRate && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, needWorkIndex.hashCode, utilizationPercentage.hashCode, predictedAvailabilityScore.hashCode, scheduledHoursThisPeriod.hashCode, desiredHoursThisPeriod.hashCode, lastShiftDate.hashCode, acceptanceRate.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + if (needWorkIndex != null) { + json['needWorkIndex'] = nativeToJson(needWorkIndex); + } + if (utilizationPercentage != null) { + json['utilizationPercentage'] = nativeToJson(utilizationPercentage); + } + if (predictedAvailabilityScore != null) { + json['predictedAvailabilityScore'] = nativeToJson(predictedAvailabilityScore); + } + if (scheduledHoursThisPeriod != null) { + json['scheduledHoursThisPeriod'] = nativeToJson(scheduledHoursThisPeriod); + } + if (desiredHoursThisPeriod != null) { + json['desiredHoursThisPeriod'] = nativeToJson(desiredHoursThisPeriod); + } + if (lastShiftDate != null) { + json['lastShiftDate'] = lastShiftDate!.toJson(); + } + if (acceptanceRate != null) { + json['acceptanceRate'] = nativeToJson(acceptanceRate); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['staff'] = staff.toJson(); + return json; + } + + FilterStaffAvailabilityStatsStaffAvailabilityStatss({ + required this.id, + required this.staffId, + this.needWorkIndex, + this.utilizationPercentage, + this.predictedAvailabilityScore, + this.scheduledHoursThisPeriod, + this.desiredHoursThisPeriod, + this.lastShiftDate, + this.acceptanceRate, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.staff, + }); +} + +@immutable +class FilterStaffAvailabilityStatsStaffAvailabilityStatssStaff { + final String id; + final String fullName; + FilterStaffAvailabilityStatsStaffAvailabilityStatssStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterStaffAvailabilityStatsStaffAvailabilityStatssStaff otherTyped = other as FilterStaffAvailabilityStatsStaffAvailabilityStatssStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + FilterStaffAvailabilityStatsStaffAvailabilityStatssStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class FilterStaffAvailabilityStatsData { + final List staffAvailabilityStatss; + FilterStaffAvailabilityStatsData.fromJson(dynamic json): + + staffAvailabilityStatss = (json['staffAvailabilityStatss'] as List) + .map((e) => FilterStaffAvailabilityStatsStaffAvailabilityStatss.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterStaffAvailabilityStatsData otherTyped = other as FilterStaffAvailabilityStatsData; + return staffAvailabilityStatss == otherTyped.staffAvailabilityStatss; + + } + @override + int get hashCode => staffAvailabilityStatss.hashCode; + + + Map toJson() { + Map json = {}; + json['staffAvailabilityStatss'] = staffAvailabilityStatss.map((e) => e.toJson()).toList(); + return json; + } + + FilterStaffAvailabilityStatsData({ + required this.staffAvailabilityStatss, + }); +} + +@immutable +class FilterStaffAvailabilityStatsVariables { + late final OptionalneedWorkIndexMin; + late final OptionalneedWorkIndexMax; + late final OptionalutilizationMin; + late final OptionalutilizationMax; + late final OptionalacceptanceRateMin; + late final OptionalacceptanceRateMax; + late final OptionallastShiftAfter; + late final OptionallastShiftBefore; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterStaffAvailabilityStatsVariables.fromJson(Map json) { + + + needWorkIndexMin = Optional.optional(nativeFromJson, nativeToJson); + needWorkIndexMin.value = json['needWorkIndexMin'] == null ? null : nativeFromJson(json['needWorkIndexMin']); + + + needWorkIndexMax = Optional.optional(nativeFromJson, nativeToJson); + needWorkIndexMax.value = json['needWorkIndexMax'] == null ? null : nativeFromJson(json['needWorkIndexMax']); + + + utilizationMin = Optional.optional(nativeFromJson, nativeToJson); + utilizationMin.value = json['utilizationMin'] == null ? null : nativeFromJson(json['utilizationMin']); + + + utilizationMax = Optional.optional(nativeFromJson, nativeToJson); + utilizationMax.value = json['utilizationMax'] == null ? null : nativeFromJson(json['utilizationMax']); + + + acceptanceRateMin = Optional.optional(nativeFromJson, nativeToJson); + acceptanceRateMin.value = json['acceptanceRateMin'] == null ? null : nativeFromJson(json['acceptanceRateMin']); + + + acceptanceRateMax = Optional.optional(nativeFromJson, nativeToJson); + acceptanceRateMax.value = json['acceptanceRateMax'] == null ? null : nativeFromJson(json['acceptanceRateMax']); + + + lastShiftAfter = Optional.optional((json) => json['lastShiftAfter'] = Timestamp.fromJson(json['lastShiftAfter']), defaultSerializer); + lastShiftAfter.value = json['lastShiftAfter'] == null ? null : Timestamp.fromJson(json['lastShiftAfter']); + + + lastShiftBefore = Optional.optional((json) => json['lastShiftBefore'] = Timestamp.fromJson(json['lastShiftBefore']), defaultSerializer); + lastShiftBefore.value = json['lastShiftBefore'] == null ? null : Timestamp.fromJson(json['lastShiftBefore']); + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterStaffAvailabilityStatsVariables otherTyped = other as FilterStaffAvailabilityStatsVariables; + return needWorkIndexMin == otherTyped.needWorkIndexMin && + needWorkIndexMax == otherTyped.needWorkIndexMax && + utilizationMin == otherTyped.utilizationMin && + utilizationMax == otherTyped.utilizationMax && + acceptanceRateMin == otherTyped.acceptanceRateMin && + acceptanceRateMax == otherTyped.acceptanceRateMax && + lastShiftAfter == otherTyped.lastShiftAfter && + lastShiftBefore == otherTyped.lastShiftBefore && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([needWorkIndexMin.hashCode, needWorkIndexMax.hashCode, utilizationMin.hashCode, utilizationMax.hashCode, acceptanceRateMin.hashCode, acceptanceRateMax.hashCode, lastShiftAfter.hashCode, lastShiftBefore.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(needWorkIndexMin.state == OptionalState.set) { + json['needWorkIndexMin'] = needWorkIndexMin.toJson(); + } + if(needWorkIndexMax.state == OptionalState.set) { + json['needWorkIndexMax'] = needWorkIndexMax.toJson(); + } + if(utilizationMin.state == OptionalState.set) { + json['utilizationMin'] = utilizationMin.toJson(); + } + if(utilizationMax.state == OptionalState.set) { + json['utilizationMax'] = utilizationMax.toJson(); + } + if(acceptanceRateMin.state == OptionalState.set) { + json['acceptanceRateMin'] = acceptanceRateMin.toJson(); + } + if(acceptanceRateMax.state == OptionalState.set) { + json['acceptanceRateMax'] = acceptanceRateMax.toJson(); + } + if(lastShiftAfter.state == OptionalState.set) { + json['lastShiftAfter'] = lastShiftAfter.toJson(); + } + if(lastShiftBefore.state == OptionalState.set) { + json['lastShiftBefore'] = lastShiftBefore.toJson(); + } + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + FilterStaffAvailabilityStatsVariables({ + required this.needWorkIndexMin, + required this.needWorkIndexMax, + required this.utilizationMin, + required this.utilizationMax, + required this.acceptanceRateMin, + required this.acceptanceRateMax, + required this.lastShiftAfter, + required this.lastShiftBefore, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_staff_roles.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_staff_roles.dart new file mode 100644 index 00000000..7cfaf69c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_staff_roles.dart @@ -0,0 +1,206 @@ +part of 'generated.dart'; + +class FilterStaffRolesVariablesBuilder { + Optional _staffId = Optional.optional(nativeFromJson, nativeToJson); + Optional _roleId = Optional.optional(nativeFromJson, nativeToJson); + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterStaffRolesVariablesBuilder staffId(String? t) { + _staffId.value = t; + return this; + } + FilterStaffRolesVariablesBuilder roleId(String? t) { + _roleId.value = t; + return this; + } + FilterStaffRolesVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterStaffRolesVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + FilterStaffRolesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterStaffRolesData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterStaffRolesVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterStaffRolesVariables vars= FilterStaffRolesVariables(staffId: _staffId,roleId: _roleId,offset: _offset,limit: _limit,); + return _dataConnect.query("filterStaffRoles", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterStaffRolesStaffRoles { + final String id; + final String staffId; + final String roleId; + final Timestamp? createdAt; + final EnumValue? roleType; + FilterStaffRolesStaffRoles.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + roleId = nativeFromJson(json['roleId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + roleType = json['roleType'] == null ? null : roleTypeDeserializer(json['roleType']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterStaffRolesStaffRoles otherTyped = other as FilterStaffRolesStaffRoles; + return id == otherTyped.id && + staffId == otherTyped.staffId && + roleId == otherTyped.roleId && + createdAt == otherTyped.createdAt && + roleType == otherTyped.roleType; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, roleId.hashCode, createdAt.hashCode, roleType.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['roleId'] = nativeToJson(roleId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (roleType != null) { + json['roleType'] = + roleTypeSerializer(roleType!) + ; + } + return json; + } + + FilterStaffRolesStaffRoles({ + required this.id, + required this.staffId, + required this.roleId, + this.createdAt, + this.roleType, + }); +} + +@immutable +class FilterStaffRolesData { + final List staffRoles; + FilterStaffRolesData.fromJson(dynamic json): + + staffRoles = (json['staffRoles'] as List) + .map((e) => FilterStaffRolesStaffRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterStaffRolesData otherTyped = other as FilterStaffRolesData; + return staffRoles == otherTyped.staffRoles; + + } + @override + int get hashCode => staffRoles.hashCode; + + + Map toJson() { + Map json = {}; + json['staffRoles'] = staffRoles.map((e) => e.toJson()).toList(); + return json; + } + + FilterStaffRolesData({ + required this.staffRoles, + }); +} + +@immutable +class FilterStaffRolesVariables { + late final OptionalstaffId; + late final OptionalroleId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterStaffRolesVariables.fromJson(Map json) { + + + staffId = Optional.optional(nativeFromJson, nativeToJson); + staffId.value = json['staffId'] == null ? null : nativeFromJson(json['staffId']); + + + roleId = Optional.optional(nativeFromJson, nativeToJson); + roleId.value = json['roleId'] == null ? null : nativeFromJson(json['roleId']); + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterStaffRolesVariables otherTyped = other as FilterStaffRolesVariables; + return staffId == otherTyped.staffId && + roleId == otherTyped.roleId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, roleId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(staffId.state == OptionalState.set) { + json['staffId'] = staffId.toJson(); + } + if(roleId.state == OptionalState.set) { + json['roleId'] = roleId.toJson(); + } + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + FilterStaffRolesVariables({ + required this.staffId, + required this.roleId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_tasks.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_tasks.dart new file mode 100644 index 00000000..be84063e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_tasks.dart @@ -0,0 +1,239 @@ +part of 'generated.dart'; + +class FilterTasksVariablesBuilder { + Optional _status = Optional.optional((data) => TaskStatus.values.byName(data), enumSerializer); + Optional _priority = Optional.optional((data) => TaskPriority.values.byName(data), enumSerializer); + + final FirebaseDataConnect _dataConnect; + FilterTasksVariablesBuilder status(TaskStatus? t) { + _status.value = t; + return this; + } + FilterTasksVariablesBuilder priority(TaskPriority? t) { + _priority.value = t; + return this; + } + + FilterTasksVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterTasksData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterTasksVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterTasksVariables vars= FilterTasksVariables(status: _status,priority: _priority,); + return _dataConnect.query("filterTasks", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterTasksTasks { + final String id; + final String taskName; + final String? description; + final EnumValue priority; + final EnumValue status; + final Timestamp? dueDate; + final int? progress; + final int? orderIndex; + final int? commentCount; + final int? attachmentCount; + final AnyValue? files; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + FilterTasksTasks.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + taskName = nativeFromJson(json['taskName']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + priority = taskPriorityDeserializer(json['priority']), + status = taskStatusDeserializer(json['status']), + dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']), + progress = json['progress'] == null ? null : nativeFromJson(json['progress']), + orderIndex = json['orderIndex'] == null ? null : nativeFromJson(json['orderIndex']), + commentCount = json['commentCount'] == null ? null : nativeFromJson(json['commentCount']), + attachmentCount = json['attachmentCount'] == null ? null : nativeFromJson(json['attachmentCount']), + files = json['files'] == null ? null : AnyValue.fromJson(json['files']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterTasksTasks otherTyped = other as FilterTasksTasks; + return id == otherTyped.id && + taskName == otherTyped.taskName && + description == otherTyped.description && + priority == otherTyped.priority && + status == otherTyped.status && + dueDate == otherTyped.dueDate && + progress == otherTyped.progress && + orderIndex == otherTyped.orderIndex && + commentCount == otherTyped.commentCount && + attachmentCount == otherTyped.attachmentCount && + files == otherTyped.files && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, taskName.hashCode, description.hashCode, priority.hashCode, status.hashCode, dueDate.hashCode, progress.hashCode, orderIndex.hashCode, commentCount.hashCode, attachmentCount.hashCode, files.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['taskName'] = nativeToJson(taskName); + if (description != null) { + json['description'] = nativeToJson(description); + } + json['priority'] = + taskPrioritySerializer(priority) + ; + json['status'] = + taskStatusSerializer(status) + ; + if (dueDate != null) { + json['dueDate'] = dueDate!.toJson(); + } + if (progress != null) { + json['progress'] = nativeToJson(progress); + } + if (orderIndex != null) { + json['orderIndex'] = nativeToJson(orderIndex); + } + if (commentCount != null) { + json['commentCount'] = nativeToJson(commentCount); + } + if (attachmentCount != null) { + json['attachmentCount'] = nativeToJson(attachmentCount); + } + if (files != null) { + json['files'] = files!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + FilterTasksTasks({ + required this.id, + required this.taskName, + this.description, + required this.priority, + required this.status, + this.dueDate, + this.progress, + this.orderIndex, + this.commentCount, + this.attachmentCount, + this.files, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class FilterTasksData { + final List tasks; + FilterTasksData.fromJson(dynamic json): + + tasks = (json['tasks'] as List) + .map((e) => FilterTasksTasks.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterTasksData otherTyped = other as FilterTasksData; + return tasks == otherTyped.tasks; + + } + @override + int get hashCode => tasks.hashCode; + + + Map toJson() { + Map json = {}; + json['tasks'] = tasks.map((e) => e.toJson()).toList(); + return json; + } + + FilterTasksData({ + required this.tasks, + }); +} + +@immutable +class FilterTasksVariables { + late final Optionalstatus; + late final Optionalpriority; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterTasksVariables.fromJson(Map json) { + + + status = Optional.optional((data) => TaskStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : TaskStatus.values.byName(json['status']); + + + priority = Optional.optional((data) => TaskPriority.values.byName(data), enumSerializer); + priority.value = json['priority'] == null ? null : TaskPriority.values.byName(json['priority']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterTasksVariables otherTyped = other as FilterTasksVariables; + return status == otherTyped.status && + priority == otherTyped.priority; + + } + @override + int get hashCode => Object.hashAll([status.hashCode, priority.hashCode]); + + + Map toJson() { + Map json = {}; + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(priority.state == OptionalState.set) { + json['priority'] = priority.toJson(); + } + return json; + } + + FilterTasksVariables({ + required this.status, + required this.priority, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_tax_forms.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_tax_forms.dart new file mode 100644 index 00000000..bbfbe1cc --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_tax_forms.dart @@ -0,0 +1,189 @@ +part of 'generated.dart'; + +class FilterTaxFormsVariablesBuilder { + Optional _formType = Optional.optional((data) => TaxFormType.values.byName(data), enumSerializer); + Optional _status = Optional.optional((data) => TaxFormStatus.values.byName(data), enumSerializer); + Optional _staffId = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterTaxFormsVariablesBuilder formType(TaxFormType? t) { + _formType.value = t; + return this; + } + FilterTaxFormsVariablesBuilder status(TaxFormStatus? t) { + _status.value = t; + return this; + } + FilterTaxFormsVariablesBuilder staffId(String? t) { + _staffId.value = t; + return this; + } + + FilterTaxFormsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterTaxFormsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterTaxFormsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterTaxFormsVariables vars= FilterTaxFormsVariables(formType: _formType,status: _status,staffId: _staffId,); + return _dataConnect.query("filterTaxForms", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterTaxFormsTaxForms { + final String id; + final EnumValue formType; + final String title; + final EnumValue status; + final String staffId; + FilterTaxFormsTaxForms.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + formType = taxFormTypeDeserializer(json['formType']), + title = nativeFromJson(json['title']), + status = taxFormStatusDeserializer(json['status']), + staffId = nativeFromJson(json['staffId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterTaxFormsTaxForms otherTyped = other as FilterTaxFormsTaxForms; + return id == otherTyped.id && + formType == otherTyped.formType && + title == otherTyped.title && + status == otherTyped.status && + staffId == otherTyped.staffId; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, formType.hashCode, title.hashCode, status.hashCode, staffId.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['formType'] = + taxFormTypeSerializer(formType) + ; + json['title'] = nativeToJson(title); + json['status'] = + taxFormStatusSerializer(status) + ; + json['staffId'] = nativeToJson(staffId); + return json; + } + + FilterTaxFormsTaxForms({ + required this.id, + required this.formType, + required this.title, + required this.status, + required this.staffId, + }); +} + +@immutable +class FilterTaxFormsData { + final List taxForms; + FilterTaxFormsData.fromJson(dynamic json): + + taxForms = (json['taxForms'] as List) + .map((e) => FilterTaxFormsTaxForms.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterTaxFormsData otherTyped = other as FilterTaxFormsData; + return taxForms == otherTyped.taxForms; + + } + @override + int get hashCode => taxForms.hashCode; + + + Map toJson() { + Map json = {}; + json['taxForms'] = taxForms.map((e) => e.toJson()).toList(); + return json; + } + + FilterTaxFormsData({ + required this.taxForms, + }); +} + +@immutable +class FilterTaxFormsVariables { + late final OptionalformType; + late final Optionalstatus; + late final OptionalstaffId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterTaxFormsVariables.fromJson(Map json) { + + + formType = Optional.optional((data) => TaxFormType.values.byName(data), enumSerializer); + formType.value = json['formType'] == null ? null : TaxFormType.values.byName(json['formType']); + + + status = Optional.optional((data) => TaxFormStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : TaxFormStatus.values.byName(json['status']); + + + staffId = Optional.optional(nativeFromJson, nativeToJson); + staffId.value = json['staffId'] == null ? null : nativeFromJson(json['staffId']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterTaxFormsVariables otherTyped = other as FilterTaxFormsVariables; + return formType == otherTyped.formType && + status == otherTyped.status && + staffId == otherTyped.staffId; + + } + @override + int get hashCode => Object.hashAll([formType.hashCode, status.hashCode, staffId.hashCode]); + + + Map toJson() { + Map json = {}; + if(formType.state == OptionalState.set) { + json['formType'] = formType.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(staffId.state == OptionalState.set) { + json['staffId'] = staffId.toJson(); + } + return json; + } + + FilterTaxFormsVariables({ + required this.formType, + required this.status, + required this.staffId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_user_conversations.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_user_conversations.dart new file mode 100644 index 00000000..c71b6d82 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_user_conversations.dart @@ -0,0 +1,423 @@ +part of 'generated.dart'; + +class FilterUserConversationsVariablesBuilder { + Optional _userId = Optional.optional(nativeFromJson, nativeToJson); + Optional _conversationId = Optional.optional(nativeFromJson, nativeToJson); + Optional _unreadMin = Optional.optional(nativeFromJson, nativeToJson); + Optional _unreadMax = Optional.optional(nativeFromJson, nativeToJson); + Optional _lastReadAfter = Optional.optional((json) => json['lastReadAfter'] = Timestamp.fromJson(json['lastReadAfter']), defaultSerializer); + Optional _lastReadBefore = Optional.optional((json) => json['lastReadBefore'] = Timestamp.fromJson(json['lastReadBefore']), defaultSerializer); + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterUserConversationsVariablesBuilder userId(String? t) { + _userId.value = t; + return this; + } + FilterUserConversationsVariablesBuilder conversationId(String? t) { + _conversationId.value = t; + return this; + } + FilterUserConversationsVariablesBuilder unreadMin(int? t) { + _unreadMin.value = t; + return this; + } + FilterUserConversationsVariablesBuilder unreadMax(int? t) { + _unreadMax.value = t; + return this; + } + FilterUserConversationsVariablesBuilder lastReadAfter(Timestamp? t) { + _lastReadAfter.value = t; + return this; + } + FilterUserConversationsVariablesBuilder lastReadBefore(Timestamp? t) { + _lastReadBefore.value = t; + return this; + } + FilterUserConversationsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterUserConversationsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + FilterUserConversationsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterUserConversationsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterUserConversationsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterUserConversationsVariables vars= FilterUserConversationsVariables(userId: _userId,conversationId: _conversationId,unreadMin: _unreadMin,unreadMax: _unreadMax,lastReadAfter: _lastReadAfter,lastReadBefore: _lastReadBefore,offset: _offset,limit: _limit,); + return _dataConnect.query("filterUserConversations", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterUserConversationsUserConversations { + final String id; + final String conversationId; + final String userId; + final int? unreadCount; + final Timestamp? lastReadAt; + final Timestamp? createdAt; + final FilterUserConversationsUserConversationsConversation conversation; + final FilterUserConversationsUserConversationsUser user; + FilterUserConversationsUserConversations.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']), + unreadCount = json['unreadCount'] == null ? null : nativeFromJson(json['unreadCount']), + lastReadAt = json['lastReadAt'] == null ? null : Timestamp.fromJson(json['lastReadAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + conversation = FilterUserConversationsUserConversationsConversation.fromJson(json['conversation']), + user = FilterUserConversationsUserConversationsUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterUserConversationsUserConversations otherTyped = other as FilterUserConversationsUserConversations; + return id == otherTyped.id && + conversationId == otherTyped.conversationId && + userId == otherTyped.userId && + unreadCount == otherTyped.unreadCount && + lastReadAt == otherTyped.lastReadAt && + createdAt == otherTyped.createdAt && + conversation == otherTyped.conversation && + user == otherTyped.user; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, conversationId.hashCode, userId.hashCode, unreadCount.hashCode, lastReadAt.hashCode, createdAt.hashCode, conversation.hashCode, user.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + if (unreadCount != null) { + json['unreadCount'] = nativeToJson(unreadCount); + } + if (lastReadAt != null) { + json['lastReadAt'] = lastReadAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['conversation'] = conversation.toJson(); + json['user'] = user.toJson(); + return json; + } + + FilterUserConversationsUserConversations({ + required this.id, + required this.conversationId, + required this.userId, + this.unreadCount, + this.lastReadAt, + this.createdAt, + required this.conversation, + required this.user, + }); +} + +@immutable +class FilterUserConversationsUserConversationsConversation { + final String id; + final String? subject; + final EnumValue? status; + final EnumValue? conversationType; + final bool? isGroup; + final String? groupName; + final String? lastMessage; + final Timestamp? lastMessageAt; + final Timestamp? createdAt; + FilterUserConversationsUserConversationsConversation.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + subject = json['subject'] == null ? null : nativeFromJson(json['subject']), + status = json['status'] == null ? null : conversationStatusDeserializer(json['status']), + conversationType = json['conversationType'] == null ? null : conversationTypeDeserializer(json['conversationType']), + isGroup = json['isGroup'] == null ? null : nativeFromJson(json['isGroup']), + groupName = json['groupName'] == null ? null : nativeFromJson(json['groupName']), + lastMessage = json['lastMessage'] == null ? null : nativeFromJson(json['lastMessage']), + lastMessageAt = json['lastMessageAt'] == null ? null : Timestamp.fromJson(json['lastMessageAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterUserConversationsUserConversationsConversation otherTyped = other as FilterUserConversationsUserConversationsConversation; + return id == otherTyped.id && + subject == otherTyped.subject && + status == otherTyped.status && + conversationType == otherTyped.conversationType && + isGroup == otherTyped.isGroup && + groupName == otherTyped.groupName && + lastMessage == otherTyped.lastMessage && + lastMessageAt == otherTyped.lastMessageAt && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, subject.hashCode, status.hashCode, conversationType.hashCode, isGroup.hashCode, groupName.hashCode, lastMessage.hashCode, lastMessageAt.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (subject != null) { + json['subject'] = nativeToJson(subject); + } + if (status != null) { + json['status'] = + conversationStatusSerializer(status!) + ; + } + if (conversationType != null) { + json['conversationType'] = + conversationTypeSerializer(conversationType!) + ; + } + if (isGroup != null) { + json['isGroup'] = nativeToJson(isGroup); + } + if (groupName != null) { + json['groupName'] = nativeToJson(groupName); + } + if (lastMessage != null) { + json['lastMessage'] = nativeToJson(lastMessage); + } + if (lastMessageAt != null) { + json['lastMessageAt'] = lastMessageAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + FilterUserConversationsUserConversationsConversation({ + required this.id, + this.subject, + this.status, + this.conversationType, + this.isGroup, + this.groupName, + this.lastMessage, + this.lastMessageAt, + this.createdAt, + }); +} + +@immutable +class FilterUserConversationsUserConversationsUser { + final String id; + final String? fullName; + final String? photoUrl; + FilterUserConversationsUserConversationsUser.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterUserConversationsUserConversationsUser otherTyped = other as FilterUserConversationsUserConversationsUser; + return id == otherTyped.id && + fullName == otherTyped.fullName && + photoUrl == otherTyped.photoUrl; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, photoUrl.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + return json; + } + + FilterUserConversationsUserConversationsUser({ + required this.id, + this.fullName, + this.photoUrl, + }); +} + +@immutable +class FilterUserConversationsData { + final List userConversations; + FilterUserConversationsData.fromJson(dynamic json): + + userConversations = (json['userConversations'] as List) + .map((e) => FilterUserConversationsUserConversations.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterUserConversationsData otherTyped = other as FilterUserConversationsData; + return userConversations == otherTyped.userConversations; + + } + @override + int get hashCode => userConversations.hashCode; + + + Map toJson() { + Map json = {}; + json['userConversations'] = userConversations.map((e) => e.toJson()).toList(); + return json; + } + + FilterUserConversationsData({ + required this.userConversations, + }); +} + +@immutable +class FilterUserConversationsVariables { + late final OptionaluserId; + late final OptionalconversationId; + late final OptionalunreadMin; + late final OptionalunreadMax; + late final OptionallastReadAfter; + late final OptionallastReadBefore; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterUserConversationsVariables.fromJson(Map json) { + + + userId = Optional.optional(nativeFromJson, nativeToJson); + userId.value = json['userId'] == null ? null : nativeFromJson(json['userId']); + + + conversationId = Optional.optional(nativeFromJson, nativeToJson); + conversationId.value = json['conversationId'] == null ? null : nativeFromJson(json['conversationId']); + + + unreadMin = Optional.optional(nativeFromJson, nativeToJson); + unreadMin.value = json['unreadMin'] == null ? null : nativeFromJson(json['unreadMin']); + + + unreadMax = Optional.optional(nativeFromJson, nativeToJson); + unreadMax.value = json['unreadMax'] == null ? null : nativeFromJson(json['unreadMax']); + + + lastReadAfter = Optional.optional((json) => json['lastReadAfter'] = Timestamp.fromJson(json['lastReadAfter']), defaultSerializer); + lastReadAfter.value = json['lastReadAfter'] == null ? null : Timestamp.fromJson(json['lastReadAfter']); + + + lastReadBefore = Optional.optional((json) => json['lastReadBefore'] = Timestamp.fromJson(json['lastReadBefore']), defaultSerializer); + lastReadBefore.value = json['lastReadBefore'] == null ? null : Timestamp.fromJson(json['lastReadBefore']); + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterUserConversationsVariables otherTyped = other as FilterUserConversationsVariables; + return userId == otherTyped.userId && + conversationId == otherTyped.conversationId && + unreadMin == otherTyped.unreadMin && + unreadMax == otherTyped.unreadMax && + lastReadAfter == otherTyped.lastReadAfter && + lastReadBefore == otherTyped.lastReadBefore && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([userId.hashCode, conversationId.hashCode, unreadMin.hashCode, unreadMax.hashCode, lastReadAfter.hashCode, lastReadBefore.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(userId.state == OptionalState.set) { + json['userId'] = userId.toJson(); + } + if(conversationId.state == OptionalState.set) { + json['conversationId'] = conversationId.toJson(); + } + if(unreadMin.state == OptionalState.set) { + json['unreadMin'] = unreadMin.toJson(); + } + if(unreadMax.state == OptionalState.set) { + json['unreadMax'] = unreadMax.toJson(); + } + if(lastReadAfter.state == OptionalState.set) { + json['lastReadAfter'] = lastReadAfter.toJson(); + } + if(lastReadBefore.state == OptionalState.set) { + json['lastReadBefore'] = lastReadBefore.toJson(); + } + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + FilterUserConversationsVariables({ + required this.userId, + required this.conversationId, + required this.unreadMin, + required this.unreadMax, + required this.lastReadAfter, + required this.lastReadBefore, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_users.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_users.dart new file mode 100644 index 00000000..0e386768 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_users.dart @@ -0,0 +1,215 @@ +part of 'generated.dart'; + +class FilterUsersVariablesBuilder { + Optional _id = Optional.optional(nativeFromJson, nativeToJson); + Optional _email = Optional.optional(nativeFromJson, nativeToJson); + Optional _role = Optional.optional((data) => UserBaseRole.values.byName(data), enumSerializer); + Optional _userRole = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterUsersVariablesBuilder id(String? t) { + _id.value = t; + return this; + } + FilterUsersVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + FilterUsersVariablesBuilder role(UserBaseRole? t) { + _role.value = t; + return this; + } + FilterUsersVariablesBuilder userRole(String? t) { + _userRole.value = t; + return this; + } + + FilterUsersVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterUsersData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterUsersVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterUsersVariables vars= FilterUsersVariables(id: _id,email: _email,role: _role,userRole: _userRole,); + return _dataConnect.query("filterUsers", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterUsersUsers { + final String id; + final String? email; + final String? fullName; + final EnumValue role; + final String? userRole; + final String? photoUrl; + FilterUsersUsers.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + role = userBaseRoleDeserializer(json['role']), + userRole = json['userRole'] == null ? null : nativeFromJson(json['userRole']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterUsersUsers otherTyped = other as FilterUsersUsers; + return id == otherTyped.id && + email == otherTyped.email && + fullName == otherTyped.fullName && + role == otherTyped.role && + userRole == otherTyped.userRole && + photoUrl == otherTyped.photoUrl; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, email.hashCode, fullName.hashCode, role.hashCode, userRole.hashCode, photoUrl.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + json['role'] = + userBaseRoleSerializer(role) + ; + if (userRole != null) { + json['userRole'] = nativeToJson(userRole); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + return json; + } + + FilterUsersUsers({ + required this.id, + this.email, + this.fullName, + required this.role, + this.userRole, + this.photoUrl, + }); +} + +@immutable +class FilterUsersData { + final List users; + FilterUsersData.fromJson(dynamic json): + + users = (json['users'] as List) + .map((e) => FilterUsersUsers.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterUsersData otherTyped = other as FilterUsersData; + return users == otherTyped.users; + + } + @override + int get hashCode => users.hashCode; + + + Map toJson() { + Map json = {}; + json['users'] = users.map((e) => e.toJson()).toList(); + return json; + } + + FilterUsersData({ + required this.users, + }); +} + +@immutable +class FilterUsersVariables { + late final Optionalid; + late final Optionalemail; + late final Optionalrole; + late final OptionaluserRole; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterUsersVariables.fromJson(Map json) { + + + id = Optional.optional(nativeFromJson, nativeToJson); + id.value = json['id'] == null ? null : nativeFromJson(json['id']); + + + email = Optional.optional(nativeFromJson, nativeToJson); + email.value = json['email'] == null ? null : nativeFromJson(json['email']); + + + role = Optional.optional((data) => UserBaseRole.values.byName(data), enumSerializer); + role.value = json['role'] == null ? null : UserBaseRole.values.byName(json['role']); + + + userRole = Optional.optional(nativeFromJson, nativeToJson); + userRole.value = json['userRole'] == null ? null : nativeFromJson(json['userRole']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterUsersVariables otherTyped = other as FilterUsersVariables; + return id == otherTyped.id && + email == otherTyped.email && + role == otherTyped.role && + userRole == otherTyped.userRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, email.hashCode, role.hashCode, userRole.hashCode]); + + + Map toJson() { + Map json = {}; + if(id.state == OptionalState.set) { + json['id'] = id.toJson(); + } + if(email.state == OptionalState.set) { + json['email'] = email.toJson(); + } + if(role.state == OptionalState.set) { + json['role'] = role.toJson(); + } + if(userRole.state == OptionalState.set) { + json['userRole'] = userRole.toJson(); + } + return json; + } + + FilterUsersVariables({ + required this.id, + required this.email, + required this.role, + required this.userRole, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_vendor_benefit_plans.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_vendor_benefit_plans.dart new file mode 100644 index 00000000..6ced6af8 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/filter_vendor_benefit_plans.dart @@ -0,0 +1,293 @@ +part of 'generated.dart'; + +class FilterVendorBenefitPlansVariablesBuilder { + Optional _vendorId = Optional.optional(nativeFromJson, nativeToJson); + Optional _title = Optional.optional(nativeFromJson, nativeToJson); + Optional _isActive = Optional.optional(nativeFromJson, nativeToJson); + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + FilterVendorBenefitPlansVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + FilterVendorBenefitPlansVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + FilterVendorBenefitPlansVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + FilterVendorBenefitPlansVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + FilterVendorBenefitPlansVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + FilterVendorBenefitPlansVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => FilterVendorBenefitPlansData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (FilterVendorBenefitPlansVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + FilterVendorBenefitPlansVariables vars= FilterVendorBenefitPlansVariables(vendorId: _vendorId,title: _title,isActive: _isActive,offset: _offset,limit: _limit,); + return _dataConnect.query("filterVendorBenefitPlans", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class FilterVendorBenefitPlansVendorBenefitPlans { + final String id; + final String vendorId; + final String title; + final String? description; + final String? requestLabel; + final int? total; + final bool? isActive; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final FilterVendorBenefitPlansVendorBenefitPlansVendor vendor; + FilterVendorBenefitPlansVendorBenefitPlans.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + title = nativeFromJson(json['title']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + requestLabel = json['requestLabel'] == null ? null : nativeFromJson(json['requestLabel']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + vendor = FilterVendorBenefitPlansVendorBenefitPlansVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterVendorBenefitPlansVendorBenefitPlans otherTyped = other as FilterVendorBenefitPlansVendorBenefitPlans; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + title == otherTyped.title && + description == otherTyped.description && + requestLabel == otherTyped.requestLabel && + total == otherTyped.total && + isActive == otherTyped.isActive && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, title.hashCode, description.hashCode, requestLabel.hashCode, total.hashCode, isActive.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + json['title'] = nativeToJson(title); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (requestLabel != null) { + json['requestLabel'] = nativeToJson(requestLabel); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['vendor'] = vendor.toJson(); + return json; + } + + FilterVendorBenefitPlansVendorBenefitPlans({ + required this.id, + required this.vendorId, + required this.title, + this.description, + this.requestLabel, + this.total, + this.isActive, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.vendor, + }); +} + +@immutable +class FilterVendorBenefitPlansVendorBenefitPlansVendor { + final String companyName; + FilterVendorBenefitPlansVendorBenefitPlansVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterVendorBenefitPlansVendorBenefitPlansVendor otherTyped = other as FilterVendorBenefitPlansVendorBenefitPlansVendor; + return companyName == otherTyped.companyName; + + } + @override + int get hashCode => companyName.hashCode; + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + return json; + } + + FilterVendorBenefitPlansVendorBenefitPlansVendor({ + required this.companyName, + }); +} + +@immutable +class FilterVendorBenefitPlansData { + final List vendorBenefitPlans; + FilterVendorBenefitPlansData.fromJson(dynamic json): + + vendorBenefitPlans = (json['vendorBenefitPlans'] as List) + .map((e) => FilterVendorBenefitPlansVendorBenefitPlans.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterVendorBenefitPlansData otherTyped = other as FilterVendorBenefitPlansData; + return vendorBenefitPlans == otherTyped.vendorBenefitPlans; + + } + @override + int get hashCode => vendorBenefitPlans.hashCode; + + + Map toJson() { + Map json = {}; + json['vendorBenefitPlans'] = vendorBenefitPlans.map((e) => e.toJson()).toList(); + return json; + } + + FilterVendorBenefitPlansData({ + required this.vendorBenefitPlans, + }); +} + +@immutable +class FilterVendorBenefitPlansVariables { + late final OptionalvendorId; + late final Optionaltitle; + late final OptionalisActive; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + FilterVendorBenefitPlansVariables.fromJson(Map json) { + + + vendorId = Optional.optional(nativeFromJson, nativeToJson); + vendorId.value = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + + + title = Optional.optional(nativeFromJson, nativeToJson); + title.value = json['title'] == null ? null : nativeFromJson(json['title']); + + + isActive = Optional.optional(nativeFromJson, nativeToJson); + isActive.value = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final FilterVendorBenefitPlansVariables otherTyped = other as FilterVendorBenefitPlansVariables; + return vendorId == otherTyped.vendorId && + title == otherTyped.title && + isActive == otherTyped.isActive && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, title.hashCode, isActive.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(vendorId.state == OptionalState.set) { + json['vendorId'] = vendorId.toJson(); + } + if(title.state == OptionalState.set) { + json['title'] = title.toJson(); + } + if(isActive.state == OptionalState.set) { + json['isActive'] = isActive.toJson(); + } + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + FilterVendorBenefitPlansVariables({ + required this.vendorId, + required this.title, + required this.isActive, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/generated.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/generated.dart new file mode 100644 index 00000000..63a2646d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/generated.dart @@ -0,0 +1,4533 @@ +library dataconnect_generated; +import 'package:firebase_data_connect/firebase_data_connect.dart'; +import 'package:flutter/foundation.dart'; +import 'dart:convert'; +import 'package:flutter/foundation.dart'; + +part 'create_team_member.dart'; + +part 'update_team_member.dart'; + +part 'update_team_member_invite_status.dart'; + +part 'accept_invite_by_code.dart'; + +part 'cancel_invite_by_code.dart'; + +part 'delete_team_member.dart'; + +part 'list_activity_logs.dart'; + +part 'get_activity_log_by_id.dart'; + +part 'list_activity_logs_by_user_id.dart'; + +part 'list_unread_activity_logs_by_user_id.dart'; + +part 'filter_activity_logs.dart'; + +part 'create_benefits_data.dart'; + +part 'update_benefits_data.dart'; + +part 'delete_benefits_data.dart'; + +part 'list_businesses.dart'; + +part 'get_businesses_by_user_id.dart'; + +part 'get_business_by_id.dart'; + +part 'list_shifts_for_coverage.dart'; + +part 'list_applications_for_coverage.dart'; + +part 'list_shifts_for_daily_ops_by_business.dart'; + +part 'list_shifts_for_daily_ops_by_vendor.dart'; + +part 'list_applications_for_daily_ops.dart'; + +part 'list_shifts_for_forecast_by_business.dart'; + +part 'list_shifts_for_forecast_by_vendor.dart'; + +part 'list_shifts_for_no_show_range_by_business.dart'; + +part 'list_shifts_for_no_show_range_by_vendor.dart'; + +part 'list_applications_for_no_show_range.dart'; + +part 'list_staff_for_no_show_report.dart'; + +part 'list_invoices_for_spend_by_business.dart'; + +part 'list_invoices_for_spend_by_vendor.dart'; + +part 'list_invoices_for_spend_by_order.dart'; + +part 'list_timesheets_for_spend.dart'; + +part 'list_shifts_for_performance_by_business.dart'; + +part 'list_shifts_for_performance_by_vendor.dart'; + +part 'list_applications_for_performance.dart'; + +part 'list_staff_for_performance.dart'; + +part 'list_staff_availabilities.dart'; + +part 'list_staff_availabilities_by_staff_id.dart'; + +part 'get_staff_availability_by_key.dart'; + +part 'list_staff_availabilities_by_day.dart'; + +part 'create_staff_course.dart'; + +part 'update_staff_course.dart'; + +part 'delete_staff_course.dart'; + +part 'create_team.dart'; + +part 'update_team.dart'; + +part 'delete_team.dart'; + +part 'create_team_hub.dart'; + +part 'update_team_hub.dart'; + +part 'delete_team_hub.dart'; + +part 'create_application.dart'; + +part 'update_application_status.dart'; + +part 'delete_application.dart'; + +part 'list_conversations.dart'; + +part 'get_conversation_by_id.dart'; + +part 'list_conversations_by_type.dart'; + +part 'list_conversations_by_status.dart'; + +part 'filter_conversations.dart'; + +part 'create_shift.dart'; + +part 'update_shift.dart'; + +part 'delete_shift.dart'; + +part 'list_teams.dart'; + +part 'get_team_by_id.dart'; + +part 'get_teams_by_owner_id.dart'; + +part 'list_categories.dart'; + +part 'get_category_by_id.dart'; + +part 'filter_categories.dart'; + +part 'create_user_conversation.dart'; + +part 'update_user_conversation.dart'; + +part 'mark_conversation_as_read.dart'; + +part 'increment_unread_for_user.dart'; + +part 'delete_user_conversation.dart'; + +part 'list_vendor_benefit_plans.dart'; + +part 'get_vendor_benefit_plan_by_id.dart'; + +part 'list_vendor_benefit_plans_by_vendor_id.dart'; + +part 'list_active_vendor_benefit_plans_by_vendor_id.dart'; + +part 'filter_vendor_benefit_plans.dart'; + +part 'list_courses.dart'; + +part 'get_course_by_id.dart'; + +part 'filter_courses.dart'; + +part 'list_roles.dart'; + +part 'get_role_by_id.dart'; + +part 'list_roles_by_vendor_id.dart'; + +part 'list_roles_byrole_category_id.dart'; + +part 'get_staff_course_by_id.dart'; + +part 'list_staff_courses_by_staff_id.dart'; + +part 'list_staff_courses_by_course_id.dart'; + +part 'get_staff_course_by_staff_and_course.dart'; + +part 'create_user.dart'; + +part 'update_user.dart'; + +part 'delete_user.dart'; + +part 'create_client_feedback.dart'; + +part 'update_client_feedback.dart'; + +part 'delete_client_feedback.dart'; + +part 'get_shift_role_by_id.dart'; + +part 'list_shift_roles_by_shift_id.dart'; + +part 'list_shift_roles_by_role_id.dart'; + +part 'list_shift_roles_by_shift_id_and_time_range.dart'; + +part 'list_shift_roles_by_vendor_id.dart'; + +part 'list_shift_roles_by_business_and_date_range.dart'; + +part 'list_shift_roles_by_business_and_order.dart'; + +part 'list_shift_roles_by_business_date_range_completed_orders.dart'; + +part 'create_staff_availability.dart'; + +part 'update_staff_availability.dart'; + +part 'delete_staff_availability.dart'; + +part 'create_conversation.dart'; + +part 'update_conversation.dart'; + +part 'update_conversation_last_message.dart'; + +part 'delete_conversation.dart'; + +part 'create_tax_form.dart'; + +part 'update_tax_form.dart'; + +part 'delete_tax_form.dart'; + +part 'create_team_hud_department.dart'; + +part 'update_team_hud_department.dart'; + +part 'delete_team_hud_department.dart'; + +part 'get_vendor_by_id.dart'; + +part 'get_vendor_by_user_id.dart'; + +part 'list_vendors.dart'; + +part 'list_vendor_rates.dart'; + +part 'get_vendor_rate_by_id.dart'; + +part 'list_accounts.dart'; + +part 'get_account_by_id.dart'; + +part 'get_accounts_by_owner_id.dart'; + +part 'filter_accounts.dart'; + +part 'create_business.dart'; + +part 'update_business.dart'; + +part 'delete_business.dart'; + +part 'list_hubs.dart'; + +part 'get_hub_by_id.dart'; + +part 'get_hubs_by_owner_id.dart'; + +part 'filter_hubs.dart'; + +part 'list_recent_payments.dart'; + +part 'get_recent_payment_by_id.dart'; + +part 'list_recent_payments_by_staff_id.dart'; + +part 'list_recent_payments_by_application_id.dart'; + +part 'list_recent_payments_by_invoice_id.dart'; + +part 'list_recent_payments_by_status.dart'; + +part 'list_recent_payments_by_invoice_ids.dart'; + +part 'list_recent_payments_by_business_id.dart'; + +part 'create_role.dart'; + +part 'update_role.dart'; + +part 'delete_role.dart'; + +part 'get_staff_document_by_key.dart'; + +part 'list_staff_documents_by_staff_id.dart'; + +part 'list_staff_documents_by_document_type.dart'; + +part 'list_staff_documents_by_status.dart'; + +part 'list_tasks.dart'; + +part 'get_task_by_id.dart'; + +part 'get_tasks_by_owner_id.dart'; + +part 'filter_tasks.dart'; + +part 'list_task_comments.dart'; + +part 'get_task_comment_by_id.dart'; + +part 'get_task_comments_by_task_id.dart'; + +part 'create_emergency_contact.dart'; + +part 'update_emergency_contact.dart'; + +part 'delete_emergency_contact.dart'; + +part 'list_faq_datas.dart'; + +part 'get_faq_data_by_id.dart'; + +part 'filter_faq_datas.dart'; + +part 'list_invoice_templates.dart'; + +part 'get_invoice_template_by_id.dart'; + +part 'list_invoice_templates_by_owner_id.dart'; + +part 'list_invoice_templates_by_vendor_id.dart'; + +part 'list_invoice_templates_by_business_id.dart'; + +part 'list_invoice_templates_by_order_id.dart'; + +part 'search_invoice_templates_by_owner_and_name.dart'; + +part 'list_messages.dart'; + +part 'get_message_by_id.dart'; + +part 'get_messages_by_conversation_id.dart'; + +part 'create_order.dart'; + +part 'update_order.dart'; + +part 'delete_order.dart'; + +part 'create_shift_role.dart'; + +part 'update_shift_role.dart'; + +part 'delete_shift_role.dart'; + +part 'list_staff.dart'; + +part 'get_staff_by_id.dart'; + +part 'get_staff_by_user_id.dart'; + +part 'filter_staff.dart'; + +part 'list_user_conversations.dart'; + +part 'get_user_conversation_by_key.dart'; + +part 'list_user_conversations_by_user_id.dart'; + +part 'list_unread_user_conversations_by_user_id.dart'; + +part 'list_user_conversations_by_conversation_id.dart'; + +part 'filter_user_conversations.dart'; + +part 'create_attire_option.dart'; + +part 'update_attire_option.dart'; + +part 'delete_attire_option.dart'; + +part 'create_invoice.dart'; + +part 'update_invoice.dart'; + +part 'delete_invoice.dart'; + +part 'get_my_tasks.dart'; + +part 'get_member_task_by_id_key.dart'; + +part 'get_member_tasks_by_task_id.dart'; + +part 'list_shifts.dart'; + +part 'get_shift_by_id.dart'; + +part 'filter_shifts.dart'; + +part 'get_shifts_by_business_id.dart'; + +part 'get_shifts_by_vendor_id.dart'; + +part 'create_task.dart'; + +part 'update_task.dart'; + +part 'delete_task.dart'; + +part 'create_workforce.dart'; + +part 'update_workforce.dart'; + +part 'deactivate_workforce.dart'; + +part 'create_member_task.dart'; + +part 'delete_member_task.dart'; + +part 'create_staff_availability_stats.dart'; + +part 'update_staff_availability_stats.dart'; + +part 'delete_staff_availability_stats.dart'; + +part 'create_vendor_benefit_plan.dart'; + +part 'update_vendor_benefit_plan.dart'; + +part 'delete_vendor_benefit_plan.dart'; + +part 'create_vendor_rate.dart'; + +part 'update_vendor_rate.dart'; + +part 'delete_vendor_rate.dart'; + +part 'get_workforce_by_id.dart'; + +part 'get_workforce_by_vendor_and_staff.dart'; + +part 'list_workforce_by_vendor_id.dart'; + +part 'list_workforce_by_staff_id.dart'; + +part 'get_workforce_by_vendor_and_number.dart'; + +part 'create_certificate.dart'; + +part 'update_certificate.dart'; + +part 'delete_certificate.dart'; + +part 'create_course.dart'; + +part 'update_course.dart'; + +part 'delete_course.dart'; + +part 'list_documents.dart'; + +part 'get_document_by_id.dart'; + +part 'filter_documents.dart'; + +part 'list_emergency_contacts.dart'; + +part 'get_emergency_contact_by_id.dart'; + +part 'get_emergency_contacts_by_staff_id.dart'; + +part 'list_levels.dart'; + +part 'get_level_by_id.dart'; + +part 'filter_levels.dart'; + +part 'create_role_category.dart'; + +part 'update_role_category.dart'; + +part 'delete_role_category.dart'; + +part 'create_staff.dart'; + +part 'update_staff.dart'; + +part 'delete_staff.dart'; + +part 'list_staff_availability_stats.dart'; + +part 'get_staff_availability_stats_by_staff_id.dart'; + +part 'filter_staff_availability_stats.dart'; + +part 'create_account.dart'; + +part 'update_account.dart'; + +part 'delete_account.dart'; + +part 'create_activity_log.dart'; + +part 'update_activity_log.dart'; + +part 'mark_activity_log_as_read.dart'; + +part 'mark_activity_logs_as_read.dart'; + +part 'delete_activity_log.dart'; + +part 'list_assignments.dart'; + +part 'get_assignment_by_id.dart'; + +part 'list_assignments_by_workforce_id.dart'; + +part 'list_assignments_by_workforce_ids.dart'; + +part 'list_assignments_by_shift_role.dart'; + +part 'filter_assignments.dart'; + +part 'list_certificates.dart'; + +part 'get_certificate_by_id.dart'; + +part 'list_certificates_by_staff_id.dart'; + +part 'create_level.dart'; + +part 'update_level.dart'; + +part 'delete_level.dart'; + +part 'create_message.dart'; + +part 'update_message.dart'; + +part 'delete_message.dart'; + +part 'create_recent_payment.dart'; + +part 'update_recent_payment.dart'; + +part 'delete_recent_payment.dart'; + +part 'create_staff_role.dart'; + +part 'delete_staff_role.dart'; + +part 'list_applications.dart'; + +part 'get_application_by_id.dart'; + +part 'get_applications_by_shift_id.dart'; + +part 'get_applications_by_shift_id_and_status.dart'; + +part 'get_applications_by_staff_id.dart'; + +part 'list_accepted_applications_by_shift_role_key.dart'; + +part 'list_accepted_applications_by_business_for_day.dart'; + +part 'create_assignment.dart'; + +part 'update_assignment.dart'; + +part 'delete_assignment.dart'; + +part 'list_attire_options.dart'; + +part 'get_attire_option_by_id.dart'; + +part 'filter_attire_options.dart'; + +part 'create_custom_rate_card.dart'; + +part 'update_custom_rate_card.dart'; + +part 'delete_custom_rate_card.dart'; + +part 'list_invoices.dart'; + +part 'get_invoice_by_id.dart'; + +part 'list_invoices_by_vendor_id.dart'; + +part 'list_invoices_by_business_id.dart'; + +part 'list_invoices_by_order_id.dart'; + +part 'list_invoices_by_status.dart'; + +part 'filter_invoices.dart'; + +part 'list_overdue_invoices.dart'; + +part 'create_invoice_template.dart'; + +part 'update_invoice_template.dart'; + +part 'delete_invoice_template.dart'; + +part 'create_staff_document.dart'; + +part 'update_staff_document.dart'; + +part 'delete_staff_document.dart'; + +part 'list_users.dart'; + +part 'get_user_by_id.dart'; + +part 'filter_users.dart'; + +part 'create_category.dart'; + +part 'update_category.dart'; + +part 'delete_category.dart'; + +part 'create_hub.dart'; + +part 'update_hub.dart'; + +part 'delete_hub.dart'; + +part 'list_staff_roles.dart'; + +part 'get_staff_role_by_key.dart'; + +part 'list_staff_roles_by_staff_id.dart'; + +part 'list_staff_roles_by_role_id.dart'; + +part 'filter_staff_roles.dart'; + +part 'create_task_comment.dart'; + +part 'update_task_comment.dart'; + +part 'delete_task_comment.dart'; + +part 'list_team_hubs.dart'; + +part 'get_team_hub_by_id.dart'; + +part 'get_team_hubs_by_team_id.dart'; + +part 'list_team_hubs_by_owner_id.dart'; + +part 'list_team_hud_departments.dart'; + +part 'get_team_hud_department_by_id.dart'; + +part 'list_team_hud_departments_by_team_hub_id.dart'; + +part 'list_team_members.dart'; + +part 'get_team_member_by_id.dart'; + +part 'get_team_members_by_team_id.dart'; + +part 'list_client_feedbacks.dart'; + +part 'get_client_feedback_by_id.dart'; + +part 'list_client_feedbacks_by_business_id.dart'; + +part 'list_client_feedbacks_by_vendor_id.dart'; + +part 'list_client_feedbacks_by_business_and_vendor.dart'; + +part 'filter_client_feedbacks.dart'; + +part 'list_client_feedback_ratings_by_vendor_id.dart'; + +part 'list_custom_rate_cards.dart'; + +part 'get_custom_rate_card_by_id.dart'; + +part 'create_document.dart'; + +part 'update_document.dart'; + +part 'delete_document.dart'; + +part 'list_role_categories.dart'; + +part 'get_role_category_by_id.dart'; + +part 'get_role_categories_by_category.dart'; + +part 'list_tax_forms.dart'; + +part 'get_tax_form_by_id.dart'; + +part 'get_tax_forms_bystaff_id.dart'; + +part 'filter_tax_forms.dart'; + +part 'create_vendor.dart'; + +part 'update_vendor.dart'; + +part 'delete_vendor.dart'; + +part 'list_benefits_data.dart'; + +part 'get_benefits_data_by_key.dart'; + +part 'list_benefits_data_by_staff_id.dart'; + +part 'list_benefits_data_by_vendor_benefit_plan_id.dart'; + +part 'list_benefits_data_by_vendor_benefit_plan_ids.dart'; + +part 'create_faq_data.dart'; + +part 'update_faq_data.dart'; + +part 'delete_faq_data.dart'; + +part 'list_orders.dart'; + +part 'get_order_by_id.dart'; + +part 'get_orders_by_business_id.dart'; + +part 'get_orders_by_vendor_id.dart'; + +part 'get_orders_by_status.dart'; + +part 'get_orders_by_date_range.dart'; + +part 'get_rapid_orders.dart'; + + + + enum AccountType { + + CHECKING, + + SAVINGS, + + } + + String accountTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue accountTypeDeserializer(dynamic data) { + switch (data) { + + case 'CHECKING': + return const Known(AccountType.CHECKING); + + case 'SAVINGS': + return const Known(AccountType.SAVINGS); + + default: + return Unknown(data); + } + } + + + enum ActivityIconType { + + INVOICE, + + CHECK, + + ALERT, + + MESSAGE, + + CALENDAR, + + } + + String activityIconTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue activityIconTypeDeserializer(dynamic data) { + switch (data) { + + case 'INVOICE': + return const Known(ActivityIconType.INVOICE); + + case 'CHECK': + return const Known(ActivityIconType.CHECK); + + case 'ALERT': + return const Known(ActivityIconType.ALERT); + + case 'MESSAGE': + return const Known(ActivityIconType.MESSAGE); + + case 'CALENDAR': + return const Known(ActivityIconType.CALENDAR); + + default: + return Unknown(data); + } + } + + + enum ActivityType { + + ORDER_CREATED, + + SHIFT_UPDATE, + + COMPLIANCE_ALERT, + + MESSAGE_RECEIVED, + + SYSTEM_UPDATE, + + } + + String activityTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue activityTypeDeserializer(dynamic data) { + switch (data) { + + case 'ORDER_CREATED': + return const Known(ActivityType.ORDER_CREATED); + + case 'SHIFT_UPDATE': + return const Known(ActivityType.SHIFT_UPDATE); + + case 'COMPLIANCE_ALERT': + return const Known(ActivityType.COMPLIANCE_ALERT); + + case 'MESSAGE_RECEIVED': + return const Known(ActivityType.MESSAGE_RECEIVED); + + case 'SYSTEM_UPDATE': + return const Known(ActivityType.SYSTEM_UPDATE); + + default: + return Unknown(data); + } + } + + + enum ApplicationOrigin { + + STAFF, + + EMPLOYER, + + } + + String applicationOriginSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue applicationOriginDeserializer(dynamic data) { + switch (data) { + + case 'STAFF': + return const Known(ApplicationOrigin.STAFF); + + case 'EMPLOYER': + return const Known(ApplicationOrigin.EMPLOYER); + + default: + return Unknown(data); + } + } + + + enum ApplicationStatus { + + PENDING, + + ACCEPTED, + + REJECTED, + + CONFIRMED, + + CHECKED_IN, + + CHECKED_OUT, + + LATE, + + NO_SHOW, + + } + + String applicationStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue applicationStatusDeserializer(dynamic data) { + switch (data) { + + case 'PENDING': + return const Known(ApplicationStatus.PENDING); + + case 'ACCEPTED': + return const Known(ApplicationStatus.ACCEPTED); + + case 'REJECTED': + return const Known(ApplicationStatus.REJECTED); + + case 'CONFIRMED': + return const Known(ApplicationStatus.CONFIRMED); + + case 'CHECKED_IN': + return const Known(ApplicationStatus.CHECKED_IN); + + case 'CHECKED_OUT': + return const Known(ApplicationStatus.CHECKED_OUT); + + case 'LATE': + return const Known(ApplicationStatus.LATE); + + case 'NO_SHOW': + return const Known(ApplicationStatus.NO_SHOW); + + default: + return Unknown(data); + } + } + + + enum ApprovalStatus { + + APPROVED, + + } + + String approvalStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue approvalStatusDeserializer(dynamic data) { + switch (data) { + + case 'APPROVED': + return const Known(ApprovalStatus.APPROVED); + + default: + return Unknown(data); + } + } + + + enum AssignmentStatus { + + PENDING, + + CONFIRMED, + + OPEN, + + COMPLETED, + + CANCELED, + + ACTIVE, + + } + + String assignmentStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue assignmentStatusDeserializer(dynamic data) { + switch (data) { + + case 'PENDING': + return const Known(AssignmentStatus.PENDING); + + case 'CONFIRMED': + return const Known(AssignmentStatus.CONFIRMED); + + case 'OPEN': + return const Known(AssignmentStatus.OPEN); + + case 'COMPLETED': + return const Known(AssignmentStatus.COMPLETED); + + case 'CANCELED': + return const Known(AssignmentStatus.CANCELED); + + case 'ACTIVE': + return const Known(AssignmentStatus.ACTIVE); + + default: + return Unknown(data); + } + } + + + enum AvailabilitySlot { + + MORNING, + + AFTERNOON, + + EVENING, + + } + + String availabilitySlotSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue availabilitySlotDeserializer(dynamic data) { + switch (data) { + + case 'MORNING': + return const Known(AvailabilitySlot.MORNING); + + case 'AFTERNOON': + return const Known(AvailabilitySlot.AFTERNOON); + + case 'EVENING': + return const Known(AvailabilitySlot.EVENING); + + default: + return Unknown(data); + } + } + + + enum AvailabilityStatus { + + CONFIRMED_AVAILABLE, + + UNKNOWN, + + BLOCKED, + + } + + String availabilityStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue availabilityStatusDeserializer(dynamic data) { + switch (data) { + + case 'CONFIRMED_AVAILABLE': + return const Known(AvailabilityStatus.CONFIRMED_AVAILABLE); + + case 'UNKNOWN': + return const Known(AvailabilityStatus.UNKNOWN); + + case 'BLOCKED': + return const Known(AvailabilityStatus.BLOCKED); + + default: + return Unknown(data); + } + } + + + enum BackgroundCheckStatus { + + PENDING, + + CLEARED, + + FAILED, + + EXPIRED, + + NOT_REQUIRED, + + } + + String backgroundCheckStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue backgroundCheckStatusDeserializer(dynamic data) { + switch (data) { + + case 'PENDING': + return const Known(BackgroundCheckStatus.PENDING); + + case 'CLEARED': + return const Known(BackgroundCheckStatus.CLEARED); + + case 'FAILED': + return const Known(BackgroundCheckStatus.FAILED); + + case 'EXPIRED': + return const Known(BackgroundCheckStatus.EXPIRED); + + case 'NOT_REQUIRED': + return const Known(BackgroundCheckStatus.NOT_REQUIRED); + + default: + return Unknown(data); + } + } + + + enum BreakDuration { + + MIN_15, + + MIN_30, + + NO_BREAK, + + } + + String breakDurationSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue breakDurationDeserializer(dynamic data) { + switch (data) { + + case 'MIN_15': + return const Known(BreakDuration.MIN_15); + + case 'MIN_30': + return const Known(BreakDuration.MIN_30); + + case 'NO_BREAK': + return const Known(BreakDuration.NO_BREAK); + + default: + return Unknown(data); + } + } + + + enum BusinessArea { + + BAY_AREA, + + SOUTHERN_CALIFORNIA, + + NORTHERN_CALIFORNIA, + + CENTRAL_VALLEY, + + OTHER, + + } + + String businessAreaSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue businessAreaDeserializer(dynamic data) { + switch (data) { + + case 'BAY_AREA': + return const Known(BusinessArea.BAY_AREA); + + case 'SOUTHERN_CALIFORNIA': + return const Known(BusinessArea.SOUTHERN_CALIFORNIA); + + case 'NORTHERN_CALIFORNIA': + return const Known(BusinessArea.NORTHERN_CALIFORNIA); + + case 'CENTRAL_VALLEY': + return const Known(BusinessArea.CENTRAL_VALLEY); + + case 'OTHER': + return const Known(BusinessArea.OTHER); + + default: + return Unknown(data); + } + } + + + enum BusinessRateGroup { + + STANDARD, + + PREMIUM, + + ENTERPRISE, + + CUSTOM, + + } + + String businessRateGroupSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue businessRateGroupDeserializer(dynamic data) { + switch (data) { + + case 'STANDARD': + return const Known(BusinessRateGroup.STANDARD); + + case 'PREMIUM': + return const Known(BusinessRateGroup.PREMIUM); + + case 'ENTERPRISE': + return const Known(BusinessRateGroup.ENTERPRISE); + + case 'CUSTOM': + return const Known(BusinessRateGroup.CUSTOM); + + default: + return Unknown(data); + } + } + + + enum BusinessSector { + + BON_APPETIT, + + EUREST, + + ARAMARK, + + EPICUREAN_GROUP, + + CHARTWELLS, + + OTHER, + + } + + String businessSectorSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue businessSectorDeserializer(dynamic data) { + switch (data) { + + case 'BON_APPETIT': + return const Known(BusinessSector.BON_APPETIT); + + case 'EUREST': + return const Known(BusinessSector.EUREST); + + case 'ARAMARK': + return const Known(BusinessSector.ARAMARK); + + case 'EPICUREAN_GROUP': + return const Known(BusinessSector.EPICUREAN_GROUP); + + case 'CHARTWELLS': + return const Known(BusinessSector.CHARTWELLS); + + case 'OTHER': + return const Known(BusinessSector.OTHER); + + default: + return Unknown(data); + } + } + + + enum BusinessStatus { + + ACTIVE, + + INACTIVE, + + PENDING, + + } + + String businessStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue businessStatusDeserializer(dynamic data) { + switch (data) { + + case 'ACTIVE': + return const Known(BusinessStatus.ACTIVE); + + case 'INACTIVE': + return const Known(BusinessStatus.INACTIVE); + + case 'PENDING': + return const Known(BusinessStatus.PENDING); + + default: + return Unknown(data); + } + } + + + enum CategoryType { + + KITCHEN_AND_CULINARY, + + CONCESSIONS, + + FACILITIES, + + BARTENDING, + + SECURITY, + + EVENT_STAFF, + + MANAGEMENT, + + TECHNICAL, + + OTHER, + + } + + String categoryTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue categoryTypeDeserializer(dynamic data) { + switch (data) { + + case 'KITCHEN_AND_CULINARY': + return const Known(CategoryType.KITCHEN_AND_CULINARY); + + case 'CONCESSIONS': + return const Known(CategoryType.CONCESSIONS); + + case 'FACILITIES': + return const Known(CategoryType.FACILITIES); + + case 'BARTENDING': + return const Known(CategoryType.BARTENDING); + + case 'SECURITY': + return const Known(CategoryType.SECURITY); + + case 'EVENT_STAFF': + return const Known(CategoryType.EVENT_STAFF); + + case 'MANAGEMENT': + return const Known(CategoryType.MANAGEMENT); + + case 'TECHNICAL': + return const Known(CategoryType.TECHNICAL); + + case 'OTHER': + return const Known(CategoryType.OTHER); + + default: + return Unknown(data); + } + } + + + enum CertificateStatus { + + CURRENT, + + EXPIRING_SOON, + + COMPLETED, + + PENDING, + + EXPIRED, + + EXPIRING, + + NOT_STARTED, + + } + + String certificateStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue certificateStatusDeserializer(dynamic data) { + switch (data) { + + case 'CURRENT': + return const Known(CertificateStatus.CURRENT); + + case 'EXPIRING_SOON': + return const Known(CertificateStatus.EXPIRING_SOON); + + case 'COMPLETED': + return const Known(CertificateStatus.COMPLETED); + + case 'PENDING': + return const Known(CertificateStatus.PENDING); + + case 'EXPIRED': + return const Known(CertificateStatus.EXPIRED); + + case 'EXPIRING': + return const Known(CertificateStatus.EXPIRING); + + case 'NOT_STARTED': + return const Known(CertificateStatus.NOT_STARTED); + + default: + return Unknown(data); + } + } + + + enum ComplianceType { + + BACKGROUND_CHECK, + + FOOD_HANDLER, + + RBS, + + LEGAL, + + OPERATIONAL, + + SAFETY, + + TRAINING, + + LICENSE, + + OTHER, + + } + + String complianceTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue complianceTypeDeserializer(dynamic data) { + switch (data) { + + case 'BACKGROUND_CHECK': + return const Known(ComplianceType.BACKGROUND_CHECK); + + case 'FOOD_HANDLER': + return const Known(ComplianceType.FOOD_HANDLER); + + case 'RBS': + return const Known(ComplianceType.RBS); + + case 'LEGAL': + return const Known(ComplianceType.LEGAL); + + case 'OPERATIONAL': + return const Known(ComplianceType.OPERATIONAL); + + case 'SAFETY': + return const Known(ComplianceType.SAFETY); + + case 'TRAINING': + return const Known(ComplianceType.TRAINING); + + case 'LICENSE': + return const Known(ComplianceType.LICENSE); + + case 'OTHER': + return const Known(ComplianceType.OTHER); + + default: + return Unknown(data); + } + } + + + enum ConversationStatus { + + ACTIVE, + + } + + String conversationStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue conversationStatusDeserializer(dynamic data) { + switch (data) { + + case 'ACTIVE': + return const Known(ConversationStatus.ACTIVE); + + default: + return Unknown(data); + } + } + + + enum ConversationType { + + CLIENT_VENDOR, + + GROUP_STAFF, + + STAFF_CLIENT, + + STAFF_ADMIN, + + VENDOR_ADMIN, + + CLIENT_ADMIN, + + GROUP_ORDER_STAFF, + + } + + String conversationTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue conversationTypeDeserializer(dynamic data) { + switch (data) { + + case 'CLIENT_VENDOR': + return const Known(ConversationType.CLIENT_VENDOR); + + case 'GROUP_STAFF': + return const Known(ConversationType.GROUP_STAFF); + + case 'STAFF_CLIENT': + return const Known(ConversationType.STAFF_CLIENT); + + case 'STAFF_ADMIN': + return const Known(ConversationType.STAFF_ADMIN); + + case 'VENDOR_ADMIN': + return const Known(ConversationType.VENDOR_ADMIN); + + case 'CLIENT_ADMIN': + return const Known(ConversationType.CLIENT_ADMIN); + + case 'GROUP_ORDER_STAFF': + return const Known(ConversationType.GROUP_ORDER_STAFF); + + default: + return Unknown(data); + } + } + + + enum DayOfWeek { + + SUNDAY, + + MONDAY, + + TUESDAY, + + WEDNESDAY, + + THURSDAY, + + FRIDAY, + + SATURDAY, + + } + + String dayOfWeekSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue dayOfWeekDeserializer(dynamic data) { + switch (data) { + + case 'SUNDAY': + return const Known(DayOfWeek.SUNDAY); + + case 'MONDAY': + return const Known(DayOfWeek.MONDAY); + + case 'TUESDAY': + return const Known(DayOfWeek.TUESDAY); + + case 'WEDNESDAY': + return const Known(DayOfWeek.WEDNESDAY); + + case 'THURSDAY': + return const Known(DayOfWeek.THURSDAY); + + case 'FRIDAY': + return const Known(DayOfWeek.FRIDAY); + + case 'SATURDAY': + return const Known(DayOfWeek.SATURDAY); + + default: + return Unknown(data); + } + } + + + enum DepartmentType { + + OPERATIONS, + + SALES, + + HR, + + FINANCE, + + IT, + + MARKETING, + + CUSTOMER_SERVICE, + + LOGISTICS, + + } + + String departmentTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue departmentTypeDeserializer(dynamic data) { + switch (data) { + + case 'OPERATIONS': + return const Known(DepartmentType.OPERATIONS); + + case 'SALES': + return const Known(DepartmentType.SALES); + + case 'HR': + return const Known(DepartmentType.HR); + + case 'FINANCE': + return const Known(DepartmentType.FINANCE); + + case 'IT': + return const Known(DepartmentType.IT); + + case 'MARKETING': + return const Known(DepartmentType.MARKETING); + + case 'CUSTOMER_SERVICE': + return const Known(DepartmentType.CUSTOMER_SERVICE); + + case 'LOGISTICS': + return const Known(DepartmentType.LOGISTICS); + + default: + return Unknown(data); + } + } + + + enum DocumentStatus { + + UPLOADED, + + PENDING, + + EXPIRING, + + MISSING, + + VERIFIED, + + } + + String documentStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue documentStatusDeserializer(dynamic data) { + switch (data) { + + case 'UPLOADED': + return const Known(DocumentStatus.UPLOADED); + + case 'PENDING': + return const Known(DocumentStatus.PENDING); + + case 'EXPIRING': + return const Known(DocumentStatus.EXPIRING); + + case 'MISSING': + return const Known(DocumentStatus.MISSING); + + case 'VERIFIED': + return const Known(DocumentStatus.VERIFIED); + + default: + return Unknown(data); + } + } + + + enum DocumentType { + + W4_FORM, + + I9_FORM, + + STATE_TAX_FORM, + + DIRECT_DEPOSIT, + + ID_COPY, + + SSN_CARD, + + WORK_PERMIT, + + } + + String documentTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue documentTypeDeserializer(dynamic data) { + switch (data) { + + case 'W4_FORM': + return const Known(DocumentType.W4_FORM); + + case 'I9_FORM': + return const Known(DocumentType.I9_FORM); + + case 'STATE_TAX_FORM': + return const Known(DocumentType.STATE_TAX_FORM); + + case 'DIRECT_DEPOSIT': + return const Known(DocumentType.DIRECT_DEPOSIT); + + case 'ID_COPY': + return const Known(DocumentType.ID_COPY); + + case 'SSN_CARD': + return const Known(DocumentType.SSN_CARD); + + case 'WORK_PERMIT': + return const Known(DocumentType.WORK_PERMIT); + + default: + return Unknown(data); + } + } + + + enum EmploymentType { + + FULL_TIME, + + PART_TIME, + + ON_CALL, + + WEEKENDS, + + SPECIFIC_DAYS, + + SEASONAL, + + MEDICAL_LEAVE, + + } + + String employmentTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue employmentTypeDeserializer(dynamic data) { + switch (data) { + + case 'FULL_TIME': + return const Known(EmploymentType.FULL_TIME); + + case 'PART_TIME': + return const Known(EmploymentType.PART_TIME); + + case 'ON_CALL': + return const Known(EmploymentType.ON_CALL); + + case 'WEEKENDS': + return const Known(EmploymentType.WEEKENDS); + + case 'SPECIFIC_DAYS': + return const Known(EmploymentType.SPECIFIC_DAYS); + + case 'SEASONAL': + return const Known(EmploymentType.SEASONAL); + + case 'MEDICAL_LEAVE': + return const Known(EmploymentType.MEDICAL_LEAVE); + + default: + return Unknown(data); + } + } + + + enum EnglishProficiency { + + FLUENT, + + INTERMEDIATE, + + BASIC, + + NONE, + + } + + String englishProficiencySerializer(EnumValue e) { + return e.stringValue; + } + EnumValue englishProficiencyDeserializer(dynamic data) { + switch (data) { + + case 'FLUENT': + return const Known(EnglishProficiency.FLUENT); + + case 'INTERMEDIATE': + return const Known(EnglishProficiency.INTERMEDIATE); + + case 'BASIC': + return const Known(EnglishProficiency.BASIC); + + case 'NONE': + return const Known(EnglishProficiency.NONE); + + default: + return Unknown(data); + } + } + + + enum InovicePaymentTerms { + + NET_30, + + NET_45, + + NET_60, + + } + + String inovicePaymentTermsSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue inovicePaymentTermsDeserializer(dynamic data) { + switch (data) { + + case 'NET_30': + return const Known(InovicePaymentTerms.NET_30); + + case 'NET_45': + return const Known(InovicePaymentTerms.NET_45); + + case 'NET_60': + return const Known(InovicePaymentTerms.NET_60); + + default: + return Unknown(data); + } + } + + + enum InovicePaymentTermsTemp { + + NET_30, + + NET_45, + + NET_60, + + } + + String inovicePaymentTermsTempSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue inovicePaymentTermsTempDeserializer(dynamic data) { + switch (data) { + + case 'NET_30': + return const Known(InovicePaymentTermsTemp.NET_30); + + case 'NET_45': + return const Known(InovicePaymentTermsTemp.NET_45); + + case 'NET_60': + return const Known(InovicePaymentTermsTemp.NET_60); + + default: + return Unknown(data); + } + } + + + enum InvoiceStatus { + + PAID, + + PENDING, + + OVERDUE, + + PENDING_REVIEW, + + APPROVED, + + DISPUTED, + + DRAFT, + + } + + String invoiceStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue invoiceStatusDeserializer(dynamic data) { + switch (data) { + + case 'PAID': + return const Known(InvoiceStatus.PAID); + + case 'PENDING': + return const Known(InvoiceStatus.PENDING); + + case 'OVERDUE': + return const Known(InvoiceStatus.OVERDUE); + + case 'PENDING_REVIEW': + return const Known(InvoiceStatus.PENDING_REVIEW); + + case 'APPROVED': + return const Known(InvoiceStatus.APPROVED); + + case 'DISPUTED': + return const Known(InvoiceStatus.DISPUTED); + + case 'DRAFT': + return const Known(InvoiceStatus.DRAFT); + + default: + return Unknown(data); + } + } + + + enum OrderDuration { + + WEEKLY, + + MONTHLY, + + } + + String orderDurationSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue orderDurationDeserializer(dynamic data) { + switch (data) { + + case 'WEEKLY': + return const Known(OrderDuration.WEEKLY); + + case 'MONTHLY': + return const Known(OrderDuration.MONTHLY); + + default: + return Unknown(data); + } + } + + + enum OrderStatus { + + DRAFT, + + POSTED, + + FILLED, + + COMPLETED, + + CANCELLED, + + PENDING, + + FULLY_STAFFED, + + PARTIAL_STAFFED, + + } + + String orderStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue orderStatusDeserializer(dynamic data) { + switch (data) { + + case 'DRAFT': + return const Known(OrderStatus.DRAFT); + + case 'POSTED': + return const Known(OrderStatus.POSTED); + + case 'FILLED': + return const Known(OrderStatus.FILLED); + + case 'COMPLETED': + return const Known(OrderStatus.COMPLETED); + + case 'CANCELLED': + return const Known(OrderStatus.CANCELLED); + + case 'PENDING': + return const Known(OrderStatus.PENDING); + + case 'FULLY_STAFFED': + return const Known(OrderStatus.FULLY_STAFFED); + + case 'PARTIAL_STAFFED': + return const Known(OrderStatus.PARTIAL_STAFFED); + + default: + return Unknown(data); + } + } + + + enum OrderType { + + ONE_TIME, + + PERMANENT, + + RECURRING, + + RAPID, + + } + + String orderTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue orderTypeDeserializer(dynamic data) { + switch (data) { + + case 'ONE_TIME': + return const Known(OrderType.ONE_TIME); + + case 'PERMANENT': + return const Known(OrderType.PERMANENT); + + case 'RECURRING': + return const Known(OrderType.RECURRING); + + case 'RAPID': + return const Known(OrderType.RAPID); + + default: + return Unknown(data); + } + } + + + enum RecentPaymentStatus { + + PAID, + + PENDING, + + FAILED, + + } + + String recentPaymentStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue recentPaymentStatusDeserializer(dynamic data) { + switch (data) { + + case 'PAID': + return const Known(RecentPaymentStatus.PAID); + + case 'PENDING': + return const Known(RecentPaymentStatus.PENDING); + + case 'FAILED': + return const Known(RecentPaymentStatus.FAILED); + + default: + return Unknown(data); + } + } + + + enum RelationshipType { + + FAMILY, + + SPOUSE, + + FRIEND, + + OTHER, + + } + + String relationshipTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue relationshipTypeDeserializer(dynamic data) { + switch (data) { + + case 'FAMILY': + return const Known(RelationshipType.FAMILY); + + case 'SPOUSE': + return const Known(RelationshipType.SPOUSE); + + case 'FRIEND': + return const Known(RelationshipType.FRIEND); + + case 'OTHER': + return const Known(RelationshipType.OTHER); + + default: + return Unknown(data); + } + } + + + enum RoleCategoryType { + + KITCHEN_AND_CULINARY, + + CONCESSIONS, + + FACILITIES, + + BARTENDING, + + SECURITY, + + EVENT_STAFF, + + MANAGEMENT, + + TECHNICAL, + + OTHER, + + } + + String roleCategoryTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue roleCategoryTypeDeserializer(dynamic data) { + switch (data) { + + case 'KITCHEN_AND_CULINARY': + return const Known(RoleCategoryType.KITCHEN_AND_CULINARY); + + case 'CONCESSIONS': + return const Known(RoleCategoryType.CONCESSIONS); + + case 'FACILITIES': + return const Known(RoleCategoryType.FACILITIES); + + case 'BARTENDING': + return const Known(RoleCategoryType.BARTENDING); + + case 'SECURITY': + return const Known(RoleCategoryType.SECURITY); + + case 'EVENT_STAFF': + return const Known(RoleCategoryType.EVENT_STAFF); + + case 'MANAGEMENT': + return const Known(RoleCategoryType.MANAGEMENT); + + case 'TECHNICAL': + return const Known(RoleCategoryType.TECHNICAL); + + case 'OTHER': + return const Known(RoleCategoryType.OTHER); + + default: + return Unknown(data); + } + } + + + enum RoleType { + + SKILLED, + + BEGINNER, + + CROSS_TRAINED, + + } + + String roleTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue roleTypeDeserializer(dynamic data) { + switch (data) { + + case 'SKILLED': + return const Known(RoleType.SKILLED); + + case 'BEGINNER': + return const Known(RoleType.BEGINNER); + + case 'CROSS_TRAINED': + return const Known(RoleType.CROSS_TRAINED); + + default: + return Unknown(data); + } + } + + + enum ShiftStatus { + + DRAFT, + + FILLED, + + PENDING, + + ASSIGNED, + + CONFIRMED, + + OPEN, + + IN_PROGRESS, + + COMPLETED, + + CANCELED, + + } + + String shiftStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue shiftStatusDeserializer(dynamic data) { + switch (data) { + + case 'DRAFT': + return const Known(ShiftStatus.DRAFT); + + case 'FILLED': + return const Known(ShiftStatus.FILLED); + + case 'PENDING': + return const Known(ShiftStatus.PENDING); + + case 'ASSIGNED': + return const Known(ShiftStatus.ASSIGNED); + + case 'CONFIRMED': + return const Known(ShiftStatus.CONFIRMED); + + case 'OPEN': + return const Known(ShiftStatus.OPEN); + + case 'IN_PROGRESS': + return const Known(ShiftStatus.IN_PROGRESS); + + case 'COMPLETED': + return const Known(ShiftStatus.COMPLETED); + + case 'CANCELED': + return const Known(ShiftStatus.CANCELED); + + default: + return Unknown(data); + } + } + + + enum TaskPriority { + + LOW, + + NORMAL, + + HIGH, + + } + + String taskPrioritySerializer(EnumValue e) { + return e.stringValue; + } + EnumValue taskPriorityDeserializer(dynamic data) { + switch (data) { + + case 'LOW': + return const Known(TaskPriority.LOW); + + case 'NORMAL': + return const Known(TaskPriority.NORMAL); + + case 'HIGH': + return const Known(TaskPriority.HIGH); + + default: + return Unknown(data); + } + } + + + enum TaskStatus { + + PENDING, + + IN_PROGRESS, + + COMPLETED, + + } + + String taskStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue taskStatusDeserializer(dynamic data) { + switch (data) { + + case 'PENDING': + return const Known(TaskStatus.PENDING); + + case 'IN_PROGRESS': + return const Known(TaskStatus.IN_PROGRESS); + + case 'COMPLETED': + return const Known(TaskStatus.COMPLETED); + + default: + return Unknown(data); + } + } + + + enum TaxFormStatus { + + NOT_STARTED, + + DRAFT, + + SUBMITTED, + + APPROVED, + + REJECTED, + + } + + String taxFormStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue taxFormStatusDeserializer(dynamic data) { + switch (data) { + + case 'NOT_STARTED': + return const Known(TaxFormStatus.NOT_STARTED); + + case 'DRAFT': + return const Known(TaxFormStatus.DRAFT); + + case 'SUBMITTED': + return const Known(TaxFormStatus.SUBMITTED); + + case 'APPROVED': + return const Known(TaxFormStatus.APPROVED); + + case 'REJECTED': + return const Known(TaxFormStatus.REJECTED); + + default: + return Unknown(data); + } + } + + + enum TaxFormType { + + I9, + + W4, + + } + + String taxFormTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue taxFormTypeDeserializer(dynamic data) { + switch (data) { + + case 'I9': + return const Known(TaxFormType.I9); + + case 'W4': + return const Known(TaxFormType.W4); + + default: + return Unknown(data); + } + } + + + enum TeamMemberInviteStatus { + + PENDING, + + ACCEPTED, + + CANCELLED, + + } + + String teamMemberInviteStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue teamMemberInviteStatusDeserializer(dynamic data) { + switch (data) { + + case 'PENDING': + return const Known(TeamMemberInviteStatus.PENDING); + + case 'ACCEPTED': + return const Known(TeamMemberInviteStatus.ACCEPTED); + + case 'CANCELLED': + return const Known(TeamMemberInviteStatus.CANCELLED); + + default: + return Unknown(data); + } + } + + + enum TeamMemberRole { + + OWNER, + + ADMIN, + + MEMBER, + + MANAGER, + + VIEWER, + + } + + String teamMemberRoleSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue teamMemberRoleDeserializer(dynamic data) { + switch (data) { + + case 'OWNER': + return const Known(TeamMemberRole.OWNER); + + case 'ADMIN': + return const Known(TeamMemberRole.ADMIN); + + case 'MEMBER': + return const Known(TeamMemberRole.MEMBER); + + case 'MANAGER': + return const Known(TeamMemberRole.MANAGER); + + case 'VIEWER': + return const Known(TeamMemberRole.VIEWER); + + default: + return Unknown(data); + } + } + + + enum UserBaseRole { + + ADMIN, + + USER, + + } + + String userBaseRoleSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue userBaseRoleDeserializer(dynamic data) { + switch (data) { + + case 'ADMIN': + return const Known(UserBaseRole.ADMIN); + + case 'USER': + return const Known(UserBaseRole.USER); + + default: + return Unknown(data); + } + } + + + enum ValidationStatus { + + APPROVED, + + PENDING_EXPERT_REVIEW, + + REJECTED, + + AI_VERIFIED, + + AI_FLAGGED, + + MANUAL_REVIEW_NEEDED, + + } + + String validationStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue validationStatusDeserializer(dynamic data) { + switch (data) { + + case 'APPROVED': + return const Known(ValidationStatus.APPROVED); + + case 'PENDING_EXPERT_REVIEW': + return const Known(ValidationStatus.PENDING_EXPERT_REVIEW); + + case 'REJECTED': + return const Known(ValidationStatus.REJECTED); + + case 'AI_VERIFIED': + return const Known(ValidationStatus.AI_VERIFIED); + + case 'AI_FLAGGED': + return const Known(ValidationStatus.AI_FLAGGED); + + case 'MANUAL_REVIEW_NEEDED': + return const Known(ValidationStatus.MANUAL_REVIEW_NEEDED); + + default: + return Unknown(data); + } + } + + + enum VendorTier { + + PREFERRED, + + APPROVED, + + STANDARD, + + } + + String vendorTierSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue vendorTierDeserializer(dynamic data) { + switch (data) { + + case 'PREFERRED': + return const Known(VendorTier.PREFERRED); + + case 'APPROVED': + return const Known(VendorTier.APPROVED); + + case 'STANDARD': + return const Known(VendorTier.STANDARD); + + default: + return Unknown(data); + } + } + + + enum WorkforceEmploymentType { + + W2, + + W1099, + + TEMPORARY, + + CONTRACT, + + } + + String workforceEmploymentTypeSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue workforceEmploymentTypeDeserializer(dynamic data) { + switch (data) { + + case 'W2': + return const Known(WorkforceEmploymentType.W2); + + case 'W1099': + return const Known(WorkforceEmploymentType.W1099); + + case 'TEMPORARY': + return const Known(WorkforceEmploymentType.TEMPORARY); + + case 'CONTRACT': + return const Known(WorkforceEmploymentType.CONTRACT); + + default: + return Unknown(data); + } + } + + + enum WorkforceStatus { + + ACTIVE, + + INACTIVE, + + } + + String workforceStatusSerializer(EnumValue e) { + return e.stringValue; + } + EnumValue workforceStatusDeserializer(dynamic data) { + switch (data) { + + case 'ACTIVE': + return const Known(WorkforceStatus.ACTIVE); + + case 'INACTIVE': + return const Known(WorkforceStatus.INACTIVE); + + default: + return Unknown(data); + } + } + + + + +String enumSerializer(Enum e) { + return e.name; +} + + + +/// A sealed class representing either a known enum value or an unknown string value. +@immutable +sealed class EnumValue { + const EnumValue(); + + + + /// The string representation of the value. + String get stringValue; + @override + String toString() { + return "EnumValue($stringValue)"; + } +} + +/// Represents a known, valid enum value. +class Known extends EnumValue { + /// The actual enum value. + final T value; + + const Known(this.value); + + @override + String get stringValue => value.name; + + @override + String toString() { + return "Known($stringValue)"; + } +} +/// Represents an unknown or unrecognized enum value. +class Unknown extends EnumValue { + /// The raw string value that couldn't be mapped to a known enum. + @override + final String stringValue; + + const Unknown(this.stringValue); + @override + String toString() { + return "Unknown($stringValue)"; + } +} + +class ExampleConnector { + + + CreateTeamMemberVariablesBuilder createTeamMember ({required String teamId, required TeamMemberRole role, required String userId, }) { + return CreateTeamMemberVariablesBuilder(dataConnect, teamId: teamId,role: role,userId: userId,); + } + + + UpdateTeamMemberVariablesBuilder updateTeamMember ({required String id, }) { + return UpdateTeamMemberVariablesBuilder(dataConnect, id: id,); + } + + + UpdateTeamMemberInviteStatusVariablesBuilder updateTeamMemberInviteStatus ({required String id, required TeamMemberInviteStatus inviteStatus, }) { + return UpdateTeamMemberInviteStatusVariablesBuilder(dataConnect, id: id,inviteStatus: inviteStatus,); + } + + + AcceptInviteByCodeVariablesBuilder acceptInviteByCode ({required String inviteCode, }) { + return AcceptInviteByCodeVariablesBuilder(dataConnect, inviteCode: inviteCode,); + } + + + CancelInviteByCodeVariablesBuilder cancelInviteByCode ({required String inviteCode, }) { + return CancelInviteByCodeVariablesBuilder(dataConnect, inviteCode: inviteCode,); + } + + + DeleteTeamMemberVariablesBuilder deleteTeamMember ({required String id, }) { + return DeleteTeamMemberVariablesBuilder(dataConnect, id: id,); + } + + + ListActivityLogsVariablesBuilder listActivityLogs () { + return ListActivityLogsVariablesBuilder(dataConnect, ); + } + + + GetActivityLogByIdVariablesBuilder getActivityLogById ({required String id, }) { + return GetActivityLogByIdVariablesBuilder(dataConnect, id: id,); + } + + + ListActivityLogsByUserIdVariablesBuilder listActivityLogsByUserId ({required String userId, }) { + return ListActivityLogsByUserIdVariablesBuilder(dataConnect, userId: userId,); + } + + + ListUnreadActivityLogsByUserIdVariablesBuilder listUnreadActivityLogsByUserId ({required String userId, }) { + return ListUnreadActivityLogsByUserIdVariablesBuilder(dataConnect, userId: userId,); + } + + + FilterActivityLogsVariablesBuilder filterActivityLogs () { + return FilterActivityLogsVariablesBuilder(dataConnect, ); + } + + + CreateBenefitsDataVariablesBuilder createBenefitsData ({required String vendorBenefitPlanId, required String staffId, required int current, }) { + return CreateBenefitsDataVariablesBuilder(dataConnect, vendorBenefitPlanId: vendorBenefitPlanId,staffId: staffId,current: current,); + } + + + UpdateBenefitsDataVariablesBuilder updateBenefitsData ({required String staffId, required String vendorBenefitPlanId, }) { + return UpdateBenefitsDataVariablesBuilder(dataConnect, staffId: staffId,vendorBenefitPlanId: vendorBenefitPlanId,); + } + + + DeleteBenefitsDataVariablesBuilder deleteBenefitsData ({required String staffId, required String vendorBenefitPlanId, }) { + return DeleteBenefitsDataVariablesBuilder(dataConnect, staffId: staffId,vendorBenefitPlanId: vendorBenefitPlanId,); + } + + + ListBusinessesVariablesBuilder listBusinesses () { + return ListBusinessesVariablesBuilder(dataConnect, ); + } + + + GetBusinessesByUserIdVariablesBuilder getBusinessesByUserId ({required String userId, }) { + return GetBusinessesByUserIdVariablesBuilder(dataConnect, userId: userId,); + } + + + GetBusinessByIdVariablesBuilder getBusinessById ({required String id, }) { + return GetBusinessByIdVariablesBuilder(dataConnect, id: id,); + } + + + ListShiftsForCoverageVariablesBuilder listShiftsForCoverage ({required String businessId, required Timestamp startDate, required Timestamp endDate, }) { + return ListShiftsForCoverageVariablesBuilder(dataConnect, businessId: businessId,startDate: startDate,endDate: endDate,); + } + + + ListApplicationsForCoverageVariablesBuilder listApplicationsForCoverage ({required List shiftIds, }) { + return ListApplicationsForCoverageVariablesBuilder(dataConnect, shiftIds: shiftIds,); + } + + + ListShiftsForDailyOpsByBusinessVariablesBuilder listShiftsForDailyOpsByBusiness ({required String businessId, required Timestamp date, }) { + return ListShiftsForDailyOpsByBusinessVariablesBuilder(dataConnect, businessId: businessId,date: date,); + } + + + ListShiftsForDailyOpsByVendorVariablesBuilder listShiftsForDailyOpsByVendor ({required String vendorId, required Timestamp date, }) { + return ListShiftsForDailyOpsByVendorVariablesBuilder(dataConnect, vendorId: vendorId,date: date,); + } + + + ListApplicationsForDailyOpsVariablesBuilder listApplicationsForDailyOps ({required List shiftIds, }) { + return ListApplicationsForDailyOpsVariablesBuilder(dataConnect, shiftIds: shiftIds,); + } + + + ListShiftsForForecastByBusinessVariablesBuilder listShiftsForForecastByBusiness ({required String businessId, required Timestamp startDate, required Timestamp endDate, }) { + return ListShiftsForForecastByBusinessVariablesBuilder(dataConnect, businessId: businessId,startDate: startDate,endDate: endDate,); + } + + + ListShiftsForForecastByVendorVariablesBuilder listShiftsForForecastByVendor ({required String vendorId, required Timestamp startDate, required Timestamp endDate, }) { + return ListShiftsForForecastByVendorVariablesBuilder(dataConnect, vendorId: vendorId,startDate: startDate,endDate: endDate,); + } + + + ListShiftsForNoShowRangeByBusinessVariablesBuilder listShiftsForNoShowRangeByBusiness ({required String businessId, required Timestamp startDate, required Timestamp endDate, }) { + return ListShiftsForNoShowRangeByBusinessVariablesBuilder(dataConnect, businessId: businessId,startDate: startDate,endDate: endDate,); + } + + + ListShiftsForNoShowRangeByVendorVariablesBuilder listShiftsForNoShowRangeByVendor ({required String vendorId, required Timestamp startDate, required Timestamp endDate, }) { + return ListShiftsForNoShowRangeByVendorVariablesBuilder(dataConnect, vendorId: vendorId,startDate: startDate,endDate: endDate,); + } + + + ListApplicationsForNoShowRangeVariablesBuilder listApplicationsForNoShowRange ({required List shiftIds, }) { + return ListApplicationsForNoShowRangeVariablesBuilder(dataConnect, shiftIds: shiftIds,); + } + + + ListStaffForNoShowReportVariablesBuilder listStaffForNoShowReport ({required List staffIds, }) { + return ListStaffForNoShowReportVariablesBuilder(dataConnect, staffIds: staffIds,); + } + + + ListInvoicesForSpendByBusinessVariablesBuilder listInvoicesForSpendByBusiness ({required String businessId, required Timestamp startDate, required Timestamp endDate, }) { + return ListInvoicesForSpendByBusinessVariablesBuilder(dataConnect, businessId: businessId,startDate: startDate,endDate: endDate,); + } + + + ListInvoicesForSpendByVendorVariablesBuilder listInvoicesForSpendByVendor ({required String vendorId, required Timestamp startDate, required Timestamp endDate, }) { + return ListInvoicesForSpendByVendorVariablesBuilder(dataConnect, vendorId: vendorId,startDate: startDate,endDate: endDate,); + } + + + ListInvoicesForSpendByOrderVariablesBuilder listInvoicesForSpendByOrder ({required String orderId, required Timestamp startDate, required Timestamp endDate, }) { + return ListInvoicesForSpendByOrderVariablesBuilder(dataConnect, orderId: orderId,startDate: startDate,endDate: endDate,); + } + + + ListTimesheetsForSpendVariablesBuilder listTimesheetsForSpend ({required Timestamp startTime, required Timestamp endTime, }) { + return ListTimesheetsForSpendVariablesBuilder(dataConnect, startTime: startTime,endTime: endTime,); + } + + + ListShiftsForPerformanceByBusinessVariablesBuilder listShiftsForPerformanceByBusiness ({required String businessId, required Timestamp startDate, required Timestamp endDate, }) { + return ListShiftsForPerformanceByBusinessVariablesBuilder(dataConnect, businessId: businessId,startDate: startDate,endDate: endDate,); + } + + + ListShiftsForPerformanceByVendorVariablesBuilder listShiftsForPerformanceByVendor ({required String vendorId, required Timestamp startDate, required Timestamp endDate, }) { + return ListShiftsForPerformanceByVendorVariablesBuilder(dataConnect, vendorId: vendorId,startDate: startDate,endDate: endDate,); + } + + + ListApplicationsForPerformanceVariablesBuilder listApplicationsForPerformance ({required List shiftIds, }) { + return ListApplicationsForPerformanceVariablesBuilder(dataConnect, shiftIds: shiftIds,); + } + + + ListStaffForPerformanceVariablesBuilder listStaffForPerformance ({required List staffIds, }) { + return ListStaffForPerformanceVariablesBuilder(dataConnect, staffIds: staffIds,); + } + + + ListStaffAvailabilitiesVariablesBuilder listStaffAvailabilities () { + return ListStaffAvailabilitiesVariablesBuilder(dataConnect, ); + } + + + ListStaffAvailabilitiesByStaffIdVariablesBuilder listStaffAvailabilitiesByStaffId ({required String staffId, }) { + return ListStaffAvailabilitiesByStaffIdVariablesBuilder(dataConnect, staffId: staffId,); + } + + + GetStaffAvailabilityByKeyVariablesBuilder getStaffAvailabilityByKey ({required String staffId, required DayOfWeek day, required AvailabilitySlot slot, }) { + return GetStaffAvailabilityByKeyVariablesBuilder(dataConnect, staffId: staffId,day: day,slot: slot,); + } + + + ListStaffAvailabilitiesByDayVariablesBuilder listStaffAvailabilitiesByDay ({required DayOfWeek day, }) { + return ListStaffAvailabilitiesByDayVariablesBuilder(dataConnect, day: day,); + } + + + CreateStaffCourseVariablesBuilder createStaffCourse ({required String staffId, required String courseId, }) { + return CreateStaffCourseVariablesBuilder(dataConnect, staffId: staffId,courseId: courseId,); + } + + + UpdateStaffCourseVariablesBuilder updateStaffCourse ({required String id, }) { + return UpdateStaffCourseVariablesBuilder(dataConnect, id: id,); + } + + + DeleteStaffCourseVariablesBuilder deleteStaffCourse ({required String id, }) { + return DeleteStaffCourseVariablesBuilder(dataConnect, id: id,); + } + + + CreateTeamVariablesBuilder createTeam ({required String teamName, required String ownerId, required String ownerName, required String ownerRole, }) { + return CreateTeamVariablesBuilder(dataConnect, teamName: teamName,ownerId: ownerId,ownerName: ownerName,ownerRole: ownerRole,); + } + + + UpdateTeamVariablesBuilder updateTeam ({required String id, }) { + return UpdateTeamVariablesBuilder(dataConnect, id: id,); + } + + + DeleteTeamVariablesBuilder deleteTeam ({required String id, }) { + return DeleteTeamVariablesBuilder(dataConnect, id: id,); + } + + + CreateTeamHubVariablesBuilder createTeamHub ({required String teamId, required String hubName, required String address, }) { + return CreateTeamHubVariablesBuilder(dataConnect, teamId: teamId,hubName: hubName,address: address,); + } + + + UpdateTeamHubVariablesBuilder updateTeamHub ({required String id, }) { + return UpdateTeamHubVariablesBuilder(dataConnect, id: id,); + } + + + DeleteTeamHubVariablesBuilder deleteTeamHub ({required String id, }) { + return DeleteTeamHubVariablesBuilder(dataConnect, id: id,); + } + + + CreateApplicationVariablesBuilder createApplication ({required String shiftId, required String staffId, required ApplicationStatus status, required ApplicationOrigin origin, required String roleId, }) { + return CreateApplicationVariablesBuilder(dataConnect, shiftId: shiftId,staffId: staffId,status: status,origin: origin,roleId: roleId,); + } + + + UpdateApplicationStatusVariablesBuilder updateApplicationStatus ({required String id, required String roleId, }) { + return UpdateApplicationStatusVariablesBuilder(dataConnect, id: id,roleId: roleId,); + } + + + DeleteApplicationVariablesBuilder deleteApplication ({required String id, }) { + return DeleteApplicationVariablesBuilder(dataConnect, id: id,); + } + + + ListConversationsVariablesBuilder listConversations () { + return ListConversationsVariablesBuilder(dataConnect, ); + } + + + GetConversationByIdVariablesBuilder getConversationById ({required String id, }) { + return GetConversationByIdVariablesBuilder(dataConnect, id: id,); + } + + + ListConversationsByTypeVariablesBuilder listConversationsByType ({required ConversationType conversationType, }) { + return ListConversationsByTypeVariablesBuilder(dataConnect, conversationType: conversationType,); + } + + + ListConversationsByStatusVariablesBuilder listConversationsByStatus ({required ConversationStatus status, }) { + return ListConversationsByStatusVariablesBuilder(dataConnect, status: status,); + } + + + FilterConversationsVariablesBuilder filterConversations () { + return FilterConversationsVariablesBuilder(dataConnect, ); + } + + + CreateShiftVariablesBuilder createShift ({required String title, required String orderId, }) { + return CreateShiftVariablesBuilder(dataConnect, title: title,orderId: orderId,); + } + + + UpdateShiftVariablesBuilder updateShift ({required String id, }) { + return UpdateShiftVariablesBuilder(dataConnect, id: id,); + } + + + DeleteShiftVariablesBuilder deleteShift ({required String id, }) { + return DeleteShiftVariablesBuilder(dataConnect, id: id,); + } + + + ListTeamsVariablesBuilder listTeams () { + return ListTeamsVariablesBuilder(dataConnect, ); + } + + + GetTeamByIdVariablesBuilder getTeamById ({required String id, }) { + return GetTeamByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetTeamsByOwnerIdVariablesBuilder getTeamsByOwnerId ({required String ownerId, }) { + return GetTeamsByOwnerIdVariablesBuilder(dataConnect, ownerId: ownerId,); + } + + + ListCategoriesVariablesBuilder listCategories () { + return ListCategoriesVariablesBuilder(dataConnect, ); + } + + + GetCategoryByIdVariablesBuilder getCategoryById ({required String id, }) { + return GetCategoryByIdVariablesBuilder(dataConnect, id: id,); + } + + + FilterCategoriesVariablesBuilder filterCategories () { + return FilterCategoriesVariablesBuilder(dataConnect, ); + } + + + CreateUserConversationVariablesBuilder createUserConversation ({required String conversationId, required String userId, }) { + return CreateUserConversationVariablesBuilder(dataConnect, conversationId: conversationId,userId: userId,); + } + + + UpdateUserConversationVariablesBuilder updateUserConversation ({required String conversationId, required String userId, }) { + return UpdateUserConversationVariablesBuilder(dataConnect, conversationId: conversationId,userId: userId,); + } + + + MarkConversationAsReadVariablesBuilder markConversationAsRead ({required String conversationId, required String userId, }) { + return MarkConversationAsReadVariablesBuilder(dataConnect, conversationId: conversationId,userId: userId,); + } + + + IncrementUnreadForUserVariablesBuilder incrementUnreadForUser ({required String conversationId, required String userId, required int unreadCount, }) { + return IncrementUnreadForUserVariablesBuilder(dataConnect, conversationId: conversationId,userId: userId,unreadCount: unreadCount,); + } + + + DeleteUserConversationVariablesBuilder deleteUserConversation ({required String conversationId, required String userId, }) { + return DeleteUserConversationVariablesBuilder(dataConnect, conversationId: conversationId,userId: userId,); + } + + + ListVendorBenefitPlansVariablesBuilder listVendorBenefitPlans () { + return ListVendorBenefitPlansVariablesBuilder(dataConnect, ); + } + + + GetVendorBenefitPlanByIdVariablesBuilder getVendorBenefitPlanById ({required String id, }) { + return GetVendorBenefitPlanByIdVariablesBuilder(dataConnect, id: id,); + } + + + ListVendorBenefitPlansByVendorIdVariablesBuilder listVendorBenefitPlansByVendorId ({required String vendorId, }) { + return ListVendorBenefitPlansByVendorIdVariablesBuilder(dataConnect, vendorId: vendorId,); + } + + + ListActiveVendorBenefitPlansByVendorIdVariablesBuilder listActiveVendorBenefitPlansByVendorId ({required String vendorId, }) { + return ListActiveVendorBenefitPlansByVendorIdVariablesBuilder(dataConnect, vendorId: vendorId,); + } + + + FilterVendorBenefitPlansVariablesBuilder filterVendorBenefitPlans () { + return FilterVendorBenefitPlansVariablesBuilder(dataConnect, ); + } + + + ListCoursesVariablesBuilder listCourses () { + return ListCoursesVariablesBuilder(dataConnect, ); + } + + + GetCourseByIdVariablesBuilder getCourseById ({required String id, }) { + return GetCourseByIdVariablesBuilder(dataConnect, id: id,); + } + + + FilterCoursesVariablesBuilder filterCourses () { + return FilterCoursesVariablesBuilder(dataConnect, ); + } + + + ListRolesVariablesBuilder listRoles () { + return ListRolesVariablesBuilder(dataConnect, ); + } + + + GetRoleByIdVariablesBuilder getRoleById ({required String id, }) { + return GetRoleByIdVariablesBuilder(dataConnect, id: id,); + } + + + ListRolesByVendorIdVariablesBuilder listRolesByVendorId ({required String vendorId, }) { + return ListRolesByVendorIdVariablesBuilder(dataConnect, vendorId: vendorId,); + } + + + ListRolesByroleCategoryIdVariablesBuilder listRolesByroleCategoryId ({required String roleCategoryId, }) { + return ListRolesByroleCategoryIdVariablesBuilder(dataConnect, roleCategoryId: roleCategoryId,); + } + + + GetStaffCourseByIdVariablesBuilder getStaffCourseById ({required String id, }) { + return GetStaffCourseByIdVariablesBuilder(dataConnect, id: id,); + } + + + ListStaffCoursesByStaffIdVariablesBuilder listStaffCoursesByStaffId ({required String staffId, }) { + return ListStaffCoursesByStaffIdVariablesBuilder(dataConnect, staffId: staffId,); + } + + + ListStaffCoursesByCourseIdVariablesBuilder listStaffCoursesByCourseId ({required String courseId, }) { + return ListStaffCoursesByCourseIdVariablesBuilder(dataConnect, courseId: courseId,); + } + + + GetStaffCourseByStaffAndCourseVariablesBuilder getStaffCourseByStaffAndCourse ({required String staffId, required String courseId, }) { + return GetStaffCourseByStaffAndCourseVariablesBuilder(dataConnect, staffId: staffId,courseId: courseId,); + } + + + CreateUserVariablesBuilder createUser ({required String id, required UserBaseRole role, }) { + return CreateUserVariablesBuilder(dataConnect, id: id,role: role,); + } + + + UpdateUserVariablesBuilder updateUser ({required String id, }) { + return UpdateUserVariablesBuilder(dataConnect, id: id,); + } + + + DeleteUserVariablesBuilder deleteUser ({required String id, }) { + return DeleteUserVariablesBuilder(dataConnect, id: id,); + } + + + CreateClientFeedbackVariablesBuilder createClientFeedback ({required String businessId, required String vendorId, }) { + return CreateClientFeedbackVariablesBuilder(dataConnect, businessId: businessId,vendorId: vendorId,); + } + + + UpdateClientFeedbackVariablesBuilder updateClientFeedback ({required String id, }) { + return UpdateClientFeedbackVariablesBuilder(dataConnect, id: id,); + } + + + DeleteClientFeedbackVariablesBuilder deleteClientFeedback ({required String id, }) { + return DeleteClientFeedbackVariablesBuilder(dataConnect, id: id,); + } + + + GetShiftRoleByIdVariablesBuilder getShiftRoleById ({required String shiftId, required String roleId, }) { + return GetShiftRoleByIdVariablesBuilder(dataConnect, shiftId: shiftId,roleId: roleId,); + } + + + ListShiftRolesByShiftIdVariablesBuilder listShiftRolesByShiftId ({required String shiftId, }) { + return ListShiftRolesByShiftIdVariablesBuilder(dataConnect, shiftId: shiftId,); + } + + + ListShiftRolesByRoleIdVariablesBuilder listShiftRolesByRoleId ({required String roleId, }) { + return ListShiftRolesByRoleIdVariablesBuilder(dataConnect, roleId: roleId,); + } + + + ListShiftRolesByShiftIdAndTimeRangeVariablesBuilder listShiftRolesByShiftIdAndTimeRange ({required String shiftId, required Timestamp start, required Timestamp end, }) { + return ListShiftRolesByShiftIdAndTimeRangeVariablesBuilder(dataConnect, shiftId: shiftId,start: start,end: end,); + } + + + ListShiftRolesByVendorIdVariablesBuilder listShiftRolesByVendorId ({required String vendorId, }) { + return ListShiftRolesByVendorIdVariablesBuilder(dataConnect, vendorId: vendorId,); + } + + + ListShiftRolesByBusinessAndDateRangeVariablesBuilder listShiftRolesByBusinessAndDateRange ({required String businessId, required Timestamp start, required Timestamp end, }) { + return ListShiftRolesByBusinessAndDateRangeVariablesBuilder(dataConnect, businessId: businessId,start: start,end: end,); + } + + + ListShiftRolesByBusinessAndOrderVariablesBuilder listShiftRolesByBusinessAndOrder ({required String businessId, required String orderId, }) { + return ListShiftRolesByBusinessAndOrderVariablesBuilder(dataConnect, businessId: businessId,orderId: orderId,); + } + + + ListShiftRolesByBusinessDateRangeCompletedOrdersVariablesBuilder listShiftRolesByBusinessDateRangeCompletedOrders ({required String businessId, required Timestamp start, required Timestamp end, }) { + return ListShiftRolesByBusinessDateRangeCompletedOrdersVariablesBuilder(dataConnect, businessId: businessId,start: start,end: end,); + } + + + CreateStaffAvailabilityVariablesBuilder createStaffAvailability ({required String staffId, required DayOfWeek day, required AvailabilitySlot slot, }) { + return CreateStaffAvailabilityVariablesBuilder(dataConnect, staffId: staffId,day: day,slot: slot,); + } + + + UpdateStaffAvailabilityVariablesBuilder updateStaffAvailability ({required String staffId, required DayOfWeek day, required AvailabilitySlot slot, }) { + return UpdateStaffAvailabilityVariablesBuilder(dataConnect, staffId: staffId,day: day,slot: slot,); + } + + + DeleteStaffAvailabilityVariablesBuilder deleteStaffAvailability ({required String staffId, required DayOfWeek day, required AvailabilitySlot slot, }) { + return DeleteStaffAvailabilityVariablesBuilder(dataConnect, staffId: staffId,day: day,slot: slot,); + } + + + CreateConversationVariablesBuilder createConversation () { + return CreateConversationVariablesBuilder(dataConnect, ); + } + + + UpdateConversationVariablesBuilder updateConversation ({required String id, }) { + return UpdateConversationVariablesBuilder(dataConnect, id: id,); + } + + + UpdateConversationLastMessageVariablesBuilder updateConversationLastMessage ({required String id, }) { + return UpdateConversationLastMessageVariablesBuilder(dataConnect, id: id,); + } + + + DeleteConversationVariablesBuilder deleteConversation ({required String id, }) { + return DeleteConversationVariablesBuilder(dataConnect, id: id,); + } + + + CreateTaxFormVariablesBuilder createTaxForm ({required TaxFormType formType, required String title, required String staffId, }) { + return CreateTaxFormVariablesBuilder(dataConnect, formType: formType,title: title,staffId: staffId,); + } + + + UpdateTaxFormVariablesBuilder updateTaxForm ({required String id, }) { + return UpdateTaxFormVariablesBuilder(dataConnect, id: id,); + } + + + DeleteTaxFormVariablesBuilder deleteTaxForm ({required String id, }) { + return DeleteTaxFormVariablesBuilder(dataConnect, id: id,); + } + + + CreateTeamHudDepartmentVariablesBuilder createTeamHudDepartment ({required String name, required String teamHubId, }) { + return CreateTeamHudDepartmentVariablesBuilder(dataConnect, name: name,teamHubId: teamHubId,); + } + + + UpdateTeamHudDepartmentVariablesBuilder updateTeamHudDepartment ({required String id, }) { + return UpdateTeamHudDepartmentVariablesBuilder(dataConnect, id: id,); + } + + + DeleteTeamHudDepartmentVariablesBuilder deleteTeamHudDepartment ({required String id, }) { + return DeleteTeamHudDepartmentVariablesBuilder(dataConnect, id: id,); + } + + + GetVendorByIdVariablesBuilder getVendorById ({required String id, }) { + return GetVendorByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetVendorByUserIdVariablesBuilder getVendorByUserId ({required String userId, }) { + return GetVendorByUserIdVariablesBuilder(dataConnect, userId: userId,); + } + + + ListVendorsVariablesBuilder listVendors () { + return ListVendorsVariablesBuilder(dataConnect, ); + } + + + ListVendorRatesVariablesBuilder listVendorRates () { + return ListVendorRatesVariablesBuilder(dataConnect, ); + } + + + GetVendorRateByIdVariablesBuilder getVendorRateById ({required String id, }) { + return GetVendorRateByIdVariablesBuilder(dataConnect, id: id,); + } + + + ListAccountsVariablesBuilder listAccounts () { + return ListAccountsVariablesBuilder(dataConnect, ); + } + + + GetAccountByIdVariablesBuilder getAccountById ({required String id, }) { + return GetAccountByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetAccountsByOwnerIdVariablesBuilder getAccountsByOwnerId ({required String ownerId, }) { + return GetAccountsByOwnerIdVariablesBuilder(dataConnect, ownerId: ownerId,); + } + + + FilterAccountsVariablesBuilder filterAccounts () { + return FilterAccountsVariablesBuilder(dataConnect, ); + } + + + CreateBusinessVariablesBuilder createBusiness ({required String businessName, required String userId, required BusinessRateGroup rateGroup, required BusinessStatus status, }) { + return CreateBusinessVariablesBuilder(dataConnect, businessName: businessName,userId: userId,rateGroup: rateGroup,status: status,); + } + + + UpdateBusinessVariablesBuilder updateBusiness ({required String id, }) { + return UpdateBusinessVariablesBuilder(dataConnect, id: id,); + } + + + DeleteBusinessVariablesBuilder deleteBusiness ({required String id, }) { + return DeleteBusinessVariablesBuilder(dataConnect, id: id,); + } + + + ListHubsVariablesBuilder listHubs () { + return ListHubsVariablesBuilder(dataConnect, ); + } + + + GetHubByIdVariablesBuilder getHubById ({required String id, }) { + return GetHubByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetHubsByOwnerIdVariablesBuilder getHubsByOwnerId ({required String ownerId, }) { + return GetHubsByOwnerIdVariablesBuilder(dataConnect, ownerId: ownerId,); + } + + + FilterHubsVariablesBuilder filterHubs () { + return FilterHubsVariablesBuilder(dataConnect, ); + } + + + ListRecentPaymentsVariablesBuilder listRecentPayments () { + return ListRecentPaymentsVariablesBuilder(dataConnect, ); + } + + + GetRecentPaymentByIdVariablesBuilder getRecentPaymentById ({required String id, }) { + return GetRecentPaymentByIdVariablesBuilder(dataConnect, id: id,); + } + + + ListRecentPaymentsByStaffIdVariablesBuilder listRecentPaymentsByStaffId ({required String staffId, }) { + return ListRecentPaymentsByStaffIdVariablesBuilder(dataConnect, staffId: staffId,); + } + + + ListRecentPaymentsByApplicationIdVariablesBuilder listRecentPaymentsByApplicationId ({required String applicationId, }) { + return ListRecentPaymentsByApplicationIdVariablesBuilder(dataConnect, applicationId: applicationId,); + } + + + ListRecentPaymentsByInvoiceIdVariablesBuilder listRecentPaymentsByInvoiceId ({required String invoiceId, }) { + return ListRecentPaymentsByInvoiceIdVariablesBuilder(dataConnect, invoiceId: invoiceId,); + } + + + ListRecentPaymentsByStatusVariablesBuilder listRecentPaymentsByStatus ({required RecentPaymentStatus status, }) { + return ListRecentPaymentsByStatusVariablesBuilder(dataConnect, status: status,); + } + + + ListRecentPaymentsByInvoiceIdsVariablesBuilder listRecentPaymentsByInvoiceIds ({required List invoiceIds, }) { + return ListRecentPaymentsByInvoiceIdsVariablesBuilder(dataConnect, invoiceIds: invoiceIds,); + } + + + ListRecentPaymentsByBusinessIdVariablesBuilder listRecentPaymentsByBusinessId ({required String businessId, }) { + return ListRecentPaymentsByBusinessIdVariablesBuilder(dataConnect, businessId: businessId,); + } + + + CreateRoleVariablesBuilder createRole ({required String name, required double costPerHour, required String vendorId, required String roleCategoryId, }) { + return CreateRoleVariablesBuilder(dataConnect, name: name,costPerHour: costPerHour,vendorId: vendorId,roleCategoryId: roleCategoryId,); + } + + + UpdateRoleVariablesBuilder updateRole ({required String id, required String roleCategoryId, }) { + return UpdateRoleVariablesBuilder(dataConnect, id: id,roleCategoryId: roleCategoryId,); + } + + + DeleteRoleVariablesBuilder deleteRole ({required String id, }) { + return DeleteRoleVariablesBuilder(dataConnect, id: id,); + } + + + GetStaffDocumentByKeyVariablesBuilder getStaffDocumentByKey ({required String staffId, required String documentId, }) { + return GetStaffDocumentByKeyVariablesBuilder(dataConnect, staffId: staffId,documentId: documentId,); + } + + + ListStaffDocumentsByStaffIdVariablesBuilder listStaffDocumentsByStaffId ({required String staffId, }) { + return ListStaffDocumentsByStaffIdVariablesBuilder(dataConnect, staffId: staffId,); + } + + + ListStaffDocumentsByDocumentTypeVariablesBuilder listStaffDocumentsByDocumentType ({required DocumentType documentType, }) { + return ListStaffDocumentsByDocumentTypeVariablesBuilder(dataConnect, documentType: documentType,); + } + + + ListStaffDocumentsByStatusVariablesBuilder listStaffDocumentsByStatus ({required DocumentStatus status, }) { + return ListStaffDocumentsByStatusVariablesBuilder(dataConnect, status: status,); + } + + + ListTasksVariablesBuilder listTasks () { + return ListTasksVariablesBuilder(dataConnect, ); + } + + + GetTaskByIdVariablesBuilder getTaskById ({required String id, }) { + return GetTaskByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetTasksByOwnerIdVariablesBuilder getTasksByOwnerId ({required String ownerId, }) { + return GetTasksByOwnerIdVariablesBuilder(dataConnect, ownerId: ownerId,); + } + + + FilterTasksVariablesBuilder filterTasks () { + return FilterTasksVariablesBuilder(dataConnect, ); + } + + + ListTaskCommentsVariablesBuilder listTaskComments () { + return ListTaskCommentsVariablesBuilder(dataConnect, ); + } + + + GetTaskCommentByIdVariablesBuilder getTaskCommentById ({required String id, }) { + return GetTaskCommentByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetTaskCommentsByTaskIdVariablesBuilder getTaskCommentsByTaskId ({required String taskId, }) { + return GetTaskCommentsByTaskIdVariablesBuilder(dataConnect, taskId: taskId,); + } + + + CreateEmergencyContactVariablesBuilder createEmergencyContact ({required String name, required String phone, required RelationshipType relationship, required String staffId, }) { + return CreateEmergencyContactVariablesBuilder(dataConnect, name: name,phone: phone,relationship: relationship,staffId: staffId,); + } + + + UpdateEmergencyContactVariablesBuilder updateEmergencyContact ({required String id, }) { + return UpdateEmergencyContactVariablesBuilder(dataConnect, id: id,); + } + + + DeleteEmergencyContactVariablesBuilder deleteEmergencyContact ({required String id, }) { + return DeleteEmergencyContactVariablesBuilder(dataConnect, id: id,); + } + + + ListFaqDatasVariablesBuilder listFaqDatas () { + return ListFaqDatasVariablesBuilder(dataConnect, ); + } + + + GetFaqDataByIdVariablesBuilder getFaqDataById ({required String id, }) { + return GetFaqDataByIdVariablesBuilder(dataConnect, id: id,); + } + + + FilterFaqDatasVariablesBuilder filterFaqDatas () { + return FilterFaqDatasVariablesBuilder(dataConnect, ); + } + + + ListInvoiceTemplatesVariablesBuilder listInvoiceTemplates () { + return ListInvoiceTemplatesVariablesBuilder(dataConnect, ); + } + + + GetInvoiceTemplateByIdVariablesBuilder getInvoiceTemplateById ({required String id, }) { + return GetInvoiceTemplateByIdVariablesBuilder(dataConnect, id: id,); + } + + + ListInvoiceTemplatesByOwnerIdVariablesBuilder listInvoiceTemplatesByOwnerId ({required String ownerId, }) { + return ListInvoiceTemplatesByOwnerIdVariablesBuilder(dataConnect, ownerId: ownerId,); + } + + + ListInvoiceTemplatesByVendorIdVariablesBuilder listInvoiceTemplatesByVendorId ({required String vendorId, }) { + return ListInvoiceTemplatesByVendorIdVariablesBuilder(dataConnect, vendorId: vendorId,); + } + + + ListInvoiceTemplatesByBusinessIdVariablesBuilder listInvoiceTemplatesByBusinessId ({required String businessId, }) { + return ListInvoiceTemplatesByBusinessIdVariablesBuilder(dataConnect, businessId: businessId,); + } + + + ListInvoiceTemplatesByOrderIdVariablesBuilder listInvoiceTemplatesByOrderId ({required String orderId, }) { + return ListInvoiceTemplatesByOrderIdVariablesBuilder(dataConnect, orderId: orderId,); + } + + + SearchInvoiceTemplatesByOwnerAndNameVariablesBuilder searchInvoiceTemplatesByOwnerAndName ({required String ownerId, required String name, }) { + return SearchInvoiceTemplatesByOwnerAndNameVariablesBuilder(dataConnect, ownerId: ownerId,name: name,); + } + + + ListMessagesVariablesBuilder listMessages () { + return ListMessagesVariablesBuilder(dataConnect, ); + } + + + GetMessageByIdVariablesBuilder getMessageById ({required String id, }) { + return GetMessageByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetMessagesByConversationIdVariablesBuilder getMessagesByConversationId ({required String conversationId, }) { + return GetMessagesByConversationIdVariablesBuilder(dataConnect, conversationId: conversationId,); + } + + + CreateOrderVariablesBuilder createOrder ({required String businessId, required OrderType orderType, }) { + return CreateOrderVariablesBuilder(dataConnect, businessId: businessId,orderType: orderType,); + } + + + UpdateOrderVariablesBuilder updateOrder ({required String id, }) { + return UpdateOrderVariablesBuilder(dataConnect, id: id,); + } + + + DeleteOrderVariablesBuilder deleteOrder ({required String id, }) { + return DeleteOrderVariablesBuilder(dataConnect, id: id,); + } + + + CreateShiftRoleVariablesBuilder createShiftRole ({required String shiftId, required String roleId, required int count, }) { + return CreateShiftRoleVariablesBuilder(dataConnect, shiftId: shiftId,roleId: roleId,count: count,); + } + + + UpdateShiftRoleVariablesBuilder updateShiftRole ({required String shiftId, required String roleId, }) { + return UpdateShiftRoleVariablesBuilder(dataConnect, shiftId: shiftId,roleId: roleId,); + } + + + DeleteShiftRoleVariablesBuilder deleteShiftRole ({required String shiftId, required String roleId, }) { + return DeleteShiftRoleVariablesBuilder(dataConnect, shiftId: shiftId,roleId: roleId,); + } + + + ListStaffVariablesBuilder listStaff () { + return ListStaffVariablesBuilder(dataConnect, ); + } + + + GetStaffByIdVariablesBuilder getStaffById ({required String id, }) { + return GetStaffByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetStaffByUserIdVariablesBuilder getStaffByUserId ({required String userId, }) { + return GetStaffByUserIdVariablesBuilder(dataConnect, userId: userId,); + } + + + FilterStaffVariablesBuilder filterStaff () { + return FilterStaffVariablesBuilder(dataConnect, ); + } + + + ListUserConversationsVariablesBuilder listUserConversations () { + return ListUserConversationsVariablesBuilder(dataConnect, ); + } + + + GetUserConversationByKeyVariablesBuilder getUserConversationByKey ({required String conversationId, required String userId, }) { + return GetUserConversationByKeyVariablesBuilder(dataConnect, conversationId: conversationId,userId: userId,); + } + + + ListUserConversationsByUserIdVariablesBuilder listUserConversationsByUserId ({required String userId, }) { + return ListUserConversationsByUserIdVariablesBuilder(dataConnect, userId: userId,); + } + + + ListUnreadUserConversationsByUserIdVariablesBuilder listUnreadUserConversationsByUserId ({required String userId, }) { + return ListUnreadUserConversationsByUserIdVariablesBuilder(dataConnect, userId: userId,); + } + + + ListUserConversationsByConversationIdVariablesBuilder listUserConversationsByConversationId ({required String conversationId, }) { + return ListUserConversationsByConversationIdVariablesBuilder(dataConnect, conversationId: conversationId,); + } + + + FilterUserConversationsVariablesBuilder filterUserConversations () { + return FilterUserConversationsVariablesBuilder(dataConnect, ); + } + + + CreateAttireOptionVariablesBuilder createAttireOption ({required String itemId, required String label, }) { + return CreateAttireOptionVariablesBuilder(dataConnect, itemId: itemId,label: label,); + } + + + UpdateAttireOptionVariablesBuilder updateAttireOption ({required String id, }) { + return UpdateAttireOptionVariablesBuilder(dataConnect, id: id,); + } + + + DeleteAttireOptionVariablesBuilder deleteAttireOption ({required String id, }) { + return DeleteAttireOptionVariablesBuilder(dataConnect, id: id,); + } + + + CreateInvoiceVariablesBuilder createInvoice ({required InvoiceStatus status, required String vendorId, required String businessId, required String orderId, required String invoiceNumber, required Timestamp issueDate, required Timestamp dueDate, required double amount, }) { + return CreateInvoiceVariablesBuilder(dataConnect, status: status,vendorId: vendorId,businessId: businessId,orderId: orderId,invoiceNumber: invoiceNumber,issueDate: issueDate,dueDate: dueDate,amount: amount,); + } + + + UpdateInvoiceVariablesBuilder updateInvoice ({required String id, }) { + return UpdateInvoiceVariablesBuilder(dataConnect, id: id,); + } + + + DeleteInvoiceVariablesBuilder deleteInvoice ({required String id, }) { + return DeleteInvoiceVariablesBuilder(dataConnect, id: id,); + } + + + GetMyTasksVariablesBuilder getMyTasks ({required String teamMemberId, }) { + return GetMyTasksVariablesBuilder(dataConnect, teamMemberId: teamMemberId,); + } + + + GetMemberTaskByIdKeyVariablesBuilder getMemberTaskByIdKey ({required String teamMemberId, required String taskId, }) { + return GetMemberTaskByIdKeyVariablesBuilder(dataConnect, teamMemberId: teamMemberId,taskId: taskId,); + } + + + GetMemberTasksByTaskIdVariablesBuilder getMemberTasksByTaskId ({required String taskId, }) { + return GetMemberTasksByTaskIdVariablesBuilder(dataConnect, taskId: taskId,); + } + + + ListShiftsVariablesBuilder listShifts () { + return ListShiftsVariablesBuilder(dataConnect, ); + } + + + GetShiftByIdVariablesBuilder getShiftById ({required String id, }) { + return GetShiftByIdVariablesBuilder(dataConnect, id: id,); + } + + + FilterShiftsVariablesBuilder filterShifts () { + return FilterShiftsVariablesBuilder(dataConnect, ); + } + + + GetShiftsByBusinessIdVariablesBuilder getShiftsByBusinessId ({required String businessId, }) { + return GetShiftsByBusinessIdVariablesBuilder(dataConnect, businessId: businessId,); + } + + + GetShiftsByVendorIdVariablesBuilder getShiftsByVendorId ({required String vendorId, }) { + return GetShiftsByVendorIdVariablesBuilder(dataConnect, vendorId: vendorId,); + } + + + CreateTaskVariablesBuilder createTask ({required String taskName, required TaskPriority priority, required TaskStatus status, required String ownerId, }) { + return CreateTaskVariablesBuilder(dataConnect, taskName: taskName,priority: priority,status: status,ownerId: ownerId,); + } + + + UpdateTaskVariablesBuilder updateTask ({required String id, }) { + return UpdateTaskVariablesBuilder(dataConnect, id: id,); + } + + + DeleteTaskVariablesBuilder deleteTask ({required String id, }) { + return DeleteTaskVariablesBuilder(dataConnect, id: id,); + } + + + CreateWorkforceVariablesBuilder createWorkforce ({required String vendorId, required String staffId, required String workforceNumber, }) { + return CreateWorkforceVariablesBuilder(dataConnect, vendorId: vendorId,staffId: staffId,workforceNumber: workforceNumber,); + } + + + UpdateWorkforceVariablesBuilder updateWorkforce ({required String id, }) { + return UpdateWorkforceVariablesBuilder(dataConnect, id: id,); + } + + + DeactivateWorkforceVariablesBuilder deactivateWorkforce ({required String id, }) { + return DeactivateWorkforceVariablesBuilder(dataConnect, id: id,); + } + + + CreateMemberTaskVariablesBuilder createMemberTask ({required String teamMemberId, required String taskId, }) { + return CreateMemberTaskVariablesBuilder(dataConnect, teamMemberId: teamMemberId,taskId: taskId,); + } + + + DeleteMemberTaskVariablesBuilder deleteMemberTask ({required String teamMemberId, required String taskId, }) { + return DeleteMemberTaskVariablesBuilder(dataConnect, teamMemberId: teamMemberId,taskId: taskId,); + } + + + CreateStaffAvailabilityStatsVariablesBuilder createStaffAvailabilityStats ({required String staffId, }) { + return CreateStaffAvailabilityStatsVariablesBuilder(dataConnect, staffId: staffId,); + } + + + UpdateStaffAvailabilityStatsVariablesBuilder updateStaffAvailabilityStats ({required String staffId, }) { + return UpdateStaffAvailabilityStatsVariablesBuilder(dataConnect, staffId: staffId,); + } + + + DeleteStaffAvailabilityStatsVariablesBuilder deleteStaffAvailabilityStats ({required String staffId, }) { + return DeleteStaffAvailabilityStatsVariablesBuilder(dataConnect, staffId: staffId,); + } + + + CreateVendorBenefitPlanVariablesBuilder createVendorBenefitPlan ({required String vendorId, required String title, }) { + return CreateVendorBenefitPlanVariablesBuilder(dataConnect, vendorId: vendorId,title: title,); + } + + + UpdateVendorBenefitPlanVariablesBuilder updateVendorBenefitPlan ({required String id, }) { + return UpdateVendorBenefitPlanVariablesBuilder(dataConnect, id: id,); + } + + + DeleteVendorBenefitPlanVariablesBuilder deleteVendorBenefitPlan ({required String id, }) { + return DeleteVendorBenefitPlanVariablesBuilder(dataConnect, id: id,); + } + + + CreateVendorRateVariablesBuilder createVendorRate ({required String vendorId, }) { + return CreateVendorRateVariablesBuilder(dataConnect, vendorId: vendorId,); + } + + + UpdateVendorRateVariablesBuilder updateVendorRate ({required String id, }) { + return UpdateVendorRateVariablesBuilder(dataConnect, id: id,); + } + + + DeleteVendorRateVariablesBuilder deleteVendorRate ({required String id, }) { + return DeleteVendorRateVariablesBuilder(dataConnect, id: id,); + } + + + GetWorkforceByIdVariablesBuilder getWorkforceById ({required String id, }) { + return GetWorkforceByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetWorkforceByVendorAndStaffVariablesBuilder getWorkforceByVendorAndStaff ({required String vendorId, required String staffId, }) { + return GetWorkforceByVendorAndStaffVariablesBuilder(dataConnect, vendorId: vendorId,staffId: staffId,); + } + + + ListWorkforceByVendorIdVariablesBuilder listWorkforceByVendorId ({required String vendorId, }) { + return ListWorkforceByVendorIdVariablesBuilder(dataConnect, vendorId: vendorId,); + } + + + ListWorkforceByStaffIdVariablesBuilder listWorkforceByStaffId ({required String staffId, }) { + return ListWorkforceByStaffIdVariablesBuilder(dataConnect, staffId: staffId,); + } + + + GetWorkforceByVendorAndNumberVariablesBuilder getWorkforceByVendorAndNumber ({required String vendorId, required String workforceNumber, }) { + return GetWorkforceByVendorAndNumberVariablesBuilder(dataConnect, vendorId: vendorId,workforceNumber: workforceNumber,); + } + + + CreateCertificateVariablesBuilder createCertificate ({required String name, required CertificateStatus status, required String staffId, }) { + return CreateCertificateVariablesBuilder(dataConnect, name: name,status: status,staffId: staffId,); + } + + + UpdateCertificateVariablesBuilder updateCertificate ({required String id, }) { + return UpdateCertificateVariablesBuilder(dataConnect, id: id,); + } + + + DeleteCertificateVariablesBuilder deleteCertificate ({required String id, }) { + return DeleteCertificateVariablesBuilder(dataConnect, id: id,); + } + + + CreateCourseVariablesBuilder createCourse ({required String categoryId, }) { + return CreateCourseVariablesBuilder(dataConnect, categoryId: categoryId,); + } + + + UpdateCourseVariablesBuilder updateCourse ({required String id, required String categoryId, }) { + return UpdateCourseVariablesBuilder(dataConnect, id: id,categoryId: categoryId,); + } + + + DeleteCourseVariablesBuilder deleteCourse ({required String id, }) { + return DeleteCourseVariablesBuilder(dataConnect, id: id,); + } + + + ListDocumentsVariablesBuilder listDocuments () { + return ListDocumentsVariablesBuilder(dataConnect, ); + } + + + GetDocumentByIdVariablesBuilder getDocumentById ({required String id, }) { + return GetDocumentByIdVariablesBuilder(dataConnect, id: id,); + } + + + FilterDocumentsVariablesBuilder filterDocuments () { + return FilterDocumentsVariablesBuilder(dataConnect, ); + } + + + ListEmergencyContactsVariablesBuilder listEmergencyContacts () { + return ListEmergencyContactsVariablesBuilder(dataConnect, ); + } + + + GetEmergencyContactByIdVariablesBuilder getEmergencyContactById ({required String id, }) { + return GetEmergencyContactByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetEmergencyContactsByStaffIdVariablesBuilder getEmergencyContactsByStaffId ({required String staffId, }) { + return GetEmergencyContactsByStaffIdVariablesBuilder(dataConnect, staffId: staffId,); + } + + + ListLevelsVariablesBuilder listLevels () { + return ListLevelsVariablesBuilder(dataConnect, ); + } + + + GetLevelByIdVariablesBuilder getLevelById ({required String id, }) { + return GetLevelByIdVariablesBuilder(dataConnect, id: id,); + } + + + FilterLevelsVariablesBuilder filterLevels () { + return FilterLevelsVariablesBuilder(dataConnect, ); + } + + + CreateRoleCategoryVariablesBuilder createRoleCategory ({required String roleName, required RoleCategoryType category, }) { + return CreateRoleCategoryVariablesBuilder(dataConnect, roleName: roleName,category: category,); + } + + + UpdateRoleCategoryVariablesBuilder updateRoleCategory ({required String id, }) { + return UpdateRoleCategoryVariablesBuilder(dataConnect, id: id,); + } + + + DeleteRoleCategoryVariablesBuilder deleteRoleCategory ({required String id, }) { + return DeleteRoleCategoryVariablesBuilder(dataConnect, id: id,); + } + + + CreateStaffVariablesBuilder createStaff ({required String userId, required String fullName, }) { + return CreateStaffVariablesBuilder(dataConnect, userId: userId,fullName: fullName,); + } + + + UpdateStaffVariablesBuilder updateStaff ({required String id, }) { + return UpdateStaffVariablesBuilder(dataConnect, id: id,); + } + + + DeleteStaffVariablesBuilder deleteStaff ({required String id, }) { + return DeleteStaffVariablesBuilder(dataConnect, id: id,); + } + + + ListStaffAvailabilityStatsVariablesBuilder listStaffAvailabilityStats () { + return ListStaffAvailabilityStatsVariablesBuilder(dataConnect, ); + } + + + GetStaffAvailabilityStatsByStaffIdVariablesBuilder getStaffAvailabilityStatsByStaffId ({required String staffId, }) { + return GetStaffAvailabilityStatsByStaffIdVariablesBuilder(dataConnect, staffId: staffId,); + } + + + FilterStaffAvailabilityStatsVariablesBuilder filterStaffAvailabilityStats () { + return FilterStaffAvailabilityStatsVariablesBuilder(dataConnect, ); + } + + + CreateAccountVariablesBuilder createAccount ({required String bank, required AccountType type, required String last4, required String ownerId, }) { + return CreateAccountVariablesBuilder(dataConnect, bank: bank,type: type,last4: last4,ownerId: ownerId,); + } + + + UpdateAccountVariablesBuilder updateAccount ({required String id, }) { + return UpdateAccountVariablesBuilder(dataConnect, id: id,); + } + + + DeleteAccountVariablesBuilder deleteAccount ({required String id, }) { + return DeleteAccountVariablesBuilder(dataConnect, id: id,); + } + + + CreateActivityLogVariablesBuilder createActivityLog ({required String userId, required Timestamp date, required String title, required String description, required ActivityType activityType, }) { + return CreateActivityLogVariablesBuilder(dataConnect, userId: userId,date: date,title: title,description: description,activityType: activityType,); + } + + + UpdateActivityLogVariablesBuilder updateActivityLog ({required String id, }) { + return UpdateActivityLogVariablesBuilder(dataConnect, id: id,); + } + + + MarkActivityLogAsReadVariablesBuilder markActivityLogAsRead ({required String id, }) { + return MarkActivityLogAsReadVariablesBuilder(dataConnect, id: id,); + } + + + MarkActivityLogsAsReadVariablesBuilder markActivityLogsAsRead ({required List ids, }) { + return MarkActivityLogsAsReadVariablesBuilder(dataConnect, ids: ids,); + } + + + DeleteActivityLogVariablesBuilder deleteActivityLog ({required String id, }) { + return DeleteActivityLogVariablesBuilder(dataConnect, id: id,); + } + + + ListAssignmentsVariablesBuilder listAssignments () { + return ListAssignmentsVariablesBuilder(dataConnect, ); + } + + + GetAssignmentByIdVariablesBuilder getAssignmentById ({required String id, }) { + return GetAssignmentByIdVariablesBuilder(dataConnect, id: id,); + } + + + ListAssignmentsByWorkforceIdVariablesBuilder listAssignmentsByWorkforceId ({required String workforceId, }) { + return ListAssignmentsByWorkforceIdVariablesBuilder(dataConnect, workforceId: workforceId,); + } + + + ListAssignmentsByWorkforceIdsVariablesBuilder listAssignmentsByWorkforceIds ({required List workforceIds, }) { + return ListAssignmentsByWorkforceIdsVariablesBuilder(dataConnect, workforceIds: workforceIds,); + } + + + ListAssignmentsByShiftRoleVariablesBuilder listAssignmentsByShiftRole ({required String shiftId, required String roleId, }) { + return ListAssignmentsByShiftRoleVariablesBuilder(dataConnect, shiftId: shiftId,roleId: roleId,); + } + + + FilterAssignmentsVariablesBuilder filterAssignments ({required List shiftIds, required List roleIds, }) { + return FilterAssignmentsVariablesBuilder(dataConnect, shiftIds: shiftIds,roleIds: roleIds,); + } + + + ListCertificatesVariablesBuilder listCertificates () { + return ListCertificatesVariablesBuilder(dataConnect, ); + } + + + GetCertificateByIdVariablesBuilder getCertificateById ({required String id, }) { + return GetCertificateByIdVariablesBuilder(dataConnect, id: id,); + } + + + ListCertificatesByStaffIdVariablesBuilder listCertificatesByStaffId ({required String staffId, }) { + return ListCertificatesByStaffIdVariablesBuilder(dataConnect, staffId: staffId,); + } + + + CreateLevelVariablesBuilder createLevel ({required String name, required int xpRequired, }) { + return CreateLevelVariablesBuilder(dataConnect, name: name,xpRequired: xpRequired,); + } + + + UpdateLevelVariablesBuilder updateLevel ({required String id, }) { + return UpdateLevelVariablesBuilder(dataConnect, id: id,); + } + + + DeleteLevelVariablesBuilder deleteLevel ({required String id, }) { + return DeleteLevelVariablesBuilder(dataConnect, id: id,); + } + + + CreateMessageVariablesBuilder createMessage ({required String conversationId, required String senderId, required String content, }) { + return CreateMessageVariablesBuilder(dataConnect, conversationId: conversationId,senderId: senderId,content: content,); + } + + + UpdateMessageVariablesBuilder updateMessage ({required String id, }) { + return UpdateMessageVariablesBuilder(dataConnect, id: id,); + } + + + DeleteMessageVariablesBuilder deleteMessage ({required String id, }) { + return DeleteMessageVariablesBuilder(dataConnect, id: id,); + } + + + CreateRecentPaymentVariablesBuilder createRecentPayment ({required String staffId, required String applicationId, required String invoiceId, }) { + return CreateRecentPaymentVariablesBuilder(dataConnect, staffId: staffId,applicationId: applicationId,invoiceId: invoiceId,); + } + + + UpdateRecentPaymentVariablesBuilder updateRecentPayment ({required String id, }) { + return UpdateRecentPaymentVariablesBuilder(dataConnect, id: id,); + } + + + DeleteRecentPaymentVariablesBuilder deleteRecentPayment ({required String id, }) { + return DeleteRecentPaymentVariablesBuilder(dataConnect, id: id,); + } + + + CreateStaffRoleVariablesBuilder createStaffRole ({required String staffId, required String roleId, }) { + return CreateStaffRoleVariablesBuilder(dataConnect, staffId: staffId,roleId: roleId,); + } + + + DeleteStaffRoleVariablesBuilder deleteStaffRole ({required String staffId, required String roleId, }) { + return DeleteStaffRoleVariablesBuilder(dataConnect, staffId: staffId,roleId: roleId,); + } + + + ListApplicationsVariablesBuilder listApplications () { + return ListApplicationsVariablesBuilder(dataConnect, ); + } + + + GetApplicationByIdVariablesBuilder getApplicationById ({required String id, }) { + return GetApplicationByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetApplicationsByShiftIdVariablesBuilder getApplicationsByShiftId ({required String shiftId, }) { + return GetApplicationsByShiftIdVariablesBuilder(dataConnect, shiftId: shiftId,); + } + + + GetApplicationsByShiftIdAndStatusVariablesBuilder getApplicationsByShiftIdAndStatus ({required String shiftId, required ApplicationStatus status, }) { + return GetApplicationsByShiftIdAndStatusVariablesBuilder(dataConnect, shiftId: shiftId,status: status,); + } + + + GetApplicationsByStaffIdVariablesBuilder getApplicationsByStaffId ({required String staffId, }) { + return GetApplicationsByStaffIdVariablesBuilder(dataConnect, staffId: staffId,); + } + + + ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder listAcceptedApplicationsByShiftRoleKey ({required String shiftId, required String roleId, }) { + return ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder(dataConnect, shiftId: shiftId,roleId: roleId,); + } + + + ListAcceptedApplicationsByBusinessForDayVariablesBuilder listAcceptedApplicationsByBusinessForDay ({required String businessId, required Timestamp dayStart, required Timestamp dayEnd, }) { + return ListAcceptedApplicationsByBusinessForDayVariablesBuilder(dataConnect, businessId: businessId,dayStart: dayStart,dayEnd: dayEnd,); + } + + + CreateAssignmentVariablesBuilder createAssignment ({required String workforceId, required String roleId, required String shiftId, }) { + return CreateAssignmentVariablesBuilder(dataConnect, workforceId: workforceId,roleId: roleId,shiftId: shiftId,); + } + + + UpdateAssignmentVariablesBuilder updateAssignment ({required String id, required String roleId, required String shiftId, }) { + return UpdateAssignmentVariablesBuilder(dataConnect, id: id,roleId: roleId,shiftId: shiftId,); + } + + + DeleteAssignmentVariablesBuilder deleteAssignment ({required String id, }) { + return DeleteAssignmentVariablesBuilder(dataConnect, id: id,); + } + + + ListAttireOptionsVariablesBuilder listAttireOptions () { + return ListAttireOptionsVariablesBuilder(dataConnect, ); + } + + + GetAttireOptionByIdVariablesBuilder getAttireOptionById ({required String id, }) { + return GetAttireOptionByIdVariablesBuilder(dataConnect, id: id,); + } + + + FilterAttireOptionsVariablesBuilder filterAttireOptions () { + return FilterAttireOptionsVariablesBuilder(dataConnect, ); + } + + + CreateCustomRateCardVariablesBuilder createCustomRateCard ({required String name, }) { + return CreateCustomRateCardVariablesBuilder(dataConnect, name: name,); + } + + + UpdateCustomRateCardVariablesBuilder updateCustomRateCard ({required String id, }) { + return UpdateCustomRateCardVariablesBuilder(dataConnect, id: id,); + } + + + DeleteCustomRateCardVariablesBuilder deleteCustomRateCard ({required String id, }) { + return DeleteCustomRateCardVariablesBuilder(dataConnect, id: id,); + } + + + ListInvoicesVariablesBuilder listInvoices () { + return ListInvoicesVariablesBuilder(dataConnect, ); + } + + + GetInvoiceByIdVariablesBuilder getInvoiceById ({required String id, }) { + return GetInvoiceByIdVariablesBuilder(dataConnect, id: id,); + } + + + ListInvoicesByVendorIdVariablesBuilder listInvoicesByVendorId ({required String vendorId, }) { + return ListInvoicesByVendorIdVariablesBuilder(dataConnect, vendorId: vendorId,); + } + + + ListInvoicesByBusinessIdVariablesBuilder listInvoicesByBusinessId ({required String businessId, }) { + return ListInvoicesByBusinessIdVariablesBuilder(dataConnect, businessId: businessId,); + } + + + ListInvoicesByOrderIdVariablesBuilder listInvoicesByOrderId ({required String orderId, }) { + return ListInvoicesByOrderIdVariablesBuilder(dataConnect, orderId: orderId,); + } + + + ListInvoicesByStatusVariablesBuilder listInvoicesByStatus ({required InvoiceStatus status, }) { + return ListInvoicesByStatusVariablesBuilder(dataConnect, status: status,); + } + + + FilterInvoicesVariablesBuilder filterInvoices () { + return FilterInvoicesVariablesBuilder(dataConnect, ); + } + + + ListOverdueInvoicesVariablesBuilder listOverdueInvoices ({required Timestamp now, }) { + return ListOverdueInvoicesVariablesBuilder(dataConnect, now: now,); + } + + + CreateInvoiceTemplateVariablesBuilder createInvoiceTemplate ({required String name, required String ownerId, }) { + return CreateInvoiceTemplateVariablesBuilder(dataConnect, name: name,ownerId: ownerId,); + } + + + UpdateInvoiceTemplateVariablesBuilder updateInvoiceTemplate ({required String id, }) { + return UpdateInvoiceTemplateVariablesBuilder(dataConnect, id: id,); + } + + + DeleteInvoiceTemplateVariablesBuilder deleteInvoiceTemplate ({required String id, }) { + return DeleteInvoiceTemplateVariablesBuilder(dataConnect, id: id,); + } + + + CreateStaffDocumentVariablesBuilder createStaffDocument ({required String staffId, required String staffName, required String documentId, required DocumentStatus status, }) { + return CreateStaffDocumentVariablesBuilder(dataConnect, staffId: staffId,staffName: staffName,documentId: documentId,status: status,); + } + + + UpdateStaffDocumentVariablesBuilder updateStaffDocument ({required String staffId, required String documentId, }) { + return UpdateStaffDocumentVariablesBuilder(dataConnect, staffId: staffId,documentId: documentId,); + } + + + DeleteStaffDocumentVariablesBuilder deleteStaffDocument ({required String staffId, required String documentId, }) { + return DeleteStaffDocumentVariablesBuilder(dataConnect, staffId: staffId,documentId: documentId,); + } + + + ListUsersVariablesBuilder listUsers () { + return ListUsersVariablesBuilder(dataConnect, ); + } + + + GetUserByIdVariablesBuilder getUserById ({required String id, }) { + return GetUserByIdVariablesBuilder(dataConnect, id: id,); + } + + + FilterUsersVariablesBuilder filterUsers () { + return FilterUsersVariablesBuilder(dataConnect, ); + } + + + CreateCategoryVariablesBuilder createCategory ({required String categoryId, required String label, }) { + return CreateCategoryVariablesBuilder(dataConnect, categoryId: categoryId,label: label,); + } + + + UpdateCategoryVariablesBuilder updateCategory ({required String id, }) { + return UpdateCategoryVariablesBuilder(dataConnect, id: id,); + } + + + DeleteCategoryVariablesBuilder deleteCategory ({required String id, }) { + return DeleteCategoryVariablesBuilder(dataConnect, id: id,); + } + + + CreateHubVariablesBuilder createHub ({required String name, required String ownerId, }) { + return CreateHubVariablesBuilder(dataConnect, name: name,ownerId: ownerId,); + } + + + UpdateHubVariablesBuilder updateHub ({required String id, }) { + return UpdateHubVariablesBuilder(dataConnect, id: id,); + } + + + DeleteHubVariablesBuilder deleteHub ({required String id, }) { + return DeleteHubVariablesBuilder(dataConnect, id: id,); + } + + + ListStaffRolesVariablesBuilder listStaffRoles () { + return ListStaffRolesVariablesBuilder(dataConnect, ); + } + + + GetStaffRoleByKeyVariablesBuilder getStaffRoleByKey ({required String staffId, required String roleId, }) { + return GetStaffRoleByKeyVariablesBuilder(dataConnect, staffId: staffId,roleId: roleId,); + } + + + ListStaffRolesByStaffIdVariablesBuilder listStaffRolesByStaffId ({required String staffId, }) { + return ListStaffRolesByStaffIdVariablesBuilder(dataConnect, staffId: staffId,); + } + + + ListStaffRolesByRoleIdVariablesBuilder listStaffRolesByRoleId ({required String roleId, }) { + return ListStaffRolesByRoleIdVariablesBuilder(dataConnect, roleId: roleId,); + } + + + FilterStaffRolesVariablesBuilder filterStaffRoles () { + return FilterStaffRolesVariablesBuilder(dataConnect, ); + } + + + CreateTaskCommentVariablesBuilder createTaskComment ({required String taskId, required String teamMemberId, required String comment, }) { + return CreateTaskCommentVariablesBuilder(dataConnect, taskId: taskId,teamMemberId: teamMemberId,comment: comment,); + } + + + UpdateTaskCommentVariablesBuilder updateTaskComment ({required String id, }) { + return UpdateTaskCommentVariablesBuilder(dataConnect, id: id,); + } + + + DeleteTaskCommentVariablesBuilder deleteTaskComment ({required String id, }) { + return DeleteTaskCommentVariablesBuilder(dataConnect, id: id,); + } + + + ListTeamHubsVariablesBuilder listTeamHubs () { + return ListTeamHubsVariablesBuilder(dataConnect, ); + } + + + GetTeamHubByIdVariablesBuilder getTeamHubById ({required String id, }) { + return GetTeamHubByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetTeamHubsByTeamIdVariablesBuilder getTeamHubsByTeamId ({required String teamId, }) { + return GetTeamHubsByTeamIdVariablesBuilder(dataConnect, teamId: teamId,); + } + + + ListTeamHubsByOwnerIdVariablesBuilder listTeamHubsByOwnerId ({required String ownerId, }) { + return ListTeamHubsByOwnerIdVariablesBuilder(dataConnect, ownerId: ownerId,); + } + + + ListTeamHudDepartmentsVariablesBuilder listTeamHudDepartments () { + return ListTeamHudDepartmentsVariablesBuilder(dataConnect, ); + } + + + GetTeamHudDepartmentByIdVariablesBuilder getTeamHudDepartmentById ({required String id, }) { + return GetTeamHudDepartmentByIdVariablesBuilder(dataConnect, id: id,); + } + + + ListTeamHudDepartmentsByTeamHubIdVariablesBuilder listTeamHudDepartmentsByTeamHubId ({required String teamHubId, }) { + return ListTeamHudDepartmentsByTeamHubIdVariablesBuilder(dataConnect, teamHubId: teamHubId,); + } + + + ListTeamMembersVariablesBuilder listTeamMembers () { + return ListTeamMembersVariablesBuilder(dataConnect, ); + } + + + GetTeamMemberByIdVariablesBuilder getTeamMemberById ({required String id, }) { + return GetTeamMemberByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetTeamMembersByTeamIdVariablesBuilder getTeamMembersByTeamId ({required String teamId, }) { + return GetTeamMembersByTeamIdVariablesBuilder(dataConnect, teamId: teamId,); + } + + + ListClientFeedbacksVariablesBuilder listClientFeedbacks () { + return ListClientFeedbacksVariablesBuilder(dataConnect, ); + } + + + GetClientFeedbackByIdVariablesBuilder getClientFeedbackById ({required String id, }) { + return GetClientFeedbackByIdVariablesBuilder(dataConnect, id: id,); + } + + + ListClientFeedbacksByBusinessIdVariablesBuilder listClientFeedbacksByBusinessId ({required String businessId, }) { + return ListClientFeedbacksByBusinessIdVariablesBuilder(dataConnect, businessId: businessId,); + } + + + ListClientFeedbacksByVendorIdVariablesBuilder listClientFeedbacksByVendorId ({required String vendorId, }) { + return ListClientFeedbacksByVendorIdVariablesBuilder(dataConnect, vendorId: vendorId,); + } + + + ListClientFeedbacksByBusinessAndVendorVariablesBuilder listClientFeedbacksByBusinessAndVendor ({required String businessId, required String vendorId, }) { + return ListClientFeedbacksByBusinessAndVendorVariablesBuilder(dataConnect, businessId: businessId,vendorId: vendorId,); + } + + + FilterClientFeedbacksVariablesBuilder filterClientFeedbacks () { + return FilterClientFeedbacksVariablesBuilder(dataConnect, ); + } + + + ListClientFeedbackRatingsByVendorIdVariablesBuilder listClientFeedbackRatingsByVendorId ({required String vendorId, }) { + return ListClientFeedbackRatingsByVendorIdVariablesBuilder(dataConnect, vendorId: vendorId,); + } + + + ListCustomRateCardsVariablesBuilder listCustomRateCards () { + return ListCustomRateCardsVariablesBuilder(dataConnect, ); + } + + + GetCustomRateCardByIdVariablesBuilder getCustomRateCardById ({required String id, }) { + return GetCustomRateCardByIdVariablesBuilder(dataConnect, id: id,); + } + + + CreateDocumentVariablesBuilder createDocument ({required DocumentType documentType, required String name, }) { + return CreateDocumentVariablesBuilder(dataConnect, documentType: documentType,name: name,); + } + + + UpdateDocumentVariablesBuilder updateDocument ({required String id, }) { + return UpdateDocumentVariablesBuilder(dataConnect, id: id,); + } + + + DeleteDocumentVariablesBuilder deleteDocument ({required String id, }) { + return DeleteDocumentVariablesBuilder(dataConnect, id: id,); + } + + + ListRoleCategoriesVariablesBuilder listRoleCategories () { + return ListRoleCategoriesVariablesBuilder(dataConnect, ); + } + + + GetRoleCategoryByIdVariablesBuilder getRoleCategoryById ({required String id, }) { + return GetRoleCategoryByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetRoleCategoriesByCategoryVariablesBuilder getRoleCategoriesByCategory ({required RoleCategoryType category, }) { + return GetRoleCategoriesByCategoryVariablesBuilder(dataConnect, category: category,); + } + + + ListTaxFormsVariablesBuilder listTaxForms () { + return ListTaxFormsVariablesBuilder(dataConnect, ); + } + + + GetTaxFormByIdVariablesBuilder getTaxFormById ({required String id, }) { + return GetTaxFormByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetTaxFormsBystaffIdVariablesBuilder getTaxFormsBystaffId ({required String staffId, }) { + return GetTaxFormsBystaffIdVariablesBuilder(dataConnect, staffId: staffId,); + } + + + FilterTaxFormsVariablesBuilder filterTaxForms () { + return FilterTaxFormsVariablesBuilder(dataConnect, ); + } + + + CreateVendorVariablesBuilder createVendor ({required String userId, required String companyName, }) { + return CreateVendorVariablesBuilder(dataConnect, userId: userId,companyName: companyName,); + } + + + UpdateVendorVariablesBuilder updateVendor ({required String id, }) { + return UpdateVendorVariablesBuilder(dataConnect, id: id,); + } + + + DeleteVendorVariablesBuilder deleteVendor ({required String id, }) { + return DeleteVendorVariablesBuilder(dataConnect, id: id,); + } + + + ListBenefitsDataVariablesBuilder listBenefitsData () { + return ListBenefitsDataVariablesBuilder(dataConnect, ); + } + + + GetBenefitsDataByKeyVariablesBuilder getBenefitsDataByKey ({required String staffId, required String vendorBenefitPlanId, }) { + return GetBenefitsDataByKeyVariablesBuilder(dataConnect, staffId: staffId,vendorBenefitPlanId: vendorBenefitPlanId,); + } + + + ListBenefitsDataByStaffIdVariablesBuilder listBenefitsDataByStaffId ({required String staffId, }) { + return ListBenefitsDataByStaffIdVariablesBuilder(dataConnect, staffId: staffId,); + } + + + ListBenefitsDataByVendorBenefitPlanIdVariablesBuilder listBenefitsDataByVendorBenefitPlanId ({required String vendorBenefitPlanId, }) { + return ListBenefitsDataByVendorBenefitPlanIdVariablesBuilder(dataConnect, vendorBenefitPlanId: vendorBenefitPlanId,); + } + + + ListBenefitsDataByVendorBenefitPlanIdsVariablesBuilder listBenefitsDataByVendorBenefitPlanIds ({required List vendorBenefitPlanIds, }) { + return ListBenefitsDataByVendorBenefitPlanIdsVariablesBuilder(dataConnect, vendorBenefitPlanIds: vendorBenefitPlanIds,); + } + + + CreateFaqDataVariablesBuilder createFaqData ({required String category, }) { + return CreateFaqDataVariablesBuilder(dataConnect, category: category,); + } + + + UpdateFaqDataVariablesBuilder updateFaqData ({required String id, }) { + return UpdateFaqDataVariablesBuilder(dataConnect, id: id,); + } + + + DeleteFaqDataVariablesBuilder deleteFaqData ({required String id, }) { + return DeleteFaqDataVariablesBuilder(dataConnect, id: id,); + } + + + ListOrdersVariablesBuilder listOrders () { + return ListOrdersVariablesBuilder(dataConnect, ); + } + + + GetOrderByIdVariablesBuilder getOrderById ({required String id, }) { + return GetOrderByIdVariablesBuilder(dataConnect, id: id,); + } + + + GetOrdersByBusinessIdVariablesBuilder getOrdersByBusinessId ({required String businessId, }) { + return GetOrdersByBusinessIdVariablesBuilder(dataConnect, businessId: businessId,); + } + + + GetOrdersByVendorIdVariablesBuilder getOrdersByVendorId ({required String vendorId, }) { + return GetOrdersByVendorIdVariablesBuilder(dataConnect, vendorId: vendorId,); + } + + + GetOrdersByStatusVariablesBuilder getOrdersByStatus ({required OrderStatus status, }) { + return GetOrdersByStatusVariablesBuilder(dataConnect, status: status,); + } + + + GetOrdersByDateRangeVariablesBuilder getOrdersByDateRange ({required Timestamp start, required Timestamp end, }) { + return GetOrdersByDateRangeVariablesBuilder(dataConnect, start: start,end: end,); + } + + + GetRapidOrdersVariablesBuilder getRapidOrders () { + return GetRapidOrdersVariablesBuilder(dataConnect, ); + } + + + static ConnectorConfig connectorConfig = ConnectorConfig( + 'us-central1', + 'example', + 'krow-workforce-db', + ); + + ExampleConnector({required this.dataConnect}); + static ExampleConnector get instance { + return ExampleConnector( + dataConnect: FirebaseDataConnect.instanceFor( + connectorConfig: connectorConfig, + sdkType: CallerSDKType.generated)); + } + + FirebaseDataConnect dataConnect; +} diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_account_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_account_by_id.dart new file mode 100644 index 00000000..5e4d9836 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_account_by_id.dart @@ -0,0 +1,174 @@ +part of 'generated.dart'; + +class GetAccountByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetAccountByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetAccountByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetAccountByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetAccountByIdVariables vars= GetAccountByIdVariables(id: id,); + return _dataConnect.query("getAccountById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetAccountByIdAccount { + final String id; + final String bank; + final EnumValue type; + final String last4; + final bool? isPrimary; + final String ownerId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetAccountByIdAccount.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + bank = nativeFromJson(json['bank']), + type = accountTypeDeserializer(json['type']), + last4 = nativeFromJson(json['last4']), + isPrimary = json['isPrimary'] == null ? null : nativeFromJson(json['isPrimary']), + ownerId = nativeFromJson(json['ownerId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAccountByIdAccount otherTyped = other as GetAccountByIdAccount; + return id == otherTyped.id && + bank == otherTyped.bank && + type == otherTyped.type && + last4 == otherTyped.last4 && + isPrimary == otherTyped.isPrimary && + ownerId == otherTyped.ownerId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['bank'] = nativeToJson(bank); + json['type'] = + accountTypeSerializer(type) + ; + json['last4'] = nativeToJson(last4); + if (isPrimary != null) { + json['isPrimary'] = nativeToJson(isPrimary); + } + json['ownerId'] = nativeToJson(ownerId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetAccountByIdAccount({ + required this.id, + required this.bank, + required this.type, + required this.last4, + this.isPrimary, + required this.ownerId, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetAccountByIdData { + final GetAccountByIdAccount? account; + GetAccountByIdData.fromJson(dynamic json): + + account = json['account'] == null ? null : GetAccountByIdAccount.fromJson(json['account']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAccountByIdData otherTyped = other as GetAccountByIdData; + return account == otherTyped.account; + + } + @override + int get hashCode => account.hashCode; + + + Map toJson() { + Map json = {}; + if (account != null) { + json['account'] = account!.toJson(); + } + return json; + } + + GetAccountByIdData({ + this.account, + }); +} + +@immutable +class GetAccountByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetAccountByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAccountByIdVariables otherTyped = other as GetAccountByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetAccountByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_accounts_by_owner_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_accounts_by_owner_id.dart new file mode 100644 index 00000000..2d704e46 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_accounts_by_owner_id.dart @@ -0,0 +1,174 @@ +part of 'generated.dart'; + +class GetAccountsByOwnerIdVariablesBuilder { + String ownerId; + + final FirebaseDataConnect _dataConnect; + GetAccountsByOwnerIdVariablesBuilder(this._dataConnect, {required this.ownerId,}); + Deserializer dataDeserializer = (dynamic json) => GetAccountsByOwnerIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetAccountsByOwnerIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetAccountsByOwnerIdVariables vars= GetAccountsByOwnerIdVariables(ownerId: ownerId,); + return _dataConnect.query("getAccountsByOwnerId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetAccountsByOwnerIdAccounts { + final String id; + final String bank; + final EnumValue type; + final String last4; + final bool? isPrimary; + final String ownerId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetAccountsByOwnerIdAccounts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + bank = nativeFromJson(json['bank']), + type = accountTypeDeserializer(json['type']), + last4 = nativeFromJson(json['last4']), + isPrimary = json['isPrimary'] == null ? null : nativeFromJson(json['isPrimary']), + ownerId = nativeFromJson(json['ownerId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAccountsByOwnerIdAccounts otherTyped = other as GetAccountsByOwnerIdAccounts; + return id == otherTyped.id && + bank == otherTyped.bank && + type == otherTyped.type && + last4 == otherTyped.last4 && + isPrimary == otherTyped.isPrimary && + ownerId == otherTyped.ownerId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['bank'] = nativeToJson(bank); + json['type'] = + accountTypeSerializer(type) + ; + json['last4'] = nativeToJson(last4); + if (isPrimary != null) { + json['isPrimary'] = nativeToJson(isPrimary); + } + json['ownerId'] = nativeToJson(ownerId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetAccountsByOwnerIdAccounts({ + required this.id, + required this.bank, + required this.type, + required this.last4, + this.isPrimary, + required this.ownerId, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetAccountsByOwnerIdData { + final List accounts; + GetAccountsByOwnerIdData.fromJson(dynamic json): + + accounts = (json['accounts'] as List) + .map((e) => GetAccountsByOwnerIdAccounts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAccountsByOwnerIdData otherTyped = other as GetAccountsByOwnerIdData; + return accounts == otherTyped.accounts; + + } + @override + int get hashCode => accounts.hashCode; + + + Map toJson() { + Map json = {}; + json['accounts'] = accounts.map((e) => e.toJson()).toList(); + return json; + } + + GetAccountsByOwnerIdData({ + required this.accounts, + }); +} + +@immutable +class GetAccountsByOwnerIdVariables { + final String ownerId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetAccountsByOwnerIdVariables.fromJson(Map json): + + ownerId = nativeFromJson(json['ownerId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAccountsByOwnerIdVariables otherTyped = other as GetAccountsByOwnerIdVariables; + return ownerId == otherTyped.ownerId; + + } + @override + int get hashCode => ownerId.hashCode; + + + Map toJson() { + Map json = {}; + json['ownerId'] = nativeToJson(ownerId); + return json; + } + + GetAccountsByOwnerIdVariables({ + required this.ownerId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_activity_log_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_activity_log_by_id.dart new file mode 100644 index 00000000..e236b0b5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_activity_log_by_id.dart @@ -0,0 +1,216 @@ +part of 'generated.dart'; + +class GetActivityLogByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetActivityLogByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetActivityLogByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetActivityLogByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetActivityLogByIdVariables vars= GetActivityLogByIdVariables(id: id,); + return _dataConnect.query("getActivityLogById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetActivityLogByIdActivityLog { + final String id; + final String userId; + final Timestamp date; + final String? hourStart; + final String? hourEnd; + final String? totalhours; + final EnumValue? iconType; + final String? iconColor; + final String title; + final String description; + final bool? isRead; + final EnumValue activityType; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetActivityLogByIdActivityLog.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + userId = nativeFromJson(json['userId']), + date = Timestamp.fromJson(json['date']), + hourStart = json['hourStart'] == null ? null : nativeFromJson(json['hourStart']), + hourEnd = json['hourEnd'] == null ? null : nativeFromJson(json['hourEnd']), + totalhours = json['totalhours'] == null ? null : nativeFromJson(json['totalhours']), + iconType = json['iconType'] == null ? null : activityIconTypeDeserializer(json['iconType']), + iconColor = json['iconColor'] == null ? null : nativeFromJson(json['iconColor']), + title = nativeFromJson(json['title']), + description = nativeFromJson(json['description']), + isRead = json['isRead'] == null ? null : nativeFromJson(json['isRead']), + activityType = activityTypeDeserializer(json['activityType']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetActivityLogByIdActivityLog otherTyped = other as GetActivityLogByIdActivityLog; + return id == otherTyped.id && + userId == otherTyped.userId && + date == otherTyped.date && + hourStart == otherTyped.hourStart && + hourEnd == otherTyped.hourEnd && + totalhours == otherTyped.totalhours && + iconType == otherTyped.iconType && + iconColor == otherTyped.iconColor && + title == otherTyped.title && + description == otherTyped.description && + isRead == otherTyped.isRead && + activityType == otherTyped.activityType && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, date.hashCode, hourStart.hashCode, hourEnd.hashCode, totalhours.hashCode, iconType.hashCode, iconColor.hashCode, title.hashCode, description.hashCode, isRead.hashCode, activityType.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['userId'] = nativeToJson(userId); + json['date'] = date.toJson(); + if (hourStart != null) { + json['hourStart'] = nativeToJson(hourStart); + } + if (hourEnd != null) { + json['hourEnd'] = nativeToJson(hourEnd); + } + if (totalhours != null) { + json['totalhours'] = nativeToJson(totalhours); + } + if (iconType != null) { + json['iconType'] = + activityIconTypeSerializer(iconType!) + ; + } + if (iconColor != null) { + json['iconColor'] = nativeToJson(iconColor); + } + json['title'] = nativeToJson(title); + json['description'] = nativeToJson(description); + if (isRead != null) { + json['isRead'] = nativeToJson(isRead); + } + json['activityType'] = + activityTypeSerializer(activityType) + ; + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetActivityLogByIdActivityLog({ + required this.id, + required this.userId, + required this.date, + this.hourStart, + this.hourEnd, + this.totalhours, + this.iconType, + this.iconColor, + required this.title, + required this.description, + this.isRead, + required this.activityType, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetActivityLogByIdData { + final GetActivityLogByIdActivityLog? activityLog; + GetActivityLogByIdData.fromJson(dynamic json): + + activityLog = json['activityLog'] == null ? null : GetActivityLogByIdActivityLog.fromJson(json['activityLog']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetActivityLogByIdData otherTyped = other as GetActivityLogByIdData; + return activityLog == otherTyped.activityLog; + + } + @override + int get hashCode => activityLog.hashCode; + + + Map toJson() { + Map json = {}; + if (activityLog != null) { + json['activityLog'] = activityLog!.toJson(); + } + return json; + } + + GetActivityLogByIdData({ + this.activityLog, + }); +} + +@immutable +class GetActivityLogByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetActivityLogByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetActivityLogByIdVariables otherTyped = other as GetActivityLogByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetActivityLogByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_application_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_application_by_id.dart new file mode 100644 index 00000000..2f8bfcb5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_application_by_id.dart @@ -0,0 +1,547 @@ +part of 'generated.dart'; + +class GetApplicationByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetApplicationByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetApplicationByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetApplicationByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetApplicationByIdVariables vars= GetApplicationByIdVariables(id: id,); + return _dataConnect.query("getApplicationById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetApplicationByIdApplication { + final String id; + final String shiftId; + final String staffId; + final EnumValue status; + final Timestamp? appliedAt; + final Timestamp? checkInTime; + final Timestamp? checkOutTime; + final EnumValue origin; + final Timestamp? createdAt; + final GetApplicationByIdApplicationShift shift; + final GetApplicationByIdApplicationShiftRole shiftRole; + GetApplicationByIdApplication.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + staffId = nativeFromJson(json['staffId']), + status = applicationStatusDeserializer(json['status']), + appliedAt = json['appliedAt'] == null ? null : Timestamp.fromJson(json['appliedAt']), + checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']), + checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']), + origin = applicationOriginDeserializer(json['origin']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + shift = GetApplicationByIdApplicationShift.fromJson(json['shift']), + shiftRole = GetApplicationByIdApplicationShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationByIdApplication otherTyped = other as GetApplicationByIdApplication; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + staffId == otherTyped.staffId && + status == otherTyped.status && + appliedAt == otherTyped.appliedAt && + checkInTime == otherTyped.checkInTime && + checkOutTime == otherTyped.checkOutTime && + origin == otherTyped.origin && + createdAt == otherTyped.createdAt && + shift == otherTyped.shift && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, staffId.hashCode, status.hashCode, appliedAt.hashCode, checkInTime.hashCode, checkOutTime.hashCode, origin.hashCode, createdAt.hashCode, shift.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['staffId'] = nativeToJson(staffId); + json['status'] = + applicationStatusSerializer(status) + ; + if (appliedAt != null) { + json['appliedAt'] = appliedAt!.toJson(); + } + if (checkInTime != null) { + json['checkInTime'] = checkInTime!.toJson(); + } + if (checkOutTime != null) { + json['checkOutTime'] = checkOutTime!.toJson(); + } + json['origin'] = + applicationOriginSerializer(origin) + ; + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['shift'] = shift.toJson(); + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + GetApplicationByIdApplication({ + required this.id, + required this.shiftId, + required this.staffId, + required this.status, + this.appliedAt, + this.checkInTime, + this.checkOutTime, + required this.origin, + this.createdAt, + required this.shift, + required this.shiftRole, + }); +} + +@immutable +class GetApplicationByIdApplicationShift { + final String id; + final String title; + final Timestamp? date; + final Timestamp? startTime; + final Timestamp? endTime; + final String? location; + final EnumValue? status; + final GetApplicationByIdApplicationShiftOrder order; + GetApplicationByIdApplicationShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + order = GetApplicationByIdApplicationShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationByIdApplicationShift otherTyped = other as GetApplicationByIdApplicationShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + location == otherTyped.location && + status == otherTyped.status && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, location.hashCode, status.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + json['order'] = order.toJson(); + return json; + } + + GetApplicationByIdApplicationShift({ + required this.id, + required this.title, + this.date, + this.startTime, + this.endTime, + this.location, + this.status, + required this.order, + }); +} + +@immutable +class GetApplicationByIdApplicationShiftOrder { + final String id; + final String? eventName; + final String? location; + final GetApplicationByIdApplicationShiftOrderBusiness business; + final GetApplicationByIdApplicationShiftOrderVendor? vendor; + GetApplicationByIdApplicationShiftOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + business = GetApplicationByIdApplicationShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetApplicationByIdApplicationShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationByIdApplicationShiftOrder otherTyped = other as GetApplicationByIdApplicationShiftOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + location == otherTyped.location && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, location.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetApplicationByIdApplicationShiftOrder({ + required this.id, + this.eventName, + this.location, + required this.business, + this.vendor, + }); +} + +@immutable +class GetApplicationByIdApplicationShiftOrderBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetApplicationByIdApplicationShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationByIdApplicationShiftOrderBusiness otherTyped = other as GetApplicationByIdApplicationShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetApplicationByIdApplicationShiftOrderBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetApplicationByIdApplicationShiftOrderVendor { + final String id; + final String companyName; + GetApplicationByIdApplicationShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationByIdApplicationShiftOrderVendor otherTyped = other as GetApplicationByIdApplicationShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetApplicationByIdApplicationShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetApplicationByIdApplicationShiftRole { + final String id; + final String roleId; + final int count; + final int? assigned; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? totalValue; + final GetApplicationByIdApplicationShiftRoleRole role; + GetApplicationByIdApplicationShiftRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + roleId = nativeFromJson(json['roleId']), + count = nativeFromJson(json['count']), + assigned = json['assigned'] == null ? null : nativeFromJson(json['assigned']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = GetApplicationByIdApplicationShiftRoleRole.fromJson(json['role']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationByIdApplicationShiftRole otherTyped = other as GetApplicationByIdApplicationShiftRole; + return id == otherTyped.id && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + role == otherTyped.role; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, totalValue.hashCode, role.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['roleId'] = nativeToJson(roleId); + json['count'] = nativeToJson(count); + if (assigned != null) { + json['assigned'] = nativeToJson(assigned); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + return json; + } + + GetApplicationByIdApplicationShiftRole({ + required this.id, + required this.roleId, + required this.count, + this.assigned, + this.startTime, + this.endTime, + this.hours, + this.totalValue, + required this.role, + }); +} + +@immutable +class GetApplicationByIdApplicationShiftRoleRole { + final String id; + final String name; + final double costPerHour; + GetApplicationByIdApplicationShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationByIdApplicationShiftRoleRole otherTyped = other as GetApplicationByIdApplicationShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + GetApplicationByIdApplicationShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class GetApplicationByIdData { + final GetApplicationByIdApplication? application; + GetApplicationByIdData.fromJson(dynamic json): + + application = json['application'] == null ? null : GetApplicationByIdApplication.fromJson(json['application']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationByIdData otherTyped = other as GetApplicationByIdData; + return application == otherTyped.application; + + } + @override + int get hashCode => application.hashCode; + + + Map toJson() { + Map json = {}; + if (application != null) { + json['application'] = application!.toJson(); + } + return json; + } + + GetApplicationByIdData({ + this.application, + }); +} + +@immutable +class GetApplicationByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetApplicationByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationByIdVariables otherTyped = other as GetApplicationByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetApplicationByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_applications_by_shift_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_applications_by_shift_id.dart new file mode 100644 index 00000000..69630e56 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_applications_by_shift_id.dart @@ -0,0 +1,547 @@ +part of 'generated.dart'; + +class GetApplicationsByShiftIdVariablesBuilder { + String shiftId; + + final FirebaseDataConnect _dataConnect; + GetApplicationsByShiftIdVariablesBuilder(this._dataConnect, {required this.shiftId,}); + Deserializer dataDeserializer = (dynamic json) => GetApplicationsByShiftIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetApplicationsByShiftIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetApplicationsByShiftIdVariables vars= GetApplicationsByShiftIdVariables(shiftId: shiftId,); + return _dataConnect.query("getApplicationsByShiftId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetApplicationsByShiftIdApplications { + final String id; + final String shiftId; + final String staffId; + final EnumValue status; + final Timestamp? appliedAt; + final Timestamp? checkInTime; + final Timestamp? checkOutTime; + final EnumValue origin; + final Timestamp? createdAt; + final GetApplicationsByShiftIdApplicationsShift shift; + final GetApplicationsByShiftIdApplicationsShiftRole shiftRole; + GetApplicationsByShiftIdApplications.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + staffId = nativeFromJson(json['staffId']), + status = applicationStatusDeserializer(json['status']), + appliedAt = json['appliedAt'] == null ? null : Timestamp.fromJson(json['appliedAt']), + checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']), + checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']), + origin = applicationOriginDeserializer(json['origin']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + shift = GetApplicationsByShiftIdApplicationsShift.fromJson(json['shift']), + shiftRole = GetApplicationsByShiftIdApplicationsShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdApplications otherTyped = other as GetApplicationsByShiftIdApplications; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + staffId == otherTyped.staffId && + status == otherTyped.status && + appliedAt == otherTyped.appliedAt && + checkInTime == otherTyped.checkInTime && + checkOutTime == otherTyped.checkOutTime && + origin == otherTyped.origin && + createdAt == otherTyped.createdAt && + shift == otherTyped.shift && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, staffId.hashCode, status.hashCode, appliedAt.hashCode, checkInTime.hashCode, checkOutTime.hashCode, origin.hashCode, createdAt.hashCode, shift.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['staffId'] = nativeToJson(staffId); + json['status'] = + applicationStatusSerializer(status) + ; + if (appliedAt != null) { + json['appliedAt'] = appliedAt!.toJson(); + } + if (checkInTime != null) { + json['checkInTime'] = checkInTime!.toJson(); + } + if (checkOutTime != null) { + json['checkOutTime'] = checkOutTime!.toJson(); + } + json['origin'] = + applicationOriginSerializer(origin) + ; + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['shift'] = shift.toJson(); + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + GetApplicationsByShiftIdApplications({ + required this.id, + required this.shiftId, + required this.staffId, + required this.status, + this.appliedAt, + this.checkInTime, + this.checkOutTime, + required this.origin, + this.createdAt, + required this.shift, + required this.shiftRole, + }); +} + +@immutable +class GetApplicationsByShiftIdApplicationsShift { + final String id; + final String title; + final Timestamp? date; + final Timestamp? startTime; + final Timestamp? endTime; + final String? location; + final EnumValue? status; + final GetApplicationsByShiftIdApplicationsShiftOrder order; + GetApplicationsByShiftIdApplicationsShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + order = GetApplicationsByShiftIdApplicationsShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdApplicationsShift otherTyped = other as GetApplicationsByShiftIdApplicationsShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + location == otherTyped.location && + status == otherTyped.status && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, location.hashCode, status.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + json['order'] = order.toJson(); + return json; + } + + GetApplicationsByShiftIdApplicationsShift({ + required this.id, + required this.title, + this.date, + this.startTime, + this.endTime, + this.location, + this.status, + required this.order, + }); +} + +@immutable +class GetApplicationsByShiftIdApplicationsShiftOrder { + final String id; + final String? eventName; + final String? location; + final GetApplicationsByShiftIdApplicationsShiftOrderBusiness business; + final GetApplicationsByShiftIdApplicationsShiftOrderVendor? vendor; + GetApplicationsByShiftIdApplicationsShiftOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + business = GetApplicationsByShiftIdApplicationsShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetApplicationsByShiftIdApplicationsShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdApplicationsShiftOrder otherTyped = other as GetApplicationsByShiftIdApplicationsShiftOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + location == otherTyped.location && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, location.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetApplicationsByShiftIdApplicationsShiftOrder({ + required this.id, + this.eventName, + this.location, + required this.business, + this.vendor, + }); +} + +@immutable +class GetApplicationsByShiftIdApplicationsShiftOrderBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetApplicationsByShiftIdApplicationsShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdApplicationsShiftOrderBusiness otherTyped = other as GetApplicationsByShiftIdApplicationsShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetApplicationsByShiftIdApplicationsShiftOrderBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetApplicationsByShiftIdApplicationsShiftOrderVendor { + final String id; + final String companyName; + GetApplicationsByShiftIdApplicationsShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdApplicationsShiftOrderVendor otherTyped = other as GetApplicationsByShiftIdApplicationsShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetApplicationsByShiftIdApplicationsShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetApplicationsByShiftIdApplicationsShiftRole { + final String id; + final String roleId; + final int count; + final int? assigned; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? totalValue; + final GetApplicationsByShiftIdApplicationsShiftRoleRole role; + GetApplicationsByShiftIdApplicationsShiftRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + roleId = nativeFromJson(json['roleId']), + count = nativeFromJson(json['count']), + assigned = json['assigned'] == null ? null : nativeFromJson(json['assigned']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = GetApplicationsByShiftIdApplicationsShiftRoleRole.fromJson(json['role']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdApplicationsShiftRole otherTyped = other as GetApplicationsByShiftIdApplicationsShiftRole; + return id == otherTyped.id && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + role == otherTyped.role; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, totalValue.hashCode, role.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['roleId'] = nativeToJson(roleId); + json['count'] = nativeToJson(count); + if (assigned != null) { + json['assigned'] = nativeToJson(assigned); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + return json; + } + + GetApplicationsByShiftIdApplicationsShiftRole({ + required this.id, + required this.roleId, + required this.count, + this.assigned, + this.startTime, + this.endTime, + this.hours, + this.totalValue, + required this.role, + }); +} + +@immutable +class GetApplicationsByShiftIdApplicationsShiftRoleRole { + final String id; + final String name; + final double costPerHour; + GetApplicationsByShiftIdApplicationsShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdApplicationsShiftRoleRole otherTyped = other as GetApplicationsByShiftIdApplicationsShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + GetApplicationsByShiftIdApplicationsShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class GetApplicationsByShiftIdData { + final List applications; + GetApplicationsByShiftIdData.fromJson(dynamic json): + + applications = (json['applications'] as List) + .map((e) => GetApplicationsByShiftIdApplications.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdData otherTyped = other as GetApplicationsByShiftIdData; + return applications == otherTyped.applications; + + } + @override + int get hashCode => applications.hashCode; + + + Map toJson() { + Map json = {}; + json['applications'] = applications.map((e) => e.toJson()).toList(); + return json; + } + + GetApplicationsByShiftIdData({ + required this.applications, + }); +} + +@immutable +class GetApplicationsByShiftIdVariables { + final String shiftId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetApplicationsByShiftIdVariables.fromJson(Map json): + + shiftId = nativeFromJson(json['shiftId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdVariables otherTyped = other as GetApplicationsByShiftIdVariables; + return shiftId == otherTyped.shiftId; + + } + @override + int get hashCode => shiftId.hashCode; + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + return json; + } + + GetApplicationsByShiftIdVariables({ + required this.shiftId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_applications_by_shift_id_and_status.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_applications_by_shift_id_and_status.dart new file mode 100644 index 00000000..f915ffba --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_applications_by_shift_id_and_status.dart @@ -0,0 +1,589 @@ +part of 'generated.dart'; + +class GetApplicationsByShiftIdAndStatusVariablesBuilder { + String shiftId; + ApplicationStatus status; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; GetApplicationsByShiftIdAndStatusVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetApplicationsByShiftIdAndStatusVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + GetApplicationsByShiftIdAndStatusVariablesBuilder(this._dataConnect, {required this.shiftId,required this.status,}); + Deserializer dataDeserializer = (dynamic json) => GetApplicationsByShiftIdAndStatusData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetApplicationsByShiftIdAndStatusVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetApplicationsByShiftIdAndStatusVariables vars= GetApplicationsByShiftIdAndStatusVariables(shiftId: shiftId,status: status,offset: _offset,limit: _limit,); + return _dataConnect.query("getApplicationsByShiftIdAndStatus", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetApplicationsByShiftIdAndStatusApplications { + final String id; + final String shiftId; + final String staffId; + final EnumValue status; + final Timestamp? appliedAt; + final Timestamp? checkInTime; + final Timestamp? checkOutTime; + final EnumValue origin; + final Timestamp? createdAt; + final GetApplicationsByShiftIdAndStatusApplicationsShift shift; + final GetApplicationsByShiftIdAndStatusApplicationsShiftRole shiftRole; + GetApplicationsByShiftIdAndStatusApplications.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + staffId = nativeFromJson(json['staffId']), + status = applicationStatusDeserializer(json['status']), + appliedAt = json['appliedAt'] == null ? null : Timestamp.fromJson(json['appliedAt']), + checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']), + checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']), + origin = applicationOriginDeserializer(json['origin']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + shift = GetApplicationsByShiftIdAndStatusApplicationsShift.fromJson(json['shift']), + shiftRole = GetApplicationsByShiftIdAndStatusApplicationsShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdAndStatusApplications otherTyped = other as GetApplicationsByShiftIdAndStatusApplications; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + staffId == otherTyped.staffId && + status == otherTyped.status && + appliedAt == otherTyped.appliedAt && + checkInTime == otherTyped.checkInTime && + checkOutTime == otherTyped.checkOutTime && + origin == otherTyped.origin && + createdAt == otherTyped.createdAt && + shift == otherTyped.shift && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, staffId.hashCode, status.hashCode, appliedAt.hashCode, checkInTime.hashCode, checkOutTime.hashCode, origin.hashCode, createdAt.hashCode, shift.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['staffId'] = nativeToJson(staffId); + json['status'] = + applicationStatusSerializer(status) + ; + if (appliedAt != null) { + json['appliedAt'] = appliedAt!.toJson(); + } + if (checkInTime != null) { + json['checkInTime'] = checkInTime!.toJson(); + } + if (checkOutTime != null) { + json['checkOutTime'] = checkOutTime!.toJson(); + } + json['origin'] = + applicationOriginSerializer(origin) + ; + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['shift'] = shift.toJson(); + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + GetApplicationsByShiftIdAndStatusApplications({ + required this.id, + required this.shiftId, + required this.staffId, + required this.status, + this.appliedAt, + this.checkInTime, + this.checkOutTime, + required this.origin, + this.createdAt, + required this.shift, + required this.shiftRole, + }); +} + +@immutable +class GetApplicationsByShiftIdAndStatusApplicationsShift { + final String id; + final String title; + final Timestamp? date; + final Timestamp? startTime; + final Timestamp? endTime; + final String? location; + final EnumValue? status; + final GetApplicationsByShiftIdAndStatusApplicationsShiftOrder order; + GetApplicationsByShiftIdAndStatusApplicationsShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + order = GetApplicationsByShiftIdAndStatusApplicationsShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdAndStatusApplicationsShift otherTyped = other as GetApplicationsByShiftIdAndStatusApplicationsShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + location == otherTyped.location && + status == otherTyped.status && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, location.hashCode, status.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + json['order'] = order.toJson(); + return json; + } + + GetApplicationsByShiftIdAndStatusApplicationsShift({ + required this.id, + required this.title, + this.date, + this.startTime, + this.endTime, + this.location, + this.status, + required this.order, + }); +} + +@immutable +class GetApplicationsByShiftIdAndStatusApplicationsShiftOrder { + final String id; + final String? eventName; + final String? location; + final GetApplicationsByShiftIdAndStatusApplicationsShiftOrderBusiness business; + final GetApplicationsByShiftIdAndStatusApplicationsShiftOrderVendor? vendor; + GetApplicationsByShiftIdAndStatusApplicationsShiftOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + business = GetApplicationsByShiftIdAndStatusApplicationsShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetApplicationsByShiftIdAndStatusApplicationsShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdAndStatusApplicationsShiftOrder otherTyped = other as GetApplicationsByShiftIdAndStatusApplicationsShiftOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + location == otherTyped.location && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, location.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetApplicationsByShiftIdAndStatusApplicationsShiftOrder({ + required this.id, + this.eventName, + this.location, + required this.business, + this.vendor, + }); +} + +@immutable +class GetApplicationsByShiftIdAndStatusApplicationsShiftOrderBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetApplicationsByShiftIdAndStatusApplicationsShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdAndStatusApplicationsShiftOrderBusiness otherTyped = other as GetApplicationsByShiftIdAndStatusApplicationsShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetApplicationsByShiftIdAndStatusApplicationsShiftOrderBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetApplicationsByShiftIdAndStatusApplicationsShiftOrderVendor { + final String id; + final String companyName; + GetApplicationsByShiftIdAndStatusApplicationsShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdAndStatusApplicationsShiftOrderVendor otherTyped = other as GetApplicationsByShiftIdAndStatusApplicationsShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetApplicationsByShiftIdAndStatusApplicationsShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetApplicationsByShiftIdAndStatusApplicationsShiftRole { + final String id; + final String roleId; + final int count; + final int? assigned; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? totalValue; + final GetApplicationsByShiftIdAndStatusApplicationsShiftRoleRole role; + GetApplicationsByShiftIdAndStatusApplicationsShiftRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + roleId = nativeFromJson(json['roleId']), + count = nativeFromJson(json['count']), + assigned = json['assigned'] == null ? null : nativeFromJson(json['assigned']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = GetApplicationsByShiftIdAndStatusApplicationsShiftRoleRole.fromJson(json['role']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdAndStatusApplicationsShiftRole otherTyped = other as GetApplicationsByShiftIdAndStatusApplicationsShiftRole; + return id == otherTyped.id && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + role == otherTyped.role; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, totalValue.hashCode, role.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['roleId'] = nativeToJson(roleId); + json['count'] = nativeToJson(count); + if (assigned != null) { + json['assigned'] = nativeToJson(assigned); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + return json; + } + + GetApplicationsByShiftIdAndStatusApplicationsShiftRole({ + required this.id, + required this.roleId, + required this.count, + this.assigned, + this.startTime, + this.endTime, + this.hours, + this.totalValue, + required this.role, + }); +} + +@immutable +class GetApplicationsByShiftIdAndStatusApplicationsShiftRoleRole { + final String id; + final String name; + final double costPerHour; + GetApplicationsByShiftIdAndStatusApplicationsShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdAndStatusApplicationsShiftRoleRole otherTyped = other as GetApplicationsByShiftIdAndStatusApplicationsShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + GetApplicationsByShiftIdAndStatusApplicationsShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class GetApplicationsByShiftIdAndStatusData { + final List applications; + GetApplicationsByShiftIdAndStatusData.fromJson(dynamic json): + + applications = (json['applications'] as List) + .map((e) => GetApplicationsByShiftIdAndStatusApplications.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdAndStatusData otherTyped = other as GetApplicationsByShiftIdAndStatusData; + return applications == otherTyped.applications; + + } + @override + int get hashCode => applications.hashCode; + + + Map toJson() { + Map json = {}; + json['applications'] = applications.map((e) => e.toJson()).toList(); + return json; + } + + GetApplicationsByShiftIdAndStatusData({ + required this.applications, + }); +} + +@immutable +class GetApplicationsByShiftIdAndStatusVariables { + final String shiftId; + final ApplicationStatus status; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetApplicationsByShiftIdAndStatusVariables.fromJson(Map json): + + shiftId = nativeFromJson(json['shiftId']), + status = ApplicationStatus.values.byName(json['status']) { + + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByShiftIdAndStatusVariables otherTyped = other as GetApplicationsByShiftIdAndStatusVariables; + return shiftId == otherTyped.shiftId && + status == otherTyped.status && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, status.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + json['status'] = + status.name + ; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + GetApplicationsByShiftIdAndStatusVariables({ + required this.shiftId, + required this.status, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_applications_by_staff_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_applications_by_staff_id.dart new file mode 100644 index 00000000..257d3b50 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_applications_by_staff_id.dart @@ -0,0 +1,580 @@ +part of 'generated.dart'; + +class GetApplicationsByStaffIdVariablesBuilder { + String staffId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; GetApplicationsByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetApplicationsByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + GetApplicationsByStaffIdVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => GetApplicationsByStaffIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetApplicationsByStaffIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetApplicationsByStaffIdVariables vars= GetApplicationsByStaffIdVariables(staffId: staffId,offset: _offset,limit: _limit,); + return _dataConnect.query("getApplicationsByStaffId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetApplicationsByStaffIdApplications { + final String id; + final String shiftId; + final String staffId; + final EnumValue status; + final Timestamp? appliedAt; + final Timestamp? checkInTime; + final Timestamp? checkOutTime; + final EnumValue origin; + final Timestamp? createdAt; + final GetApplicationsByStaffIdApplicationsShift shift; + final GetApplicationsByStaffIdApplicationsShiftRole shiftRole; + GetApplicationsByStaffIdApplications.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + staffId = nativeFromJson(json['staffId']), + status = applicationStatusDeserializer(json['status']), + appliedAt = json['appliedAt'] == null ? null : Timestamp.fromJson(json['appliedAt']), + checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']), + checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']), + origin = applicationOriginDeserializer(json['origin']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + shift = GetApplicationsByStaffIdApplicationsShift.fromJson(json['shift']), + shiftRole = GetApplicationsByStaffIdApplicationsShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByStaffIdApplications otherTyped = other as GetApplicationsByStaffIdApplications; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + staffId == otherTyped.staffId && + status == otherTyped.status && + appliedAt == otherTyped.appliedAt && + checkInTime == otherTyped.checkInTime && + checkOutTime == otherTyped.checkOutTime && + origin == otherTyped.origin && + createdAt == otherTyped.createdAt && + shift == otherTyped.shift && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, staffId.hashCode, status.hashCode, appliedAt.hashCode, checkInTime.hashCode, checkOutTime.hashCode, origin.hashCode, createdAt.hashCode, shift.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['staffId'] = nativeToJson(staffId); + json['status'] = + applicationStatusSerializer(status) + ; + if (appliedAt != null) { + json['appliedAt'] = appliedAt!.toJson(); + } + if (checkInTime != null) { + json['checkInTime'] = checkInTime!.toJson(); + } + if (checkOutTime != null) { + json['checkOutTime'] = checkOutTime!.toJson(); + } + json['origin'] = + applicationOriginSerializer(origin) + ; + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['shift'] = shift.toJson(); + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + GetApplicationsByStaffIdApplications({ + required this.id, + required this.shiftId, + required this.staffId, + required this.status, + this.appliedAt, + this.checkInTime, + this.checkOutTime, + required this.origin, + this.createdAt, + required this.shift, + required this.shiftRole, + }); +} + +@immutable +class GetApplicationsByStaffIdApplicationsShift { + final String id; + final String title; + final Timestamp? date; + final Timestamp? startTime; + final Timestamp? endTime; + final String? location; + final EnumValue? status; + final GetApplicationsByStaffIdApplicationsShiftOrder order; + GetApplicationsByStaffIdApplicationsShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + order = GetApplicationsByStaffIdApplicationsShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByStaffIdApplicationsShift otherTyped = other as GetApplicationsByStaffIdApplicationsShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + location == otherTyped.location && + status == otherTyped.status && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, location.hashCode, status.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + json['order'] = order.toJson(); + return json; + } + + GetApplicationsByStaffIdApplicationsShift({ + required this.id, + required this.title, + this.date, + this.startTime, + this.endTime, + this.location, + this.status, + required this.order, + }); +} + +@immutable +class GetApplicationsByStaffIdApplicationsShiftOrder { + final String id; + final String? eventName; + final String? location; + final GetApplicationsByStaffIdApplicationsShiftOrderBusiness business; + final GetApplicationsByStaffIdApplicationsShiftOrderVendor? vendor; + GetApplicationsByStaffIdApplicationsShiftOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + business = GetApplicationsByStaffIdApplicationsShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetApplicationsByStaffIdApplicationsShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByStaffIdApplicationsShiftOrder otherTyped = other as GetApplicationsByStaffIdApplicationsShiftOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + location == otherTyped.location && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, location.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetApplicationsByStaffIdApplicationsShiftOrder({ + required this.id, + this.eventName, + this.location, + required this.business, + this.vendor, + }); +} + +@immutable +class GetApplicationsByStaffIdApplicationsShiftOrderBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetApplicationsByStaffIdApplicationsShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByStaffIdApplicationsShiftOrderBusiness otherTyped = other as GetApplicationsByStaffIdApplicationsShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetApplicationsByStaffIdApplicationsShiftOrderBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetApplicationsByStaffIdApplicationsShiftOrderVendor { + final String id; + final String companyName; + GetApplicationsByStaffIdApplicationsShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByStaffIdApplicationsShiftOrderVendor otherTyped = other as GetApplicationsByStaffIdApplicationsShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetApplicationsByStaffIdApplicationsShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetApplicationsByStaffIdApplicationsShiftRole { + final String id; + final String roleId; + final int count; + final int? assigned; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? totalValue; + final GetApplicationsByStaffIdApplicationsShiftRoleRole role; + GetApplicationsByStaffIdApplicationsShiftRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + roleId = nativeFromJson(json['roleId']), + count = nativeFromJson(json['count']), + assigned = json['assigned'] == null ? null : nativeFromJson(json['assigned']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = GetApplicationsByStaffIdApplicationsShiftRoleRole.fromJson(json['role']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByStaffIdApplicationsShiftRole otherTyped = other as GetApplicationsByStaffIdApplicationsShiftRole; + return id == otherTyped.id && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + role == otherTyped.role; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, totalValue.hashCode, role.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['roleId'] = nativeToJson(roleId); + json['count'] = nativeToJson(count); + if (assigned != null) { + json['assigned'] = nativeToJson(assigned); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + return json; + } + + GetApplicationsByStaffIdApplicationsShiftRole({ + required this.id, + required this.roleId, + required this.count, + this.assigned, + this.startTime, + this.endTime, + this.hours, + this.totalValue, + required this.role, + }); +} + +@immutable +class GetApplicationsByStaffIdApplicationsShiftRoleRole { + final String id; + final String name; + final double costPerHour; + GetApplicationsByStaffIdApplicationsShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByStaffIdApplicationsShiftRoleRole otherTyped = other as GetApplicationsByStaffIdApplicationsShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + GetApplicationsByStaffIdApplicationsShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class GetApplicationsByStaffIdData { + final List applications; + GetApplicationsByStaffIdData.fromJson(dynamic json): + + applications = (json['applications'] as List) + .map((e) => GetApplicationsByStaffIdApplications.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByStaffIdData otherTyped = other as GetApplicationsByStaffIdData; + return applications == otherTyped.applications; + + } + @override + int get hashCode => applications.hashCode; + + + Map toJson() { + Map json = {}; + json['applications'] = applications.map((e) => e.toJson()).toList(); + return json; + } + + GetApplicationsByStaffIdData({ + required this.applications, + }); +} + +@immutable +class GetApplicationsByStaffIdVariables { + final String staffId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetApplicationsByStaffIdVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetApplicationsByStaffIdVariables otherTyped = other as GetApplicationsByStaffIdVariables; + return staffId == otherTyped.staffId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + GetApplicationsByStaffIdVariables({ + required this.staffId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_assignment_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_assignment_by_id.dart new file mode 100644 index 00000000..8887cb9f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_assignment_by_id.dart @@ -0,0 +1,709 @@ +part of 'generated.dart'; + +class GetAssignmentByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetAssignmentByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetAssignmentByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetAssignmentByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetAssignmentByIdVariables vars= GetAssignmentByIdVariables(id: id,); + return _dataConnect.query("getAssignmentById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetAssignmentByIdAssignment { + final String id; + final String? title; + final String? description; + final String? instructions; + final EnumValue? status; + final bool? tipsAvailable; + final bool? travelTime; + final bool? mealProvided; + final bool? parkingAvailable; + final bool? gasCompensation; + final List? managers; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final GetAssignmentByIdAssignmentWorkforce workforce; + final GetAssignmentByIdAssignmentShiftRole shiftRole; + GetAssignmentByIdAssignment.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = json['title'] == null ? null : nativeFromJson(json['title']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + instructions = json['instructions'] == null ? null : nativeFromJson(json['instructions']), + status = json['status'] == null ? null : assignmentStatusDeserializer(json['status']), + tipsAvailable = json['tipsAvailable'] == null ? null : nativeFromJson(json['tipsAvailable']), + travelTime = json['travelTime'] == null ? null : nativeFromJson(json['travelTime']), + mealProvided = json['mealProvided'] == null ? null : nativeFromJson(json['mealProvided']), + parkingAvailable = json['parkingAvailable'] == null ? null : nativeFromJson(json['parkingAvailable']), + gasCompensation = json['gasCompensation'] == null ? null : nativeFromJson(json['gasCompensation']), + managers = json['managers'] == null ? null : (json['managers'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + workforce = GetAssignmentByIdAssignmentWorkforce.fromJson(json['workforce']), + shiftRole = GetAssignmentByIdAssignmentShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAssignmentByIdAssignment otherTyped = other as GetAssignmentByIdAssignment; + return id == otherTyped.id && + title == otherTyped.title && + description == otherTyped.description && + instructions == otherTyped.instructions && + status == otherTyped.status && + tipsAvailable == otherTyped.tipsAvailable && + travelTime == otherTyped.travelTime && + mealProvided == otherTyped.mealProvided && + parkingAvailable == otherTyped.parkingAvailable && + gasCompensation == otherTyped.gasCompensation && + managers == otherTyped.managers && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + workforce == otherTyped.workforce && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, description.hashCode, instructions.hashCode, status.hashCode, tipsAvailable.hashCode, travelTime.hashCode, mealProvided.hashCode, parkingAvailable.hashCode, gasCompensation.hashCode, managers.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, workforce.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (title != null) { + json['title'] = nativeToJson(title); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + if (instructions != null) { + json['instructions'] = nativeToJson(instructions); + } + if (status != null) { + json['status'] = + assignmentStatusSerializer(status!) + ; + } + if (tipsAvailable != null) { + json['tipsAvailable'] = nativeToJson(tipsAvailable); + } + if (travelTime != null) { + json['travelTime'] = nativeToJson(travelTime); + } + if (mealProvided != null) { + json['mealProvided'] = nativeToJson(mealProvided); + } + if (parkingAvailable != null) { + json['parkingAvailable'] = nativeToJson(parkingAvailable); + } + if (gasCompensation != null) { + json['gasCompensation'] = nativeToJson(gasCompensation); + } + if (managers != null) { + json['managers'] = managers?.map((e) => e!.toJson()).toList(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['workforce'] = workforce.toJson(); + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + GetAssignmentByIdAssignment({ + required this.id, + this.title, + this.description, + this.instructions, + this.status, + this.tipsAvailable, + this.travelTime, + this.mealProvided, + this.parkingAvailable, + this.gasCompensation, + this.managers, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.workforce, + required this.shiftRole, + }); +} + +@immutable +class GetAssignmentByIdAssignmentWorkforce { + final String id; + final String workforceNumber; + final EnumValue? status; + final GetAssignmentByIdAssignmentWorkforceStaff staff; + GetAssignmentByIdAssignmentWorkforce.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workforceNumber = nativeFromJson(json['workforceNumber']), + status = json['status'] == null ? null : workforceStatusDeserializer(json['status']), + staff = GetAssignmentByIdAssignmentWorkforceStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAssignmentByIdAssignmentWorkforce otherTyped = other as GetAssignmentByIdAssignmentWorkforce; + return id == otherTyped.id && + workforceNumber == otherTyped.workforceNumber && + status == otherTyped.status && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workforceNumber.hashCode, status.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['workforceNumber'] = nativeToJson(workforceNumber); + if (status != null) { + json['status'] = + workforceStatusSerializer(status!) + ; + } + json['staff'] = staff.toJson(); + return json; + } + + GetAssignmentByIdAssignmentWorkforce({ + required this.id, + required this.workforceNumber, + this.status, + required this.staff, + }); +} + +@immutable +class GetAssignmentByIdAssignmentWorkforceStaff { + final String id; + final String fullName; + GetAssignmentByIdAssignmentWorkforceStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAssignmentByIdAssignmentWorkforceStaff otherTyped = other as GetAssignmentByIdAssignmentWorkforceStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + GetAssignmentByIdAssignmentWorkforceStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class GetAssignmentByIdAssignmentShiftRole { + final String id; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? totalValue; + final EnumValue? breakType; + final String? uniform; + final String? department; + final GetAssignmentByIdAssignmentShiftRoleRole role; + final GetAssignmentByIdAssignmentShiftRoleShift shift; + GetAssignmentByIdAssignmentShiftRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + breakType = json['breakType'] == null ? null : breakDurationDeserializer(json['breakType']), + uniform = json['uniform'] == null ? null : nativeFromJson(json['uniform']), + department = json['department'] == null ? null : nativeFromJson(json['department']), + role = GetAssignmentByIdAssignmentShiftRoleRole.fromJson(json['role']), + shift = GetAssignmentByIdAssignmentShiftRoleShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAssignmentByIdAssignmentShiftRole otherTyped = other as GetAssignmentByIdAssignmentShiftRole; + return id == otherTyped.id && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + breakType == otherTyped.breakType && + uniform == otherTyped.uniform && + department == otherTyped.department && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, totalValue.hashCode, breakType.hashCode, uniform.hashCode, department.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + if (breakType != null) { + json['breakType'] = + breakDurationSerializer(breakType!) + ; + } + if (uniform != null) { + json['uniform'] = nativeToJson(uniform); + } + if (department != null) { + json['department'] = nativeToJson(department); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + GetAssignmentByIdAssignmentShiftRole({ + required this.id, + this.startTime, + this.endTime, + this.hours, + this.totalValue, + this.breakType, + this.uniform, + this.department, + required this.role, + required this.shift, + }); +} + +@immutable +class GetAssignmentByIdAssignmentShiftRoleRole { + final String id; + final String name; + final double costPerHour; + GetAssignmentByIdAssignmentShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAssignmentByIdAssignmentShiftRoleRole otherTyped = other as GetAssignmentByIdAssignmentShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + GetAssignmentByIdAssignmentShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class GetAssignmentByIdAssignmentShiftRoleShift { + final String id; + final String title; + final Timestamp? date; + final String? location; + final String? locationAddress; + final double? latitude; + final double? longitude; + final EnumValue? status; + final List? managers; + final GetAssignmentByIdAssignmentShiftRoleShiftOrder order; + GetAssignmentByIdAssignmentShiftRoleShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + latitude = json['latitude'] == null ? null : nativeFromJson(json['latitude']), + longitude = json['longitude'] == null ? null : nativeFromJson(json['longitude']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + managers = json['managers'] == null ? null : (json['managers'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(), + order = GetAssignmentByIdAssignmentShiftRoleShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAssignmentByIdAssignmentShiftRoleShift otherTyped = other as GetAssignmentByIdAssignmentShiftRoleShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + latitude == otherTyped.latitude && + longitude == otherTyped.longitude && + status == otherTyped.status && + managers == otherTyped.managers && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, status.hashCode, managers.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (latitude != null) { + json['latitude'] = nativeToJson(latitude); + } + if (longitude != null) { + json['longitude'] = nativeToJson(longitude); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + if (managers != null) { + json['managers'] = managers?.map((e) => e!.toJson()).toList(); + } + json['order'] = order.toJson(); + return json; + } + + GetAssignmentByIdAssignmentShiftRoleShift({ + required this.id, + required this.title, + this.date, + this.location, + this.locationAddress, + this.latitude, + this.longitude, + this.status, + this.managers, + required this.order, + }); +} + +@immutable +class GetAssignmentByIdAssignmentShiftRoleShiftOrder { + final String id; + final String? eventName; + final EnumValue orderType; + final GetAssignmentByIdAssignmentShiftRoleShiftOrderBusiness business; + final GetAssignmentByIdAssignmentShiftRoleShiftOrderVendor? vendor; + GetAssignmentByIdAssignmentShiftRoleShiftOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + orderType = orderTypeDeserializer(json['orderType']), + business = GetAssignmentByIdAssignmentShiftRoleShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetAssignmentByIdAssignmentShiftRoleShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAssignmentByIdAssignmentShiftRoleShiftOrder otherTyped = other as GetAssignmentByIdAssignmentShiftRoleShiftOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + orderType == otherTyped.orderType && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, orderType.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['orderType'] = + orderTypeSerializer(orderType) + ; + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetAssignmentByIdAssignmentShiftRoleShiftOrder({ + required this.id, + this.eventName, + required this.orderType, + required this.business, + this.vendor, + }); +} + +@immutable +class GetAssignmentByIdAssignmentShiftRoleShiftOrderBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetAssignmentByIdAssignmentShiftRoleShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAssignmentByIdAssignmentShiftRoleShiftOrderBusiness otherTyped = other as GetAssignmentByIdAssignmentShiftRoleShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetAssignmentByIdAssignmentShiftRoleShiftOrderBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetAssignmentByIdAssignmentShiftRoleShiftOrderVendor { + final String id; + final String companyName; + GetAssignmentByIdAssignmentShiftRoleShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAssignmentByIdAssignmentShiftRoleShiftOrderVendor otherTyped = other as GetAssignmentByIdAssignmentShiftRoleShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetAssignmentByIdAssignmentShiftRoleShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetAssignmentByIdData { + final GetAssignmentByIdAssignment? assignment; + GetAssignmentByIdData.fromJson(dynamic json): + + assignment = json['assignment'] == null ? null : GetAssignmentByIdAssignment.fromJson(json['assignment']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAssignmentByIdData otherTyped = other as GetAssignmentByIdData; + return assignment == otherTyped.assignment; + + } + @override + int get hashCode => assignment.hashCode; + + + Map toJson() { + Map json = {}; + if (assignment != null) { + json['assignment'] = assignment!.toJson(); + } + return json; + } + + GetAssignmentByIdData({ + this.assignment, + }); +} + +@immutable +class GetAssignmentByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetAssignmentByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAssignmentByIdVariables otherTyped = other as GetAssignmentByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetAssignmentByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_attire_option_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_attire_option_by_id.dart new file mode 100644 index 00000000..a889f163 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_attire_option_by_id.dart @@ -0,0 +1,169 @@ +part of 'generated.dart'; + +class GetAttireOptionByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetAttireOptionByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetAttireOptionByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetAttireOptionByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetAttireOptionByIdVariables vars= GetAttireOptionByIdVariables(id: id,); + return _dataConnect.query("getAttireOptionById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetAttireOptionByIdAttireOption { + final String id; + final String itemId; + final String label; + final String? icon; + final String? imageUrl; + final bool? isMandatory; + final String? vendorId; + final Timestamp? createdAt; + GetAttireOptionByIdAttireOption.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + itemId = nativeFromJson(json['itemId']), + label = nativeFromJson(json['label']), + icon = json['icon'] == null ? null : nativeFromJson(json['icon']), + imageUrl = json['imageUrl'] == null ? null : nativeFromJson(json['imageUrl']), + isMandatory = json['isMandatory'] == null ? null : nativeFromJson(json['isMandatory']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAttireOptionByIdAttireOption otherTyped = other as GetAttireOptionByIdAttireOption; + return id == otherTyped.id && + itemId == otherTyped.itemId && + label == otherTyped.label && + icon == otherTyped.icon && + imageUrl == otherTyped.imageUrl && + isMandatory == otherTyped.isMandatory && + vendorId == otherTyped.vendorId && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, itemId.hashCode, label.hashCode, icon.hashCode, imageUrl.hashCode, isMandatory.hashCode, vendorId.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['itemId'] = nativeToJson(itemId); + json['label'] = nativeToJson(label); + if (icon != null) { + json['icon'] = nativeToJson(icon); + } + if (imageUrl != null) { + json['imageUrl'] = nativeToJson(imageUrl); + } + if (isMandatory != null) { + json['isMandatory'] = nativeToJson(isMandatory); + } + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + GetAttireOptionByIdAttireOption({ + required this.id, + required this.itemId, + required this.label, + this.icon, + this.imageUrl, + this.isMandatory, + this.vendorId, + this.createdAt, + }); +} + +@immutable +class GetAttireOptionByIdData { + final GetAttireOptionByIdAttireOption? attireOption; + GetAttireOptionByIdData.fromJson(dynamic json): + + attireOption = json['attireOption'] == null ? null : GetAttireOptionByIdAttireOption.fromJson(json['attireOption']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAttireOptionByIdData otherTyped = other as GetAttireOptionByIdData; + return attireOption == otherTyped.attireOption; + + } + @override + int get hashCode => attireOption.hashCode; + + + Map toJson() { + Map json = {}; + if (attireOption != null) { + json['attireOption'] = attireOption!.toJson(); + } + return json; + } + + GetAttireOptionByIdData({ + this.attireOption, + }); +} + +@immutable +class GetAttireOptionByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetAttireOptionByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetAttireOptionByIdVariables otherTyped = other as GetAttireOptionByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetAttireOptionByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_benefits_data_by_key.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_benefits_data_by_key.dart new file mode 100644 index 00000000..90a2870b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_benefits_data_by_key.dart @@ -0,0 +1,266 @@ +part of 'generated.dart'; + +class GetBenefitsDataByKeyVariablesBuilder { + String staffId; + String vendorBenefitPlanId; + + final FirebaseDataConnect _dataConnect; + GetBenefitsDataByKeyVariablesBuilder(this._dataConnect, {required this.staffId,required this.vendorBenefitPlanId,}); + Deserializer dataDeserializer = (dynamic json) => GetBenefitsDataByKeyData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetBenefitsDataByKeyVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetBenefitsDataByKeyVariables vars= GetBenefitsDataByKeyVariables(staffId: staffId,vendorBenefitPlanId: vendorBenefitPlanId,); + return _dataConnect.query("getBenefitsDataByKey", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetBenefitsDataByKeyBenefitsData { + final String id; + final String vendorBenefitPlanId; + final int current; + final String staffId; + final GetBenefitsDataByKeyBenefitsDataStaff staff; + final GetBenefitsDataByKeyBenefitsDataVendorBenefitPlan vendorBenefitPlan; + GetBenefitsDataByKeyBenefitsData.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorBenefitPlanId = nativeFromJson(json['vendorBenefitPlanId']), + current = nativeFromJson(json['current']), + staffId = nativeFromJson(json['staffId']), + staff = GetBenefitsDataByKeyBenefitsDataStaff.fromJson(json['staff']), + vendorBenefitPlan = GetBenefitsDataByKeyBenefitsDataVendorBenefitPlan.fromJson(json['vendorBenefitPlan']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetBenefitsDataByKeyBenefitsData otherTyped = other as GetBenefitsDataByKeyBenefitsData; + return id == otherTyped.id && + vendorBenefitPlanId == otherTyped.vendorBenefitPlanId && + current == otherTyped.current && + staffId == otherTyped.staffId && + staff == otherTyped.staff && + vendorBenefitPlan == otherTyped.vendorBenefitPlan; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorBenefitPlanId.hashCode, current.hashCode, staffId.hashCode, staff.hashCode, vendorBenefitPlan.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorBenefitPlanId'] = nativeToJson(vendorBenefitPlanId); + json['current'] = nativeToJson(current); + json['staffId'] = nativeToJson(staffId); + json['staff'] = staff.toJson(); + json['vendorBenefitPlan'] = vendorBenefitPlan.toJson(); + return json; + } + + GetBenefitsDataByKeyBenefitsData({ + required this.id, + required this.vendorBenefitPlanId, + required this.current, + required this.staffId, + required this.staff, + required this.vendorBenefitPlan, + }); +} + +@immutable +class GetBenefitsDataByKeyBenefitsDataStaff { + final String id; + final String fullName; + GetBenefitsDataByKeyBenefitsDataStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetBenefitsDataByKeyBenefitsDataStaff otherTyped = other as GetBenefitsDataByKeyBenefitsDataStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + GetBenefitsDataByKeyBenefitsDataStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class GetBenefitsDataByKeyBenefitsDataVendorBenefitPlan { + final String id; + final String vendorId; + final String title; + final String? description; + final String? requestLabel; + final int? total; + final bool? isActive; + GetBenefitsDataByKeyBenefitsDataVendorBenefitPlan.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + title = nativeFromJson(json['title']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + requestLabel = json['requestLabel'] == null ? null : nativeFromJson(json['requestLabel']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetBenefitsDataByKeyBenefitsDataVendorBenefitPlan otherTyped = other as GetBenefitsDataByKeyBenefitsDataVendorBenefitPlan; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + title == otherTyped.title && + description == otherTyped.description && + requestLabel == otherTyped.requestLabel && + total == otherTyped.total && + isActive == otherTyped.isActive; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, title.hashCode, description.hashCode, requestLabel.hashCode, total.hashCode, isActive.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + json['title'] = nativeToJson(title); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (requestLabel != null) { + json['requestLabel'] = nativeToJson(requestLabel); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + return json; + } + + GetBenefitsDataByKeyBenefitsDataVendorBenefitPlan({ + required this.id, + required this.vendorId, + required this.title, + this.description, + this.requestLabel, + this.total, + this.isActive, + }); +} + +@immutable +class GetBenefitsDataByKeyData { + final GetBenefitsDataByKeyBenefitsData? benefitsData; + GetBenefitsDataByKeyData.fromJson(dynamic json): + + benefitsData = json['benefitsData'] == null ? null : GetBenefitsDataByKeyBenefitsData.fromJson(json['benefitsData']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetBenefitsDataByKeyData otherTyped = other as GetBenefitsDataByKeyData; + return benefitsData == otherTyped.benefitsData; + + } + @override + int get hashCode => benefitsData.hashCode; + + + Map toJson() { + Map json = {}; + if (benefitsData != null) { + json['benefitsData'] = benefitsData!.toJson(); + } + return json; + } + + GetBenefitsDataByKeyData({ + this.benefitsData, + }); +} + +@immutable +class GetBenefitsDataByKeyVariables { + final String staffId; + final String vendorBenefitPlanId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetBenefitsDataByKeyVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + vendorBenefitPlanId = nativeFromJson(json['vendorBenefitPlanId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetBenefitsDataByKeyVariables otherTyped = other as GetBenefitsDataByKeyVariables; + return staffId == otherTyped.staffId && + vendorBenefitPlanId == otherTyped.vendorBenefitPlanId; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, vendorBenefitPlanId.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['vendorBenefitPlanId'] = nativeToJson(vendorBenefitPlanId); + return json; + } + + GetBenefitsDataByKeyVariables({ + required this.staffId, + required this.vendorBenefitPlanId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_business_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_business_by_id.dart new file mode 100644 index 00000000..50ee46b0 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_business_by_id.dart @@ -0,0 +1,236 @@ +part of 'generated.dart'; + +class GetBusinessByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetBusinessByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetBusinessByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetBusinessByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetBusinessByIdVariables vars= GetBusinessByIdVariables(id: id,); + return _dataConnect.query("getBusinessById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetBusinessByIdBusiness { + final String id; + final String businessName; + final String? contactName; + final String userId; + final String? companyLogoUrl; + final String? phone; + final String? email; + final String? hubBuilding; + final String? address; + final String? city; + final EnumValue? area; + final EnumValue? sector; + final EnumValue rateGroup; + final EnumValue status; + final String? notes; + final Timestamp? createdAt; + final Timestamp? updatedAt; + GetBusinessByIdBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']), + userId = nativeFromJson(json['userId']), + companyLogoUrl = json['companyLogoUrl'] == null ? null : nativeFromJson(json['companyLogoUrl']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + hubBuilding = json['hubBuilding'] == null ? null : nativeFromJson(json['hubBuilding']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + city = json['city'] == null ? null : nativeFromJson(json['city']), + area = json['area'] == null ? null : businessAreaDeserializer(json['area']), + sector = json['sector'] == null ? null : businessSectorDeserializer(json['sector']), + rateGroup = businessRateGroupDeserializer(json['rateGroup']), + status = businessStatusDeserializer(json['status']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetBusinessByIdBusiness otherTyped = other as GetBusinessByIdBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + contactName == otherTyped.contactName && + userId == otherTyped.userId && + companyLogoUrl == otherTyped.companyLogoUrl && + phone == otherTyped.phone && + email == otherTyped.email && + hubBuilding == otherTyped.hubBuilding && + address == otherTyped.address && + city == otherTyped.city && + area == otherTyped.area && + sector == otherTyped.sector && + rateGroup == otherTyped.rateGroup && + status == otherTyped.status && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, contactName.hashCode, userId.hashCode, companyLogoUrl.hashCode, phone.hashCode, email.hashCode, hubBuilding.hashCode, address.hashCode, city.hashCode, area.hashCode, sector.hashCode, rateGroup.hashCode, status.hashCode, notes.hashCode, createdAt.hashCode, updatedAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + json['userId'] = nativeToJson(userId); + if (companyLogoUrl != null) { + json['companyLogoUrl'] = nativeToJson(companyLogoUrl); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (hubBuilding != null) { + json['hubBuilding'] = nativeToJson(hubBuilding); + } + if (address != null) { + json['address'] = nativeToJson(address); + } + if (city != null) { + json['city'] = nativeToJson(city); + } + if (area != null) { + json['area'] = + businessAreaSerializer(area!) + ; + } + if (sector != null) { + json['sector'] = + businessSectorSerializer(sector!) + ; + } + json['rateGroup'] = + businessRateGroupSerializer(rateGroup) + ; + json['status'] = + businessStatusSerializer(status) + ; + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + return json; + } + + GetBusinessByIdBusiness({ + required this.id, + required this.businessName, + this.contactName, + required this.userId, + this.companyLogoUrl, + this.phone, + this.email, + this.hubBuilding, + this.address, + this.city, + this.area, + this.sector, + required this.rateGroup, + required this.status, + this.notes, + this.createdAt, + this.updatedAt, + }); +} + +@immutable +class GetBusinessByIdData { + final GetBusinessByIdBusiness? business; + GetBusinessByIdData.fromJson(dynamic json): + + business = json['business'] == null ? null : GetBusinessByIdBusiness.fromJson(json['business']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetBusinessByIdData otherTyped = other as GetBusinessByIdData; + return business == otherTyped.business; + + } + @override + int get hashCode => business.hashCode; + + + Map toJson() { + Map json = {}; + if (business != null) { + json['business'] = business!.toJson(); + } + return json; + } + + GetBusinessByIdData({ + this.business, + }); +} + +@immutable +class GetBusinessByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetBusinessByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetBusinessByIdVariables otherTyped = other as GetBusinessByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetBusinessByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_businesses_by_user_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_businesses_by_user_id.dart new file mode 100644 index 00000000..850b697a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_businesses_by_user_id.dart @@ -0,0 +1,236 @@ +part of 'generated.dart'; + +class GetBusinessesByUserIdVariablesBuilder { + String userId; + + final FirebaseDataConnect _dataConnect; + GetBusinessesByUserIdVariablesBuilder(this._dataConnect, {required this.userId,}); + Deserializer dataDeserializer = (dynamic json) => GetBusinessesByUserIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetBusinessesByUserIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetBusinessesByUserIdVariables vars= GetBusinessesByUserIdVariables(userId: userId,); + return _dataConnect.query("getBusinessesByUserId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetBusinessesByUserIdBusinesses { + final String id; + final String businessName; + final String? contactName; + final String userId; + final String? companyLogoUrl; + final String? phone; + final String? email; + final String? hubBuilding; + final String? address; + final String? city; + final EnumValue? area; + final EnumValue? sector; + final EnumValue rateGroup; + final EnumValue status; + final String? notes; + final Timestamp? createdAt; + final Timestamp? updatedAt; + GetBusinessesByUserIdBusinesses.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']), + userId = nativeFromJson(json['userId']), + companyLogoUrl = json['companyLogoUrl'] == null ? null : nativeFromJson(json['companyLogoUrl']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + hubBuilding = json['hubBuilding'] == null ? null : nativeFromJson(json['hubBuilding']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + city = json['city'] == null ? null : nativeFromJson(json['city']), + area = json['area'] == null ? null : businessAreaDeserializer(json['area']), + sector = json['sector'] == null ? null : businessSectorDeserializer(json['sector']), + rateGroup = businessRateGroupDeserializer(json['rateGroup']), + status = businessStatusDeserializer(json['status']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetBusinessesByUserIdBusinesses otherTyped = other as GetBusinessesByUserIdBusinesses; + return id == otherTyped.id && + businessName == otherTyped.businessName && + contactName == otherTyped.contactName && + userId == otherTyped.userId && + companyLogoUrl == otherTyped.companyLogoUrl && + phone == otherTyped.phone && + email == otherTyped.email && + hubBuilding == otherTyped.hubBuilding && + address == otherTyped.address && + city == otherTyped.city && + area == otherTyped.area && + sector == otherTyped.sector && + rateGroup == otherTyped.rateGroup && + status == otherTyped.status && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, contactName.hashCode, userId.hashCode, companyLogoUrl.hashCode, phone.hashCode, email.hashCode, hubBuilding.hashCode, address.hashCode, city.hashCode, area.hashCode, sector.hashCode, rateGroup.hashCode, status.hashCode, notes.hashCode, createdAt.hashCode, updatedAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + json['userId'] = nativeToJson(userId); + if (companyLogoUrl != null) { + json['companyLogoUrl'] = nativeToJson(companyLogoUrl); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (hubBuilding != null) { + json['hubBuilding'] = nativeToJson(hubBuilding); + } + if (address != null) { + json['address'] = nativeToJson(address); + } + if (city != null) { + json['city'] = nativeToJson(city); + } + if (area != null) { + json['area'] = + businessAreaSerializer(area!) + ; + } + if (sector != null) { + json['sector'] = + businessSectorSerializer(sector!) + ; + } + json['rateGroup'] = + businessRateGroupSerializer(rateGroup) + ; + json['status'] = + businessStatusSerializer(status) + ; + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + return json; + } + + GetBusinessesByUserIdBusinesses({ + required this.id, + required this.businessName, + this.contactName, + required this.userId, + this.companyLogoUrl, + this.phone, + this.email, + this.hubBuilding, + this.address, + this.city, + this.area, + this.sector, + required this.rateGroup, + required this.status, + this.notes, + this.createdAt, + this.updatedAt, + }); +} + +@immutable +class GetBusinessesByUserIdData { + final List businesses; + GetBusinessesByUserIdData.fromJson(dynamic json): + + businesses = (json['businesses'] as List) + .map((e) => GetBusinessesByUserIdBusinesses.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetBusinessesByUserIdData otherTyped = other as GetBusinessesByUserIdData; + return businesses == otherTyped.businesses; + + } + @override + int get hashCode => businesses.hashCode; + + + Map toJson() { + Map json = {}; + json['businesses'] = businesses.map((e) => e.toJson()).toList(); + return json; + } + + GetBusinessesByUserIdData({ + required this.businesses, + }); +} + +@immutable +class GetBusinessesByUserIdVariables { + final String userId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetBusinessesByUserIdVariables.fromJson(Map json): + + userId = nativeFromJson(json['userId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetBusinessesByUserIdVariables otherTyped = other as GetBusinessesByUserIdVariables; + return userId == otherTyped.userId; + + } + @override + int get hashCode => userId.hashCode; + + + Map toJson() { + Map json = {}; + json['userId'] = nativeToJson(userId); + return json; + } + + GetBusinessesByUserIdVariables({ + required this.userId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_category_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_category_by_id.dart new file mode 100644 index 00000000..ce631bca --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_category_by_id.dart @@ -0,0 +1,162 @@ +part of 'generated.dart'; + +class GetCategoryByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetCategoryByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetCategoryByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetCategoryByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetCategoryByIdVariables vars= GetCategoryByIdVariables(id: id,); + return _dataConnect.query("getCategoryById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetCategoryByIdCategory { + final String id; + final String categoryId; + final String label; + final String? icon; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetCategoryByIdCategory.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + categoryId = nativeFromJson(json['categoryId']), + label = nativeFromJson(json['label']), + icon = json['icon'] == null ? null : nativeFromJson(json['icon']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetCategoryByIdCategory otherTyped = other as GetCategoryByIdCategory; + return id == otherTyped.id && + categoryId == otherTyped.categoryId && + label == otherTyped.label && + icon == otherTyped.icon && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, categoryId.hashCode, label.hashCode, icon.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['categoryId'] = nativeToJson(categoryId); + json['label'] = nativeToJson(label); + if (icon != null) { + json['icon'] = nativeToJson(icon); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetCategoryByIdCategory({ + required this.id, + required this.categoryId, + required this.label, + this.icon, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetCategoryByIdData { + final GetCategoryByIdCategory? category; + GetCategoryByIdData.fromJson(dynamic json): + + category = json['category'] == null ? null : GetCategoryByIdCategory.fromJson(json['category']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetCategoryByIdData otherTyped = other as GetCategoryByIdData; + return category == otherTyped.category; + + } + @override + int get hashCode => category.hashCode; + + + Map toJson() { + Map json = {}; + if (category != null) { + json['category'] = category!.toJson(); + } + return json; + } + + GetCategoryByIdData({ + this.category, + }); +} + +@immutable +class GetCategoryByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetCategoryByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetCategoryByIdVariables otherTyped = other as GetCategoryByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetCategoryByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_certificate_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_certificate_by_id.dart new file mode 100644 index 00000000..c391e609 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_certificate_by_id.dart @@ -0,0 +1,252 @@ +part of 'generated.dart'; + +class GetCertificateByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetCertificateByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetCertificateByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetCertificateByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetCertificateByIdVariables vars= GetCertificateByIdVariables(id: id,); + return _dataConnect.query("getCertificateById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetCertificateByIdCertificate { + final String id; + final String name; + final String? description; + final Timestamp? expiry; + final EnumValue status; + final String? fileUrl; + final String? icon; + final EnumValue? certificationType; + final String? issuer; + final String staffId; + final EnumValue? validationStatus; + final String? certificateNumber; + final Timestamp? updatedAt; + final GetCertificateByIdCertificateStaff staff; + GetCertificateByIdCertificate.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + expiry = json['expiry'] == null ? null : Timestamp.fromJson(json['expiry']), + status = certificateStatusDeserializer(json['status']), + fileUrl = json['fileUrl'] == null ? null : nativeFromJson(json['fileUrl']), + icon = json['icon'] == null ? null : nativeFromJson(json['icon']), + certificationType = json['certificationType'] == null ? null : complianceTypeDeserializer(json['certificationType']), + issuer = json['issuer'] == null ? null : nativeFromJson(json['issuer']), + staffId = nativeFromJson(json['staffId']), + validationStatus = json['validationStatus'] == null ? null : validationStatusDeserializer(json['validationStatus']), + certificateNumber = json['certificateNumber'] == null ? null : nativeFromJson(json['certificateNumber']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + staff = GetCertificateByIdCertificateStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetCertificateByIdCertificate otherTyped = other as GetCertificateByIdCertificate; + return id == otherTyped.id && + name == otherTyped.name && + description == otherTyped.description && + expiry == otherTyped.expiry && + status == otherTyped.status && + fileUrl == otherTyped.fileUrl && + icon == otherTyped.icon && + certificationType == otherTyped.certificationType && + issuer == otherTyped.issuer && + staffId == otherTyped.staffId && + validationStatus == otherTyped.validationStatus && + certificateNumber == otherTyped.certificateNumber && + updatedAt == otherTyped.updatedAt && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, description.hashCode, expiry.hashCode, status.hashCode, fileUrl.hashCode, icon.hashCode, certificationType.hashCode, issuer.hashCode, staffId.hashCode, validationStatus.hashCode, certificateNumber.hashCode, updatedAt.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (expiry != null) { + json['expiry'] = expiry!.toJson(); + } + json['status'] = + certificateStatusSerializer(status) + ; + if (fileUrl != null) { + json['fileUrl'] = nativeToJson(fileUrl); + } + if (icon != null) { + json['icon'] = nativeToJson(icon); + } + if (certificationType != null) { + json['certificationType'] = + complianceTypeSerializer(certificationType!) + ; + } + if (issuer != null) { + json['issuer'] = nativeToJson(issuer); + } + json['staffId'] = nativeToJson(staffId); + if (validationStatus != null) { + json['validationStatus'] = + validationStatusSerializer(validationStatus!) + ; + } + if (certificateNumber != null) { + json['certificateNumber'] = nativeToJson(certificateNumber); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + json['staff'] = staff.toJson(); + return json; + } + + GetCertificateByIdCertificate({ + required this.id, + required this.name, + this.description, + this.expiry, + required this.status, + this.fileUrl, + this.icon, + this.certificationType, + this.issuer, + required this.staffId, + this.validationStatus, + this.certificateNumber, + this.updatedAt, + required this.staff, + }); +} + +@immutable +class GetCertificateByIdCertificateStaff { + final String id; + final String fullName; + GetCertificateByIdCertificateStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetCertificateByIdCertificateStaff otherTyped = other as GetCertificateByIdCertificateStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + GetCertificateByIdCertificateStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class GetCertificateByIdData { + final GetCertificateByIdCertificate? certificate; + GetCertificateByIdData.fromJson(dynamic json): + + certificate = json['certificate'] == null ? null : GetCertificateByIdCertificate.fromJson(json['certificate']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetCertificateByIdData otherTyped = other as GetCertificateByIdData; + return certificate == otherTyped.certificate; + + } + @override + int get hashCode => certificate.hashCode; + + + Map toJson() { + Map json = {}; + if (certificate != null) { + json['certificate'] = certificate!.toJson(); + } + return json; + } + + GetCertificateByIdData({ + this.certificate, + }); +} + +@immutable +class GetCertificateByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetCertificateByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetCertificateByIdVariables otherTyped = other as GetCertificateByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetCertificateByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_client_feedback_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_client_feedback_by_id.dart new file mode 100644 index 00000000..6778c038 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_client_feedback_by_id.dart @@ -0,0 +1,250 @@ +part of 'generated.dart'; + +class GetClientFeedbackByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetClientFeedbackByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetClientFeedbackByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetClientFeedbackByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetClientFeedbackByIdVariables vars= GetClientFeedbackByIdVariables(id: id,); + return _dataConnect.query("getClientFeedbackById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetClientFeedbackByIdClientFeedback { + final String id; + final String businessId; + final String vendorId; + final int? rating; + final String? comment; + final Timestamp? date; + final Timestamp? createdAt; + final GetClientFeedbackByIdClientFeedbackBusiness business; + final GetClientFeedbackByIdClientFeedbackVendor vendor; + GetClientFeedbackByIdClientFeedback.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessId = nativeFromJson(json['businessId']), + vendorId = nativeFromJson(json['vendorId']), + rating = json['rating'] == null ? null : nativeFromJson(json['rating']), + comment = json['comment'] == null ? null : nativeFromJson(json['comment']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + business = GetClientFeedbackByIdClientFeedbackBusiness.fromJson(json['business']), + vendor = GetClientFeedbackByIdClientFeedbackVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetClientFeedbackByIdClientFeedback otherTyped = other as GetClientFeedbackByIdClientFeedback; + return id == otherTyped.id && + businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + rating == otherTyped.rating && + comment == otherTyped.comment && + date == otherTyped.date && + createdAt == otherTyped.createdAt && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessId.hashCode, vendorId.hashCode, rating.hashCode, comment.hashCode, date.hashCode, createdAt.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessId'] = nativeToJson(businessId); + json['vendorId'] = nativeToJson(vendorId); + if (rating != null) { + json['rating'] = nativeToJson(rating); + } + if (comment != null) { + json['comment'] = nativeToJson(comment); + } + if (date != null) { + json['date'] = date!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + return json; + } + + GetClientFeedbackByIdClientFeedback({ + required this.id, + required this.businessId, + required this.vendorId, + this.rating, + this.comment, + this.date, + this.createdAt, + required this.business, + required this.vendor, + }); +} + +@immutable +class GetClientFeedbackByIdClientFeedbackBusiness { + final String id; + final String businessName; + GetClientFeedbackByIdClientFeedbackBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetClientFeedbackByIdClientFeedbackBusiness otherTyped = other as GetClientFeedbackByIdClientFeedbackBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + GetClientFeedbackByIdClientFeedbackBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class GetClientFeedbackByIdClientFeedbackVendor { + final String id; + final String companyName; + GetClientFeedbackByIdClientFeedbackVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetClientFeedbackByIdClientFeedbackVendor otherTyped = other as GetClientFeedbackByIdClientFeedbackVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetClientFeedbackByIdClientFeedbackVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetClientFeedbackByIdData { + final GetClientFeedbackByIdClientFeedback? clientFeedback; + GetClientFeedbackByIdData.fromJson(dynamic json): + + clientFeedback = json['clientFeedback'] == null ? null : GetClientFeedbackByIdClientFeedback.fromJson(json['clientFeedback']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetClientFeedbackByIdData otherTyped = other as GetClientFeedbackByIdData; + return clientFeedback == otherTyped.clientFeedback; + + } + @override + int get hashCode => clientFeedback.hashCode; + + + Map toJson() { + Map json = {}; + if (clientFeedback != null) { + json['clientFeedback'] = clientFeedback!.toJson(); + } + return json; + } + + GetClientFeedbackByIdData({ + this.clientFeedback, + }); +} + +@immutable +class GetClientFeedbackByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetClientFeedbackByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetClientFeedbackByIdVariables otherTyped = other as GetClientFeedbackByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetClientFeedbackByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_conversation_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_conversation_by_id.dart new file mode 100644 index 00000000..4b1892f0 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_conversation_by_id.dart @@ -0,0 +1,184 @@ +part of 'generated.dart'; + +class GetConversationByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetConversationByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetConversationByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetConversationByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetConversationByIdVariables vars= GetConversationByIdVariables(id: id,); + return _dataConnect.query("getConversationById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetConversationByIdConversation { + final String id; + final String? subject; + final EnumValue? status; + final EnumValue? conversationType; + final bool? isGroup; + final String? groupName; + final String? lastMessage; + final Timestamp? lastMessageAt; + final Timestamp? createdAt; + GetConversationByIdConversation.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + subject = json['subject'] == null ? null : nativeFromJson(json['subject']), + status = json['status'] == null ? null : conversationStatusDeserializer(json['status']), + conversationType = json['conversationType'] == null ? null : conversationTypeDeserializer(json['conversationType']), + isGroup = json['isGroup'] == null ? null : nativeFromJson(json['isGroup']), + groupName = json['groupName'] == null ? null : nativeFromJson(json['groupName']), + lastMessage = json['lastMessage'] == null ? null : nativeFromJson(json['lastMessage']), + lastMessageAt = json['lastMessageAt'] == null ? null : Timestamp.fromJson(json['lastMessageAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetConversationByIdConversation otherTyped = other as GetConversationByIdConversation; + return id == otherTyped.id && + subject == otherTyped.subject && + status == otherTyped.status && + conversationType == otherTyped.conversationType && + isGroup == otherTyped.isGroup && + groupName == otherTyped.groupName && + lastMessage == otherTyped.lastMessage && + lastMessageAt == otherTyped.lastMessageAt && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, subject.hashCode, status.hashCode, conversationType.hashCode, isGroup.hashCode, groupName.hashCode, lastMessage.hashCode, lastMessageAt.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (subject != null) { + json['subject'] = nativeToJson(subject); + } + if (status != null) { + json['status'] = + conversationStatusSerializer(status!) + ; + } + if (conversationType != null) { + json['conversationType'] = + conversationTypeSerializer(conversationType!) + ; + } + if (isGroup != null) { + json['isGroup'] = nativeToJson(isGroup); + } + if (groupName != null) { + json['groupName'] = nativeToJson(groupName); + } + if (lastMessage != null) { + json['lastMessage'] = nativeToJson(lastMessage); + } + if (lastMessageAt != null) { + json['lastMessageAt'] = lastMessageAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + GetConversationByIdConversation({ + required this.id, + this.subject, + this.status, + this.conversationType, + this.isGroup, + this.groupName, + this.lastMessage, + this.lastMessageAt, + this.createdAt, + }); +} + +@immutable +class GetConversationByIdData { + final GetConversationByIdConversation? conversation; + GetConversationByIdData.fromJson(dynamic json): + + conversation = json['conversation'] == null ? null : GetConversationByIdConversation.fromJson(json['conversation']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetConversationByIdData otherTyped = other as GetConversationByIdData; + return conversation == otherTyped.conversation; + + } + @override + int get hashCode => conversation.hashCode; + + + Map toJson() { + Map json = {}; + if (conversation != null) { + json['conversation'] = conversation!.toJson(); + } + return json; + } + + GetConversationByIdData({ + this.conversation, + }); +} + +@immutable +class GetConversationByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetConversationByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetConversationByIdVariables otherTyped = other as GetConversationByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetConversationByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_course_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_course_by_id.dart new file mode 100644 index 00000000..c68626ad --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_course_by_id.dart @@ -0,0 +1,229 @@ +part of 'generated.dart'; + +class GetCourseByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetCourseByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetCourseByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetCourseByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetCourseByIdVariables vars= GetCourseByIdVariables(id: id,); + return _dataConnect.query("getCourseById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetCourseByIdCourse { + final String id; + final String? title; + final String? description; + final String? thumbnailUrl; + final int? durationMinutes; + final int? xpReward; + final String categoryId; + final String? levelRequired; + final bool? isCertification; + final Timestamp? createdAt; + final GetCourseByIdCourseCategory category; + GetCourseByIdCourse.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = json['title'] == null ? null : nativeFromJson(json['title']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + thumbnailUrl = json['thumbnailUrl'] == null ? null : nativeFromJson(json['thumbnailUrl']), + durationMinutes = json['durationMinutes'] == null ? null : nativeFromJson(json['durationMinutes']), + xpReward = json['xpReward'] == null ? null : nativeFromJson(json['xpReward']), + categoryId = nativeFromJson(json['categoryId']), + levelRequired = json['levelRequired'] == null ? null : nativeFromJson(json['levelRequired']), + isCertification = json['isCertification'] == null ? null : nativeFromJson(json['isCertification']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + category = GetCourseByIdCourseCategory.fromJson(json['category']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetCourseByIdCourse otherTyped = other as GetCourseByIdCourse; + return id == otherTyped.id && + title == otherTyped.title && + description == otherTyped.description && + thumbnailUrl == otherTyped.thumbnailUrl && + durationMinutes == otherTyped.durationMinutes && + xpReward == otherTyped.xpReward && + categoryId == otherTyped.categoryId && + levelRequired == otherTyped.levelRequired && + isCertification == otherTyped.isCertification && + createdAt == otherTyped.createdAt && + category == otherTyped.category; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, description.hashCode, thumbnailUrl.hashCode, durationMinutes.hashCode, xpReward.hashCode, categoryId.hashCode, levelRequired.hashCode, isCertification.hashCode, createdAt.hashCode, category.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (title != null) { + json['title'] = nativeToJson(title); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + if (thumbnailUrl != null) { + json['thumbnailUrl'] = nativeToJson(thumbnailUrl); + } + if (durationMinutes != null) { + json['durationMinutes'] = nativeToJson(durationMinutes); + } + if (xpReward != null) { + json['xpReward'] = nativeToJson(xpReward); + } + json['categoryId'] = nativeToJson(categoryId); + if (levelRequired != null) { + json['levelRequired'] = nativeToJson(levelRequired); + } + if (isCertification != null) { + json['isCertification'] = nativeToJson(isCertification); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['category'] = category.toJson(); + return json; + } + + GetCourseByIdCourse({ + required this.id, + this.title, + this.description, + this.thumbnailUrl, + this.durationMinutes, + this.xpReward, + required this.categoryId, + this.levelRequired, + this.isCertification, + this.createdAt, + required this.category, + }); +} + +@immutable +class GetCourseByIdCourseCategory { + final String id; + final String label; + GetCourseByIdCourseCategory.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + label = nativeFromJson(json['label']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetCourseByIdCourseCategory otherTyped = other as GetCourseByIdCourseCategory; + return id == otherTyped.id && + label == otherTyped.label; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, label.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['label'] = nativeToJson(label); + return json; + } + + GetCourseByIdCourseCategory({ + required this.id, + required this.label, + }); +} + +@immutable +class GetCourseByIdData { + final GetCourseByIdCourse? course; + GetCourseByIdData.fromJson(dynamic json): + + course = json['course'] == null ? null : GetCourseByIdCourse.fromJson(json['course']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetCourseByIdData otherTyped = other as GetCourseByIdData; + return course == otherTyped.course; + + } + @override + int get hashCode => course.hashCode; + + + Map toJson() { + Map json = {}; + if (course != null) { + json['course'] = course!.toJson(); + } + return json; + } + + GetCourseByIdData({ + this.course, + }); +} + +@immutable +class GetCourseByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetCourseByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetCourseByIdVariables otherTyped = other as GetCourseByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetCourseByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_custom_rate_card_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_custom_rate_card_by_id.dart new file mode 100644 index 00000000..d763bf21 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_custom_rate_card_by_id.dart @@ -0,0 +1,164 @@ +part of 'generated.dart'; + +class GetCustomRateCardByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetCustomRateCardByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetCustomRateCardByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetCustomRateCardByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetCustomRateCardByIdVariables vars= GetCustomRateCardByIdVariables(id: id,); + return _dataConnect.query("getCustomRateCardById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetCustomRateCardByIdCustomRateCard { + final String id; + final String name; + final String? baseBook; + final double? discount; + final bool? isDefault; + final Timestamp? createdAt; + final Timestamp? updatedAt; + GetCustomRateCardByIdCustomRateCard.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + baseBook = json['baseBook'] == null ? null : nativeFromJson(json['baseBook']), + discount = json['discount'] == null ? null : nativeFromJson(json['discount']), + isDefault = json['isDefault'] == null ? null : nativeFromJson(json['isDefault']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetCustomRateCardByIdCustomRateCard otherTyped = other as GetCustomRateCardByIdCustomRateCard; + return id == otherTyped.id && + name == otherTyped.name && + baseBook == otherTyped.baseBook && + discount == otherTyped.discount && + isDefault == otherTyped.isDefault && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, baseBook.hashCode, discount.hashCode, isDefault.hashCode, createdAt.hashCode, updatedAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + if (baseBook != null) { + json['baseBook'] = nativeToJson(baseBook); + } + if (discount != null) { + json['discount'] = nativeToJson(discount); + } + if (isDefault != null) { + json['isDefault'] = nativeToJson(isDefault); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + return json; + } + + GetCustomRateCardByIdCustomRateCard({ + required this.id, + required this.name, + this.baseBook, + this.discount, + this.isDefault, + this.createdAt, + this.updatedAt, + }); +} + +@immutable +class GetCustomRateCardByIdData { + final GetCustomRateCardByIdCustomRateCard? customRateCard; + GetCustomRateCardByIdData.fromJson(dynamic json): + + customRateCard = json['customRateCard'] == null ? null : GetCustomRateCardByIdCustomRateCard.fromJson(json['customRateCard']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetCustomRateCardByIdData otherTyped = other as GetCustomRateCardByIdData; + return customRateCard == otherTyped.customRateCard; + + } + @override + int get hashCode => customRateCard.hashCode; + + + Map toJson() { + Map json = {}; + if (customRateCard != null) { + json['customRateCard'] = customRateCard!.toJson(); + } + return json; + } + + GetCustomRateCardByIdData({ + this.customRateCard, + }); +} + +@immutable +class GetCustomRateCardByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetCustomRateCardByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetCustomRateCardByIdVariables otherTyped = other as GetCustomRateCardByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetCustomRateCardByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_document_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_document_by_id.dart new file mode 100644 index 00000000..c75831d6 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_document_by_id.dart @@ -0,0 +1,150 @@ +part of 'generated.dart'; + +class GetDocumentByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetDocumentByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetDocumentByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetDocumentByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetDocumentByIdVariables vars= GetDocumentByIdVariables(id: id,); + return _dataConnect.query("getDocumentById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetDocumentByIdDocument { + final String id; + final EnumValue documentType; + final String name; + final String? description; + final Timestamp? createdAt; + GetDocumentByIdDocument.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + documentType = documentTypeDeserializer(json['documentType']), + name = nativeFromJson(json['name']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetDocumentByIdDocument otherTyped = other as GetDocumentByIdDocument; + return id == otherTyped.id && + documentType == otherTyped.documentType && + name == otherTyped.name && + description == otherTyped.description && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, documentType.hashCode, name.hashCode, description.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['documentType'] = + documentTypeSerializer(documentType) + ; + json['name'] = nativeToJson(name); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + GetDocumentByIdDocument({ + required this.id, + required this.documentType, + required this.name, + this.description, + this.createdAt, + }); +} + +@immutable +class GetDocumentByIdData { + final GetDocumentByIdDocument? document; + GetDocumentByIdData.fromJson(dynamic json): + + document = json['document'] == null ? null : GetDocumentByIdDocument.fromJson(json['document']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetDocumentByIdData otherTyped = other as GetDocumentByIdData; + return document == otherTyped.document; + + } + @override + int get hashCode => document.hashCode; + + + Map toJson() { + Map json = {}; + if (document != null) { + json['document'] = document!.toJson(); + } + return json; + } + + GetDocumentByIdData({ + this.document, + }); +} + +@immutable +class GetDocumentByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetDocumentByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetDocumentByIdVariables otherTyped = other as GetDocumentByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetDocumentByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_emergency_contact_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_emergency_contact_by_id.dart new file mode 100644 index 00000000..f2ecd85f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_emergency_contact_by_id.dart @@ -0,0 +1,167 @@ +part of 'generated.dart'; + +class GetEmergencyContactByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetEmergencyContactByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetEmergencyContactByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetEmergencyContactByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetEmergencyContactByIdVariables vars= GetEmergencyContactByIdVariables(id: id,); + return _dataConnect.query("getEmergencyContactById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetEmergencyContactByIdEmergencyContact { + final String id; + final String name; + final String phone; + final EnumValue relationship; + final String staffId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetEmergencyContactByIdEmergencyContact.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + phone = nativeFromJson(json['phone']), + relationship = relationshipTypeDeserializer(json['relationship']), + staffId = nativeFromJson(json['staffId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetEmergencyContactByIdEmergencyContact otherTyped = other as GetEmergencyContactByIdEmergencyContact; + return id == otherTyped.id && + name == otherTyped.name && + phone == otherTyped.phone && + relationship == otherTyped.relationship && + staffId == otherTyped.staffId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, phone.hashCode, relationship.hashCode, staffId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['phone'] = nativeToJson(phone); + json['relationship'] = + relationshipTypeSerializer(relationship) + ; + json['staffId'] = nativeToJson(staffId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetEmergencyContactByIdEmergencyContact({ + required this.id, + required this.name, + required this.phone, + required this.relationship, + required this.staffId, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetEmergencyContactByIdData { + final GetEmergencyContactByIdEmergencyContact? emergencyContact; + GetEmergencyContactByIdData.fromJson(dynamic json): + + emergencyContact = json['emergencyContact'] == null ? null : GetEmergencyContactByIdEmergencyContact.fromJson(json['emergencyContact']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetEmergencyContactByIdData otherTyped = other as GetEmergencyContactByIdData; + return emergencyContact == otherTyped.emergencyContact; + + } + @override + int get hashCode => emergencyContact.hashCode; + + + Map toJson() { + Map json = {}; + if (emergencyContact != null) { + json['emergencyContact'] = emergencyContact!.toJson(); + } + return json; + } + + GetEmergencyContactByIdData({ + this.emergencyContact, + }); +} + +@immutable +class GetEmergencyContactByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetEmergencyContactByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetEmergencyContactByIdVariables otherTyped = other as GetEmergencyContactByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetEmergencyContactByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_emergency_contacts_by_staff_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_emergency_contacts_by_staff_id.dart new file mode 100644 index 00000000..e052eaa6 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_emergency_contacts_by_staff_id.dart @@ -0,0 +1,167 @@ +part of 'generated.dart'; + +class GetEmergencyContactsByStaffIdVariablesBuilder { + String staffId; + + final FirebaseDataConnect _dataConnect; + GetEmergencyContactsByStaffIdVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => GetEmergencyContactsByStaffIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetEmergencyContactsByStaffIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetEmergencyContactsByStaffIdVariables vars= GetEmergencyContactsByStaffIdVariables(staffId: staffId,); + return _dataConnect.query("getEmergencyContactsByStaffId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetEmergencyContactsByStaffIdEmergencyContacts { + final String id; + final String name; + final String phone; + final EnumValue relationship; + final String staffId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetEmergencyContactsByStaffIdEmergencyContacts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + phone = nativeFromJson(json['phone']), + relationship = relationshipTypeDeserializer(json['relationship']), + staffId = nativeFromJson(json['staffId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetEmergencyContactsByStaffIdEmergencyContacts otherTyped = other as GetEmergencyContactsByStaffIdEmergencyContacts; + return id == otherTyped.id && + name == otherTyped.name && + phone == otherTyped.phone && + relationship == otherTyped.relationship && + staffId == otherTyped.staffId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, phone.hashCode, relationship.hashCode, staffId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['phone'] = nativeToJson(phone); + json['relationship'] = + relationshipTypeSerializer(relationship) + ; + json['staffId'] = nativeToJson(staffId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetEmergencyContactsByStaffIdEmergencyContacts({ + required this.id, + required this.name, + required this.phone, + required this.relationship, + required this.staffId, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetEmergencyContactsByStaffIdData { + final List emergencyContacts; + GetEmergencyContactsByStaffIdData.fromJson(dynamic json): + + emergencyContacts = (json['emergencyContacts'] as List) + .map((e) => GetEmergencyContactsByStaffIdEmergencyContacts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetEmergencyContactsByStaffIdData otherTyped = other as GetEmergencyContactsByStaffIdData; + return emergencyContacts == otherTyped.emergencyContacts; + + } + @override + int get hashCode => emergencyContacts.hashCode; + + + Map toJson() { + Map json = {}; + json['emergencyContacts'] = emergencyContacts.map((e) => e.toJson()).toList(); + return json; + } + + GetEmergencyContactsByStaffIdData({ + required this.emergencyContacts, + }); +} + +@immutable +class GetEmergencyContactsByStaffIdVariables { + final String staffId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetEmergencyContactsByStaffIdVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetEmergencyContactsByStaffIdVariables otherTyped = other as GetEmergencyContactsByStaffIdVariables; + return staffId == otherTyped.staffId; + + } + @override + int get hashCode => staffId.hashCode; + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + return json; + } + + GetEmergencyContactsByStaffIdVariables({ + required this.staffId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_faq_data_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_faq_data_by_id.dart new file mode 100644 index 00000000..c6fb22ae --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_faq_data_by_id.dart @@ -0,0 +1,159 @@ +part of 'generated.dart'; + +class GetFaqDataByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetFaqDataByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetFaqDataByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetFaqDataByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetFaqDataByIdVariables vars= GetFaqDataByIdVariables(id: id,); + return _dataConnect.query("getFaqDataById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetFaqDataByIdFaqData { + final String id; + final String category; + final List? questions; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetFaqDataByIdFaqData.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + category = nativeFromJson(json['category']), + questions = json['questions'] == null ? null : (json['questions'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetFaqDataByIdFaqData otherTyped = other as GetFaqDataByIdFaqData; + return id == otherTyped.id && + category == otherTyped.category && + questions == otherTyped.questions && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, category.hashCode, questions.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['category'] = nativeToJson(category); + if (questions != null) { + json['questions'] = questions?.map((e) => e!.toJson()).toList(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetFaqDataByIdFaqData({ + required this.id, + required this.category, + this.questions, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetFaqDataByIdData { + final GetFaqDataByIdFaqData? faqData; + GetFaqDataByIdData.fromJson(dynamic json): + + faqData = json['faqData'] == null ? null : GetFaqDataByIdFaqData.fromJson(json['faqData']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetFaqDataByIdData otherTyped = other as GetFaqDataByIdData; + return faqData == otherTyped.faqData; + + } + @override + int get hashCode => faqData.hashCode; + + + Map toJson() { + Map json = {}; + if (faqData != null) { + json['faqData'] = faqData!.toJson(); + } + return json; + } + + GetFaqDataByIdData({ + this.faqData, + }); +} + +@immutable +class GetFaqDataByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetFaqDataByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetFaqDataByIdVariables otherTyped = other as GetFaqDataByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetFaqDataByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_hub_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_hub_by_id.dart new file mode 100644 index 00000000..aad9ede2 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_hub_by_id.dart @@ -0,0 +1,176 @@ +part of 'generated.dart'; + +class GetHubByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetHubByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetHubByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetHubByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetHubByIdVariables vars= GetHubByIdVariables(id: id,); + return _dataConnect.query("getHubById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetHubByIdHub { + final String id; + final String name; + final String? locationName; + final String? address; + final String? nfcTagId; + final String ownerId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetHubByIdHub.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + locationName = json['locationName'] == null ? null : nativeFromJson(json['locationName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + nfcTagId = json['nfcTagId'] == null ? null : nativeFromJson(json['nfcTagId']), + ownerId = nativeFromJson(json['ownerId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetHubByIdHub otherTyped = other as GetHubByIdHub; + return id == otherTyped.id && + name == otherTyped.name && + locationName == otherTyped.locationName && + address == otherTyped.address && + nfcTagId == otherTyped.nfcTagId && + ownerId == otherTyped.ownerId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, locationName.hashCode, address.hashCode, nfcTagId.hashCode, ownerId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + if (locationName != null) { + json['locationName'] = nativeToJson(locationName); + } + if (address != null) { + json['address'] = nativeToJson(address); + } + if (nfcTagId != null) { + json['nfcTagId'] = nativeToJson(nfcTagId); + } + json['ownerId'] = nativeToJson(ownerId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetHubByIdHub({ + required this.id, + required this.name, + this.locationName, + this.address, + this.nfcTagId, + required this.ownerId, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetHubByIdData { + final GetHubByIdHub? hub; + GetHubByIdData.fromJson(dynamic json): + + hub = json['hub'] == null ? null : GetHubByIdHub.fromJson(json['hub']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetHubByIdData otherTyped = other as GetHubByIdData; + return hub == otherTyped.hub; + + } + @override + int get hashCode => hub.hashCode; + + + Map toJson() { + Map json = {}; + if (hub != null) { + json['hub'] = hub!.toJson(); + } + return json; + } + + GetHubByIdData({ + this.hub, + }); +} + +@immutable +class GetHubByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetHubByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetHubByIdVariables otherTyped = other as GetHubByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetHubByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_hubs_by_owner_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_hubs_by_owner_id.dart new file mode 100644 index 00000000..4b280f98 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_hubs_by_owner_id.dart @@ -0,0 +1,176 @@ +part of 'generated.dart'; + +class GetHubsByOwnerIdVariablesBuilder { + String ownerId; + + final FirebaseDataConnect _dataConnect; + GetHubsByOwnerIdVariablesBuilder(this._dataConnect, {required this.ownerId,}); + Deserializer dataDeserializer = (dynamic json) => GetHubsByOwnerIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetHubsByOwnerIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetHubsByOwnerIdVariables vars= GetHubsByOwnerIdVariables(ownerId: ownerId,); + return _dataConnect.query("getHubsByOwnerId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetHubsByOwnerIdHubs { + final String id; + final String name; + final String? locationName; + final String? address; + final String? nfcTagId; + final String ownerId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetHubsByOwnerIdHubs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + locationName = json['locationName'] == null ? null : nativeFromJson(json['locationName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + nfcTagId = json['nfcTagId'] == null ? null : nativeFromJson(json['nfcTagId']), + ownerId = nativeFromJson(json['ownerId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetHubsByOwnerIdHubs otherTyped = other as GetHubsByOwnerIdHubs; + return id == otherTyped.id && + name == otherTyped.name && + locationName == otherTyped.locationName && + address == otherTyped.address && + nfcTagId == otherTyped.nfcTagId && + ownerId == otherTyped.ownerId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, locationName.hashCode, address.hashCode, nfcTagId.hashCode, ownerId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + if (locationName != null) { + json['locationName'] = nativeToJson(locationName); + } + if (address != null) { + json['address'] = nativeToJson(address); + } + if (nfcTagId != null) { + json['nfcTagId'] = nativeToJson(nfcTagId); + } + json['ownerId'] = nativeToJson(ownerId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetHubsByOwnerIdHubs({ + required this.id, + required this.name, + this.locationName, + this.address, + this.nfcTagId, + required this.ownerId, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetHubsByOwnerIdData { + final List hubs; + GetHubsByOwnerIdData.fromJson(dynamic json): + + hubs = (json['hubs'] as List) + .map((e) => GetHubsByOwnerIdHubs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetHubsByOwnerIdData otherTyped = other as GetHubsByOwnerIdData; + return hubs == otherTyped.hubs; + + } + @override + int get hashCode => hubs.hashCode; + + + Map toJson() { + Map json = {}; + json['hubs'] = hubs.map((e) => e.toJson()).toList(); + return json; + } + + GetHubsByOwnerIdData({ + required this.hubs, + }); +} + +@immutable +class GetHubsByOwnerIdVariables { + final String ownerId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetHubsByOwnerIdVariables.fromJson(Map json): + + ownerId = nativeFromJson(json['ownerId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetHubsByOwnerIdVariables otherTyped = other as GetHubsByOwnerIdVariables; + return ownerId == otherTyped.ownerId; + + } + @override + int get hashCode => ownerId.hashCode; + + + Map toJson() { + Map json = {}; + json['ownerId'] = nativeToJson(ownerId); + return json; + } + + GetHubsByOwnerIdVariables({ + required this.ownerId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_invoice_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_invoice_by_id.dart new file mode 100644 index 00000000..f27c8d4c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_invoice_by_id.dart @@ -0,0 +1,448 @@ +part of 'generated.dart'; + +class GetInvoiceByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetInvoiceByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetInvoiceByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetInvoiceByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetInvoiceByIdVariables vars= GetInvoiceByIdVariables(id: id,); + return _dataConnect.query("getInvoiceById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetInvoiceByIdInvoice { + final String id; + final EnumValue status; + final String vendorId; + final String businessId; + final String orderId; + final EnumValue? paymentTerms; + final String invoiceNumber; + final Timestamp issueDate; + final Timestamp dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final AnyValue? disputedItems; + final String? disputeReason; + final String? disputeDetails; + final GetInvoiceByIdInvoiceVendor vendor; + final GetInvoiceByIdInvoiceBusiness business; + final GetInvoiceByIdInvoiceOrder order; + GetInvoiceByIdInvoice.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + status = invoiceStatusDeserializer(json['status']), + vendorId = nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderId = nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsDeserializer(json['paymentTerms']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + issueDate = Timestamp.fromJson(json['issueDate']), + dueDate = Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + disputedItems = json['disputedItems'] == null ? null : AnyValue.fromJson(json['disputedItems']), + disputeReason = json['disputeReason'] == null ? null : nativeFromJson(json['disputeReason']), + disputeDetails = json['disputeDetails'] == null ? null : nativeFromJson(json['disputeDetails']), + vendor = GetInvoiceByIdInvoiceVendor.fromJson(json['vendor']), + business = GetInvoiceByIdInvoiceBusiness.fromJson(json['business']), + order = GetInvoiceByIdInvoiceOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetInvoiceByIdInvoice otherTyped = other as GetInvoiceByIdInvoice; + return id == otherTyped.id && + status == otherTyped.status && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + disputedItems == otherTyped.disputedItems && + disputeReason == otherTyped.disputeReason && + disputeDetails == otherTyped.disputeDetails && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, status.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, disputedItems.hashCode, disputeReason.hashCode, disputeDetails.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['status'] = + invoiceStatusSerializer(status) + ; + json['vendorId'] = nativeToJson(vendorId); + json['businessId'] = nativeToJson(businessId); + json['orderId'] = nativeToJson(orderId); + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsSerializer(paymentTerms!) + ; + } + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['issueDate'] = issueDate.toJson(); + json['dueDate'] = dueDate.toJson(); + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + json['amount'] = nativeToJson(amount); + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (disputedItems != null) { + json['disputedItems'] = disputedItems!.toJson(); + } + if (disputeReason != null) { + json['disputeReason'] = nativeToJson(disputeReason); + } + if (disputeDetails != null) { + json['disputeDetails'] = nativeToJson(disputeDetails); + } + json['vendor'] = vendor.toJson(); + json['business'] = business.toJson(); + json['order'] = order.toJson(); + return json; + } + + GetInvoiceByIdInvoice({ + required this.id, + required this.status, + required this.vendorId, + required this.businessId, + required this.orderId, + this.paymentTerms, + required this.invoiceNumber, + required this.issueDate, + required this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + required this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.disputedItems, + this.disputeReason, + this.disputeDetails, + required this.vendor, + required this.business, + required this.order, + }); +} + +@immutable +class GetInvoiceByIdInvoiceVendor { + final String companyName; + final String? address; + final String? email; + final String? phone; + GetInvoiceByIdInvoiceVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetInvoiceByIdInvoiceVendor otherTyped = other as GetInvoiceByIdInvoiceVendor; + return companyName == otherTyped.companyName && + address == otherTyped.address && + email == otherTyped.email && + phone == otherTyped.phone; + + } + @override + int get hashCode => Object.hashAll([companyName.hashCode, address.hashCode, email.hashCode, phone.hashCode]); + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + return json; + } + + GetInvoiceByIdInvoiceVendor({ + required this.companyName, + this.address, + this.email, + this.phone, + }); +} + +@immutable +class GetInvoiceByIdInvoiceBusiness { + final String businessName; + final String? address; + final String? phone; + final String? email; + GetInvoiceByIdInvoiceBusiness.fromJson(dynamic json): + + businessName = nativeFromJson(json['businessName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetInvoiceByIdInvoiceBusiness otherTyped = other as GetInvoiceByIdInvoiceBusiness; + return businessName == otherTyped.businessName && + address == otherTyped.address && + phone == otherTyped.phone && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([businessName.hashCode, address.hashCode, phone.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessName'] = nativeToJson(businessName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + GetInvoiceByIdInvoiceBusiness({ + required this.businessName, + this.address, + this.phone, + this.email, + }); +} + +@immutable +class GetInvoiceByIdInvoiceOrder { + final String? eventName; + final String? hub; + final String? deparment; + final String? poReference; + GetInvoiceByIdInvoiceOrder.fromJson(dynamic json): + + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + deparment = json['deparment'] == null ? null : nativeFromJson(json['deparment']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetInvoiceByIdInvoiceOrder otherTyped = other as GetInvoiceByIdInvoiceOrder; + return eventName == otherTyped.eventName && + hub == otherTyped.hub && + deparment == otherTyped.deparment && + poReference == otherTyped.poReference; + + } + @override + int get hashCode => Object.hashAll([eventName.hashCode, hub.hashCode, deparment.hashCode, poReference.hashCode]); + + + Map toJson() { + Map json = {}; + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (deparment != null) { + json['deparment'] = nativeToJson(deparment); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + return json; + } + + GetInvoiceByIdInvoiceOrder({ + this.eventName, + this.hub, + this.deparment, + this.poReference, + }); +} + +@immutable +class GetInvoiceByIdData { + final GetInvoiceByIdInvoice? invoice; + GetInvoiceByIdData.fromJson(dynamic json): + + invoice = json['invoice'] == null ? null : GetInvoiceByIdInvoice.fromJson(json['invoice']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetInvoiceByIdData otherTyped = other as GetInvoiceByIdData; + return invoice == otherTyped.invoice; + + } + @override + int get hashCode => invoice.hashCode; + + + Map toJson() { + Map json = {}; + if (invoice != null) { + json['invoice'] = invoice!.toJson(); + } + return json; + } + + GetInvoiceByIdData({ + this.invoice, + }); +} + +@immutable +class GetInvoiceByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetInvoiceByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetInvoiceByIdVariables otherTyped = other as GetInvoiceByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetInvoiceByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_invoice_template_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_invoice_template_by_id.dart new file mode 100644 index 00000000..2688c0f5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_invoice_template_by_id.dart @@ -0,0 +1,451 @@ +part of 'generated.dart'; + +class GetInvoiceTemplateByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetInvoiceTemplateByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetInvoiceTemplateByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetInvoiceTemplateByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetInvoiceTemplateByIdVariables vars= GetInvoiceTemplateByIdVariables(id: id,); + return _dataConnect.query("getInvoiceTemplateById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetInvoiceTemplateByIdInvoiceTemplate { + final String id; + final String name; + final String ownerId; + final String? vendorId; + final String? businessId; + final String? orderId; + final EnumValue? paymentTerms; + final String? invoiceNumber; + final Timestamp? issueDate; + final Timestamp? dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double? amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final GetInvoiceTemplateByIdInvoiceTemplateVendor? vendor; + final GetInvoiceTemplateByIdInvoiceTemplateBusiness? business; + final GetInvoiceTemplateByIdInvoiceTemplateOrder? order; + GetInvoiceTemplateByIdInvoiceTemplate.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + ownerId = nativeFromJson(json['ownerId']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = json['businessId'] == null ? null : nativeFromJson(json['businessId']), + orderId = json['orderId'] == null ? null : nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsTempDeserializer(json['paymentTerms']), + invoiceNumber = json['invoiceNumber'] == null ? null : nativeFromJson(json['invoiceNumber']), + issueDate = json['issueDate'] == null ? null : Timestamp.fromJson(json['issueDate']), + dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = json['amount'] == null ? null : nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + vendor = json['vendor'] == null ? null : GetInvoiceTemplateByIdInvoiceTemplateVendor.fromJson(json['vendor']), + business = json['business'] == null ? null : GetInvoiceTemplateByIdInvoiceTemplateBusiness.fromJson(json['business']), + order = json['order'] == null ? null : GetInvoiceTemplateByIdInvoiceTemplateOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetInvoiceTemplateByIdInvoiceTemplate otherTyped = other as GetInvoiceTemplateByIdInvoiceTemplate; + return id == otherTyped.id && + name == otherTyped.name && + ownerId == otherTyped.ownerId && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, ownerId.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['ownerId'] = nativeToJson(ownerId); + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + if (businessId != null) { + json['businessId'] = nativeToJson(businessId); + } + if (orderId != null) { + json['orderId'] = nativeToJson(orderId); + } + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsTempSerializer(paymentTerms!) + ; + } + if (invoiceNumber != null) { + json['invoiceNumber'] = nativeToJson(invoiceNumber); + } + if (issueDate != null) { + json['issueDate'] = issueDate!.toJson(); + } + if (dueDate != null) { + json['dueDate'] = dueDate!.toJson(); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + if (amount != null) { + json['amount'] = nativeToJson(amount); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + if (business != null) { + json['business'] = business!.toJson(); + } + if (order != null) { + json['order'] = order!.toJson(); + } + return json; + } + + GetInvoiceTemplateByIdInvoiceTemplate({ + required this.id, + required this.name, + required this.ownerId, + this.vendorId, + this.businessId, + this.orderId, + this.paymentTerms, + this.invoiceNumber, + this.issueDate, + this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.createdAt, + this.updatedAt, + this.createdBy, + this.vendor, + this.business, + this.order, + }); +} + +@immutable +class GetInvoiceTemplateByIdInvoiceTemplateVendor { + final String id; + final String companyName; + GetInvoiceTemplateByIdInvoiceTemplateVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetInvoiceTemplateByIdInvoiceTemplateVendor otherTyped = other as GetInvoiceTemplateByIdInvoiceTemplateVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetInvoiceTemplateByIdInvoiceTemplateVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetInvoiceTemplateByIdInvoiceTemplateBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetInvoiceTemplateByIdInvoiceTemplateBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetInvoiceTemplateByIdInvoiceTemplateBusiness otherTyped = other as GetInvoiceTemplateByIdInvoiceTemplateBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetInvoiceTemplateByIdInvoiceTemplateBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetInvoiceTemplateByIdInvoiceTemplateOrder { + final String id; + final String? eventName; + final EnumValue status; + final EnumValue orderType; + GetInvoiceTemplateByIdInvoiceTemplateOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + status = orderStatusDeserializer(json['status']), + orderType = orderTypeDeserializer(json['orderType']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetInvoiceTemplateByIdInvoiceTemplateOrder otherTyped = other as GetInvoiceTemplateByIdInvoiceTemplateOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + status == otherTyped.status && + orderType == otherTyped.orderType; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, status.hashCode, orderType.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['status'] = + orderStatusSerializer(status) + ; + json['orderType'] = + orderTypeSerializer(orderType) + ; + return json; + } + + GetInvoiceTemplateByIdInvoiceTemplateOrder({ + required this.id, + this.eventName, + required this.status, + required this.orderType, + }); +} + +@immutable +class GetInvoiceTemplateByIdData { + final GetInvoiceTemplateByIdInvoiceTemplate? invoiceTemplate; + GetInvoiceTemplateByIdData.fromJson(dynamic json): + + invoiceTemplate = json['invoiceTemplate'] == null ? null : GetInvoiceTemplateByIdInvoiceTemplate.fromJson(json['invoiceTemplate']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetInvoiceTemplateByIdData otherTyped = other as GetInvoiceTemplateByIdData; + return invoiceTemplate == otherTyped.invoiceTemplate; + + } + @override + int get hashCode => invoiceTemplate.hashCode; + + + Map toJson() { + Map json = {}; + if (invoiceTemplate != null) { + json['invoiceTemplate'] = invoiceTemplate!.toJson(); + } + return json; + } + + GetInvoiceTemplateByIdData({ + this.invoiceTemplate, + }); +} + +@immutable +class GetInvoiceTemplateByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetInvoiceTemplateByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetInvoiceTemplateByIdVariables otherTyped = other as GetInvoiceTemplateByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetInvoiceTemplateByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_level_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_level_by_id.dart new file mode 100644 index 00000000..39437a2c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_level_by_id.dart @@ -0,0 +1,169 @@ +part of 'generated.dart'; + +class GetLevelByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetLevelByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetLevelByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetLevelByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetLevelByIdVariables vars= GetLevelByIdVariables(id: id,); + return _dataConnect.query("getLevelById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetLevelByIdLevel { + final String id; + final String name; + final int xpRequired; + final String? icon; + final AnyValue? colors; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetLevelByIdLevel.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + xpRequired = nativeFromJson(json['xpRequired']), + icon = json['icon'] == null ? null : nativeFromJson(json['icon']), + colors = json['colors'] == null ? null : AnyValue.fromJson(json['colors']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetLevelByIdLevel otherTyped = other as GetLevelByIdLevel; + return id == otherTyped.id && + name == otherTyped.name && + xpRequired == otherTyped.xpRequired && + icon == otherTyped.icon && + colors == otherTyped.colors && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, xpRequired.hashCode, icon.hashCode, colors.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['xpRequired'] = nativeToJson(xpRequired); + if (icon != null) { + json['icon'] = nativeToJson(icon); + } + if (colors != null) { + json['colors'] = colors!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetLevelByIdLevel({ + required this.id, + required this.name, + required this.xpRequired, + this.icon, + this.colors, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetLevelByIdData { + final GetLevelByIdLevel? level; + GetLevelByIdData.fromJson(dynamic json): + + level = json['level'] == null ? null : GetLevelByIdLevel.fromJson(json['level']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetLevelByIdData otherTyped = other as GetLevelByIdData; + return level == otherTyped.level; + + } + @override + int get hashCode => level.hashCode; + + + Map toJson() { + Map json = {}; + if (level != null) { + json['level'] = level!.toJson(); + } + return json; + } + + GetLevelByIdData({ + this.level, + }); +} + +@immutable +class GetLevelByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetLevelByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetLevelByIdVariables otherTyped = other as GetLevelByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetLevelByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_member_task_by_id_key.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_member_task_by_id_key.dart new file mode 100644 index 00000000..c5e6c71a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_member_task_by_id_key.dart @@ -0,0 +1,291 @@ +part of 'generated.dart'; + +class GetMemberTaskByIdKeyVariablesBuilder { + String teamMemberId; + String taskId; + + final FirebaseDataConnect _dataConnect; + GetMemberTaskByIdKeyVariablesBuilder(this._dataConnect, {required this.teamMemberId,required this.taskId,}); + Deserializer dataDeserializer = (dynamic json) => GetMemberTaskByIdKeyData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetMemberTaskByIdKeyVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetMemberTaskByIdKeyVariables vars= GetMemberTaskByIdKeyVariables(teamMemberId: teamMemberId,taskId: taskId,); + return _dataConnect.query("getMemberTaskByIdKey", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetMemberTaskByIdKeyMemberTask { + final String id; + final GetMemberTaskByIdKeyMemberTaskTask task; + final GetMemberTaskByIdKeyMemberTaskTeamMember teamMember; + GetMemberTaskByIdKeyMemberTask.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + task = GetMemberTaskByIdKeyMemberTaskTask.fromJson(json['task']), + teamMember = GetMemberTaskByIdKeyMemberTaskTeamMember.fromJson(json['teamMember']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMemberTaskByIdKeyMemberTask otherTyped = other as GetMemberTaskByIdKeyMemberTask; + return id == otherTyped.id && + task == otherTyped.task && + teamMember == otherTyped.teamMember; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, task.hashCode, teamMember.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['task'] = task.toJson(); + json['teamMember'] = teamMember.toJson(); + return json; + } + + GetMemberTaskByIdKeyMemberTask({ + required this.id, + required this.task, + required this.teamMember, + }); +} + +@immutable +class GetMemberTaskByIdKeyMemberTaskTask { + final String id; + final String taskName; + final String? description; + final EnumValue status; + final Timestamp? dueDate; + final int? progress; + final EnumValue priority; + GetMemberTaskByIdKeyMemberTaskTask.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + taskName = nativeFromJson(json['taskName']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + status = taskStatusDeserializer(json['status']), + dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']), + progress = json['progress'] == null ? null : nativeFromJson(json['progress']), + priority = taskPriorityDeserializer(json['priority']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMemberTaskByIdKeyMemberTaskTask otherTyped = other as GetMemberTaskByIdKeyMemberTaskTask; + return id == otherTyped.id && + taskName == otherTyped.taskName && + description == otherTyped.description && + status == otherTyped.status && + dueDate == otherTyped.dueDate && + progress == otherTyped.progress && + priority == otherTyped.priority; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, taskName.hashCode, description.hashCode, status.hashCode, dueDate.hashCode, progress.hashCode, priority.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['taskName'] = nativeToJson(taskName); + if (description != null) { + json['description'] = nativeToJson(description); + } + json['status'] = + taskStatusSerializer(status) + ; + if (dueDate != null) { + json['dueDate'] = dueDate!.toJson(); + } + if (progress != null) { + json['progress'] = nativeToJson(progress); + } + json['priority'] = + taskPrioritySerializer(priority) + ; + return json; + } + + GetMemberTaskByIdKeyMemberTaskTask({ + required this.id, + required this.taskName, + this.description, + required this.status, + this.dueDate, + this.progress, + required this.priority, + }); +} + +@immutable +class GetMemberTaskByIdKeyMemberTaskTeamMember { + final GetMemberTaskByIdKeyMemberTaskTeamMemberUser user; + GetMemberTaskByIdKeyMemberTaskTeamMember.fromJson(dynamic json): + + user = GetMemberTaskByIdKeyMemberTaskTeamMemberUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMemberTaskByIdKeyMemberTaskTeamMember otherTyped = other as GetMemberTaskByIdKeyMemberTaskTeamMember; + return user == otherTyped.user; + + } + @override + int get hashCode => user.hashCode; + + + Map toJson() { + Map json = {}; + json['user'] = user.toJson(); + return json; + } + + GetMemberTaskByIdKeyMemberTaskTeamMember({ + required this.user, + }); +} + +@immutable +class GetMemberTaskByIdKeyMemberTaskTeamMemberUser { + final String? fullName; + final String? email; + GetMemberTaskByIdKeyMemberTaskTeamMemberUser.fromJson(dynamic json): + + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMemberTaskByIdKeyMemberTaskTeamMemberUser otherTyped = other as GetMemberTaskByIdKeyMemberTaskTeamMemberUser; + return fullName == otherTyped.fullName && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([fullName.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + GetMemberTaskByIdKeyMemberTaskTeamMemberUser({ + this.fullName, + this.email, + }); +} + +@immutable +class GetMemberTaskByIdKeyData { + final GetMemberTaskByIdKeyMemberTask? memberTask; + GetMemberTaskByIdKeyData.fromJson(dynamic json): + + memberTask = json['memberTask'] == null ? null : GetMemberTaskByIdKeyMemberTask.fromJson(json['memberTask']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMemberTaskByIdKeyData otherTyped = other as GetMemberTaskByIdKeyData; + return memberTask == otherTyped.memberTask; + + } + @override + int get hashCode => memberTask.hashCode; + + + Map toJson() { + Map json = {}; + if (memberTask != null) { + json['memberTask'] = memberTask!.toJson(); + } + return json; + } + + GetMemberTaskByIdKeyData({ + this.memberTask, + }); +} + +@immutable +class GetMemberTaskByIdKeyVariables { + final String teamMemberId; + final String taskId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetMemberTaskByIdKeyVariables.fromJson(Map json): + + teamMemberId = nativeFromJson(json['teamMemberId']), + taskId = nativeFromJson(json['taskId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMemberTaskByIdKeyVariables otherTyped = other as GetMemberTaskByIdKeyVariables; + return teamMemberId == otherTyped.teamMemberId && + taskId == otherTyped.taskId; + + } + @override + int get hashCode => Object.hashAll([teamMemberId.hashCode, taskId.hashCode]); + + + Map toJson() { + Map json = {}; + json['teamMemberId'] = nativeToJson(teamMemberId); + json['taskId'] = nativeToJson(taskId); + return json; + } + + GetMemberTaskByIdKeyVariables({ + required this.teamMemberId, + required this.taskId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_member_tasks_by_task_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_member_tasks_by_task_id.dart new file mode 100644 index 00000000..242412af --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_member_tasks_by_task_id.dart @@ -0,0 +1,285 @@ +part of 'generated.dart'; + +class GetMemberTasksByTaskIdVariablesBuilder { + String taskId; + + final FirebaseDataConnect _dataConnect; + GetMemberTasksByTaskIdVariablesBuilder(this._dataConnect, {required this.taskId,}); + Deserializer dataDeserializer = (dynamic json) => GetMemberTasksByTaskIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetMemberTasksByTaskIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetMemberTasksByTaskIdVariables vars= GetMemberTasksByTaskIdVariables(taskId: taskId,); + return _dataConnect.query("getMemberTasksByTaskId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetMemberTasksByTaskIdMemberTasks { + final String id; + final GetMemberTasksByTaskIdMemberTasksTask task; + final GetMemberTasksByTaskIdMemberTasksTeamMember teamMember; + GetMemberTasksByTaskIdMemberTasks.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + task = GetMemberTasksByTaskIdMemberTasksTask.fromJson(json['task']), + teamMember = GetMemberTasksByTaskIdMemberTasksTeamMember.fromJson(json['teamMember']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMemberTasksByTaskIdMemberTasks otherTyped = other as GetMemberTasksByTaskIdMemberTasks; + return id == otherTyped.id && + task == otherTyped.task && + teamMember == otherTyped.teamMember; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, task.hashCode, teamMember.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['task'] = task.toJson(); + json['teamMember'] = teamMember.toJson(); + return json; + } + + GetMemberTasksByTaskIdMemberTasks({ + required this.id, + required this.task, + required this.teamMember, + }); +} + +@immutable +class GetMemberTasksByTaskIdMemberTasksTask { + final String id; + final String taskName; + final String? description; + final EnumValue status; + final Timestamp? dueDate; + final int? progress; + final EnumValue priority; + GetMemberTasksByTaskIdMemberTasksTask.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + taskName = nativeFromJson(json['taskName']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + status = taskStatusDeserializer(json['status']), + dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']), + progress = json['progress'] == null ? null : nativeFromJson(json['progress']), + priority = taskPriorityDeserializer(json['priority']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMemberTasksByTaskIdMemberTasksTask otherTyped = other as GetMemberTasksByTaskIdMemberTasksTask; + return id == otherTyped.id && + taskName == otherTyped.taskName && + description == otherTyped.description && + status == otherTyped.status && + dueDate == otherTyped.dueDate && + progress == otherTyped.progress && + priority == otherTyped.priority; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, taskName.hashCode, description.hashCode, status.hashCode, dueDate.hashCode, progress.hashCode, priority.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['taskName'] = nativeToJson(taskName); + if (description != null) { + json['description'] = nativeToJson(description); + } + json['status'] = + taskStatusSerializer(status) + ; + if (dueDate != null) { + json['dueDate'] = dueDate!.toJson(); + } + if (progress != null) { + json['progress'] = nativeToJson(progress); + } + json['priority'] = + taskPrioritySerializer(priority) + ; + return json; + } + + GetMemberTasksByTaskIdMemberTasksTask({ + required this.id, + required this.taskName, + this.description, + required this.status, + this.dueDate, + this.progress, + required this.priority, + }); +} + +@immutable +class GetMemberTasksByTaskIdMemberTasksTeamMember { + final GetMemberTasksByTaskIdMemberTasksTeamMemberUser user; + GetMemberTasksByTaskIdMemberTasksTeamMember.fromJson(dynamic json): + + user = GetMemberTasksByTaskIdMemberTasksTeamMemberUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMemberTasksByTaskIdMemberTasksTeamMember otherTyped = other as GetMemberTasksByTaskIdMemberTasksTeamMember; + return user == otherTyped.user; + + } + @override + int get hashCode => user.hashCode; + + + Map toJson() { + Map json = {}; + json['user'] = user.toJson(); + return json; + } + + GetMemberTasksByTaskIdMemberTasksTeamMember({ + required this.user, + }); +} + +@immutable +class GetMemberTasksByTaskIdMemberTasksTeamMemberUser { + final String? fullName; + final String? email; + GetMemberTasksByTaskIdMemberTasksTeamMemberUser.fromJson(dynamic json): + + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMemberTasksByTaskIdMemberTasksTeamMemberUser otherTyped = other as GetMemberTasksByTaskIdMemberTasksTeamMemberUser; + return fullName == otherTyped.fullName && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([fullName.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + GetMemberTasksByTaskIdMemberTasksTeamMemberUser({ + this.fullName, + this.email, + }); +} + +@immutable +class GetMemberTasksByTaskIdData { + final List memberTasks; + GetMemberTasksByTaskIdData.fromJson(dynamic json): + + memberTasks = (json['memberTasks'] as List) + .map((e) => GetMemberTasksByTaskIdMemberTasks.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMemberTasksByTaskIdData otherTyped = other as GetMemberTasksByTaskIdData; + return memberTasks == otherTyped.memberTasks; + + } + @override + int get hashCode => memberTasks.hashCode; + + + Map toJson() { + Map json = {}; + json['memberTasks'] = memberTasks.map((e) => e.toJson()).toList(); + return json; + } + + GetMemberTasksByTaskIdData({ + required this.memberTasks, + }); +} + +@immutable +class GetMemberTasksByTaskIdVariables { + final String taskId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetMemberTasksByTaskIdVariables.fromJson(Map json): + + taskId = nativeFromJson(json['taskId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMemberTasksByTaskIdVariables otherTyped = other as GetMemberTasksByTaskIdVariables; + return taskId == otherTyped.taskId; + + } + @override + int get hashCode => taskId.hashCode; + + + Map toJson() { + Map json = {}; + json['taskId'] = nativeToJson(taskId); + return json; + } + + GetMemberTasksByTaskIdVariables({ + required this.taskId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_message_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_message_by_id.dart new file mode 100644 index 00000000..24068c4e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_message_by_id.dart @@ -0,0 +1,194 @@ +part of 'generated.dart'; + +class GetMessageByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetMessageByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetMessageByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetMessageByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetMessageByIdVariables vars= GetMessageByIdVariables(id: id,); + return _dataConnect.query("getMessageById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetMessageByIdMessage { + final String id; + final String conversationId; + final String senderId; + final String content; + final bool? isSystem; + final Timestamp? createdAt; + final GetMessageByIdMessageUser user; + GetMessageByIdMessage.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + conversationId = nativeFromJson(json['conversationId']), + senderId = nativeFromJson(json['senderId']), + content = nativeFromJson(json['content']), + isSystem = json['isSystem'] == null ? null : nativeFromJson(json['isSystem']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + user = GetMessageByIdMessageUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMessageByIdMessage otherTyped = other as GetMessageByIdMessage; + return id == otherTyped.id && + conversationId == otherTyped.conversationId && + senderId == otherTyped.senderId && + content == otherTyped.content && + isSystem == otherTyped.isSystem && + createdAt == otherTyped.createdAt && + user == otherTyped.user; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, conversationId.hashCode, senderId.hashCode, content.hashCode, isSystem.hashCode, createdAt.hashCode, user.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['conversationId'] = nativeToJson(conversationId); + json['senderId'] = nativeToJson(senderId); + json['content'] = nativeToJson(content); + if (isSystem != null) { + json['isSystem'] = nativeToJson(isSystem); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['user'] = user.toJson(); + return json; + } + + GetMessageByIdMessage({ + required this.id, + required this.conversationId, + required this.senderId, + required this.content, + this.isSystem, + this.createdAt, + required this.user, + }); +} + +@immutable +class GetMessageByIdMessageUser { + final String? fullName; + GetMessageByIdMessageUser.fromJson(dynamic json): + + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMessageByIdMessageUser otherTyped = other as GetMessageByIdMessageUser; + return fullName == otherTyped.fullName; + + } + @override + int get hashCode => fullName.hashCode; + + + Map toJson() { + Map json = {}; + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + return json; + } + + GetMessageByIdMessageUser({ + this.fullName, + }); +} + +@immutable +class GetMessageByIdData { + final GetMessageByIdMessage? message; + GetMessageByIdData.fromJson(dynamic json): + + message = json['message'] == null ? null : GetMessageByIdMessage.fromJson(json['message']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMessageByIdData otherTyped = other as GetMessageByIdData; + return message == otherTyped.message; + + } + @override + int get hashCode => message.hashCode; + + + Map toJson() { + Map json = {}; + if (message != null) { + json['message'] = message!.toJson(); + } + return json; + } + + GetMessageByIdData({ + this.message, + }); +} + +@immutable +class GetMessageByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetMessageByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMessageByIdVariables otherTyped = other as GetMessageByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetMessageByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_messages_by_conversation_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_messages_by_conversation_id.dart new file mode 100644 index 00000000..bb5dfd86 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_messages_by_conversation_id.dart @@ -0,0 +1,194 @@ +part of 'generated.dart'; + +class GetMessagesByConversationIdVariablesBuilder { + String conversationId; + + final FirebaseDataConnect _dataConnect; + GetMessagesByConversationIdVariablesBuilder(this._dataConnect, {required this.conversationId,}); + Deserializer dataDeserializer = (dynamic json) => GetMessagesByConversationIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetMessagesByConversationIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetMessagesByConversationIdVariables vars= GetMessagesByConversationIdVariables(conversationId: conversationId,); + return _dataConnect.query("getMessagesByConversationId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetMessagesByConversationIdMessages { + final String id; + final String conversationId; + final String senderId; + final String content; + final bool? isSystem; + final Timestamp? createdAt; + final GetMessagesByConversationIdMessagesUser user; + GetMessagesByConversationIdMessages.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + conversationId = nativeFromJson(json['conversationId']), + senderId = nativeFromJson(json['senderId']), + content = nativeFromJson(json['content']), + isSystem = json['isSystem'] == null ? null : nativeFromJson(json['isSystem']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + user = GetMessagesByConversationIdMessagesUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMessagesByConversationIdMessages otherTyped = other as GetMessagesByConversationIdMessages; + return id == otherTyped.id && + conversationId == otherTyped.conversationId && + senderId == otherTyped.senderId && + content == otherTyped.content && + isSystem == otherTyped.isSystem && + createdAt == otherTyped.createdAt && + user == otherTyped.user; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, conversationId.hashCode, senderId.hashCode, content.hashCode, isSystem.hashCode, createdAt.hashCode, user.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['conversationId'] = nativeToJson(conversationId); + json['senderId'] = nativeToJson(senderId); + json['content'] = nativeToJson(content); + if (isSystem != null) { + json['isSystem'] = nativeToJson(isSystem); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['user'] = user.toJson(); + return json; + } + + GetMessagesByConversationIdMessages({ + required this.id, + required this.conversationId, + required this.senderId, + required this.content, + this.isSystem, + this.createdAt, + required this.user, + }); +} + +@immutable +class GetMessagesByConversationIdMessagesUser { + final String? fullName; + GetMessagesByConversationIdMessagesUser.fromJson(dynamic json): + + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMessagesByConversationIdMessagesUser otherTyped = other as GetMessagesByConversationIdMessagesUser; + return fullName == otherTyped.fullName; + + } + @override + int get hashCode => fullName.hashCode; + + + Map toJson() { + Map json = {}; + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + return json; + } + + GetMessagesByConversationIdMessagesUser({ + this.fullName, + }); +} + +@immutable +class GetMessagesByConversationIdData { + final List messages; + GetMessagesByConversationIdData.fromJson(dynamic json): + + messages = (json['messages'] as List) + .map((e) => GetMessagesByConversationIdMessages.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMessagesByConversationIdData otherTyped = other as GetMessagesByConversationIdData; + return messages == otherTyped.messages; + + } + @override + int get hashCode => messages.hashCode; + + + Map toJson() { + Map json = {}; + json['messages'] = messages.map((e) => e.toJson()).toList(); + return json; + } + + GetMessagesByConversationIdData({ + required this.messages, + }); +} + +@immutable +class GetMessagesByConversationIdVariables { + final String conversationId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetMessagesByConversationIdVariables.fromJson(Map json): + + conversationId = nativeFromJson(json['conversationId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMessagesByConversationIdVariables otherTyped = other as GetMessagesByConversationIdVariables; + return conversationId == otherTyped.conversationId; + + } + @override + int get hashCode => conversationId.hashCode; + + + Map toJson() { + Map json = {}; + json['conversationId'] = nativeToJson(conversationId); + return json; + } + + GetMessagesByConversationIdVariables({ + required this.conversationId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_my_tasks.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_my_tasks.dart new file mode 100644 index 00000000..34101380 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_my_tasks.dart @@ -0,0 +1,285 @@ +part of 'generated.dart'; + +class GetMyTasksVariablesBuilder { + String teamMemberId; + + final FirebaseDataConnect _dataConnect; + GetMyTasksVariablesBuilder(this._dataConnect, {required this.teamMemberId,}); + Deserializer dataDeserializer = (dynamic json) => GetMyTasksData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetMyTasksVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetMyTasksVariables vars= GetMyTasksVariables(teamMemberId: teamMemberId,); + return _dataConnect.query("getMyTasks", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetMyTasksMemberTasks { + final String id; + final GetMyTasksMemberTasksTask task; + final GetMyTasksMemberTasksTeamMember teamMember; + GetMyTasksMemberTasks.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + task = GetMyTasksMemberTasksTask.fromJson(json['task']), + teamMember = GetMyTasksMemberTasksTeamMember.fromJson(json['teamMember']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMyTasksMemberTasks otherTyped = other as GetMyTasksMemberTasks; + return id == otherTyped.id && + task == otherTyped.task && + teamMember == otherTyped.teamMember; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, task.hashCode, teamMember.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['task'] = task.toJson(); + json['teamMember'] = teamMember.toJson(); + return json; + } + + GetMyTasksMemberTasks({ + required this.id, + required this.task, + required this.teamMember, + }); +} + +@immutable +class GetMyTasksMemberTasksTask { + final String id; + final String taskName; + final String? description; + final EnumValue status; + final Timestamp? dueDate; + final int? progress; + final EnumValue priority; + GetMyTasksMemberTasksTask.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + taskName = nativeFromJson(json['taskName']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + status = taskStatusDeserializer(json['status']), + dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']), + progress = json['progress'] == null ? null : nativeFromJson(json['progress']), + priority = taskPriorityDeserializer(json['priority']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMyTasksMemberTasksTask otherTyped = other as GetMyTasksMemberTasksTask; + return id == otherTyped.id && + taskName == otherTyped.taskName && + description == otherTyped.description && + status == otherTyped.status && + dueDate == otherTyped.dueDate && + progress == otherTyped.progress && + priority == otherTyped.priority; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, taskName.hashCode, description.hashCode, status.hashCode, dueDate.hashCode, progress.hashCode, priority.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['taskName'] = nativeToJson(taskName); + if (description != null) { + json['description'] = nativeToJson(description); + } + json['status'] = + taskStatusSerializer(status) + ; + if (dueDate != null) { + json['dueDate'] = dueDate!.toJson(); + } + if (progress != null) { + json['progress'] = nativeToJson(progress); + } + json['priority'] = + taskPrioritySerializer(priority) + ; + return json; + } + + GetMyTasksMemberTasksTask({ + required this.id, + required this.taskName, + this.description, + required this.status, + this.dueDate, + this.progress, + required this.priority, + }); +} + +@immutable +class GetMyTasksMemberTasksTeamMember { + final GetMyTasksMemberTasksTeamMemberUser user; + GetMyTasksMemberTasksTeamMember.fromJson(dynamic json): + + user = GetMyTasksMemberTasksTeamMemberUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMyTasksMemberTasksTeamMember otherTyped = other as GetMyTasksMemberTasksTeamMember; + return user == otherTyped.user; + + } + @override + int get hashCode => user.hashCode; + + + Map toJson() { + Map json = {}; + json['user'] = user.toJson(); + return json; + } + + GetMyTasksMemberTasksTeamMember({ + required this.user, + }); +} + +@immutable +class GetMyTasksMemberTasksTeamMemberUser { + final String? fullName; + final String? email; + GetMyTasksMemberTasksTeamMemberUser.fromJson(dynamic json): + + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMyTasksMemberTasksTeamMemberUser otherTyped = other as GetMyTasksMemberTasksTeamMemberUser; + return fullName == otherTyped.fullName && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([fullName.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + GetMyTasksMemberTasksTeamMemberUser({ + this.fullName, + this.email, + }); +} + +@immutable +class GetMyTasksData { + final List memberTasks; + GetMyTasksData.fromJson(dynamic json): + + memberTasks = (json['memberTasks'] as List) + .map((e) => GetMyTasksMemberTasks.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMyTasksData otherTyped = other as GetMyTasksData; + return memberTasks == otherTyped.memberTasks; + + } + @override + int get hashCode => memberTasks.hashCode; + + + Map toJson() { + Map json = {}; + json['memberTasks'] = memberTasks.map((e) => e.toJson()).toList(); + return json; + } + + GetMyTasksData({ + required this.memberTasks, + }); +} + +@immutable +class GetMyTasksVariables { + final String teamMemberId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetMyTasksVariables.fromJson(Map json): + + teamMemberId = nativeFromJson(json['teamMemberId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetMyTasksVariables otherTyped = other as GetMyTasksVariables; + return teamMemberId == otherTyped.teamMemberId; + + } + @override + int get hashCode => teamMemberId.hashCode; + + + Map toJson() { + Map json = {}; + json['teamMemberId'] = nativeToJson(teamMemberId); + return json; + } + + GetMyTasksVariables({ + required this.teamMemberId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_order_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_order_by_id.dart new file mode 100644 index 00000000..24fdb607 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_order_by_id.dart @@ -0,0 +1,382 @@ +part of 'generated.dart'; + +class GetOrderByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetOrderByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetOrderByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetOrderByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetOrderByIdVariables vars= GetOrderByIdVariables(id: id,); + return _dataConnect.query("getOrderById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetOrderByIdOrder { + final String id; + final String? eventName; + final String? vendorId; + final String businessId; + final EnumValue orderType; + final String? location; + final EnumValue status; + final Timestamp? date; + final Timestamp? startDate; + final Timestamp? endDate; + final EnumValue? duration; + final int? lunchBreak; + final double? total; + final AnyValue? assignedStaff; + final AnyValue? shifts; + final int? requested; + final String? hub; + final AnyValue? recurringDays; + final AnyValue? permanentDays; + final String? poReference; + final AnyValue? detectedConflicts; + final String? notes; + final Timestamp? createdAt; + final GetOrderByIdOrderBusiness business; + final GetOrderByIdOrderVendor? vendor; + GetOrderByIdOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderType = orderTypeDeserializer(json['orderType']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = orderStatusDeserializer(json['status']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startDate = json['startDate'] == null ? null : Timestamp.fromJson(json['startDate']), + endDate = json['endDate'] == null ? null : Timestamp.fromJson(json['endDate']), + duration = json['duration'] == null ? null : orderDurationDeserializer(json['duration']), + lunchBreak = json['lunchBreak'] == null ? null : nativeFromJson(json['lunchBreak']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + assignedStaff = json['assignedStaff'] == null ? null : AnyValue.fromJson(json['assignedStaff']), + shifts = json['shifts'] == null ? null : AnyValue.fromJson(json['shifts']), + requested = json['requested'] == null ? null : nativeFromJson(json['requested']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), + permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']), + detectedConflicts = json['detectedConflicts'] == null ? null : AnyValue.fromJson(json['detectedConflicts']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + business = GetOrderByIdOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetOrderByIdOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrderByIdOrder otherTyped = other as GetOrderByIdOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderType == otherTyped.orderType && + location == otherTyped.location && + status == otherTyped.status && + date == otherTyped.date && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate && + duration == otherTyped.duration && + lunchBreak == otherTyped.lunchBreak && + total == otherTyped.total && + assignedStaff == otherTyped.assignedStaff && + shifts == otherTyped.shifts && + requested == otherTyped.requested && + hub == otherTyped.hub && + recurringDays == otherTyped.recurringDays && + permanentDays == otherTyped.permanentDays && + poReference == otherTyped.poReference && + detectedConflicts == otherTyped.detectedConflicts && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, vendorId.hashCode, businessId.hashCode, orderType.hashCode, location.hashCode, status.hashCode, date.hashCode, startDate.hashCode, endDate.hashCode, duration.hashCode, lunchBreak.hashCode, total.hashCode, assignedStaff.hashCode, shifts.hashCode, requested.hashCode, hub.hashCode, recurringDays.hashCode, permanentDays.hashCode, poReference.hashCode, detectedConflicts.hashCode, notes.hashCode, createdAt.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + json['businessId'] = nativeToJson(businessId); + json['orderType'] = + orderTypeSerializer(orderType) + ; + if (location != null) { + json['location'] = nativeToJson(location); + } + json['status'] = + orderStatusSerializer(status) + ; + if (date != null) { + json['date'] = date!.toJson(); + } + if (startDate != null) { + json['startDate'] = startDate!.toJson(); + } + if (endDate != null) { + json['endDate'] = endDate!.toJson(); + } + if (duration != null) { + json['duration'] = + orderDurationSerializer(duration!) + ; + } + if (lunchBreak != null) { + json['lunchBreak'] = nativeToJson(lunchBreak); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (assignedStaff != null) { + json['assignedStaff'] = assignedStaff!.toJson(); + } + if (shifts != null) { + json['shifts'] = shifts!.toJson(); + } + if (requested != null) { + json['requested'] = nativeToJson(requested); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (recurringDays != null) { + json['recurringDays'] = recurringDays!.toJson(); + } + if (permanentDays != null) { + json['permanentDays'] = permanentDays!.toJson(); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + if (detectedConflicts != null) { + json['detectedConflicts'] = detectedConflicts!.toJson(); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetOrderByIdOrder({ + required this.id, + this.eventName, + this.vendorId, + required this.businessId, + required this.orderType, + this.location, + required this.status, + this.date, + this.startDate, + this.endDate, + this.duration, + this.lunchBreak, + this.total, + this.assignedStaff, + this.shifts, + this.requested, + this.hub, + this.recurringDays, + this.permanentDays, + this.poReference, + this.detectedConflicts, + this.notes, + this.createdAt, + required this.business, + this.vendor, + }); +} + +@immutable +class GetOrderByIdOrderBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetOrderByIdOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrderByIdOrderBusiness otherTyped = other as GetOrderByIdOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetOrderByIdOrderBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetOrderByIdOrderVendor { + final String id; + final String companyName; + GetOrderByIdOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrderByIdOrderVendor otherTyped = other as GetOrderByIdOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetOrderByIdOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetOrderByIdData { + final GetOrderByIdOrder? order; + GetOrderByIdData.fromJson(dynamic json): + + order = json['order'] == null ? null : GetOrderByIdOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrderByIdData otherTyped = other as GetOrderByIdData; + return order == otherTyped.order; + + } + @override + int get hashCode => order.hashCode; + + + Map toJson() { + Map json = {}; + if (order != null) { + json['order'] = order!.toJson(); + } + return json; + } + + GetOrderByIdData({ + this.order, + }); +} + +@immutable +class GetOrderByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetOrderByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrderByIdVariables otherTyped = other as GetOrderByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetOrderByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_orders_by_business_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_orders_by_business_id.dart new file mode 100644 index 00000000..52795c9b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_orders_by_business_id.dart @@ -0,0 +1,415 @@ +part of 'generated.dart'; + +class GetOrdersByBusinessIdVariablesBuilder { + String businessId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; GetOrdersByBusinessIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetOrdersByBusinessIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + GetOrdersByBusinessIdVariablesBuilder(this._dataConnect, {required this.businessId,}); + Deserializer dataDeserializer = (dynamic json) => GetOrdersByBusinessIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetOrdersByBusinessIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetOrdersByBusinessIdVariables vars= GetOrdersByBusinessIdVariables(businessId: businessId,offset: _offset,limit: _limit,); + return _dataConnect.query("getOrdersByBusinessId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetOrdersByBusinessIdOrders { + final String id; + final String? eventName; + final String? vendorId; + final String businessId; + final EnumValue orderType; + final String? location; + final EnumValue status; + final Timestamp? date; + final Timestamp? startDate; + final Timestamp? endDate; + final EnumValue? duration; + final int? lunchBreak; + final double? total; + final AnyValue? assignedStaff; + final AnyValue? shifts; + final int? requested; + final String? hub; + final AnyValue? recurringDays; + final AnyValue? permanentDays; + final String? poReference; + final AnyValue? detectedConflicts; + final String? notes; + final Timestamp? createdAt; + final GetOrdersByBusinessIdOrdersBusiness business; + final GetOrdersByBusinessIdOrdersVendor? vendor; + GetOrdersByBusinessIdOrders.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderType = orderTypeDeserializer(json['orderType']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = orderStatusDeserializer(json['status']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startDate = json['startDate'] == null ? null : Timestamp.fromJson(json['startDate']), + endDate = json['endDate'] == null ? null : Timestamp.fromJson(json['endDate']), + duration = json['duration'] == null ? null : orderDurationDeserializer(json['duration']), + lunchBreak = json['lunchBreak'] == null ? null : nativeFromJson(json['lunchBreak']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + assignedStaff = json['assignedStaff'] == null ? null : AnyValue.fromJson(json['assignedStaff']), + shifts = json['shifts'] == null ? null : AnyValue.fromJson(json['shifts']), + requested = json['requested'] == null ? null : nativeFromJson(json['requested']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), + permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']), + detectedConflicts = json['detectedConflicts'] == null ? null : AnyValue.fromJson(json['detectedConflicts']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + business = GetOrdersByBusinessIdOrdersBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetOrdersByBusinessIdOrdersVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByBusinessIdOrders otherTyped = other as GetOrdersByBusinessIdOrders; + return id == otherTyped.id && + eventName == otherTyped.eventName && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderType == otherTyped.orderType && + location == otherTyped.location && + status == otherTyped.status && + date == otherTyped.date && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate && + duration == otherTyped.duration && + lunchBreak == otherTyped.lunchBreak && + total == otherTyped.total && + assignedStaff == otherTyped.assignedStaff && + shifts == otherTyped.shifts && + requested == otherTyped.requested && + hub == otherTyped.hub && + recurringDays == otherTyped.recurringDays && + permanentDays == otherTyped.permanentDays && + poReference == otherTyped.poReference && + detectedConflicts == otherTyped.detectedConflicts && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, vendorId.hashCode, businessId.hashCode, orderType.hashCode, location.hashCode, status.hashCode, date.hashCode, startDate.hashCode, endDate.hashCode, duration.hashCode, lunchBreak.hashCode, total.hashCode, assignedStaff.hashCode, shifts.hashCode, requested.hashCode, hub.hashCode, recurringDays.hashCode, permanentDays.hashCode, poReference.hashCode, detectedConflicts.hashCode, notes.hashCode, createdAt.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + json['businessId'] = nativeToJson(businessId); + json['orderType'] = + orderTypeSerializer(orderType) + ; + if (location != null) { + json['location'] = nativeToJson(location); + } + json['status'] = + orderStatusSerializer(status) + ; + if (date != null) { + json['date'] = date!.toJson(); + } + if (startDate != null) { + json['startDate'] = startDate!.toJson(); + } + if (endDate != null) { + json['endDate'] = endDate!.toJson(); + } + if (duration != null) { + json['duration'] = + orderDurationSerializer(duration!) + ; + } + if (lunchBreak != null) { + json['lunchBreak'] = nativeToJson(lunchBreak); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (assignedStaff != null) { + json['assignedStaff'] = assignedStaff!.toJson(); + } + if (shifts != null) { + json['shifts'] = shifts!.toJson(); + } + if (requested != null) { + json['requested'] = nativeToJson(requested); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (recurringDays != null) { + json['recurringDays'] = recurringDays!.toJson(); + } + if (permanentDays != null) { + json['permanentDays'] = permanentDays!.toJson(); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + if (detectedConflicts != null) { + json['detectedConflicts'] = detectedConflicts!.toJson(); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetOrdersByBusinessIdOrders({ + required this.id, + this.eventName, + this.vendorId, + required this.businessId, + required this.orderType, + this.location, + required this.status, + this.date, + this.startDate, + this.endDate, + this.duration, + this.lunchBreak, + this.total, + this.assignedStaff, + this.shifts, + this.requested, + this.hub, + this.recurringDays, + this.permanentDays, + this.poReference, + this.detectedConflicts, + this.notes, + this.createdAt, + required this.business, + this.vendor, + }); +} + +@immutable +class GetOrdersByBusinessIdOrdersBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetOrdersByBusinessIdOrdersBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByBusinessIdOrdersBusiness otherTyped = other as GetOrdersByBusinessIdOrdersBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetOrdersByBusinessIdOrdersBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetOrdersByBusinessIdOrdersVendor { + final String id; + final String companyName; + GetOrdersByBusinessIdOrdersVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByBusinessIdOrdersVendor otherTyped = other as GetOrdersByBusinessIdOrdersVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetOrdersByBusinessIdOrdersVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetOrdersByBusinessIdData { + final List orders; + GetOrdersByBusinessIdData.fromJson(dynamic json): + + orders = (json['orders'] as List) + .map((e) => GetOrdersByBusinessIdOrders.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByBusinessIdData otherTyped = other as GetOrdersByBusinessIdData; + return orders == otherTyped.orders; + + } + @override + int get hashCode => orders.hashCode; + + + Map toJson() { + Map json = {}; + json['orders'] = orders.map((e) => e.toJson()).toList(); + return json; + } + + GetOrdersByBusinessIdData({ + required this.orders, + }); +} + +@immutable +class GetOrdersByBusinessIdVariables { + final String businessId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetOrdersByBusinessIdVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByBusinessIdVariables otherTyped = other as GetOrdersByBusinessIdVariables; + return businessId == otherTyped.businessId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + GetOrdersByBusinessIdVariables({ + required this.businessId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_orders_by_date_range.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_orders_by_date_range.dart new file mode 100644 index 00000000..f66f3874 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_orders_by_date_range.dart @@ -0,0 +1,422 @@ +part of 'generated.dart'; + +class GetOrdersByDateRangeVariablesBuilder { + Timestamp start; + Timestamp end; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; GetOrdersByDateRangeVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetOrdersByDateRangeVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + GetOrdersByDateRangeVariablesBuilder(this._dataConnect, {required this.start,required this.end,}); + Deserializer dataDeserializer = (dynamic json) => GetOrdersByDateRangeData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetOrdersByDateRangeVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetOrdersByDateRangeVariables vars= GetOrdersByDateRangeVariables(start: start,end: end,offset: _offset,limit: _limit,); + return _dataConnect.query("getOrdersByDateRange", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetOrdersByDateRangeOrders { + final String id; + final String? eventName; + final String? vendorId; + final String businessId; + final EnumValue orderType; + final String? location; + final EnumValue status; + final Timestamp? date; + final Timestamp? startDate; + final Timestamp? endDate; + final EnumValue? duration; + final int? lunchBreak; + final double? total; + final AnyValue? assignedStaff; + final AnyValue? shifts; + final int? requested; + final String? hub; + final AnyValue? recurringDays; + final AnyValue? permanentDays; + final String? poReference; + final AnyValue? detectedConflicts; + final String? notes; + final Timestamp? createdAt; + final GetOrdersByDateRangeOrdersBusiness business; + final GetOrdersByDateRangeOrdersVendor? vendor; + GetOrdersByDateRangeOrders.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderType = orderTypeDeserializer(json['orderType']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = orderStatusDeserializer(json['status']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startDate = json['startDate'] == null ? null : Timestamp.fromJson(json['startDate']), + endDate = json['endDate'] == null ? null : Timestamp.fromJson(json['endDate']), + duration = json['duration'] == null ? null : orderDurationDeserializer(json['duration']), + lunchBreak = json['lunchBreak'] == null ? null : nativeFromJson(json['lunchBreak']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + assignedStaff = json['assignedStaff'] == null ? null : AnyValue.fromJson(json['assignedStaff']), + shifts = json['shifts'] == null ? null : AnyValue.fromJson(json['shifts']), + requested = json['requested'] == null ? null : nativeFromJson(json['requested']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), + permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']), + detectedConflicts = json['detectedConflicts'] == null ? null : AnyValue.fromJson(json['detectedConflicts']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + business = GetOrdersByDateRangeOrdersBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetOrdersByDateRangeOrdersVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByDateRangeOrders otherTyped = other as GetOrdersByDateRangeOrders; + return id == otherTyped.id && + eventName == otherTyped.eventName && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderType == otherTyped.orderType && + location == otherTyped.location && + status == otherTyped.status && + date == otherTyped.date && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate && + duration == otherTyped.duration && + lunchBreak == otherTyped.lunchBreak && + total == otherTyped.total && + assignedStaff == otherTyped.assignedStaff && + shifts == otherTyped.shifts && + requested == otherTyped.requested && + hub == otherTyped.hub && + recurringDays == otherTyped.recurringDays && + permanentDays == otherTyped.permanentDays && + poReference == otherTyped.poReference && + detectedConflicts == otherTyped.detectedConflicts && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, vendorId.hashCode, businessId.hashCode, orderType.hashCode, location.hashCode, status.hashCode, date.hashCode, startDate.hashCode, endDate.hashCode, duration.hashCode, lunchBreak.hashCode, total.hashCode, assignedStaff.hashCode, shifts.hashCode, requested.hashCode, hub.hashCode, recurringDays.hashCode, permanentDays.hashCode, poReference.hashCode, detectedConflicts.hashCode, notes.hashCode, createdAt.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + json['businessId'] = nativeToJson(businessId); + json['orderType'] = + orderTypeSerializer(orderType) + ; + if (location != null) { + json['location'] = nativeToJson(location); + } + json['status'] = + orderStatusSerializer(status) + ; + if (date != null) { + json['date'] = date!.toJson(); + } + if (startDate != null) { + json['startDate'] = startDate!.toJson(); + } + if (endDate != null) { + json['endDate'] = endDate!.toJson(); + } + if (duration != null) { + json['duration'] = + orderDurationSerializer(duration!) + ; + } + if (lunchBreak != null) { + json['lunchBreak'] = nativeToJson(lunchBreak); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (assignedStaff != null) { + json['assignedStaff'] = assignedStaff!.toJson(); + } + if (shifts != null) { + json['shifts'] = shifts!.toJson(); + } + if (requested != null) { + json['requested'] = nativeToJson(requested); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (recurringDays != null) { + json['recurringDays'] = recurringDays!.toJson(); + } + if (permanentDays != null) { + json['permanentDays'] = permanentDays!.toJson(); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + if (detectedConflicts != null) { + json['detectedConflicts'] = detectedConflicts!.toJson(); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetOrdersByDateRangeOrders({ + required this.id, + this.eventName, + this.vendorId, + required this.businessId, + required this.orderType, + this.location, + required this.status, + this.date, + this.startDate, + this.endDate, + this.duration, + this.lunchBreak, + this.total, + this.assignedStaff, + this.shifts, + this.requested, + this.hub, + this.recurringDays, + this.permanentDays, + this.poReference, + this.detectedConflicts, + this.notes, + this.createdAt, + required this.business, + this.vendor, + }); +} + +@immutable +class GetOrdersByDateRangeOrdersBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetOrdersByDateRangeOrdersBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByDateRangeOrdersBusiness otherTyped = other as GetOrdersByDateRangeOrdersBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetOrdersByDateRangeOrdersBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetOrdersByDateRangeOrdersVendor { + final String id; + final String companyName; + GetOrdersByDateRangeOrdersVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByDateRangeOrdersVendor otherTyped = other as GetOrdersByDateRangeOrdersVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetOrdersByDateRangeOrdersVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetOrdersByDateRangeData { + final List orders; + GetOrdersByDateRangeData.fromJson(dynamic json): + + orders = (json['orders'] as List) + .map((e) => GetOrdersByDateRangeOrders.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByDateRangeData otherTyped = other as GetOrdersByDateRangeData; + return orders == otherTyped.orders; + + } + @override + int get hashCode => orders.hashCode; + + + Map toJson() { + Map json = {}; + json['orders'] = orders.map((e) => e.toJson()).toList(); + return json; + } + + GetOrdersByDateRangeData({ + required this.orders, + }); +} + +@immutable +class GetOrdersByDateRangeVariables { + final Timestamp start; + final Timestamp end; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetOrdersByDateRangeVariables.fromJson(Map json): + + start = Timestamp.fromJson(json['start']), + end = Timestamp.fromJson(json['end']) { + + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByDateRangeVariables otherTyped = other as GetOrdersByDateRangeVariables; + return start == otherTyped.start && + end == otherTyped.end && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([start.hashCode, end.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['start'] = start.toJson(); + json['end'] = end.toJson(); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + GetOrdersByDateRangeVariables({ + required this.start, + required this.end, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_orders_by_status.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_orders_by_status.dart new file mode 100644 index 00000000..617b6fa8 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_orders_by_status.dart @@ -0,0 +1,417 @@ +part of 'generated.dart'; + +class GetOrdersByStatusVariablesBuilder { + OrderStatus status; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; GetOrdersByStatusVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetOrdersByStatusVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + GetOrdersByStatusVariablesBuilder(this._dataConnect, {required this.status,}); + Deserializer dataDeserializer = (dynamic json) => GetOrdersByStatusData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetOrdersByStatusVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetOrdersByStatusVariables vars= GetOrdersByStatusVariables(status: status,offset: _offset,limit: _limit,); + return _dataConnect.query("getOrdersByStatus", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetOrdersByStatusOrders { + final String id; + final String? eventName; + final String? vendorId; + final String businessId; + final EnumValue orderType; + final String? location; + final EnumValue status; + final Timestamp? date; + final Timestamp? startDate; + final Timestamp? endDate; + final EnumValue? duration; + final int? lunchBreak; + final double? total; + final AnyValue? assignedStaff; + final AnyValue? shifts; + final int? requested; + final String? hub; + final AnyValue? recurringDays; + final AnyValue? permanentDays; + final String? poReference; + final AnyValue? detectedConflicts; + final String? notes; + final Timestamp? createdAt; + final GetOrdersByStatusOrdersBusiness business; + final GetOrdersByStatusOrdersVendor? vendor; + GetOrdersByStatusOrders.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderType = orderTypeDeserializer(json['orderType']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = orderStatusDeserializer(json['status']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startDate = json['startDate'] == null ? null : Timestamp.fromJson(json['startDate']), + endDate = json['endDate'] == null ? null : Timestamp.fromJson(json['endDate']), + duration = json['duration'] == null ? null : orderDurationDeserializer(json['duration']), + lunchBreak = json['lunchBreak'] == null ? null : nativeFromJson(json['lunchBreak']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + assignedStaff = json['assignedStaff'] == null ? null : AnyValue.fromJson(json['assignedStaff']), + shifts = json['shifts'] == null ? null : AnyValue.fromJson(json['shifts']), + requested = json['requested'] == null ? null : nativeFromJson(json['requested']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), + permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']), + detectedConflicts = json['detectedConflicts'] == null ? null : AnyValue.fromJson(json['detectedConflicts']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + business = GetOrdersByStatusOrdersBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetOrdersByStatusOrdersVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByStatusOrders otherTyped = other as GetOrdersByStatusOrders; + return id == otherTyped.id && + eventName == otherTyped.eventName && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderType == otherTyped.orderType && + location == otherTyped.location && + status == otherTyped.status && + date == otherTyped.date && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate && + duration == otherTyped.duration && + lunchBreak == otherTyped.lunchBreak && + total == otherTyped.total && + assignedStaff == otherTyped.assignedStaff && + shifts == otherTyped.shifts && + requested == otherTyped.requested && + hub == otherTyped.hub && + recurringDays == otherTyped.recurringDays && + permanentDays == otherTyped.permanentDays && + poReference == otherTyped.poReference && + detectedConflicts == otherTyped.detectedConflicts && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, vendorId.hashCode, businessId.hashCode, orderType.hashCode, location.hashCode, status.hashCode, date.hashCode, startDate.hashCode, endDate.hashCode, duration.hashCode, lunchBreak.hashCode, total.hashCode, assignedStaff.hashCode, shifts.hashCode, requested.hashCode, hub.hashCode, recurringDays.hashCode, permanentDays.hashCode, poReference.hashCode, detectedConflicts.hashCode, notes.hashCode, createdAt.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + json['businessId'] = nativeToJson(businessId); + json['orderType'] = + orderTypeSerializer(orderType) + ; + if (location != null) { + json['location'] = nativeToJson(location); + } + json['status'] = + orderStatusSerializer(status) + ; + if (date != null) { + json['date'] = date!.toJson(); + } + if (startDate != null) { + json['startDate'] = startDate!.toJson(); + } + if (endDate != null) { + json['endDate'] = endDate!.toJson(); + } + if (duration != null) { + json['duration'] = + orderDurationSerializer(duration!) + ; + } + if (lunchBreak != null) { + json['lunchBreak'] = nativeToJson(lunchBreak); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (assignedStaff != null) { + json['assignedStaff'] = assignedStaff!.toJson(); + } + if (shifts != null) { + json['shifts'] = shifts!.toJson(); + } + if (requested != null) { + json['requested'] = nativeToJson(requested); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (recurringDays != null) { + json['recurringDays'] = recurringDays!.toJson(); + } + if (permanentDays != null) { + json['permanentDays'] = permanentDays!.toJson(); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + if (detectedConflicts != null) { + json['detectedConflicts'] = detectedConflicts!.toJson(); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetOrdersByStatusOrders({ + required this.id, + this.eventName, + this.vendorId, + required this.businessId, + required this.orderType, + this.location, + required this.status, + this.date, + this.startDate, + this.endDate, + this.duration, + this.lunchBreak, + this.total, + this.assignedStaff, + this.shifts, + this.requested, + this.hub, + this.recurringDays, + this.permanentDays, + this.poReference, + this.detectedConflicts, + this.notes, + this.createdAt, + required this.business, + this.vendor, + }); +} + +@immutable +class GetOrdersByStatusOrdersBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetOrdersByStatusOrdersBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByStatusOrdersBusiness otherTyped = other as GetOrdersByStatusOrdersBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetOrdersByStatusOrdersBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetOrdersByStatusOrdersVendor { + final String id; + final String companyName; + GetOrdersByStatusOrdersVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByStatusOrdersVendor otherTyped = other as GetOrdersByStatusOrdersVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetOrdersByStatusOrdersVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetOrdersByStatusData { + final List orders; + GetOrdersByStatusData.fromJson(dynamic json): + + orders = (json['orders'] as List) + .map((e) => GetOrdersByStatusOrders.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByStatusData otherTyped = other as GetOrdersByStatusData; + return orders == otherTyped.orders; + + } + @override + int get hashCode => orders.hashCode; + + + Map toJson() { + Map json = {}; + json['orders'] = orders.map((e) => e.toJson()).toList(); + return json; + } + + GetOrdersByStatusData({ + required this.orders, + }); +} + +@immutable +class GetOrdersByStatusVariables { + final OrderStatus status; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetOrdersByStatusVariables.fromJson(Map json): + + status = OrderStatus.values.byName(json['status']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByStatusVariables otherTyped = other as GetOrdersByStatusVariables; + return status == otherTyped.status && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([status.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['status'] = + status.name + ; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + GetOrdersByStatusVariables({ + required this.status, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_orders_by_vendor_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_orders_by_vendor_id.dart new file mode 100644 index 00000000..3e98668a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_orders_by_vendor_id.dart @@ -0,0 +1,415 @@ +part of 'generated.dart'; + +class GetOrdersByVendorIdVariablesBuilder { + String vendorId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; GetOrdersByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetOrdersByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + GetOrdersByVendorIdVariablesBuilder(this._dataConnect, {required this.vendorId,}); + Deserializer dataDeserializer = (dynamic json) => GetOrdersByVendorIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetOrdersByVendorIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetOrdersByVendorIdVariables vars= GetOrdersByVendorIdVariables(vendorId: vendorId,offset: _offset,limit: _limit,); + return _dataConnect.query("getOrdersByVendorId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetOrdersByVendorIdOrders { + final String id; + final String? eventName; + final String? vendorId; + final String businessId; + final EnumValue orderType; + final String? location; + final EnumValue status; + final Timestamp? date; + final Timestamp? startDate; + final Timestamp? endDate; + final EnumValue? duration; + final int? lunchBreak; + final double? total; + final AnyValue? assignedStaff; + final AnyValue? shifts; + final int? requested; + final String? hub; + final AnyValue? recurringDays; + final AnyValue? permanentDays; + final String? poReference; + final AnyValue? detectedConflicts; + final String? notes; + final Timestamp? createdAt; + final GetOrdersByVendorIdOrdersBusiness business; + final GetOrdersByVendorIdOrdersVendor? vendor; + GetOrdersByVendorIdOrders.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderType = orderTypeDeserializer(json['orderType']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = orderStatusDeserializer(json['status']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startDate = json['startDate'] == null ? null : Timestamp.fromJson(json['startDate']), + endDate = json['endDate'] == null ? null : Timestamp.fromJson(json['endDate']), + duration = json['duration'] == null ? null : orderDurationDeserializer(json['duration']), + lunchBreak = json['lunchBreak'] == null ? null : nativeFromJson(json['lunchBreak']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + assignedStaff = json['assignedStaff'] == null ? null : AnyValue.fromJson(json['assignedStaff']), + shifts = json['shifts'] == null ? null : AnyValue.fromJson(json['shifts']), + requested = json['requested'] == null ? null : nativeFromJson(json['requested']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), + permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']), + detectedConflicts = json['detectedConflicts'] == null ? null : AnyValue.fromJson(json['detectedConflicts']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + business = GetOrdersByVendorIdOrdersBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetOrdersByVendorIdOrdersVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByVendorIdOrders otherTyped = other as GetOrdersByVendorIdOrders; + return id == otherTyped.id && + eventName == otherTyped.eventName && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderType == otherTyped.orderType && + location == otherTyped.location && + status == otherTyped.status && + date == otherTyped.date && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate && + duration == otherTyped.duration && + lunchBreak == otherTyped.lunchBreak && + total == otherTyped.total && + assignedStaff == otherTyped.assignedStaff && + shifts == otherTyped.shifts && + requested == otherTyped.requested && + hub == otherTyped.hub && + recurringDays == otherTyped.recurringDays && + permanentDays == otherTyped.permanentDays && + poReference == otherTyped.poReference && + detectedConflicts == otherTyped.detectedConflicts && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, vendorId.hashCode, businessId.hashCode, orderType.hashCode, location.hashCode, status.hashCode, date.hashCode, startDate.hashCode, endDate.hashCode, duration.hashCode, lunchBreak.hashCode, total.hashCode, assignedStaff.hashCode, shifts.hashCode, requested.hashCode, hub.hashCode, recurringDays.hashCode, permanentDays.hashCode, poReference.hashCode, detectedConflicts.hashCode, notes.hashCode, createdAt.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + json['businessId'] = nativeToJson(businessId); + json['orderType'] = + orderTypeSerializer(orderType) + ; + if (location != null) { + json['location'] = nativeToJson(location); + } + json['status'] = + orderStatusSerializer(status) + ; + if (date != null) { + json['date'] = date!.toJson(); + } + if (startDate != null) { + json['startDate'] = startDate!.toJson(); + } + if (endDate != null) { + json['endDate'] = endDate!.toJson(); + } + if (duration != null) { + json['duration'] = + orderDurationSerializer(duration!) + ; + } + if (lunchBreak != null) { + json['lunchBreak'] = nativeToJson(lunchBreak); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (assignedStaff != null) { + json['assignedStaff'] = assignedStaff!.toJson(); + } + if (shifts != null) { + json['shifts'] = shifts!.toJson(); + } + if (requested != null) { + json['requested'] = nativeToJson(requested); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (recurringDays != null) { + json['recurringDays'] = recurringDays!.toJson(); + } + if (permanentDays != null) { + json['permanentDays'] = permanentDays!.toJson(); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + if (detectedConflicts != null) { + json['detectedConflicts'] = detectedConflicts!.toJson(); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetOrdersByVendorIdOrders({ + required this.id, + this.eventName, + this.vendorId, + required this.businessId, + required this.orderType, + this.location, + required this.status, + this.date, + this.startDate, + this.endDate, + this.duration, + this.lunchBreak, + this.total, + this.assignedStaff, + this.shifts, + this.requested, + this.hub, + this.recurringDays, + this.permanentDays, + this.poReference, + this.detectedConflicts, + this.notes, + this.createdAt, + required this.business, + this.vendor, + }); +} + +@immutable +class GetOrdersByVendorIdOrdersBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetOrdersByVendorIdOrdersBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByVendorIdOrdersBusiness otherTyped = other as GetOrdersByVendorIdOrdersBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetOrdersByVendorIdOrdersBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetOrdersByVendorIdOrdersVendor { + final String id; + final String companyName; + GetOrdersByVendorIdOrdersVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByVendorIdOrdersVendor otherTyped = other as GetOrdersByVendorIdOrdersVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetOrdersByVendorIdOrdersVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetOrdersByVendorIdData { + final List orders; + GetOrdersByVendorIdData.fromJson(dynamic json): + + orders = (json['orders'] as List) + .map((e) => GetOrdersByVendorIdOrders.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByVendorIdData otherTyped = other as GetOrdersByVendorIdData; + return orders == otherTyped.orders; + + } + @override + int get hashCode => orders.hashCode; + + + Map toJson() { + Map json = {}; + json['orders'] = orders.map((e) => e.toJson()).toList(); + return json; + } + + GetOrdersByVendorIdData({ + required this.orders, + }); +} + +@immutable +class GetOrdersByVendorIdVariables { + final String vendorId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetOrdersByVendorIdVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetOrdersByVendorIdVariables otherTyped = other as GetOrdersByVendorIdVariables; + return vendorId == otherTyped.vendorId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + GetOrdersByVendorIdVariables({ + required this.vendorId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_rapid_orders.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_rapid_orders.dart new file mode 100644 index 00000000..22fe43be --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_rapid_orders.dart @@ -0,0 +1,408 @@ +part of 'generated.dart'; + +class GetRapidOrdersVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + GetRapidOrdersVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetRapidOrdersVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + GetRapidOrdersVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => GetRapidOrdersData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetRapidOrdersVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetRapidOrdersVariables vars= GetRapidOrdersVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("getRapidOrders", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetRapidOrdersOrders { + final String id; + final String? eventName; + final String? vendorId; + final String businessId; + final EnumValue orderType; + final String? location; + final EnumValue status; + final Timestamp? date; + final Timestamp? startDate; + final Timestamp? endDate; + final EnumValue? duration; + final int? lunchBreak; + final double? total; + final AnyValue? assignedStaff; + final AnyValue? shifts; + final int? requested; + final String? hub; + final AnyValue? recurringDays; + final AnyValue? permanentDays; + final String? poReference; + final AnyValue? detectedConflicts; + final String? notes; + final Timestamp? createdAt; + final GetRapidOrdersOrdersBusiness business; + final GetRapidOrdersOrdersVendor? vendor; + GetRapidOrdersOrders.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderType = orderTypeDeserializer(json['orderType']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = orderStatusDeserializer(json['status']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startDate = json['startDate'] == null ? null : Timestamp.fromJson(json['startDate']), + endDate = json['endDate'] == null ? null : Timestamp.fromJson(json['endDate']), + duration = json['duration'] == null ? null : orderDurationDeserializer(json['duration']), + lunchBreak = json['lunchBreak'] == null ? null : nativeFromJson(json['lunchBreak']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + assignedStaff = json['assignedStaff'] == null ? null : AnyValue.fromJson(json['assignedStaff']), + shifts = json['shifts'] == null ? null : AnyValue.fromJson(json['shifts']), + requested = json['requested'] == null ? null : nativeFromJson(json['requested']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), + permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']), + detectedConflicts = json['detectedConflicts'] == null ? null : AnyValue.fromJson(json['detectedConflicts']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + business = GetRapidOrdersOrdersBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetRapidOrdersOrdersVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRapidOrdersOrders otherTyped = other as GetRapidOrdersOrders; + return id == otherTyped.id && + eventName == otherTyped.eventName && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderType == otherTyped.orderType && + location == otherTyped.location && + status == otherTyped.status && + date == otherTyped.date && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate && + duration == otherTyped.duration && + lunchBreak == otherTyped.lunchBreak && + total == otherTyped.total && + assignedStaff == otherTyped.assignedStaff && + shifts == otherTyped.shifts && + requested == otherTyped.requested && + hub == otherTyped.hub && + recurringDays == otherTyped.recurringDays && + permanentDays == otherTyped.permanentDays && + poReference == otherTyped.poReference && + detectedConflicts == otherTyped.detectedConflicts && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, vendorId.hashCode, businessId.hashCode, orderType.hashCode, location.hashCode, status.hashCode, date.hashCode, startDate.hashCode, endDate.hashCode, duration.hashCode, lunchBreak.hashCode, total.hashCode, assignedStaff.hashCode, shifts.hashCode, requested.hashCode, hub.hashCode, recurringDays.hashCode, permanentDays.hashCode, poReference.hashCode, detectedConflicts.hashCode, notes.hashCode, createdAt.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + json['businessId'] = nativeToJson(businessId); + json['orderType'] = + orderTypeSerializer(orderType) + ; + if (location != null) { + json['location'] = nativeToJson(location); + } + json['status'] = + orderStatusSerializer(status) + ; + if (date != null) { + json['date'] = date!.toJson(); + } + if (startDate != null) { + json['startDate'] = startDate!.toJson(); + } + if (endDate != null) { + json['endDate'] = endDate!.toJson(); + } + if (duration != null) { + json['duration'] = + orderDurationSerializer(duration!) + ; + } + if (lunchBreak != null) { + json['lunchBreak'] = nativeToJson(lunchBreak); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (assignedStaff != null) { + json['assignedStaff'] = assignedStaff!.toJson(); + } + if (shifts != null) { + json['shifts'] = shifts!.toJson(); + } + if (requested != null) { + json['requested'] = nativeToJson(requested); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (recurringDays != null) { + json['recurringDays'] = recurringDays!.toJson(); + } + if (permanentDays != null) { + json['permanentDays'] = permanentDays!.toJson(); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + if (detectedConflicts != null) { + json['detectedConflicts'] = detectedConflicts!.toJson(); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetRapidOrdersOrders({ + required this.id, + this.eventName, + this.vendorId, + required this.businessId, + required this.orderType, + this.location, + required this.status, + this.date, + this.startDate, + this.endDate, + this.duration, + this.lunchBreak, + this.total, + this.assignedStaff, + this.shifts, + this.requested, + this.hub, + this.recurringDays, + this.permanentDays, + this.poReference, + this.detectedConflicts, + this.notes, + this.createdAt, + required this.business, + this.vendor, + }); +} + +@immutable +class GetRapidOrdersOrdersBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetRapidOrdersOrdersBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRapidOrdersOrdersBusiness otherTyped = other as GetRapidOrdersOrdersBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetRapidOrdersOrdersBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetRapidOrdersOrdersVendor { + final String id; + final String companyName; + GetRapidOrdersOrdersVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRapidOrdersOrdersVendor otherTyped = other as GetRapidOrdersOrdersVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetRapidOrdersOrdersVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetRapidOrdersData { + final List orders; + GetRapidOrdersData.fromJson(dynamic json): + + orders = (json['orders'] as List) + .map((e) => GetRapidOrdersOrders.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRapidOrdersData otherTyped = other as GetRapidOrdersData; + return orders == otherTyped.orders; + + } + @override + int get hashCode => orders.hashCode; + + + Map toJson() { + Map json = {}; + json['orders'] = orders.map((e) => e.toJson()).toList(); + return json; + } + + GetRapidOrdersData({ + required this.orders, + }); +} + +@immutable +class GetRapidOrdersVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetRapidOrdersVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRapidOrdersVariables otherTyped = other as GetRapidOrdersVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + GetRapidOrdersVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_recent_payment_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_recent_payment_by_id.dart new file mode 100644 index 00000000..11ef4fd3 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_recent_payment_by_id.dart @@ -0,0 +1,582 @@ +part of 'generated.dart'; + +class GetRecentPaymentByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetRecentPaymentByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetRecentPaymentByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetRecentPaymentByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetRecentPaymentByIdVariables vars= GetRecentPaymentByIdVariables(id: id,); + return _dataConnect.query("getRecentPaymentById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetRecentPaymentByIdRecentPayment { + final String id; + final String? workedTime; + final EnumValue? status; + final String staffId; + final String applicationId; + final String invoiceId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final GetRecentPaymentByIdRecentPaymentApplication application; + final GetRecentPaymentByIdRecentPaymentInvoice invoice; + GetRecentPaymentByIdRecentPayment.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workedTime = json['workedTime'] == null ? null : nativeFromJson(json['workedTime']), + status = json['status'] == null ? null : recentPaymentStatusDeserializer(json['status']), + staffId = nativeFromJson(json['staffId']), + applicationId = nativeFromJson(json['applicationId']), + invoiceId = nativeFromJson(json['invoiceId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + application = GetRecentPaymentByIdRecentPaymentApplication.fromJson(json['application']), + invoice = GetRecentPaymentByIdRecentPaymentInvoice.fromJson(json['invoice']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRecentPaymentByIdRecentPayment otherTyped = other as GetRecentPaymentByIdRecentPayment; + return id == otherTyped.id && + workedTime == otherTyped.workedTime && + status == otherTyped.status && + staffId == otherTyped.staffId && + applicationId == otherTyped.applicationId && + invoiceId == otherTyped.invoiceId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + application == otherTyped.application && + invoice == otherTyped.invoice; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workedTime.hashCode, status.hashCode, staffId.hashCode, applicationId.hashCode, invoiceId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, application.hashCode, invoice.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (workedTime != null) { + json['workedTime'] = nativeToJson(workedTime); + } + if (status != null) { + json['status'] = + recentPaymentStatusSerializer(status!) + ; + } + json['staffId'] = nativeToJson(staffId); + json['applicationId'] = nativeToJson(applicationId); + json['invoiceId'] = nativeToJson(invoiceId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['application'] = application.toJson(); + json['invoice'] = invoice.toJson(); + return json; + } + + GetRecentPaymentByIdRecentPayment({ + required this.id, + this.workedTime, + this.status, + required this.staffId, + required this.applicationId, + required this.invoiceId, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.application, + required this.invoice, + }); +} + +@immutable +class GetRecentPaymentByIdRecentPaymentApplication { + final Timestamp? checkInTime; + final Timestamp? checkOutTime; + final GetRecentPaymentByIdRecentPaymentApplicationShiftRole shiftRole; + GetRecentPaymentByIdRecentPaymentApplication.fromJson(dynamic json): + + checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']), + checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']), + shiftRole = GetRecentPaymentByIdRecentPaymentApplicationShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRecentPaymentByIdRecentPaymentApplication otherTyped = other as GetRecentPaymentByIdRecentPaymentApplication; + return checkInTime == otherTyped.checkInTime && + checkOutTime == otherTyped.checkOutTime && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([checkInTime.hashCode, checkOutTime.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + if (checkInTime != null) { + json['checkInTime'] = checkInTime!.toJson(); + } + if (checkOutTime != null) { + json['checkOutTime'] = checkOutTime!.toJson(); + } + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + GetRecentPaymentByIdRecentPaymentApplication({ + this.checkInTime, + this.checkOutTime, + required this.shiftRole, + }); +} + +@immutable +class GetRecentPaymentByIdRecentPaymentApplicationShiftRole { + final double? hours; + final double? totalValue; + final Timestamp? startTime; + final Timestamp? endTime; + final GetRecentPaymentByIdRecentPaymentApplicationShiftRoleRole role; + final GetRecentPaymentByIdRecentPaymentApplicationShiftRoleShift shift; + GetRecentPaymentByIdRecentPaymentApplicationShiftRole.fromJson(dynamic json): + + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + role = GetRecentPaymentByIdRecentPaymentApplicationShiftRoleRole.fromJson(json['role']), + shift = GetRecentPaymentByIdRecentPaymentApplicationShiftRoleShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRecentPaymentByIdRecentPaymentApplicationShiftRole otherTyped = other as GetRecentPaymentByIdRecentPaymentApplicationShiftRole; + return hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([hours.hashCode, totalValue.hashCode, startTime.hashCode, endTime.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + GetRecentPaymentByIdRecentPaymentApplicationShiftRole({ + this.hours, + this.totalValue, + this.startTime, + this.endTime, + required this.role, + required this.shift, + }); +} + +@immutable +class GetRecentPaymentByIdRecentPaymentApplicationShiftRoleRole { + final String name; + final double costPerHour; + GetRecentPaymentByIdRecentPaymentApplicationShiftRoleRole.fromJson(dynamic json): + + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRecentPaymentByIdRecentPaymentApplicationShiftRoleRole otherTyped = other as GetRecentPaymentByIdRecentPaymentApplicationShiftRoleRole; + return name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + GetRecentPaymentByIdRecentPaymentApplicationShiftRoleRole({ + required this.name, + required this.costPerHour, + }); +} + +@immutable +class GetRecentPaymentByIdRecentPaymentApplicationShiftRoleShift { + final String title; + final Timestamp? date; + final String? location; + final String? locationAddress; + final String? description; + GetRecentPaymentByIdRecentPaymentApplicationShiftRoleShift.fromJson(dynamic json): + + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + description = json['description'] == null ? null : nativeFromJson(json['description']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRecentPaymentByIdRecentPaymentApplicationShiftRoleShift otherTyped = other as GetRecentPaymentByIdRecentPaymentApplicationShiftRoleShift; + return title == otherTyped.title && + date == otherTyped.date && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + description == otherTyped.description; + + } + @override + int get hashCode => Object.hashAll([title.hashCode, date.hashCode, location.hashCode, locationAddress.hashCode, description.hashCode]); + + + Map toJson() { + Map json = {}; + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + return json; + } + + GetRecentPaymentByIdRecentPaymentApplicationShiftRoleShift({ + required this.title, + this.date, + this.location, + this.locationAddress, + this.description, + }); +} + +@immutable +class GetRecentPaymentByIdRecentPaymentInvoice { + final EnumValue status; + final String invoiceNumber; + final Timestamp issueDate; + final GetRecentPaymentByIdRecentPaymentInvoiceBusiness business; + final GetRecentPaymentByIdRecentPaymentInvoiceVendor vendor; + final GetRecentPaymentByIdRecentPaymentInvoiceOrder order; + GetRecentPaymentByIdRecentPaymentInvoice.fromJson(dynamic json): + + status = invoiceStatusDeserializer(json['status']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + issueDate = Timestamp.fromJson(json['issueDate']), + business = GetRecentPaymentByIdRecentPaymentInvoiceBusiness.fromJson(json['business']), + vendor = GetRecentPaymentByIdRecentPaymentInvoiceVendor.fromJson(json['vendor']), + order = GetRecentPaymentByIdRecentPaymentInvoiceOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRecentPaymentByIdRecentPaymentInvoice otherTyped = other as GetRecentPaymentByIdRecentPaymentInvoice; + return status == otherTyped.status && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + business == otherTyped.business && + vendor == otherTyped.vendor && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([status.hashCode, invoiceNumber.hashCode, issueDate.hashCode, business.hashCode, vendor.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['status'] = + invoiceStatusSerializer(status) + ; + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['issueDate'] = issueDate.toJson(); + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + json['order'] = order.toJson(); + return json; + } + + GetRecentPaymentByIdRecentPaymentInvoice({ + required this.status, + required this.invoiceNumber, + required this.issueDate, + required this.business, + required this.vendor, + required this.order, + }); +} + +@immutable +class GetRecentPaymentByIdRecentPaymentInvoiceBusiness { + final String id; + final String businessName; + GetRecentPaymentByIdRecentPaymentInvoiceBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRecentPaymentByIdRecentPaymentInvoiceBusiness otherTyped = other as GetRecentPaymentByIdRecentPaymentInvoiceBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + GetRecentPaymentByIdRecentPaymentInvoiceBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class GetRecentPaymentByIdRecentPaymentInvoiceVendor { + final String id; + final String companyName; + GetRecentPaymentByIdRecentPaymentInvoiceVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRecentPaymentByIdRecentPaymentInvoiceVendor otherTyped = other as GetRecentPaymentByIdRecentPaymentInvoiceVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetRecentPaymentByIdRecentPaymentInvoiceVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetRecentPaymentByIdRecentPaymentInvoiceOrder { + final String id; + final String? eventName; + GetRecentPaymentByIdRecentPaymentInvoiceOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRecentPaymentByIdRecentPaymentInvoiceOrder otherTyped = other as GetRecentPaymentByIdRecentPaymentInvoiceOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + return json; + } + + GetRecentPaymentByIdRecentPaymentInvoiceOrder({ + required this.id, + this.eventName, + }); +} + +@immutable +class GetRecentPaymentByIdData { + final GetRecentPaymentByIdRecentPayment? recentPayment; + GetRecentPaymentByIdData.fromJson(dynamic json): + + recentPayment = json['recentPayment'] == null ? null : GetRecentPaymentByIdRecentPayment.fromJson(json['recentPayment']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRecentPaymentByIdData otherTyped = other as GetRecentPaymentByIdData; + return recentPayment == otherTyped.recentPayment; + + } + @override + int get hashCode => recentPayment.hashCode; + + + Map toJson() { + Map json = {}; + if (recentPayment != null) { + json['recentPayment'] = recentPayment!.toJson(); + } + return json; + } + + GetRecentPaymentByIdData({ + this.recentPayment, + }); +} + +@immutable +class GetRecentPaymentByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetRecentPaymentByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRecentPaymentByIdVariables otherTyped = other as GetRecentPaymentByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetRecentPaymentByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_role_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_role_by_id.dart new file mode 100644 index 00000000..8eb99ee3 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_role_by_id.dart @@ -0,0 +1,151 @@ +part of 'generated.dart'; + +class GetRoleByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetRoleByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetRoleByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetRoleByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetRoleByIdVariables vars= GetRoleByIdVariables(id: id,); + return _dataConnect.query("getRoleById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetRoleByIdRole { + final String id; + final String name; + final double costPerHour; + final String vendorId; + final String roleCategoryId; + final Timestamp? createdAt; + GetRoleByIdRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']), + vendorId = nativeFromJson(json['vendorId']), + roleCategoryId = nativeFromJson(json['roleCategoryId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRoleByIdRole otherTyped = other as GetRoleByIdRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour && + vendorId == otherTyped.vendorId && + roleCategoryId == otherTyped.roleCategoryId && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode, vendorId.hashCode, roleCategoryId.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + json['vendorId'] = nativeToJson(vendorId); + json['roleCategoryId'] = nativeToJson(roleCategoryId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + GetRoleByIdRole({ + required this.id, + required this.name, + required this.costPerHour, + required this.vendorId, + required this.roleCategoryId, + this.createdAt, + }); +} + +@immutable +class GetRoleByIdData { + final GetRoleByIdRole? role; + GetRoleByIdData.fromJson(dynamic json): + + role = json['role'] == null ? null : GetRoleByIdRole.fromJson(json['role']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRoleByIdData otherTyped = other as GetRoleByIdData; + return role == otherTyped.role; + + } + @override + int get hashCode => role.hashCode; + + + Map toJson() { + Map json = {}; + if (role != null) { + json['role'] = role!.toJson(); + } + return json; + } + + GetRoleByIdData({ + this.role, + }); +} + +@immutable +class GetRoleByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetRoleByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRoleByIdVariables otherTyped = other as GetRoleByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetRoleByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_role_categories_by_category.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_role_categories_by_category.dart new file mode 100644 index 00000000..98e597f6 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_role_categories_by_category.dart @@ -0,0 +1,138 @@ +part of 'generated.dart'; + +class GetRoleCategoriesByCategoryVariablesBuilder { + RoleCategoryType category; + + final FirebaseDataConnect _dataConnect; + GetRoleCategoriesByCategoryVariablesBuilder(this._dataConnect, {required this.category,}); + Deserializer dataDeserializer = (dynamic json) => GetRoleCategoriesByCategoryData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetRoleCategoriesByCategoryVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetRoleCategoriesByCategoryVariables vars= GetRoleCategoriesByCategoryVariables(category: category,); + return _dataConnect.query("getRoleCategoriesByCategory", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetRoleCategoriesByCategoryRoleCategories { + final String id; + final String roleName; + final EnumValue category; + GetRoleCategoriesByCategoryRoleCategories.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + roleName = nativeFromJson(json['roleName']), + category = roleCategoryTypeDeserializer(json['category']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRoleCategoriesByCategoryRoleCategories otherTyped = other as GetRoleCategoriesByCategoryRoleCategories; + return id == otherTyped.id && + roleName == otherTyped.roleName && + category == otherTyped.category; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, roleName.hashCode, category.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['roleName'] = nativeToJson(roleName); + json['category'] = + roleCategoryTypeSerializer(category) + ; + return json; + } + + GetRoleCategoriesByCategoryRoleCategories({ + required this.id, + required this.roleName, + required this.category, + }); +} + +@immutable +class GetRoleCategoriesByCategoryData { + final List roleCategories; + GetRoleCategoriesByCategoryData.fromJson(dynamic json): + + roleCategories = (json['roleCategories'] as List) + .map((e) => GetRoleCategoriesByCategoryRoleCategories.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRoleCategoriesByCategoryData otherTyped = other as GetRoleCategoriesByCategoryData; + return roleCategories == otherTyped.roleCategories; + + } + @override + int get hashCode => roleCategories.hashCode; + + + Map toJson() { + Map json = {}; + json['roleCategories'] = roleCategories.map((e) => e.toJson()).toList(); + return json; + } + + GetRoleCategoriesByCategoryData({ + required this.roleCategories, + }); +} + +@immutable +class GetRoleCategoriesByCategoryVariables { + final RoleCategoryType category; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetRoleCategoriesByCategoryVariables.fromJson(Map json): + + category = RoleCategoryType.values.byName(json['category']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRoleCategoriesByCategoryVariables otherTyped = other as GetRoleCategoriesByCategoryVariables; + return category == otherTyped.category; + + } + @override + int get hashCode => category.hashCode; + + + Map toJson() { + Map json = {}; + json['category'] = + category.name + ; + return json; + } + + GetRoleCategoriesByCategoryVariables({ + required this.category, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_role_category_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_role_category_by_id.dart new file mode 100644 index 00000000..6b87597d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_role_category_by_id.dart @@ -0,0 +1,150 @@ +part of 'generated.dart'; + +class GetRoleCategoryByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetRoleCategoryByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetRoleCategoryByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetRoleCategoryByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetRoleCategoryByIdVariables vars= GetRoleCategoryByIdVariables(id: id,); + return _dataConnect.query("getRoleCategoryById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetRoleCategoryByIdRoleCategory { + final String id; + final String roleName; + final EnumValue category; + final Timestamp? createdAt; + final Timestamp? updatedAt; + GetRoleCategoryByIdRoleCategory.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + roleName = nativeFromJson(json['roleName']), + category = roleCategoryTypeDeserializer(json['category']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRoleCategoryByIdRoleCategory otherTyped = other as GetRoleCategoryByIdRoleCategory; + return id == otherTyped.id && + roleName == otherTyped.roleName && + category == otherTyped.category && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, roleName.hashCode, category.hashCode, createdAt.hashCode, updatedAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['roleName'] = nativeToJson(roleName); + json['category'] = + roleCategoryTypeSerializer(category) + ; + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + return json; + } + + GetRoleCategoryByIdRoleCategory({ + required this.id, + required this.roleName, + required this.category, + this.createdAt, + this.updatedAt, + }); +} + +@immutable +class GetRoleCategoryByIdData { + final GetRoleCategoryByIdRoleCategory? roleCategory; + GetRoleCategoryByIdData.fromJson(dynamic json): + + roleCategory = json['roleCategory'] == null ? null : GetRoleCategoryByIdRoleCategory.fromJson(json['roleCategory']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRoleCategoryByIdData otherTyped = other as GetRoleCategoryByIdData; + return roleCategory == otherTyped.roleCategory; + + } + @override + int get hashCode => roleCategory.hashCode; + + + Map toJson() { + Map json = {}; + if (roleCategory != null) { + json['roleCategory'] = roleCategory!.toJson(); + } + return json; + } + + GetRoleCategoryByIdData({ + this.roleCategory, + }); +} + +@immutable +class GetRoleCategoryByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetRoleCategoryByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetRoleCategoryByIdVariables otherTyped = other as GetRoleCategoryByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetRoleCategoryByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_shift_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_shift_by_id.dart new file mode 100644 index 00000000..30277381 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_shift_by_id.dart @@ -0,0 +1,447 @@ +part of 'generated.dart'; + +class GetShiftByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetShiftByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetShiftByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetShiftByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetShiftByIdVariables vars= GetShiftByIdVariables(id: id,); + return _dataConnect.query("getShiftById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetShiftByIdShift { + final String id; + final String title; + final String orderId; + final Timestamp? date; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? cost; + final String? location; + final String? locationAddress; + final double? latitude; + final double? longitude; + final String? description; + final EnumValue? status; + final int? workersNeeded; + final int? filled; + final Timestamp? filledAt; + final List? managers; + final int? durationDays; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final GetShiftByIdShiftOrder order; + GetShiftByIdShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + orderId = nativeFromJson(json['orderId']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + cost = json['cost'] == null ? null : nativeFromJson(json['cost']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + latitude = json['latitude'] == null ? null : nativeFromJson(json['latitude']), + longitude = json['longitude'] == null ? null : nativeFromJson(json['longitude']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson(json['workersNeeded']), + filled = json['filled'] == null ? null : nativeFromJson(json['filled']), + filledAt = json['filledAt'] == null ? null : Timestamp.fromJson(json['filledAt']), + managers = json['managers'] == null ? null : (json['managers'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(), + durationDays = json['durationDays'] == null ? null : nativeFromJson(json['durationDays']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + order = GetShiftByIdShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftByIdShift otherTyped = other as GetShiftByIdShift; + return id == otherTyped.id && + title == otherTyped.title && + orderId == otherTyped.orderId && + date == otherTyped.date && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + cost == otherTyped.cost && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + latitude == otherTyped.latitude && + longitude == otherTyped.longitude && + description == otherTyped.description && + status == otherTyped.status && + workersNeeded == otherTyped.workersNeeded && + filled == otherTyped.filled && + filledAt == otherTyped.filledAt && + managers == otherTyped.managers && + durationDays == otherTyped.durationDays && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + json['orderId'] = nativeToJson(orderId); + if (date != null) { + json['date'] = date!.toJson(); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (cost != null) { + json['cost'] = nativeToJson(cost); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (latitude != null) { + json['latitude'] = nativeToJson(latitude); + } + if (longitude != null) { + json['longitude'] = nativeToJson(longitude); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + if (workersNeeded != null) { + json['workersNeeded'] = nativeToJson(workersNeeded); + } + if (filled != null) { + json['filled'] = nativeToJson(filled); + } + if (filledAt != null) { + json['filledAt'] = filledAt!.toJson(); + } + if (managers != null) { + json['managers'] = managers?.map((e) => e!.toJson()).toList(); + } + if (durationDays != null) { + json['durationDays'] = nativeToJson(durationDays); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['order'] = order.toJson(); + return json; + } + + GetShiftByIdShift({ + required this.id, + required this.title, + required this.orderId, + this.date, + this.startTime, + this.endTime, + this.hours, + this.cost, + this.location, + this.locationAddress, + this.latitude, + this.longitude, + this.description, + this.status, + this.workersNeeded, + this.filled, + this.filledAt, + this.managers, + this.durationDays, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.order, + }); +} + +@immutable +class GetShiftByIdShiftOrder { + final String id; + final String? eventName; + final EnumValue status; + final EnumValue orderType; + final String businessId; + final String? vendorId; + final GetShiftByIdShiftOrderBusiness business; + final GetShiftByIdShiftOrderVendor? vendor; + GetShiftByIdShiftOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + status = orderStatusDeserializer(json['status']), + orderType = orderTypeDeserializer(json['orderType']), + businessId = nativeFromJson(json['businessId']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + business = GetShiftByIdShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetShiftByIdShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftByIdShiftOrder otherTyped = other as GetShiftByIdShiftOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + status == otherTyped.status && + orderType == otherTyped.orderType && + businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, status.hashCode, orderType.hashCode, businessId.hashCode, vendorId.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['status'] = + orderStatusSerializer(status) + ; + json['orderType'] = + orderTypeSerializer(orderType) + ; + json['businessId'] = nativeToJson(businessId); + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetShiftByIdShiftOrder({ + required this.id, + this.eventName, + required this.status, + required this.orderType, + required this.businessId, + this.vendorId, + required this.business, + this.vendor, + }); +} + +@immutable +class GetShiftByIdShiftOrderBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetShiftByIdShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftByIdShiftOrderBusiness otherTyped = other as GetShiftByIdShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetShiftByIdShiftOrderBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetShiftByIdShiftOrderVendor { + final String id; + final String companyName; + GetShiftByIdShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftByIdShiftOrderVendor otherTyped = other as GetShiftByIdShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetShiftByIdShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetShiftByIdData { + final GetShiftByIdShift? shift; + GetShiftByIdData.fromJson(dynamic json): + + shift = json['shift'] == null ? null : GetShiftByIdShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftByIdData otherTyped = other as GetShiftByIdData; + return shift == otherTyped.shift; + + } + @override + int get hashCode => shift.hashCode; + + + Map toJson() { + Map json = {}; + if (shift != null) { + json['shift'] = shift!.toJson(); + } + return json; + } + + GetShiftByIdData({ + this.shift, + }); +} + +@immutable +class GetShiftByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetShiftByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftByIdVariables otherTyped = other as GetShiftByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetShiftByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_shift_role_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_shift_role_by_id.dart new file mode 100644 index 00000000..833f164e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_shift_role_by_id.dart @@ -0,0 +1,464 @@ +part of 'generated.dart'; + +class GetShiftRoleByIdVariablesBuilder { + String shiftId; + String roleId; + + final FirebaseDataConnect _dataConnect; + GetShiftRoleByIdVariablesBuilder(this._dataConnect, {required this.shiftId,required this.roleId,}); + Deserializer dataDeserializer = (dynamic json) => GetShiftRoleByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetShiftRoleByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetShiftRoleByIdVariables vars= GetShiftRoleByIdVariables(shiftId: shiftId,roleId: roleId,); + return _dataConnect.query("getShiftRoleById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetShiftRoleByIdShiftRole { + final String id; + final String shiftId; + final String roleId; + final int count; + final int? assigned; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final String? department; + final String? uniform; + final EnumValue? breakType; + final double? totalValue; + final Timestamp? createdAt; + final GetShiftRoleByIdShiftRoleRole role; + final GetShiftRoleByIdShiftRoleShift shift; + GetShiftRoleByIdShiftRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']), + count = nativeFromJson(json['count']), + assigned = json['assigned'] == null ? null : nativeFromJson(json['assigned']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + department = json['department'] == null ? null : nativeFromJson(json['department']), + uniform = json['uniform'] == null ? null : nativeFromJson(json['uniform']), + breakType = json['breakType'] == null ? null : breakDurationDeserializer(json['breakType']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + role = GetShiftRoleByIdShiftRoleRole.fromJson(json['role']), + shift = GetShiftRoleByIdShiftRoleShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftRoleByIdShiftRole otherTyped = other as GetShiftRoleByIdShiftRole; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + department == otherTyped.department && + uniform == otherTyped.uniform && + breakType == otherTyped.breakType && + totalValue == otherTyped.totalValue && + createdAt == otherTyped.createdAt && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, department.hashCode, uniform.hashCode, breakType.hashCode, totalValue.hashCode, createdAt.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + json['count'] = nativeToJson(count); + if (assigned != null) { + json['assigned'] = nativeToJson(assigned); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (department != null) { + json['department'] = nativeToJson(department); + } + if (uniform != null) { + json['uniform'] = nativeToJson(uniform); + } + if (breakType != null) { + json['breakType'] = + breakDurationSerializer(breakType!) + ; + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + GetShiftRoleByIdShiftRole({ + required this.id, + required this.shiftId, + required this.roleId, + required this.count, + this.assigned, + this.startTime, + this.endTime, + this.hours, + this.department, + this.uniform, + this.breakType, + this.totalValue, + this.createdAt, + required this.role, + required this.shift, + }); +} + +@immutable +class GetShiftRoleByIdShiftRoleRole { + final String id; + final String name; + final double costPerHour; + GetShiftRoleByIdShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftRoleByIdShiftRoleRole otherTyped = other as GetShiftRoleByIdShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + GetShiftRoleByIdShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class GetShiftRoleByIdShiftRoleShift { + final String? location; + final String? locationAddress; + final String? description; + final String orderId; + final GetShiftRoleByIdShiftRoleShiftOrder order; + GetShiftRoleByIdShiftRoleShift.fromJson(dynamic json): + + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + orderId = nativeFromJson(json['orderId']), + order = GetShiftRoleByIdShiftRoleShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftRoleByIdShiftRoleShift otherTyped = other as GetShiftRoleByIdShiftRoleShift; + return location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + description == otherTyped.description && + orderId == otherTyped.orderId && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([location.hashCode, locationAddress.hashCode, description.hashCode, orderId.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + json['orderId'] = nativeToJson(orderId); + json['order'] = order.toJson(); + return json; + } + + GetShiftRoleByIdShiftRoleShift({ + this.location, + this.locationAddress, + this.description, + required this.orderId, + required this.order, + }); +} + +@immutable +class GetShiftRoleByIdShiftRoleShiftOrder { + final AnyValue? recurringDays; + final AnyValue? permanentDays; + final String? notes; + final GetShiftRoleByIdShiftRoleShiftOrderBusiness business; + final GetShiftRoleByIdShiftRoleShiftOrderVendor? vendor; + GetShiftRoleByIdShiftRoleShiftOrder.fromJson(dynamic json): + + recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), + permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + business = GetShiftRoleByIdShiftRoleShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetShiftRoleByIdShiftRoleShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftRoleByIdShiftRoleShiftOrder otherTyped = other as GetShiftRoleByIdShiftRoleShiftOrder; + return recurringDays == otherTyped.recurringDays && + permanentDays == otherTyped.permanentDays && + notes == otherTyped.notes && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([recurringDays.hashCode, permanentDays.hashCode, notes.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + if (recurringDays != null) { + json['recurringDays'] = recurringDays!.toJson(); + } + if (permanentDays != null) { + json['permanentDays'] = permanentDays!.toJson(); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetShiftRoleByIdShiftRoleShiftOrder({ + this.recurringDays, + this.permanentDays, + this.notes, + required this.business, + this.vendor, + }); +} + +@immutable +class GetShiftRoleByIdShiftRoleShiftOrderBusiness { + final String id; + final String businessName; + GetShiftRoleByIdShiftRoleShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftRoleByIdShiftRoleShiftOrderBusiness otherTyped = other as GetShiftRoleByIdShiftRoleShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + GetShiftRoleByIdShiftRoleShiftOrderBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class GetShiftRoleByIdShiftRoleShiftOrderVendor { + final String id; + final String companyName; + GetShiftRoleByIdShiftRoleShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftRoleByIdShiftRoleShiftOrderVendor otherTyped = other as GetShiftRoleByIdShiftRoleShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetShiftRoleByIdShiftRoleShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetShiftRoleByIdData { + final GetShiftRoleByIdShiftRole? shiftRole; + GetShiftRoleByIdData.fromJson(dynamic json): + + shiftRole = json['shiftRole'] == null ? null : GetShiftRoleByIdShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftRoleByIdData otherTyped = other as GetShiftRoleByIdData; + return shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => shiftRole.hashCode; + + + Map toJson() { + Map json = {}; + if (shiftRole != null) { + json['shiftRole'] = shiftRole!.toJson(); + } + return json; + } + + GetShiftRoleByIdData({ + this.shiftRole, + }); +} + +@immutable +class GetShiftRoleByIdVariables { + final String shiftId; + final String roleId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetShiftRoleByIdVariables.fromJson(Map json): + + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftRoleByIdVariables otherTyped = other as GetShiftRoleByIdVariables; + return shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + return json; + } + + GetShiftRoleByIdVariables({ + required this.shiftId, + required this.roleId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_shifts_by_business_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_shifts_by_business_id.dart new file mode 100644 index 00000000..fd6f1b1f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_shifts_by_business_id.dart @@ -0,0 +1,510 @@ +part of 'generated.dart'; + +class GetShiftsByBusinessIdVariablesBuilder { + String businessId; + Optional _dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer); + Optional _dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer); + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; GetShiftsByBusinessIdVariablesBuilder dateFrom(Timestamp? t) { + _dateFrom.value = t; + return this; + } + GetShiftsByBusinessIdVariablesBuilder dateTo(Timestamp? t) { + _dateTo.value = t; + return this; + } + GetShiftsByBusinessIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetShiftsByBusinessIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + GetShiftsByBusinessIdVariablesBuilder(this._dataConnect, {required this.businessId,}); + Deserializer dataDeserializer = (dynamic json) => GetShiftsByBusinessIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetShiftsByBusinessIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetShiftsByBusinessIdVariables vars= GetShiftsByBusinessIdVariables(businessId: businessId,dateFrom: _dateFrom,dateTo: _dateTo,offset: _offset,limit: _limit,); + return _dataConnect.query("getShiftsByBusinessId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetShiftsByBusinessIdShifts { + final String id; + final String title; + final String orderId; + final Timestamp? date; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? cost; + final String? location; + final String? locationAddress; + final double? latitude; + final double? longitude; + final String? description; + final EnumValue? status; + final int? workersNeeded; + final int? filled; + final Timestamp? filledAt; + final List? managers; + final int? durationDays; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final GetShiftsByBusinessIdShiftsOrder order; + GetShiftsByBusinessIdShifts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + orderId = nativeFromJson(json['orderId']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + cost = json['cost'] == null ? null : nativeFromJson(json['cost']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + latitude = json['latitude'] == null ? null : nativeFromJson(json['latitude']), + longitude = json['longitude'] == null ? null : nativeFromJson(json['longitude']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson(json['workersNeeded']), + filled = json['filled'] == null ? null : nativeFromJson(json['filled']), + filledAt = json['filledAt'] == null ? null : Timestamp.fromJson(json['filledAt']), + managers = json['managers'] == null ? null : (json['managers'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(), + durationDays = json['durationDays'] == null ? null : nativeFromJson(json['durationDays']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + order = GetShiftsByBusinessIdShiftsOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftsByBusinessIdShifts otherTyped = other as GetShiftsByBusinessIdShifts; + return id == otherTyped.id && + title == otherTyped.title && + orderId == otherTyped.orderId && + date == otherTyped.date && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + cost == otherTyped.cost && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + latitude == otherTyped.latitude && + longitude == otherTyped.longitude && + description == otherTyped.description && + status == otherTyped.status && + workersNeeded == otherTyped.workersNeeded && + filled == otherTyped.filled && + filledAt == otherTyped.filledAt && + managers == otherTyped.managers && + durationDays == otherTyped.durationDays && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + json['orderId'] = nativeToJson(orderId); + if (date != null) { + json['date'] = date!.toJson(); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (cost != null) { + json['cost'] = nativeToJson(cost); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (latitude != null) { + json['latitude'] = nativeToJson(latitude); + } + if (longitude != null) { + json['longitude'] = nativeToJson(longitude); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + if (workersNeeded != null) { + json['workersNeeded'] = nativeToJson(workersNeeded); + } + if (filled != null) { + json['filled'] = nativeToJson(filled); + } + if (filledAt != null) { + json['filledAt'] = filledAt!.toJson(); + } + if (managers != null) { + json['managers'] = managers?.map((e) => e!.toJson()).toList(); + } + if (durationDays != null) { + json['durationDays'] = nativeToJson(durationDays); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['order'] = order.toJson(); + return json; + } + + GetShiftsByBusinessIdShifts({ + required this.id, + required this.title, + required this.orderId, + this.date, + this.startTime, + this.endTime, + this.hours, + this.cost, + this.location, + this.locationAddress, + this.latitude, + this.longitude, + this.description, + this.status, + this.workersNeeded, + this.filled, + this.filledAt, + this.managers, + this.durationDays, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.order, + }); +} + +@immutable +class GetShiftsByBusinessIdShiftsOrder { + final String id; + final String? eventName; + final EnumValue status; + final EnumValue orderType; + final String businessId; + final String? vendorId; + final GetShiftsByBusinessIdShiftsOrderBusiness business; + final GetShiftsByBusinessIdShiftsOrderVendor? vendor; + GetShiftsByBusinessIdShiftsOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + status = orderStatusDeserializer(json['status']), + orderType = orderTypeDeserializer(json['orderType']), + businessId = nativeFromJson(json['businessId']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + business = GetShiftsByBusinessIdShiftsOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetShiftsByBusinessIdShiftsOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftsByBusinessIdShiftsOrder otherTyped = other as GetShiftsByBusinessIdShiftsOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + status == otherTyped.status && + orderType == otherTyped.orderType && + businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, status.hashCode, orderType.hashCode, businessId.hashCode, vendorId.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['status'] = + orderStatusSerializer(status) + ; + json['orderType'] = + orderTypeSerializer(orderType) + ; + json['businessId'] = nativeToJson(businessId); + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetShiftsByBusinessIdShiftsOrder({ + required this.id, + this.eventName, + required this.status, + required this.orderType, + required this.businessId, + this.vendorId, + required this.business, + this.vendor, + }); +} + +@immutable +class GetShiftsByBusinessIdShiftsOrderBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetShiftsByBusinessIdShiftsOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftsByBusinessIdShiftsOrderBusiness otherTyped = other as GetShiftsByBusinessIdShiftsOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetShiftsByBusinessIdShiftsOrderBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetShiftsByBusinessIdShiftsOrderVendor { + final String id; + final String companyName; + GetShiftsByBusinessIdShiftsOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftsByBusinessIdShiftsOrderVendor otherTyped = other as GetShiftsByBusinessIdShiftsOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetShiftsByBusinessIdShiftsOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetShiftsByBusinessIdData { + final List shifts; + GetShiftsByBusinessIdData.fromJson(dynamic json): + + shifts = (json['shifts'] as List) + .map((e) => GetShiftsByBusinessIdShifts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftsByBusinessIdData otherTyped = other as GetShiftsByBusinessIdData; + return shifts == otherTyped.shifts; + + } + @override + int get hashCode => shifts.hashCode; + + + Map toJson() { + Map json = {}; + json['shifts'] = shifts.map((e) => e.toJson()).toList(); + return json; + } + + GetShiftsByBusinessIdData({ + required this.shifts, + }); +} + +@immutable +class GetShiftsByBusinessIdVariables { + final String businessId; + late final OptionaldateFrom; + late final OptionaldateTo; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetShiftsByBusinessIdVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']) { + + + + dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer); + dateFrom.value = json['dateFrom'] == null ? null : Timestamp.fromJson(json['dateFrom']); + + + dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer); + dateTo.value = json['dateTo'] == null ? null : Timestamp.fromJson(json['dateTo']); + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftsByBusinessIdVariables otherTyped = other as GetShiftsByBusinessIdVariables; + return businessId == otherTyped.businessId && + dateFrom == otherTyped.dateFrom && + dateTo == otherTyped.dateTo && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, dateFrom.hashCode, dateTo.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + if(dateFrom.state == OptionalState.set) { + json['dateFrom'] = dateFrom.toJson(); + } + if(dateTo.state == OptionalState.set) { + json['dateTo'] = dateTo.toJson(); + } + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + GetShiftsByBusinessIdVariables({ + required this.businessId, + required this.dateFrom, + required this.dateTo, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_shifts_by_vendor_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_shifts_by_vendor_id.dart new file mode 100644 index 00000000..1228ab5f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_shifts_by_vendor_id.dart @@ -0,0 +1,510 @@ +part of 'generated.dart'; + +class GetShiftsByVendorIdVariablesBuilder { + String vendorId; + Optional _dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer); + Optional _dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer); + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; GetShiftsByVendorIdVariablesBuilder dateFrom(Timestamp? t) { + _dateFrom.value = t; + return this; + } + GetShiftsByVendorIdVariablesBuilder dateTo(Timestamp? t) { + _dateTo.value = t; + return this; + } + GetShiftsByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + GetShiftsByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + GetShiftsByVendorIdVariablesBuilder(this._dataConnect, {required this.vendorId,}); + Deserializer dataDeserializer = (dynamic json) => GetShiftsByVendorIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetShiftsByVendorIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetShiftsByVendorIdVariables vars= GetShiftsByVendorIdVariables(vendorId: vendorId,dateFrom: _dateFrom,dateTo: _dateTo,offset: _offset,limit: _limit,); + return _dataConnect.query("getShiftsByVendorId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetShiftsByVendorIdShifts { + final String id; + final String title; + final String orderId; + final Timestamp? date; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? cost; + final String? location; + final String? locationAddress; + final double? latitude; + final double? longitude; + final String? description; + final EnumValue? status; + final int? workersNeeded; + final int? filled; + final Timestamp? filledAt; + final List? managers; + final int? durationDays; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final GetShiftsByVendorIdShiftsOrder order; + GetShiftsByVendorIdShifts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + orderId = nativeFromJson(json['orderId']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + cost = json['cost'] == null ? null : nativeFromJson(json['cost']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + latitude = json['latitude'] == null ? null : nativeFromJson(json['latitude']), + longitude = json['longitude'] == null ? null : nativeFromJson(json['longitude']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson(json['workersNeeded']), + filled = json['filled'] == null ? null : nativeFromJson(json['filled']), + filledAt = json['filledAt'] == null ? null : Timestamp.fromJson(json['filledAt']), + managers = json['managers'] == null ? null : (json['managers'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(), + durationDays = json['durationDays'] == null ? null : nativeFromJson(json['durationDays']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + order = GetShiftsByVendorIdShiftsOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftsByVendorIdShifts otherTyped = other as GetShiftsByVendorIdShifts; + return id == otherTyped.id && + title == otherTyped.title && + orderId == otherTyped.orderId && + date == otherTyped.date && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + cost == otherTyped.cost && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + latitude == otherTyped.latitude && + longitude == otherTyped.longitude && + description == otherTyped.description && + status == otherTyped.status && + workersNeeded == otherTyped.workersNeeded && + filled == otherTyped.filled && + filledAt == otherTyped.filledAt && + managers == otherTyped.managers && + durationDays == otherTyped.durationDays && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + json['orderId'] = nativeToJson(orderId); + if (date != null) { + json['date'] = date!.toJson(); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (cost != null) { + json['cost'] = nativeToJson(cost); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (latitude != null) { + json['latitude'] = nativeToJson(latitude); + } + if (longitude != null) { + json['longitude'] = nativeToJson(longitude); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + if (workersNeeded != null) { + json['workersNeeded'] = nativeToJson(workersNeeded); + } + if (filled != null) { + json['filled'] = nativeToJson(filled); + } + if (filledAt != null) { + json['filledAt'] = filledAt!.toJson(); + } + if (managers != null) { + json['managers'] = managers?.map((e) => e!.toJson()).toList(); + } + if (durationDays != null) { + json['durationDays'] = nativeToJson(durationDays); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['order'] = order.toJson(); + return json; + } + + GetShiftsByVendorIdShifts({ + required this.id, + required this.title, + required this.orderId, + this.date, + this.startTime, + this.endTime, + this.hours, + this.cost, + this.location, + this.locationAddress, + this.latitude, + this.longitude, + this.description, + this.status, + this.workersNeeded, + this.filled, + this.filledAt, + this.managers, + this.durationDays, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.order, + }); +} + +@immutable +class GetShiftsByVendorIdShiftsOrder { + final String id; + final String? eventName; + final EnumValue status; + final EnumValue orderType; + final String businessId; + final String? vendorId; + final GetShiftsByVendorIdShiftsOrderBusiness business; + final GetShiftsByVendorIdShiftsOrderVendor? vendor; + GetShiftsByVendorIdShiftsOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + status = orderStatusDeserializer(json['status']), + orderType = orderTypeDeserializer(json['orderType']), + businessId = nativeFromJson(json['businessId']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + business = GetShiftsByVendorIdShiftsOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : GetShiftsByVendorIdShiftsOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftsByVendorIdShiftsOrder otherTyped = other as GetShiftsByVendorIdShiftsOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + status == otherTyped.status && + orderType == otherTyped.orderType && + businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, status.hashCode, orderType.hashCode, businessId.hashCode, vendorId.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['status'] = + orderStatusSerializer(status) + ; + json['orderType'] = + orderTypeSerializer(orderType) + ; + json['businessId'] = nativeToJson(businessId); + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetShiftsByVendorIdShiftsOrder({ + required this.id, + this.eventName, + required this.status, + required this.orderType, + required this.businessId, + this.vendorId, + required this.business, + this.vendor, + }); +} + +@immutable +class GetShiftsByVendorIdShiftsOrderBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + GetShiftsByVendorIdShiftsOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftsByVendorIdShiftsOrderBusiness otherTyped = other as GetShiftsByVendorIdShiftsOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + GetShiftsByVendorIdShiftsOrderBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class GetShiftsByVendorIdShiftsOrderVendor { + final String id; + final String companyName; + GetShiftsByVendorIdShiftsOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftsByVendorIdShiftsOrderVendor otherTyped = other as GetShiftsByVendorIdShiftsOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetShiftsByVendorIdShiftsOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetShiftsByVendorIdData { + final List shifts; + GetShiftsByVendorIdData.fromJson(dynamic json): + + shifts = (json['shifts'] as List) + .map((e) => GetShiftsByVendorIdShifts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftsByVendorIdData otherTyped = other as GetShiftsByVendorIdData; + return shifts == otherTyped.shifts; + + } + @override + int get hashCode => shifts.hashCode; + + + Map toJson() { + Map json = {}; + json['shifts'] = shifts.map((e) => e.toJson()).toList(); + return json; + } + + GetShiftsByVendorIdData({ + required this.shifts, + }); +} + +@immutable +class GetShiftsByVendorIdVariables { + final String vendorId; + late final OptionaldateFrom; + late final OptionaldateTo; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetShiftsByVendorIdVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']) { + + + + dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer); + dateFrom.value = json['dateFrom'] == null ? null : Timestamp.fromJson(json['dateFrom']); + + + dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer); + dateTo.value = json['dateTo'] == null ? null : Timestamp.fromJson(json['dateTo']); + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetShiftsByVendorIdVariables otherTyped = other as GetShiftsByVendorIdVariables; + return vendorId == otherTyped.vendorId && + dateFrom == otherTyped.dateFrom && + dateTo == otherTyped.dateTo && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, dateFrom.hashCode, dateTo.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + if(dateFrom.state == OptionalState.set) { + json['dateFrom'] = dateFrom.toJson(); + } + if(dateTo.state == OptionalState.set) { + json['dateTo'] = dateTo.toJson(); + } + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + GetShiftsByVendorIdVariables({ + required this.vendorId, + required this.dateFrom, + required this.dateTo, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_availability_by_key.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_availability_by_key.dart new file mode 100644 index 00000000..f6f325ba --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_availability_by_key.dart @@ -0,0 +1,238 @@ +part of 'generated.dart'; + +class GetStaffAvailabilityByKeyVariablesBuilder { + String staffId; + DayOfWeek day; + AvailabilitySlot slot; + + final FirebaseDataConnect _dataConnect; + GetStaffAvailabilityByKeyVariablesBuilder(this._dataConnect, {required this.staffId,required this.day,required this.slot,}); + Deserializer dataDeserializer = (dynamic json) => GetStaffAvailabilityByKeyData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetStaffAvailabilityByKeyVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetStaffAvailabilityByKeyVariables vars= GetStaffAvailabilityByKeyVariables(staffId: staffId,day: day,slot: slot,); + return _dataConnect.query("getStaffAvailabilityByKey", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetStaffAvailabilityByKeyStaffAvailability { + final String id; + final String staffId; + final EnumValue day; + final EnumValue slot; + final EnumValue status; + final String? notes; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final GetStaffAvailabilityByKeyStaffAvailabilityStaff staff; + GetStaffAvailabilityByKeyStaffAvailability.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + day = dayOfWeekDeserializer(json['day']), + slot = availabilitySlotDeserializer(json['slot']), + status = availabilityStatusDeserializer(json['status']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + staff = GetStaffAvailabilityByKeyStaffAvailabilityStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffAvailabilityByKeyStaffAvailability otherTyped = other as GetStaffAvailabilityByKeyStaffAvailability; + return id == otherTyped.id && + staffId == otherTyped.staffId && + day == otherTyped.day && + slot == otherTyped.slot && + status == otherTyped.status && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, day.hashCode, slot.hashCode, status.hashCode, notes.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['day'] = + dayOfWeekSerializer(day) + ; + json['slot'] = + availabilitySlotSerializer(slot) + ; + json['status'] = + availabilityStatusSerializer(status) + ; + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['staff'] = staff.toJson(); + return json; + } + + GetStaffAvailabilityByKeyStaffAvailability({ + required this.id, + required this.staffId, + required this.day, + required this.slot, + required this.status, + this.notes, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.staff, + }); +} + +@immutable +class GetStaffAvailabilityByKeyStaffAvailabilityStaff { + final String id; + final String fullName; + GetStaffAvailabilityByKeyStaffAvailabilityStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffAvailabilityByKeyStaffAvailabilityStaff otherTyped = other as GetStaffAvailabilityByKeyStaffAvailabilityStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + GetStaffAvailabilityByKeyStaffAvailabilityStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class GetStaffAvailabilityByKeyData { + final GetStaffAvailabilityByKeyStaffAvailability? staffAvailability; + GetStaffAvailabilityByKeyData.fromJson(dynamic json): + + staffAvailability = json['staffAvailability'] == null ? null : GetStaffAvailabilityByKeyStaffAvailability.fromJson(json['staffAvailability']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffAvailabilityByKeyData otherTyped = other as GetStaffAvailabilityByKeyData; + return staffAvailability == otherTyped.staffAvailability; + + } + @override + int get hashCode => staffAvailability.hashCode; + + + Map toJson() { + Map json = {}; + if (staffAvailability != null) { + json['staffAvailability'] = staffAvailability!.toJson(); + } + return json; + } + + GetStaffAvailabilityByKeyData({ + this.staffAvailability, + }); +} + +@immutable +class GetStaffAvailabilityByKeyVariables { + final String staffId; + final DayOfWeek day; + final AvailabilitySlot slot; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetStaffAvailabilityByKeyVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + day = DayOfWeek.values.byName(json['day']), + slot = AvailabilitySlot.values.byName(json['slot']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffAvailabilityByKeyVariables otherTyped = other as GetStaffAvailabilityByKeyVariables; + return staffId == otherTyped.staffId && + day == otherTyped.day && + slot == otherTyped.slot; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, day.hashCode, slot.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['day'] = + day.name + ; + json['slot'] = + slot.name + ; + return json; + } + + GetStaffAvailabilityByKeyVariables({ + required this.staffId, + required this.day, + required this.slot, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_availability_stats_by_staff_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_availability_stats_by_staff_id.dart new file mode 100644 index 00000000..4b20637a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_availability_stats_by_staff_id.dart @@ -0,0 +1,243 @@ +part of 'generated.dart'; + +class GetStaffAvailabilityStatsByStaffIdVariablesBuilder { + String staffId; + + final FirebaseDataConnect _dataConnect; + GetStaffAvailabilityStatsByStaffIdVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => GetStaffAvailabilityStatsByStaffIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetStaffAvailabilityStatsByStaffIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetStaffAvailabilityStatsByStaffIdVariables vars= GetStaffAvailabilityStatsByStaffIdVariables(staffId: staffId,); + return _dataConnect.query("getStaffAvailabilityStatsByStaffId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetStaffAvailabilityStatsByStaffIdStaffAvailabilityStats { + final String id; + final String staffId; + final int? needWorkIndex; + final int? utilizationPercentage; + final int? predictedAvailabilityScore; + final int? scheduledHoursThisPeriod; + final int? desiredHoursThisPeriod; + final Timestamp? lastShiftDate; + final int? acceptanceRate; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final GetStaffAvailabilityStatsByStaffIdStaffAvailabilityStatsStaff staff; + GetStaffAvailabilityStatsByStaffIdStaffAvailabilityStats.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + needWorkIndex = json['needWorkIndex'] == null ? null : nativeFromJson(json['needWorkIndex']), + utilizationPercentage = json['utilizationPercentage'] == null ? null : nativeFromJson(json['utilizationPercentage']), + predictedAvailabilityScore = json['predictedAvailabilityScore'] == null ? null : nativeFromJson(json['predictedAvailabilityScore']), + scheduledHoursThisPeriod = json['scheduledHoursThisPeriod'] == null ? null : nativeFromJson(json['scheduledHoursThisPeriod']), + desiredHoursThisPeriod = json['desiredHoursThisPeriod'] == null ? null : nativeFromJson(json['desiredHoursThisPeriod']), + lastShiftDate = json['lastShiftDate'] == null ? null : Timestamp.fromJson(json['lastShiftDate']), + acceptanceRate = json['acceptanceRate'] == null ? null : nativeFromJson(json['acceptanceRate']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + staff = GetStaffAvailabilityStatsByStaffIdStaffAvailabilityStatsStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffAvailabilityStatsByStaffIdStaffAvailabilityStats otherTyped = other as GetStaffAvailabilityStatsByStaffIdStaffAvailabilityStats; + return id == otherTyped.id && + staffId == otherTyped.staffId && + needWorkIndex == otherTyped.needWorkIndex && + utilizationPercentage == otherTyped.utilizationPercentage && + predictedAvailabilityScore == otherTyped.predictedAvailabilityScore && + scheduledHoursThisPeriod == otherTyped.scheduledHoursThisPeriod && + desiredHoursThisPeriod == otherTyped.desiredHoursThisPeriod && + lastShiftDate == otherTyped.lastShiftDate && + acceptanceRate == otherTyped.acceptanceRate && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, needWorkIndex.hashCode, utilizationPercentage.hashCode, predictedAvailabilityScore.hashCode, scheduledHoursThisPeriod.hashCode, desiredHoursThisPeriod.hashCode, lastShiftDate.hashCode, acceptanceRate.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + if (needWorkIndex != null) { + json['needWorkIndex'] = nativeToJson(needWorkIndex); + } + if (utilizationPercentage != null) { + json['utilizationPercentage'] = nativeToJson(utilizationPercentage); + } + if (predictedAvailabilityScore != null) { + json['predictedAvailabilityScore'] = nativeToJson(predictedAvailabilityScore); + } + if (scheduledHoursThisPeriod != null) { + json['scheduledHoursThisPeriod'] = nativeToJson(scheduledHoursThisPeriod); + } + if (desiredHoursThisPeriod != null) { + json['desiredHoursThisPeriod'] = nativeToJson(desiredHoursThisPeriod); + } + if (lastShiftDate != null) { + json['lastShiftDate'] = lastShiftDate!.toJson(); + } + if (acceptanceRate != null) { + json['acceptanceRate'] = nativeToJson(acceptanceRate); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['staff'] = staff.toJson(); + return json; + } + + GetStaffAvailabilityStatsByStaffIdStaffAvailabilityStats({ + required this.id, + required this.staffId, + this.needWorkIndex, + this.utilizationPercentage, + this.predictedAvailabilityScore, + this.scheduledHoursThisPeriod, + this.desiredHoursThisPeriod, + this.lastShiftDate, + this.acceptanceRate, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.staff, + }); +} + +@immutable +class GetStaffAvailabilityStatsByStaffIdStaffAvailabilityStatsStaff { + final String id; + final String fullName; + GetStaffAvailabilityStatsByStaffIdStaffAvailabilityStatsStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffAvailabilityStatsByStaffIdStaffAvailabilityStatsStaff otherTyped = other as GetStaffAvailabilityStatsByStaffIdStaffAvailabilityStatsStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + GetStaffAvailabilityStatsByStaffIdStaffAvailabilityStatsStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class GetStaffAvailabilityStatsByStaffIdData { + final GetStaffAvailabilityStatsByStaffIdStaffAvailabilityStats? staffAvailabilityStats; + GetStaffAvailabilityStatsByStaffIdData.fromJson(dynamic json): + + staffAvailabilityStats = json['staffAvailabilityStats'] == null ? null : GetStaffAvailabilityStatsByStaffIdStaffAvailabilityStats.fromJson(json['staffAvailabilityStats']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffAvailabilityStatsByStaffIdData otherTyped = other as GetStaffAvailabilityStatsByStaffIdData; + return staffAvailabilityStats == otherTyped.staffAvailabilityStats; + + } + @override + int get hashCode => staffAvailabilityStats.hashCode; + + + Map toJson() { + Map json = {}; + if (staffAvailabilityStats != null) { + json['staffAvailabilityStats'] = staffAvailabilityStats!.toJson(); + } + return json; + } + + GetStaffAvailabilityStatsByStaffIdData({ + this.staffAvailabilityStats, + }); +} + +@immutable +class GetStaffAvailabilityStatsByStaffIdVariables { + final String staffId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetStaffAvailabilityStatsByStaffIdVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffAvailabilityStatsByStaffIdVariables otherTyped = other as GetStaffAvailabilityStatsByStaffIdVariables; + return staffId == otherTyped.staffId; + + } + @override + int get hashCode => staffId.hashCode; + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + return json; + } + + GetStaffAvailabilityStatsByStaffIdVariables({ + required this.staffId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_by_id.dart new file mode 100644 index 00000000..3820320e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_by_id.dart @@ -0,0 +1,380 @@ +part of 'generated.dart'; + +class GetStaffByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetStaffByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetStaffByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetStaffByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetStaffByIdVariables vars= GetStaffByIdVariables(id: id,); + return _dataConnect.query("getStaffById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetStaffByIdStaff { + final String id; + final String userId; + final String fullName; + final String? role; + final String? level; + final String? phone; + final String? email; + final String? photoUrl; + final int? totalShifts; + final double? averageRating; + final int? onTimeRate; + final int? noShowCount; + final int? cancellationCount; + final int? reliabilityScore; + final int? xp; + final AnyValue? badges; + final bool? isRecommended; + final String? bio; + final AnyValue? industries; + final AnyValue? preferredLocations; + final int? maxDistanceMiles; + final AnyValue? languages; + final AnyValue? itemsAttire; + final String? ownerId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final EnumValue? department; + final String? hubId; + final String? manager; + final EnumValue? english; + final EnumValue? backgroundCheckStatus; + final EnumValue? employmentType; + final String? initial; + final bool? englishRequired; + final String? city; + final String? addres; + GetStaffByIdStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + userId = nativeFromJson(json['userId']), + fullName = nativeFromJson(json['fullName']), + role = json['role'] == null ? null : nativeFromJson(json['role']), + level = json['level'] == null ? null : nativeFromJson(json['level']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']), + totalShifts = json['totalShifts'] == null ? null : nativeFromJson(json['totalShifts']), + averageRating = json['averageRating'] == null ? null : nativeFromJson(json['averageRating']), + onTimeRate = json['onTimeRate'] == null ? null : nativeFromJson(json['onTimeRate']), + noShowCount = json['noShowCount'] == null ? null : nativeFromJson(json['noShowCount']), + cancellationCount = json['cancellationCount'] == null ? null : nativeFromJson(json['cancellationCount']), + reliabilityScore = json['reliabilityScore'] == null ? null : nativeFromJson(json['reliabilityScore']), + xp = json['xp'] == null ? null : nativeFromJson(json['xp']), + badges = json['badges'] == null ? null : AnyValue.fromJson(json['badges']), + isRecommended = json['isRecommended'] == null ? null : nativeFromJson(json['isRecommended']), + bio = json['bio'] == null ? null : nativeFromJson(json['bio']), + industries = json['industries'] == null ? null : AnyValue.fromJson(json['industries']), + preferredLocations = json['preferredLocations'] == null ? null : AnyValue.fromJson(json['preferredLocations']), + maxDistanceMiles = json['maxDistanceMiles'] == null ? null : nativeFromJson(json['maxDistanceMiles']), + languages = json['languages'] == null ? null : AnyValue.fromJson(json['languages']), + itemsAttire = json['itemsAttire'] == null ? null : AnyValue.fromJson(json['itemsAttire']), + ownerId = json['ownerId'] == null ? null : nativeFromJson(json['ownerId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + department = json['department'] == null ? null : departmentTypeDeserializer(json['department']), + hubId = json['hubId'] == null ? null : nativeFromJson(json['hubId']), + manager = json['manager'] == null ? null : nativeFromJson(json['manager']), + english = json['english'] == null ? null : englishProficiencyDeserializer(json['english']), + backgroundCheckStatus = json['backgroundCheckStatus'] == null ? null : backgroundCheckStatusDeserializer(json['backgroundCheckStatus']), + employmentType = json['employmentType'] == null ? null : employmentTypeDeserializer(json['employmentType']), + initial = json['initial'] == null ? null : nativeFromJson(json['initial']), + englishRequired = json['englishRequired'] == null ? null : nativeFromJson(json['englishRequired']), + city = json['city'] == null ? null : nativeFromJson(json['city']), + addres = json['addres'] == null ? null : nativeFromJson(json['addres']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffByIdStaff otherTyped = other as GetStaffByIdStaff; + return id == otherTyped.id && + userId == otherTyped.userId && + fullName == otherTyped.fullName && + role == otherTyped.role && + level == otherTyped.level && + phone == otherTyped.phone && + email == otherTyped.email && + photoUrl == otherTyped.photoUrl && + totalShifts == otherTyped.totalShifts && + averageRating == otherTyped.averageRating && + onTimeRate == otherTyped.onTimeRate && + noShowCount == otherTyped.noShowCount && + cancellationCount == otherTyped.cancellationCount && + reliabilityScore == otherTyped.reliabilityScore && + xp == otherTyped.xp && + badges == otherTyped.badges && + isRecommended == otherTyped.isRecommended && + bio == otherTyped.bio && + industries == otherTyped.industries && + preferredLocations == otherTyped.preferredLocations && + maxDistanceMiles == otherTyped.maxDistanceMiles && + languages == otherTyped.languages && + itemsAttire == otherTyped.itemsAttire && + ownerId == otherTyped.ownerId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + department == otherTyped.department && + hubId == otherTyped.hubId && + manager == otherTyped.manager && + english == otherTyped.english && + backgroundCheckStatus == otherTyped.backgroundCheckStatus && + employmentType == otherTyped.employmentType && + initial == otherTyped.initial && + englishRequired == otherTyped.englishRequired && + city == otherTyped.city && + addres == otherTyped.addres; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, fullName.hashCode, role.hashCode, level.hashCode, phone.hashCode, email.hashCode, photoUrl.hashCode, totalShifts.hashCode, averageRating.hashCode, onTimeRate.hashCode, noShowCount.hashCode, cancellationCount.hashCode, reliabilityScore.hashCode, xp.hashCode, badges.hashCode, isRecommended.hashCode, bio.hashCode, industries.hashCode, preferredLocations.hashCode, maxDistanceMiles.hashCode, languages.hashCode, itemsAttire.hashCode, ownerId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, department.hashCode, hubId.hashCode, manager.hashCode, english.hashCode, backgroundCheckStatus.hashCode, employmentType.hashCode, initial.hashCode, englishRequired.hashCode, city.hashCode, addres.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['userId'] = nativeToJson(userId); + json['fullName'] = nativeToJson(fullName); + if (role != null) { + json['role'] = nativeToJson(role); + } + if (level != null) { + json['level'] = nativeToJson(level); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + if (totalShifts != null) { + json['totalShifts'] = nativeToJson(totalShifts); + } + if (averageRating != null) { + json['averageRating'] = nativeToJson(averageRating); + } + if (onTimeRate != null) { + json['onTimeRate'] = nativeToJson(onTimeRate); + } + if (noShowCount != null) { + json['noShowCount'] = nativeToJson(noShowCount); + } + if (cancellationCount != null) { + json['cancellationCount'] = nativeToJson(cancellationCount); + } + if (reliabilityScore != null) { + json['reliabilityScore'] = nativeToJson(reliabilityScore); + } + if (xp != null) { + json['xp'] = nativeToJson(xp); + } + if (badges != null) { + json['badges'] = badges!.toJson(); + } + if (isRecommended != null) { + json['isRecommended'] = nativeToJson(isRecommended); + } + if (bio != null) { + json['bio'] = nativeToJson(bio); + } + if (industries != null) { + json['industries'] = industries!.toJson(); + } + if (preferredLocations != null) { + json['preferredLocations'] = preferredLocations!.toJson(); + } + if (maxDistanceMiles != null) { + json['maxDistanceMiles'] = nativeToJson(maxDistanceMiles); + } + if (languages != null) { + json['languages'] = languages!.toJson(); + } + if (itemsAttire != null) { + json['itemsAttire'] = itemsAttire!.toJson(); + } + if (ownerId != null) { + json['ownerId'] = nativeToJson(ownerId); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + if (department != null) { + json['department'] = + departmentTypeSerializer(department!) + ; + } + if (hubId != null) { + json['hubId'] = nativeToJson(hubId); + } + if (manager != null) { + json['manager'] = nativeToJson(manager); + } + if (english != null) { + json['english'] = + englishProficiencySerializer(english!) + ; + } + if (backgroundCheckStatus != null) { + json['backgroundCheckStatus'] = + backgroundCheckStatusSerializer(backgroundCheckStatus!) + ; + } + if (employmentType != null) { + json['employmentType'] = + employmentTypeSerializer(employmentType!) + ; + } + if (initial != null) { + json['initial'] = nativeToJson(initial); + } + if (englishRequired != null) { + json['englishRequired'] = nativeToJson(englishRequired); + } + if (city != null) { + json['city'] = nativeToJson(city); + } + if (addres != null) { + json['addres'] = nativeToJson(addres); + } + return json; + } + + GetStaffByIdStaff({ + required this.id, + required this.userId, + required this.fullName, + this.role, + this.level, + this.phone, + this.email, + this.photoUrl, + this.totalShifts, + this.averageRating, + this.onTimeRate, + this.noShowCount, + this.cancellationCount, + this.reliabilityScore, + this.xp, + this.badges, + this.isRecommended, + this.bio, + this.industries, + this.preferredLocations, + this.maxDistanceMiles, + this.languages, + this.itemsAttire, + this.ownerId, + this.createdAt, + this.updatedAt, + this.createdBy, + this.department, + this.hubId, + this.manager, + this.english, + this.backgroundCheckStatus, + this.employmentType, + this.initial, + this.englishRequired, + this.city, + this.addres, + }); +} + +@immutable +class GetStaffByIdData { + final GetStaffByIdStaff? staff; + GetStaffByIdData.fromJson(dynamic json): + + staff = json['staff'] == null ? null : GetStaffByIdStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffByIdData otherTyped = other as GetStaffByIdData; + return staff == otherTyped.staff; + + } + @override + int get hashCode => staff.hashCode; + + + Map toJson() { + Map json = {}; + if (staff != null) { + json['staff'] = staff!.toJson(); + } + return json; + } + + GetStaffByIdData({ + this.staff, + }); +} + +@immutable +class GetStaffByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetStaffByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffByIdVariables otherTyped = other as GetStaffByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetStaffByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_by_user_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_by_user_id.dart new file mode 100644 index 00000000..293cafe8 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_by_user_id.dart @@ -0,0 +1,373 @@ +part of 'generated.dart'; + +class GetStaffByUserIdVariablesBuilder { + String userId; + + final FirebaseDataConnect _dataConnect; + GetStaffByUserIdVariablesBuilder(this._dataConnect, {required this.userId,}); + Deserializer dataDeserializer = (dynamic json) => GetStaffByUserIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetStaffByUserIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetStaffByUserIdVariables vars= GetStaffByUserIdVariables(userId: userId,); + return _dataConnect.query("getStaffByUserId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetStaffByUserIdStaffs { + final String id; + final String userId; + final String fullName; + final String? level; + final String? phone; + final String? email; + final String? photoUrl; + final int? totalShifts; + final double? averageRating; + final int? onTimeRate; + final int? noShowCount; + final int? cancellationCount; + final int? reliabilityScore; + final int? xp; + final AnyValue? badges; + final bool? isRecommended; + final String? bio; + final AnyValue? industries; + final AnyValue? preferredLocations; + final int? maxDistanceMiles; + final AnyValue? languages; + final AnyValue? itemsAttire; + final String? ownerId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final EnumValue? department; + final String? hubId; + final String? manager; + final EnumValue? english; + final EnumValue? backgroundCheckStatus; + final EnumValue? employmentType; + final String? initial; + final bool? englishRequired; + final String? city; + final String? addres; + GetStaffByUserIdStaffs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + userId = nativeFromJson(json['userId']), + fullName = nativeFromJson(json['fullName']), + level = json['level'] == null ? null : nativeFromJson(json['level']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']), + totalShifts = json['totalShifts'] == null ? null : nativeFromJson(json['totalShifts']), + averageRating = json['averageRating'] == null ? null : nativeFromJson(json['averageRating']), + onTimeRate = json['onTimeRate'] == null ? null : nativeFromJson(json['onTimeRate']), + noShowCount = json['noShowCount'] == null ? null : nativeFromJson(json['noShowCount']), + cancellationCount = json['cancellationCount'] == null ? null : nativeFromJson(json['cancellationCount']), + reliabilityScore = json['reliabilityScore'] == null ? null : nativeFromJson(json['reliabilityScore']), + xp = json['xp'] == null ? null : nativeFromJson(json['xp']), + badges = json['badges'] == null ? null : AnyValue.fromJson(json['badges']), + isRecommended = json['isRecommended'] == null ? null : nativeFromJson(json['isRecommended']), + bio = json['bio'] == null ? null : nativeFromJson(json['bio']), + industries = json['industries'] == null ? null : AnyValue.fromJson(json['industries']), + preferredLocations = json['preferredLocations'] == null ? null : AnyValue.fromJson(json['preferredLocations']), + maxDistanceMiles = json['maxDistanceMiles'] == null ? null : nativeFromJson(json['maxDistanceMiles']), + languages = json['languages'] == null ? null : AnyValue.fromJson(json['languages']), + itemsAttire = json['itemsAttire'] == null ? null : AnyValue.fromJson(json['itemsAttire']), + ownerId = json['ownerId'] == null ? null : nativeFromJson(json['ownerId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + department = json['department'] == null ? null : departmentTypeDeserializer(json['department']), + hubId = json['hubId'] == null ? null : nativeFromJson(json['hubId']), + manager = json['manager'] == null ? null : nativeFromJson(json['manager']), + english = json['english'] == null ? null : englishProficiencyDeserializer(json['english']), + backgroundCheckStatus = json['backgroundCheckStatus'] == null ? null : backgroundCheckStatusDeserializer(json['backgroundCheckStatus']), + employmentType = json['employmentType'] == null ? null : employmentTypeDeserializer(json['employmentType']), + initial = json['initial'] == null ? null : nativeFromJson(json['initial']), + englishRequired = json['englishRequired'] == null ? null : nativeFromJson(json['englishRequired']), + city = json['city'] == null ? null : nativeFromJson(json['city']), + addres = json['addres'] == null ? null : nativeFromJson(json['addres']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffByUserIdStaffs otherTyped = other as GetStaffByUserIdStaffs; + return id == otherTyped.id && + userId == otherTyped.userId && + fullName == otherTyped.fullName && + level == otherTyped.level && + phone == otherTyped.phone && + email == otherTyped.email && + photoUrl == otherTyped.photoUrl && + totalShifts == otherTyped.totalShifts && + averageRating == otherTyped.averageRating && + onTimeRate == otherTyped.onTimeRate && + noShowCount == otherTyped.noShowCount && + cancellationCount == otherTyped.cancellationCount && + reliabilityScore == otherTyped.reliabilityScore && + xp == otherTyped.xp && + badges == otherTyped.badges && + isRecommended == otherTyped.isRecommended && + bio == otherTyped.bio && + industries == otherTyped.industries && + preferredLocations == otherTyped.preferredLocations && + maxDistanceMiles == otherTyped.maxDistanceMiles && + languages == otherTyped.languages && + itemsAttire == otherTyped.itemsAttire && + ownerId == otherTyped.ownerId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + department == otherTyped.department && + hubId == otherTyped.hubId && + manager == otherTyped.manager && + english == otherTyped.english && + backgroundCheckStatus == otherTyped.backgroundCheckStatus && + employmentType == otherTyped.employmentType && + initial == otherTyped.initial && + englishRequired == otherTyped.englishRequired && + city == otherTyped.city && + addres == otherTyped.addres; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, fullName.hashCode, level.hashCode, phone.hashCode, email.hashCode, photoUrl.hashCode, totalShifts.hashCode, averageRating.hashCode, onTimeRate.hashCode, noShowCount.hashCode, cancellationCount.hashCode, reliabilityScore.hashCode, xp.hashCode, badges.hashCode, isRecommended.hashCode, bio.hashCode, industries.hashCode, preferredLocations.hashCode, maxDistanceMiles.hashCode, languages.hashCode, itemsAttire.hashCode, ownerId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, department.hashCode, hubId.hashCode, manager.hashCode, english.hashCode, backgroundCheckStatus.hashCode, employmentType.hashCode, initial.hashCode, englishRequired.hashCode, city.hashCode, addres.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['userId'] = nativeToJson(userId); + json['fullName'] = nativeToJson(fullName); + if (level != null) { + json['level'] = nativeToJson(level); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + if (totalShifts != null) { + json['totalShifts'] = nativeToJson(totalShifts); + } + if (averageRating != null) { + json['averageRating'] = nativeToJson(averageRating); + } + if (onTimeRate != null) { + json['onTimeRate'] = nativeToJson(onTimeRate); + } + if (noShowCount != null) { + json['noShowCount'] = nativeToJson(noShowCount); + } + if (cancellationCount != null) { + json['cancellationCount'] = nativeToJson(cancellationCount); + } + if (reliabilityScore != null) { + json['reliabilityScore'] = nativeToJson(reliabilityScore); + } + if (xp != null) { + json['xp'] = nativeToJson(xp); + } + if (badges != null) { + json['badges'] = badges!.toJson(); + } + if (isRecommended != null) { + json['isRecommended'] = nativeToJson(isRecommended); + } + if (bio != null) { + json['bio'] = nativeToJson(bio); + } + if (industries != null) { + json['industries'] = industries!.toJson(); + } + if (preferredLocations != null) { + json['preferredLocations'] = preferredLocations!.toJson(); + } + if (maxDistanceMiles != null) { + json['maxDistanceMiles'] = nativeToJson(maxDistanceMiles); + } + if (languages != null) { + json['languages'] = languages!.toJson(); + } + if (itemsAttire != null) { + json['itemsAttire'] = itemsAttire!.toJson(); + } + if (ownerId != null) { + json['ownerId'] = nativeToJson(ownerId); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + if (department != null) { + json['department'] = + departmentTypeSerializer(department!) + ; + } + if (hubId != null) { + json['hubId'] = nativeToJson(hubId); + } + if (manager != null) { + json['manager'] = nativeToJson(manager); + } + if (english != null) { + json['english'] = + englishProficiencySerializer(english!) + ; + } + if (backgroundCheckStatus != null) { + json['backgroundCheckStatus'] = + backgroundCheckStatusSerializer(backgroundCheckStatus!) + ; + } + if (employmentType != null) { + json['employmentType'] = + employmentTypeSerializer(employmentType!) + ; + } + if (initial != null) { + json['initial'] = nativeToJson(initial); + } + if (englishRequired != null) { + json['englishRequired'] = nativeToJson(englishRequired); + } + if (city != null) { + json['city'] = nativeToJson(city); + } + if (addres != null) { + json['addres'] = nativeToJson(addres); + } + return json; + } + + GetStaffByUserIdStaffs({ + required this.id, + required this.userId, + required this.fullName, + this.level, + this.phone, + this.email, + this.photoUrl, + this.totalShifts, + this.averageRating, + this.onTimeRate, + this.noShowCount, + this.cancellationCount, + this.reliabilityScore, + this.xp, + this.badges, + this.isRecommended, + this.bio, + this.industries, + this.preferredLocations, + this.maxDistanceMiles, + this.languages, + this.itemsAttire, + this.ownerId, + this.createdAt, + this.updatedAt, + this.createdBy, + this.department, + this.hubId, + this.manager, + this.english, + this.backgroundCheckStatus, + this.employmentType, + this.initial, + this.englishRequired, + this.city, + this.addres, + }); +} + +@immutable +class GetStaffByUserIdData { + final List staffs; + GetStaffByUserIdData.fromJson(dynamic json): + + staffs = (json['staffs'] as List) + .map((e) => GetStaffByUserIdStaffs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffByUserIdData otherTyped = other as GetStaffByUserIdData; + return staffs == otherTyped.staffs; + + } + @override + int get hashCode => staffs.hashCode; + + + Map toJson() { + Map json = {}; + json['staffs'] = staffs.map((e) => e.toJson()).toList(); + return json; + } + + GetStaffByUserIdData({ + required this.staffs, + }); +} + +@immutable +class GetStaffByUserIdVariables { + final String userId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetStaffByUserIdVariables.fromJson(Map json): + + userId = nativeFromJson(json['userId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffByUserIdVariables otherTyped = other as GetStaffByUserIdVariables; + return userId == otherTyped.userId; + + } + @override + int get hashCode => userId.hashCode; + + + Map toJson() { + Map json = {}; + json['userId'] = nativeToJson(userId); + return json; + } + + GetStaffByUserIdVariables({ + required this.userId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_course_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_course_by_id.dart new file mode 100644 index 00000000..f2c72e71 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_course_by_id.dart @@ -0,0 +1,183 @@ +part of 'generated.dart'; + +class GetStaffCourseByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetStaffCourseByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetStaffCourseByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetStaffCourseByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetStaffCourseByIdVariables vars= GetStaffCourseByIdVariables(id: id,); + return _dataConnect.query("getStaffCourseById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetStaffCourseByIdStaffCourse { + final String id; + final String staffId; + final String courseId; + final int? progressPercent; + final bool? completed; + final Timestamp? completedAt; + final Timestamp? startedAt; + final Timestamp? lastAccessedAt; + final Timestamp? createdAt; + final Timestamp? updatedAt; + GetStaffCourseByIdStaffCourse.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + courseId = nativeFromJson(json['courseId']), + progressPercent = json['progressPercent'] == null ? null : nativeFromJson(json['progressPercent']), + completed = json['completed'] == null ? null : nativeFromJson(json['completed']), + completedAt = json['completedAt'] == null ? null : Timestamp.fromJson(json['completedAt']), + startedAt = json['startedAt'] == null ? null : Timestamp.fromJson(json['startedAt']), + lastAccessedAt = json['lastAccessedAt'] == null ? null : Timestamp.fromJson(json['lastAccessedAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffCourseByIdStaffCourse otherTyped = other as GetStaffCourseByIdStaffCourse; + return id == otherTyped.id && + staffId == otherTyped.staffId && + courseId == otherTyped.courseId && + progressPercent == otherTyped.progressPercent && + completed == otherTyped.completed && + completedAt == otherTyped.completedAt && + startedAt == otherTyped.startedAt && + lastAccessedAt == otherTyped.lastAccessedAt && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, courseId.hashCode, progressPercent.hashCode, completed.hashCode, completedAt.hashCode, startedAt.hashCode, lastAccessedAt.hashCode, createdAt.hashCode, updatedAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['courseId'] = nativeToJson(courseId); + if (progressPercent != null) { + json['progressPercent'] = nativeToJson(progressPercent); + } + if (completed != null) { + json['completed'] = nativeToJson(completed); + } + if (completedAt != null) { + json['completedAt'] = completedAt!.toJson(); + } + if (startedAt != null) { + json['startedAt'] = startedAt!.toJson(); + } + if (lastAccessedAt != null) { + json['lastAccessedAt'] = lastAccessedAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + return json; + } + + GetStaffCourseByIdStaffCourse({ + required this.id, + required this.staffId, + required this.courseId, + this.progressPercent, + this.completed, + this.completedAt, + this.startedAt, + this.lastAccessedAt, + this.createdAt, + this.updatedAt, + }); +} + +@immutable +class GetStaffCourseByIdData { + final GetStaffCourseByIdStaffCourse? staffCourse; + GetStaffCourseByIdData.fromJson(dynamic json): + + staffCourse = json['staffCourse'] == null ? null : GetStaffCourseByIdStaffCourse.fromJson(json['staffCourse']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffCourseByIdData otherTyped = other as GetStaffCourseByIdData; + return staffCourse == otherTyped.staffCourse; + + } + @override + int get hashCode => staffCourse.hashCode; + + + Map toJson() { + Map json = {}; + if (staffCourse != null) { + json['staffCourse'] = staffCourse!.toJson(); + } + return json; + } + + GetStaffCourseByIdData({ + this.staffCourse, + }); +} + +@immutable +class GetStaffCourseByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetStaffCourseByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffCourseByIdVariables otherTyped = other as GetStaffCourseByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetStaffCourseByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_course_by_staff_and_course.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_course_by_staff_and_course.dart new file mode 100644 index 00000000..fddd3f9d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_course_by_staff_and_course.dart @@ -0,0 +1,189 @@ +part of 'generated.dart'; + +class GetStaffCourseByStaffAndCourseVariablesBuilder { + String staffId; + String courseId; + + final FirebaseDataConnect _dataConnect; + GetStaffCourseByStaffAndCourseVariablesBuilder(this._dataConnect, {required this.staffId,required this.courseId,}); + Deserializer dataDeserializer = (dynamic json) => GetStaffCourseByStaffAndCourseData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetStaffCourseByStaffAndCourseVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetStaffCourseByStaffAndCourseVariables vars= GetStaffCourseByStaffAndCourseVariables(staffId: staffId,courseId: courseId,); + return _dataConnect.query("getStaffCourseByStaffAndCourse", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetStaffCourseByStaffAndCourseStaffCourses { + final String id; + final String staffId; + final String courseId; + final int? progressPercent; + final bool? completed; + final Timestamp? completedAt; + final Timestamp? startedAt; + final Timestamp? lastAccessedAt; + final Timestamp? createdAt; + final Timestamp? updatedAt; + GetStaffCourseByStaffAndCourseStaffCourses.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + courseId = nativeFromJson(json['courseId']), + progressPercent = json['progressPercent'] == null ? null : nativeFromJson(json['progressPercent']), + completed = json['completed'] == null ? null : nativeFromJson(json['completed']), + completedAt = json['completedAt'] == null ? null : Timestamp.fromJson(json['completedAt']), + startedAt = json['startedAt'] == null ? null : Timestamp.fromJson(json['startedAt']), + lastAccessedAt = json['lastAccessedAt'] == null ? null : Timestamp.fromJson(json['lastAccessedAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffCourseByStaffAndCourseStaffCourses otherTyped = other as GetStaffCourseByStaffAndCourseStaffCourses; + return id == otherTyped.id && + staffId == otherTyped.staffId && + courseId == otherTyped.courseId && + progressPercent == otherTyped.progressPercent && + completed == otherTyped.completed && + completedAt == otherTyped.completedAt && + startedAt == otherTyped.startedAt && + lastAccessedAt == otherTyped.lastAccessedAt && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, courseId.hashCode, progressPercent.hashCode, completed.hashCode, completedAt.hashCode, startedAt.hashCode, lastAccessedAt.hashCode, createdAt.hashCode, updatedAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['courseId'] = nativeToJson(courseId); + if (progressPercent != null) { + json['progressPercent'] = nativeToJson(progressPercent); + } + if (completed != null) { + json['completed'] = nativeToJson(completed); + } + if (completedAt != null) { + json['completedAt'] = completedAt!.toJson(); + } + if (startedAt != null) { + json['startedAt'] = startedAt!.toJson(); + } + if (lastAccessedAt != null) { + json['lastAccessedAt'] = lastAccessedAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + return json; + } + + GetStaffCourseByStaffAndCourseStaffCourses({ + required this.id, + required this.staffId, + required this.courseId, + this.progressPercent, + this.completed, + this.completedAt, + this.startedAt, + this.lastAccessedAt, + this.createdAt, + this.updatedAt, + }); +} + +@immutable +class GetStaffCourseByStaffAndCourseData { + final List staffCourses; + GetStaffCourseByStaffAndCourseData.fromJson(dynamic json): + + staffCourses = (json['staffCourses'] as List) + .map((e) => GetStaffCourseByStaffAndCourseStaffCourses.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffCourseByStaffAndCourseData otherTyped = other as GetStaffCourseByStaffAndCourseData; + return staffCourses == otherTyped.staffCourses; + + } + @override + int get hashCode => staffCourses.hashCode; + + + Map toJson() { + Map json = {}; + json['staffCourses'] = staffCourses.map((e) => e.toJson()).toList(); + return json; + } + + GetStaffCourseByStaffAndCourseData({ + required this.staffCourses, + }); +} + +@immutable +class GetStaffCourseByStaffAndCourseVariables { + final String staffId; + final String courseId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetStaffCourseByStaffAndCourseVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + courseId = nativeFromJson(json['courseId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffCourseByStaffAndCourseVariables otherTyped = other as GetStaffCourseByStaffAndCourseVariables; + return staffId == otherTyped.staffId && + courseId == otherTyped.courseId; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, courseId.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['courseId'] = nativeToJson(courseId); + return json; + } + + GetStaffCourseByStaffAndCourseVariables({ + required this.staffId, + required this.courseId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_document_by_key.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_document_by_key.dart new file mode 100644 index 00000000..092c1eb5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_document_by_key.dart @@ -0,0 +1,238 @@ +part of 'generated.dart'; + +class GetStaffDocumentByKeyVariablesBuilder { + String staffId; + String documentId; + + final FirebaseDataConnect _dataConnect; + GetStaffDocumentByKeyVariablesBuilder(this._dataConnect, {required this.staffId,required this.documentId,}); + Deserializer dataDeserializer = (dynamic json) => GetStaffDocumentByKeyData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetStaffDocumentByKeyVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetStaffDocumentByKeyVariables vars= GetStaffDocumentByKeyVariables(staffId: staffId,documentId: documentId,); + return _dataConnect.query("getStaffDocumentByKey", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetStaffDocumentByKeyStaffDocument { + final String id; + final String staffId; + final String staffName; + final String documentId; + final EnumValue status; + final String? documentUrl; + final Timestamp? expiryDate; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final GetStaffDocumentByKeyStaffDocumentDocument document; + GetStaffDocumentByKeyStaffDocument.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + staffName = nativeFromJson(json['staffName']), + documentId = nativeFromJson(json['documentId']), + status = documentStatusDeserializer(json['status']), + documentUrl = json['documentUrl'] == null ? null : nativeFromJson(json['documentUrl']), + expiryDate = json['expiryDate'] == null ? null : Timestamp.fromJson(json['expiryDate']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + document = GetStaffDocumentByKeyStaffDocumentDocument.fromJson(json['document']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffDocumentByKeyStaffDocument otherTyped = other as GetStaffDocumentByKeyStaffDocument; + return id == otherTyped.id && + staffId == otherTyped.staffId && + staffName == otherTyped.staffName && + documentId == otherTyped.documentId && + status == otherTyped.status && + documentUrl == otherTyped.documentUrl && + expiryDate == otherTyped.expiryDate && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + document == otherTyped.document; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, staffName.hashCode, documentId.hashCode, status.hashCode, documentUrl.hashCode, expiryDate.hashCode, createdAt.hashCode, updatedAt.hashCode, document.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['staffName'] = nativeToJson(staffName); + json['documentId'] = nativeToJson(documentId); + json['status'] = + documentStatusSerializer(status) + ; + if (documentUrl != null) { + json['documentUrl'] = nativeToJson(documentUrl); + } + if (expiryDate != null) { + json['expiryDate'] = expiryDate!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + json['document'] = document.toJson(); + return json; + } + + GetStaffDocumentByKeyStaffDocument({ + required this.id, + required this.staffId, + required this.staffName, + required this.documentId, + required this.status, + this.documentUrl, + this.expiryDate, + this.createdAt, + this.updatedAt, + required this.document, + }); +} + +@immutable +class GetStaffDocumentByKeyStaffDocumentDocument { + final String id; + final String name; + final EnumValue documentType; + final String? description; + GetStaffDocumentByKeyStaffDocumentDocument.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + documentType = documentTypeDeserializer(json['documentType']), + description = json['description'] == null ? null : nativeFromJson(json['description']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffDocumentByKeyStaffDocumentDocument otherTyped = other as GetStaffDocumentByKeyStaffDocumentDocument; + return id == otherTyped.id && + name == otherTyped.name && + documentType == otherTyped.documentType && + description == otherTyped.description; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, documentType.hashCode, description.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['documentType'] = + documentTypeSerializer(documentType) + ; + if (description != null) { + json['description'] = nativeToJson(description); + } + return json; + } + + GetStaffDocumentByKeyStaffDocumentDocument({ + required this.id, + required this.name, + required this.documentType, + this.description, + }); +} + +@immutable +class GetStaffDocumentByKeyData { + final GetStaffDocumentByKeyStaffDocument? staffDocument; + GetStaffDocumentByKeyData.fromJson(dynamic json): + + staffDocument = json['staffDocument'] == null ? null : GetStaffDocumentByKeyStaffDocument.fromJson(json['staffDocument']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffDocumentByKeyData otherTyped = other as GetStaffDocumentByKeyData; + return staffDocument == otherTyped.staffDocument; + + } + @override + int get hashCode => staffDocument.hashCode; + + + Map toJson() { + Map json = {}; + if (staffDocument != null) { + json['staffDocument'] = staffDocument!.toJson(); + } + return json; + } + + GetStaffDocumentByKeyData({ + this.staffDocument, + }); +} + +@immutable +class GetStaffDocumentByKeyVariables { + final String staffId; + final String documentId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetStaffDocumentByKeyVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + documentId = nativeFromJson(json['documentId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffDocumentByKeyVariables otherTyped = other as GetStaffDocumentByKeyVariables; + return staffId == otherTyped.staffId && + documentId == otherTyped.documentId; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, documentId.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['documentId'] = nativeToJson(documentId); + return json; + } + + GetStaffDocumentByKeyVariables({ + required this.staffId, + required this.documentId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_role_by_key.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_role_by_key.dart new file mode 100644 index 00000000..f4b042ab --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_staff_role_by_key.dart @@ -0,0 +1,268 @@ +part of 'generated.dart'; + +class GetStaffRoleByKeyVariablesBuilder { + String staffId; + String roleId; + + final FirebaseDataConnect _dataConnect; + GetStaffRoleByKeyVariablesBuilder(this._dataConnect, {required this.staffId,required this.roleId,}); + Deserializer dataDeserializer = (dynamic json) => GetStaffRoleByKeyData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetStaffRoleByKeyVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetStaffRoleByKeyVariables vars= GetStaffRoleByKeyVariables(staffId: staffId,roleId: roleId,); + return _dataConnect.query("getStaffRoleByKey", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetStaffRoleByKeyStaffRole { + final String id; + final String staffId; + final String roleId; + final Timestamp? createdAt; + final EnumValue? roleType; + final GetStaffRoleByKeyStaffRoleStaff staff; + final GetStaffRoleByKeyStaffRoleRole role; + GetStaffRoleByKeyStaffRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + roleId = nativeFromJson(json['roleId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + roleType = json['roleType'] == null ? null : roleTypeDeserializer(json['roleType']), + staff = GetStaffRoleByKeyStaffRoleStaff.fromJson(json['staff']), + role = GetStaffRoleByKeyStaffRoleRole.fromJson(json['role']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffRoleByKeyStaffRole otherTyped = other as GetStaffRoleByKeyStaffRole; + return id == otherTyped.id && + staffId == otherTyped.staffId && + roleId == otherTyped.roleId && + createdAt == otherTyped.createdAt && + roleType == otherTyped.roleType && + staff == otherTyped.staff && + role == otherTyped.role; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, roleId.hashCode, createdAt.hashCode, roleType.hashCode, staff.hashCode, role.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['roleId'] = nativeToJson(roleId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (roleType != null) { + json['roleType'] = + roleTypeSerializer(roleType!) + ; + } + json['staff'] = staff.toJson(); + json['role'] = role.toJson(); + return json; + } + + GetStaffRoleByKeyStaffRole({ + required this.id, + required this.staffId, + required this.roleId, + this.createdAt, + this.roleType, + required this.staff, + required this.role, + }); +} + +@immutable +class GetStaffRoleByKeyStaffRoleStaff { + final String id; + final String fullName; + final String userId; + final String? email; + final String? phone; + GetStaffRoleByKeyStaffRoleStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']), + userId = nativeFromJson(json['userId']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffRoleByKeyStaffRoleStaff otherTyped = other as GetStaffRoleByKeyStaffRoleStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName && + userId == otherTyped.userId && + email == otherTyped.email && + phone == otherTyped.phone; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, userId.hashCode, email.hashCode, phone.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + json['userId'] = nativeToJson(userId); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + return json; + } + + GetStaffRoleByKeyStaffRoleStaff({ + required this.id, + required this.fullName, + required this.userId, + this.email, + this.phone, + }); +} + +@immutable +class GetStaffRoleByKeyStaffRoleRole { + final String id; + final String name; + final double costPerHour; + GetStaffRoleByKeyStaffRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffRoleByKeyStaffRoleRole otherTyped = other as GetStaffRoleByKeyStaffRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + GetStaffRoleByKeyStaffRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class GetStaffRoleByKeyData { + final GetStaffRoleByKeyStaffRole? staffRole; + GetStaffRoleByKeyData.fromJson(dynamic json): + + staffRole = json['staffRole'] == null ? null : GetStaffRoleByKeyStaffRole.fromJson(json['staffRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffRoleByKeyData otherTyped = other as GetStaffRoleByKeyData; + return staffRole == otherTyped.staffRole; + + } + @override + int get hashCode => staffRole.hashCode; + + + Map toJson() { + Map json = {}; + if (staffRole != null) { + json['staffRole'] = staffRole!.toJson(); + } + return json; + } + + GetStaffRoleByKeyData({ + this.staffRole, + }); +} + +@immutable +class GetStaffRoleByKeyVariables { + final String staffId; + final String roleId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetStaffRoleByKeyVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + roleId = nativeFromJson(json['roleId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetStaffRoleByKeyVariables otherTyped = other as GetStaffRoleByKeyVariables; + return staffId == otherTyped.staffId && + roleId == otherTyped.roleId; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, roleId.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['roleId'] = nativeToJson(roleId); + return json; + } + + GetStaffRoleByKeyVariables({ + required this.staffId, + required this.roleId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_task_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_task_by_id.dart new file mode 100644 index 00000000..431c5eda --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_task_by_id.dart @@ -0,0 +1,213 @@ +part of 'generated.dart'; + +class GetTaskByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetTaskByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetTaskByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetTaskByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetTaskByIdVariables vars= GetTaskByIdVariables(id: id,); + return _dataConnect.query("getTaskById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetTaskByIdTask { + final String id; + final String taskName; + final String? description; + final EnumValue priority; + final EnumValue status; + final Timestamp? dueDate; + final int? progress; + final int? orderIndex; + final int? commentCount; + final int? attachmentCount; + final AnyValue? files; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetTaskByIdTask.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + taskName = nativeFromJson(json['taskName']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + priority = taskPriorityDeserializer(json['priority']), + status = taskStatusDeserializer(json['status']), + dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']), + progress = json['progress'] == null ? null : nativeFromJson(json['progress']), + orderIndex = json['orderIndex'] == null ? null : nativeFromJson(json['orderIndex']), + commentCount = json['commentCount'] == null ? null : nativeFromJson(json['commentCount']), + attachmentCount = json['attachmentCount'] == null ? null : nativeFromJson(json['attachmentCount']), + files = json['files'] == null ? null : AnyValue.fromJson(json['files']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaskByIdTask otherTyped = other as GetTaskByIdTask; + return id == otherTyped.id && + taskName == otherTyped.taskName && + description == otherTyped.description && + priority == otherTyped.priority && + status == otherTyped.status && + dueDate == otherTyped.dueDate && + progress == otherTyped.progress && + orderIndex == otherTyped.orderIndex && + commentCount == otherTyped.commentCount && + attachmentCount == otherTyped.attachmentCount && + files == otherTyped.files && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, taskName.hashCode, description.hashCode, priority.hashCode, status.hashCode, dueDate.hashCode, progress.hashCode, orderIndex.hashCode, commentCount.hashCode, attachmentCount.hashCode, files.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['taskName'] = nativeToJson(taskName); + if (description != null) { + json['description'] = nativeToJson(description); + } + json['priority'] = + taskPrioritySerializer(priority) + ; + json['status'] = + taskStatusSerializer(status) + ; + if (dueDate != null) { + json['dueDate'] = dueDate!.toJson(); + } + if (progress != null) { + json['progress'] = nativeToJson(progress); + } + if (orderIndex != null) { + json['orderIndex'] = nativeToJson(orderIndex); + } + if (commentCount != null) { + json['commentCount'] = nativeToJson(commentCount); + } + if (attachmentCount != null) { + json['attachmentCount'] = nativeToJson(attachmentCount); + } + if (files != null) { + json['files'] = files!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetTaskByIdTask({ + required this.id, + required this.taskName, + this.description, + required this.priority, + required this.status, + this.dueDate, + this.progress, + this.orderIndex, + this.commentCount, + this.attachmentCount, + this.files, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetTaskByIdData { + final GetTaskByIdTask? task; + GetTaskByIdData.fromJson(dynamic json): + + task = json['task'] == null ? null : GetTaskByIdTask.fromJson(json['task']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaskByIdData otherTyped = other as GetTaskByIdData; + return task == otherTyped.task; + + } + @override + int get hashCode => task.hashCode; + + + Map toJson() { + Map json = {}; + if (task != null) { + json['task'] = task!.toJson(); + } + return json; + } + + GetTaskByIdData({ + this.task, + }); +} + +@immutable +class GetTaskByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetTaskByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaskByIdVariables otherTyped = other as GetTaskByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetTaskByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_task_comment_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_task_comment_by_id.dart new file mode 100644 index 00000000..7bb3f768 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_task_comment_by_id.dart @@ -0,0 +1,233 @@ +part of 'generated.dart'; + +class GetTaskCommentByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetTaskCommentByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetTaskCommentByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetTaskCommentByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetTaskCommentByIdVariables vars= GetTaskCommentByIdVariables(id: id,); + return _dataConnect.query("getTaskCommentById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetTaskCommentByIdTaskComment { + final String id; + final String taskId; + final String teamMemberId; + final String comment; + final bool isSystem; + final Timestamp? createdAt; + final GetTaskCommentByIdTaskCommentTeamMember teamMember; + GetTaskCommentByIdTaskComment.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + taskId = nativeFromJson(json['taskId']), + teamMemberId = nativeFromJson(json['teamMemberId']), + comment = nativeFromJson(json['comment']), + isSystem = nativeFromJson(json['isSystem']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + teamMember = GetTaskCommentByIdTaskCommentTeamMember.fromJson(json['teamMember']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaskCommentByIdTaskComment otherTyped = other as GetTaskCommentByIdTaskComment; + return id == otherTyped.id && + taskId == otherTyped.taskId && + teamMemberId == otherTyped.teamMemberId && + comment == otherTyped.comment && + isSystem == otherTyped.isSystem && + createdAt == otherTyped.createdAt && + teamMember == otherTyped.teamMember; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, taskId.hashCode, teamMemberId.hashCode, comment.hashCode, isSystem.hashCode, createdAt.hashCode, teamMember.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['taskId'] = nativeToJson(taskId); + json['teamMemberId'] = nativeToJson(teamMemberId); + json['comment'] = nativeToJson(comment); + json['isSystem'] = nativeToJson(isSystem); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['teamMember'] = teamMember.toJson(); + return json; + } + + GetTaskCommentByIdTaskComment({ + required this.id, + required this.taskId, + required this.teamMemberId, + required this.comment, + required this.isSystem, + this.createdAt, + required this.teamMember, + }); +} + +@immutable +class GetTaskCommentByIdTaskCommentTeamMember { + final GetTaskCommentByIdTaskCommentTeamMemberUser user; + GetTaskCommentByIdTaskCommentTeamMember.fromJson(dynamic json): + + user = GetTaskCommentByIdTaskCommentTeamMemberUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaskCommentByIdTaskCommentTeamMember otherTyped = other as GetTaskCommentByIdTaskCommentTeamMember; + return user == otherTyped.user; + + } + @override + int get hashCode => user.hashCode; + + + Map toJson() { + Map json = {}; + json['user'] = user.toJson(); + return json; + } + + GetTaskCommentByIdTaskCommentTeamMember({ + required this.user, + }); +} + +@immutable +class GetTaskCommentByIdTaskCommentTeamMemberUser { + final String? fullName; + final String? email; + GetTaskCommentByIdTaskCommentTeamMemberUser.fromJson(dynamic json): + + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaskCommentByIdTaskCommentTeamMemberUser otherTyped = other as GetTaskCommentByIdTaskCommentTeamMemberUser; + return fullName == otherTyped.fullName && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([fullName.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + GetTaskCommentByIdTaskCommentTeamMemberUser({ + this.fullName, + this.email, + }); +} + +@immutable +class GetTaskCommentByIdData { + final GetTaskCommentByIdTaskComment? taskComment; + GetTaskCommentByIdData.fromJson(dynamic json): + + taskComment = json['taskComment'] == null ? null : GetTaskCommentByIdTaskComment.fromJson(json['taskComment']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaskCommentByIdData otherTyped = other as GetTaskCommentByIdData; + return taskComment == otherTyped.taskComment; + + } + @override + int get hashCode => taskComment.hashCode; + + + Map toJson() { + Map json = {}; + if (taskComment != null) { + json['taskComment'] = taskComment!.toJson(); + } + return json; + } + + GetTaskCommentByIdData({ + this.taskComment, + }); +} + +@immutable +class GetTaskCommentByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetTaskCommentByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaskCommentByIdVariables otherTyped = other as GetTaskCommentByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetTaskCommentByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_task_comments_by_task_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_task_comments_by_task_id.dart new file mode 100644 index 00000000..f2a514e4 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_task_comments_by_task_id.dart @@ -0,0 +1,233 @@ +part of 'generated.dart'; + +class GetTaskCommentsByTaskIdVariablesBuilder { + String taskId; + + final FirebaseDataConnect _dataConnect; + GetTaskCommentsByTaskIdVariablesBuilder(this._dataConnect, {required this.taskId,}); + Deserializer dataDeserializer = (dynamic json) => GetTaskCommentsByTaskIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetTaskCommentsByTaskIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetTaskCommentsByTaskIdVariables vars= GetTaskCommentsByTaskIdVariables(taskId: taskId,); + return _dataConnect.query("getTaskCommentsByTaskId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetTaskCommentsByTaskIdTaskComments { + final String id; + final String taskId; + final String teamMemberId; + final String comment; + final bool isSystem; + final Timestamp? createdAt; + final GetTaskCommentsByTaskIdTaskCommentsTeamMember teamMember; + GetTaskCommentsByTaskIdTaskComments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + taskId = nativeFromJson(json['taskId']), + teamMemberId = nativeFromJson(json['teamMemberId']), + comment = nativeFromJson(json['comment']), + isSystem = nativeFromJson(json['isSystem']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + teamMember = GetTaskCommentsByTaskIdTaskCommentsTeamMember.fromJson(json['teamMember']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaskCommentsByTaskIdTaskComments otherTyped = other as GetTaskCommentsByTaskIdTaskComments; + return id == otherTyped.id && + taskId == otherTyped.taskId && + teamMemberId == otherTyped.teamMemberId && + comment == otherTyped.comment && + isSystem == otherTyped.isSystem && + createdAt == otherTyped.createdAt && + teamMember == otherTyped.teamMember; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, taskId.hashCode, teamMemberId.hashCode, comment.hashCode, isSystem.hashCode, createdAt.hashCode, teamMember.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['taskId'] = nativeToJson(taskId); + json['teamMemberId'] = nativeToJson(teamMemberId); + json['comment'] = nativeToJson(comment); + json['isSystem'] = nativeToJson(isSystem); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['teamMember'] = teamMember.toJson(); + return json; + } + + GetTaskCommentsByTaskIdTaskComments({ + required this.id, + required this.taskId, + required this.teamMemberId, + required this.comment, + required this.isSystem, + this.createdAt, + required this.teamMember, + }); +} + +@immutable +class GetTaskCommentsByTaskIdTaskCommentsTeamMember { + final GetTaskCommentsByTaskIdTaskCommentsTeamMemberUser user; + GetTaskCommentsByTaskIdTaskCommentsTeamMember.fromJson(dynamic json): + + user = GetTaskCommentsByTaskIdTaskCommentsTeamMemberUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaskCommentsByTaskIdTaskCommentsTeamMember otherTyped = other as GetTaskCommentsByTaskIdTaskCommentsTeamMember; + return user == otherTyped.user; + + } + @override + int get hashCode => user.hashCode; + + + Map toJson() { + Map json = {}; + json['user'] = user.toJson(); + return json; + } + + GetTaskCommentsByTaskIdTaskCommentsTeamMember({ + required this.user, + }); +} + +@immutable +class GetTaskCommentsByTaskIdTaskCommentsTeamMemberUser { + final String? fullName; + final String? email; + GetTaskCommentsByTaskIdTaskCommentsTeamMemberUser.fromJson(dynamic json): + + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaskCommentsByTaskIdTaskCommentsTeamMemberUser otherTyped = other as GetTaskCommentsByTaskIdTaskCommentsTeamMemberUser; + return fullName == otherTyped.fullName && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([fullName.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + GetTaskCommentsByTaskIdTaskCommentsTeamMemberUser({ + this.fullName, + this.email, + }); +} + +@immutable +class GetTaskCommentsByTaskIdData { + final List taskComments; + GetTaskCommentsByTaskIdData.fromJson(dynamic json): + + taskComments = (json['taskComments'] as List) + .map((e) => GetTaskCommentsByTaskIdTaskComments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaskCommentsByTaskIdData otherTyped = other as GetTaskCommentsByTaskIdData; + return taskComments == otherTyped.taskComments; + + } + @override + int get hashCode => taskComments.hashCode; + + + Map toJson() { + Map json = {}; + json['taskComments'] = taskComments.map((e) => e.toJson()).toList(); + return json; + } + + GetTaskCommentsByTaskIdData({ + required this.taskComments, + }); +} + +@immutable +class GetTaskCommentsByTaskIdVariables { + final String taskId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetTaskCommentsByTaskIdVariables.fromJson(Map json): + + taskId = nativeFromJson(json['taskId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaskCommentsByTaskIdVariables otherTyped = other as GetTaskCommentsByTaskIdVariables; + return taskId == otherTyped.taskId; + + } + @override + int get hashCode => taskId.hashCode; + + + Map toJson() { + Map json = {}; + json['taskId'] = nativeToJson(taskId); + return json; + } + + GetTaskCommentsByTaskIdVariables({ + required this.taskId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_tasks_by_owner_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_tasks_by_owner_id.dart new file mode 100644 index 00000000..5da6f4c6 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_tasks_by_owner_id.dart @@ -0,0 +1,213 @@ +part of 'generated.dart'; + +class GetTasksByOwnerIdVariablesBuilder { + String ownerId; + + final FirebaseDataConnect _dataConnect; + GetTasksByOwnerIdVariablesBuilder(this._dataConnect, {required this.ownerId,}); + Deserializer dataDeserializer = (dynamic json) => GetTasksByOwnerIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetTasksByOwnerIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetTasksByOwnerIdVariables vars= GetTasksByOwnerIdVariables(ownerId: ownerId,); + return _dataConnect.query("getTasksByOwnerId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetTasksByOwnerIdTasks { + final String id; + final String taskName; + final String? description; + final EnumValue priority; + final EnumValue status; + final Timestamp? dueDate; + final int? progress; + final int? orderIndex; + final int? commentCount; + final int? attachmentCount; + final AnyValue? files; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetTasksByOwnerIdTasks.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + taskName = nativeFromJson(json['taskName']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + priority = taskPriorityDeserializer(json['priority']), + status = taskStatusDeserializer(json['status']), + dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']), + progress = json['progress'] == null ? null : nativeFromJson(json['progress']), + orderIndex = json['orderIndex'] == null ? null : nativeFromJson(json['orderIndex']), + commentCount = json['commentCount'] == null ? null : nativeFromJson(json['commentCount']), + attachmentCount = json['attachmentCount'] == null ? null : nativeFromJson(json['attachmentCount']), + files = json['files'] == null ? null : AnyValue.fromJson(json['files']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTasksByOwnerIdTasks otherTyped = other as GetTasksByOwnerIdTasks; + return id == otherTyped.id && + taskName == otherTyped.taskName && + description == otherTyped.description && + priority == otherTyped.priority && + status == otherTyped.status && + dueDate == otherTyped.dueDate && + progress == otherTyped.progress && + orderIndex == otherTyped.orderIndex && + commentCount == otherTyped.commentCount && + attachmentCount == otherTyped.attachmentCount && + files == otherTyped.files && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, taskName.hashCode, description.hashCode, priority.hashCode, status.hashCode, dueDate.hashCode, progress.hashCode, orderIndex.hashCode, commentCount.hashCode, attachmentCount.hashCode, files.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['taskName'] = nativeToJson(taskName); + if (description != null) { + json['description'] = nativeToJson(description); + } + json['priority'] = + taskPrioritySerializer(priority) + ; + json['status'] = + taskStatusSerializer(status) + ; + if (dueDate != null) { + json['dueDate'] = dueDate!.toJson(); + } + if (progress != null) { + json['progress'] = nativeToJson(progress); + } + if (orderIndex != null) { + json['orderIndex'] = nativeToJson(orderIndex); + } + if (commentCount != null) { + json['commentCount'] = nativeToJson(commentCount); + } + if (attachmentCount != null) { + json['attachmentCount'] = nativeToJson(attachmentCount); + } + if (files != null) { + json['files'] = files!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetTasksByOwnerIdTasks({ + required this.id, + required this.taskName, + this.description, + required this.priority, + required this.status, + this.dueDate, + this.progress, + this.orderIndex, + this.commentCount, + this.attachmentCount, + this.files, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetTasksByOwnerIdData { + final List tasks; + GetTasksByOwnerIdData.fromJson(dynamic json): + + tasks = (json['tasks'] as List) + .map((e) => GetTasksByOwnerIdTasks.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTasksByOwnerIdData otherTyped = other as GetTasksByOwnerIdData; + return tasks == otherTyped.tasks; + + } + @override + int get hashCode => tasks.hashCode; + + + Map toJson() { + Map json = {}; + json['tasks'] = tasks.map((e) => e.toJson()).toList(); + return json; + } + + GetTasksByOwnerIdData({ + required this.tasks, + }); +} + +@immutable +class GetTasksByOwnerIdVariables { + final String ownerId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetTasksByOwnerIdVariables.fromJson(Map json): + + ownerId = nativeFromJson(json['ownerId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTasksByOwnerIdVariables otherTyped = other as GetTasksByOwnerIdVariables; + return ownerId == otherTyped.ownerId; + + } + @override + int get hashCode => ownerId.hashCode; + + + Map toJson() { + Map json = {}; + json['ownerId'] = nativeToJson(ownerId); + return json; + } + + GetTasksByOwnerIdVariables({ + required this.ownerId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_tax_form_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_tax_form_by_id.dart new file mode 100644 index 00000000..83d40b89 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_tax_form_by_id.dart @@ -0,0 +1,190 @@ +part of 'generated.dart'; + +class GetTaxFormByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetTaxFormByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetTaxFormByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetTaxFormByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetTaxFormByIdVariables vars= GetTaxFormByIdVariables(id: id,); + return _dataConnect.query("getTaxFormById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetTaxFormByIdTaxForm { + final String id; + final EnumValue formType; + final String title; + final String? subtitle; + final String? description; + final EnumValue status; + final String staffId; + final AnyValue? formData; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetTaxFormByIdTaxForm.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + formType = taxFormTypeDeserializer(json['formType']), + title = nativeFromJson(json['title']), + subtitle = json['subtitle'] == null ? null : nativeFromJson(json['subtitle']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + status = taxFormStatusDeserializer(json['status']), + staffId = nativeFromJson(json['staffId']), + formData = json['formData'] == null ? null : AnyValue.fromJson(json['formData']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaxFormByIdTaxForm otherTyped = other as GetTaxFormByIdTaxForm; + return id == otherTyped.id && + formType == otherTyped.formType && + title == otherTyped.title && + subtitle == otherTyped.subtitle && + description == otherTyped.description && + status == otherTyped.status && + staffId == otherTyped.staffId && + formData == otherTyped.formData && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, formType.hashCode, title.hashCode, subtitle.hashCode, description.hashCode, status.hashCode, staffId.hashCode, formData.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['formType'] = + taxFormTypeSerializer(formType) + ; + json['title'] = nativeToJson(title); + if (subtitle != null) { + json['subtitle'] = nativeToJson(subtitle); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + json['status'] = + taxFormStatusSerializer(status) + ; + json['staffId'] = nativeToJson(staffId); + if (formData != null) { + json['formData'] = formData!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetTaxFormByIdTaxForm({ + required this.id, + required this.formType, + required this.title, + this.subtitle, + this.description, + required this.status, + required this.staffId, + this.formData, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetTaxFormByIdData { + final GetTaxFormByIdTaxForm? taxForm; + GetTaxFormByIdData.fromJson(dynamic json): + + taxForm = json['taxForm'] == null ? null : GetTaxFormByIdTaxForm.fromJson(json['taxForm']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaxFormByIdData otherTyped = other as GetTaxFormByIdData; + return taxForm == otherTyped.taxForm; + + } + @override + int get hashCode => taxForm.hashCode; + + + Map toJson() { + Map json = {}; + if (taxForm != null) { + json['taxForm'] = taxForm!.toJson(); + } + return json; + } + + GetTaxFormByIdData({ + this.taxForm, + }); +} + +@immutable +class GetTaxFormByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetTaxFormByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaxFormByIdVariables otherTyped = other as GetTaxFormByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetTaxFormByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_tax_forms_bystaff_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_tax_forms_bystaff_id.dart new file mode 100644 index 00000000..c9be080e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_tax_forms_bystaff_id.dart @@ -0,0 +1,190 @@ +part of 'generated.dart'; + +class GetTaxFormsBystaffIdVariablesBuilder { + String staffId; + + final FirebaseDataConnect _dataConnect; + GetTaxFormsBystaffIdVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => GetTaxFormsBystaffIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetTaxFormsBystaffIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetTaxFormsBystaffIdVariables vars= GetTaxFormsBystaffIdVariables(staffId: staffId,); + return _dataConnect.query("getTaxFormsBystaffId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetTaxFormsBystaffIdTaxForms { + final String id; + final EnumValue formType; + final String title; + final String? subtitle; + final String? description; + final EnumValue status; + final String staffId; + final AnyValue? formData; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetTaxFormsBystaffIdTaxForms.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + formType = taxFormTypeDeserializer(json['formType']), + title = nativeFromJson(json['title']), + subtitle = json['subtitle'] == null ? null : nativeFromJson(json['subtitle']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + status = taxFormStatusDeserializer(json['status']), + staffId = nativeFromJson(json['staffId']), + formData = json['formData'] == null ? null : AnyValue.fromJson(json['formData']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaxFormsBystaffIdTaxForms otherTyped = other as GetTaxFormsBystaffIdTaxForms; + return id == otherTyped.id && + formType == otherTyped.formType && + title == otherTyped.title && + subtitle == otherTyped.subtitle && + description == otherTyped.description && + status == otherTyped.status && + staffId == otherTyped.staffId && + formData == otherTyped.formData && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, formType.hashCode, title.hashCode, subtitle.hashCode, description.hashCode, status.hashCode, staffId.hashCode, formData.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['formType'] = + taxFormTypeSerializer(formType) + ; + json['title'] = nativeToJson(title); + if (subtitle != null) { + json['subtitle'] = nativeToJson(subtitle); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + json['status'] = + taxFormStatusSerializer(status) + ; + json['staffId'] = nativeToJson(staffId); + if (formData != null) { + json['formData'] = formData!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetTaxFormsBystaffIdTaxForms({ + required this.id, + required this.formType, + required this.title, + this.subtitle, + this.description, + required this.status, + required this.staffId, + this.formData, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetTaxFormsBystaffIdData { + final List taxForms; + GetTaxFormsBystaffIdData.fromJson(dynamic json): + + taxForms = (json['taxForms'] as List) + .map((e) => GetTaxFormsBystaffIdTaxForms.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaxFormsBystaffIdData otherTyped = other as GetTaxFormsBystaffIdData; + return taxForms == otherTyped.taxForms; + + } + @override + int get hashCode => taxForms.hashCode; + + + Map toJson() { + Map json = {}; + json['taxForms'] = taxForms.map((e) => e.toJson()).toList(); + return json; + } + + GetTaxFormsBystaffIdData({ + required this.taxForms, + }); +} + +@immutable +class GetTaxFormsBystaffIdVariables { + final String staffId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetTaxFormsBystaffIdVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTaxFormsBystaffIdVariables otherTyped = other as GetTaxFormsBystaffIdVariables; + return staffId == otherTyped.staffId; + + } + @override + int get hashCode => staffId.hashCode; + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + return json; + } + + GetTaxFormsBystaffIdVariables({ + required this.staffId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_by_id.dart new file mode 100644 index 00000000..8a449009 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_by_id.dart @@ -0,0 +1,235 @@ +part of 'generated.dart'; + +class GetTeamByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetTeamByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetTeamByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetTeamByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetTeamByIdVariables vars= GetTeamByIdVariables(id: id,); + return _dataConnect.query("getTeamById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetTeamByIdTeam { + final String id; + final String teamName; + final String ownerId; + final String ownerName; + final String ownerRole; + final String? email; + final String? companyLogo; + final int? totalMembers; + final int? activeMembers; + final int? totalHubs; + final AnyValue? departments; + final int? favoriteStaffCount; + final int? blockedStaffCount; + final AnyValue? favoriteStaff; + final AnyValue? blockedStaff; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetTeamByIdTeam.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + teamName = nativeFromJson(json['teamName']), + ownerId = nativeFromJson(json['ownerId']), + ownerName = nativeFromJson(json['ownerName']), + ownerRole = nativeFromJson(json['ownerRole']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + companyLogo = json['companyLogo'] == null ? null : nativeFromJson(json['companyLogo']), + totalMembers = json['totalMembers'] == null ? null : nativeFromJson(json['totalMembers']), + activeMembers = json['activeMembers'] == null ? null : nativeFromJson(json['activeMembers']), + totalHubs = json['totalHubs'] == null ? null : nativeFromJson(json['totalHubs']), + departments = json['departments'] == null ? null : AnyValue.fromJson(json['departments']), + favoriteStaffCount = json['favoriteStaffCount'] == null ? null : nativeFromJson(json['favoriteStaffCount']), + blockedStaffCount = json['blockedStaffCount'] == null ? null : nativeFromJson(json['blockedStaffCount']), + favoriteStaff = json['favoriteStaff'] == null ? null : AnyValue.fromJson(json['favoriteStaff']), + blockedStaff = json['blockedStaff'] == null ? null : AnyValue.fromJson(json['blockedStaff']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamByIdTeam otherTyped = other as GetTeamByIdTeam; + return id == otherTyped.id && + teamName == otherTyped.teamName && + ownerId == otherTyped.ownerId && + ownerName == otherTyped.ownerName && + ownerRole == otherTyped.ownerRole && + email == otherTyped.email && + companyLogo == otherTyped.companyLogo && + totalMembers == otherTyped.totalMembers && + activeMembers == otherTyped.activeMembers && + totalHubs == otherTyped.totalHubs && + departments == otherTyped.departments && + favoriteStaffCount == otherTyped.favoriteStaffCount && + blockedStaffCount == otherTyped.blockedStaffCount && + favoriteStaff == otherTyped.favoriteStaff && + blockedStaff == otherTyped.blockedStaff && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, teamName.hashCode, ownerId.hashCode, ownerName.hashCode, ownerRole.hashCode, email.hashCode, companyLogo.hashCode, totalMembers.hashCode, activeMembers.hashCode, totalHubs.hashCode, departments.hashCode, favoriteStaffCount.hashCode, blockedStaffCount.hashCode, favoriteStaff.hashCode, blockedStaff.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['teamName'] = nativeToJson(teamName); + json['ownerId'] = nativeToJson(ownerId); + json['ownerName'] = nativeToJson(ownerName); + json['ownerRole'] = nativeToJson(ownerRole); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (companyLogo != null) { + json['companyLogo'] = nativeToJson(companyLogo); + } + if (totalMembers != null) { + json['totalMembers'] = nativeToJson(totalMembers); + } + if (activeMembers != null) { + json['activeMembers'] = nativeToJson(activeMembers); + } + if (totalHubs != null) { + json['totalHubs'] = nativeToJson(totalHubs); + } + if (departments != null) { + json['departments'] = departments!.toJson(); + } + if (favoriteStaffCount != null) { + json['favoriteStaffCount'] = nativeToJson(favoriteStaffCount); + } + if (blockedStaffCount != null) { + json['blockedStaffCount'] = nativeToJson(blockedStaffCount); + } + if (favoriteStaff != null) { + json['favoriteStaff'] = favoriteStaff!.toJson(); + } + if (blockedStaff != null) { + json['blockedStaff'] = blockedStaff!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetTeamByIdTeam({ + required this.id, + required this.teamName, + required this.ownerId, + required this.ownerName, + required this.ownerRole, + this.email, + this.companyLogo, + this.totalMembers, + this.activeMembers, + this.totalHubs, + this.departments, + this.favoriteStaffCount, + this.blockedStaffCount, + this.favoriteStaff, + this.blockedStaff, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetTeamByIdData { + final GetTeamByIdTeam? team; + GetTeamByIdData.fromJson(dynamic json): + + team = json['team'] == null ? null : GetTeamByIdTeam.fromJson(json['team']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamByIdData otherTyped = other as GetTeamByIdData; + return team == otherTyped.team; + + } + @override + int get hashCode => team.hashCode; + + + Map toJson() { + Map json = {}; + if (team != null) { + json['team'] = team!.toJson(); + } + return json; + } + + GetTeamByIdData({ + this.team, + }); +} + +@immutable +class GetTeamByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetTeamByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamByIdVariables otherTyped = other as GetTeamByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetTeamByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_hub_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_hub_by_id.dart new file mode 100644 index 00000000..39e1fa0b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_hub_by_id.dart @@ -0,0 +1,200 @@ +part of 'generated.dart'; + +class GetTeamHubByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetTeamHubByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetTeamHubByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetTeamHubByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetTeamHubByIdVariables vars= GetTeamHubByIdVariables(id: id,); + return _dataConnect.query("getTeamHubById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetTeamHubByIdTeamHub { + final String id; + final String teamId; + final String hubName; + final String address; + final String? city; + final String? state; + final String? zipCode; + final String? managerName; + final bool isActive; + final AnyValue? departments; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetTeamHubByIdTeamHub.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + teamId = nativeFromJson(json['teamId']), + hubName = nativeFromJson(json['hubName']), + address = nativeFromJson(json['address']), + city = json['city'] == null ? null : nativeFromJson(json['city']), + state = json['state'] == null ? null : nativeFromJson(json['state']), + zipCode = json['zipCode'] == null ? null : nativeFromJson(json['zipCode']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + isActive = nativeFromJson(json['isActive']), + departments = json['departments'] == null ? null : AnyValue.fromJson(json['departments']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamHubByIdTeamHub otherTyped = other as GetTeamHubByIdTeamHub; + return id == otherTyped.id && + teamId == otherTyped.teamId && + hubName == otherTyped.hubName && + address == otherTyped.address && + city == otherTyped.city && + state == otherTyped.state && + zipCode == otherTyped.zipCode && + managerName == otherTyped.managerName && + isActive == otherTyped.isActive && + departments == otherTyped.departments && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, teamId.hashCode, hubName.hashCode, address.hashCode, city.hashCode, state.hashCode, zipCode.hashCode, managerName.hashCode, isActive.hashCode, departments.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['teamId'] = nativeToJson(teamId); + json['hubName'] = nativeToJson(hubName); + json['address'] = nativeToJson(address); + if (city != null) { + json['city'] = nativeToJson(city); + } + if (state != null) { + json['state'] = nativeToJson(state); + } + if (zipCode != null) { + json['zipCode'] = nativeToJson(zipCode); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + json['isActive'] = nativeToJson(isActive); + if (departments != null) { + json['departments'] = departments!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetTeamHubByIdTeamHub({ + required this.id, + required this.teamId, + required this.hubName, + required this.address, + this.city, + this.state, + this.zipCode, + this.managerName, + required this.isActive, + this.departments, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetTeamHubByIdData { + final GetTeamHubByIdTeamHub? teamHub; + GetTeamHubByIdData.fromJson(dynamic json): + + teamHub = json['teamHub'] == null ? null : GetTeamHubByIdTeamHub.fromJson(json['teamHub']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamHubByIdData otherTyped = other as GetTeamHubByIdData; + return teamHub == otherTyped.teamHub; + + } + @override + int get hashCode => teamHub.hashCode; + + + Map toJson() { + Map json = {}; + if (teamHub != null) { + json['teamHub'] = teamHub!.toJson(); + } + return json; + } + + GetTeamHubByIdData({ + this.teamHub, + }); +} + +@immutable +class GetTeamHubByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetTeamHubByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamHubByIdVariables otherTyped = other as GetTeamHubByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetTeamHubByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_hubs_by_team_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_hubs_by_team_id.dart new file mode 100644 index 00000000..c0534c24 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_hubs_by_team_id.dart @@ -0,0 +1,200 @@ +part of 'generated.dart'; + +class GetTeamHubsByTeamIdVariablesBuilder { + String teamId; + + final FirebaseDataConnect _dataConnect; + GetTeamHubsByTeamIdVariablesBuilder(this._dataConnect, {required this.teamId,}); + Deserializer dataDeserializer = (dynamic json) => GetTeamHubsByTeamIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetTeamHubsByTeamIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetTeamHubsByTeamIdVariables vars= GetTeamHubsByTeamIdVariables(teamId: teamId,); + return _dataConnect.query("getTeamHubsByTeamId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetTeamHubsByTeamIdTeamHubs { + final String id; + final String teamId; + final String hubName; + final String address; + final String? city; + final String? state; + final String? zipCode; + final String? managerName; + final bool isActive; + final AnyValue? departments; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetTeamHubsByTeamIdTeamHubs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + teamId = nativeFromJson(json['teamId']), + hubName = nativeFromJson(json['hubName']), + address = nativeFromJson(json['address']), + city = json['city'] == null ? null : nativeFromJson(json['city']), + state = json['state'] == null ? null : nativeFromJson(json['state']), + zipCode = json['zipCode'] == null ? null : nativeFromJson(json['zipCode']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + isActive = nativeFromJson(json['isActive']), + departments = json['departments'] == null ? null : AnyValue.fromJson(json['departments']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamHubsByTeamIdTeamHubs otherTyped = other as GetTeamHubsByTeamIdTeamHubs; + return id == otherTyped.id && + teamId == otherTyped.teamId && + hubName == otherTyped.hubName && + address == otherTyped.address && + city == otherTyped.city && + state == otherTyped.state && + zipCode == otherTyped.zipCode && + managerName == otherTyped.managerName && + isActive == otherTyped.isActive && + departments == otherTyped.departments && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, teamId.hashCode, hubName.hashCode, address.hashCode, city.hashCode, state.hashCode, zipCode.hashCode, managerName.hashCode, isActive.hashCode, departments.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['teamId'] = nativeToJson(teamId); + json['hubName'] = nativeToJson(hubName); + json['address'] = nativeToJson(address); + if (city != null) { + json['city'] = nativeToJson(city); + } + if (state != null) { + json['state'] = nativeToJson(state); + } + if (zipCode != null) { + json['zipCode'] = nativeToJson(zipCode); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + json['isActive'] = nativeToJson(isActive); + if (departments != null) { + json['departments'] = departments!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetTeamHubsByTeamIdTeamHubs({ + required this.id, + required this.teamId, + required this.hubName, + required this.address, + this.city, + this.state, + this.zipCode, + this.managerName, + required this.isActive, + this.departments, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetTeamHubsByTeamIdData { + final List teamHubs; + GetTeamHubsByTeamIdData.fromJson(dynamic json): + + teamHubs = (json['teamHubs'] as List) + .map((e) => GetTeamHubsByTeamIdTeamHubs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamHubsByTeamIdData otherTyped = other as GetTeamHubsByTeamIdData; + return teamHubs == otherTyped.teamHubs; + + } + @override + int get hashCode => teamHubs.hashCode; + + + Map toJson() { + Map json = {}; + json['teamHubs'] = teamHubs.map((e) => e.toJson()).toList(); + return json; + } + + GetTeamHubsByTeamIdData({ + required this.teamHubs, + }); +} + +@immutable +class GetTeamHubsByTeamIdVariables { + final String teamId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetTeamHubsByTeamIdVariables.fromJson(Map json): + + teamId = nativeFromJson(json['teamId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamHubsByTeamIdVariables otherTyped = other as GetTeamHubsByTeamIdVariables; + return teamId == otherTyped.teamId; + + } + @override + int get hashCode => teamId.hashCode; + + + Map toJson() { + Map json = {}; + json['teamId'] = nativeToJson(teamId); + return json; + } + + GetTeamHubsByTeamIdVariables({ + required this.teamId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_hud_department_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_hud_department_by_id.dart new file mode 100644 index 00000000..cc4aa27d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_hud_department_by_id.dart @@ -0,0 +1,192 @@ +part of 'generated.dart'; + +class GetTeamHudDepartmentByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetTeamHudDepartmentByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetTeamHudDepartmentByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetTeamHudDepartmentByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetTeamHudDepartmentByIdVariables vars= GetTeamHudDepartmentByIdVariables(id: id,); + return _dataConnect.query("getTeamHudDepartmentById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetTeamHudDepartmentByIdTeamHudDepartment { + final String id; + final String name; + final String? costCenter; + final String teamHubId; + final GetTeamHudDepartmentByIdTeamHudDepartmentTeamHub teamHub; + final Timestamp? createdAt; + GetTeamHudDepartmentByIdTeamHudDepartment.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costCenter = json['costCenter'] == null ? null : nativeFromJson(json['costCenter']), + teamHubId = nativeFromJson(json['teamHubId']), + teamHub = GetTeamHudDepartmentByIdTeamHudDepartmentTeamHub.fromJson(json['teamHub']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamHudDepartmentByIdTeamHudDepartment otherTyped = other as GetTeamHudDepartmentByIdTeamHudDepartment; + return id == otherTyped.id && + name == otherTyped.name && + costCenter == otherTyped.costCenter && + teamHubId == otherTyped.teamHubId && + teamHub == otherTyped.teamHub && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costCenter.hashCode, teamHubId.hashCode, teamHub.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + if (costCenter != null) { + json['costCenter'] = nativeToJson(costCenter); + } + json['teamHubId'] = nativeToJson(teamHubId); + json['teamHub'] = teamHub.toJson(); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + GetTeamHudDepartmentByIdTeamHudDepartment({ + required this.id, + required this.name, + this.costCenter, + required this.teamHubId, + required this.teamHub, + this.createdAt, + }); +} + +@immutable +class GetTeamHudDepartmentByIdTeamHudDepartmentTeamHub { + final String id; + final String hubName; + GetTeamHudDepartmentByIdTeamHudDepartmentTeamHub.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + hubName = nativeFromJson(json['hubName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamHudDepartmentByIdTeamHudDepartmentTeamHub otherTyped = other as GetTeamHudDepartmentByIdTeamHudDepartmentTeamHub; + return id == otherTyped.id && + hubName == otherTyped.hubName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, hubName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['hubName'] = nativeToJson(hubName); + return json; + } + + GetTeamHudDepartmentByIdTeamHudDepartmentTeamHub({ + required this.id, + required this.hubName, + }); +} + +@immutable +class GetTeamHudDepartmentByIdData { + final GetTeamHudDepartmentByIdTeamHudDepartment? teamHudDepartment; + GetTeamHudDepartmentByIdData.fromJson(dynamic json): + + teamHudDepartment = json['teamHudDepartment'] == null ? null : GetTeamHudDepartmentByIdTeamHudDepartment.fromJson(json['teamHudDepartment']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamHudDepartmentByIdData otherTyped = other as GetTeamHudDepartmentByIdData; + return teamHudDepartment == otherTyped.teamHudDepartment; + + } + @override + int get hashCode => teamHudDepartment.hashCode; + + + Map toJson() { + Map json = {}; + if (teamHudDepartment != null) { + json['teamHudDepartment'] = teamHudDepartment!.toJson(); + } + return json; + } + + GetTeamHudDepartmentByIdData({ + this.teamHudDepartment, + }); +} + +@immutable +class GetTeamHudDepartmentByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetTeamHudDepartmentByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamHudDepartmentByIdVariables otherTyped = other as GetTeamHudDepartmentByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetTeamHudDepartmentByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_member_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_member_by_id.dart new file mode 100644 index 00000000..aa74a564 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_member_by_id.dart @@ -0,0 +1,260 @@ +part of 'generated.dart'; + +class GetTeamMemberByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetTeamMemberByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetTeamMemberByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetTeamMemberByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetTeamMemberByIdVariables vars= GetTeamMemberByIdVariables(id: id,); + return _dataConnect.query("getTeamMemberById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetTeamMemberByIdTeamMember { + final String id; + final String teamId; + final EnumValue role; + final String? title; + final String? department; + final String? teamHubId; + final bool? isActive; + final Timestamp? createdAt; + final GetTeamMemberByIdTeamMemberUser user; + final GetTeamMemberByIdTeamMemberTeamHub? teamHub; + GetTeamMemberByIdTeamMember.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + teamId = nativeFromJson(json['teamId']), + role = teamMemberRoleDeserializer(json['role']), + title = json['title'] == null ? null : nativeFromJson(json['title']), + department = json['department'] == null ? null : nativeFromJson(json['department']), + teamHubId = json['teamHubId'] == null ? null : nativeFromJson(json['teamHubId']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + user = GetTeamMemberByIdTeamMemberUser.fromJson(json['user']), + teamHub = json['teamHub'] == null ? null : GetTeamMemberByIdTeamMemberTeamHub.fromJson(json['teamHub']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamMemberByIdTeamMember otherTyped = other as GetTeamMemberByIdTeamMember; + return id == otherTyped.id && + teamId == otherTyped.teamId && + role == otherTyped.role && + title == otherTyped.title && + department == otherTyped.department && + teamHubId == otherTyped.teamHubId && + isActive == otherTyped.isActive && + createdAt == otherTyped.createdAt && + user == otherTyped.user && + teamHub == otherTyped.teamHub; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, teamId.hashCode, role.hashCode, title.hashCode, department.hashCode, teamHubId.hashCode, isActive.hashCode, createdAt.hashCode, user.hashCode, teamHub.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['teamId'] = nativeToJson(teamId); + json['role'] = + teamMemberRoleSerializer(role) + ; + if (title != null) { + json['title'] = nativeToJson(title); + } + if (department != null) { + json['department'] = nativeToJson(department); + } + if (teamHubId != null) { + json['teamHubId'] = nativeToJson(teamHubId); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['user'] = user.toJson(); + if (teamHub != null) { + json['teamHub'] = teamHub!.toJson(); + } + return json; + } + + GetTeamMemberByIdTeamMember({ + required this.id, + required this.teamId, + required this.role, + this.title, + this.department, + this.teamHubId, + this.isActive, + this.createdAt, + required this.user, + this.teamHub, + }); +} + +@immutable +class GetTeamMemberByIdTeamMemberUser { + final String? fullName; + final String? email; + GetTeamMemberByIdTeamMemberUser.fromJson(dynamic json): + + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamMemberByIdTeamMemberUser otherTyped = other as GetTeamMemberByIdTeamMemberUser; + return fullName == otherTyped.fullName && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([fullName.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + GetTeamMemberByIdTeamMemberUser({ + this.fullName, + this.email, + }); +} + +@immutable +class GetTeamMemberByIdTeamMemberTeamHub { + final String hubName; + GetTeamMemberByIdTeamMemberTeamHub.fromJson(dynamic json): + + hubName = nativeFromJson(json['hubName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamMemberByIdTeamMemberTeamHub otherTyped = other as GetTeamMemberByIdTeamMemberTeamHub; + return hubName == otherTyped.hubName; + + } + @override + int get hashCode => hubName.hashCode; + + + Map toJson() { + Map json = {}; + json['hubName'] = nativeToJson(hubName); + return json; + } + + GetTeamMemberByIdTeamMemberTeamHub({ + required this.hubName, + }); +} + +@immutable +class GetTeamMemberByIdData { + final GetTeamMemberByIdTeamMember? teamMember; + GetTeamMemberByIdData.fromJson(dynamic json): + + teamMember = json['teamMember'] == null ? null : GetTeamMemberByIdTeamMember.fromJson(json['teamMember']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamMemberByIdData otherTyped = other as GetTeamMemberByIdData; + return teamMember == otherTyped.teamMember; + + } + @override + int get hashCode => teamMember.hashCode; + + + Map toJson() { + Map json = {}; + if (teamMember != null) { + json['teamMember'] = teamMember!.toJson(); + } + return json; + } + + GetTeamMemberByIdData({ + this.teamMember, + }); +} + +@immutable +class GetTeamMemberByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetTeamMemberByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamMemberByIdVariables otherTyped = other as GetTeamMemberByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetTeamMemberByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_members_by_team_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_members_by_team_id.dart new file mode 100644 index 00000000..72939378 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_team_members_by_team_id.dart @@ -0,0 +1,260 @@ +part of 'generated.dart'; + +class GetTeamMembersByTeamIdVariablesBuilder { + String teamId; + + final FirebaseDataConnect _dataConnect; + GetTeamMembersByTeamIdVariablesBuilder(this._dataConnect, {required this.teamId,}); + Deserializer dataDeserializer = (dynamic json) => GetTeamMembersByTeamIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetTeamMembersByTeamIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetTeamMembersByTeamIdVariables vars= GetTeamMembersByTeamIdVariables(teamId: teamId,); + return _dataConnect.query("getTeamMembersByTeamId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetTeamMembersByTeamIdTeamMembers { + final String id; + final String teamId; + final EnumValue role; + final String? title; + final String? department; + final String? teamHubId; + final bool? isActive; + final Timestamp? createdAt; + final GetTeamMembersByTeamIdTeamMembersUser user; + final GetTeamMembersByTeamIdTeamMembersTeamHub? teamHub; + GetTeamMembersByTeamIdTeamMembers.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + teamId = nativeFromJson(json['teamId']), + role = teamMemberRoleDeserializer(json['role']), + title = json['title'] == null ? null : nativeFromJson(json['title']), + department = json['department'] == null ? null : nativeFromJson(json['department']), + teamHubId = json['teamHubId'] == null ? null : nativeFromJson(json['teamHubId']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + user = GetTeamMembersByTeamIdTeamMembersUser.fromJson(json['user']), + teamHub = json['teamHub'] == null ? null : GetTeamMembersByTeamIdTeamMembersTeamHub.fromJson(json['teamHub']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamMembersByTeamIdTeamMembers otherTyped = other as GetTeamMembersByTeamIdTeamMembers; + return id == otherTyped.id && + teamId == otherTyped.teamId && + role == otherTyped.role && + title == otherTyped.title && + department == otherTyped.department && + teamHubId == otherTyped.teamHubId && + isActive == otherTyped.isActive && + createdAt == otherTyped.createdAt && + user == otherTyped.user && + teamHub == otherTyped.teamHub; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, teamId.hashCode, role.hashCode, title.hashCode, department.hashCode, teamHubId.hashCode, isActive.hashCode, createdAt.hashCode, user.hashCode, teamHub.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['teamId'] = nativeToJson(teamId); + json['role'] = + teamMemberRoleSerializer(role) + ; + if (title != null) { + json['title'] = nativeToJson(title); + } + if (department != null) { + json['department'] = nativeToJson(department); + } + if (teamHubId != null) { + json['teamHubId'] = nativeToJson(teamHubId); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['user'] = user.toJson(); + if (teamHub != null) { + json['teamHub'] = teamHub!.toJson(); + } + return json; + } + + GetTeamMembersByTeamIdTeamMembers({ + required this.id, + required this.teamId, + required this.role, + this.title, + this.department, + this.teamHubId, + this.isActive, + this.createdAt, + required this.user, + this.teamHub, + }); +} + +@immutable +class GetTeamMembersByTeamIdTeamMembersUser { + final String? fullName; + final String? email; + GetTeamMembersByTeamIdTeamMembersUser.fromJson(dynamic json): + + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamMembersByTeamIdTeamMembersUser otherTyped = other as GetTeamMembersByTeamIdTeamMembersUser; + return fullName == otherTyped.fullName && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([fullName.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + GetTeamMembersByTeamIdTeamMembersUser({ + this.fullName, + this.email, + }); +} + +@immutable +class GetTeamMembersByTeamIdTeamMembersTeamHub { + final String hubName; + GetTeamMembersByTeamIdTeamMembersTeamHub.fromJson(dynamic json): + + hubName = nativeFromJson(json['hubName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamMembersByTeamIdTeamMembersTeamHub otherTyped = other as GetTeamMembersByTeamIdTeamMembersTeamHub; + return hubName == otherTyped.hubName; + + } + @override + int get hashCode => hubName.hashCode; + + + Map toJson() { + Map json = {}; + json['hubName'] = nativeToJson(hubName); + return json; + } + + GetTeamMembersByTeamIdTeamMembersTeamHub({ + required this.hubName, + }); +} + +@immutable +class GetTeamMembersByTeamIdData { + final List teamMembers; + GetTeamMembersByTeamIdData.fromJson(dynamic json): + + teamMembers = (json['teamMembers'] as List) + .map((e) => GetTeamMembersByTeamIdTeamMembers.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamMembersByTeamIdData otherTyped = other as GetTeamMembersByTeamIdData; + return teamMembers == otherTyped.teamMembers; + + } + @override + int get hashCode => teamMembers.hashCode; + + + Map toJson() { + Map json = {}; + json['teamMembers'] = teamMembers.map((e) => e.toJson()).toList(); + return json; + } + + GetTeamMembersByTeamIdData({ + required this.teamMembers, + }); +} + +@immutable +class GetTeamMembersByTeamIdVariables { + final String teamId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetTeamMembersByTeamIdVariables.fromJson(Map json): + + teamId = nativeFromJson(json['teamId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamMembersByTeamIdVariables otherTyped = other as GetTeamMembersByTeamIdVariables; + return teamId == otherTyped.teamId; + + } + @override + int get hashCode => teamId.hashCode; + + + Map toJson() { + Map json = {}; + json['teamId'] = nativeToJson(teamId); + return json; + } + + GetTeamMembersByTeamIdVariables({ + required this.teamId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_teams_by_owner_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_teams_by_owner_id.dart new file mode 100644 index 00000000..cf4f44bc --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_teams_by_owner_id.dart @@ -0,0 +1,235 @@ +part of 'generated.dart'; + +class GetTeamsByOwnerIdVariablesBuilder { + String ownerId; + + final FirebaseDataConnect _dataConnect; + GetTeamsByOwnerIdVariablesBuilder(this._dataConnect, {required this.ownerId,}); + Deserializer dataDeserializer = (dynamic json) => GetTeamsByOwnerIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetTeamsByOwnerIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetTeamsByOwnerIdVariables vars= GetTeamsByOwnerIdVariables(ownerId: ownerId,); + return _dataConnect.query("getTeamsByOwnerId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetTeamsByOwnerIdTeams { + final String id; + final String teamName; + final String ownerId; + final String ownerName; + final String ownerRole; + final String? email; + final String? companyLogo; + final int? totalMembers; + final int? activeMembers; + final int? totalHubs; + final AnyValue? departments; + final int? favoriteStaffCount; + final int? blockedStaffCount; + final AnyValue? favoriteStaff; + final AnyValue? blockedStaff; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetTeamsByOwnerIdTeams.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + teamName = nativeFromJson(json['teamName']), + ownerId = nativeFromJson(json['ownerId']), + ownerName = nativeFromJson(json['ownerName']), + ownerRole = nativeFromJson(json['ownerRole']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + companyLogo = json['companyLogo'] == null ? null : nativeFromJson(json['companyLogo']), + totalMembers = json['totalMembers'] == null ? null : nativeFromJson(json['totalMembers']), + activeMembers = json['activeMembers'] == null ? null : nativeFromJson(json['activeMembers']), + totalHubs = json['totalHubs'] == null ? null : nativeFromJson(json['totalHubs']), + departments = json['departments'] == null ? null : AnyValue.fromJson(json['departments']), + favoriteStaffCount = json['favoriteStaffCount'] == null ? null : nativeFromJson(json['favoriteStaffCount']), + blockedStaffCount = json['blockedStaffCount'] == null ? null : nativeFromJson(json['blockedStaffCount']), + favoriteStaff = json['favoriteStaff'] == null ? null : AnyValue.fromJson(json['favoriteStaff']), + blockedStaff = json['blockedStaff'] == null ? null : AnyValue.fromJson(json['blockedStaff']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamsByOwnerIdTeams otherTyped = other as GetTeamsByOwnerIdTeams; + return id == otherTyped.id && + teamName == otherTyped.teamName && + ownerId == otherTyped.ownerId && + ownerName == otherTyped.ownerName && + ownerRole == otherTyped.ownerRole && + email == otherTyped.email && + companyLogo == otherTyped.companyLogo && + totalMembers == otherTyped.totalMembers && + activeMembers == otherTyped.activeMembers && + totalHubs == otherTyped.totalHubs && + departments == otherTyped.departments && + favoriteStaffCount == otherTyped.favoriteStaffCount && + blockedStaffCount == otherTyped.blockedStaffCount && + favoriteStaff == otherTyped.favoriteStaff && + blockedStaff == otherTyped.blockedStaff && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, teamName.hashCode, ownerId.hashCode, ownerName.hashCode, ownerRole.hashCode, email.hashCode, companyLogo.hashCode, totalMembers.hashCode, activeMembers.hashCode, totalHubs.hashCode, departments.hashCode, favoriteStaffCount.hashCode, blockedStaffCount.hashCode, favoriteStaff.hashCode, blockedStaff.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['teamName'] = nativeToJson(teamName); + json['ownerId'] = nativeToJson(ownerId); + json['ownerName'] = nativeToJson(ownerName); + json['ownerRole'] = nativeToJson(ownerRole); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (companyLogo != null) { + json['companyLogo'] = nativeToJson(companyLogo); + } + if (totalMembers != null) { + json['totalMembers'] = nativeToJson(totalMembers); + } + if (activeMembers != null) { + json['activeMembers'] = nativeToJson(activeMembers); + } + if (totalHubs != null) { + json['totalHubs'] = nativeToJson(totalHubs); + } + if (departments != null) { + json['departments'] = departments!.toJson(); + } + if (favoriteStaffCount != null) { + json['favoriteStaffCount'] = nativeToJson(favoriteStaffCount); + } + if (blockedStaffCount != null) { + json['blockedStaffCount'] = nativeToJson(blockedStaffCount); + } + if (favoriteStaff != null) { + json['favoriteStaff'] = favoriteStaff!.toJson(); + } + if (blockedStaff != null) { + json['blockedStaff'] = blockedStaff!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetTeamsByOwnerIdTeams({ + required this.id, + required this.teamName, + required this.ownerId, + required this.ownerName, + required this.ownerRole, + this.email, + this.companyLogo, + this.totalMembers, + this.activeMembers, + this.totalHubs, + this.departments, + this.favoriteStaffCount, + this.blockedStaffCount, + this.favoriteStaff, + this.blockedStaff, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetTeamsByOwnerIdData { + final List teams; + GetTeamsByOwnerIdData.fromJson(dynamic json): + + teams = (json['teams'] as List) + .map((e) => GetTeamsByOwnerIdTeams.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamsByOwnerIdData otherTyped = other as GetTeamsByOwnerIdData; + return teams == otherTyped.teams; + + } + @override + int get hashCode => teams.hashCode; + + + Map toJson() { + Map json = {}; + json['teams'] = teams.map((e) => e.toJson()).toList(); + return json; + } + + GetTeamsByOwnerIdData({ + required this.teams, + }); +} + +@immutable +class GetTeamsByOwnerIdVariables { + final String ownerId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetTeamsByOwnerIdVariables.fromJson(Map json): + + ownerId = nativeFromJson(json['ownerId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetTeamsByOwnerIdVariables otherTyped = other as GetTeamsByOwnerIdVariables; + return ownerId == otherTyped.ownerId; + + } + @override + int get hashCode => ownerId.hashCode; + + + Map toJson() { + Map json = {}; + json['ownerId'] = nativeToJson(ownerId); + return json; + } + + GetTeamsByOwnerIdVariables({ + required this.ownerId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_user_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_user_by_id.dart new file mode 100644 index 00000000..167c4fec --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_user_by_id.dart @@ -0,0 +1,159 @@ +part of 'generated.dart'; + +class GetUserByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetUserByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetUserByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetUserByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetUserByIdVariables vars= GetUserByIdVariables(id: id,); + return _dataConnect.query("getUserById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetUserByIdUser { + final String id; + final String? email; + final String? fullName; + final EnumValue role; + final String? userRole; + final String? photoUrl; + GetUserByIdUser.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + role = userBaseRoleDeserializer(json['role']), + userRole = json['userRole'] == null ? null : nativeFromJson(json['userRole']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetUserByIdUser otherTyped = other as GetUserByIdUser; + return id == otherTyped.id && + email == otherTyped.email && + fullName == otherTyped.fullName && + role == otherTyped.role && + userRole == otherTyped.userRole && + photoUrl == otherTyped.photoUrl; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, email.hashCode, fullName.hashCode, role.hashCode, userRole.hashCode, photoUrl.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + json['role'] = + userBaseRoleSerializer(role) + ; + if (userRole != null) { + json['userRole'] = nativeToJson(userRole); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + return json; + } + + GetUserByIdUser({ + required this.id, + this.email, + this.fullName, + required this.role, + this.userRole, + this.photoUrl, + }); +} + +@immutable +class GetUserByIdData { + final GetUserByIdUser? user; + GetUserByIdData.fromJson(dynamic json): + + user = json['user'] == null ? null : GetUserByIdUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetUserByIdData otherTyped = other as GetUserByIdData; + return user == otherTyped.user; + + } + @override + int get hashCode => user.hashCode; + + + Map toJson() { + Map json = {}; + if (user != null) { + json['user'] = user!.toJson(); + } + return json; + } + + GetUserByIdData({ + this.user, + }); +} + +@immutable +class GetUserByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetUserByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetUserByIdVariables otherTyped = other as GetUserByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetUserByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_user_conversation_by_key.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_user_conversation_by_key.dart new file mode 100644 index 00000000..d0a8a9c8 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_user_conversation_by_key.dart @@ -0,0 +1,313 @@ +part of 'generated.dart'; + +class GetUserConversationByKeyVariablesBuilder { + String conversationId; + String userId; + + final FirebaseDataConnect _dataConnect; + GetUserConversationByKeyVariablesBuilder(this._dataConnect, {required this.conversationId,required this.userId,}); + Deserializer dataDeserializer = (dynamic json) => GetUserConversationByKeyData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetUserConversationByKeyVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetUserConversationByKeyVariables vars= GetUserConversationByKeyVariables(conversationId: conversationId,userId: userId,); + return _dataConnect.query("getUserConversationByKey", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetUserConversationByKeyUserConversation { + final String id; + final String conversationId; + final String userId; + final int? unreadCount; + final Timestamp? lastReadAt; + final Timestamp? createdAt; + final GetUserConversationByKeyUserConversationConversation conversation; + final GetUserConversationByKeyUserConversationUser user; + GetUserConversationByKeyUserConversation.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']), + unreadCount = json['unreadCount'] == null ? null : nativeFromJson(json['unreadCount']), + lastReadAt = json['lastReadAt'] == null ? null : Timestamp.fromJson(json['lastReadAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + conversation = GetUserConversationByKeyUserConversationConversation.fromJson(json['conversation']), + user = GetUserConversationByKeyUserConversationUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetUserConversationByKeyUserConversation otherTyped = other as GetUserConversationByKeyUserConversation; + return id == otherTyped.id && + conversationId == otherTyped.conversationId && + userId == otherTyped.userId && + unreadCount == otherTyped.unreadCount && + lastReadAt == otherTyped.lastReadAt && + createdAt == otherTyped.createdAt && + conversation == otherTyped.conversation && + user == otherTyped.user; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, conversationId.hashCode, userId.hashCode, unreadCount.hashCode, lastReadAt.hashCode, createdAt.hashCode, conversation.hashCode, user.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + if (unreadCount != null) { + json['unreadCount'] = nativeToJson(unreadCount); + } + if (lastReadAt != null) { + json['lastReadAt'] = lastReadAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['conversation'] = conversation.toJson(); + json['user'] = user.toJson(); + return json; + } + + GetUserConversationByKeyUserConversation({ + required this.id, + required this.conversationId, + required this.userId, + this.unreadCount, + this.lastReadAt, + this.createdAt, + required this.conversation, + required this.user, + }); +} + +@immutable +class GetUserConversationByKeyUserConversationConversation { + final String id; + final String? subject; + final EnumValue? status; + final EnumValue? conversationType; + final bool? isGroup; + final String? groupName; + final String? lastMessage; + final Timestamp? lastMessageAt; + final Timestamp? createdAt; + GetUserConversationByKeyUserConversationConversation.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + subject = json['subject'] == null ? null : nativeFromJson(json['subject']), + status = json['status'] == null ? null : conversationStatusDeserializer(json['status']), + conversationType = json['conversationType'] == null ? null : conversationTypeDeserializer(json['conversationType']), + isGroup = json['isGroup'] == null ? null : nativeFromJson(json['isGroup']), + groupName = json['groupName'] == null ? null : nativeFromJson(json['groupName']), + lastMessage = json['lastMessage'] == null ? null : nativeFromJson(json['lastMessage']), + lastMessageAt = json['lastMessageAt'] == null ? null : Timestamp.fromJson(json['lastMessageAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetUserConversationByKeyUserConversationConversation otherTyped = other as GetUserConversationByKeyUserConversationConversation; + return id == otherTyped.id && + subject == otherTyped.subject && + status == otherTyped.status && + conversationType == otherTyped.conversationType && + isGroup == otherTyped.isGroup && + groupName == otherTyped.groupName && + lastMessage == otherTyped.lastMessage && + lastMessageAt == otherTyped.lastMessageAt && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, subject.hashCode, status.hashCode, conversationType.hashCode, isGroup.hashCode, groupName.hashCode, lastMessage.hashCode, lastMessageAt.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (subject != null) { + json['subject'] = nativeToJson(subject); + } + if (status != null) { + json['status'] = + conversationStatusSerializer(status!) + ; + } + if (conversationType != null) { + json['conversationType'] = + conversationTypeSerializer(conversationType!) + ; + } + if (isGroup != null) { + json['isGroup'] = nativeToJson(isGroup); + } + if (groupName != null) { + json['groupName'] = nativeToJson(groupName); + } + if (lastMessage != null) { + json['lastMessage'] = nativeToJson(lastMessage); + } + if (lastMessageAt != null) { + json['lastMessageAt'] = lastMessageAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + GetUserConversationByKeyUserConversationConversation({ + required this.id, + this.subject, + this.status, + this.conversationType, + this.isGroup, + this.groupName, + this.lastMessage, + this.lastMessageAt, + this.createdAt, + }); +} + +@immutable +class GetUserConversationByKeyUserConversationUser { + final String id; + final String? fullName; + final String? photoUrl; + GetUserConversationByKeyUserConversationUser.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetUserConversationByKeyUserConversationUser otherTyped = other as GetUserConversationByKeyUserConversationUser; + return id == otherTyped.id && + fullName == otherTyped.fullName && + photoUrl == otherTyped.photoUrl; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, photoUrl.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + return json; + } + + GetUserConversationByKeyUserConversationUser({ + required this.id, + this.fullName, + this.photoUrl, + }); +} + +@immutable +class GetUserConversationByKeyData { + final GetUserConversationByKeyUserConversation? userConversation; + GetUserConversationByKeyData.fromJson(dynamic json): + + userConversation = json['userConversation'] == null ? null : GetUserConversationByKeyUserConversation.fromJson(json['userConversation']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetUserConversationByKeyData otherTyped = other as GetUserConversationByKeyData; + return userConversation == otherTyped.userConversation; + + } + @override + int get hashCode => userConversation.hashCode; + + + Map toJson() { + Map json = {}; + if (userConversation != null) { + json['userConversation'] = userConversation!.toJson(); + } + return json; + } + + GetUserConversationByKeyData({ + this.userConversation, + }); +} + +@immutable +class GetUserConversationByKeyVariables { + final String conversationId; + final String userId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetUserConversationByKeyVariables.fromJson(Map json): + + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetUserConversationByKeyVariables otherTyped = other as GetUserConversationByKeyVariables; + return conversationId == otherTyped.conversationId && + userId == otherTyped.userId; + + } + @override + int get hashCode => Object.hashAll([conversationId.hashCode, userId.hashCode]); + + + Map toJson() { + Map json = {}; + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + return json; + } + + GetUserConversationByKeyVariables({ + required this.conversationId, + required this.userId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_vendor_benefit_plan_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_vendor_benefit_plan_by_id.dart new file mode 100644 index 00000000..0ee45b1c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_vendor_benefit_plan_by_id.dart @@ -0,0 +1,222 @@ +part of 'generated.dart'; + +class GetVendorBenefitPlanByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetVendorBenefitPlanByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetVendorBenefitPlanByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetVendorBenefitPlanByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetVendorBenefitPlanByIdVariables vars= GetVendorBenefitPlanByIdVariables(id: id,); + return _dataConnect.query("getVendorBenefitPlanById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetVendorBenefitPlanByIdVendorBenefitPlan { + final String id; + final String vendorId; + final String title; + final String? description; + final String? requestLabel; + final int? total; + final bool? isActive; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final GetVendorBenefitPlanByIdVendorBenefitPlanVendor vendor; + GetVendorBenefitPlanByIdVendorBenefitPlan.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + title = nativeFromJson(json['title']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + requestLabel = json['requestLabel'] == null ? null : nativeFromJson(json['requestLabel']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + vendor = GetVendorBenefitPlanByIdVendorBenefitPlanVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetVendorBenefitPlanByIdVendorBenefitPlan otherTyped = other as GetVendorBenefitPlanByIdVendorBenefitPlan; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + title == otherTyped.title && + description == otherTyped.description && + requestLabel == otherTyped.requestLabel && + total == otherTyped.total && + isActive == otherTyped.isActive && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, title.hashCode, description.hashCode, requestLabel.hashCode, total.hashCode, isActive.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + json['title'] = nativeToJson(title); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (requestLabel != null) { + json['requestLabel'] = nativeToJson(requestLabel); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['vendor'] = vendor.toJson(); + return json; + } + + GetVendorBenefitPlanByIdVendorBenefitPlan({ + required this.id, + required this.vendorId, + required this.title, + this.description, + this.requestLabel, + this.total, + this.isActive, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.vendor, + }); +} + +@immutable +class GetVendorBenefitPlanByIdVendorBenefitPlanVendor { + final String companyName; + GetVendorBenefitPlanByIdVendorBenefitPlanVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetVendorBenefitPlanByIdVendorBenefitPlanVendor otherTyped = other as GetVendorBenefitPlanByIdVendorBenefitPlanVendor; + return companyName == otherTyped.companyName; + + } + @override + int get hashCode => companyName.hashCode; + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetVendorBenefitPlanByIdVendorBenefitPlanVendor({ + required this.companyName, + }); +} + +@immutable +class GetVendorBenefitPlanByIdData { + final GetVendorBenefitPlanByIdVendorBenefitPlan? vendorBenefitPlan; + GetVendorBenefitPlanByIdData.fromJson(dynamic json): + + vendorBenefitPlan = json['vendorBenefitPlan'] == null ? null : GetVendorBenefitPlanByIdVendorBenefitPlan.fromJson(json['vendorBenefitPlan']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetVendorBenefitPlanByIdData otherTyped = other as GetVendorBenefitPlanByIdData; + return vendorBenefitPlan == otherTyped.vendorBenefitPlan; + + } + @override + int get hashCode => vendorBenefitPlan.hashCode; + + + Map toJson() { + Map json = {}; + if (vendorBenefitPlan != null) { + json['vendorBenefitPlan'] = vendorBenefitPlan!.toJson(); + } + return json; + } + + GetVendorBenefitPlanByIdData({ + this.vendorBenefitPlan, + }); +} + +@immutable +class GetVendorBenefitPlanByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetVendorBenefitPlanByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetVendorBenefitPlanByIdVariables otherTyped = other as GetVendorBenefitPlanByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetVendorBenefitPlanByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_vendor_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_vendor_by_id.dart new file mode 100644 index 00000000..2838999b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_vendor_by_id.dart @@ -0,0 +1,285 @@ +part of 'generated.dart'; + +class GetVendorByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetVendorByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetVendorByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetVendorByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetVendorByIdVariables vars= GetVendorByIdVariables(id: id,); + return _dataConnect.query("getVendorById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetVendorByIdVendor { + final String id; + final String userId; + final String companyName; + final String? email; + final String? phone; + final String? photoUrl; + final String? address; + final String? billingAddress; + final String? timezone; + final String? legalName; + final String? doingBusinessAs; + final String? region; + final String? state; + final String? city; + final String? serviceSpecialty; + final EnumValue? approvalStatus; + final bool? isActive; + final double? markup; + final double? fee; + final double? csat; + final EnumValue? tier; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetVendorByIdVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + userId = nativeFromJson(json['userId']), + companyName = nativeFromJson(json['companyName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + billingAddress = json['billingAddress'] == null ? null : nativeFromJson(json['billingAddress']), + timezone = json['timezone'] == null ? null : nativeFromJson(json['timezone']), + legalName = json['legalName'] == null ? null : nativeFromJson(json['legalName']), + doingBusinessAs = json['doingBusinessAs'] == null ? null : nativeFromJson(json['doingBusinessAs']), + region = json['region'] == null ? null : nativeFromJson(json['region']), + state = json['state'] == null ? null : nativeFromJson(json['state']), + city = json['city'] == null ? null : nativeFromJson(json['city']), + serviceSpecialty = json['serviceSpecialty'] == null ? null : nativeFromJson(json['serviceSpecialty']), + approvalStatus = json['approvalStatus'] == null ? null : approvalStatusDeserializer(json['approvalStatus']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']), + markup = json['markup'] == null ? null : nativeFromJson(json['markup']), + fee = json['fee'] == null ? null : nativeFromJson(json['fee']), + csat = json['csat'] == null ? null : nativeFromJson(json['csat']), + tier = json['tier'] == null ? null : vendorTierDeserializer(json['tier']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetVendorByIdVendor otherTyped = other as GetVendorByIdVendor; + return id == otherTyped.id && + userId == otherTyped.userId && + companyName == otherTyped.companyName && + email == otherTyped.email && + phone == otherTyped.phone && + photoUrl == otherTyped.photoUrl && + address == otherTyped.address && + billingAddress == otherTyped.billingAddress && + timezone == otherTyped.timezone && + legalName == otherTyped.legalName && + doingBusinessAs == otherTyped.doingBusinessAs && + region == otherTyped.region && + state == otherTyped.state && + city == otherTyped.city && + serviceSpecialty == otherTyped.serviceSpecialty && + approvalStatus == otherTyped.approvalStatus && + isActive == otherTyped.isActive && + markup == otherTyped.markup && + fee == otherTyped.fee && + csat == otherTyped.csat && + tier == otherTyped.tier && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, companyName.hashCode, email.hashCode, phone.hashCode, photoUrl.hashCode, address.hashCode, billingAddress.hashCode, timezone.hashCode, legalName.hashCode, doingBusinessAs.hashCode, region.hashCode, state.hashCode, city.hashCode, serviceSpecialty.hashCode, approvalStatus.hashCode, isActive.hashCode, markup.hashCode, fee.hashCode, csat.hashCode, tier.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['userId'] = nativeToJson(userId); + json['companyName'] = nativeToJson(companyName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + if (address != null) { + json['address'] = nativeToJson(address); + } + if (billingAddress != null) { + json['billingAddress'] = nativeToJson(billingAddress); + } + if (timezone != null) { + json['timezone'] = nativeToJson(timezone); + } + if (legalName != null) { + json['legalName'] = nativeToJson(legalName); + } + if (doingBusinessAs != null) { + json['doingBusinessAs'] = nativeToJson(doingBusinessAs); + } + if (region != null) { + json['region'] = nativeToJson(region); + } + if (state != null) { + json['state'] = nativeToJson(state); + } + if (city != null) { + json['city'] = nativeToJson(city); + } + if (serviceSpecialty != null) { + json['serviceSpecialty'] = nativeToJson(serviceSpecialty); + } + if (approvalStatus != null) { + json['approvalStatus'] = + approvalStatusSerializer(approvalStatus!) + ; + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + if (markup != null) { + json['markup'] = nativeToJson(markup); + } + if (fee != null) { + json['fee'] = nativeToJson(fee); + } + if (csat != null) { + json['csat'] = nativeToJson(csat); + } + if (tier != null) { + json['tier'] = + vendorTierSerializer(tier!) + ; + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetVendorByIdVendor({ + required this.id, + required this.userId, + required this.companyName, + this.email, + this.phone, + this.photoUrl, + this.address, + this.billingAddress, + this.timezone, + this.legalName, + this.doingBusinessAs, + this.region, + this.state, + this.city, + this.serviceSpecialty, + this.approvalStatus, + this.isActive, + this.markup, + this.fee, + this.csat, + this.tier, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetVendorByIdData { + final GetVendorByIdVendor? vendor; + GetVendorByIdData.fromJson(dynamic json): + + vendor = json['vendor'] == null ? null : GetVendorByIdVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetVendorByIdData otherTyped = other as GetVendorByIdData; + return vendor == otherTyped.vendor; + + } + @override + int get hashCode => vendor.hashCode; + + + Map toJson() { + Map json = {}; + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + GetVendorByIdData({ + this.vendor, + }); +} + +@immutable +class GetVendorByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetVendorByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetVendorByIdVariables otherTyped = other as GetVendorByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetVendorByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_vendor_by_user_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_vendor_by_user_id.dart new file mode 100644 index 00000000..429a46a8 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_vendor_by_user_id.dart @@ -0,0 +1,285 @@ +part of 'generated.dart'; + +class GetVendorByUserIdVariablesBuilder { + String userId; + + final FirebaseDataConnect _dataConnect; + GetVendorByUserIdVariablesBuilder(this._dataConnect, {required this.userId,}); + Deserializer dataDeserializer = (dynamic json) => GetVendorByUserIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetVendorByUserIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetVendorByUserIdVariables vars= GetVendorByUserIdVariables(userId: userId,); + return _dataConnect.query("getVendorByUserId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetVendorByUserIdVendors { + final String id; + final String userId; + final String companyName; + final String? email; + final String? phone; + final String? photoUrl; + final String? address; + final String? billingAddress; + final String? timezone; + final String? legalName; + final String? doingBusinessAs; + final String? region; + final String? state; + final String? city; + final String? serviceSpecialty; + final EnumValue? approvalStatus; + final bool? isActive; + final double? markup; + final double? fee; + final double? csat; + final EnumValue? tier; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + GetVendorByUserIdVendors.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + userId = nativeFromJson(json['userId']), + companyName = nativeFromJson(json['companyName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + billingAddress = json['billingAddress'] == null ? null : nativeFromJson(json['billingAddress']), + timezone = json['timezone'] == null ? null : nativeFromJson(json['timezone']), + legalName = json['legalName'] == null ? null : nativeFromJson(json['legalName']), + doingBusinessAs = json['doingBusinessAs'] == null ? null : nativeFromJson(json['doingBusinessAs']), + region = json['region'] == null ? null : nativeFromJson(json['region']), + state = json['state'] == null ? null : nativeFromJson(json['state']), + city = json['city'] == null ? null : nativeFromJson(json['city']), + serviceSpecialty = json['serviceSpecialty'] == null ? null : nativeFromJson(json['serviceSpecialty']), + approvalStatus = json['approvalStatus'] == null ? null : approvalStatusDeserializer(json['approvalStatus']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']), + markup = json['markup'] == null ? null : nativeFromJson(json['markup']), + fee = json['fee'] == null ? null : nativeFromJson(json['fee']), + csat = json['csat'] == null ? null : nativeFromJson(json['csat']), + tier = json['tier'] == null ? null : vendorTierDeserializer(json['tier']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetVendorByUserIdVendors otherTyped = other as GetVendorByUserIdVendors; + return id == otherTyped.id && + userId == otherTyped.userId && + companyName == otherTyped.companyName && + email == otherTyped.email && + phone == otherTyped.phone && + photoUrl == otherTyped.photoUrl && + address == otherTyped.address && + billingAddress == otherTyped.billingAddress && + timezone == otherTyped.timezone && + legalName == otherTyped.legalName && + doingBusinessAs == otherTyped.doingBusinessAs && + region == otherTyped.region && + state == otherTyped.state && + city == otherTyped.city && + serviceSpecialty == otherTyped.serviceSpecialty && + approvalStatus == otherTyped.approvalStatus && + isActive == otherTyped.isActive && + markup == otherTyped.markup && + fee == otherTyped.fee && + csat == otherTyped.csat && + tier == otherTyped.tier && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, companyName.hashCode, email.hashCode, phone.hashCode, photoUrl.hashCode, address.hashCode, billingAddress.hashCode, timezone.hashCode, legalName.hashCode, doingBusinessAs.hashCode, region.hashCode, state.hashCode, city.hashCode, serviceSpecialty.hashCode, approvalStatus.hashCode, isActive.hashCode, markup.hashCode, fee.hashCode, csat.hashCode, tier.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['userId'] = nativeToJson(userId); + json['companyName'] = nativeToJson(companyName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + if (address != null) { + json['address'] = nativeToJson(address); + } + if (billingAddress != null) { + json['billingAddress'] = nativeToJson(billingAddress); + } + if (timezone != null) { + json['timezone'] = nativeToJson(timezone); + } + if (legalName != null) { + json['legalName'] = nativeToJson(legalName); + } + if (doingBusinessAs != null) { + json['doingBusinessAs'] = nativeToJson(doingBusinessAs); + } + if (region != null) { + json['region'] = nativeToJson(region); + } + if (state != null) { + json['state'] = nativeToJson(state); + } + if (city != null) { + json['city'] = nativeToJson(city); + } + if (serviceSpecialty != null) { + json['serviceSpecialty'] = nativeToJson(serviceSpecialty); + } + if (approvalStatus != null) { + json['approvalStatus'] = + approvalStatusSerializer(approvalStatus!) + ; + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + if (markup != null) { + json['markup'] = nativeToJson(markup); + } + if (fee != null) { + json['fee'] = nativeToJson(fee); + } + if (csat != null) { + json['csat'] = nativeToJson(csat); + } + if (tier != null) { + json['tier'] = + vendorTierSerializer(tier!) + ; + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + GetVendorByUserIdVendors({ + required this.id, + required this.userId, + required this.companyName, + this.email, + this.phone, + this.photoUrl, + this.address, + this.billingAddress, + this.timezone, + this.legalName, + this.doingBusinessAs, + this.region, + this.state, + this.city, + this.serviceSpecialty, + this.approvalStatus, + this.isActive, + this.markup, + this.fee, + this.csat, + this.tier, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class GetVendorByUserIdData { + final List vendors; + GetVendorByUserIdData.fromJson(dynamic json): + + vendors = (json['vendors'] as List) + .map((e) => GetVendorByUserIdVendors.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetVendorByUserIdData otherTyped = other as GetVendorByUserIdData; + return vendors == otherTyped.vendors; + + } + @override + int get hashCode => vendors.hashCode; + + + Map toJson() { + Map json = {}; + json['vendors'] = vendors.map((e) => e.toJson()).toList(); + return json; + } + + GetVendorByUserIdData({ + required this.vendors, + }); +} + +@immutable +class GetVendorByUserIdVariables { + final String userId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetVendorByUserIdVariables.fromJson(Map json): + + userId = nativeFromJson(json['userId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetVendorByUserIdVariables otherTyped = other as GetVendorByUserIdVariables; + return userId == otherTyped.userId; + + } + @override + int get hashCode => userId.hashCode; + + + Map toJson() { + Map json = {}; + json['userId'] = nativeToJson(userId); + return json; + } + + GetVendorByUserIdVariables({ + required this.userId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_vendor_rate_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_vendor_rate_by_id.dart new file mode 100644 index 00000000..e436ab02 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_vendor_rate_by_id.dart @@ -0,0 +1,240 @@ +part of 'generated.dart'; + +class GetVendorRateByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetVendorRateByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetVendorRateByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetVendorRateByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetVendorRateByIdVariables vars= GetVendorRateByIdVariables(id: id,); + return _dataConnect.query("getVendorRateById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetVendorRateByIdVendorRate { + final String id; + final String vendorId; + final String? roleName; + final EnumValue? category; + final double? clientRate; + final double? employeeWage; + final double? markupPercentage; + final double? vendorFeePercentage; + final bool? isActive; + final String? notes; + final Timestamp? createdAt; + final GetVendorRateByIdVendorRateVendor vendor; + GetVendorRateByIdVendorRate.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + roleName = json['roleName'] == null ? null : nativeFromJson(json['roleName']), + category = json['category'] == null ? null : categoryTypeDeserializer(json['category']), + clientRate = json['clientRate'] == null ? null : nativeFromJson(json['clientRate']), + employeeWage = json['employeeWage'] == null ? null : nativeFromJson(json['employeeWage']), + markupPercentage = json['markupPercentage'] == null ? null : nativeFromJson(json['markupPercentage']), + vendorFeePercentage = json['vendorFeePercentage'] == null ? null : nativeFromJson(json['vendorFeePercentage']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + vendor = GetVendorRateByIdVendorRateVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetVendorRateByIdVendorRate otherTyped = other as GetVendorRateByIdVendorRate; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + roleName == otherTyped.roleName && + category == otherTyped.category && + clientRate == otherTyped.clientRate && + employeeWage == otherTyped.employeeWage && + markupPercentage == otherTyped.markupPercentage && + vendorFeePercentage == otherTyped.vendorFeePercentage && + isActive == otherTyped.isActive && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, roleName.hashCode, category.hashCode, clientRate.hashCode, employeeWage.hashCode, markupPercentage.hashCode, vendorFeePercentage.hashCode, isActive.hashCode, notes.hashCode, createdAt.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + if (roleName != null) { + json['roleName'] = nativeToJson(roleName); + } + if (category != null) { + json['category'] = + categoryTypeSerializer(category!) + ; + } + if (clientRate != null) { + json['clientRate'] = nativeToJson(clientRate); + } + if (employeeWage != null) { + json['employeeWage'] = nativeToJson(employeeWage); + } + if (markupPercentage != null) { + json['markupPercentage'] = nativeToJson(markupPercentage); + } + if (vendorFeePercentage != null) { + json['vendorFeePercentage'] = nativeToJson(vendorFeePercentage); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['vendor'] = vendor.toJson(); + return json; + } + + GetVendorRateByIdVendorRate({ + required this.id, + required this.vendorId, + this.roleName, + this.category, + this.clientRate, + this.employeeWage, + this.markupPercentage, + this.vendorFeePercentage, + this.isActive, + this.notes, + this.createdAt, + required this.vendor, + }); +} + +@immutable +class GetVendorRateByIdVendorRateVendor { + final String companyName; + final String? region; + GetVendorRateByIdVendorRateVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']), + region = json['region'] == null ? null : nativeFromJson(json['region']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetVendorRateByIdVendorRateVendor otherTyped = other as GetVendorRateByIdVendorRateVendor; + return companyName == otherTyped.companyName && + region == otherTyped.region; + + } + @override + int get hashCode => Object.hashAll([companyName.hashCode, region.hashCode]); + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + if (region != null) { + json['region'] = nativeToJson(region); + } + return json; + } + + GetVendorRateByIdVendorRateVendor({ + required this.companyName, + this.region, + }); +} + +@immutable +class GetVendorRateByIdData { + final GetVendorRateByIdVendorRate? vendorRate; + GetVendorRateByIdData.fromJson(dynamic json): + + vendorRate = json['vendorRate'] == null ? null : GetVendorRateByIdVendorRate.fromJson(json['vendorRate']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetVendorRateByIdData otherTyped = other as GetVendorRateByIdData; + return vendorRate == otherTyped.vendorRate; + + } + @override + int get hashCode => vendorRate.hashCode; + + + Map toJson() { + Map json = {}; + if (vendorRate != null) { + json['vendorRate'] = vendorRate!.toJson(); + } + return json; + } + + GetVendorRateByIdData({ + this.vendorRate, + }); +} + +@immutable +class GetVendorRateByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetVendorRateByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetVendorRateByIdVariables otherTyped = other as GetVendorRateByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetVendorRateByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_workforce_by_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_workforce_by_id.dart new file mode 100644 index 00000000..35a8862f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_workforce_by_id.dart @@ -0,0 +1,259 @@ +part of 'generated.dart'; + +class GetWorkforceByIdVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + GetWorkforceByIdVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => GetWorkforceByIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetWorkforceByIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetWorkforceByIdVariables vars= GetWorkforceByIdVariables(id: id,); + return _dataConnect.query("getWorkforceById", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetWorkforceByIdWorkforce { + final String id; + final String vendorId; + final String staffId; + final String workforceNumber; + final EnumValue? employmentType; + final EnumValue? status; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final GetWorkforceByIdWorkforceStaff staff; + final GetWorkforceByIdWorkforceVendor vendor; + GetWorkforceByIdWorkforce.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + staffId = nativeFromJson(json['staffId']), + workforceNumber = nativeFromJson(json['workforceNumber']), + employmentType = json['employmentType'] == null ? null : workforceEmploymentTypeDeserializer(json['employmentType']), + status = json['status'] == null ? null : workforceStatusDeserializer(json['status']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + staff = GetWorkforceByIdWorkforceStaff.fromJson(json['staff']), + vendor = GetWorkforceByIdWorkforceVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetWorkforceByIdWorkforce otherTyped = other as GetWorkforceByIdWorkforce; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + staffId == otherTyped.staffId && + workforceNumber == otherTyped.workforceNumber && + employmentType == otherTyped.employmentType && + status == otherTyped.status && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + staff == otherTyped.staff && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, staffId.hashCode, workforceNumber.hashCode, employmentType.hashCode, status.hashCode, createdAt.hashCode, updatedAt.hashCode, staff.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + json['staffId'] = nativeToJson(staffId); + json['workforceNumber'] = nativeToJson(workforceNumber); + if (employmentType != null) { + json['employmentType'] = + workforceEmploymentTypeSerializer(employmentType!) + ; + } + if (status != null) { + json['status'] = + workforceStatusSerializer(status!) + ; + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + json['staff'] = staff.toJson(); + json['vendor'] = vendor.toJson(); + return json; + } + + GetWorkforceByIdWorkforce({ + required this.id, + required this.vendorId, + required this.staffId, + required this.workforceNumber, + this.employmentType, + this.status, + this.createdAt, + this.updatedAt, + required this.staff, + required this.vendor, + }); +} + +@immutable +class GetWorkforceByIdWorkforceStaff { + final String id; + final String fullName; + GetWorkforceByIdWorkforceStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetWorkforceByIdWorkforceStaff otherTyped = other as GetWorkforceByIdWorkforceStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + GetWorkforceByIdWorkforceStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class GetWorkforceByIdWorkforceVendor { + final String id; + final String companyName; + GetWorkforceByIdWorkforceVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetWorkforceByIdWorkforceVendor otherTyped = other as GetWorkforceByIdWorkforceVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetWorkforceByIdWorkforceVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetWorkforceByIdData { + final GetWorkforceByIdWorkforce? workforce; + GetWorkforceByIdData.fromJson(dynamic json): + + workforce = json['workforce'] == null ? null : GetWorkforceByIdWorkforce.fromJson(json['workforce']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetWorkforceByIdData otherTyped = other as GetWorkforceByIdData; + return workforce == otherTyped.workforce; + + } + @override + int get hashCode => workforce.hashCode; + + + Map toJson() { + Map json = {}; + if (workforce != null) { + json['workforce'] = workforce!.toJson(); + } + return json; + } + + GetWorkforceByIdData({ + this.workforce, + }); +} + +@immutable +class GetWorkforceByIdVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetWorkforceByIdVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetWorkforceByIdVariables otherTyped = other as GetWorkforceByIdVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + GetWorkforceByIdVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_workforce_by_vendor_and_number.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_workforce_by_vendor_and_number.dart new file mode 100644 index 00000000..1f4ef4a0 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_workforce_by_vendor_and_number.dart @@ -0,0 +1,149 @@ +part of 'generated.dart'; + +class GetWorkforceByVendorAndNumberVariablesBuilder { + String vendorId; + String workforceNumber; + + final FirebaseDataConnect _dataConnect; + GetWorkforceByVendorAndNumberVariablesBuilder(this._dataConnect, {required this.vendorId,required this.workforceNumber,}); + Deserializer dataDeserializer = (dynamic json) => GetWorkforceByVendorAndNumberData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetWorkforceByVendorAndNumberVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetWorkforceByVendorAndNumberVariables vars= GetWorkforceByVendorAndNumberVariables(vendorId: vendorId,workforceNumber: workforceNumber,); + return _dataConnect.query("getWorkforceByVendorAndNumber", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetWorkforceByVendorAndNumberWorkforces { + final String id; + final String staffId; + final String workforceNumber; + final EnumValue? status; + GetWorkforceByVendorAndNumberWorkforces.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + workforceNumber = nativeFromJson(json['workforceNumber']), + status = json['status'] == null ? null : workforceStatusDeserializer(json['status']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetWorkforceByVendorAndNumberWorkforces otherTyped = other as GetWorkforceByVendorAndNumberWorkforces; + return id == otherTyped.id && + staffId == otherTyped.staffId && + workforceNumber == otherTyped.workforceNumber && + status == otherTyped.status; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, workforceNumber.hashCode, status.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['workforceNumber'] = nativeToJson(workforceNumber); + if (status != null) { + json['status'] = + workforceStatusSerializer(status!) + ; + } + return json; + } + + GetWorkforceByVendorAndNumberWorkforces({ + required this.id, + required this.staffId, + required this.workforceNumber, + this.status, + }); +} + +@immutable +class GetWorkforceByVendorAndNumberData { + final List workforces; + GetWorkforceByVendorAndNumberData.fromJson(dynamic json): + + workforces = (json['workforces'] as List) + .map((e) => GetWorkforceByVendorAndNumberWorkforces.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetWorkforceByVendorAndNumberData otherTyped = other as GetWorkforceByVendorAndNumberData; + return workforces == otherTyped.workforces; + + } + @override + int get hashCode => workforces.hashCode; + + + Map toJson() { + Map json = {}; + json['workforces'] = workforces.map((e) => e.toJson()).toList(); + return json; + } + + GetWorkforceByVendorAndNumberData({ + required this.workforces, + }); +} + +@immutable +class GetWorkforceByVendorAndNumberVariables { + final String vendorId; + final String workforceNumber; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetWorkforceByVendorAndNumberVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']), + workforceNumber = nativeFromJson(json['workforceNumber']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetWorkforceByVendorAndNumberVariables otherTyped = other as GetWorkforceByVendorAndNumberVariables; + return vendorId == otherTyped.vendorId && + workforceNumber == otherTyped.workforceNumber; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, workforceNumber.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + json['workforceNumber'] = nativeToJson(workforceNumber); + return json; + } + + GetWorkforceByVendorAndNumberVariables({ + required this.vendorId, + required this.workforceNumber, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_workforce_by_vendor_and_staff.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_workforce_by_vendor_and_staff.dart new file mode 100644 index 00000000..6505314b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/get_workforce_by_vendor_and_staff.dart @@ -0,0 +1,265 @@ +part of 'generated.dart'; + +class GetWorkforceByVendorAndStaffVariablesBuilder { + String vendorId; + String staffId; + + final FirebaseDataConnect _dataConnect; + GetWorkforceByVendorAndStaffVariablesBuilder(this._dataConnect, {required this.vendorId,required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => GetWorkforceByVendorAndStaffData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (GetWorkforceByVendorAndStaffVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + GetWorkforceByVendorAndStaffVariables vars= GetWorkforceByVendorAndStaffVariables(vendorId: vendorId,staffId: staffId,); + return _dataConnect.query("getWorkforceByVendorAndStaff", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class GetWorkforceByVendorAndStaffWorkforces { + final String id; + final String vendorId; + final String staffId; + final String workforceNumber; + final EnumValue? employmentType; + final EnumValue? status; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final GetWorkforceByVendorAndStaffWorkforcesStaff staff; + final GetWorkforceByVendorAndStaffWorkforcesVendor vendor; + GetWorkforceByVendorAndStaffWorkforces.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + staffId = nativeFromJson(json['staffId']), + workforceNumber = nativeFromJson(json['workforceNumber']), + employmentType = json['employmentType'] == null ? null : workforceEmploymentTypeDeserializer(json['employmentType']), + status = json['status'] == null ? null : workforceStatusDeserializer(json['status']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + staff = GetWorkforceByVendorAndStaffWorkforcesStaff.fromJson(json['staff']), + vendor = GetWorkforceByVendorAndStaffWorkforcesVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetWorkforceByVendorAndStaffWorkforces otherTyped = other as GetWorkforceByVendorAndStaffWorkforces; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + staffId == otherTyped.staffId && + workforceNumber == otherTyped.workforceNumber && + employmentType == otherTyped.employmentType && + status == otherTyped.status && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + staff == otherTyped.staff && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, staffId.hashCode, workforceNumber.hashCode, employmentType.hashCode, status.hashCode, createdAt.hashCode, updatedAt.hashCode, staff.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + json['staffId'] = nativeToJson(staffId); + json['workforceNumber'] = nativeToJson(workforceNumber); + if (employmentType != null) { + json['employmentType'] = + workforceEmploymentTypeSerializer(employmentType!) + ; + } + if (status != null) { + json['status'] = + workforceStatusSerializer(status!) + ; + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + json['staff'] = staff.toJson(); + json['vendor'] = vendor.toJson(); + return json; + } + + GetWorkforceByVendorAndStaffWorkforces({ + required this.id, + required this.vendorId, + required this.staffId, + required this.workforceNumber, + this.employmentType, + this.status, + this.createdAt, + this.updatedAt, + required this.staff, + required this.vendor, + }); +} + +@immutable +class GetWorkforceByVendorAndStaffWorkforcesStaff { + final String id; + final String fullName; + GetWorkforceByVendorAndStaffWorkforcesStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetWorkforceByVendorAndStaffWorkforcesStaff otherTyped = other as GetWorkforceByVendorAndStaffWorkforcesStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + GetWorkforceByVendorAndStaffWorkforcesStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class GetWorkforceByVendorAndStaffWorkforcesVendor { + final String id; + final String companyName; + GetWorkforceByVendorAndStaffWorkforcesVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetWorkforceByVendorAndStaffWorkforcesVendor otherTyped = other as GetWorkforceByVendorAndStaffWorkforcesVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + GetWorkforceByVendorAndStaffWorkforcesVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class GetWorkforceByVendorAndStaffData { + final List workforces; + GetWorkforceByVendorAndStaffData.fromJson(dynamic json): + + workforces = (json['workforces'] as List) + .map((e) => GetWorkforceByVendorAndStaffWorkforces.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetWorkforceByVendorAndStaffData otherTyped = other as GetWorkforceByVendorAndStaffData; + return workforces == otherTyped.workforces; + + } + @override + int get hashCode => workforces.hashCode; + + + Map toJson() { + Map json = {}; + json['workforces'] = workforces.map((e) => e.toJson()).toList(); + return json; + } + + GetWorkforceByVendorAndStaffData({ + required this.workforces, + }); +} + +@immutable +class GetWorkforceByVendorAndStaffVariables { + final String vendorId; + final String staffId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + GetWorkforceByVendorAndStaffVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']), + staffId = nativeFromJson(json['staffId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final GetWorkforceByVendorAndStaffVariables otherTyped = other as GetWorkforceByVendorAndStaffVariables; + return vendorId == otherTyped.vendorId && + staffId == otherTyped.staffId; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, staffId.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + json['staffId'] = nativeToJson(staffId); + return json; + } + + GetWorkforceByVendorAndStaffVariables({ + required this.vendorId, + required this.staffId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/increment_unread_for_user.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/increment_unread_for_user.dart new file mode 100644 index 00000000..559f4fb9 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/increment_unread_for_user.dart @@ -0,0 +1,141 @@ +part of 'generated.dart'; + +class IncrementUnreadForUserVariablesBuilder { + String conversationId; + String userId; + int unreadCount; + + final FirebaseDataConnect _dataConnect; + IncrementUnreadForUserVariablesBuilder(this._dataConnect, {required this.conversationId,required this.userId,required this.unreadCount,}); + Deserializer dataDeserializer = (dynamic json) => IncrementUnreadForUserData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (IncrementUnreadForUserVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + IncrementUnreadForUserVariables vars= IncrementUnreadForUserVariables(conversationId: conversationId,userId: userId,unreadCount: unreadCount,); + return _dataConnect.mutation("incrementUnreadForUser", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class IncrementUnreadForUserUserConversationUpdate { + final String conversationId; + final String userId; + IncrementUnreadForUserUserConversationUpdate.fromJson(dynamic json): + + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final IncrementUnreadForUserUserConversationUpdate otherTyped = other as IncrementUnreadForUserUserConversationUpdate; + return conversationId == otherTyped.conversationId && + userId == otherTyped.userId; + + } + @override + int get hashCode => Object.hashAll([conversationId.hashCode, userId.hashCode]); + + + Map toJson() { + Map json = {}; + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + return json; + } + + IncrementUnreadForUserUserConversationUpdate({ + required this.conversationId, + required this.userId, + }); +} + +@immutable +class IncrementUnreadForUserData { + final IncrementUnreadForUserUserConversationUpdate? userConversation_update; + IncrementUnreadForUserData.fromJson(dynamic json): + + userConversation_update = json['userConversation_update'] == null ? null : IncrementUnreadForUserUserConversationUpdate.fromJson(json['userConversation_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final IncrementUnreadForUserData otherTyped = other as IncrementUnreadForUserData; + return userConversation_update == otherTyped.userConversation_update; + + } + @override + int get hashCode => userConversation_update.hashCode; + + + Map toJson() { + Map json = {}; + if (userConversation_update != null) { + json['userConversation_update'] = userConversation_update!.toJson(); + } + return json; + } + + IncrementUnreadForUserData({ + this.userConversation_update, + }); +} + +@immutable +class IncrementUnreadForUserVariables { + final String conversationId; + final String userId; + final int unreadCount; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + IncrementUnreadForUserVariables.fromJson(Map json): + + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']), + unreadCount = nativeFromJson(json['unreadCount']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final IncrementUnreadForUserVariables otherTyped = other as IncrementUnreadForUserVariables; + return conversationId == otherTyped.conversationId && + userId == otherTyped.userId && + unreadCount == otherTyped.unreadCount; + + } + @override + int get hashCode => Object.hashAll([conversationId.hashCode, userId.hashCode, unreadCount.hashCode]); + + + Map toJson() { + Map json = {}; + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + json['unreadCount'] = nativeToJson(unreadCount); + return json; + } + + IncrementUnreadForUserVariables({ + required this.conversationId, + required this.userId, + required this.unreadCount, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_accepted_applications_by_business_for_day.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_accepted_applications_by_business_for_day.dart new file mode 100644 index 00000000..a6b3ae54 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_accepted_applications_by_business_for_day.dart @@ -0,0 +1,267 @@ +part of 'generated.dart'; + +class ListAcceptedApplicationsByBusinessForDayVariablesBuilder { + String businessId; + Timestamp dayStart; + Timestamp dayEnd; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListAcceptedApplicationsByBusinessForDayVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListAcceptedApplicationsByBusinessForDayVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListAcceptedApplicationsByBusinessForDayVariablesBuilder(this._dataConnect, {required this.businessId,required this.dayStart,required this.dayEnd,}); + Deserializer dataDeserializer = (dynamic json) => ListAcceptedApplicationsByBusinessForDayData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListAcceptedApplicationsByBusinessForDayVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListAcceptedApplicationsByBusinessForDayVariables vars= ListAcceptedApplicationsByBusinessForDayVariables(businessId: businessId,dayStart: dayStart,dayEnd: dayEnd,offset: _offset,limit: _limit,); + return _dataConnect.query("listAcceptedApplicationsByBusinessForDay", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListAcceptedApplicationsByBusinessForDayApplications { + final String id; + final String shiftId; + final String roleId; + final Timestamp? checkInTime; + final Timestamp? checkOutTime; + final Timestamp? appliedAt; + final ListAcceptedApplicationsByBusinessForDayApplicationsStaff staff; + ListAcceptedApplicationsByBusinessForDayApplications.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']), + checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']), + checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']), + appliedAt = json['appliedAt'] == null ? null : Timestamp.fromJson(json['appliedAt']), + staff = ListAcceptedApplicationsByBusinessForDayApplicationsStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAcceptedApplicationsByBusinessForDayApplications otherTyped = other as ListAcceptedApplicationsByBusinessForDayApplications; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId && + checkInTime == otherTyped.checkInTime && + checkOutTime == otherTyped.checkOutTime && + appliedAt == otherTyped.appliedAt && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, roleId.hashCode, checkInTime.hashCode, checkOutTime.hashCode, appliedAt.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + if (checkInTime != null) { + json['checkInTime'] = checkInTime!.toJson(); + } + if (checkOutTime != null) { + json['checkOutTime'] = checkOutTime!.toJson(); + } + if (appliedAt != null) { + json['appliedAt'] = appliedAt!.toJson(); + } + json['staff'] = staff.toJson(); + return json; + } + + ListAcceptedApplicationsByBusinessForDayApplications({ + required this.id, + required this.shiftId, + required this.roleId, + this.checkInTime, + this.checkOutTime, + this.appliedAt, + required this.staff, + }); +} + +@immutable +class ListAcceptedApplicationsByBusinessForDayApplicationsStaff { + final String id; + final String fullName; + final String? email; + final String? phone; + final String? photoUrl; + ListAcceptedApplicationsByBusinessForDayApplicationsStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAcceptedApplicationsByBusinessForDayApplicationsStaff otherTyped = other as ListAcceptedApplicationsByBusinessForDayApplicationsStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName && + email == otherTyped.email && + phone == otherTyped.phone && + photoUrl == otherTyped.photoUrl; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, email.hashCode, phone.hashCode, photoUrl.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + return json; + } + + ListAcceptedApplicationsByBusinessForDayApplicationsStaff({ + required this.id, + required this.fullName, + this.email, + this.phone, + this.photoUrl, + }); +} + +@immutable +class ListAcceptedApplicationsByBusinessForDayData { + final List applications; + ListAcceptedApplicationsByBusinessForDayData.fromJson(dynamic json): + + applications = (json['applications'] as List) + .map((e) => ListAcceptedApplicationsByBusinessForDayApplications.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAcceptedApplicationsByBusinessForDayData otherTyped = other as ListAcceptedApplicationsByBusinessForDayData; + return applications == otherTyped.applications; + + } + @override + int get hashCode => applications.hashCode; + + + Map toJson() { + Map json = {}; + json['applications'] = applications.map((e) => e.toJson()).toList(); + return json; + } + + ListAcceptedApplicationsByBusinessForDayData({ + required this.applications, + }); +} + +@immutable +class ListAcceptedApplicationsByBusinessForDayVariables { + final String businessId; + final Timestamp dayStart; + final Timestamp dayEnd; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListAcceptedApplicationsByBusinessForDayVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']), + dayStart = Timestamp.fromJson(json['dayStart']), + dayEnd = Timestamp.fromJson(json['dayEnd']) { + + + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAcceptedApplicationsByBusinessForDayVariables otherTyped = other as ListAcceptedApplicationsByBusinessForDayVariables; + return businessId == otherTyped.businessId && + dayStart == otherTyped.dayStart && + dayEnd == otherTyped.dayEnd && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, dayStart.hashCode, dayEnd.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + json['dayStart'] = dayStart.toJson(); + json['dayEnd'] = dayEnd.toJson(); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListAcceptedApplicationsByBusinessForDayVariables({ + required this.businessId, + required this.dayStart, + required this.dayEnd, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_accepted_applications_by_shift_role_key.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_accepted_applications_by_shift_role_key.dart new file mode 100644 index 00000000..2c623882 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_accepted_applications_by_shift_role_key.dart @@ -0,0 +1,243 @@ +part of 'generated.dart'; + +class ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder { + String shiftId; + String roleId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListAcceptedApplicationsByShiftRoleKeyVariablesBuilder(this._dataConnect, {required this.shiftId,required this.roleId,}); + Deserializer dataDeserializer = (dynamic json) => ListAcceptedApplicationsByShiftRoleKeyData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListAcceptedApplicationsByShiftRoleKeyVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListAcceptedApplicationsByShiftRoleKeyVariables vars= ListAcceptedApplicationsByShiftRoleKeyVariables(shiftId: shiftId,roleId: roleId,offset: _offset,limit: _limit,); + return _dataConnect.query("listAcceptedApplicationsByShiftRoleKey", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListAcceptedApplicationsByShiftRoleKeyApplications { + final String id; + final Timestamp? checkInTime; + final Timestamp? checkOutTime; + final ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff staff; + ListAcceptedApplicationsByShiftRoleKeyApplications.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']), + checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']), + staff = ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAcceptedApplicationsByShiftRoleKeyApplications otherTyped = other as ListAcceptedApplicationsByShiftRoleKeyApplications; + return id == otherTyped.id && + checkInTime == otherTyped.checkInTime && + checkOutTime == otherTyped.checkOutTime && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, checkInTime.hashCode, checkOutTime.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (checkInTime != null) { + json['checkInTime'] = checkInTime!.toJson(); + } + if (checkOutTime != null) { + json['checkOutTime'] = checkOutTime!.toJson(); + } + json['staff'] = staff.toJson(); + return json; + } + + ListAcceptedApplicationsByShiftRoleKeyApplications({ + required this.id, + this.checkInTime, + this.checkOutTime, + required this.staff, + }); +} + +@immutable +class ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff { + final String id; + final String fullName; + final String? email; + final String? phone; + final String? photoUrl; + ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff otherTyped = other as ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName && + email == otherTyped.email && + phone == otherTyped.phone && + photoUrl == otherTyped.photoUrl; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, email.hashCode, phone.hashCode, photoUrl.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + return json; + } + + ListAcceptedApplicationsByShiftRoleKeyApplicationsStaff({ + required this.id, + required this.fullName, + this.email, + this.phone, + this.photoUrl, + }); +} + +@immutable +class ListAcceptedApplicationsByShiftRoleKeyData { + final List applications; + ListAcceptedApplicationsByShiftRoleKeyData.fromJson(dynamic json): + + applications = (json['applications'] as List) + .map((e) => ListAcceptedApplicationsByShiftRoleKeyApplications.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAcceptedApplicationsByShiftRoleKeyData otherTyped = other as ListAcceptedApplicationsByShiftRoleKeyData; + return applications == otherTyped.applications; + + } + @override + int get hashCode => applications.hashCode; + + + Map toJson() { + Map json = {}; + json['applications'] = applications.map((e) => e.toJson()).toList(); + return json; + } + + ListAcceptedApplicationsByShiftRoleKeyData({ + required this.applications, + }); +} + +@immutable +class ListAcceptedApplicationsByShiftRoleKeyVariables { + final String shiftId; + final String roleId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListAcceptedApplicationsByShiftRoleKeyVariables.fromJson(Map json): + + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']) { + + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAcceptedApplicationsByShiftRoleKeyVariables otherTyped = other as ListAcceptedApplicationsByShiftRoleKeyVariables; + return shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListAcceptedApplicationsByShiftRoleKeyVariables({ + required this.shiftId, + required this.roleId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_accounts.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_accounts.dart new file mode 100644 index 00000000..cb6aa7ce --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_accounts.dart @@ -0,0 +1,138 @@ +part of 'generated.dart'; + +class ListAccountsVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListAccountsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListAccountsData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listAccounts", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListAccountsAccounts { + final String id; + final String bank; + final EnumValue type; + final String last4; + final bool? isPrimary; + final String ownerId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + ListAccountsAccounts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + bank = nativeFromJson(json['bank']), + type = accountTypeDeserializer(json['type']), + last4 = nativeFromJson(json['last4']), + isPrimary = json['isPrimary'] == null ? null : nativeFromJson(json['isPrimary']), + ownerId = nativeFromJson(json['ownerId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAccountsAccounts otherTyped = other as ListAccountsAccounts; + return id == otherTyped.id && + bank == otherTyped.bank && + type == otherTyped.type && + last4 == otherTyped.last4 && + isPrimary == otherTyped.isPrimary && + ownerId == otherTyped.ownerId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode, ownerId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['bank'] = nativeToJson(bank); + json['type'] = + accountTypeSerializer(type) + ; + json['last4'] = nativeToJson(last4); + if (isPrimary != null) { + json['isPrimary'] = nativeToJson(isPrimary); + } + json['ownerId'] = nativeToJson(ownerId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + ListAccountsAccounts({ + required this.id, + required this.bank, + required this.type, + required this.last4, + this.isPrimary, + required this.ownerId, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class ListAccountsData { + final List accounts; + ListAccountsData.fromJson(dynamic json): + + accounts = (json['accounts'] as List) + .map((e) => ListAccountsAccounts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAccountsData otherTyped = other as ListAccountsData; + return accounts == otherTyped.accounts; + + } + @override + int get hashCode => accounts.hashCode; + + + Map toJson() { + Map json = {}; + json['accounts'] = accounts.map((e) => e.toJson()).toList(); + return json; + } + + ListAccountsData({ + required this.accounts, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_active_vendor_benefit_plans_by_vendor_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_active_vendor_benefit_plans_by_vendor_id.dart new file mode 100644 index 00000000..3497fae5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_active_vendor_benefit_plans_by_vendor_id.dart @@ -0,0 +1,255 @@ +part of 'generated.dart'; + +class ListActiveVendorBenefitPlansByVendorIdVariablesBuilder { + String vendorId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListActiveVendorBenefitPlansByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListActiveVendorBenefitPlansByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListActiveVendorBenefitPlansByVendorIdVariablesBuilder(this._dataConnect, {required this.vendorId,}); + Deserializer dataDeserializer = (dynamic json) => ListActiveVendorBenefitPlansByVendorIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListActiveVendorBenefitPlansByVendorIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListActiveVendorBenefitPlansByVendorIdVariables vars= ListActiveVendorBenefitPlansByVendorIdVariables(vendorId: vendorId,offset: _offset,limit: _limit,); + return _dataConnect.query("listActiveVendorBenefitPlansByVendorId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListActiveVendorBenefitPlansByVendorIdVendorBenefitPlans { + final String id; + final String vendorId; + final String title; + final String? description; + final String? requestLabel; + final int? total; + final bool? isActive; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListActiveVendorBenefitPlansByVendorIdVendorBenefitPlansVendor vendor; + ListActiveVendorBenefitPlansByVendorIdVendorBenefitPlans.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + title = nativeFromJson(json['title']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + requestLabel = json['requestLabel'] == null ? null : nativeFromJson(json['requestLabel']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + vendor = ListActiveVendorBenefitPlansByVendorIdVendorBenefitPlansVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListActiveVendorBenefitPlansByVendorIdVendorBenefitPlans otherTyped = other as ListActiveVendorBenefitPlansByVendorIdVendorBenefitPlans; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + title == otherTyped.title && + description == otherTyped.description && + requestLabel == otherTyped.requestLabel && + total == otherTyped.total && + isActive == otherTyped.isActive && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, title.hashCode, description.hashCode, requestLabel.hashCode, total.hashCode, isActive.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + json['title'] = nativeToJson(title); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (requestLabel != null) { + json['requestLabel'] = nativeToJson(requestLabel); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['vendor'] = vendor.toJson(); + return json; + } + + ListActiveVendorBenefitPlansByVendorIdVendorBenefitPlans({ + required this.id, + required this.vendorId, + required this.title, + this.description, + this.requestLabel, + this.total, + this.isActive, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.vendor, + }); +} + +@immutable +class ListActiveVendorBenefitPlansByVendorIdVendorBenefitPlansVendor { + final String companyName; + ListActiveVendorBenefitPlansByVendorIdVendorBenefitPlansVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListActiveVendorBenefitPlansByVendorIdVendorBenefitPlansVendor otherTyped = other as ListActiveVendorBenefitPlansByVendorIdVendorBenefitPlansVendor; + return companyName == otherTyped.companyName; + + } + @override + int get hashCode => companyName.hashCode; + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListActiveVendorBenefitPlansByVendorIdVendorBenefitPlansVendor({ + required this.companyName, + }); +} + +@immutable +class ListActiveVendorBenefitPlansByVendorIdData { + final List vendorBenefitPlans; + ListActiveVendorBenefitPlansByVendorIdData.fromJson(dynamic json): + + vendorBenefitPlans = (json['vendorBenefitPlans'] as List) + .map((e) => ListActiveVendorBenefitPlansByVendorIdVendorBenefitPlans.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListActiveVendorBenefitPlansByVendorIdData otherTyped = other as ListActiveVendorBenefitPlansByVendorIdData; + return vendorBenefitPlans == otherTyped.vendorBenefitPlans; + + } + @override + int get hashCode => vendorBenefitPlans.hashCode; + + + Map toJson() { + Map json = {}; + json['vendorBenefitPlans'] = vendorBenefitPlans.map((e) => e.toJson()).toList(); + return json; + } + + ListActiveVendorBenefitPlansByVendorIdData({ + required this.vendorBenefitPlans, + }); +} + +@immutable +class ListActiveVendorBenefitPlansByVendorIdVariables { + final String vendorId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListActiveVendorBenefitPlansByVendorIdVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListActiveVendorBenefitPlansByVendorIdVariables otherTyped = other as ListActiveVendorBenefitPlansByVendorIdVariables; + return vendorId == otherTyped.vendorId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListActiveVendorBenefitPlansByVendorIdVariables({ + required this.vendorId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_activity_logs.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_activity_logs.dart new file mode 100644 index 00000000..9d2feac5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_activity_logs.dart @@ -0,0 +1,242 @@ +part of 'generated.dart'; + +class ListActivityLogsVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListActivityLogsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListActivityLogsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListActivityLogsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListActivityLogsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListActivityLogsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListActivityLogsVariables vars= ListActivityLogsVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listActivityLogs", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListActivityLogsActivityLogs { + final String id; + final String userId; + final Timestamp date; + final String? hourStart; + final String? hourEnd; + final String? totalhours; + final EnumValue? iconType; + final String? iconColor; + final String title; + final String description; + final bool? isRead; + final EnumValue activityType; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + ListActivityLogsActivityLogs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + userId = nativeFromJson(json['userId']), + date = Timestamp.fromJson(json['date']), + hourStart = json['hourStart'] == null ? null : nativeFromJson(json['hourStart']), + hourEnd = json['hourEnd'] == null ? null : nativeFromJson(json['hourEnd']), + totalhours = json['totalhours'] == null ? null : nativeFromJson(json['totalhours']), + iconType = json['iconType'] == null ? null : activityIconTypeDeserializer(json['iconType']), + iconColor = json['iconColor'] == null ? null : nativeFromJson(json['iconColor']), + title = nativeFromJson(json['title']), + description = nativeFromJson(json['description']), + isRead = json['isRead'] == null ? null : nativeFromJson(json['isRead']), + activityType = activityTypeDeserializer(json['activityType']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListActivityLogsActivityLogs otherTyped = other as ListActivityLogsActivityLogs; + return id == otherTyped.id && + userId == otherTyped.userId && + date == otherTyped.date && + hourStart == otherTyped.hourStart && + hourEnd == otherTyped.hourEnd && + totalhours == otherTyped.totalhours && + iconType == otherTyped.iconType && + iconColor == otherTyped.iconColor && + title == otherTyped.title && + description == otherTyped.description && + isRead == otherTyped.isRead && + activityType == otherTyped.activityType && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, date.hashCode, hourStart.hashCode, hourEnd.hashCode, totalhours.hashCode, iconType.hashCode, iconColor.hashCode, title.hashCode, description.hashCode, isRead.hashCode, activityType.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['userId'] = nativeToJson(userId); + json['date'] = date.toJson(); + if (hourStart != null) { + json['hourStart'] = nativeToJson(hourStart); + } + if (hourEnd != null) { + json['hourEnd'] = nativeToJson(hourEnd); + } + if (totalhours != null) { + json['totalhours'] = nativeToJson(totalhours); + } + if (iconType != null) { + json['iconType'] = + activityIconTypeSerializer(iconType!) + ; + } + if (iconColor != null) { + json['iconColor'] = nativeToJson(iconColor); + } + json['title'] = nativeToJson(title); + json['description'] = nativeToJson(description); + if (isRead != null) { + json['isRead'] = nativeToJson(isRead); + } + json['activityType'] = + activityTypeSerializer(activityType) + ; + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + ListActivityLogsActivityLogs({ + required this.id, + required this.userId, + required this.date, + this.hourStart, + this.hourEnd, + this.totalhours, + this.iconType, + this.iconColor, + required this.title, + required this.description, + this.isRead, + required this.activityType, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class ListActivityLogsData { + final List activityLogs; + ListActivityLogsData.fromJson(dynamic json): + + activityLogs = (json['activityLogs'] as List) + .map((e) => ListActivityLogsActivityLogs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListActivityLogsData otherTyped = other as ListActivityLogsData; + return activityLogs == otherTyped.activityLogs; + + } + @override + int get hashCode => activityLogs.hashCode; + + + Map toJson() { + Map json = {}; + json['activityLogs'] = activityLogs.map((e) => e.toJson()).toList(); + return json; + } + + ListActivityLogsData({ + required this.activityLogs, + }); +} + +@immutable +class ListActivityLogsVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListActivityLogsVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListActivityLogsVariables otherTyped = other as ListActivityLogsVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListActivityLogsVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_activity_logs_by_user_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_activity_logs_by_user_id.dart new file mode 100644 index 00000000..4ef7eb46 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_activity_logs_by_user_id.dart @@ -0,0 +1,249 @@ +part of 'generated.dart'; + +class ListActivityLogsByUserIdVariablesBuilder { + String userId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListActivityLogsByUserIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListActivityLogsByUserIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListActivityLogsByUserIdVariablesBuilder(this._dataConnect, {required this.userId,}); + Deserializer dataDeserializer = (dynamic json) => ListActivityLogsByUserIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListActivityLogsByUserIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListActivityLogsByUserIdVariables vars= ListActivityLogsByUserIdVariables(userId: userId,offset: _offset,limit: _limit,); + return _dataConnect.query("listActivityLogsByUserId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListActivityLogsByUserIdActivityLogs { + final String id; + final String userId; + final Timestamp date; + final String? hourStart; + final String? hourEnd; + final String? totalhours; + final EnumValue? iconType; + final String? iconColor; + final String title; + final String description; + final bool? isRead; + final EnumValue activityType; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + ListActivityLogsByUserIdActivityLogs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + userId = nativeFromJson(json['userId']), + date = Timestamp.fromJson(json['date']), + hourStart = json['hourStart'] == null ? null : nativeFromJson(json['hourStart']), + hourEnd = json['hourEnd'] == null ? null : nativeFromJson(json['hourEnd']), + totalhours = json['totalhours'] == null ? null : nativeFromJson(json['totalhours']), + iconType = json['iconType'] == null ? null : activityIconTypeDeserializer(json['iconType']), + iconColor = json['iconColor'] == null ? null : nativeFromJson(json['iconColor']), + title = nativeFromJson(json['title']), + description = nativeFromJson(json['description']), + isRead = json['isRead'] == null ? null : nativeFromJson(json['isRead']), + activityType = activityTypeDeserializer(json['activityType']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListActivityLogsByUserIdActivityLogs otherTyped = other as ListActivityLogsByUserIdActivityLogs; + return id == otherTyped.id && + userId == otherTyped.userId && + date == otherTyped.date && + hourStart == otherTyped.hourStart && + hourEnd == otherTyped.hourEnd && + totalhours == otherTyped.totalhours && + iconType == otherTyped.iconType && + iconColor == otherTyped.iconColor && + title == otherTyped.title && + description == otherTyped.description && + isRead == otherTyped.isRead && + activityType == otherTyped.activityType && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, date.hashCode, hourStart.hashCode, hourEnd.hashCode, totalhours.hashCode, iconType.hashCode, iconColor.hashCode, title.hashCode, description.hashCode, isRead.hashCode, activityType.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['userId'] = nativeToJson(userId); + json['date'] = date.toJson(); + if (hourStart != null) { + json['hourStart'] = nativeToJson(hourStart); + } + if (hourEnd != null) { + json['hourEnd'] = nativeToJson(hourEnd); + } + if (totalhours != null) { + json['totalhours'] = nativeToJson(totalhours); + } + if (iconType != null) { + json['iconType'] = + activityIconTypeSerializer(iconType!) + ; + } + if (iconColor != null) { + json['iconColor'] = nativeToJson(iconColor); + } + json['title'] = nativeToJson(title); + json['description'] = nativeToJson(description); + if (isRead != null) { + json['isRead'] = nativeToJson(isRead); + } + json['activityType'] = + activityTypeSerializer(activityType) + ; + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + ListActivityLogsByUserIdActivityLogs({ + required this.id, + required this.userId, + required this.date, + this.hourStart, + this.hourEnd, + this.totalhours, + this.iconType, + this.iconColor, + required this.title, + required this.description, + this.isRead, + required this.activityType, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class ListActivityLogsByUserIdData { + final List activityLogs; + ListActivityLogsByUserIdData.fromJson(dynamic json): + + activityLogs = (json['activityLogs'] as List) + .map((e) => ListActivityLogsByUserIdActivityLogs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListActivityLogsByUserIdData otherTyped = other as ListActivityLogsByUserIdData; + return activityLogs == otherTyped.activityLogs; + + } + @override + int get hashCode => activityLogs.hashCode; + + + Map toJson() { + Map json = {}; + json['activityLogs'] = activityLogs.map((e) => e.toJson()).toList(); + return json; + } + + ListActivityLogsByUserIdData({ + required this.activityLogs, + }); +} + +@immutable +class ListActivityLogsByUserIdVariables { + final String userId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListActivityLogsByUserIdVariables.fromJson(Map json): + + userId = nativeFromJson(json['userId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListActivityLogsByUserIdVariables otherTyped = other as ListActivityLogsByUserIdVariables; + return userId == otherTyped.userId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([userId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['userId'] = nativeToJson(userId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListActivityLogsByUserIdVariables({ + required this.userId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications.dart new file mode 100644 index 00000000..2c86d4a5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications.dart @@ -0,0 +1,511 @@ +part of 'generated.dart'; + +class ListApplicationsVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListApplicationsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListApplicationsData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listApplications", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListApplicationsApplications { + final String id; + final String shiftId; + final String staffId; + final EnumValue status; + final Timestamp? appliedAt; + final Timestamp? checkInTime; + final Timestamp? checkOutTime; + final EnumValue origin; + final Timestamp? createdAt; + final ListApplicationsApplicationsShift shift; + final ListApplicationsApplicationsShiftRole shiftRole; + ListApplicationsApplications.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + staffId = nativeFromJson(json['staffId']), + status = applicationStatusDeserializer(json['status']), + appliedAt = json['appliedAt'] == null ? null : Timestamp.fromJson(json['appliedAt']), + checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']), + checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']), + origin = applicationOriginDeserializer(json['origin']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + shift = ListApplicationsApplicationsShift.fromJson(json['shift']), + shiftRole = ListApplicationsApplicationsShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsApplications otherTyped = other as ListApplicationsApplications; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + staffId == otherTyped.staffId && + status == otherTyped.status && + appliedAt == otherTyped.appliedAt && + checkInTime == otherTyped.checkInTime && + checkOutTime == otherTyped.checkOutTime && + origin == otherTyped.origin && + createdAt == otherTyped.createdAt && + shift == otherTyped.shift && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, staffId.hashCode, status.hashCode, appliedAt.hashCode, checkInTime.hashCode, checkOutTime.hashCode, origin.hashCode, createdAt.hashCode, shift.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['staffId'] = nativeToJson(staffId); + json['status'] = + applicationStatusSerializer(status) + ; + if (appliedAt != null) { + json['appliedAt'] = appliedAt!.toJson(); + } + if (checkInTime != null) { + json['checkInTime'] = checkInTime!.toJson(); + } + if (checkOutTime != null) { + json['checkOutTime'] = checkOutTime!.toJson(); + } + json['origin'] = + applicationOriginSerializer(origin) + ; + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['shift'] = shift.toJson(); + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + ListApplicationsApplications({ + required this.id, + required this.shiftId, + required this.staffId, + required this.status, + this.appliedAt, + this.checkInTime, + this.checkOutTime, + required this.origin, + this.createdAt, + required this.shift, + required this.shiftRole, + }); +} + +@immutable +class ListApplicationsApplicationsShift { + final String id; + final String title; + final Timestamp? date; + final Timestamp? startTime; + final Timestamp? endTime; + final String? location; + final EnumValue? status; + final ListApplicationsApplicationsShiftOrder order; + ListApplicationsApplicationsShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + order = ListApplicationsApplicationsShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsApplicationsShift otherTyped = other as ListApplicationsApplicationsShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + location == otherTyped.location && + status == otherTyped.status && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, location.hashCode, status.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + json['order'] = order.toJson(); + return json; + } + + ListApplicationsApplicationsShift({ + required this.id, + required this.title, + this.date, + this.startTime, + this.endTime, + this.location, + this.status, + required this.order, + }); +} + +@immutable +class ListApplicationsApplicationsShiftOrder { + final String id; + final String? eventName; + final String? location; + final ListApplicationsApplicationsShiftOrderBusiness business; + final ListApplicationsApplicationsShiftOrderVendor? vendor; + ListApplicationsApplicationsShiftOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + business = ListApplicationsApplicationsShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : ListApplicationsApplicationsShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsApplicationsShiftOrder otherTyped = other as ListApplicationsApplicationsShiftOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + location == otherTyped.location && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, location.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + ListApplicationsApplicationsShiftOrder({ + required this.id, + this.eventName, + this.location, + required this.business, + this.vendor, + }); +} + +@immutable +class ListApplicationsApplicationsShiftOrderBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + ListApplicationsApplicationsShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsApplicationsShiftOrderBusiness otherTyped = other as ListApplicationsApplicationsShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + ListApplicationsApplicationsShiftOrderBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class ListApplicationsApplicationsShiftOrderVendor { + final String id; + final String companyName; + ListApplicationsApplicationsShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsApplicationsShiftOrderVendor otherTyped = other as ListApplicationsApplicationsShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListApplicationsApplicationsShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListApplicationsApplicationsShiftRole { + final String id; + final String roleId; + final int count; + final int? assigned; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? totalValue; + final ListApplicationsApplicationsShiftRoleRole role; + ListApplicationsApplicationsShiftRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + roleId = nativeFromJson(json['roleId']), + count = nativeFromJson(json['count']), + assigned = json['assigned'] == null ? null : nativeFromJson(json['assigned']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = ListApplicationsApplicationsShiftRoleRole.fromJson(json['role']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsApplicationsShiftRole otherTyped = other as ListApplicationsApplicationsShiftRole; + return id == otherTyped.id && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + role == otherTyped.role; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, totalValue.hashCode, role.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['roleId'] = nativeToJson(roleId); + json['count'] = nativeToJson(count); + if (assigned != null) { + json['assigned'] = nativeToJson(assigned); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + return json; + } + + ListApplicationsApplicationsShiftRole({ + required this.id, + required this.roleId, + required this.count, + this.assigned, + this.startTime, + this.endTime, + this.hours, + this.totalValue, + required this.role, + }); +} + +@immutable +class ListApplicationsApplicationsShiftRoleRole { + final String id; + final String name; + final double costPerHour; + ListApplicationsApplicationsShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsApplicationsShiftRoleRole otherTyped = other as ListApplicationsApplicationsShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListApplicationsApplicationsShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListApplicationsData { + final List applications; + ListApplicationsData.fromJson(dynamic json): + + applications = (json['applications'] as List) + .map((e) => ListApplicationsApplications.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsData otherTyped = other as ListApplicationsData; + return applications == otherTyped.applications; + + } + @override + int get hashCode => applications.hashCode; + + + Map toJson() { + Map json = {}; + json['applications'] = applications.map((e) => e.toJson()).toList(); + return json; + } + + ListApplicationsData({ + required this.applications, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications_for_coverage.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications_for_coverage.dart new file mode 100644 index 00000000..150fd861 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications_for_coverage.dart @@ -0,0 +1,143 @@ +part of 'generated.dart'; + +class ListApplicationsForCoverageVariablesBuilder { + List shiftIds; + + final FirebaseDataConnect _dataConnect; + ListApplicationsForCoverageVariablesBuilder(this._dataConnect, {required this.shiftIds,}); + Deserializer dataDeserializer = (dynamic json) => ListApplicationsForCoverageData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListApplicationsForCoverageVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListApplicationsForCoverageVariables vars= ListApplicationsForCoverageVariables(shiftIds: shiftIds,); + return _dataConnect.query("listApplicationsForCoverage", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListApplicationsForCoverageApplications { + final String id; + final String shiftId; + final String staffId; + final EnumValue status; + ListApplicationsForCoverageApplications.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + staffId = nativeFromJson(json['staffId']), + status = applicationStatusDeserializer(json['status']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsForCoverageApplications otherTyped = other as ListApplicationsForCoverageApplications; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + staffId == otherTyped.staffId && + status == otherTyped.status; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, staffId.hashCode, status.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['staffId'] = nativeToJson(staffId); + json['status'] = + applicationStatusSerializer(status) + ; + return json; + } + + ListApplicationsForCoverageApplications({ + required this.id, + required this.shiftId, + required this.staffId, + required this.status, + }); +} + +@immutable +class ListApplicationsForCoverageData { + final List applications; + ListApplicationsForCoverageData.fromJson(dynamic json): + + applications = (json['applications'] as List) + .map((e) => ListApplicationsForCoverageApplications.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsForCoverageData otherTyped = other as ListApplicationsForCoverageData; + return applications == otherTyped.applications; + + } + @override + int get hashCode => applications.hashCode; + + + Map toJson() { + Map json = {}; + json['applications'] = applications.map((e) => e.toJson()).toList(); + return json; + } + + ListApplicationsForCoverageData({ + required this.applications, + }); +} + +@immutable +class ListApplicationsForCoverageVariables { + final List shiftIds; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListApplicationsForCoverageVariables.fromJson(Map json): + + shiftIds = (json['shiftIds'] as List) + .map((e) => nativeFromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsForCoverageVariables otherTyped = other as ListApplicationsForCoverageVariables; + return shiftIds == otherTyped.shiftIds; + + } + @override + int get hashCode => shiftIds.hashCode; + + + Map toJson() { + Map json = {}; + json['shiftIds'] = shiftIds.map((e) => nativeToJson(e)).toList(); + return json; + } + + ListApplicationsForCoverageVariables({ + required this.shiftIds, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications_for_daily_ops.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications_for_daily_ops.dart new file mode 100644 index 00000000..c64a0110 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications_for_daily_ops.dart @@ -0,0 +1,157 @@ +part of 'generated.dart'; + +class ListApplicationsForDailyOpsVariablesBuilder { + List shiftIds; + + final FirebaseDataConnect _dataConnect; + ListApplicationsForDailyOpsVariablesBuilder(this._dataConnect, {required this.shiftIds,}); + Deserializer dataDeserializer = (dynamic json) => ListApplicationsForDailyOpsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListApplicationsForDailyOpsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListApplicationsForDailyOpsVariables vars= ListApplicationsForDailyOpsVariables(shiftIds: shiftIds,); + return _dataConnect.query("listApplicationsForDailyOps", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListApplicationsForDailyOpsApplications { + final String id; + final String shiftId; + final String staffId; + final EnumValue status; + final Timestamp? checkInTime; + final Timestamp? checkOutTime; + ListApplicationsForDailyOpsApplications.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + staffId = nativeFromJson(json['staffId']), + status = applicationStatusDeserializer(json['status']), + checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']), + checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsForDailyOpsApplications otherTyped = other as ListApplicationsForDailyOpsApplications; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + staffId == otherTyped.staffId && + status == otherTyped.status && + checkInTime == otherTyped.checkInTime && + checkOutTime == otherTyped.checkOutTime; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, staffId.hashCode, status.hashCode, checkInTime.hashCode, checkOutTime.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['staffId'] = nativeToJson(staffId); + json['status'] = + applicationStatusSerializer(status) + ; + if (checkInTime != null) { + json['checkInTime'] = checkInTime!.toJson(); + } + if (checkOutTime != null) { + json['checkOutTime'] = checkOutTime!.toJson(); + } + return json; + } + + ListApplicationsForDailyOpsApplications({ + required this.id, + required this.shiftId, + required this.staffId, + required this.status, + this.checkInTime, + this.checkOutTime, + }); +} + +@immutable +class ListApplicationsForDailyOpsData { + final List applications; + ListApplicationsForDailyOpsData.fromJson(dynamic json): + + applications = (json['applications'] as List) + .map((e) => ListApplicationsForDailyOpsApplications.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsForDailyOpsData otherTyped = other as ListApplicationsForDailyOpsData; + return applications == otherTyped.applications; + + } + @override + int get hashCode => applications.hashCode; + + + Map toJson() { + Map json = {}; + json['applications'] = applications.map((e) => e.toJson()).toList(); + return json; + } + + ListApplicationsForDailyOpsData({ + required this.applications, + }); +} + +@immutable +class ListApplicationsForDailyOpsVariables { + final List shiftIds; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListApplicationsForDailyOpsVariables.fromJson(Map json): + + shiftIds = (json['shiftIds'] as List) + .map((e) => nativeFromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsForDailyOpsVariables otherTyped = other as ListApplicationsForDailyOpsVariables; + return shiftIds == otherTyped.shiftIds; + + } + @override + int get hashCode => shiftIds.hashCode; + + + Map toJson() { + Map json = {}; + json['shiftIds'] = shiftIds.map((e) => nativeToJson(e)).toList(); + return json; + } + + ListApplicationsForDailyOpsVariables({ + required this.shiftIds, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications_for_no_show_range.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications_for_no_show_range.dart new file mode 100644 index 00000000..e1c51a64 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications_for_no_show_range.dart @@ -0,0 +1,143 @@ +part of 'generated.dart'; + +class ListApplicationsForNoShowRangeVariablesBuilder { + List shiftIds; + + final FirebaseDataConnect _dataConnect; + ListApplicationsForNoShowRangeVariablesBuilder(this._dataConnect, {required this.shiftIds,}); + Deserializer dataDeserializer = (dynamic json) => ListApplicationsForNoShowRangeData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListApplicationsForNoShowRangeVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListApplicationsForNoShowRangeVariables vars= ListApplicationsForNoShowRangeVariables(shiftIds: shiftIds,); + return _dataConnect.query("listApplicationsForNoShowRange", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListApplicationsForNoShowRangeApplications { + final String id; + final String shiftId; + final String staffId; + final EnumValue status; + ListApplicationsForNoShowRangeApplications.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + staffId = nativeFromJson(json['staffId']), + status = applicationStatusDeserializer(json['status']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsForNoShowRangeApplications otherTyped = other as ListApplicationsForNoShowRangeApplications; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + staffId == otherTyped.staffId && + status == otherTyped.status; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, staffId.hashCode, status.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['staffId'] = nativeToJson(staffId); + json['status'] = + applicationStatusSerializer(status) + ; + return json; + } + + ListApplicationsForNoShowRangeApplications({ + required this.id, + required this.shiftId, + required this.staffId, + required this.status, + }); +} + +@immutable +class ListApplicationsForNoShowRangeData { + final List applications; + ListApplicationsForNoShowRangeData.fromJson(dynamic json): + + applications = (json['applications'] as List) + .map((e) => ListApplicationsForNoShowRangeApplications.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsForNoShowRangeData otherTyped = other as ListApplicationsForNoShowRangeData; + return applications == otherTyped.applications; + + } + @override + int get hashCode => applications.hashCode; + + + Map toJson() { + Map json = {}; + json['applications'] = applications.map((e) => e.toJson()).toList(); + return json; + } + + ListApplicationsForNoShowRangeData({ + required this.applications, + }); +} + +@immutable +class ListApplicationsForNoShowRangeVariables { + final List shiftIds; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListApplicationsForNoShowRangeVariables.fromJson(Map json): + + shiftIds = (json['shiftIds'] as List) + .map((e) => nativeFromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsForNoShowRangeVariables otherTyped = other as ListApplicationsForNoShowRangeVariables; + return shiftIds == otherTyped.shiftIds; + + } + @override + int get hashCode => shiftIds.hashCode; + + + Map toJson() { + Map json = {}; + json['shiftIds'] = shiftIds.map((e) => nativeToJson(e)).toList(); + return json; + } + + ListApplicationsForNoShowRangeVariables({ + required this.shiftIds, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications_for_performance.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications_for_performance.dart new file mode 100644 index 00000000..6a2c7d27 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_applications_for_performance.dart @@ -0,0 +1,157 @@ +part of 'generated.dart'; + +class ListApplicationsForPerformanceVariablesBuilder { + List shiftIds; + + final FirebaseDataConnect _dataConnect; + ListApplicationsForPerformanceVariablesBuilder(this._dataConnect, {required this.shiftIds,}); + Deserializer dataDeserializer = (dynamic json) => ListApplicationsForPerformanceData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListApplicationsForPerformanceVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListApplicationsForPerformanceVariables vars= ListApplicationsForPerformanceVariables(shiftIds: shiftIds,); + return _dataConnect.query("listApplicationsForPerformance", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListApplicationsForPerformanceApplications { + final String id; + final String shiftId; + final String staffId; + final EnumValue status; + final Timestamp? checkInTime; + final Timestamp? checkOutTime; + ListApplicationsForPerformanceApplications.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + staffId = nativeFromJson(json['staffId']), + status = applicationStatusDeserializer(json['status']), + checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']), + checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsForPerformanceApplications otherTyped = other as ListApplicationsForPerformanceApplications; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + staffId == otherTyped.staffId && + status == otherTyped.status && + checkInTime == otherTyped.checkInTime && + checkOutTime == otherTyped.checkOutTime; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, staffId.hashCode, status.hashCode, checkInTime.hashCode, checkOutTime.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['staffId'] = nativeToJson(staffId); + json['status'] = + applicationStatusSerializer(status) + ; + if (checkInTime != null) { + json['checkInTime'] = checkInTime!.toJson(); + } + if (checkOutTime != null) { + json['checkOutTime'] = checkOutTime!.toJson(); + } + return json; + } + + ListApplicationsForPerformanceApplications({ + required this.id, + required this.shiftId, + required this.staffId, + required this.status, + this.checkInTime, + this.checkOutTime, + }); +} + +@immutable +class ListApplicationsForPerformanceData { + final List applications; + ListApplicationsForPerformanceData.fromJson(dynamic json): + + applications = (json['applications'] as List) + .map((e) => ListApplicationsForPerformanceApplications.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsForPerformanceData otherTyped = other as ListApplicationsForPerformanceData; + return applications == otherTyped.applications; + + } + @override + int get hashCode => applications.hashCode; + + + Map toJson() { + Map json = {}; + json['applications'] = applications.map((e) => e.toJson()).toList(); + return json; + } + + ListApplicationsForPerformanceData({ + required this.applications, + }); +} + +@immutable +class ListApplicationsForPerformanceVariables { + final List shiftIds; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListApplicationsForPerformanceVariables.fromJson(Map json): + + shiftIds = (json['shiftIds'] as List) + .map((e) => nativeFromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListApplicationsForPerformanceVariables otherTyped = other as ListApplicationsForPerformanceVariables; + return shiftIds == otherTyped.shiftIds; + + } + @override + int get hashCode => shiftIds.hashCode; + + + Map toJson() { + Map json = {}; + json['shiftIds'] = shiftIds.map((e) => nativeToJson(e)).toList(); + return json; + } + + ListApplicationsForPerformanceVariables({ + required this.shiftIds, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_assignments.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_assignments.dart new file mode 100644 index 00000000..e541bdb0 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_assignments.dart @@ -0,0 +1,627 @@ +part of 'generated.dart'; + +class ListAssignmentsVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListAssignmentsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListAssignmentsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListAssignmentsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListAssignmentsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListAssignmentsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListAssignmentsVariables vars= ListAssignmentsVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listAssignments", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListAssignmentsAssignments { + final String id; + final String? title; + final EnumValue? status; + final Timestamp? createdAt; + final ListAssignmentsAssignmentsWorkforce workforce; + final ListAssignmentsAssignmentsShiftRole shiftRole; + ListAssignmentsAssignments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = json['title'] == null ? null : nativeFromJson(json['title']), + status = json['status'] == null ? null : assignmentStatusDeserializer(json['status']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + workforce = ListAssignmentsAssignmentsWorkforce.fromJson(json['workforce']), + shiftRole = ListAssignmentsAssignmentsShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsAssignments otherTyped = other as ListAssignmentsAssignments; + return id == otherTyped.id && + title == otherTyped.title && + status == otherTyped.status && + createdAt == otherTyped.createdAt && + workforce == otherTyped.workforce && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, status.hashCode, createdAt.hashCode, workforce.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (title != null) { + json['title'] = nativeToJson(title); + } + if (status != null) { + json['status'] = + assignmentStatusSerializer(status!) + ; + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['workforce'] = workforce.toJson(); + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + ListAssignmentsAssignments({ + required this.id, + this.title, + this.status, + this.createdAt, + required this.workforce, + required this.shiftRole, + }); +} + +@immutable +class ListAssignmentsAssignmentsWorkforce { + final String id; + final String workforceNumber; + final ListAssignmentsAssignmentsWorkforceStaff staff; + ListAssignmentsAssignmentsWorkforce.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workforceNumber = nativeFromJson(json['workforceNumber']), + staff = ListAssignmentsAssignmentsWorkforceStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsAssignmentsWorkforce otherTyped = other as ListAssignmentsAssignmentsWorkforce; + return id == otherTyped.id && + workforceNumber == otherTyped.workforceNumber && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workforceNumber.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['workforceNumber'] = nativeToJson(workforceNumber); + json['staff'] = staff.toJson(); + return json; + } + + ListAssignmentsAssignmentsWorkforce({ + required this.id, + required this.workforceNumber, + required this.staff, + }); +} + +@immutable +class ListAssignmentsAssignmentsWorkforceStaff { + final String id; + final String fullName; + ListAssignmentsAssignmentsWorkforceStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsAssignmentsWorkforceStaff otherTyped = other as ListAssignmentsAssignmentsWorkforceStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListAssignmentsAssignmentsWorkforceStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListAssignmentsAssignmentsShiftRole { + final String id; + final int count; + final int? assigned; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? totalValue; + final ListAssignmentsAssignmentsShiftRoleRole role; + final ListAssignmentsAssignmentsShiftRoleShift shift; + ListAssignmentsAssignmentsShiftRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + count = nativeFromJson(json['count']), + assigned = json['assigned'] == null ? null : nativeFromJson(json['assigned']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = ListAssignmentsAssignmentsShiftRoleRole.fromJson(json['role']), + shift = ListAssignmentsAssignmentsShiftRoleShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsAssignmentsShiftRole otherTyped = other as ListAssignmentsAssignmentsShiftRole; + return id == otherTyped.id && + count == otherTyped.count && + assigned == otherTyped.assigned && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, totalValue.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['count'] = nativeToJson(count); + if (assigned != null) { + json['assigned'] = nativeToJson(assigned); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListAssignmentsAssignmentsShiftRole({ + required this.id, + required this.count, + this.assigned, + this.startTime, + this.endTime, + this.hours, + this.totalValue, + required this.role, + required this.shift, + }); +} + +@immutable +class ListAssignmentsAssignmentsShiftRoleRole { + final String id; + final String name; + final double costPerHour; + ListAssignmentsAssignmentsShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsAssignmentsShiftRoleRole otherTyped = other as ListAssignmentsAssignmentsShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListAssignmentsAssignmentsShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListAssignmentsAssignmentsShiftRoleShift { + final String id; + final String title; + final Timestamp? date; + final String? location; + final String? locationAddress; + final double? latitude; + final double? longitude; + final EnumValue? status; + final ListAssignmentsAssignmentsShiftRoleShiftOrder order; + ListAssignmentsAssignmentsShiftRoleShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + latitude = json['latitude'] == null ? null : nativeFromJson(json['latitude']), + longitude = json['longitude'] == null ? null : nativeFromJson(json['longitude']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + order = ListAssignmentsAssignmentsShiftRoleShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsAssignmentsShiftRoleShift otherTyped = other as ListAssignmentsAssignmentsShiftRoleShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + latitude == otherTyped.latitude && + longitude == otherTyped.longitude && + status == otherTyped.status && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, status.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (latitude != null) { + json['latitude'] = nativeToJson(latitude); + } + if (longitude != null) { + json['longitude'] = nativeToJson(longitude); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + json['order'] = order.toJson(); + return json; + } + + ListAssignmentsAssignmentsShiftRoleShift({ + required this.id, + required this.title, + this.date, + this.location, + this.locationAddress, + this.latitude, + this.longitude, + this.status, + required this.order, + }); +} + +@immutable +class ListAssignmentsAssignmentsShiftRoleShiftOrder { + final String id; + final String? eventName; + final ListAssignmentsAssignmentsShiftRoleShiftOrderBusiness business; + final ListAssignmentsAssignmentsShiftRoleShiftOrderVendor? vendor; + ListAssignmentsAssignmentsShiftRoleShiftOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + business = ListAssignmentsAssignmentsShiftRoleShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : ListAssignmentsAssignmentsShiftRoleShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsAssignmentsShiftRoleShiftOrder otherTyped = other as ListAssignmentsAssignmentsShiftRoleShiftOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + ListAssignmentsAssignmentsShiftRoleShiftOrder({ + required this.id, + this.eventName, + required this.business, + this.vendor, + }); +} + +@immutable +class ListAssignmentsAssignmentsShiftRoleShiftOrderBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + ListAssignmentsAssignmentsShiftRoleShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsAssignmentsShiftRoleShiftOrderBusiness otherTyped = other as ListAssignmentsAssignmentsShiftRoleShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + ListAssignmentsAssignmentsShiftRoleShiftOrderBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class ListAssignmentsAssignmentsShiftRoleShiftOrderVendor { + final String id; + final String companyName; + ListAssignmentsAssignmentsShiftRoleShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsAssignmentsShiftRoleShiftOrderVendor otherTyped = other as ListAssignmentsAssignmentsShiftRoleShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListAssignmentsAssignmentsShiftRoleShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListAssignmentsData { + final List assignments; + ListAssignmentsData.fromJson(dynamic json): + + assignments = (json['assignments'] as List) + .map((e) => ListAssignmentsAssignments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsData otherTyped = other as ListAssignmentsData; + return assignments == otherTyped.assignments; + + } + @override + int get hashCode => assignments.hashCode; + + + Map toJson() { + Map json = {}; + json['assignments'] = assignments.map((e) => e.toJson()).toList(); + return json; + } + + ListAssignmentsData({ + required this.assignments, + }); +} + +@immutable +class ListAssignmentsVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListAssignmentsVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsVariables otherTyped = other as ListAssignmentsVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListAssignmentsVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_assignments_by_shift_role.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_assignments_by_shift_role.dart new file mode 100644 index 00000000..8c057dab --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_assignments_by_shift_role.dart @@ -0,0 +1,275 @@ +part of 'generated.dart'; + +class ListAssignmentsByShiftRoleVariablesBuilder { + String shiftId; + String roleId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListAssignmentsByShiftRoleVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListAssignmentsByShiftRoleVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListAssignmentsByShiftRoleVariablesBuilder(this._dataConnect, {required this.shiftId,required this.roleId,}); + Deserializer dataDeserializer = (dynamic json) => ListAssignmentsByShiftRoleData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListAssignmentsByShiftRoleVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListAssignmentsByShiftRoleVariables vars= ListAssignmentsByShiftRoleVariables(shiftId: shiftId,roleId: roleId,offset: _offset,limit: _limit,); + return _dataConnect.query("listAssignmentsByShiftRole", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListAssignmentsByShiftRoleAssignments { + final String id; + final String? title; + final EnumValue? status; + final Timestamp? createdAt; + final ListAssignmentsByShiftRoleAssignmentsWorkforce workforce; + ListAssignmentsByShiftRoleAssignments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = json['title'] == null ? null : nativeFromJson(json['title']), + status = json['status'] == null ? null : assignmentStatusDeserializer(json['status']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + workforce = ListAssignmentsByShiftRoleAssignmentsWorkforce.fromJson(json['workforce']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByShiftRoleAssignments otherTyped = other as ListAssignmentsByShiftRoleAssignments; + return id == otherTyped.id && + title == otherTyped.title && + status == otherTyped.status && + createdAt == otherTyped.createdAt && + workforce == otherTyped.workforce; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, status.hashCode, createdAt.hashCode, workforce.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (title != null) { + json['title'] = nativeToJson(title); + } + if (status != null) { + json['status'] = + assignmentStatusSerializer(status!) + ; + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['workforce'] = workforce.toJson(); + return json; + } + + ListAssignmentsByShiftRoleAssignments({ + required this.id, + this.title, + this.status, + this.createdAt, + required this.workforce, + }); +} + +@immutable +class ListAssignmentsByShiftRoleAssignmentsWorkforce { + final String id; + final String workforceNumber; + final ListAssignmentsByShiftRoleAssignmentsWorkforceStaff staff; + ListAssignmentsByShiftRoleAssignmentsWorkforce.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workforceNumber = nativeFromJson(json['workforceNumber']), + staff = ListAssignmentsByShiftRoleAssignmentsWorkforceStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByShiftRoleAssignmentsWorkforce otherTyped = other as ListAssignmentsByShiftRoleAssignmentsWorkforce; + return id == otherTyped.id && + workforceNumber == otherTyped.workforceNumber && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workforceNumber.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['workforceNumber'] = nativeToJson(workforceNumber); + json['staff'] = staff.toJson(); + return json; + } + + ListAssignmentsByShiftRoleAssignmentsWorkforce({ + required this.id, + required this.workforceNumber, + required this.staff, + }); +} + +@immutable +class ListAssignmentsByShiftRoleAssignmentsWorkforceStaff { + final String id; + final String fullName; + ListAssignmentsByShiftRoleAssignmentsWorkforceStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByShiftRoleAssignmentsWorkforceStaff otherTyped = other as ListAssignmentsByShiftRoleAssignmentsWorkforceStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListAssignmentsByShiftRoleAssignmentsWorkforceStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListAssignmentsByShiftRoleData { + final List assignments; + ListAssignmentsByShiftRoleData.fromJson(dynamic json): + + assignments = (json['assignments'] as List) + .map((e) => ListAssignmentsByShiftRoleAssignments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByShiftRoleData otherTyped = other as ListAssignmentsByShiftRoleData; + return assignments == otherTyped.assignments; + + } + @override + int get hashCode => assignments.hashCode; + + + Map toJson() { + Map json = {}; + json['assignments'] = assignments.map((e) => e.toJson()).toList(); + return json; + } + + ListAssignmentsByShiftRoleData({ + required this.assignments, + }); +} + +@immutable +class ListAssignmentsByShiftRoleVariables { + final String shiftId; + final String roleId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListAssignmentsByShiftRoleVariables.fromJson(Map json): + + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']) { + + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByShiftRoleVariables otherTyped = other as ListAssignmentsByShiftRoleVariables; + return shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListAssignmentsByShiftRoleVariables({ + required this.shiftId, + required this.roleId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_assignments_by_workforce_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_assignments_by_workforce_id.dart new file mode 100644 index 00000000..d161a14f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_assignments_by_workforce_id.dart @@ -0,0 +1,587 @@ +part of 'generated.dart'; + +class ListAssignmentsByWorkforceIdVariablesBuilder { + String workforceId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListAssignmentsByWorkforceIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListAssignmentsByWorkforceIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListAssignmentsByWorkforceIdVariablesBuilder(this._dataConnect, {required this.workforceId,}); + Deserializer dataDeserializer = (dynamic json) => ListAssignmentsByWorkforceIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListAssignmentsByWorkforceIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListAssignmentsByWorkforceIdVariables vars= ListAssignmentsByWorkforceIdVariables(workforceId: workforceId,offset: _offset,limit: _limit,); + return _dataConnect.query("listAssignmentsByWorkforceId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListAssignmentsByWorkforceIdAssignments { + final String id; + final String? title; + final EnumValue? status; + final Timestamp? createdAt; + final ListAssignmentsByWorkforceIdAssignmentsWorkforce workforce; + final ListAssignmentsByWorkforceIdAssignmentsShiftRole shiftRole; + ListAssignmentsByWorkforceIdAssignments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = json['title'] == null ? null : nativeFromJson(json['title']), + status = json['status'] == null ? null : assignmentStatusDeserializer(json['status']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + workforce = ListAssignmentsByWorkforceIdAssignmentsWorkforce.fromJson(json['workforce']), + shiftRole = ListAssignmentsByWorkforceIdAssignmentsShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdAssignments otherTyped = other as ListAssignmentsByWorkforceIdAssignments; + return id == otherTyped.id && + title == otherTyped.title && + status == otherTyped.status && + createdAt == otherTyped.createdAt && + workforce == otherTyped.workforce && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, status.hashCode, createdAt.hashCode, workforce.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (title != null) { + json['title'] = nativeToJson(title); + } + if (status != null) { + json['status'] = + assignmentStatusSerializer(status!) + ; + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['workforce'] = workforce.toJson(); + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + ListAssignmentsByWorkforceIdAssignments({ + required this.id, + this.title, + this.status, + this.createdAt, + required this.workforce, + required this.shiftRole, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdAssignmentsWorkforce { + final String id; + final String workforceNumber; + final ListAssignmentsByWorkforceIdAssignmentsWorkforceStaff staff; + ListAssignmentsByWorkforceIdAssignmentsWorkforce.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workforceNumber = nativeFromJson(json['workforceNumber']), + staff = ListAssignmentsByWorkforceIdAssignmentsWorkforceStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdAssignmentsWorkforce otherTyped = other as ListAssignmentsByWorkforceIdAssignmentsWorkforce; + return id == otherTyped.id && + workforceNumber == otherTyped.workforceNumber && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workforceNumber.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['workforceNumber'] = nativeToJson(workforceNumber); + json['staff'] = staff.toJson(); + return json; + } + + ListAssignmentsByWorkforceIdAssignmentsWorkforce({ + required this.id, + required this.workforceNumber, + required this.staff, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdAssignmentsWorkforceStaff { + final String id; + final String fullName; + ListAssignmentsByWorkforceIdAssignmentsWorkforceStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdAssignmentsWorkforceStaff otherTyped = other as ListAssignmentsByWorkforceIdAssignmentsWorkforceStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListAssignmentsByWorkforceIdAssignmentsWorkforceStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdAssignmentsShiftRole { + final String id; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? totalValue; + final ListAssignmentsByWorkforceIdAssignmentsShiftRoleRole role; + final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShift shift; + ListAssignmentsByWorkforceIdAssignmentsShiftRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = ListAssignmentsByWorkforceIdAssignmentsShiftRoleRole.fromJson(json['role']), + shift = ListAssignmentsByWorkforceIdAssignmentsShiftRoleShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdAssignmentsShiftRole otherTyped = other as ListAssignmentsByWorkforceIdAssignmentsShiftRole; + return id == otherTyped.id && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, totalValue.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListAssignmentsByWorkforceIdAssignmentsShiftRole({ + required this.id, + this.startTime, + this.endTime, + this.hours, + this.totalValue, + required this.role, + required this.shift, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdAssignmentsShiftRoleRole { + final String id; + final String name; + final double costPerHour; + ListAssignmentsByWorkforceIdAssignmentsShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdAssignmentsShiftRoleRole otherTyped = other as ListAssignmentsByWorkforceIdAssignmentsShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListAssignmentsByWorkforceIdAssignmentsShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdAssignmentsShiftRoleShift { + final String id; + final String title; + final Timestamp? date; + final String? location; + final EnumValue? status; + final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder order; + ListAssignmentsByWorkforceIdAssignmentsShiftRoleShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + order = ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShift otherTyped = other as ListAssignmentsByWorkforceIdAssignmentsShiftRoleShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + location == otherTyped.location && + status == otherTyped.status && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, location.hashCode, status.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + json['order'] = order.toJson(); + return json; + } + + ListAssignmentsByWorkforceIdAssignmentsShiftRoleShift({ + required this.id, + required this.title, + this.date, + this.location, + this.status, + required this.order, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder { + final String id; + final String? eventName; + final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderBusiness business; + final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderVendor? vendor; + ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + business = ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder otherTyped = other as ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder({ + required this.id, + this.eventName, + required this.business, + this.vendor, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderBusiness { + final String id; + final String businessName; + ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderBusiness otherTyped = other as ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderVendor { + final String id; + final String companyName; + ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderVendor otherTyped = other as ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdData { + final List assignments; + ListAssignmentsByWorkforceIdData.fromJson(dynamic json): + + assignments = (json['assignments'] as List) + .map((e) => ListAssignmentsByWorkforceIdAssignments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdData otherTyped = other as ListAssignmentsByWorkforceIdData; + return assignments == otherTyped.assignments; + + } + @override + int get hashCode => assignments.hashCode; + + + Map toJson() { + Map json = {}; + json['assignments'] = assignments.map((e) => e.toJson()).toList(); + return json; + } + + ListAssignmentsByWorkforceIdData({ + required this.assignments, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdVariables { + final String workforceId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListAssignmentsByWorkforceIdVariables.fromJson(Map json): + + workforceId = nativeFromJson(json['workforceId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdVariables otherTyped = other as ListAssignmentsByWorkforceIdVariables; + return workforceId == otherTyped.workforceId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([workforceId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['workforceId'] = nativeToJson(workforceId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListAssignmentsByWorkforceIdVariables({ + required this.workforceId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_assignments_by_workforce_ids.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_assignments_by_workforce_ids.dart new file mode 100644 index 00000000..829660bc --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_assignments_by_workforce_ids.dart @@ -0,0 +1,540 @@ +part of 'generated.dart'; + +class ListAssignmentsByWorkforceIdsVariablesBuilder { + List workforceIds; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListAssignmentsByWorkforceIdsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListAssignmentsByWorkforceIdsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListAssignmentsByWorkforceIdsVariablesBuilder(this._dataConnect, {required this.workforceIds,}); + Deserializer dataDeserializer = (dynamic json) => ListAssignmentsByWorkforceIdsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListAssignmentsByWorkforceIdsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListAssignmentsByWorkforceIdsVariables vars= ListAssignmentsByWorkforceIdsVariables(workforceIds: workforceIds,offset: _offset,limit: _limit,); + return _dataConnect.query("listAssignmentsByWorkforceIds", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListAssignmentsByWorkforceIdsAssignments { + final String id; + final String? title; + final EnumValue? status; + final Timestamp? createdAt; + final ListAssignmentsByWorkforceIdsAssignmentsWorkforce workforce; + final ListAssignmentsByWorkforceIdsAssignmentsShiftRole shiftRole; + ListAssignmentsByWorkforceIdsAssignments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = json['title'] == null ? null : nativeFromJson(json['title']), + status = json['status'] == null ? null : assignmentStatusDeserializer(json['status']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + workforce = ListAssignmentsByWorkforceIdsAssignmentsWorkforce.fromJson(json['workforce']), + shiftRole = ListAssignmentsByWorkforceIdsAssignmentsShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdsAssignments otherTyped = other as ListAssignmentsByWorkforceIdsAssignments; + return id == otherTyped.id && + title == otherTyped.title && + status == otherTyped.status && + createdAt == otherTyped.createdAt && + workforce == otherTyped.workforce && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, status.hashCode, createdAt.hashCode, workforce.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (title != null) { + json['title'] = nativeToJson(title); + } + if (status != null) { + json['status'] = + assignmentStatusSerializer(status!) + ; + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['workforce'] = workforce.toJson(); + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + ListAssignmentsByWorkforceIdsAssignments({ + required this.id, + this.title, + this.status, + this.createdAt, + required this.workforce, + required this.shiftRole, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdsAssignmentsWorkforce { + final String id; + final String workforceNumber; + final ListAssignmentsByWorkforceIdsAssignmentsWorkforceStaff staff; + ListAssignmentsByWorkforceIdsAssignmentsWorkforce.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workforceNumber = nativeFromJson(json['workforceNumber']), + staff = ListAssignmentsByWorkforceIdsAssignmentsWorkforceStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdsAssignmentsWorkforce otherTyped = other as ListAssignmentsByWorkforceIdsAssignmentsWorkforce; + return id == otherTyped.id && + workforceNumber == otherTyped.workforceNumber && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workforceNumber.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['workforceNumber'] = nativeToJson(workforceNumber); + json['staff'] = staff.toJson(); + return json; + } + + ListAssignmentsByWorkforceIdsAssignmentsWorkforce({ + required this.id, + required this.workforceNumber, + required this.staff, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdsAssignmentsWorkforceStaff { + final String id; + final String fullName; + ListAssignmentsByWorkforceIdsAssignmentsWorkforceStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdsAssignmentsWorkforceStaff otherTyped = other as ListAssignmentsByWorkforceIdsAssignmentsWorkforceStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListAssignmentsByWorkforceIdsAssignmentsWorkforceStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdsAssignmentsShiftRole { + final String id; + final ListAssignmentsByWorkforceIdsAssignmentsShiftRoleRole role; + final ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShift shift; + ListAssignmentsByWorkforceIdsAssignmentsShiftRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + role = ListAssignmentsByWorkforceIdsAssignmentsShiftRoleRole.fromJson(json['role']), + shift = ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdsAssignmentsShiftRole otherTyped = other as ListAssignmentsByWorkforceIdsAssignmentsShiftRole; + return id == otherTyped.id && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListAssignmentsByWorkforceIdsAssignmentsShiftRole({ + required this.id, + required this.role, + required this.shift, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdsAssignmentsShiftRoleRole { + final String id; + final String name; + ListAssignmentsByWorkforceIdsAssignmentsShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdsAssignmentsShiftRoleRole otherTyped = other as ListAssignmentsByWorkforceIdsAssignmentsShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + return json; + } + + ListAssignmentsByWorkforceIdsAssignmentsShiftRoleRole({ + required this.id, + required this.name, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShift { + final String id; + final String title; + final Timestamp? date; + final ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrder order; + ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + order = ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShift otherTyped = other as ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + json['order'] = order.toJson(); + return json; + } + + ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShift({ + required this.id, + required this.title, + this.date, + required this.order, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrder { + final String id; + final String? eventName; + final ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderBusiness business; + final ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderVendor? vendor; + ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + business = ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrder otherTyped = other as ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrder({ + required this.id, + this.eventName, + required this.business, + this.vendor, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderBusiness { + final String id; + final String businessName; + ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderBusiness otherTyped = other as ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderVendor { + final String id; + final String companyName; + ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderVendor otherTyped = other as ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListAssignmentsByWorkforceIdsAssignmentsShiftRoleShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdsData { + final List assignments; + ListAssignmentsByWorkforceIdsData.fromJson(dynamic json): + + assignments = (json['assignments'] as List) + .map((e) => ListAssignmentsByWorkforceIdsAssignments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdsData otherTyped = other as ListAssignmentsByWorkforceIdsData; + return assignments == otherTyped.assignments; + + } + @override + int get hashCode => assignments.hashCode; + + + Map toJson() { + Map json = {}; + json['assignments'] = assignments.map((e) => e.toJson()).toList(); + return json; + } + + ListAssignmentsByWorkforceIdsData({ + required this.assignments, + }); +} + +@immutable +class ListAssignmentsByWorkforceIdsVariables { + final List workforceIds; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListAssignmentsByWorkforceIdsVariables.fromJson(Map json): + + workforceIds = (json['workforceIds'] as List) + .map((e) => nativeFromJson(e)) + .toList() { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAssignmentsByWorkforceIdsVariables otherTyped = other as ListAssignmentsByWorkforceIdsVariables; + return workforceIds == otherTyped.workforceIds && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([workforceIds.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['workforceIds'] = workforceIds.map((e) => nativeToJson(e)).toList(); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListAssignmentsByWorkforceIdsVariables({ + required this.workforceIds, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_attire_options.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_attire_options.dart new file mode 100644 index 00000000..ca615c26 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_attire_options.dart @@ -0,0 +1,133 @@ +part of 'generated.dart'; + +class ListAttireOptionsVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListAttireOptionsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListAttireOptionsData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listAttireOptions", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListAttireOptionsAttireOptions { + final String id; + final String itemId; + final String label; + final String? icon; + final String? imageUrl; + final bool? isMandatory; + final String? vendorId; + final Timestamp? createdAt; + ListAttireOptionsAttireOptions.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + itemId = nativeFromJson(json['itemId']), + label = nativeFromJson(json['label']), + icon = json['icon'] == null ? null : nativeFromJson(json['icon']), + imageUrl = json['imageUrl'] == null ? null : nativeFromJson(json['imageUrl']), + isMandatory = json['isMandatory'] == null ? null : nativeFromJson(json['isMandatory']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAttireOptionsAttireOptions otherTyped = other as ListAttireOptionsAttireOptions; + return id == otherTyped.id && + itemId == otherTyped.itemId && + label == otherTyped.label && + icon == otherTyped.icon && + imageUrl == otherTyped.imageUrl && + isMandatory == otherTyped.isMandatory && + vendorId == otherTyped.vendorId && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, itemId.hashCode, label.hashCode, icon.hashCode, imageUrl.hashCode, isMandatory.hashCode, vendorId.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['itemId'] = nativeToJson(itemId); + json['label'] = nativeToJson(label); + if (icon != null) { + json['icon'] = nativeToJson(icon); + } + if (imageUrl != null) { + json['imageUrl'] = nativeToJson(imageUrl); + } + if (isMandatory != null) { + json['isMandatory'] = nativeToJson(isMandatory); + } + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + ListAttireOptionsAttireOptions({ + required this.id, + required this.itemId, + required this.label, + this.icon, + this.imageUrl, + this.isMandatory, + this.vendorId, + this.createdAt, + }); +} + +@immutable +class ListAttireOptionsData { + final List attireOptions; + ListAttireOptionsData.fromJson(dynamic json): + + attireOptions = (json['attireOptions'] as List) + .map((e) => ListAttireOptionsAttireOptions.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListAttireOptionsData otherTyped = other as ListAttireOptionsData; + return attireOptions == otherTyped.attireOptions; + + } + @override + int get hashCode => attireOptions.hashCode; + + + Map toJson() { + Map json = {}; + json['attireOptions'] = attireOptions.map((e) => e.toJson()).toList(); + return json; + } + + ListAttireOptionsData({ + required this.attireOptions, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_benefits_data.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_benefits_data.dart new file mode 100644 index 00000000..6ba3c923 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_benefits_data.dart @@ -0,0 +1,286 @@ +part of 'generated.dart'; + +class ListBenefitsDataVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListBenefitsDataVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListBenefitsDataVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListBenefitsDataVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListBenefitsDataData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListBenefitsDataVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListBenefitsDataVariables vars= ListBenefitsDataVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listBenefitsData", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListBenefitsDataBenefitsDatas { + final String id; + final String vendorBenefitPlanId; + final int current; + final String staffId; + final ListBenefitsDataBenefitsDatasStaff staff; + final ListBenefitsDataBenefitsDatasVendorBenefitPlan vendorBenefitPlan; + ListBenefitsDataBenefitsDatas.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorBenefitPlanId = nativeFromJson(json['vendorBenefitPlanId']), + current = nativeFromJson(json['current']), + staffId = nativeFromJson(json['staffId']), + staff = ListBenefitsDataBenefitsDatasStaff.fromJson(json['staff']), + vendorBenefitPlan = ListBenefitsDataBenefitsDatasVendorBenefitPlan.fromJson(json['vendorBenefitPlan']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataBenefitsDatas otherTyped = other as ListBenefitsDataBenefitsDatas; + return id == otherTyped.id && + vendorBenefitPlanId == otherTyped.vendorBenefitPlanId && + current == otherTyped.current && + staffId == otherTyped.staffId && + staff == otherTyped.staff && + vendorBenefitPlan == otherTyped.vendorBenefitPlan; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorBenefitPlanId.hashCode, current.hashCode, staffId.hashCode, staff.hashCode, vendorBenefitPlan.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorBenefitPlanId'] = nativeToJson(vendorBenefitPlanId); + json['current'] = nativeToJson(current); + json['staffId'] = nativeToJson(staffId); + json['staff'] = staff.toJson(); + json['vendorBenefitPlan'] = vendorBenefitPlan.toJson(); + return json; + } + + ListBenefitsDataBenefitsDatas({ + required this.id, + required this.vendorBenefitPlanId, + required this.current, + required this.staffId, + required this.staff, + required this.vendorBenefitPlan, + }); +} + +@immutable +class ListBenefitsDataBenefitsDatasStaff { + final String id; + final String fullName; + ListBenefitsDataBenefitsDatasStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataBenefitsDatasStaff otherTyped = other as ListBenefitsDataBenefitsDatasStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListBenefitsDataBenefitsDatasStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListBenefitsDataBenefitsDatasVendorBenefitPlan { + final String id; + final String vendorId; + final String title; + final String? description; + final String? requestLabel; + final int? total; + final bool? isActive; + ListBenefitsDataBenefitsDatasVendorBenefitPlan.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + title = nativeFromJson(json['title']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + requestLabel = json['requestLabel'] == null ? null : nativeFromJson(json['requestLabel']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataBenefitsDatasVendorBenefitPlan otherTyped = other as ListBenefitsDataBenefitsDatasVendorBenefitPlan; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + title == otherTyped.title && + description == otherTyped.description && + requestLabel == otherTyped.requestLabel && + total == otherTyped.total && + isActive == otherTyped.isActive; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, title.hashCode, description.hashCode, requestLabel.hashCode, total.hashCode, isActive.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + json['title'] = nativeToJson(title); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (requestLabel != null) { + json['requestLabel'] = nativeToJson(requestLabel); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + return json; + } + + ListBenefitsDataBenefitsDatasVendorBenefitPlan({ + required this.id, + required this.vendorId, + required this.title, + this.description, + this.requestLabel, + this.total, + this.isActive, + }); +} + +@immutable +class ListBenefitsDataData { + final List benefitsDatas; + ListBenefitsDataData.fromJson(dynamic json): + + benefitsDatas = (json['benefitsDatas'] as List) + .map((e) => ListBenefitsDataBenefitsDatas.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataData otherTyped = other as ListBenefitsDataData; + return benefitsDatas == otherTyped.benefitsDatas; + + } + @override + int get hashCode => benefitsDatas.hashCode; + + + Map toJson() { + Map json = {}; + json['benefitsDatas'] = benefitsDatas.map((e) => e.toJson()).toList(); + return json; + } + + ListBenefitsDataData({ + required this.benefitsDatas, + }); +} + +@immutable +class ListBenefitsDataVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListBenefitsDataVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataVariables otherTyped = other as ListBenefitsDataVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListBenefitsDataVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_benefits_data_by_staff_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_benefits_data_by_staff_id.dart new file mode 100644 index 00000000..dcb5e7b5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_benefits_data_by_staff_id.dart @@ -0,0 +1,293 @@ +part of 'generated.dart'; + +class ListBenefitsDataByStaffIdVariablesBuilder { + String staffId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListBenefitsDataByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListBenefitsDataByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListBenefitsDataByStaffIdVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => ListBenefitsDataByStaffIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListBenefitsDataByStaffIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListBenefitsDataByStaffIdVariables vars= ListBenefitsDataByStaffIdVariables(staffId: staffId,offset: _offset,limit: _limit,); + return _dataConnect.query("listBenefitsDataByStaffId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListBenefitsDataByStaffIdBenefitsDatas { + final String id; + final String vendorBenefitPlanId; + final int current; + final String staffId; + final ListBenefitsDataByStaffIdBenefitsDatasStaff staff; + final ListBenefitsDataByStaffIdBenefitsDatasVendorBenefitPlan vendorBenefitPlan; + ListBenefitsDataByStaffIdBenefitsDatas.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorBenefitPlanId = nativeFromJson(json['vendorBenefitPlanId']), + current = nativeFromJson(json['current']), + staffId = nativeFromJson(json['staffId']), + staff = ListBenefitsDataByStaffIdBenefitsDatasStaff.fromJson(json['staff']), + vendorBenefitPlan = ListBenefitsDataByStaffIdBenefitsDatasVendorBenefitPlan.fromJson(json['vendorBenefitPlan']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByStaffIdBenefitsDatas otherTyped = other as ListBenefitsDataByStaffIdBenefitsDatas; + return id == otherTyped.id && + vendorBenefitPlanId == otherTyped.vendorBenefitPlanId && + current == otherTyped.current && + staffId == otherTyped.staffId && + staff == otherTyped.staff && + vendorBenefitPlan == otherTyped.vendorBenefitPlan; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorBenefitPlanId.hashCode, current.hashCode, staffId.hashCode, staff.hashCode, vendorBenefitPlan.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorBenefitPlanId'] = nativeToJson(vendorBenefitPlanId); + json['current'] = nativeToJson(current); + json['staffId'] = nativeToJson(staffId); + json['staff'] = staff.toJson(); + json['vendorBenefitPlan'] = vendorBenefitPlan.toJson(); + return json; + } + + ListBenefitsDataByStaffIdBenefitsDatas({ + required this.id, + required this.vendorBenefitPlanId, + required this.current, + required this.staffId, + required this.staff, + required this.vendorBenefitPlan, + }); +} + +@immutable +class ListBenefitsDataByStaffIdBenefitsDatasStaff { + final String id; + final String fullName; + ListBenefitsDataByStaffIdBenefitsDatasStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByStaffIdBenefitsDatasStaff otherTyped = other as ListBenefitsDataByStaffIdBenefitsDatasStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListBenefitsDataByStaffIdBenefitsDatasStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListBenefitsDataByStaffIdBenefitsDatasVendorBenefitPlan { + final String id; + final String vendorId; + final String title; + final String? description; + final String? requestLabel; + final int? total; + final bool? isActive; + ListBenefitsDataByStaffIdBenefitsDatasVendorBenefitPlan.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + title = nativeFromJson(json['title']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + requestLabel = json['requestLabel'] == null ? null : nativeFromJson(json['requestLabel']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByStaffIdBenefitsDatasVendorBenefitPlan otherTyped = other as ListBenefitsDataByStaffIdBenefitsDatasVendorBenefitPlan; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + title == otherTyped.title && + description == otherTyped.description && + requestLabel == otherTyped.requestLabel && + total == otherTyped.total && + isActive == otherTyped.isActive; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, title.hashCode, description.hashCode, requestLabel.hashCode, total.hashCode, isActive.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + json['title'] = nativeToJson(title); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (requestLabel != null) { + json['requestLabel'] = nativeToJson(requestLabel); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + return json; + } + + ListBenefitsDataByStaffIdBenefitsDatasVendorBenefitPlan({ + required this.id, + required this.vendorId, + required this.title, + this.description, + this.requestLabel, + this.total, + this.isActive, + }); +} + +@immutable +class ListBenefitsDataByStaffIdData { + final List benefitsDatas; + ListBenefitsDataByStaffIdData.fromJson(dynamic json): + + benefitsDatas = (json['benefitsDatas'] as List) + .map((e) => ListBenefitsDataByStaffIdBenefitsDatas.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByStaffIdData otherTyped = other as ListBenefitsDataByStaffIdData; + return benefitsDatas == otherTyped.benefitsDatas; + + } + @override + int get hashCode => benefitsDatas.hashCode; + + + Map toJson() { + Map json = {}; + json['benefitsDatas'] = benefitsDatas.map((e) => e.toJson()).toList(); + return json; + } + + ListBenefitsDataByStaffIdData({ + required this.benefitsDatas, + }); +} + +@immutable +class ListBenefitsDataByStaffIdVariables { + final String staffId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListBenefitsDataByStaffIdVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByStaffIdVariables otherTyped = other as ListBenefitsDataByStaffIdVariables; + return staffId == otherTyped.staffId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListBenefitsDataByStaffIdVariables({ + required this.staffId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_benefits_data_by_vendor_benefit_plan_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_benefits_data_by_vendor_benefit_plan_id.dart new file mode 100644 index 00000000..c0e6d452 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_benefits_data_by_vendor_benefit_plan_id.dart @@ -0,0 +1,293 @@ +part of 'generated.dart'; + +class ListBenefitsDataByVendorBenefitPlanIdVariablesBuilder { + String vendorBenefitPlanId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListBenefitsDataByVendorBenefitPlanIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListBenefitsDataByVendorBenefitPlanIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListBenefitsDataByVendorBenefitPlanIdVariablesBuilder(this._dataConnect, {required this.vendorBenefitPlanId,}); + Deserializer dataDeserializer = (dynamic json) => ListBenefitsDataByVendorBenefitPlanIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListBenefitsDataByVendorBenefitPlanIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListBenefitsDataByVendorBenefitPlanIdVariables vars= ListBenefitsDataByVendorBenefitPlanIdVariables(vendorBenefitPlanId: vendorBenefitPlanId,offset: _offset,limit: _limit,); + return _dataConnect.query("listBenefitsDataByVendorBenefitPlanId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListBenefitsDataByVendorBenefitPlanIdBenefitsDatas { + final String id; + final String vendorBenefitPlanId; + final int current; + final String staffId; + final ListBenefitsDataByVendorBenefitPlanIdBenefitsDatasStaff staff; + final ListBenefitsDataByVendorBenefitPlanIdBenefitsDatasVendorBenefitPlan vendorBenefitPlan; + ListBenefitsDataByVendorBenefitPlanIdBenefitsDatas.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorBenefitPlanId = nativeFromJson(json['vendorBenefitPlanId']), + current = nativeFromJson(json['current']), + staffId = nativeFromJson(json['staffId']), + staff = ListBenefitsDataByVendorBenefitPlanIdBenefitsDatasStaff.fromJson(json['staff']), + vendorBenefitPlan = ListBenefitsDataByVendorBenefitPlanIdBenefitsDatasVendorBenefitPlan.fromJson(json['vendorBenefitPlan']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByVendorBenefitPlanIdBenefitsDatas otherTyped = other as ListBenefitsDataByVendorBenefitPlanIdBenefitsDatas; + return id == otherTyped.id && + vendorBenefitPlanId == otherTyped.vendorBenefitPlanId && + current == otherTyped.current && + staffId == otherTyped.staffId && + staff == otherTyped.staff && + vendorBenefitPlan == otherTyped.vendorBenefitPlan; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorBenefitPlanId.hashCode, current.hashCode, staffId.hashCode, staff.hashCode, vendorBenefitPlan.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorBenefitPlanId'] = nativeToJson(vendorBenefitPlanId); + json['current'] = nativeToJson(current); + json['staffId'] = nativeToJson(staffId); + json['staff'] = staff.toJson(); + json['vendorBenefitPlan'] = vendorBenefitPlan.toJson(); + return json; + } + + ListBenefitsDataByVendorBenefitPlanIdBenefitsDatas({ + required this.id, + required this.vendorBenefitPlanId, + required this.current, + required this.staffId, + required this.staff, + required this.vendorBenefitPlan, + }); +} + +@immutable +class ListBenefitsDataByVendorBenefitPlanIdBenefitsDatasStaff { + final String id; + final String fullName; + ListBenefitsDataByVendorBenefitPlanIdBenefitsDatasStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByVendorBenefitPlanIdBenefitsDatasStaff otherTyped = other as ListBenefitsDataByVendorBenefitPlanIdBenefitsDatasStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListBenefitsDataByVendorBenefitPlanIdBenefitsDatasStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListBenefitsDataByVendorBenefitPlanIdBenefitsDatasVendorBenefitPlan { + final String id; + final String vendorId; + final String title; + final String? description; + final String? requestLabel; + final int? total; + final bool? isActive; + ListBenefitsDataByVendorBenefitPlanIdBenefitsDatasVendorBenefitPlan.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + title = nativeFromJson(json['title']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + requestLabel = json['requestLabel'] == null ? null : nativeFromJson(json['requestLabel']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByVendorBenefitPlanIdBenefitsDatasVendorBenefitPlan otherTyped = other as ListBenefitsDataByVendorBenefitPlanIdBenefitsDatasVendorBenefitPlan; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + title == otherTyped.title && + description == otherTyped.description && + requestLabel == otherTyped.requestLabel && + total == otherTyped.total && + isActive == otherTyped.isActive; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, title.hashCode, description.hashCode, requestLabel.hashCode, total.hashCode, isActive.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + json['title'] = nativeToJson(title); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (requestLabel != null) { + json['requestLabel'] = nativeToJson(requestLabel); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + return json; + } + + ListBenefitsDataByVendorBenefitPlanIdBenefitsDatasVendorBenefitPlan({ + required this.id, + required this.vendorId, + required this.title, + this.description, + this.requestLabel, + this.total, + this.isActive, + }); +} + +@immutable +class ListBenefitsDataByVendorBenefitPlanIdData { + final List benefitsDatas; + ListBenefitsDataByVendorBenefitPlanIdData.fromJson(dynamic json): + + benefitsDatas = (json['benefitsDatas'] as List) + .map((e) => ListBenefitsDataByVendorBenefitPlanIdBenefitsDatas.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByVendorBenefitPlanIdData otherTyped = other as ListBenefitsDataByVendorBenefitPlanIdData; + return benefitsDatas == otherTyped.benefitsDatas; + + } + @override + int get hashCode => benefitsDatas.hashCode; + + + Map toJson() { + Map json = {}; + json['benefitsDatas'] = benefitsDatas.map((e) => e.toJson()).toList(); + return json; + } + + ListBenefitsDataByVendorBenefitPlanIdData({ + required this.benefitsDatas, + }); +} + +@immutable +class ListBenefitsDataByVendorBenefitPlanIdVariables { + final String vendorBenefitPlanId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListBenefitsDataByVendorBenefitPlanIdVariables.fromJson(Map json): + + vendorBenefitPlanId = nativeFromJson(json['vendorBenefitPlanId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByVendorBenefitPlanIdVariables otherTyped = other as ListBenefitsDataByVendorBenefitPlanIdVariables; + return vendorBenefitPlanId == otherTyped.vendorBenefitPlanId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([vendorBenefitPlanId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorBenefitPlanId'] = nativeToJson(vendorBenefitPlanId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListBenefitsDataByVendorBenefitPlanIdVariables({ + required this.vendorBenefitPlanId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_benefits_data_by_vendor_benefit_plan_ids.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_benefits_data_by_vendor_benefit_plan_ids.dart new file mode 100644 index 00000000..de055ed1 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_benefits_data_by_vendor_benefit_plan_ids.dart @@ -0,0 +1,295 @@ +part of 'generated.dart'; + +class ListBenefitsDataByVendorBenefitPlanIdsVariablesBuilder { + List vendorBenefitPlanIds; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListBenefitsDataByVendorBenefitPlanIdsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListBenefitsDataByVendorBenefitPlanIdsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListBenefitsDataByVendorBenefitPlanIdsVariablesBuilder(this._dataConnect, {required this.vendorBenefitPlanIds,}); + Deserializer dataDeserializer = (dynamic json) => ListBenefitsDataByVendorBenefitPlanIdsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListBenefitsDataByVendorBenefitPlanIdsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListBenefitsDataByVendorBenefitPlanIdsVariables vars= ListBenefitsDataByVendorBenefitPlanIdsVariables(vendorBenefitPlanIds: vendorBenefitPlanIds,offset: _offset,limit: _limit,); + return _dataConnect.query("listBenefitsDataByVendorBenefitPlanIds", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatas { + final String id; + final String vendorBenefitPlanId; + final int current; + final String staffId; + final ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatasStaff staff; + final ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatasVendorBenefitPlan vendorBenefitPlan; + ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatas.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorBenefitPlanId = nativeFromJson(json['vendorBenefitPlanId']), + current = nativeFromJson(json['current']), + staffId = nativeFromJson(json['staffId']), + staff = ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatasStaff.fromJson(json['staff']), + vendorBenefitPlan = ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatasVendorBenefitPlan.fromJson(json['vendorBenefitPlan']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatas otherTyped = other as ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatas; + return id == otherTyped.id && + vendorBenefitPlanId == otherTyped.vendorBenefitPlanId && + current == otherTyped.current && + staffId == otherTyped.staffId && + staff == otherTyped.staff && + vendorBenefitPlan == otherTyped.vendorBenefitPlan; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorBenefitPlanId.hashCode, current.hashCode, staffId.hashCode, staff.hashCode, vendorBenefitPlan.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorBenefitPlanId'] = nativeToJson(vendorBenefitPlanId); + json['current'] = nativeToJson(current); + json['staffId'] = nativeToJson(staffId); + json['staff'] = staff.toJson(); + json['vendorBenefitPlan'] = vendorBenefitPlan.toJson(); + return json; + } + + ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatas({ + required this.id, + required this.vendorBenefitPlanId, + required this.current, + required this.staffId, + required this.staff, + required this.vendorBenefitPlan, + }); +} + +@immutable +class ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatasStaff { + final String id; + final String fullName; + ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatasStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatasStaff otherTyped = other as ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatasStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatasStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatasVendorBenefitPlan { + final String id; + final String vendorId; + final String title; + final String? description; + final String? requestLabel; + final int? total; + final bool? isActive; + ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatasVendorBenefitPlan.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + title = nativeFromJson(json['title']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + requestLabel = json['requestLabel'] == null ? null : nativeFromJson(json['requestLabel']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatasVendorBenefitPlan otherTyped = other as ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatasVendorBenefitPlan; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + title == otherTyped.title && + description == otherTyped.description && + requestLabel == otherTyped.requestLabel && + total == otherTyped.total && + isActive == otherTyped.isActive; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, title.hashCode, description.hashCode, requestLabel.hashCode, total.hashCode, isActive.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + json['title'] = nativeToJson(title); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (requestLabel != null) { + json['requestLabel'] = nativeToJson(requestLabel); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + return json; + } + + ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatasVendorBenefitPlan({ + required this.id, + required this.vendorId, + required this.title, + this.description, + this.requestLabel, + this.total, + this.isActive, + }); +} + +@immutable +class ListBenefitsDataByVendorBenefitPlanIdsData { + final List benefitsDatas; + ListBenefitsDataByVendorBenefitPlanIdsData.fromJson(dynamic json): + + benefitsDatas = (json['benefitsDatas'] as List) + .map((e) => ListBenefitsDataByVendorBenefitPlanIdsBenefitsDatas.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByVendorBenefitPlanIdsData otherTyped = other as ListBenefitsDataByVendorBenefitPlanIdsData; + return benefitsDatas == otherTyped.benefitsDatas; + + } + @override + int get hashCode => benefitsDatas.hashCode; + + + Map toJson() { + Map json = {}; + json['benefitsDatas'] = benefitsDatas.map((e) => e.toJson()).toList(); + return json; + } + + ListBenefitsDataByVendorBenefitPlanIdsData({ + required this.benefitsDatas, + }); +} + +@immutable +class ListBenefitsDataByVendorBenefitPlanIdsVariables { + final List vendorBenefitPlanIds; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListBenefitsDataByVendorBenefitPlanIdsVariables.fromJson(Map json): + + vendorBenefitPlanIds = (json['vendorBenefitPlanIds'] as List) + .map((e) => nativeFromJson(e)) + .toList() { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBenefitsDataByVendorBenefitPlanIdsVariables otherTyped = other as ListBenefitsDataByVendorBenefitPlanIdsVariables; + return vendorBenefitPlanIds == otherTyped.vendorBenefitPlanIds && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([vendorBenefitPlanIds.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorBenefitPlanIds'] = vendorBenefitPlanIds.map((e) => nativeToJson(e)).toList(); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListBenefitsDataByVendorBenefitPlanIdsVariables({ + required this.vendorBenefitPlanIds, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_businesses.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_businesses.dart new file mode 100644 index 00000000..146298ef --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_businesses.dart @@ -0,0 +1,200 @@ +part of 'generated.dart'; + +class ListBusinessesVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListBusinessesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListBusinessesData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listBusinesses", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListBusinessesBusinesses { + final String id; + final String businessName; + final String? contactName; + final String userId; + final String? companyLogoUrl; + final String? phone; + final String? email; + final String? hubBuilding; + final String? address; + final String? city; + final EnumValue? area; + final EnumValue? sector; + final EnumValue rateGroup; + final EnumValue status; + final String? notes; + final Timestamp? createdAt; + final Timestamp? updatedAt; + ListBusinessesBusinesses.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']), + userId = nativeFromJson(json['userId']), + companyLogoUrl = json['companyLogoUrl'] == null ? null : nativeFromJson(json['companyLogoUrl']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + hubBuilding = json['hubBuilding'] == null ? null : nativeFromJson(json['hubBuilding']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + city = json['city'] == null ? null : nativeFromJson(json['city']), + area = json['area'] == null ? null : businessAreaDeserializer(json['area']), + sector = json['sector'] == null ? null : businessSectorDeserializer(json['sector']), + rateGroup = businessRateGroupDeserializer(json['rateGroup']), + status = businessStatusDeserializer(json['status']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBusinessesBusinesses otherTyped = other as ListBusinessesBusinesses; + return id == otherTyped.id && + businessName == otherTyped.businessName && + contactName == otherTyped.contactName && + userId == otherTyped.userId && + companyLogoUrl == otherTyped.companyLogoUrl && + phone == otherTyped.phone && + email == otherTyped.email && + hubBuilding == otherTyped.hubBuilding && + address == otherTyped.address && + city == otherTyped.city && + area == otherTyped.area && + sector == otherTyped.sector && + rateGroup == otherTyped.rateGroup && + status == otherTyped.status && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, contactName.hashCode, userId.hashCode, companyLogoUrl.hashCode, phone.hashCode, email.hashCode, hubBuilding.hashCode, address.hashCode, city.hashCode, area.hashCode, sector.hashCode, rateGroup.hashCode, status.hashCode, notes.hashCode, createdAt.hashCode, updatedAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + json['userId'] = nativeToJson(userId); + if (companyLogoUrl != null) { + json['companyLogoUrl'] = nativeToJson(companyLogoUrl); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (hubBuilding != null) { + json['hubBuilding'] = nativeToJson(hubBuilding); + } + if (address != null) { + json['address'] = nativeToJson(address); + } + if (city != null) { + json['city'] = nativeToJson(city); + } + if (area != null) { + json['area'] = + businessAreaSerializer(area!) + ; + } + if (sector != null) { + json['sector'] = + businessSectorSerializer(sector!) + ; + } + json['rateGroup'] = + businessRateGroupSerializer(rateGroup) + ; + json['status'] = + businessStatusSerializer(status) + ; + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + return json; + } + + ListBusinessesBusinesses({ + required this.id, + required this.businessName, + this.contactName, + required this.userId, + this.companyLogoUrl, + this.phone, + this.email, + this.hubBuilding, + this.address, + this.city, + this.area, + this.sector, + required this.rateGroup, + required this.status, + this.notes, + this.createdAt, + this.updatedAt, + }); +} + +@immutable +class ListBusinessesData { + final List businesses; + ListBusinessesData.fromJson(dynamic json): + + businesses = (json['businesses'] as List) + .map((e) => ListBusinessesBusinesses.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListBusinessesData otherTyped = other as ListBusinessesData; + return businesses == otherTyped.businesses; + + } + @override + int get hashCode => businesses.hashCode; + + + Map toJson() { + Map json = {}; + json['businesses'] = businesses.map((e) => e.toJson()).toList(); + return json; + } + + ListBusinessesData({ + required this.businesses, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_categories.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_categories.dart new file mode 100644 index 00000000..363c245e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_categories.dart @@ -0,0 +1,126 @@ +part of 'generated.dart'; + +class ListCategoriesVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListCategoriesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListCategoriesData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listCategories", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListCategoriesCategories { + final String id; + final String categoryId; + final String label; + final String? icon; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + ListCategoriesCategories.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + categoryId = nativeFromJson(json['categoryId']), + label = nativeFromJson(json['label']), + icon = json['icon'] == null ? null : nativeFromJson(json['icon']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListCategoriesCategories otherTyped = other as ListCategoriesCategories; + return id == otherTyped.id && + categoryId == otherTyped.categoryId && + label == otherTyped.label && + icon == otherTyped.icon && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, categoryId.hashCode, label.hashCode, icon.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['categoryId'] = nativeToJson(categoryId); + json['label'] = nativeToJson(label); + if (icon != null) { + json['icon'] = nativeToJson(icon); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + ListCategoriesCategories({ + required this.id, + required this.categoryId, + required this.label, + this.icon, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class ListCategoriesData { + final List categories; + ListCategoriesData.fromJson(dynamic json): + + categories = (json['categories'] as List) + .map((e) => ListCategoriesCategories.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListCategoriesData otherTyped = other as ListCategoriesData; + return categories == otherTyped.categories; + + } + @override + int get hashCode => categories.hashCode; + + + Map toJson() { + Map json = {}; + json['categories'] = categories.map((e) => e.toJson()).toList(); + return json; + } + + ListCategoriesData({ + required this.categories, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_certificates.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_certificates.dart new file mode 100644 index 00000000..037c7c39 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_certificates.dart @@ -0,0 +1,216 @@ +part of 'generated.dart'; + +class ListCertificatesVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListCertificatesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListCertificatesData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listCertificates", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListCertificatesCertificates { + final String id; + final String name; + final String? description; + final Timestamp? expiry; + final EnumValue status; + final String? fileUrl; + final String? icon; + final String staffId; + final EnumValue? certificationType; + final String? issuer; + final EnumValue? validationStatus; + final String? certificateNumber; + final Timestamp? createdAt; + final ListCertificatesCertificatesStaff staff; + ListCertificatesCertificates.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + expiry = json['expiry'] == null ? null : Timestamp.fromJson(json['expiry']), + status = certificateStatusDeserializer(json['status']), + fileUrl = json['fileUrl'] == null ? null : nativeFromJson(json['fileUrl']), + icon = json['icon'] == null ? null : nativeFromJson(json['icon']), + staffId = nativeFromJson(json['staffId']), + certificationType = json['certificationType'] == null ? null : complianceTypeDeserializer(json['certificationType']), + issuer = json['issuer'] == null ? null : nativeFromJson(json['issuer']), + validationStatus = json['validationStatus'] == null ? null : validationStatusDeserializer(json['validationStatus']), + certificateNumber = json['certificateNumber'] == null ? null : nativeFromJson(json['certificateNumber']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + staff = ListCertificatesCertificatesStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListCertificatesCertificates otherTyped = other as ListCertificatesCertificates; + return id == otherTyped.id && + name == otherTyped.name && + description == otherTyped.description && + expiry == otherTyped.expiry && + status == otherTyped.status && + fileUrl == otherTyped.fileUrl && + icon == otherTyped.icon && + staffId == otherTyped.staffId && + certificationType == otherTyped.certificationType && + issuer == otherTyped.issuer && + validationStatus == otherTyped.validationStatus && + certificateNumber == otherTyped.certificateNumber && + createdAt == otherTyped.createdAt && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, description.hashCode, expiry.hashCode, status.hashCode, fileUrl.hashCode, icon.hashCode, staffId.hashCode, certificationType.hashCode, issuer.hashCode, validationStatus.hashCode, certificateNumber.hashCode, createdAt.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (expiry != null) { + json['expiry'] = expiry!.toJson(); + } + json['status'] = + certificateStatusSerializer(status) + ; + if (fileUrl != null) { + json['fileUrl'] = nativeToJson(fileUrl); + } + if (icon != null) { + json['icon'] = nativeToJson(icon); + } + json['staffId'] = nativeToJson(staffId); + if (certificationType != null) { + json['certificationType'] = + complianceTypeSerializer(certificationType!) + ; + } + if (issuer != null) { + json['issuer'] = nativeToJson(issuer); + } + if (validationStatus != null) { + json['validationStatus'] = + validationStatusSerializer(validationStatus!) + ; + } + if (certificateNumber != null) { + json['certificateNumber'] = nativeToJson(certificateNumber); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['staff'] = staff.toJson(); + return json; + } + + ListCertificatesCertificates({ + required this.id, + required this.name, + this.description, + this.expiry, + required this.status, + this.fileUrl, + this.icon, + required this.staffId, + this.certificationType, + this.issuer, + this.validationStatus, + this.certificateNumber, + this.createdAt, + required this.staff, + }); +} + +@immutable +class ListCertificatesCertificatesStaff { + final String id; + final String fullName; + ListCertificatesCertificatesStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListCertificatesCertificatesStaff otherTyped = other as ListCertificatesCertificatesStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListCertificatesCertificatesStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListCertificatesData { + final List certificates; + ListCertificatesData.fromJson(dynamic json): + + certificates = (json['certificates'] as List) + .map((e) => ListCertificatesCertificates.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListCertificatesData otherTyped = other as ListCertificatesData; + return certificates == otherTyped.certificates; + + } + @override + int get hashCode => certificates.hashCode; + + + Map toJson() { + Map json = {}; + json['certificates'] = certificates.map((e) => e.toJson()).toList(); + return json; + } + + ListCertificatesData({ + required this.certificates, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_certificates_by_staff_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_certificates_by_staff_id.dart new file mode 100644 index 00000000..fb63414f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_certificates_by_staff_id.dart @@ -0,0 +1,252 @@ +part of 'generated.dart'; + +class ListCertificatesByStaffIdVariablesBuilder { + String staffId; + + final FirebaseDataConnect _dataConnect; + ListCertificatesByStaffIdVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => ListCertificatesByStaffIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListCertificatesByStaffIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListCertificatesByStaffIdVariables vars= ListCertificatesByStaffIdVariables(staffId: staffId,); + return _dataConnect.query("listCertificatesByStaffId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListCertificatesByStaffIdCertificates { + final String id; + final String name; + final String? description; + final Timestamp? expiry; + final EnumValue status; + final String? fileUrl; + final String? icon; + final String staffId; + final EnumValue? certificationType; + final String? issuer; + final EnumValue? validationStatus; + final String? certificateNumber; + final Timestamp? createdAt; + final ListCertificatesByStaffIdCertificatesStaff staff; + ListCertificatesByStaffIdCertificates.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + expiry = json['expiry'] == null ? null : Timestamp.fromJson(json['expiry']), + status = certificateStatusDeserializer(json['status']), + fileUrl = json['fileUrl'] == null ? null : nativeFromJson(json['fileUrl']), + icon = json['icon'] == null ? null : nativeFromJson(json['icon']), + staffId = nativeFromJson(json['staffId']), + certificationType = json['certificationType'] == null ? null : complianceTypeDeserializer(json['certificationType']), + issuer = json['issuer'] == null ? null : nativeFromJson(json['issuer']), + validationStatus = json['validationStatus'] == null ? null : validationStatusDeserializer(json['validationStatus']), + certificateNumber = json['certificateNumber'] == null ? null : nativeFromJson(json['certificateNumber']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + staff = ListCertificatesByStaffIdCertificatesStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListCertificatesByStaffIdCertificates otherTyped = other as ListCertificatesByStaffIdCertificates; + return id == otherTyped.id && + name == otherTyped.name && + description == otherTyped.description && + expiry == otherTyped.expiry && + status == otherTyped.status && + fileUrl == otherTyped.fileUrl && + icon == otherTyped.icon && + staffId == otherTyped.staffId && + certificationType == otherTyped.certificationType && + issuer == otherTyped.issuer && + validationStatus == otherTyped.validationStatus && + certificateNumber == otherTyped.certificateNumber && + createdAt == otherTyped.createdAt && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, description.hashCode, expiry.hashCode, status.hashCode, fileUrl.hashCode, icon.hashCode, staffId.hashCode, certificationType.hashCode, issuer.hashCode, validationStatus.hashCode, certificateNumber.hashCode, createdAt.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (expiry != null) { + json['expiry'] = expiry!.toJson(); + } + json['status'] = + certificateStatusSerializer(status) + ; + if (fileUrl != null) { + json['fileUrl'] = nativeToJson(fileUrl); + } + if (icon != null) { + json['icon'] = nativeToJson(icon); + } + json['staffId'] = nativeToJson(staffId); + if (certificationType != null) { + json['certificationType'] = + complianceTypeSerializer(certificationType!) + ; + } + if (issuer != null) { + json['issuer'] = nativeToJson(issuer); + } + if (validationStatus != null) { + json['validationStatus'] = + validationStatusSerializer(validationStatus!) + ; + } + if (certificateNumber != null) { + json['certificateNumber'] = nativeToJson(certificateNumber); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['staff'] = staff.toJson(); + return json; + } + + ListCertificatesByStaffIdCertificates({ + required this.id, + required this.name, + this.description, + this.expiry, + required this.status, + this.fileUrl, + this.icon, + required this.staffId, + this.certificationType, + this.issuer, + this.validationStatus, + this.certificateNumber, + this.createdAt, + required this.staff, + }); +} + +@immutable +class ListCertificatesByStaffIdCertificatesStaff { + final String id; + final String fullName; + ListCertificatesByStaffIdCertificatesStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListCertificatesByStaffIdCertificatesStaff otherTyped = other as ListCertificatesByStaffIdCertificatesStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListCertificatesByStaffIdCertificatesStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListCertificatesByStaffIdData { + final List certificates; + ListCertificatesByStaffIdData.fromJson(dynamic json): + + certificates = (json['certificates'] as List) + .map((e) => ListCertificatesByStaffIdCertificates.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListCertificatesByStaffIdData otherTyped = other as ListCertificatesByStaffIdData; + return certificates == otherTyped.certificates; + + } + @override + int get hashCode => certificates.hashCode; + + + Map toJson() { + Map json = {}; + json['certificates'] = certificates.map((e) => e.toJson()).toList(); + return json; + } + + ListCertificatesByStaffIdData({ + required this.certificates, + }); +} + +@immutable +class ListCertificatesByStaffIdVariables { + final String staffId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListCertificatesByStaffIdVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListCertificatesByStaffIdVariables otherTyped = other as ListCertificatesByStaffIdVariables; + return staffId == otherTyped.staffId; + + } + @override + int get hashCode => staffId.hashCode; + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + return json; + } + + ListCertificatesByStaffIdVariables({ + required this.staffId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedback_ratings_by_vendor_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedback_ratings_by_vendor_id.dart new file mode 100644 index 00000000..d8d6a5e9 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedback_ratings_by_vendor_id.dart @@ -0,0 +1,266 @@ +part of 'generated.dart'; + +class ListClientFeedbackRatingsByVendorIdVariablesBuilder { + String vendorId; + Optional _dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer); + Optional _dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer); + + final FirebaseDataConnect _dataConnect; ListClientFeedbackRatingsByVendorIdVariablesBuilder dateFrom(Timestamp? t) { + _dateFrom.value = t; + return this; + } + ListClientFeedbackRatingsByVendorIdVariablesBuilder dateTo(Timestamp? t) { + _dateTo.value = t; + return this; + } + + ListClientFeedbackRatingsByVendorIdVariablesBuilder(this._dataConnect, {required this.vendorId,}); + Deserializer dataDeserializer = (dynamic json) => ListClientFeedbackRatingsByVendorIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListClientFeedbackRatingsByVendorIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListClientFeedbackRatingsByVendorIdVariables vars= ListClientFeedbackRatingsByVendorIdVariables(vendorId: vendorId,dateFrom: _dateFrom,dateTo: _dateTo,); + return _dataConnect.query("listClientFeedbackRatingsByVendorId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListClientFeedbackRatingsByVendorIdClientFeedbacks { + final String id; + final int? rating; + final String? comment; + final Timestamp? date; + final ListClientFeedbackRatingsByVendorIdClientFeedbacksBusiness business; + final ListClientFeedbackRatingsByVendorIdClientFeedbacksVendor vendor; + ListClientFeedbackRatingsByVendorIdClientFeedbacks.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + rating = json['rating'] == null ? null : nativeFromJson(json['rating']), + comment = json['comment'] == null ? null : nativeFromJson(json['comment']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + business = ListClientFeedbackRatingsByVendorIdClientFeedbacksBusiness.fromJson(json['business']), + vendor = ListClientFeedbackRatingsByVendorIdClientFeedbacksVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbackRatingsByVendorIdClientFeedbacks otherTyped = other as ListClientFeedbackRatingsByVendorIdClientFeedbacks; + return id == otherTyped.id && + rating == otherTyped.rating && + comment == otherTyped.comment && + date == otherTyped.date && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, rating.hashCode, comment.hashCode, date.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (rating != null) { + json['rating'] = nativeToJson(rating); + } + if (comment != null) { + json['comment'] = nativeToJson(comment); + } + if (date != null) { + json['date'] = date!.toJson(); + } + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + return json; + } + + ListClientFeedbackRatingsByVendorIdClientFeedbacks({ + required this.id, + this.rating, + this.comment, + this.date, + required this.business, + required this.vendor, + }); +} + +@immutable +class ListClientFeedbackRatingsByVendorIdClientFeedbacksBusiness { + final String id; + final String businessName; + ListClientFeedbackRatingsByVendorIdClientFeedbacksBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbackRatingsByVendorIdClientFeedbacksBusiness otherTyped = other as ListClientFeedbackRatingsByVendorIdClientFeedbacksBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListClientFeedbackRatingsByVendorIdClientFeedbacksBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListClientFeedbackRatingsByVendorIdClientFeedbacksVendor { + final String id; + final String companyName; + ListClientFeedbackRatingsByVendorIdClientFeedbacksVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbackRatingsByVendorIdClientFeedbacksVendor otherTyped = other as ListClientFeedbackRatingsByVendorIdClientFeedbacksVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListClientFeedbackRatingsByVendorIdClientFeedbacksVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListClientFeedbackRatingsByVendorIdData { + final List clientFeedbacks; + ListClientFeedbackRatingsByVendorIdData.fromJson(dynamic json): + + clientFeedbacks = (json['clientFeedbacks'] as List) + .map((e) => ListClientFeedbackRatingsByVendorIdClientFeedbacks.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbackRatingsByVendorIdData otherTyped = other as ListClientFeedbackRatingsByVendorIdData; + return clientFeedbacks == otherTyped.clientFeedbacks; + + } + @override + int get hashCode => clientFeedbacks.hashCode; + + + Map toJson() { + Map json = {}; + json['clientFeedbacks'] = clientFeedbacks.map((e) => e.toJson()).toList(); + return json; + } + + ListClientFeedbackRatingsByVendorIdData({ + required this.clientFeedbacks, + }); +} + +@immutable +class ListClientFeedbackRatingsByVendorIdVariables { + final String vendorId; + late final OptionaldateFrom; + late final OptionaldateTo; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListClientFeedbackRatingsByVendorIdVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']) { + + + + dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer); + dateFrom.value = json['dateFrom'] == null ? null : Timestamp.fromJson(json['dateFrom']); + + + dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer); + dateTo.value = json['dateTo'] == null ? null : Timestamp.fromJson(json['dateTo']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbackRatingsByVendorIdVariables otherTyped = other as ListClientFeedbackRatingsByVendorIdVariables; + return vendorId == otherTyped.vendorId && + dateFrom == otherTyped.dateFrom && + dateTo == otherTyped.dateTo; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, dateFrom.hashCode, dateTo.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + if(dateFrom.state == OptionalState.set) { + json['dateFrom'] = dateFrom.toJson(); + } + if(dateTo.state == OptionalState.set) { + json['dateTo'] = dateTo.toJson(); + } + return json; + } + + ListClientFeedbackRatingsByVendorIdVariables({ + required this.vendorId, + required this.dateFrom, + required this.dateTo, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedbacks.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedbacks.dart new file mode 100644 index 00000000..6d119685 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedbacks.dart @@ -0,0 +1,276 @@ +part of 'generated.dart'; + +class ListClientFeedbacksVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListClientFeedbacksVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListClientFeedbacksVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListClientFeedbacksVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListClientFeedbacksData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListClientFeedbacksVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListClientFeedbacksVariables vars= ListClientFeedbacksVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listClientFeedbacks", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListClientFeedbacksClientFeedbacks { + final String id; + final String businessId; + final String vendorId; + final int? rating; + final String? comment; + final Timestamp? date; + final Timestamp? createdAt; + final ListClientFeedbacksClientFeedbacksBusiness business; + final ListClientFeedbacksClientFeedbacksVendor vendor; + ListClientFeedbacksClientFeedbacks.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessId = nativeFromJson(json['businessId']), + vendorId = nativeFromJson(json['vendorId']), + rating = json['rating'] == null ? null : nativeFromJson(json['rating']), + comment = json['comment'] == null ? null : nativeFromJson(json['comment']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + business = ListClientFeedbacksClientFeedbacksBusiness.fromJson(json['business']), + vendor = ListClientFeedbacksClientFeedbacksVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksClientFeedbacks otherTyped = other as ListClientFeedbacksClientFeedbacks; + return id == otherTyped.id && + businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + rating == otherTyped.rating && + comment == otherTyped.comment && + date == otherTyped.date && + createdAt == otherTyped.createdAt && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessId.hashCode, vendorId.hashCode, rating.hashCode, comment.hashCode, date.hashCode, createdAt.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessId'] = nativeToJson(businessId); + json['vendorId'] = nativeToJson(vendorId); + if (rating != null) { + json['rating'] = nativeToJson(rating); + } + if (comment != null) { + json['comment'] = nativeToJson(comment); + } + if (date != null) { + json['date'] = date!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + return json; + } + + ListClientFeedbacksClientFeedbacks({ + required this.id, + required this.businessId, + required this.vendorId, + this.rating, + this.comment, + this.date, + this.createdAt, + required this.business, + required this.vendor, + }); +} + +@immutable +class ListClientFeedbacksClientFeedbacksBusiness { + final String id; + final String businessName; + ListClientFeedbacksClientFeedbacksBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksClientFeedbacksBusiness otherTyped = other as ListClientFeedbacksClientFeedbacksBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListClientFeedbacksClientFeedbacksBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListClientFeedbacksClientFeedbacksVendor { + final String id; + final String companyName; + ListClientFeedbacksClientFeedbacksVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksClientFeedbacksVendor otherTyped = other as ListClientFeedbacksClientFeedbacksVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListClientFeedbacksClientFeedbacksVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListClientFeedbacksData { + final List clientFeedbacks; + ListClientFeedbacksData.fromJson(dynamic json): + + clientFeedbacks = (json['clientFeedbacks'] as List) + .map((e) => ListClientFeedbacksClientFeedbacks.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksData otherTyped = other as ListClientFeedbacksData; + return clientFeedbacks == otherTyped.clientFeedbacks; + + } + @override + int get hashCode => clientFeedbacks.hashCode; + + + Map toJson() { + Map json = {}; + json['clientFeedbacks'] = clientFeedbacks.map((e) => e.toJson()).toList(); + return json; + } + + ListClientFeedbacksData({ + required this.clientFeedbacks, + }); +} + +@immutable +class ListClientFeedbacksVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListClientFeedbacksVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksVariables otherTyped = other as ListClientFeedbacksVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListClientFeedbacksVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedbacks_by_business_and_vendor.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedbacks_by_business_and_vendor.dart new file mode 100644 index 00000000..33e2a3c3 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedbacks_by_business_and_vendor.dart @@ -0,0 +1,290 @@ +part of 'generated.dart'; + +class ListClientFeedbacksByBusinessAndVendorVariablesBuilder { + String businessId; + String vendorId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListClientFeedbacksByBusinessAndVendorVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListClientFeedbacksByBusinessAndVendorVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListClientFeedbacksByBusinessAndVendorVariablesBuilder(this._dataConnect, {required this.businessId,required this.vendorId,}); + Deserializer dataDeserializer = (dynamic json) => ListClientFeedbacksByBusinessAndVendorData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListClientFeedbacksByBusinessAndVendorVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListClientFeedbacksByBusinessAndVendorVariables vars= ListClientFeedbacksByBusinessAndVendorVariables(businessId: businessId,vendorId: vendorId,offset: _offset,limit: _limit,); + return _dataConnect.query("listClientFeedbacksByBusinessAndVendor", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListClientFeedbacksByBusinessAndVendorClientFeedbacks { + final String id; + final String businessId; + final String vendorId; + final int? rating; + final String? comment; + final Timestamp? date; + final Timestamp? createdAt; + final ListClientFeedbacksByBusinessAndVendorClientFeedbacksBusiness business; + final ListClientFeedbacksByBusinessAndVendorClientFeedbacksVendor vendor; + ListClientFeedbacksByBusinessAndVendorClientFeedbacks.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessId = nativeFromJson(json['businessId']), + vendorId = nativeFromJson(json['vendorId']), + rating = json['rating'] == null ? null : nativeFromJson(json['rating']), + comment = json['comment'] == null ? null : nativeFromJson(json['comment']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + business = ListClientFeedbacksByBusinessAndVendorClientFeedbacksBusiness.fromJson(json['business']), + vendor = ListClientFeedbacksByBusinessAndVendorClientFeedbacksVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByBusinessAndVendorClientFeedbacks otherTyped = other as ListClientFeedbacksByBusinessAndVendorClientFeedbacks; + return id == otherTyped.id && + businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + rating == otherTyped.rating && + comment == otherTyped.comment && + date == otherTyped.date && + createdAt == otherTyped.createdAt && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessId.hashCode, vendorId.hashCode, rating.hashCode, comment.hashCode, date.hashCode, createdAt.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessId'] = nativeToJson(businessId); + json['vendorId'] = nativeToJson(vendorId); + if (rating != null) { + json['rating'] = nativeToJson(rating); + } + if (comment != null) { + json['comment'] = nativeToJson(comment); + } + if (date != null) { + json['date'] = date!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + return json; + } + + ListClientFeedbacksByBusinessAndVendorClientFeedbacks({ + required this.id, + required this.businessId, + required this.vendorId, + this.rating, + this.comment, + this.date, + this.createdAt, + required this.business, + required this.vendor, + }); +} + +@immutable +class ListClientFeedbacksByBusinessAndVendorClientFeedbacksBusiness { + final String id; + final String businessName; + ListClientFeedbacksByBusinessAndVendorClientFeedbacksBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByBusinessAndVendorClientFeedbacksBusiness otherTyped = other as ListClientFeedbacksByBusinessAndVendorClientFeedbacksBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListClientFeedbacksByBusinessAndVendorClientFeedbacksBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListClientFeedbacksByBusinessAndVendorClientFeedbacksVendor { + final String id; + final String companyName; + ListClientFeedbacksByBusinessAndVendorClientFeedbacksVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByBusinessAndVendorClientFeedbacksVendor otherTyped = other as ListClientFeedbacksByBusinessAndVendorClientFeedbacksVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListClientFeedbacksByBusinessAndVendorClientFeedbacksVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListClientFeedbacksByBusinessAndVendorData { + final List clientFeedbacks; + ListClientFeedbacksByBusinessAndVendorData.fromJson(dynamic json): + + clientFeedbacks = (json['clientFeedbacks'] as List) + .map((e) => ListClientFeedbacksByBusinessAndVendorClientFeedbacks.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByBusinessAndVendorData otherTyped = other as ListClientFeedbacksByBusinessAndVendorData; + return clientFeedbacks == otherTyped.clientFeedbacks; + + } + @override + int get hashCode => clientFeedbacks.hashCode; + + + Map toJson() { + Map json = {}; + json['clientFeedbacks'] = clientFeedbacks.map((e) => e.toJson()).toList(); + return json; + } + + ListClientFeedbacksByBusinessAndVendorData({ + required this.clientFeedbacks, + }); +} + +@immutable +class ListClientFeedbacksByBusinessAndVendorVariables { + final String businessId; + final String vendorId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListClientFeedbacksByBusinessAndVendorVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']), + vendorId = nativeFromJson(json['vendorId']) { + + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByBusinessAndVendorVariables otherTyped = other as ListClientFeedbacksByBusinessAndVendorVariables; + return businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, vendorId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + json['vendorId'] = nativeToJson(vendorId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListClientFeedbacksByBusinessAndVendorVariables({ + required this.businessId, + required this.vendorId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedbacks_by_business_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedbacks_by_business_id.dart new file mode 100644 index 00000000..7a2165d9 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedbacks_by_business_id.dart @@ -0,0 +1,283 @@ +part of 'generated.dart'; + +class ListClientFeedbacksByBusinessIdVariablesBuilder { + String businessId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListClientFeedbacksByBusinessIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListClientFeedbacksByBusinessIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListClientFeedbacksByBusinessIdVariablesBuilder(this._dataConnect, {required this.businessId,}); + Deserializer dataDeserializer = (dynamic json) => ListClientFeedbacksByBusinessIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListClientFeedbacksByBusinessIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListClientFeedbacksByBusinessIdVariables vars= ListClientFeedbacksByBusinessIdVariables(businessId: businessId,offset: _offset,limit: _limit,); + return _dataConnect.query("listClientFeedbacksByBusinessId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListClientFeedbacksByBusinessIdClientFeedbacks { + final String id; + final String businessId; + final String vendorId; + final int? rating; + final String? comment; + final Timestamp? date; + final Timestamp? createdAt; + final ListClientFeedbacksByBusinessIdClientFeedbacksBusiness business; + final ListClientFeedbacksByBusinessIdClientFeedbacksVendor vendor; + ListClientFeedbacksByBusinessIdClientFeedbacks.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessId = nativeFromJson(json['businessId']), + vendorId = nativeFromJson(json['vendorId']), + rating = json['rating'] == null ? null : nativeFromJson(json['rating']), + comment = json['comment'] == null ? null : nativeFromJson(json['comment']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + business = ListClientFeedbacksByBusinessIdClientFeedbacksBusiness.fromJson(json['business']), + vendor = ListClientFeedbacksByBusinessIdClientFeedbacksVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByBusinessIdClientFeedbacks otherTyped = other as ListClientFeedbacksByBusinessIdClientFeedbacks; + return id == otherTyped.id && + businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + rating == otherTyped.rating && + comment == otherTyped.comment && + date == otherTyped.date && + createdAt == otherTyped.createdAt && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessId.hashCode, vendorId.hashCode, rating.hashCode, comment.hashCode, date.hashCode, createdAt.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessId'] = nativeToJson(businessId); + json['vendorId'] = nativeToJson(vendorId); + if (rating != null) { + json['rating'] = nativeToJson(rating); + } + if (comment != null) { + json['comment'] = nativeToJson(comment); + } + if (date != null) { + json['date'] = date!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + return json; + } + + ListClientFeedbacksByBusinessIdClientFeedbacks({ + required this.id, + required this.businessId, + required this.vendorId, + this.rating, + this.comment, + this.date, + this.createdAt, + required this.business, + required this.vendor, + }); +} + +@immutable +class ListClientFeedbacksByBusinessIdClientFeedbacksBusiness { + final String id; + final String businessName; + ListClientFeedbacksByBusinessIdClientFeedbacksBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByBusinessIdClientFeedbacksBusiness otherTyped = other as ListClientFeedbacksByBusinessIdClientFeedbacksBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListClientFeedbacksByBusinessIdClientFeedbacksBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListClientFeedbacksByBusinessIdClientFeedbacksVendor { + final String id; + final String companyName; + ListClientFeedbacksByBusinessIdClientFeedbacksVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByBusinessIdClientFeedbacksVendor otherTyped = other as ListClientFeedbacksByBusinessIdClientFeedbacksVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListClientFeedbacksByBusinessIdClientFeedbacksVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListClientFeedbacksByBusinessIdData { + final List clientFeedbacks; + ListClientFeedbacksByBusinessIdData.fromJson(dynamic json): + + clientFeedbacks = (json['clientFeedbacks'] as List) + .map((e) => ListClientFeedbacksByBusinessIdClientFeedbacks.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByBusinessIdData otherTyped = other as ListClientFeedbacksByBusinessIdData; + return clientFeedbacks == otherTyped.clientFeedbacks; + + } + @override + int get hashCode => clientFeedbacks.hashCode; + + + Map toJson() { + Map json = {}; + json['clientFeedbacks'] = clientFeedbacks.map((e) => e.toJson()).toList(); + return json; + } + + ListClientFeedbacksByBusinessIdData({ + required this.clientFeedbacks, + }); +} + +@immutable +class ListClientFeedbacksByBusinessIdVariables { + final String businessId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListClientFeedbacksByBusinessIdVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByBusinessIdVariables otherTyped = other as ListClientFeedbacksByBusinessIdVariables; + return businessId == otherTyped.businessId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListClientFeedbacksByBusinessIdVariables({ + required this.businessId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedbacks_by_vendor_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedbacks_by_vendor_id.dart new file mode 100644 index 00000000..25eb54d6 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_client_feedbacks_by_vendor_id.dart @@ -0,0 +1,283 @@ +part of 'generated.dart'; + +class ListClientFeedbacksByVendorIdVariablesBuilder { + String vendorId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListClientFeedbacksByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListClientFeedbacksByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListClientFeedbacksByVendorIdVariablesBuilder(this._dataConnect, {required this.vendorId,}); + Deserializer dataDeserializer = (dynamic json) => ListClientFeedbacksByVendorIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListClientFeedbacksByVendorIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListClientFeedbacksByVendorIdVariables vars= ListClientFeedbacksByVendorIdVariables(vendorId: vendorId,offset: _offset,limit: _limit,); + return _dataConnect.query("listClientFeedbacksByVendorId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListClientFeedbacksByVendorIdClientFeedbacks { + final String id; + final String businessId; + final String vendorId; + final int? rating; + final String? comment; + final Timestamp? date; + final Timestamp? createdAt; + final ListClientFeedbacksByVendorIdClientFeedbacksBusiness business; + final ListClientFeedbacksByVendorIdClientFeedbacksVendor vendor; + ListClientFeedbacksByVendorIdClientFeedbacks.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessId = nativeFromJson(json['businessId']), + vendorId = nativeFromJson(json['vendorId']), + rating = json['rating'] == null ? null : nativeFromJson(json['rating']), + comment = json['comment'] == null ? null : nativeFromJson(json['comment']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + business = ListClientFeedbacksByVendorIdClientFeedbacksBusiness.fromJson(json['business']), + vendor = ListClientFeedbacksByVendorIdClientFeedbacksVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByVendorIdClientFeedbacks otherTyped = other as ListClientFeedbacksByVendorIdClientFeedbacks; + return id == otherTyped.id && + businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + rating == otherTyped.rating && + comment == otherTyped.comment && + date == otherTyped.date && + createdAt == otherTyped.createdAt && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessId.hashCode, vendorId.hashCode, rating.hashCode, comment.hashCode, date.hashCode, createdAt.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessId'] = nativeToJson(businessId); + json['vendorId'] = nativeToJson(vendorId); + if (rating != null) { + json['rating'] = nativeToJson(rating); + } + if (comment != null) { + json['comment'] = nativeToJson(comment); + } + if (date != null) { + json['date'] = date!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + return json; + } + + ListClientFeedbacksByVendorIdClientFeedbacks({ + required this.id, + required this.businessId, + required this.vendorId, + this.rating, + this.comment, + this.date, + this.createdAt, + required this.business, + required this.vendor, + }); +} + +@immutable +class ListClientFeedbacksByVendorIdClientFeedbacksBusiness { + final String id; + final String businessName; + ListClientFeedbacksByVendorIdClientFeedbacksBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByVendorIdClientFeedbacksBusiness otherTyped = other as ListClientFeedbacksByVendorIdClientFeedbacksBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListClientFeedbacksByVendorIdClientFeedbacksBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListClientFeedbacksByVendorIdClientFeedbacksVendor { + final String id; + final String companyName; + ListClientFeedbacksByVendorIdClientFeedbacksVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByVendorIdClientFeedbacksVendor otherTyped = other as ListClientFeedbacksByVendorIdClientFeedbacksVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListClientFeedbacksByVendorIdClientFeedbacksVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListClientFeedbacksByVendorIdData { + final List clientFeedbacks; + ListClientFeedbacksByVendorIdData.fromJson(dynamic json): + + clientFeedbacks = (json['clientFeedbacks'] as List) + .map((e) => ListClientFeedbacksByVendorIdClientFeedbacks.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByVendorIdData otherTyped = other as ListClientFeedbacksByVendorIdData; + return clientFeedbacks == otherTyped.clientFeedbacks; + + } + @override + int get hashCode => clientFeedbacks.hashCode; + + + Map toJson() { + Map json = {}; + json['clientFeedbacks'] = clientFeedbacks.map((e) => e.toJson()).toList(); + return json; + } + + ListClientFeedbacksByVendorIdData({ + required this.clientFeedbacks, + }); +} + +@immutable +class ListClientFeedbacksByVendorIdVariables { + final String vendorId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListClientFeedbacksByVendorIdVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListClientFeedbacksByVendorIdVariables otherTyped = other as ListClientFeedbacksByVendorIdVariables; + return vendorId == otherTyped.vendorId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListClientFeedbacksByVendorIdVariables({ + required this.vendorId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_conversations.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_conversations.dart new file mode 100644 index 00000000..0cb1336c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_conversations.dart @@ -0,0 +1,210 @@ +part of 'generated.dart'; + +class ListConversationsVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListConversationsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListConversationsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListConversationsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListConversationsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListConversationsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListConversationsVariables vars= ListConversationsVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listConversations", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListConversationsConversations { + final String id; + final String? subject; + final EnumValue? status; + final EnumValue? conversationType; + final bool? isGroup; + final String? groupName; + final String? lastMessage; + final Timestamp? lastMessageAt; + final Timestamp? createdAt; + ListConversationsConversations.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + subject = json['subject'] == null ? null : nativeFromJson(json['subject']), + status = json['status'] == null ? null : conversationStatusDeserializer(json['status']), + conversationType = json['conversationType'] == null ? null : conversationTypeDeserializer(json['conversationType']), + isGroup = json['isGroup'] == null ? null : nativeFromJson(json['isGroup']), + groupName = json['groupName'] == null ? null : nativeFromJson(json['groupName']), + lastMessage = json['lastMessage'] == null ? null : nativeFromJson(json['lastMessage']), + lastMessageAt = json['lastMessageAt'] == null ? null : Timestamp.fromJson(json['lastMessageAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListConversationsConversations otherTyped = other as ListConversationsConversations; + return id == otherTyped.id && + subject == otherTyped.subject && + status == otherTyped.status && + conversationType == otherTyped.conversationType && + isGroup == otherTyped.isGroup && + groupName == otherTyped.groupName && + lastMessage == otherTyped.lastMessage && + lastMessageAt == otherTyped.lastMessageAt && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, subject.hashCode, status.hashCode, conversationType.hashCode, isGroup.hashCode, groupName.hashCode, lastMessage.hashCode, lastMessageAt.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (subject != null) { + json['subject'] = nativeToJson(subject); + } + if (status != null) { + json['status'] = + conversationStatusSerializer(status!) + ; + } + if (conversationType != null) { + json['conversationType'] = + conversationTypeSerializer(conversationType!) + ; + } + if (isGroup != null) { + json['isGroup'] = nativeToJson(isGroup); + } + if (groupName != null) { + json['groupName'] = nativeToJson(groupName); + } + if (lastMessage != null) { + json['lastMessage'] = nativeToJson(lastMessage); + } + if (lastMessageAt != null) { + json['lastMessageAt'] = lastMessageAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + ListConversationsConversations({ + required this.id, + this.subject, + this.status, + this.conversationType, + this.isGroup, + this.groupName, + this.lastMessage, + this.lastMessageAt, + this.createdAt, + }); +} + +@immutable +class ListConversationsData { + final List conversations; + ListConversationsData.fromJson(dynamic json): + + conversations = (json['conversations'] as List) + .map((e) => ListConversationsConversations.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListConversationsData otherTyped = other as ListConversationsData; + return conversations == otherTyped.conversations; + + } + @override + int get hashCode => conversations.hashCode; + + + Map toJson() { + Map json = {}; + json['conversations'] = conversations.map((e) => e.toJson()).toList(); + return json; + } + + ListConversationsData({ + required this.conversations, + }); +} + +@immutable +class ListConversationsVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListConversationsVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListConversationsVariables otherTyped = other as ListConversationsVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListConversationsVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_conversations_by_status.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_conversations_by_status.dart new file mode 100644 index 00000000..9ee20ec4 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_conversations_by_status.dart @@ -0,0 +1,219 @@ +part of 'generated.dart'; + +class ListConversationsByStatusVariablesBuilder { + ConversationStatus status; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListConversationsByStatusVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListConversationsByStatusVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListConversationsByStatusVariablesBuilder(this._dataConnect, {required this.status,}); + Deserializer dataDeserializer = (dynamic json) => ListConversationsByStatusData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListConversationsByStatusVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListConversationsByStatusVariables vars= ListConversationsByStatusVariables(status: status,offset: _offset,limit: _limit,); + return _dataConnect.query("listConversationsByStatus", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListConversationsByStatusConversations { + final String id; + final String? subject; + final EnumValue? status; + final EnumValue? conversationType; + final bool? isGroup; + final String? groupName; + final String? lastMessage; + final Timestamp? lastMessageAt; + final Timestamp? createdAt; + ListConversationsByStatusConversations.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + subject = json['subject'] == null ? null : nativeFromJson(json['subject']), + status = json['status'] == null ? null : conversationStatusDeserializer(json['status']), + conversationType = json['conversationType'] == null ? null : conversationTypeDeserializer(json['conversationType']), + isGroup = json['isGroup'] == null ? null : nativeFromJson(json['isGroup']), + groupName = json['groupName'] == null ? null : nativeFromJson(json['groupName']), + lastMessage = json['lastMessage'] == null ? null : nativeFromJson(json['lastMessage']), + lastMessageAt = json['lastMessageAt'] == null ? null : Timestamp.fromJson(json['lastMessageAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListConversationsByStatusConversations otherTyped = other as ListConversationsByStatusConversations; + return id == otherTyped.id && + subject == otherTyped.subject && + status == otherTyped.status && + conversationType == otherTyped.conversationType && + isGroup == otherTyped.isGroup && + groupName == otherTyped.groupName && + lastMessage == otherTyped.lastMessage && + lastMessageAt == otherTyped.lastMessageAt && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, subject.hashCode, status.hashCode, conversationType.hashCode, isGroup.hashCode, groupName.hashCode, lastMessage.hashCode, lastMessageAt.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (subject != null) { + json['subject'] = nativeToJson(subject); + } + if (status != null) { + json['status'] = + conversationStatusSerializer(status!) + ; + } + if (conversationType != null) { + json['conversationType'] = + conversationTypeSerializer(conversationType!) + ; + } + if (isGroup != null) { + json['isGroup'] = nativeToJson(isGroup); + } + if (groupName != null) { + json['groupName'] = nativeToJson(groupName); + } + if (lastMessage != null) { + json['lastMessage'] = nativeToJson(lastMessage); + } + if (lastMessageAt != null) { + json['lastMessageAt'] = lastMessageAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + ListConversationsByStatusConversations({ + required this.id, + this.subject, + this.status, + this.conversationType, + this.isGroup, + this.groupName, + this.lastMessage, + this.lastMessageAt, + this.createdAt, + }); +} + +@immutable +class ListConversationsByStatusData { + final List conversations; + ListConversationsByStatusData.fromJson(dynamic json): + + conversations = (json['conversations'] as List) + .map((e) => ListConversationsByStatusConversations.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListConversationsByStatusData otherTyped = other as ListConversationsByStatusData; + return conversations == otherTyped.conversations; + + } + @override + int get hashCode => conversations.hashCode; + + + Map toJson() { + Map json = {}; + json['conversations'] = conversations.map((e) => e.toJson()).toList(); + return json; + } + + ListConversationsByStatusData({ + required this.conversations, + }); +} + +@immutable +class ListConversationsByStatusVariables { + final ConversationStatus status; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListConversationsByStatusVariables.fromJson(Map json): + + status = ConversationStatus.values.byName(json['status']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListConversationsByStatusVariables otherTyped = other as ListConversationsByStatusVariables; + return status == otherTyped.status && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([status.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['status'] = + status.name + ; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListConversationsByStatusVariables({ + required this.status, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_conversations_by_type.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_conversations_by_type.dart new file mode 100644 index 00000000..8ffb4682 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_conversations_by_type.dart @@ -0,0 +1,219 @@ +part of 'generated.dart'; + +class ListConversationsByTypeVariablesBuilder { + ConversationType conversationType; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListConversationsByTypeVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListConversationsByTypeVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListConversationsByTypeVariablesBuilder(this._dataConnect, {required this.conversationType,}); + Deserializer dataDeserializer = (dynamic json) => ListConversationsByTypeData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListConversationsByTypeVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListConversationsByTypeVariables vars= ListConversationsByTypeVariables(conversationType: conversationType,offset: _offset,limit: _limit,); + return _dataConnect.query("listConversationsByType", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListConversationsByTypeConversations { + final String id; + final String? subject; + final EnumValue? status; + final EnumValue? conversationType; + final bool? isGroup; + final String? groupName; + final String? lastMessage; + final Timestamp? lastMessageAt; + final Timestamp? createdAt; + ListConversationsByTypeConversations.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + subject = json['subject'] == null ? null : nativeFromJson(json['subject']), + status = json['status'] == null ? null : conversationStatusDeserializer(json['status']), + conversationType = json['conversationType'] == null ? null : conversationTypeDeserializer(json['conversationType']), + isGroup = json['isGroup'] == null ? null : nativeFromJson(json['isGroup']), + groupName = json['groupName'] == null ? null : nativeFromJson(json['groupName']), + lastMessage = json['lastMessage'] == null ? null : nativeFromJson(json['lastMessage']), + lastMessageAt = json['lastMessageAt'] == null ? null : Timestamp.fromJson(json['lastMessageAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListConversationsByTypeConversations otherTyped = other as ListConversationsByTypeConversations; + return id == otherTyped.id && + subject == otherTyped.subject && + status == otherTyped.status && + conversationType == otherTyped.conversationType && + isGroup == otherTyped.isGroup && + groupName == otherTyped.groupName && + lastMessage == otherTyped.lastMessage && + lastMessageAt == otherTyped.lastMessageAt && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, subject.hashCode, status.hashCode, conversationType.hashCode, isGroup.hashCode, groupName.hashCode, lastMessage.hashCode, lastMessageAt.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (subject != null) { + json['subject'] = nativeToJson(subject); + } + if (status != null) { + json['status'] = + conversationStatusSerializer(status!) + ; + } + if (conversationType != null) { + json['conversationType'] = + conversationTypeSerializer(conversationType!) + ; + } + if (isGroup != null) { + json['isGroup'] = nativeToJson(isGroup); + } + if (groupName != null) { + json['groupName'] = nativeToJson(groupName); + } + if (lastMessage != null) { + json['lastMessage'] = nativeToJson(lastMessage); + } + if (lastMessageAt != null) { + json['lastMessageAt'] = lastMessageAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + ListConversationsByTypeConversations({ + required this.id, + this.subject, + this.status, + this.conversationType, + this.isGroup, + this.groupName, + this.lastMessage, + this.lastMessageAt, + this.createdAt, + }); +} + +@immutable +class ListConversationsByTypeData { + final List conversations; + ListConversationsByTypeData.fromJson(dynamic json): + + conversations = (json['conversations'] as List) + .map((e) => ListConversationsByTypeConversations.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListConversationsByTypeData otherTyped = other as ListConversationsByTypeData; + return conversations == otherTyped.conversations; + + } + @override + int get hashCode => conversations.hashCode; + + + Map toJson() { + Map json = {}; + json['conversations'] = conversations.map((e) => e.toJson()).toList(); + return json; + } + + ListConversationsByTypeData({ + required this.conversations, + }); +} + +@immutable +class ListConversationsByTypeVariables { + final ConversationType conversationType; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListConversationsByTypeVariables.fromJson(Map json): + + conversationType = ConversationType.values.byName(json['conversationType']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListConversationsByTypeVariables otherTyped = other as ListConversationsByTypeVariables; + return conversationType == otherTyped.conversationType && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([conversationType.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['conversationType'] = + conversationType.name + ; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListConversationsByTypeVariables({ + required this.conversationType, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_courses.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_courses.dart new file mode 100644 index 00000000..ddf27479 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_courses.dart @@ -0,0 +1,193 @@ +part of 'generated.dart'; + +class ListCoursesVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListCoursesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListCoursesData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listCourses", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListCoursesCourses { + final String id; + final String? title; + final String? description; + final String? thumbnailUrl; + final int? durationMinutes; + final int? xpReward; + final String categoryId; + final String? levelRequired; + final bool? isCertification; + final Timestamp? createdAt; + final ListCoursesCoursesCategory category; + ListCoursesCourses.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = json['title'] == null ? null : nativeFromJson(json['title']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + thumbnailUrl = json['thumbnailUrl'] == null ? null : nativeFromJson(json['thumbnailUrl']), + durationMinutes = json['durationMinutes'] == null ? null : nativeFromJson(json['durationMinutes']), + xpReward = json['xpReward'] == null ? null : nativeFromJson(json['xpReward']), + categoryId = nativeFromJson(json['categoryId']), + levelRequired = json['levelRequired'] == null ? null : nativeFromJson(json['levelRequired']), + isCertification = json['isCertification'] == null ? null : nativeFromJson(json['isCertification']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + category = ListCoursesCoursesCategory.fromJson(json['category']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListCoursesCourses otherTyped = other as ListCoursesCourses; + return id == otherTyped.id && + title == otherTyped.title && + description == otherTyped.description && + thumbnailUrl == otherTyped.thumbnailUrl && + durationMinutes == otherTyped.durationMinutes && + xpReward == otherTyped.xpReward && + categoryId == otherTyped.categoryId && + levelRequired == otherTyped.levelRequired && + isCertification == otherTyped.isCertification && + createdAt == otherTyped.createdAt && + category == otherTyped.category; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, description.hashCode, thumbnailUrl.hashCode, durationMinutes.hashCode, xpReward.hashCode, categoryId.hashCode, levelRequired.hashCode, isCertification.hashCode, createdAt.hashCode, category.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (title != null) { + json['title'] = nativeToJson(title); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + if (thumbnailUrl != null) { + json['thumbnailUrl'] = nativeToJson(thumbnailUrl); + } + if (durationMinutes != null) { + json['durationMinutes'] = nativeToJson(durationMinutes); + } + if (xpReward != null) { + json['xpReward'] = nativeToJson(xpReward); + } + json['categoryId'] = nativeToJson(categoryId); + if (levelRequired != null) { + json['levelRequired'] = nativeToJson(levelRequired); + } + if (isCertification != null) { + json['isCertification'] = nativeToJson(isCertification); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['category'] = category.toJson(); + return json; + } + + ListCoursesCourses({ + required this.id, + this.title, + this.description, + this.thumbnailUrl, + this.durationMinutes, + this.xpReward, + required this.categoryId, + this.levelRequired, + this.isCertification, + this.createdAt, + required this.category, + }); +} + +@immutable +class ListCoursesCoursesCategory { + final String id; + final String label; + ListCoursesCoursesCategory.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + label = nativeFromJson(json['label']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListCoursesCoursesCategory otherTyped = other as ListCoursesCoursesCategory; + return id == otherTyped.id && + label == otherTyped.label; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, label.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['label'] = nativeToJson(label); + return json; + } + + ListCoursesCoursesCategory({ + required this.id, + required this.label, + }); +} + +@immutable +class ListCoursesData { + final List courses; + ListCoursesData.fromJson(dynamic json): + + courses = (json['courses'] as List) + .map((e) => ListCoursesCourses.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListCoursesData otherTyped = other as ListCoursesData; + return courses == otherTyped.courses; + + } + @override + int get hashCode => courses.hashCode; + + + Map toJson() { + Map json = {}; + json['courses'] = courses.map((e) => e.toJson()).toList(); + return json; + } + + ListCoursesData({ + required this.courses, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_custom_rate_cards.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_custom_rate_cards.dart new file mode 100644 index 00000000..e5dcbc90 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_custom_rate_cards.dart @@ -0,0 +1,128 @@ +part of 'generated.dart'; + +class ListCustomRateCardsVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListCustomRateCardsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListCustomRateCardsData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listCustomRateCards", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListCustomRateCardsCustomRateCards { + final String id; + final String name; + final String? baseBook; + final double? discount; + final bool? isDefault; + final Timestamp? createdAt; + final Timestamp? updatedAt; + ListCustomRateCardsCustomRateCards.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + baseBook = json['baseBook'] == null ? null : nativeFromJson(json['baseBook']), + discount = json['discount'] == null ? null : nativeFromJson(json['discount']), + isDefault = json['isDefault'] == null ? null : nativeFromJson(json['isDefault']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListCustomRateCardsCustomRateCards otherTyped = other as ListCustomRateCardsCustomRateCards; + return id == otherTyped.id && + name == otherTyped.name && + baseBook == otherTyped.baseBook && + discount == otherTyped.discount && + isDefault == otherTyped.isDefault && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, baseBook.hashCode, discount.hashCode, isDefault.hashCode, createdAt.hashCode, updatedAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + if (baseBook != null) { + json['baseBook'] = nativeToJson(baseBook); + } + if (discount != null) { + json['discount'] = nativeToJson(discount); + } + if (isDefault != null) { + json['isDefault'] = nativeToJson(isDefault); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + return json; + } + + ListCustomRateCardsCustomRateCards({ + required this.id, + required this.name, + this.baseBook, + this.discount, + this.isDefault, + this.createdAt, + this.updatedAt, + }); +} + +@immutable +class ListCustomRateCardsData { + final List customRateCards; + ListCustomRateCardsData.fromJson(dynamic json): + + customRateCards = (json['customRateCards'] as List) + .map((e) => ListCustomRateCardsCustomRateCards.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListCustomRateCardsData otherTyped = other as ListCustomRateCardsData; + return customRateCards == otherTyped.customRateCards; + + } + @override + int get hashCode => customRateCards.hashCode; + + + Map toJson() { + Map json = {}; + json['customRateCards'] = customRateCards.map((e) => e.toJson()).toList(); + return json; + } + + ListCustomRateCardsData({ + required this.customRateCards, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_documents.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_documents.dart new file mode 100644 index 00000000..8960c342 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_documents.dart @@ -0,0 +1,114 @@ +part of 'generated.dart'; + +class ListDocumentsVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListDocumentsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListDocumentsData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listDocuments", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListDocumentsDocuments { + final String id; + final EnumValue documentType; + final String name; + final String? description; + final Timestamp? createdAt; + ListDocumentsDocuments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + documentType = documentTypeDeserializer(json['documentType']), + name = nativeFromJson(json['name']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListDocumentsDocuments otherTyped = other as ListDocumentsDocuments; + return id == otherTyped.id && + documentType == otherTyped.documentType && + name == otherTyped.name && + description == otherTyped.description && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, documentType.hashCode, name.hashCode, description.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['documentType'] = + documentTypeSerializer(documentType) + ; + json['name'] = nativeToJson(name); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + ListDocumentsDocuments({ + required this.id, + required this.documentType, + required this.name, + this.description, + this.createdAt, + }); +} + +@immutable +class ListDocumentsData { + final List documents; + ListDocumentsData.fromJson(dynamic json): + + documents = (json['documents'] as List) + .map((e) => ListDocumentsDocuments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListDocumentsData otherTyped = other as ListDocumentsData; + return documents == otherTyped.documents; + + } + @override + int get hashCode => documents.hashCode; + + + Map toJson() { + Map json = {}; + json['documents'] = documents.map((e) => e.toJson()).toList(); + return json; + } + + ListDocumentsData({ + required this.documents, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_emergency_contacts.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_emergency_contacts.dart new file mode 100644 index 00000000..ea448d2b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_emergency_contacts.dart @@ -0,0 +1,131 @@ +part of 'generated.dart'; + +class ListEmergencyContactsVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListEmergencyContactsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListEmergencyContactsData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listEmergencyContacts", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListEmergencyContactsEmergencyContacts { + final String id; + final String name; + final String phone; + final EnumValue relationship; + final String staffId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + ListEmergencyContactsEmergencyContacts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + phone = nativeFromJson(json['phone']), + relationship = relationshipTypeDeserializer(json['relationship']), + staffId = nativeFromJson(json['staffId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListEmergencyContactsEmergencyContacts otherTyped = other as ListEmergencyContactsEmergencyContacts; + return id == otherTyped.id && + name == otherTyped.name && + phone == otherTyped.phone && + relationship == otherTyped.relationship && + staffId == otherTyped.staffId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, phone.hashCode, relationship.hashCode, staffId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['phone'] = nativeToJson(phone); + json['relationship'] = + relationshipTypeSerializer(relationship) + ; + json['staffId'] = nativeToJson(staffId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + ListEmergencyContactsEmergencyContacts({ + required this.id, + required this.name, + required this.phone, + required this.relationship, + required this.staffId, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class ListEmergencyContactsData { + final List emergencyContacts; + ListEmergencyContactsData.fromJson(dynamic json): + + emergencyContacts = (json['emergencyContacts'] as List) + .map((e) => ListEmergencyContactsEmergencyContacts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListEmergencyContactsData otherTyped = other as ListEmergencyContactsData; + return emergencyContacts == otherTyped.emergencyContacts; + + } + @override + int get hashCode => emergencyContacts.hashCode; + + + Map toJson() { + Map json = {}; + json['emergencyContacts'] = emergencyContacts.map((e) => e.toJson()).toList(); + return json; + } + + ListEmergencyContactsData({ + required this.emergencyContacts, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_faq_datas.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_faq_datas.dart new file mode 100644 index 00000000..3c4366d7 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_faq_datas.dart @@ -0,0 +1,123 @@ +part of 'generated.dart'; + +class ListFaqDatasVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListFaqDatasVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListFaqDatasData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listFaqDatas", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListFaqDatasFaqDatas { + final String id; + final String category; + final List? questions; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + ListFaqDatasFaqDatas.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + category = nativeFromJson(json['category']), + questions = json['questions'] == null ? null : (json['questions'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListFaqDatasFaqDatas otherTyped = other as ListFaqDatasFaqDatas; + return id == otherTyped.id && + category == otherTyped.category && + questions == otherTyped.questions && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, category.hashCode, questions.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['category'] = nativeToJson(category); + if (questions != null) { + json['questions'] = questions?.map((e) => e!.toJson()).toList(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + ListFaqDatasFaqDatas({ + required this.id, + required this.category, + this.questions, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class ListFaqDatasData { + final List faqDatas; + ListFaqDatasData.fromJson(dynamic json): + + faqDatas = (json['faqDatas'] as List) + .map((e) => ListFaqDatasFaqDatas.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListFaqDatasData otherTyped = other as ListFaqDatasData; + return faqDatas == otherTyped.faqDatas; + + } + @override + int get hashCode => faqDatas.hashCode; + + + Map toJson() { + Map json = {}; + json['faqDatas'] = faqDatas.map((e) => e.toJson()).toList(); + return json; + } + + ListFaqDatasData({ + required this.faqDatas, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_hubs.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_hubs.dart new file mode 100644 index 00000000..e8b694f7 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_hubs.dart @@ -0,0 +1,140 @@ +part of 'generated.dart'; + +class ListHubsVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListHubsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListHubsData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listHubs", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListHubsHubs { + final String id; + final String name; + final String? locationName; + final String? address; + final String? nfcTagId; + final String ownerId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + ListHubsHubs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + locationName = json['locationName'] == null ? null : nativeFromJson(json['locationName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + nfcTagId = json['nfcTagId'] == null ? null : nativeFromJson(json['nfcTagId']), + ownerId = nativeFromJson(json['ownerId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListHubsHubs otherTyped = other as ListHubsHubs; + return id == otherTyped.id && + name == otherTyped.name && + locationName == otherTyped.locationName && + address == otherTyped.address && + nfcTagId == otherTyped.nfcTagId && + ownerId == otherTyped.ownerId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, locationName.hashCode, address.hashCode, nfcTagId.hashCode, ownerId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + if (locationName != null) { + json['locationName'] = nativeToJson(locationName); + } + if (address != null) { + json['address'] = nativeToJson(address); + } + if (nfcTagId != null) { + json['nfcTagId'] = nativeToJson(nfcTagId); + } + json['ownerId'] = nativeToJson(ownerId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + ListHubsHubs({ + required this.id, + required this.name, + this.locationName, + this.address, + this.nfcTagId, + required this.ownerId, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class ListHubsData { + final List hubs; + ListHubsData.fromJson(dynamic json): + + hubs = (json['hubs'] as List) + .map((e) => ListHubsHubs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListHubsData otherTyped = other as ListHubsData; + return hubs == otherTyped.hubs; + + } + @override + int get hashCode => hubs.hashCode; + + + Map toJson() { + Map json = {}; + json['hubs'] = hubs.map((e) => e.toJson()).toList(); + return json; + } + + ListHubsData({ + required this.hubs, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates.dart new file mode 100644 index 00000000..a532cfa7 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates.dart @@ -0,0 +1,477 @@ +part of 'generated.dart'; + +class ListInvoiceTemplatesVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListInvoiceTemplatesVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoiceTemplatesVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListInvoiceTemplatesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListInvoiceTemplatesData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListInvoiceTemplatesVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListInvoiceTemplatesVariables vars= ListInvoiceTemplatesVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listInvoiceTemplates", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListInvoiceTemplatesInvoiceTemplates { + final String id; + final String name; + final String ownerId; + final String? vendorId; + final String? businessId; + final String? orderId; + final EnumValue? paymentTerms; + final String? invoiceNumber; + final Timestamp? issueDate; + final Timestamp? dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double? amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListInvoiceTemplatesInvoiceTemplatesVendor? vendor; + final ListInvoiceTemplatesInvoiceTemplatesBusiness? business; + final ListInvoiceTemplatesInvoiceTemplatesOrder? order; + ListInvoiceTemplatesInvoiceTemplates.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + ownerId = nativeFromJson(json['ownerId']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = json['businessId'] == null ? null : nativeFromJson(json['businessId']), + orderId = json['orderId'] == null ? null : nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsTempDeserializer(json['paymentTerms']), + invoiceNumber = json['invoiceNumber'] == null ? null : nativeFromJson(json['invoiceNumber']), + issueDate = json['issueDate'] == null ? null : Timestamp.fromJson(json['issueDate']), + dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = json['amount'] == null ? null : nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + vendor = json['vendor'] == null ? null : ListInvoiceTemplatesInvoiceTemplatesVendor.fromJson(json['vendor']), + business = json['business'] == null ? null : ListInvoiceTemplatesInvoiceTemplatesBusiness.fromJson(json['business']), + order = json['order'] == null ? null : ListInvoiceTemplatesInvoiceTemplatesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesInvoiceTemplates otherTyped = other as ListInvoiceTemplatesInvoiceTemplates; + return id == otherTyped.id && + name == otherTyped.name && + ownerId == otherTyped.ownerId && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, ownerId.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['ownerId'] = nativeToJson(ownerId); + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + if (businessId != null) { + json['businessId'] = nativeToJson(businessId); + } + if (orderId != null) { + json['orderId'] = nativeToJson(orderId); + } + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsTempSerializer(paymentTerms!) + ; + } + if (invoiceNumber != null) { + json['invoiceNumber'] = nativeToJson(invoiceNumber); + } + if (issueDate != null) { + json['issueDate'] = issueDate!.toJson(); + } + if (dueDate != null) { + json['dueDate'] = dueDate!.toJson(); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + if (amount != null) { + json['amount'] = nativeToJson(amount); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + if (business != null) { + json['business'] = business!.toJson(); + } + if (order != null) { + json['order'] = order!.toJson(); + } + return json; + } + + ListInvoiceTemplatesInvoiceTemplates({ + required this.id, + required this.name, + required this.ownerId, + this.vendorId, + this.businessId, + this.orderId, + this.paymentTerms, + this.invoiceNumber, + this.issueDate, + this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.createdAt, + this.updatedAt, + this.createdBy, + this.vendor, + this.business, + this.order, + }); +} + +@immutable +class ListInvoiceTemplatesInvoiceTemplatesVendor { + final String id; + final String companyName; + ListInvoiceTemplatesInvoiceTemplatesVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesInvoiceTemplatesVendor otherTyped = other as ListInvoiceTemplatesInvoiceTemplatesVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListInvoiceTemplatesInvoiceTemplatesVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListInvoiceTemplatesInvoiceTemplatesBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + ListInvoiceTemplatesInvoiceTemplatesBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesInvoiceTemplatesBusiness otherTyped = other as ListInvoiceTemplatesInvoiceTemplatesBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + ListInvoiceTemplatesInvoiceTemplatesBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class ListInvoiceTemplatesInvoiceTemplatesOrder { + final String id; + final String? eventName; + final EnumValue status; + final EnumValue orderType; + ListInvoiceTemplatesInvoiceTemplatesOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + status = orderStatusDeserializer(json['status']), + orderType = orderTypeDeserializer(json['orderType']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesInvoiceTemplatesOrder otherTyped = other as ListInvoiceTemplatesInvoiceTemplatesOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + status == otherTyped.status && + orderType == otherTyped.orderType; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, status.hashCode, orderType.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['status'] = + orderStatusSerializer(status) + ; + json['orderType'] = + orderTypeSerializer(orderType) + ; + return json; + } + + ListInvoiceTemplatesInvoiceTemplatesOrder({ + required this.id, + this.eventName, + required this.status, + required this.orderType, + }); +} + +@immutable +class ListInvoiceTemplatesData { + final List invoiceTemplates; + ListInvoiceTemplatesData.fromJson(dynamic json): + + invoiceTemplates = (json['invoiceTemplates'] as List) + .map((e) => ListInvoiceTemplatesInvoiceTemplates.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesData otherTyped = other as ListInvoiceTemplatesData; + return invoiceTemplates == otherTyped.invoiceTemplates; + + } + @override + int get hashCode => invoiceTemplates.hashCode; + + + Map toJson() { + Map json = {}; + json['invoiceTemplates'] = invoiceTemplates.map((e) => e.toJson()).toList(); + return json; + } + + ListInvoiceTemplatesData({ + required this.invoiceTemplates, + }); +} + +@immutable +class ListInvoiceTemplatesVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListInvoiceTemplatesVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesVariables otherTyped = other as ListInvoiceTemplatesVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListInvoiceTemplatesVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates_by_business_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates_by_business_id.dart new file mode 100644 index 00000000..00c92572 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates_by_business_id.dart @@ -0,0 +1,484 @@ +part of 'generated.dart'; + +class ListInvoiceTemplatesByBusinessIdVariablesBuilder { + String businessId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListInvoiceTemplatesByBusinessIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoiceTemplatesByBusinessIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListInvoiceTemplatesByBusinessIdVariablesBuilder(this._dataConnect, {required this.businessId,}); + Deserializer dataDeserializer = (dynamic json) => ListInvoiceTemplatesByBusinessIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListInvoiceTemplatesByBusinessIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListInvoiceTemplatesByBusinessIdVariables vars= ListInvoiceTemplatesByBusinessIdVariables(businessId: businessId,offset: _offset,limit: _limit,); + return _dataConnect.query("listInvoiceTemplatesByBusinessId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListInvoiceTemplatesByBusinessIdInvoiceTemplates { + final String id; + final String name; + final String ownerId; + final String? vendorId; + final String? businessId; + final String? orderId; + final EnumValue? paymentTerms; + final String? invoiceNumber; + final Timestamp? issueDate; + final Timestamp? dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double? amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListInvoiceTemplatesByBusinessIdInvoiceTemplatesVendor? vendor; + final ListInvoiceTemplatesByBusinessIdInvoiceTemplatesBusiness? business; + final ListInvoiceTemplatesByBusinessIdInvoiceTemplatesOrder? order; + ListInvoiceTemplatesByBusinessIdInvoiceTemplates.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + ownerId = nativeFromJson(json['ownerId']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = json['businessId'] == null ? null : nativeFromJson(json['businessId']), + orderId = json['orderId'] == null ? null : nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsTempDeserializer(json['paymentTerms']), + invoiceNumber = json['invoiceNumber'] == null ? null : nativeFromJson(json['invoiceNumber']), + issueDate = json['issueDate'] == null ? null : Timestamp.fromJson(json['issueDate']), + dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = json['amount'] == null ? null : nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + vendor = json['vendor'] == null ? null : ListInvoiceTemplatesByBusinessIdInvoiceTemplatesVendor.fromJson(json['vendor']), + business = json['business'] == null ? null : ListInvoiceTemplatesByBusinessIdInvoiceTemplatesBusiness.fromJson(json['business']), + order = json['order'] == null ? null : ListInvoiceTemplatesByBusinessIdInvoiceTemplatesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByBusinessIdInvoiceTemplates otherTyped = other as ListInvoiceTemplatesByBusinessIdInvoiceTemplates; + return id == otherTyped.id && + name == otherTyped.name && + ownerId == otherTyped.ownerId && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, ownerId.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['ownerId'] = nativeToJson(ownerId); + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + if (businessId != null) { + json['businessId'] = nativeToJson(businessId); + } + if (orderId != null) { + json['orderId'] = nativeToJson(orderId); + } + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsTempSerializer(paymentTerms!) + ; + } + if (invoiceNumber != null) { + json['invoiceNumber'] = nativeToJson(invoiceNumber); + } + if (issueDate != null) { + json['issueDate'] = issueDate!.toJson(); + } + if (dueDate != null) { + json['dueDate'] = dueDate!.toJson(); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + if (amount != null) { + json['amount'] = nativeToJson(amount); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + if (business != null) { + json['business'] = business!.toJson(); + } + if (order != null) { + json['order'] = order!.toJson(); + } + return json; + } + + ListInvoiceTemplatesByBusinessIdInvoiceTemplates({ + required this.id, + required this.name, + required this.ownerId, + this.vendorId, + this.businessId, + this.orderId, + this.paymentTerms, + this.invoiceNumber, + this.issueDate, + this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.createdAt, + this.updatedAt, + this.createdBy, + this.vendor, + this.business, + this.order, + }); +} + +@immutable +class ListInvoiceTemplatesByBusinessIdInvoiceTemplatesVendor { + final String id; + final String companyName; + ListInvoiceTemplatesByBusinessIdInvoiceTemplatesVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByBusinessIdInvoiceTemplatesVendor otherTyped = other as ListInvoiceTemplatesByBusinessIdInvoiceTemplatesVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListInvoiceTemplatesByBusinessIdInvoiceTemplatesVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListInvoiceTemplatesByBusinessIdInvoiceTemplatesBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + ListInvoiceTemplatesByBusinessIdInvoiceTemplatesBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByBusinessIdInvoiceTemplatesBusiness otherTyped = other as ListInvoiceTemplatesByBusinessIdInvoiceTemplatesBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + ListInvoiceTemplatesByBusinessIdInvoiceTemplatesBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class ListInvoiceTemplatesByBusinessIdInvoiceTemplatesOrder { + final String id; + final String? eventName; + final EnumValue status; + final EnumValue orderType; + ListInvoiceTemplatesByBusinessIdInvoiceTemplatesOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + status = orderStatusDeserializer(json['status']), + orderType = orderTypeDeserializer(json['orderType']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByBusinessIdInvoiceTemplatesOrder otherTyped = other as ListInvoiceTemplatesByBusinessIdInvoiceTemplatesOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + status == otherTyped.status && + orderType == otherTyped.orderType; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, status.hashCode, orderType.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['status'] = + orderStatusSerializer(status) + ; + json['orderType'] = + orderTypeSerializer(orderType) + ; + return json; + } + + ListInvoiceTemplatesByBusinessIdInvoiceTemplatesOrder({ + required this.id, + this.eventName, + required this.status, + required this.orderType, + }); +} + +@immutable +class ListInvoiceTemplatesByBusinessIdData { + final List invoiceTemplates; + ListInvoiceTemplatesByBusinessIdData.fromJson(dynamic json): + + invoiceTemplates = (json['invoiceTemplates'] as List) + .map((e) => ListInvoiceTemplatesByBusinessIdInvoiceTemplates.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByBusinessIdData otherTyped = other as ListInvoiceTemplatesByBusinessIdData; + return invoiceTemplates == otherTyped.invoiceTemplates; + + } + @override + int get hashCode => invoiceTemplates.hashCode; + + + Map toJson() { + Map json = {}; + json['invoiceTemplates'] = invoiceTemplates.map((e) => e.toJson()).toList(); + return json; + } + + ListInvoiceTemplatesByBusinessIdData({ + required this.invoiceTemplates, + }); +} + +@immutable +class ListInvoiceTemplatesByBusinessIdVariables { + final String businessId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListInvoiceTemplatesByBusinessIdVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByBusinessIdVariables otherTyped = other as ListInvoiceTemplatesByBusinessIdVariables; + return businessId == otherTyped.businessId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListInvoiceTemplatesByBusinessIdVariables({ + required this.businessId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates_by_order_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates_by_order_id.dart new file mode 100644 index 00000000..c8538655 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates_by_order_id.dart @@ -0,0 +1,484 @@ +part of 'generated.dart'; + +class ListInvoiceTemplatesByOrderIdVariablesBuilder { + String orderId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListInvoiceTemplatesByOrderIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoiceTemplatesByOrderIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListInvoiceTemplatesByOrderIdVariablesBuilder(this._dataConnect, {required this.orderId,}); + Deserializer dataDeserializer = (dynamic json) => ListInvoiceTemplatesByOrderIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListInvoiceTemplatesByOrderIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListInvoiceTemplatesByOrderIdVariables vars= ListInvoiceTemplatesByOrderIdVariables(orderId: orderId,offset: _offset,limit: _limit,); + return _dataConnect.query("listInvoiceTemplatesByOrderId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListInvoiceTemplatesByOrderIdInvoiceTemplates { + final String id; + final String name; + final String ownerId; + final String? vendorId; + final String? businessId; + final String? orderId; + final EnumValue? paymentTerms; + final String? invoiceNumber; + final Timestamp? issueDate; + final Timestamp? dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double? amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListInvoiceTemplatesByOrderIdInvoiceTemplatesVendor? vendor; + final ListInvoiceTemplatesByOrderIdInvoiceTemplatesBusiness? business; + final ListInvoiceTemplatesByOrderIdInvoiceTemplatesOrder? order; + ListInvoiceTemplatesByOrderIdInvoiceTemplates.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + ownerId = nativeFromJson(json['ownerId']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = json['businessId'] == null ? null : nativeFromJson(json['businessId']), + orderId = json['orderId'] == null ? null : nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsTempDeserializer(json['paymentTerms']), + invoiceNumber = json['invoiceNumber'] == null ? null : nativeFromJson(json['invoiceNumber']), + issueDate = json['issueDate'] == null ? null : Timestamp.fromJson(json['issueDate']), + dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = json['amount'] == null ? null : nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + vendor = json['vendor'] == null ? null : ListInvoiceTemplatesByOrderIdInvoiceTemplatesVendor.fromJson(json['vendor']), + business = json['business'] == null ? null : ListInvoiceTemplatesByOrderIdInvoiceTemplatesBusiness.fromJson(json['business']), + order = json['order'] == null ? null : ListInvoiceTemplatesByOrderIdInvoiceTemplatesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByOrderIdInvoiceTemplates otherTyped = other as ListInvoiceTemplatesByOrderIdInvoiceTemplates; + return id == otherTyped.id && + name == otherTyped.name && + ownerId == otherTyped.ownerId && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, ownerId.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['ownerId'] = nativeToJson(ownerId); + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + if (businessId != null) { + json['businessId'] = nativeToJson(businessId); + } + if (orderId != null) { + json['orderId'] = nativeToJson(orderId); + } + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsTempSerializer(paymentTerms!) + ; + } + if (invoiceNumber != null) { + json['invoiceNumber'] = nativeToJson(invoiceNumber); + } + if (issueDate != null) { + json['issueDate'] = issueDate!.toJson(); + } + if (dueDate != null) { + json['dueDate'] = dueDate!.toJson(); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + if (amount != null) { + json['amount'] = nativeToJson(amount); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + if (business != null) { + json['business'] = business!.toJson(); + } + if (order != null) { + json['order'] = order!.toJson(); + } + return json; + } + + ListInvoiceTemplatesByOrderIdInvoiceTemplates({ + required this.id, + required this.name, + required this.ownerId, + this.vendorId, + this.businessId, + this.orderId, + this.paymentTerms, + this.invoiceNumber, + this.issueDate, + this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.createdAt, + this.updatedAt, + this.createdBy, + this.vendor, + this.business, + this.order, + }); +} + +@immutable +class ListInvoiceTemplatesByOrderIdInvoiceTemplatesVendor { + final String id; + final String companyName; + ListInvoiceTemplatesByOrderIdInvoiceTemplatesVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByOrderIdInvoiceTemplatesVendor otherTyped = other as ListInvoiceTemplatesByOrderIdInvoiceTemplatesVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListInvoiceTemplatesByOrderIdInvoiceTemplatesVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListInvoiceTemplatesByOrderIdInvoiceTemplatesBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + ListInvoiceTemplatesByOrderIdInvoiceTemplatesBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByOrderIdInvoiceTemplatesBusiness otherTyped = other as ListInvoiceTemplatesByOrderIdInvoiceTemplatesBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + ListInvoiceTemplatesByOrderIdInvoiceTemplatesBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class ListInvoiceTemplatesByOrderIdInvoiceTemplatesOrder { + final String id; + final String? eventName; + final EnumValue status; + final EnumValue orderType; + ListInvoiceTemplatesByOrderIdInvoiceTemplatesOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + status = orderStatusDeserializer(json['status']), + orderType = orderTypeDeserializer(json['orderType']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByOrderIdInvoiceTemplatesOrder otherTyped = other as ListInvoiceTemplatesByOrderIdInvoiceTemplatesOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + status == otherTyped.status && + orderType == otherTyped.orderType; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, status.hashCode, orderType.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['status'] = + orderStatusSerializer(status) + ; + json['orderType'] = + orderTypeSerializer(orderType) + ; + return json; + } + + ListInvoiceTemplatesByOrderIdInvoiceTemplatesOrder({ + required this.id, + this.eventName, + required this.status, + required this.orderType, + }); +} + +@immutable +class ListInvoiceTemplatesByOrderIdData { + final List invoiceTemplates; + ListInvoiceTemplatesByOrderIdData.fromJson(dynamic json): + + invoiceTemplates = (json['invoiceTemplates'] as List) + .map((e) => ListInvoiceTemplatesByOrderIdInvoiceTemplates.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByOrderIdData otherTyped = other as ListInvoiceTemplatesByOrderIdData; + return invoiceTemplates == otherTyped.invoiceTemplates; + + } + @override + int get hashCode => invoiceTemplates.hashCode; + + + Map toJson() { + Map json = {}; + json['invoiceTemplates'] = invoiceTemplates.map((e) => e.toJson()).toList(); + return json; + } + + ListInvoiceTemplatesByOrderIdData({ + required this.invoiceTemplates, + }); +} + +@immutable +class ListInvoiceTemplatesByOrderIdVariables { + final String orderId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListInvoiceTemplatesByOrderIdVariables.fromJson(Map json): + + orderId = nativeFromJson(json['orderId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByOrderIdVariables otherTyped = other as ListInvoiceTemplatesByOrderIdVariables; + return orderId == otherTyped.orderId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([orderId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['orderId'] = nativeToJson(orderId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListInvoiceTemplatesByOrderIdVariables({ + required this.orderId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates_by_owner_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates_by_owner_id.dart new file mode 100644 index 00000000..205eeae8 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates_by_owner_id.dart @@ -0,0 +1,484 @@ +part of 'generated.dart'; + +class ListInvoiceTemplatesByOwnerIdVariablesBuilder { + String ownerId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListInvoiceTemplatesByOwnerIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoiceTemplatesByOwnerIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListInvoiceTemplatesByOwnerIdVariablesBuilder(this._dataConnect, {required this.ownerId,}); + Deserializer dataDeserializer = (dynamic json) => ListInvoiceTemplatesByOwnerIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListInvoiceTemplatesByOwnerIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListInvoiceTemplatesByOwnerIdVariables vars= ListInvoiceTemplatesByOwnerIdVariables(ownerId: ownerId,offset: _offset,limit: _limit,); + return _dataConnect.query("listInvoiceTemplatesByOwnerId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListInvoiceTemplatesByOwnerIdInvoiceTemplates { + final String id; + final String name; + final String ownerId; + final String? vendorId; + final String? businessId; + final String? orderId; + final EnumValue? paymentTerms; + final String? invoiceNumber; + final Timestamp? issueDate; + final Timestamp? dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double? amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListInvoiceTemplatesByOwnerIdInvoiceTemplatesVendor? vendor; + final ListInvoiceTemplatesByOwnerIdInvoiceTemplatesBusiness? business; + final ListInvoiceTemplatesByOwnerIdInvoiceTemplatesOrder? order; + ListInvoiceTemplatesByOwnerIdInvoiceTemplates.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + ownerId = nativeFromJson(json['ownerId']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = json['businessId'] == null ? null : nativeFromJson(json['businessId']), + orderId = json['orderId'] == null ? null : nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsTempDeserializer(json['paymentTerms']), + invoiceNumber = json['invoiceNumber'] == null ? null : nativeFromJson(json['invoiceNumber']), + issueDate = json['issueDate'] == null ? null : Timestamp.fromJson(json['issueDate']), + dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = json['amount'] == null ? null : nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + vendor = json['vendor'] == null ? null : ListInvoiceTemplatesByOwnerIdInvoiceTemplatesVendor.fromJson(json['vendor']), + business = json['business'] == null ? null : ListInvoiceTemplatesByOwnerIdInvoiceTemplatesBusiness.fromJson(json['business']), + order = json['order'] == null ? null : ListInvoiceTemplatesByOwnerIdInvoiceTemplatesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByOwnerIdInvoiceTemplates otherTyped = other as ListInvoiceTemplatesByOwnerIdInvoiceTemplates; + return id == otherTyped.id && + name == otherTyped.name && + ownerId == otherTyped.ownerId && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, ownerId.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['ownerId'] = nativeToJson(ownerId); + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + if (businessId != null) { + json['businessId'] = nativeToJson(businessId); + } + if (orderId != null) { + json['orderId'] = nativeToJson(orderId); + } + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsTempSerializer(paymentTerms!) + ; + } + if (invoiceNumber != null) { + json['invoiceNumber'] = nativeToJson(invoiceNumber); + } + if (issueDate != null) { + json['issueDate'] = issueDate!.toJson(); + } + if (dueDate != null) { + json['dueDate'] = dueDate!.toJson(); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + if (amount != null) { + json['amount'] = nativeToJson(amount); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + if (business != null) { + json['business'] = business!.toJson(); + } + if (order != null) { + json['order'] = order!.toJson(); + } + return json; + } + + ListInvoiceTemplatesByOwnerIdInvoiceTemplates({ + required this.id, + required this.name, + required this.ownerId, + this.vendorId, + this.businessId, + this.orderId, + this.paymentTerms, + this.invoiceNumber, + this.issueDate, + this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.createdAt, + this.updatedAt, + this.createdBy, + this.vendor, + this.business, + this.order, + }); +} + +@immutable +class ListInvoiceTemplatesByOwnerIdInvoiceTemplatesVendor { + final String id; + final String companyName; + ListInvoiceTemplatesByOwnerIdInvoiceTemplatesVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByOwnerIdInvoiceTemplatesVendor otherTyped = other as ListInvoiceTemplatesByOwnerIdInvoiceTemplatesVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListInvoiceTemplatesByOwnerIdInvoiceTemplatesVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListInvoiceTemplatesByOwnerIdInvoiceTemplatesBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + ListInvoiceTemplatesByOwnerIdInvoiceTemplatesBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByOwnerIdInvoiceTemplatesBusiness otherTyped = other as ListInvoiceTemplatesByOwnerIdInvoiceTemplatesBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + ListInvoiceTemplatesByOwnerIdInvoiceTemplatesBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class ListInvoiceTemplatesByOwnerIdInvoiceTemplatesOrder { + final String id; + final String? eventName; + final EnumValue status; + final EnumValue orderType; + ListInvoiceTemplatesByOwnerIdInvoiceTemplatesOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + status = orderStatusDeserializer(json['status']), + orderType = orderTypeDeserializer(json['orderType']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByOwnerIdInvoiceTemplatesOrder otherTyped = other as ListInvoiceTemplatesByOwnerIdInvoiceTemplatesOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + status == otherTyped.status && + orderType == otherTyped.orderType; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, status.hashCode, orderType.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['status'] = + orderStatusSerializer(status) + ; + json['orderType'] = + orderTypeSerializer(orderType) + ; + return json; + } + + ListInvoiceTemplatesByOwnerIdInvoiceTemplatesOrder({ + required this.id, + this.eventName, + required this.status, + required this.orderType, + }); +} + +@immutable +class ListInvoiceTemplatesByOwnerIdData { + final List invoiceTemplates; + ListInvoiceTemplatesByOwnerIdData.fromJson(dynamic json): + + invoiceTemplates = (json['invoiceTemplates'] as List) + .map((e) => ListInvoiceTemplatesByOwnerIdInvoiceTemplates.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByOwnerIdData otherTyped = other as ListInvoiceTemplatesByOwnerIdData; + return invoiceTemplates == otherTyped.invoiceTemplates; + + } + @override + int get hashCode => invoiceTemplates.hashCode; + + + Map toJson() { + Map json = {}; + json['invoiceTemplates'] = invoiceTemplates.map((e) => e.toJson()).toList(); + return json; + } + + ListInvoiceTemplatesByOwnerIdData({ + required this.invoiceTemplates, + }); +} + +@immutable +class ListInvoiceTemplatesByOwnerIdVariables { + final String ownerId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListInvoiceTemplatesByOwnerIdVariables.fromJson(Map json): + + ownerId = nativeFromJson(json['ownerId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByOwnerIdVariables otherTyped = other as ListInvoiceTemplatesByOwnerIdVariables; + return ownerId == otherTyped.ownerId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([ownerId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['ownerId'] = nativeToJson(ownerId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListInvoiceTemplatesByOwnerIdVariables({ + required this.ownerId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates_by_vendor_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates_by_vendor_id.dart new file mode 100644 index 00000000..aae5f57f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoice_templates_by_vendor_id.dart @@ -0,0 +1,484 @@ +part of 'generated.dart'; + +class ListInvoiceTemplatesByVendorIdVariablesBuilder { + String vendorId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListInvoiceTemplatesByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoiceTemplatesByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListInvoiceTemplatesByVendorIdVariablesBuilder(this._dataConnect, {required this.vendorId,}); + Deserializer dataDeserializer = (dynamic json) => ListInvoiceTemplatesByVendorIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListInvoiceTemplatesByVendorIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListInvoiceTemplatesByVendorIdVariables vars= ListInvoiceTemplatesByVendorIdVariables(vendorId: vendorId,offset: _offset,limit: _limit,); + return _dataConnect.query("listInvoiceTemplatesByVendorId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListInvoiceTemplatesByVendorIdInvoiceTemplates { + final String id; + final String name; + final String ownerId; + final String? vendorId; + final String? businessId; + final String? orderId; + final EnumValue? paymentTerms; + final String? invoiceNumber; + final Timestamp? issueDate; + final Timestamp? dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double? amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListInvoiceTemplatesByVendorIdInvoiceTemplatesVendor? vendor; + final ListInvoiceTemplatesByVendorIdInvoiceTemplatesBusiness? business; + final ListInvoiceTemplatesByVendorIdInvoiceTemplatesOrder? order; + ListInvoiceTemplatesByVendorIdInvoiceTemplates.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + ownerId = nativeFromJson(json['ownerId']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = json['businessId'] == null ? null : nativeFromJson(json['businessId']), + orderId = json['orderId'] == null ? null : nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsTempDeserializer(json['paymentTerms']), + invoiceNumber = json['invoiceNumber'] == null ? null : nativeFromJson(json['invoiceNumber']), + issueDate = json['issueDate'] == null ? null : Timestamp.fromJson(json['issueDate']), + dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = json['amount'] == null ? null : nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + vendor = json['vendor'] == null ? null : ListInvoiceTemplatesByVendorIdInvoiceTemplatesVendor.fromJson(json['vendor']), + business = json['business'] == null ? null : ListInvoiceTemplatesByVendorIdInvoiceTemplatesBusiness.fromJson(json['business']), + order = json['order'] == null ? null : ListInvoiceTemplatesByVendorIdInvoiceTemplatesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByVendorIdInvoiceTemplates otherTyped = other as ListInvoiceTemplatesByVendorIdInvoiceTemplates; + return id == otherTyped.id && + name == otherTyped.name && + ownerId == otherTyped.ownerId && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, ownerId.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['ownerId'] = nativeToJson(ownerId); + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + if (businessId != null) { + json['businessId'] = nativeToJson(businessId); + } + if (orderId != null) { + json['orderId'] = nativeToJson(orderId); + } + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsTempSerializer(paymentTerms!) + ; + } + if (invoiceNumber != null) { + json['invoiceNumber'] = nativeToJson(invoiceNumber); + } + if (issueDate != null) { + json['issueDate'] = issueDate!.toJson(); + } + if (dueDate != null) { + json['dueDate'] = dueDate!.toJson(); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + if (amount != null) { + json['amount'] = nativeToJson(amount); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + if (business != null) { + json['business'] = business!.toJson(); + } + if (order != null) { + json['order'] = order!.toJson(); + } + return json; + } + + ListInvoiceTemplatesByVendorIdInvoiceTemplates({ + required this.id, + required this.name, + required this.ownerId, + this.vendorId, + this.businessId, + this.orderId, + this.paymentTerms, + this.invoiceNumber, + this.issueDate, + this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.createdAt, + this.updatedAt, + this.createdBy, + this.vendor, + this.business, + this.order, + }); +} + +@immutable +class ListInvoiceTemplatesByVendorIdInvoiceTemplatesVendor { + final String id; + final String companyName; + ListInvoiceTemplatesByVendorIdInvoiceTemplatesVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByVendorIdInvoiceTemplatesVendor otherTyped = other as ListInvoiceTemplatesByVendorIdInvoiceTemplatesVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListInvoiceTemplatesByVendorIdInvoiceTemplatesVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListInvoiceTemplatesByVendorIdInvoiceTemplatesBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + ListInvoiceTemplatesByVendorIdInvoiceTemplatesBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByVendorIdInvoiceTemplatesBusiness otherTyped = other as ListInvoiceTemplatesByVendorIdInvoiceTemplatesBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + ListInvoiceTemplatesByVendorIdInvoiceTemplatesBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class ListInvoiceTemplatesByVendorIdInvoiceTemplatesOrder { + final String id; + final String? eventName; + final EnumValue status; + final EnumValue orderType; + ListInvoiceTemplatesByVendorIdInvoiceTemplatesOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + status = orderStatusDeserializer(json['status']), + orderType = orderTypeDeserializer(json['orderType']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByVendorIdInvoiceTemplatesOrder otherTyped = other as ListInvoiceTemplatesByVendorIdInvoiceTemplatesOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + status == otherTyped.status && + orderType == otherTyped.orderType; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, status.hashCode, orderType.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['status'] = + orderStatusSerializer(status) + ; + json['orderType'] = + orderTypeSerializer(orderType) + ; + return json; + } + + ListInvoiceTemplatesByVendorIdInvoiceTemplatesOrder({ + required this.id, + this.eventName, + required this.status, + required this.orderType, + }); +} + +@immutable +class ListInvoiceTemplatesByVendorIdData { + final List invoiceTemplates; + ListInvoiceTemplatesByVendorIdData.fromJson(dynamic json): + + invoiceTemplates = (json['invoiceTemplates'] as List) + .map((e) => ListInvoiceTemplatesByVendorIdInvoiceTemplates.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByVendorIdData otherTyped = other as ListInvoiceTemplatesByVendorIdData; + return invoiceTemplates == otherTyped.invoiceTemplates; + + } + @override + int get hashCode => invoiceTemplates.hashCode; + + + Map toJson() { + Map json = {}; + json['invoiceTemplates'] = invoiceTemplates.map((e) => e.toJson()).toList(); + return json; + } + + ListInvoiceTemplatesByVendorIdData({ + required this.invoiceTemplates, + }); +} + +@immutable +class ListInvoiceTemplatesByVendorIdVariables { + final String vendorId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListInvoiceTemplatesByVendorIdVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoiceTemplatesByVendorIdVariables otherTyped = other as ListInvoiceTemplatesByVendorIdVariables; + return vendorId == otherTyped.vendorId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListInvoiceTemplatesByVendorIdVariables({ + required this.vendorId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices.dart new file mode 100644 index 00000000..74c1ebe9 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices.dart @@ -0,0 +1,474 @@ +part of 'generated.dart'; + +class ListInvoicesVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListInvoicesVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoicesVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListInvoicesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListInvoicesData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListInvoicesVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListInvoicesVariables vars= ListInvoicesVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listInvoices", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListInvoicesInvoices { + final String id; + final EnumValue status; + final String vendorId; + final String businessId; + final String orderId; + final EnumValue? paymentTerms; + final String invoiceNumber; + final Timestamp issueDate; + final Timestamp dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final AnyValue? disputedItems; + final String? disputeReason; + final String? disputeDetails; + final ListInvoicesInvoicesVendor vendor; + final ListInvoicesInvoicesBusiness business; + final ListInvoicesInvoicesOrder order; + ListInvoicesInvoices.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + status = invoiceStatusDeserializer(json['status']), + vendorId = nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderId = nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsDeserializer(json['paymentTerms']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + issueDate = Timestamp.fromJson(json['issueDate']), + dueDate = Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + disputedItems = json['disputedItems'] == null ? null : AnyValue.fromJson(json['disputedItems']), + disputeReason = json['disputeReason'] == null ? null : nativeFromJson(json['disputeReason']), + disputeDetails = json['disputeDetails'] == null ? null : nativeFromJson(json['disputeDetails']), + vendor = ListInvoicesInvoicesVendor.fromJson(json['vendor']), + business = ListInvoicesInvoicesBusiness.fromJson(json['business']), + order = ListInvoicesInvoicesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesInvoices otherTyped = other as ListInvoicesInvoices; + return id == otherTyped.id && + status == otherTyped.status && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + disputedItems == otherTyped.disputedItems && + disputeReason == otherTyped.disputeReason && + disputeDetails == otherTyped.disputeDetails && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, status.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, disputedItems.hashCode, disputeReason.hashCode, disputeDetails.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['status'] = + invoiceStatusSerializer(status) + ; + json['vendorId'] = nativeToJson(vendorId); + json['businessId'] = nativeToJson(businessId); + json['orderId'] = nativeToJson(orderId); + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsSerializer(paymentTerms!) + ; + } + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['issueDate'] = issueDate.toJson(); + json['dueDate'] = dueDate.toJson(); + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + json['amount'] = nativeToJson(amount); + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (disputedItems != null) { + json['disputedItems'] = disputedItems!.toJson(); + } + if (disputeReason != null) { + json['disputeReason'] = nativeToJson(disputeReason); + } + if (disputeDetails != null) { + json['disputeDetails'] = nativeToJson(disputeDetails); + } + json['vendor'] = vendor.toJson(); + json['business'] = business.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListInvoicesInvoices({ + required this.id, + required this.status, + required this.vendorId, + required this.businessId, + required this.orderId, + this.paymentTerms, + required this.invoiceNumber, + required this.issueDate, + required this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + required this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.disputedItems, + this.disputeReason, + this.disputeDetails, + required this.vendor, + required this.business, + required this.order, + }); +} + +@immutable +class ListInvoicesInvoicesVendor { + final String companyName; + final String? address; + final String? email; + final String? phone; + ListInvoicesInvoicesVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesInvoicesVendor otherTyped = other as ListInvoicesInvoicesVendor; + return companyName == otherTyped.companyName && + address == otherTyped.address && + email == otherTyped.email && + phone == otherTyped.phone; + + } + @override + int get hashCode => Object.hashAll([companyName.hashCode, address.hashCode, email.hashCode, phone.hashCode]); + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + return json; + } + + ListInvoicesInvoicesVendor({ + required this.companyName, + this.address, + this.email, + this.phone, + }); +} + +@immutable +class ListInvoicesInvoicesBusiness { + final String businessName; + final String? address; + final String? phone; + final String? email; + ListInvoicesInvoicesBusiness.fromJson(dynamic json): + + businessName = nativeFromJson(json['businessName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesInvoicesBusiness otherTyped = other as ListInvoicesInvoicesBusiness; + return businessName == otherTyped.businessName && + address == otherTyped.address && + phone == otherTyped.phone && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([businessName.hashCode, address.hashCode, phone.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessName'] = nativeToJson(businessName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + ListInvoicesInvoicesBusiness({ + required this.businessName, + this.address, + this.phone, + this.email, + }); +} + +@immutable +class ListInvoicesInvoicesOrder { + final String? eventName; + final String? hub; + final String? deparment; + final String? poReference; + ListInvoicesInvoicesOrder.fromJson(dynamic json): + + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + deparment = json['deparment'] == null ? null : nativeFromJson(json['deparment']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesInvoicesOrder otherTyped = other as ListInvoicesInvoicesOrder; + return eventName == otherTyped.eventName && + hub == otherTyped.hub && + deparment == otherTyped.deparment && + poReference == otherTyped.poReference; + + } + @override + int get hashCode => Object.hashAll([eventName.hashCode, hub.hashCode, deparment.hashCode, poReference.hashCode]); + + + Map toJson() { + Map json = {}; + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (deparment != null) { + json['deparment'] = nativeToJson(deparment); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + return json; + } + + ListInvoicesInvoicesOrder({ + this.eventName, + this.hub, + this.deparment, + this.poReference, + }); +} + +@immutable +class ListInvoicesData { + final List invoices; + ListInvoicesData.fromJson(dynamic json): + + invoices = (json['invoices'] as List) + .map((e) => ListInvoicesInvoices.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesData otherTyped = other as ListInvoicesData; + return invoices == otherTyped.invoices; + + } + @override + int get hashCode => invoices.hashCode; + + + Map toJson() { + Map json = {}; + json['invoices'] = invoices.map((e) => e.toJson()).toList(); + return json; + } + + ListInvoicesData({ + required this.invoices, + }); +} + +@immutable +class ListInvoicesVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListInvoicesVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesVariables otherTyped = other as ListInvoicesVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListInvoicesVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_by_business_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_by_business_id.dart new file mode 100644 index 00000000..0b3dd14c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_by_business_id.dart @@ -0,0 +1,481 @@ +part of 'generated.dart'; + +class ListInvoicesByBusinessIdVariablesBuilder { + String businessId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListInvoicesByBusinessIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoicesByBusinessIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListInvoicesByBusinessIdVariablesBuilder(this._dataConnect, {required this.businessId,}); + Deserializer dataDeserializer = (dynamic json) => ListInvoicesByBusinessIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListInvoicesByBusinessIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListInvoicesByBusinessIdVariables vars= ListInvoicesByBusinessIdVariables(businessId: businessId,offset: _offset,limit: _limit,); + return _dataConnect.query("listInvoicesByBusinessId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListInvoicesByBusinessIdInvoices { + final String id; + final EnumValue status; + final String vendorId; + final String businessId; + final String orderId; + final EnumValue? paymentTerms; + final String invoiceNumber; + final Timestamp issueDate; + final Timestamp dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final AnyValue? disputedItems; + final String? disputeReason; + final String? disputeDetails; + final ListInvoicesByBusinessIdInvoicesVendor vendor; + final ListInvoicesByBusinessIdInvoicesBusiness business; + final ListInvoicesByBusinessIdInvoicesOrder order; + ListInvoicesByBusinessIdInvoices.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + status = invoiceStatusDeserializer(json['status']), + vendorId = nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderId = nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsDeserializer(json['paymentTerms']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + issueDate = Timestamp.fromJson(json['issueDate']), + dueDate = Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + disputedItems = json['disputedItems'] == null ? null : AnyValue.fromJson(json['disputedItems']), + disputeReason = json['disputeReason'] == null ? null : nativeFromJson(json['disputeReason']), + disputeDetails = json['disputeDetails'] == null ? null : nativeFromJson(json['disputeDetails']), + vendor = ListInvoicesByBusinessIdInvoicesVendor.fromJson(json['vendor']), + business = ListInvoicesByBusinessIdInvoicesBusiness.fromJson(json['business']), + order = ListInvoicesByBusinessIdInvoicesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByBusinessIdInvoices otherTyped = other as ListInvoicesByBusinessIdInvoices; + return id == otherTyped.id && + status == otherTyped.status && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + disputedItems == otherTyped.disputedItems && + disputeReason == otherTyped.disputeReason && + disputeDetails == otherTyped.disputeDetails && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, status.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, disputedItems.hashCode, disputeReason.hashCode, disputeDetails.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['status'] = + invoiceStatusSerializer(status) + ; + json['vendorId'] = nativeToJson(vendorId); + json['businessId'] = nativeToJson(businessId); + json['orderId'] = nativeToJson(orderId); + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsSerializer(paymentTerms!) + ; + } + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['issueDate'] = issueDate.toJson(); + json['dueDate'] = dueDate.toJson(); + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + json['amount'] = nativeToJson(amount); + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (disputedItems != null) { + json['disputedItems'] = disputedItems!.toJson(); + } + if (disputeReason != null) { + json['disputeReason'] = nativeToJson(disputeReason); + } + if (disputeDetails != null) { + json['disputeDetails'] = nativeToJson(disputeDetails); + } + json['vendor'] = vendor.toJson(); + json['business'] = business.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListInvoicesByBusinessIdInvoices({ + required this.id, + required this.status, + required this.vendorId, + required this.businessId, + required this.orderId, + this.paymentTerms, + required this.invoiceNumber, + required this.issueDate, + required this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + required this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.disputedItems, + this.disputeReason, + this.disputeDetails, + required this.vendor, + required this.business, + required this.order, + }); +} + +@immutable +class ListInvoicesByBusinessIdInvoicesVendor { + final String companyName; + final String? address; + final String? email; + final String? phone; + ListInvoicesByBusinessIdInvoicesVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByBusinessIdInvoicesVendor otherTyped = other as ListInvoicesByBusinessIdInvoicesVendor; + return companyName == otherTyped.companyName && + address == otherTyped.address && + email == otherTyped.email && + phone == otherTyped.phone; + + } + @override + int get hashCode => Object.hashAll([companyName.hashCode, address.hashCode, email.hashCode, phone.hashCode]); + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + return json; + } + + ListInvoicesByBusinessIdInvoicesVendor({ + required this.companyName, + this.address, + this.email, + this.phone, + }); +} + +@immutable +class ListInvoicesByBusinessIdInvoicesBusiness { + final String businessName; + final String? address; + final String? phone; + final String? email; + ListInvoicesByBusinessIdInvoicesBusiness.fromJson(dynamic json): + + businessName = nativeFromJson(json['businessName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByBusinessIdInvoicesBusiness otherTyped = other as ListInvoicesByBusinessIdInvoicesBusiness; + return businessName == otherTyped.businessName && + address == otherTyped.address && + phone == otherTyped.phone && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([businessName.hashCode, address.hashCode, phone.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessName'] = nativeToJson(businessName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + ListInvoicesByBusinessIdInvoicesBusiness({ + required this.businessName, + this.address, + this.phone, + this.email, + }); +} + +@immutable +class ListInvoicesByBusinessIdInvoicesOrder { + final String? eventName; + final String? hub; + final String? deparment; + final String? poReference; + ListInvoicesByBusinessIdInvoicesOrder.fromJson(dynamic json): + + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + deparment = json['deparment'] == null ? null : nativeFromJson(json['deparment']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByBusinessIdInvoicesOrder otherTyped = other as ListInvoicesByBusinessIdInvoicesOrder; + return eventName == otherTyped.eventName && + hub == otherTyped.hub && + deparment == otherTyped.deparment && + poReference == otherTyped.poReference; + + } + @override + int get hashCode => Object.hashAll([eventName.hashCode, hub.hashCode, deparment.hashCode, poReference.hashCode]); + + + Map toJson() { + Map json = {}; + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (deparment != null) { + json['deparment'] = nativeToJson(deparment); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + return json; + } + + ListInvoicesByBusinessIdInvoicesOrder({ + this.eventName, + this.hub, + this.deparment, + this.poReference, + }); +} + +@immutable +class ListInvoicesByBusinessIdData { + final List invoices; + ListInvoicesByBusinessIdData.fromJson(dynamic json): + + invoices = (json['invoices'] as List) + .map((e) => ListInvoicesByBusinessIdInvoices.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByBusinessIdData otherTyped = other as ListInvoicesByBusinessIdData; + return invoices == otherTyped.invoices; + + } + @override + int get hashCode => invoices.hashCode; + + + Map toJson() { + Map json = {}; + json['invoices'] = invoices.map((e) => e.toJson()).toList(); + return json; + } + + ListInvoicesByBusinessIdData({ + required this.invoices, + }); +} + +@immutable +class ListInvoicesByBusinessIdVariables { + final String businessId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListInvoicesByBusinessIdVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByBusinessIdVariables otherTyped = other as ListInvoicesByBusinessIdVariables; + return businessId == otherTyped.businessId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListInvoicesByBusinessIdVariables({ + required this.businessId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_by_order_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_by_order_id.dart new file mode 100644 index 00000000..6217a941 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_by_order_id.dart @@ -0,0 +1,481 @@ +part of 'generated.dart'; + +class ListInvoicesByOrderIdVariablesBuilder { + String orderId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListInvoicesByOrderIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoicesByOrderIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListInvoicesByOrderIdVariablesBuilder(this._dataConnect, {required this.orderId,}); + Deserializer dataDeserializer = (dynamic json) => ListInvoicesByOrderIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListInvoicesByOrderIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListInvoicesByOrderIdVariables vars= ListInvoicesByOrderIdVariables(orderId: orderId,offset: _offset,limit: _limit,); + return _dataConnect.query("listInvoicesByOrderId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListInvoicesByOrderIdInvoices { + final String id; + final EnumValue status; + final String vendorId; + final String businessId; + final String orderId; + final EnumValue? paymentTerms; + final String invoiceNumber; + final Timestamp issueDate; + final Timestamp dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final AnyValue? disputedItems; + final String? disputeReason; + final String? disputeDetails; + final ListInvoicesByOrderIdInvoicesVendor vendor; + final ListInvoicesByOrderIdInvoicesBusiness business; + final ListInvoicesByOrderIdInvoicesOrder order; + ListInvoicesByOrderIdInvoices.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + status = invoiceStatusDeserializer(json['status']), + vendorId = nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderId = nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsDeserializer(json['paymentTerms']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + issueDate = Timestamp.fromJson(json['issueDate']), + dueDate = Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + disputedItems = json['disputedItems'] == null ? null : AnyValue.fromJson(json['disputedItems']), + disputeReason = json['disputeReason'] == null ? null : nativeFromJson(json['disputeReason']), + disputeDetails = json['disputeDetails'] == null ? null : nativeFromJson(json['disputeDetails']), + vendor = ListInvoicesByOrderIdInvoicesVendor.fromJson(json['vendor']), + business = ListInvoicesByOrderIdInvoicesBusiness.fromJson(json['business']), + order = ListInvoicesByOrderIdInvoicesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByOrderIdInvoices otherTyped = other as ListInvoicesByOrderIdInvoices; + return id == otherTyped.id && + status == otherTyped.status && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + disputedItems == otherTyped.disputedItems && + disputeReason == otherTyped.disputeReason && + disputeDetails == otherTyped.disputeDetails && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, status.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, disputedItems.hashCode, disputeReason.hashCode, disputeDetails.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['status'] = + invoiceStatusSerializer(status) + ; + json['vendorId'] = nativeToJson(vendorId); + json['businessId'] = nativeToJson(businessId); + json['orderId'] = nativeToJson(orderId); + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsSerializer(paymentTerms!) + ; + } + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['issueDate'] = issueDate.toJson(); + json['dueDate'] = dueDate.toJson(); + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + json['amount'] = nativeToJson(amount); + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (disputedItems != null) { + json['disputedItems'] = disputedItems!.toJson(); + } + if (disputeReason != null) { + json['disputeReason'] = nativeToJson(disputeReason); + } + if (disputeDetails != null) { + json['disputeDetails'] = nativeToJson(disputeDetails); + } + json['vendor'] = vendor.toJson(); + json['business'] = business.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListInvoicesByOrderIdInvoices({ + required this.id, + required this.status, + required this.vendorId, + required this.businessId, + required this.orderId, + this.paymentTerms, + required this.invoiceNumber, + required this.issueDate, + required this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + required this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.disputedItems, + this.disputeReason, + this.disputeDetails, + required this.vendor, + required this.business, + required this.order, + }); +} + +@immutable +class ListInvoicesByOrderIdInvoicesVendor { + final String companyName; + final String? address; + final String? email; + final String? phone; + ListInvoicesByOrderIdInvoicesVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByOrderIdInvoicesVendor otherTyped = other as ListInvoicesByOrderIdInvoicesVendor; + return companyName == otherTyped.companyName && + address == otherTyped.address && + email == otherTyped.email && + phone == otherTyped.phone; + + } + @override + int get hashCode => Object.hashAll([companyName.hashCode, address.hashCode, email.hashCode, phone.hashCode]); + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + return json; + } + + ListInvoicesByOrderIdInvoicesVendor({ + required this.companyName, + this.address, + this.email, + this.phone, + }); +} + +@immutable +class ListInvoicesByOrderIdInvoicesBusiness { + final String businessName; + final String? address; + final String? phone; + final String? email; + ListInvoicesByOrderIdInvoicesBusiness.fromJson(dynamic json): + + businessName = nativeFromJson(json['businessName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByOrderIdInvoicesBusiness otherTyped = other as ListInvoicesByOrderIdInvoicesBusiness; + return businessName == otherTyped.businessName && + address == otherTyped.address && + phone == otherTyped.phone && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([businessName.hashCode, address.hashCode, phone.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessName'] = nativeToJson(businessName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + ListInvoicesByOrderIdInvoicesBusiness({ + required this.businessName, + this.address, + this.phone, + this.email, + }); +} + +@immutable +class ListInvoicesByOrderIdInvoicesOrder { + final String? eventName; + final String? hub; + final String? deparment; + final String? poReference; + ListInvoicesByOrderIdInvoicesOrder.fromJson(dynamic json): + + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + deparment = json['deparment'] == null ? null : nativeFromJson(json['deparment']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByOrderIdInvoicesOrder otherTyped = other as ListInvoicesByOrderIdInvoicesOrder; + return eventName == otherTyped.eventName && + hub == otherTyped.hub && + deparment == otherTyped.deparment && + poReference == otherTyped.poReference; + + } + @override + int get hashCode => Object.hashAll([eventName.hashCode, hub.hashCode, deparment.hashCode, poReference.hashCode]); + + + Map toJson() { + Map json = {}; + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (deparment != null) { + json['deparment'] = nativeToJson(deparment); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + return json; + } + + ListInvoicesByOrderIdInvoicesOrder({ + this.eventName, + this.hub, + this.deparment, + this.poReference, + }); +} + +@immutable +class ListInvoicesByOrderIdData { + final List invoices; + ListInvoicesByOrderIdData.fromJson(dynamic json): + + invoices = (json['invoices'] as List) + .map((e) => ListInvoicesByOrderIdInvoices.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByOrderIdData otherTyped = other as ListInvoicesByOrderIdData; + return invoices == otherTyped.invoices; + + } + @override + int get hashCode => invoices.hashCode; + + + Map toJson() { + Map json = {}; + json['invoices'] = invoices.map((e) => e.toJson()).toList(); + return json; + } + + ListInvoicesByOrderIdData({ + required this.invoices, + }); +} + +@immutable +class ListInvoicesByOrderIdVariables { + final String orderId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListInvoicesByOrderIdVariables.fromJson(Map json): + + orderId = nativeFromJson(json['orderId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByOrderIdVariables otherTyped = other as ListInvoicesByOrderIdVariables; + return orderId == otherTyped.orderId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([orderId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['orderId'] = nativeToJson(orderId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListInvoicesByOrderIdVariables({ + required this.orderId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_by_status.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_by_status.dart new file mode 100644 index 00000000..7a04a11e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_by_status.dart @@ -0,0 +1,483 @@ +part of 'generated.dart'; + +class ListInvoicesByStatusVariablesBuilder { + InvoiceStatus status; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListInvoicesByStatusVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoicesByStatusVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListInvoicesByStatusVariablesBuilder(this._dataConnect, {required this.status,}); + Deserializer dataDeserializer = (dynamic json) => ListInvoicesByStatusData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListInvoicesByStatusVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListInvoicesByStatusVariables vars= ListInvoicesByStatusVariables(status: status,offset: _offset,limit: _limit,); + return _dataConnect.query("listInvoicesByStatus", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListInvoicesByStatusInvoices { + final String id; + final EnumValue status; + final String vendorId; + final String businessId; + final String orderId; + final EnumValue? paymentTerms; + final String invoiceNumber; + final Timestamp issueDate; + final Timestamp dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final AnyValue? disputedItems; + final String? disputeReason; + final String? disputeDetails; + final ListInvoicesByStatusInvoicesVendor vendor; + final ListInvoicesByStatusInvoicesBusiness business; + final ListInvoicesByStatusInvoicesOrder order; + ListInvoicesByStatusInvoices.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + status = invoiceStatusDeserializer(json['status']), + vendorId = nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderId = nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsDeserializer(json['paymentTerms']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + issueDate = Timestamp.fromJson(json['issueDate']), + dueDate = Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + disputedItems = json['disputedItems'] == null ? null : AnyValue.fromJson(json['disputedItems']), + disputeReason = json['disputeReason'] == null ? null : nativeFromJson(json['disputeReason']), + disputeDetails = json['disputeDetails'] == null ? null : nativeFromJson(json['disputeDetails']), + vendor = ListInvoicesByStatusInvoicesVendor.fromJson(json['vendor']), + business = ListInvoicesByStatusInvoicesBusiness.fromJson(json['business']), + order = ListInvoicesByStatusInvoicesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByStatusInvoices otherTyped = other as ListInvoicesByStatusInvoices; + return id == otherTyped.id && + status == otherTyped.status && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + disputedItems == otherTyped.disputedItems && + disputeReason == otherTyped.disputeReason && + disputeDetails == otherTyped.disputeDetails && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, status.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, disputedItems.hashCode, disputeReason.hashCode, disputeDetails.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['status'] = + invoiceStatusSerializer(status) + ; + json['vendorId'] = nativeToJson(vendorId); + json['businessId'] = nativeToJson(businessId); + json['orderId'] = nativeToJson(orderId); + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsSerializer(paymentTerms!) + ; + } + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['issueDate'] = issueDate.toJson(); + json['dueDate'] = dueDate.toJson(); + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + json['amount'] = nativeToJson(amount); + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (disputedItems != null) { + json['disputedItems'] = disputedItems!.toJson(); + } + if (disputeReason != null) { + json['disputeReason'] = nativeToJson(disputeReason); + } + if (disputeDetails != null) { + json['disputeDetails'] = nativeToJson(disputeDetails); + } + json['vendor'] = vendor.toJson(); + json['business'] = business.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListInvoicesByStatusInvoices({ + required this.id, + required this.status, + required this.vendorId, + required this.businessId, + required this.orderId, + this.paymentTerms, + required this.invoiceNumber, + required this.issueDate, + required this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + required this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.disputedItems, + this.disputeReason, + this.disputeDetails, + required this.vendor, + required this.business, + required this.order, + }); +} + +@immutable +class ListInvoicesByStatusInvoicesVendor { + final String companyName; + final String? address; + final String? email; + final String? phone; + ListInvoicesByStatusInvoicesVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByStatusInvoicesVendor otherTyped = other as ListInvoicesByStatusInvoicesVendor; + return companyName == otherTyped.companyName && + address == otherTyped.address && + email == otherTyped.email && + phone == otherTyped.phone; + + } + @override + int get hashCode => Object.hashAll([companyName.hashCode, address.hashCode, email.hashCode, phone.hashCode]); + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + return json; + } + + ListInvoicesByStatusInvoicesVendor({ + required this.companyName, + this.address, + this.email, + this.phone, + }); +} + +@immutable +class ListInvoicesByStatusInvoicesBusiness { + final String businessName; + final String? address; + final String? phone; + final String? email; + ListInvoicesByStatusInvoicesBusiness.fromJson(dynamic json): + + businessName = nativeFromJson(json['businessName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByStatusInvoicesBusiness otherTyped = other as ListInvoicesByStatusInvoicesBusiness; + return businessName == otherTyped.businessName && + address == otherTyped.address && + phone == otherTyped.phone && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([businessName.hashCode, address.hashCode, phone.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessName'] = nativeToJson(businessName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + ListInvoicesByStatusInvoicesBusiness({ + required this.businessName, + this.address, + this.phone, + this.email, + }); +} + +@immutable +class ListInvoicesByStatusInvoicesOrder { + final String? eventName; + final String? hub; + final String? deparment; + final String? poReference; + ListInvoicesByStatusInvoicesOrder.fromJson(dynamic json): + + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + deparment = json['deparment'] == null ? null : nativeFromJson(json['deparment']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByStatusInvoicesOrder otherTyped = other as ListInvoicesByStatusInvoicesOrder; + return eventName == otherTyped.eventName && + hub == otherTyped.hub && + deparment == otherTyped.deparment && + poReference == otherTyped.poReference; + + } + @override + int get hashCode => Object.hashAll([eventName.hashCode, hub.hashCode, deparment.hashCode, poReference.hashCode]); + + + Map toJson() { + Map json = {}; + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (deparment != null) { + json['deparment'] = nativeToJson(deparment); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + return json; + } + + ListInvoicesByStatusInvoicesOrder({ + this.eventName, + this.hub, + this.deparment, + this.poReference, + }); +} + +@immutable +class ListInvoicesByStatusData { + final List invoices; + ListInvoicesByStatusData.fromJson(dynamic json): + + invoices = (json['invoices'] as List) + .map((e) => ListInvoicesByStatusInvoices.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByStatusData otherTyped = other as ListInvoicesByStatusData; + return invoices == otherTyped.invoices; + + } + @override + int get hashCode => invoices.hashCode; + + + Map toJson() { + Map json = {}; + json['invoices'] = invoices.map((e) => e.toJson()).toList(); + return json; + } + + ListInvoicesByStatusData({ + required this.invoices, + }); +} + +@immutable +class ListInvoicesByStatusVariables { + final InvoiceStatus status; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListInvoicesByStatusVariables.fromJson(Map json): + + status = InvoiceStatus.values.byName(json['status']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByStatusVariables otherTyped = other as ListInvoicesByStatusVariables; + return status == otherTyped.status && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([status.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['status'] = + status.name + ; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListInvoicesByStatusVariables({ + required this.status, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_by_vendor_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_by_vendor_id.dart new file mode 100644 index 00000000..373c5622 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_by_vendor_id.dart @@ -0,0 +1,481 @@ +part of 'generated.dart'; + +class ListInvoicesByVendorIdVariablesBuilder { + String vendorId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListInvoicesByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListInvoicesByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListInvoicesByVendorIdVariablesBuilder(this._dataConnect, {required this.vendorId,}); + Deserializer dataDeserializer = (dynamic json) => ListInvoicesByVendorIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListInvoicesByVendorIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListInvoicesByVendorIdVariables vars= ListInvoicesByVendorIdVariables(vendorId: vendorId,offset: _offset,limit: _limit,); + return _dataConnect.query("listInvoicesByVendorId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListInvoicesByVendorIdInvoices { + final String id; + final EnumValue status; + final String vendorId; + final String businessId; + final String orderId; + final EnumValue? paymentTerms; + final String invoiceNumber; + final Timestamp issueDate; + final Timestamp dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final AnyValue? disputedItems; + final String? disputeReason; + final String? disputeDetails; + final ListInvoicesByVendorIdInvoicesVendor vendor; + final ListInvoicesByVendorIdInvoicesBusiness business; + final ListInvoicesByVendorIdInvoicesOrder order; + ListInvoicesByVendorIdInvoices.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + status = invoiceStatusDeserializer(json['status']), + vendorId = nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderId = nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsDeserializer(json['paymentTerms']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + issueDate = Timestamp.fromJson(json['issueDate']), + dueDate = Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + disputedItems = json['disputedItems'] == null ? null : AnyValue.fromJson(json['disputedItems']), + disputeReason = json['disputeReason'] == null ? null : nativeFromJson(json['disputeReason']), + disputeDetails = json['disputeDetails'] == null ? null : nativeFromJson(json['disputeDetails']), + vendor = ListInvoicesByVendorIdInvoicesVendor.fromJson(json['vendor']), + business = ListInvoicesByVendorIdInvoicesBusiness.fromJson(json['business']), + order = ListInvoicesByVendorIdInvoicesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByVendorIdInvoices otherTyped = other as ListInvoicesByVendorIdInvoices; + return id == otherTyped.id && + status == otherTyped.status && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + disputedItems == otherTyped.disputedItems && + disputeReason == otherTyped.disputeReason && + disputeDetails == otherTyped.disputeDetails && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, status.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, disputedItems.hashCode, disputeReason.hashCode, disputeDetails.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['status'] = + invoiceStatusSerializer(status) + ; + json['vendorId'] = nativeToJson(vendorId); + json['businessId'] = nativeToJson(businessId); + json['orderId'] = nativeToJson(orderId); + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsSerializer(paymentTerms!) + ; + } + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['issueDate'] = issueDate.toJson(); + json['dueDate'] = dueDate.toJson(); + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + json['amount'] = nativeToJson(amount); + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (disputedItems != null) { + json['disputedItems'] = disputedItems!.toJson(); + } + if (disputeReason != null) { + json['disputeReason'] = nativeToJson(disputeReason); + } + if (disputeDetails != null) { + json['disputeDetails'] = nativeToJson(disputeDetails); + } + json['vendor'] = vendor.toJson(); + json['business'] = business.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListInvoicesByVendorIdInvoices({ + required this.id, + required this.status, + required this.vendorId, + required this.businessId, + required this.orderId, + this.paymentTerms, + required this.invoiceNumber, + required this.issueDate, + required this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + required this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.disputedItems, + this.disputeReason, + this.disputeDetails, + required this.vendor, + required this.business, + required this.order, + }); +} + +@immutable +class ListInvoicesByVendorIdInvoicesVendor { + final String companyName; + final String? address; + final String? email; + final String? phone; + ListInvoicesByVendorIdInvoicesVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByVendorIdInvoicesVendor otherTyped = other as ListInvoicesByVendorIdInvoicesVendor; + return companyName == otherTyped.companyName && + address == otherTyped.address && + email == otherTyped.email && + phone == otherTyped.phone; + + } + @override + int get hashCode => Object.hashAll([companyName.hashCode, address.hashCode, email.hashCode, phone.hashCode]); + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + return json; + } + + ListInvoicesByVendorIdInvoicesVendor({ + required this.companyName, + this.address, + this.email, + this.phone, + }); +} + +@immutable +class ListInvoicesByVendorIdInvoicesBusiness { + final String businessName; + final String? address; + final String? phone; + final String? email; + ListInvoicesByVendorIdInvoicesBusiness.fromJson(dynamic json): + + businessName = nativeFromJson(json['businessName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByVendorIdInvoicesBusiness otherTyped = other as ListInvoicesByVendorIdInvoicesBusiness; + return businessName == otherTyped.businessName && + address == otherTyped.address && + phone == otherTyped.phone && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([businessName.hashCode, address.hashCode, phone.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessName'] = nativeToJson(businessName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + ListInvoicesByVendorIdInvoicesBusiness({ + required this.businessName, + this.address, + this.phone, + this.email, + }); +} + +@immutable +class ListInvoicesByVendorIdInvoicesOrder { + final String? eventName; + final String? hub; + final String? deparment; + final String? poReference; + ListInvoicesByVendorIdInvoicesOrder.fromJson(dynamic json): + + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + deparment = json['deparment'] == null ? null : nativeFromJson(json['deparment']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByVendorIdInvoicesOrder otherTyped = other as ListInvoicesByVendorIdInvoicesOrder; + return eventName == otherTyped.eventName && + hub == otherTyped.hub && + deparment == otherTyped.deparment && + poReference == otherTyped.poReference; + + } + @override + int get hashCode => Object.hashAll([eventName.hashCode, hub.hashCode, deparment.hashCode, poReference.hashCode]); + + + Map toJson() { + Map json = {}; + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (deparment != null) { + json['deparment'] = nativeToJson(deparment); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + return json; + } + + ListInvoicesByVendorIdInvoicesOrder({ + this.eventName, + this.hub, + this.deparment, + this.poReference, + }); +} + +@immutable +class ListInvoicesByVendorIdData { + final List invoices; + ListInvoicesByVendorIdData.fromJson(dynamic json): + + invoices = (json['invoices'] as List) + .map((e) => ListInvoicesByVendorIdInvoices.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByVendorIdData otherTyped = other as ListInvoicesByVendorIdData; + return invoices == otherTyped.invoices; + + } + @override + int get hashCode => invoices.hashCode; + + + Map toJson() { + Map json = {}; + json['invoices'] = invoices.map((e) => e.toJson()).toList(); + return json; + } + + ListInvoicesByVendorIdData({ + required this.invoices, + }); +} + +@immutable +class ListInvoicesByVendorIdVariables { + final String vendorId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListInvoicesByVendorIdVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesByVendorIdVariables otherTyped = other as ListInvoicesByVendorIdVariables; + return vendorId == otherTyped.vendorId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListInvoicesByVendorIdVariables({ + required this.vendorId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_for_spend_by_business.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_for_spend_by_business.dart new file mode 100644 index 00000000..1cc05b81 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_for_spend_by_business.dart @@ -0,0 +1,297 @@ +part of 'generated.dart'; + +class ListInvoicesForSpendByBusinessVariablesBuilder { + String businessId; + Timestamp startDate; + Timestamp endDate; + + final FirebaseDataConnect _dataConnect; + ListInvoicesForSpendByBusinessVariablesBuilder(this._dataConnect, {required this.businessId,required this.startDate,required this.endDate,}); + Deserializer dataDeserializer = (dynamic json) => ListInvoicesForSpendByBusinessData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListInvoicesForSpendByBusinessVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListInvoicesForSpendByBusinessVariables vars= ListInvoicesForSpendByBusinessVariables(businessId: businessId,startDate: startDate,endDate: endDate,); + return _dataConnect.query("listInvoicesForSpendByBusiness", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListInvoicesForSpendByBusinessInvoices { + final String id; + final Timestamp issueDate; + final Timestamp dueDate; + final double amount; + final EnumValue status; + final String invoiceNumber; + final ListInvoicesForSpendByBusinessInvoicesVendor vendor; + final ListInvoicesForSpendByBusinessInvoicesBusiness business; + final ListInvoicesForSpendByBusinessInvoicesOrder order; + ListInvoicesForSpendByBusinessInvoices.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + issueDate = Timestamp.fromJson(json['issueDate']), + dueDate = Timestamp.fromJson(json['dueDate']), + amount = nativeFromJson(json['amount']), + status = invoiceStatusDeserializer(json['status']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + vendor = ListInvoicesForSpendByBusinessInvoicesVendor.fromJson(json['vendor']), + business = ListInvoicesForSpendByBusinessInvoicesBusiness.fromJson(json['business']), + order = ListInvoicesForSpendByBusinessInvoicesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByBusinessInvoices otherTyped = other as ListInvoicesForSpendByBusinessInvoices; + return id == otherTyped.id && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + amount == otherTyped.amount && + status == otherTyped.status && + invoiceNumber == otherTyped.invoiceNumber && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, issueDate.hashCode, dueDate.hashCode, amount.hashCode, status.hashCode, invoiceNumber.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['issueDate'] = issueDate.toJson(); + json['dueDate'] = dueDate.toJson(); + json['amount'] = nativeToJson(amount); + json['status'] = + invoiceStatusSerializer(status) + ; + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['vendor'] = vendor.toJson(); + json['business'] = business.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListInvoicesForSpendByBusinessInvoices({ + required this.id, + required this.issueDate, + required this.dueDate, + required this.amount, + required this.status, + required this.invoiceNumber, + required this.vendor, + required this.business, + required this.order, + }); +} + +@immutable +class ListInvoicesForSpendByBusinessInvoicesVendor { + final String id; + final String companyName; + ListInvoicesForSpendByBusinessInvoicesVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByBusinessInvoicesVendor otherTyped = other as ListInvoicesForSpendByBusinessInvoicesVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListInvoicesForSpendByBusinessInvoicesVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListInvoicesForSpendByBusinessInvoicesBusiness { + final String id; + final String businessName; + ListInvoicesForSpendByBusinessInvoicesBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByBusinessInvoicesBusiness otherTyped = other as ListInvoicesForSpendByBusinessInvoicesBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListInvoicesForSpendByBusinessInvoicesBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListInvoicesForSpendByBusinessInvoicesOrder { + final String id; + final String? eventName; + ListInvoicesForSpendByBusinessInvoicesOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByBusinessInvoicesOrder otherTyped = other as ListInvoicesForSpendByBusinessInvoicesOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + return json; + } + + ListInvoicesForSpendByBusinessInvoicesOrder({ + required this.id, + this.eventName, + }); +} + +@immutable +class ListInvoicesForSpendByBusinessData { + final List invoices; + ListInvoicesForSpendByBusinessData.fromJson(dynamic json): + + invoices = (json['invoices'] as List) + .map((e) => ListInvoicesForSpendByBusinessInvoices.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByBusinessData otherTyped = other as ListInvoicesForSpendByBusinessData; + return invoices == otherTyped.invoices; + + } + @override + int get hashCode => invoices.hashCode; + + + Map toJson() { + Map json = {}; + json['invoices'] = invoices.map((e) => e.toJson()).toList(); + return json; + } + + ListInvoicesForSpendByBusinessData({ + required this.invoices, + }); +} + +@immutable +class ListInvoicesForSpendByBusinessVariables { + final String businessId; + final Timestamp startDate; + final Timestamp endDate; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListInvoicesForSpendByBusinessVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']), + startDate = Timestamp.fromJson(json['startDate']), + endDate = Timestamp.fromJson(json['endDate']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByBusinessVariables otherTyped = other as ListInvoicesForSpendByBusinessVariables; + return businessId == otherTyped.businessId && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, startDate.hashCode, endDate.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + json['startDate'] = startDate.toJson(); + json['endDate'] = endDate.toJson(); + return json; + } + + ListInvoicesForSpendByBusinessVariables({ + required this.businessId, + required this.startDate, + required this.endDate, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_for_spend_by_order.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_for_spend_by_order.dart new file mode 100644 index 00000000..d8c0f580 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_for_spend_by_order.dart @@ -0,0 +1,297 @@ +part of 'generated.dart'; + +class ListInvoicesForSpendByOrderVariablesBuilder { + String orderId; + Timestamp startDate; + Timestamp endDate; + + final FirebaseDataConnect _dataConnect; + ListInvoicesForSpendByOrderVariablesBuilder(this._dataConnect, {required this.orderId,required this.startDate,required this.endDate,}); + Deserializer dataDeserializer = (dynamic json) => ListInvoicesForSpendByOrderData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListInvoicesForSpendByOrderVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListInvoicesForSpendByOrderVariables vars= ListInvoicesForSpendByOrderVariables(orderId: orderId,startDate: startDate,endDate: endDate,); + return _dataConnect.query("listInvoicesForSpendByOrder", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListInvoicesForSpendByOrderInvoices { + final String id; + final Timestamp issueDate; + final Timestamp dueDate; + final double amount; + final EnumValue status; + final String invoiceNumber; + final ListInvoicesForSpendByOrderInvoicesVendor vendor; + final ListInvoicesForSpendByOrderInvoicesBusiness business; + final ListInvoicesForSpendByOrderInvoicesOrder order; + ListInvoicesForSpendByOrderInvoices.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + issueDate = Timestamp.fromJson(json['issueDate']), + dueDate = Timestamp.fromJson(json['dueDate']), + amount = nativeFromJson(json['amount']), + status = invoiceStatusDeserializer(json['status']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + vendor = ListInvoicesForSpendByOrderInvoicesVendor.fromJson(json['vendor']), + business = ListInvoicesForSpendByOrderInvoicesBusiness.fromJson(json['business']), + order = ListInvoicesForSpendByOrderInvoicesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByOrderInvoices otherTyped = other as ListInvoicesForSpendByOrderInvoices; + return id == otherTyped.id && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + amount == otherTyped.amount && + status == otherTyped.status && + invoiceNumber == otherTyped.invoiceNumber && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, issueDate.hashCode, dueDate.hashCode, amount.hashCode, status.hashCode, invoiceNumber.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['issueDate'] = issueDate.toJson(); + json['dueDate'] = dueDate.toJson(); + json['amount'] = nativeToJson(amount); + json['status'] = + invoiceStatusSerializer(status) + ; + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['vendor'] = vendor.toJson(); + json['business'] = business.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListInvoicesForSpendByOrderInvoices({ + required this.id, + required this.issueDate, + required this.dueDate, + required this.amount, + required this.status, + required this.invoiceNumber, + required this.vendor, + required this.business, + required this.order, + }); +} + +@immutable +class ListInvoicesForSpendByOrderInvoicesVendor { + final String id; + final String companyName; + ListInvoicesForSpendByOrderInvoicesVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByOrderInvoicesVendor otherTyped = other as ListInvoicesForSpendByOrderInvoicesVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListInvoicesForSpendByOrderInvoicesVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListInvoicesForSpendByOrderInvoicesBusiness { + final String id; + final String businessName; + ListInvoicesForSpendByOrderInvoicesBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByOrderInvoicesBusiness otherTyped = other as ListInvoicesForSpendByOrderInvoicesBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListInvoicesForSpendByOrderInvoicesBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListInvoicesForSpendByOrderInvoicesOrder { + final String id; + final String? eventName; + ListInvoicesForSpendByOrderInvoicesOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByOrderInvoicesOrder otherTyped = other as ListInvoicesForSpendByOrderInvoicesOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + return json; + } + + ListInvoicesForSpendByOrderInvoicesOrder({ + required this.id, + this.eventName, + }); +} + +@immutable +class ListInvoicesForSpendByOrderData { + final List invoices; + ListInvoicesForSpendByOrderData.fromJson(dynamic json): + + invoices = (json['invoices'] as List) + .map((e) => ListInvoicesForSpendByOrderInvoices.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByOrderData otherTyped = other as ListInvoicesForSpendByOrderData; + return invoices == otherTyped.invoices; + + } + @override + int get hashCode => invoices.hashCode; + + + Map toJson() { + Map json = {}; + json['invoices'] = invoices.map((e) => e.toJson()).toList(); + return json; + } + + ListInvoicesForSpendByOrderData({ + required this.invoices, + }); +} + +@immutable +class ListInvoicesForSpendByOrderVariables { + final String orderId; + final Timestamp startDate; + final Timestamp endDate; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListInvoicesForSpendByOrderVariables.fromJson(Map json): + + orderId = nativeFromJson(json['orderId']), + startDate = Timestamp.fromJson(json['startDate']), + endDate = Timestamp.fromJson(json['endDate']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByOrderVariables otherTyped = other as ListInvoicesForSpendByOrderVariables; + return orderId == otherTyped.orderId && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate; + + } + @override + int get hashCode => Object.hashAll([orderId.hashCode, startDate.hashCode, endDate.hashCode]); + + + Map toJson() { + Map json = {}; + json['orderId'] = nativeToJson(orderId); + json['startDate'] = startDate.toJson(); + json['endDate'] = endDate.toJson(); + return json; + } + + ListInvoicesForSpendByOrderVariables({ + required this.orderId, + required this.startDate, + required this.endDate, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_for_spend_by_vendor.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_for_spend_by_vendor.dart new file mode 100644 index 00000000..a3d2f7fa --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_invoices_for_spend_by_vendor.dart @@ -0,0 +1,297 @@ +part of 'generated.dart'; + +class ListInvoicesForSpendByVendorVariablesBuilder { + String vendorId; + Timestamp startDate; + Timestamp endDate; + + final FirebaseDataConnect _dataConnect; + ListInvoicesForSpendByVendorVariablesBuilder(this._dataConnect, {required this.vendorId,required this.startDate,required this.endDate,}); + Deserializer dataDeserializer = (dynamic json) => ListInvoicesForSpendByVendorData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListInvoicesForSpendByVendorVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListInvoicesForSpendByVendorVariables vars= ListInvoicesForSpendByVendorVariables(vendorId: vendorId,startDate: startDate,endDate: endDate,); + return _dataConnect.query("listInvoicesForSpendByVendor", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListInvoicesForSpendByVendorInvoices { + final String id; + final Timestamp issueDate; + final Timestamp dueDate; + final double amount; + final EnumValue status; + final String invoiceNumber; + final ListInvoicesForSpendByVendorInvoicesVendor vendor; + final ListInvoicesForSpendByVendorInvoicesBusiness business; + final ListInvoicesForSpendByVendorInvoicesOrder order; + ListInvoicesForSpendByVendorInvoices.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + issueDate = Timestamp.fromJson(json['issueDate']), + dueDate = Timestamp.fromJson(json['dueDate']), + amount = nativeFromJson(json['amount']), + status = invoiceStatusDeserializer(json['status']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + vendor = ListInvoicesForSpendByVendorInvoicesVendor.fromJson(json['vendor']), + business = ListInvoicesForSpendByVendorInvoicesBusiness.fromJson(json['business']), + order = ListInvoicesForSpendByVendorInvoicesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByVendorInvoices otherTyped = other as ListInvoicesForSpendByVendorInvoices; + return id == otherTyped.id && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + amount == otherTyped.amount && + status == otherTyped.status && + invoiceNumber == otherTyped.invoiceNumber && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, issueDate.hashCode, dueDate.hashCode, amount.hashCode, status.hashCode, invoiceNumber.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['issueDate'] = issueDate.toJson(); + json['dueDate'] = dueDate.toJson(); + json['amount'] = nativeToJson(amount); + json['status'] = + invoiceStatusSerializer(status) + ; + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['vendor'] = vendor.toJson(); + json['business'] = business.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListInvoicesForSpendByVendorInvoices({ + required this.id, + required this.issueDate, + required this.dueDate, + required this.amount, + required this.status, + required this.invoiceNumber, + required this.vendor, + required this.business, + required this.order, + }); +} + +@immutable +class ListInvoicesForSpendByVendorInvoicesVendor { + final String id; + final String companyName; + ListInvoicesForSpendByVendorInvoicesVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByVendorInvoicesVendor otherTyped = other as ListInvoicesForSpendByVendorInvoicesVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListInvoicesForSpendByVendorInvoicesVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListInvoicesForSpendByVendorInvoicesBusiness { + final String id; + final String businessName; + ListInvoicesForSpendByVendorInvoicesBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByVendorInvoicesBusiness otherTyped = other as ListInvoicesForSpendByVendorInvoicesBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListInvoicesForSpendByVendorInvoicesBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListInvoicesForSpendByVendorInvoicesOrder { + final String id; + final String? eventName; + ListInvoicesForSpendByVendorInvoicesOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByVendorInvoicesOrder otherTyped = other as ListInvoicesForSpendByVendorInvoicesOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + return json; + } + + ListInvoicesForSpendByVendorInvoicesOrder({ + required this.id, + this.eventName, + }); +} + +@immutable +class ListInvoicesForSpendByVendorData { + final List invoices; + ListInvoicesForSpendByVendorData.fromJson(dynamic json): + + invoices = (json['invoices'] as List) + .map((e) => ListInvoicesForSpendByVendorInvoices.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByVendorData otherTyped = other as ListInvoicesForSpendByVendorData; + return invoices == otherTyped.invoices; + + } + @override + int get hashCode => invoices.hashCode; + + + Map toJson() { + Map json = {}; + json['invoices'] = invoices.map((e) => e.toJson()).toList(); + return json; + } + + ListInvoicesForSpendByVendorData({ + required this.invoices, + }); +} + +@immutable +class ListInvoicesForSpendByVendorVariables { + final String vendorId; + final Timestamp startDate; + final Timestamp endDate; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListInvoicesForSpendByVendorVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']), + startDate = Timestamp.fromJson(json['startDate']), + endDate = Timestamp.fromJson(json['endDate']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListInvoicesForSpendByVendorVariables otherTyped = other as ListInvoicesForSpendByVendorVariables; + return vendorId == otherTyped.vendorId && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, startDate.hashCode, endDate.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + json['startDate'] = startDate.toJson(); + json['endDate'] = endDate.toJson(); + return json; + } + + ListInvoicesForSpendByVendorVariables({ + required this.vendorId, + required this.startDate, + required this.endDate, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_levels.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_levels.dart new file mode 100644 index 00000000..f431c5a2 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_levels.dart @@ -0,0 +1,133 @@ +part of 'generated.dart'; + +class ListLevelsVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListLevelsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListLevelsData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listLevels", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListLevelsLevels { + final String id; + final String name; + final int xpRequired; + final String? icon; + final AnyValue? colors; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + ListLevelsLevels.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + xpRequired = nativeFromJson(json['xpRequired']), + icon = json['icon'] == null ? null : nativeFromJson(json['icon']), + colors = json['colors'] == null ? null : AnyValue.fromJson(json['colors']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListLevelsLevels otherTyped = other as ListLevelsLevels; + return id == otherTyped.id && + name == otherTyped.name && + xpRequired == otherTyped.xpRequired && + icon == otherTyped.icon && + colors == otherTyped.colors && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, xpRequired.hashCode, icon.hashCode, colors.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['xpRequired'] = nativeToJson(xpRequired); + if (icon != null) { + json['icon'] = nativeToJson(icon); + } + if (colors != null) { + json['colors'] = colors!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + ListLevelsLevels({ + required this.id, + required this.name, + required this.xpRequired, + this.icon, + this.colors, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class ListLevelsData { + final List levels; + ListLevelsData.fromJson(dynamic json): + + levels = (json['levels'] as List) + .map((e) => ListLevelsLevels.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListLevelsData otherTyped = other as ListLevelsData; + return levels == otherTyped.levels; + + } + @override + int get hashCode => levels.hashCode; + + + Map toJson() { + Map json = {}; + json['levels'] = levels.map((e) => e.toJson()).toList(); + return json; + } + + ListLevelsData({ + required this.levels, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_messages.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_messages.dart new file mode 100644 index 00000000..0f842596 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_messages.dart @@ -0,0 +1,158 @@ +part of 'generated.dart'; + +class ListMessagesVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListMessagesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListMessagesData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listMessages", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListMessagesMessages { + final String id; + final String conversationId; + final String senderId; + final String content; + final bool? isSystem; + final Timestamp? createdAt; + final ListMessagesMessagesUser user; + ListMessagesMessages.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + conversationId = nativeFromJson(json['conversationId']), + senderId = nativeFromJson(json['senderId']), + content = nativeFromJson(json['content']), + isSystem = json['isSystem'] == null ? null : nativeFromJson(json['isSystem']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + user = ListMessagesMessagesUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListMessagesMessages otherTyped = other as ListMessagesMessages; + return id == otherTyped.id && + conversationId == otherTyped.conversationId && + senderId == otherTyped.senderId && + content == otherTyped.content && + isSystem == otherTyped.isSystem && + createdAt == otherTyped.createdAt && + user == otherTyped.user; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, conversationId.hashCode, senderId.hashCode, content.hashCode, isSystem.hashCode, createdAt.hashCode, user.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['conversationId'] = nativeToJson(conversationId); + json['senderId'] = nativeToJson(senderId); + json['content'] = nativeToJson(content); + if (isSystem != null) { + json['isSystem'] = nativeToJson(isSystem); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['user'] = user.toJson(); + return json; + } + + ListMessagesMessages({ + required this.id, + required this.conversationId, + required this.senderId, + required this.content, + this.isSystem, + this.createdAt, + required this.user, + }); +} + +@immutable +class ListMessagesMessagesUser { + final String? fullName; + ListMessagesMessagesUser.fromJson(dynamic json): + + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListMessagesMessagesUser otherTyped = other as ListMessagesMessagesUser; + return fullName == otherTyped.fullName; + + } + @override + int get hashCode => fullName.hashCode; + + + Map toJson() { + Map json = {}; + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + return json; + } + + ListMessagesMessagesUser({ + this.fullName, + }); +} + +@immutable +class ListMessagesData { + final List messages; + ListMessagesData.fromJson(dynamic json): + + messages = (json['messages'] as List) + .map((e) => ListMessagesMessages.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListMessagesData otherTyped = other as ListMessagesData; + return messages == otherTyped.messages; + + } + @override + int get hashCode => messages.hashCode; + + + Map toJson() { + Map json = {}; + json['messages'] = messages.map((e) => e.toJson()).toList(); + return json; + } + + ListMessagesData({ + required this.messages, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_orders.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_orders.dart new file mode 100644 index 00000000..8ba465b5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_orders.dart @@ -0,0 +1,408 @@ +part of 'generated.dart'; + +class ListOrdersVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListOrdersVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListOrdersVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListOrdersVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListOrdersData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListOrdersVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListOrdersVariables vars= ListOrdersVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listOrders", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListOrdersOrders { + final String id; + final String? eventName; + final String? vendorId; + final String businessId; + final EnumValue orderType; + final String? location; + final EnumValue status; + final Timestamp? date; + final Timestamp? startDate; + final Timestamp? endDate; + final EnumValue? duration; + final int? lunchBreak; + final double? total; + final AnyValue? assignedStaff; + final AnyValue? shifts; + final int? requested; + final String? hub; + final AnyValue? recurringDays; + final AnyValue? permanentDays; + final String? poReference; + final AnyValue? detectedConflicts; + final String? notes; + final Timestamp? createdAt; + final ListOrdersOrdersBusiness business; + final ListOrdersOrdersVendor? vendor; + ListOrdersOrders.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderType = orderTypeDeserializer(json['orderType']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = orderStatusDeserializer(json['status']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startDate = json['startDate'] == null ? null : Timestamp.fromJson(json['startDate']), + endDate = json['endDate'] == null ? null : Timestamp.fromJson(json['endDate']), + duration = json['duration'] == null ? null : orderDurationDeserializer(json['duration']), + lunchBreak = json['lunchBreak'] == null ? null : nativeFromJson(json['lunchBreak']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + assignedStaff = json['assignedStaff'] == null ? null : AnyValue.fromJson(json['assignedStaff']), + shifts = json['shifts'] == null ? null : AnyValue.fromJson(json['shifts']), + requested = json['requested'] == null ? null : nativeFromJson(json['requested']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), + permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']), + detectedConflicts = json['detectedConflicts'] == null ? null : AnyValue.fromJson(json['detectedConflicts']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + business = ListOrdersOrdersBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : ListOrdersOrdersVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListOrdersOrders otherTyped = other as ListOrdersOrders; + return id == otherTyped.id && + eventName == otherTyped.eventName && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderType == otherTyped.orderType && + location == otherTyped.location && + status == otherTyped.status && + date == otherTyped.date && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate && + duration == otherTyped.duration && + lunchBreak == otherTyped.lunchBreak && + total == otherTyped.total && + assignedStaff == otherTyped.assignedStaff && + shifts == otherTyped.shifts && + requested == otherTyped.requested && + hub == otherTyped.hub && + recurringDays == otherTyped.recurringDays && + permanentDays == otherTyped.permanentDays && + poReference == otherTyped.poReference && + detectedConflicts == otherTyped.detectedConflicts && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, vendorId.hashCode, businessId.hashCode, orderType.hashCode, location.hashCode, status.hashCode, date.hashCode, startDate.hashCode, endDate.hashCode, duration.hashCode, lunchBreak.hashCode, total.hashCode, assignedStaff.hashCode, shifts.hashCode, requested.hashCode, hub.hashCode, recurringDays.hashCode, permanentDays.hashCode, poReference.hashCode, detectedConflicts.hashCode, notes.hashCode, createdAt.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + json['businessId'] = nativeToJson(businessId); + json['orderType'] = + orderTypeSerializer(orderType) + ; + if (location != null) { + json['location'] = nativeToJson(location); + } + json['status'] = + orderStatusSerializer(status) + ; + if (date != null) { + json['date'] = date!.toJson(); + } + if (startDate != null) { + json['startDate'] = startDate!.toJson(); + } + if (endDate != null) { + json['endDate'] = endDate!.toJson(); + } + if (duration != null) { + json['duration'] = + orderDurationSerializer(duration!) + ; + } + if (lunchBreak != null) { + json['lunchBreak'] = nativeToJson(lunchBreak); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (assignedStaff != null) { + json['assignedStaff'] = assignedStaff!.toJson(); + } + if (shifts != null) { + json['shifts'] = shifts!.toJson(); + } + if (requested != null) { + json['requested'] = nativeToJson(requested); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (recurringDays != null) { + json['recurringDays'] = recurringDays!.toJson(); + } + if (permanentDays != null) { + json['permanentDays'] = permanentDays!.toJson(); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + if (detectedConflicts != null) { + json['detectedConflicts'] = detectedConflicts!.toJson(); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + ListOrdersOrders({ + required this.id, + this.eventName, + this.vendorId, + required this.businessId, + required this.orderType, + this.location, + required this.status, + this.date, + this.startDate, + this.endDate, + this.duration, + this.lunchBreak, + this.total, + this.assignedStaff, + this.shifts, + this.requested, + this.hub, + this.recurringDays, + this.permanentDays, + this.poReference, + this.detectedConflicts, + this.notes, + this.createdAt, + required this.business, + this.vendor, + }); +} + +@immutable +class ListOrdersOrdersBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + ListOrdersOrdersBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListOrdersOrdersBusiness otherTyped = other as ListOrdersOrdersBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + ListOrdersOrdersBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class ListOrdersOrdersVendor { + final String id; + final String companyName; + ListOrdersOrdersVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListOrdersOrdersVendor otherTyped = other as ListOrdersOrdersVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListOrdersOrdersVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListOrdersData { + final List orders; + ListOrdersData.fromJson(dynamic json): + + orders = (json['orders'] as List) + .map((e) => ListOrdersOrders.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListOrdersData otherTyped = other as ListOrdersData; + return orders == otherTyped.orders; + + } + @override + int get hashCode => orders.hashCode; + + + Map toJson() { + Map json = {}; + json['orders'] = orders.map((e) => e.toJson()).toList(); + return json; + } + + ListOrdersData({ + required this.orders, + }); +} + +@immutable +class ListOrdersVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListOrdersVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListOrdersVariables otherTyped = other as ListOrdersVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListOrdersVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_overdue_invoices.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_overdue_invoices.dart new file mode 100644 index 00000000..6c439434 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_overdue_invoices.dart @@ -0,0 +1,481 @@ +part of 'generated.dart'; + +class ListOverdueInvoicesVariablesBuilder { + Timestamp now; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListOverdueInvoicesVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListOverdueInvoicesVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListOverdueInvoicesVariablesBuilder(this._dataConnect, {required this.now,}); + Deserializer dataDeserializer = (dynamic json) => ListOverdueInvoicesData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListOverdueInvoicesVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListOverdueInvoicesVariables vars= ListOverdueInvoicesVariables(now: now,offset: _offset,limit: _limit,); + return _dataConnect.query("listOverdueInvoices", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListOverdueInvoicesInvoices { + final String id; + final EnumValue status; + final String vendorId; + final String businessId; + final String orderId; + final EnumValue? paymentTerms; + final String invoiceNumber; + final Timestamp issueDate; + final Timestamp dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final AnyValue? disputedItems; + final String? disputeReason; + final String? disputeDetails; + final ListOverdueInvoicesInvoicesVendor vendor; + final ListOverdueInvoicesInvoicesBusiness business; + final ListOverdueInvoicesInvoicesOrder order; + ListOverdueInvoicesInvoices.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + status = invoiceStatusDeserializer(json['status']), + vendorId = nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderId = nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsDeserializer(json['paymentTerms']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + issueDate = Timestamp.fromJson(json['issueDate']), + dueDate = Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + disputedItems = json['disputedItems'] == null ? null : AnyValue.fromJson(json['disputedItems']), + disputeReason = json['disputeReason'] == null ? null : nativeFromJson(json['disputeReason']), + disputeDetails = json['disputeDetails'] == null ? null : nativeFromJson(json['disputeDetails']), + vendor = ListOverdueInvoicesInvoicesVendor.fromJson(json['vendor']), + business = ListOverdueInvoicesInvoicesBusiness.fromJson(json['business']), + order = ListOverdueInvoicesInvoicesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListOverdueInvoicesInvoices otherTyped = other as ListOverdueInvoicesInvoices; + return id == otherTyped.id && + status == otherTyped.status && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + disputedItems == otherTyped.disputedItems && + disputeReason == otherTyped.disputeReason && + disputeDetails == otherTyped.disputeDetails && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, status.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, disputedItems.hashCode, disputeReason.hashCode, disputeDetails.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['status'] = + invoiceStatusSerializer(status) + ; + json['vendorId'] = nativeToJson(vendorId); + json['businessId'] = nativeToJson(businessId); + json['orderId'] = nativeToJson(orderId); + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsSerializer(paymentTerms!) + ; + } + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['issueDate'] = issueDate.toJson(); + json['dueDate'] = dueDate.toJson(); + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + json['amount'] = nativeToJson(amount); + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (disputedItems != null) { + json['disputedItems'] = disputedItems!.toJson(); + } + if (disputeReason != null) { + json['disputeReason'] = nativeToJson(disputeReason); + } + if (disputeDetails != null) { + json['disputeDetails'] = nativeToJson(disputeDetails); + } + json['vendor'] = vendor.toJson(); + json['business'] = business.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListOverdueInvoicesInvoices({ + required this.id, + required this.status, + required this.vendorId, + required this.businessId, + required this.orderId, + this.paymentTerms, + required this.invoiceNumber, + required this.issueDate, + required this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + required this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.disputedItems, + this.disputeReason, + this.disputeDetails, + required this.vendor, + required this.business, + required this.order, + }); +} + +@immutable +class ListOverdueInvoicesInvoicesVendor { + final String companyName; + final String? address; + final String? email; + final String? phone; + ListOverdueInvoicesInvoicesVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListOverdueInvoicesInvoicesVendor otherTyped = other as ListOverdueInvoicesInvoicesVendor; + return companyName == otherTyped.companyName && + address == otherTyped.address && + email == otherTyped.email && + phone == otherTyped.phone; + + } + @override + int get hashCode => Object.hashAll([companyName.hashCode, address.hashCode, email.hashCode, phone.hashCode]); + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + return json; + } + + ListOverdueInvoicesInvoicesVendor({ + required this.companyName, + this.address, + this.email, + this.phone, + }); +} + +@immutable +class ListOverdueInvoicesInvoicesBusiness { + final String businessName; + final String? address; + final String? phone; + final String? email; + ListOverdueInvoicesInvoicesBusiness.fromJson(dynamic json): + + businessName = nativeFromJson(json['businessName']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListOverdueInvoicesInvoicesBusiness otherTyped = other as ListOverdueInvoicesInvoicesBusiness; + return businessName == otherTyped.businessName && + address == otherTyped.address && + phone == otherTyped.phone && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([businessName.hashCode, address.hashCode, phone.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessName'] = nativeToJson(businessName); + if (address != null) { + json['address'] = nativeToJson(address); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + ListOverdueInvoicesInvoicesBusiness({ + required this.businessName, + this.address, + this.phone, + this.email, + }); +} + +@immutable +class ListOverdueInvoicesInvoicesOrder { + final String? eventName; + final String? hub; + final String? deparment; + final String? poReference; + ListOverdueInvoicesInvoicesOrder.fromJson(dynamic json): + + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + deparment = json['deparment'] == null ? null : nativeFromJson(json['deparment']), + poReference = json['poReference'] == null ? null : nativeFromJson(json['poReference']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListOverdueInvoicesInvoicesOrder otherTyped = other as ListOverdueInvoicesInvoicesOrder; + return eventName == otherTyped.eventName && + hub == otherTyped.hub && + deparment == otherTyped.deparment && + poReference == otherTyped.poReference; + + } + @override + int get hashCode => Object.hashAll([eventName.hashCode, hub.hashCode, deparment.hashCode, poReference.hashCode]); + + + Map toJson() { + Map json = {}; + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (deparment != null) { + json['deparment'] = nativeToJson(deparment); + } + if (poReference != null) { + json['poReference'] = nativeToJson(poReference); + } + return json; + } + + ListOverdueInvoicesInvoicesOrder({ + this.eventName, + this.hub, + this.deparment, + this.poReference, + }); +} + +@immutable +class ListOverdueInvoicesData { + final List invoices; + ListOverdueInvoicesData.fromJson(dynamic json): + + invoices = (json['invoices'] as List) + .map((e) => ListOverdueInvoicesInvoices.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListOverdueInvoicesData otherTyped = other as ListOverdueInvoicesData; + return invoices == otherTyped.invoices; + + } + @override + int get hashCode => invoices.hashCode; + + + Map toJson() { + Map json = {}; + json['invoices'] = invoices.map((e) => e.toJson()).toList(); + return json; + } + + ListOverdueInvoicesData({ + required this.invoices, + }); +} + +@immutable +class ListOverdueInvoicesVariables { + final Timestamp now; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListOverdueInvoicesVariables.fromJson(Map json): + + now = Timestamp.fromJson(json['now']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListOverdueInvoicesVariables otherTyped = other as ListOverdueInvoicesVariables; + return now == otherTyped.now && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([now.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['now'] = now.toJson(); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListOverdueInvoicesVariables({ + required this.now, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments.dart new file mode 100644 index 00000000..511a08c5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments.dart @@ -0,0 +1,608 @@ +part of 'generated.dart'; + +class ListRecentPaymentsVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListRecentPaymentsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListRecentPaymentsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListRecentPaymentsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListRecentPaymentsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListRecentPaymentsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListRecentPaymentsVariables vars= ListRecentPaymentsVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listRecentPayments", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListRecentPaymentsRecentPayments { + final String id; + final String? workedTime; + final EnumValue? status; + final String staffId; + final String applicationId; + final String invoiceId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListRecentPaymentsRecentPaymentsApplication application; + final ListRecentPaymentsRecentPaymentsInvoice invoice; + ListRecentPaymentsRecentPayments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workedTime = json['workedTime'] == null ? null : nativeFromJson(json['workedTime']), + status = json['status'] == null ? null : recentPaymentStatusDeserializer(json['status']), + staffId = nativeFromJson(json['staffId']), + applicationId = nativeFromJson(json['applicationId']), + invoiceId = nativeFromJson(json['invoiceId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + application = ListRecentPaymentsRecentPaymentsApplication.fromJson(json['application']), + invoice = ListRecentPaymentsRecentPaymentsInvoice.fromJson(json['invoice']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsRecentPayments otherTyped = other as ListRecentPaymentsRecentPayments; + return id == otherTyped.id && + workedTime == otherTyped.workedTime && + status == otherTyped.status && + staffId == otherTyped.staffId && + applicationId == otherTyped.applicationId && + invoiceId == otherTyped.invoiceId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + application == otherTyped.application && + invoice == otherTyped.invoice; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workedTime.hashCode, status.hashCode, staffId.hashCode, applicationId.hashCode, invoiceId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, application.hashCode, invoice.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (workedTime != null) { + json['workedTime'] = nativeToJson(workedTime); + } + if (status != null) { + json['status'] = + recentPaymentStatusSerializer(status!) + ; + } + json['staffId'] = nativeToJson(staffId); + json['applicationId'] = nativeToJson(applicationId); + json['invoiceId'] = nativeToJson(invoiceId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['application'] = application.toJson(); + json['invoice'] = invoice.toJson(); + return json; + } + + ListRecentPaymentsRecentPayments({ + required this.id, + this.workedTime, + this.status, + required this.staffId, + required this.applicationId, + required this.invoiceId, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.application, + required this.invoice, + }); +} + +@immutable +class ListRecentPaymentsRecentPaymentsApplication { + final Timestamp? checkInTime; + final Timestamp? checkOutTime; + final ListRecentPaymentsRecentPaymentsApplicationShiftRole shiftRole; + ListRecentPaymentsRecentPaymentsApplication.fromJson(dynamic json): + + checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']), + checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']), + shiftRole = ListRecentPaymentsRecentPaymentsApplicationShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsRecentPaymentsApplication otherTyped = other as ListRecentPaymentsRecentPaymentsApplication; + return checkInTime == otherTyped.checkInTime && + checkOutTime == otherTyped.checkOutTime && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([checkInTime.hashCode, checkOutTime.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + if (checkInTime != null) { + json['checkInTime'] = checkInTime!.toJson(); + } + if (checkOutTime != null) { + json['checkOutTime'] = checkOutTime!.toJson(); + } + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + ListRecentPaymentsRecentPaymentsApplication({ + this.checkInTime, + this.checkOutTime, + required this.shiftRole, + }); +} + +@immutable +class ListRecentPaymentsRecentPaymentsApplicationShiftRole { + final double? hours; + final double? totalValue; + final Timestamp? startTime; + final Timestamp? endTime; + final ListRecentPaymentsRecentPaymentsApplicationShiftRoleRole role; + final ListRecentPaymentsRecentPaymentsApplicationShiftRoleShift shift; + ListRecentPaymentsRecentPaymentsApplicationShiftRole.fromJson(dynamic json): + + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + role = ListRecentPaymentsRecentPaymentsApplicationShiftRoleRole.fromJson(json['role']), + shift = ListRecentPaymentsRecentPaymentsApplicationShiftRoleShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsRecentPaymentsApplicationShiftRole otherTyped = other as ListRecentPaymentsRecentPaymentsApplicationShiftRole; + return hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([hours.hashCode, totalValue.hashCode, startTime.hashCode, endTime.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListRecentPaymentsRecentPaymentsApplicationShiftRole({ + this.hours, + this.totalValue, + this.startTime, + this.endTime, + required this.role, + required this.shift, + }); +} + +@immutable +class ListRecentPaymentsRecentPaymentsApplicationShiftRoleRole { + final String name; + final double costPerHour; + ListRecentPaymentsRecentPaymentsApplicationShiftRoleRole.fromJson(dynamic json): + + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsRecentPaymentsApplicationShiftRoleRole otherTyped = other as ListRecentPaymentsRecentPaymentsApplicationShiftRoleRole; + return name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListRecentPaymentsRecentPaymentsApplicationShiftRoleRole({ + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListRecentPaymentsRecentPaymentsApplicationShiftRoleShift { + final String title; + final Timestamp? date; + final String? location; + final String? locationAddress; + final String? description; + ListRecentPaymentsRecentPaymentsApplicationShiftRoleShift.fromJson(dynamic json): + + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + description = json['description'] == null ? null : nativeFromJson(json['description']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsRecentPaymentsApplicationShiftRoleShift otherTyped = other as ListRecentPaymentsRecentPaymentsApplicationShiftRoleShift; + return title == otherTyped.title && + date == otherTyped.date && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + description == otherTyped.description; + + } + @override + int get hashCode => Object.hashAll([title.hashCode, date.hashCode, location.hashCode, locationAddress.hashCode, description.hashCode]); + + + Map toJson() { + Map json = {}; + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + return json; + } + + ListRecentPaymentsRecentPaymentsApplicationShiftRoleShift({ + required this.title, + this.date, + this.location, + this.locationAddress, + this.description, + }); +} + +@immutable +class ListRecentPaymentsRecentPaymentsInvoice { + final EnumValue status; + final String invoiceNumber; + final Timestamp issueDate; + final ListRecentPaymentsRecentPaymentsInvoiceBusiness business; + final ListRecentPaymentsRecentPaymentsInvoiceVendor vendor; + final ListRecentPaymentsRecentPaymentsInvoiceOrder order; + ListRecentPaymentsRecentPaymentsInvoice.fromJson(dynamic json): + + status = invoiceStatusDeserializer(json['status']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + issueDate = Timestamp.fromJson(json['issueDate']), + business = ListRecentPaymentsRecentPaymentsInvoiceBusiness.fromJson(json['business']), + vendor = ListRecentPaymentsRecentPaymentsInvoiceVendor.fromJson(json['vendor']), + order = ListRecentPaymentsRecentPaymentsInvoiceOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsRecentPaymentsInvoice otherTyped = other as ListRecentPaymentsRecentPaymentsInvoice; + return status == otherTyped.status && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + business == otherTyped.business && + vendor == otherTyped.vendor && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([status.hashCode, invoiceNumber.hashCode, issueDate.hashCode, business.hashCode, vendor.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['status'] = + invoiceStatusSerializer(status) + ; + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['issueDate'] = issueDate.toJson(); + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListRecentPaymentsRecentPaymentsInvoice({ + required this.status, + required this.invoiceNumber, + required this.issueDate, + required this.business, + required this.vendor, + required this.order, + }); +} + +@immutable +class ListRecentPaymentsRecentPaymentsInvoiceBusiness { + final String id; + final String businessName; + ListRecentPaymentsRecentPaymentsInvoiceBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsRecentPaymentsInvoiceBusiness otherTyped = other as ListRecentPaymentsRecentPaymentsInvoiceBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListRecentPaymentsRecentPaymentsInvoiceBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListRecentPaymentsRecentPaymentsInvoiceVendor { + final String id; + final String companyName; + ListRecentPaymentsRecentPaymentsInvoiceVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsRecentPaymentsInvoiceVendor otherTyped = other as ListRecentPaymentsRecentPaymentsInvoiceVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListRecentPaymentsRecentPaymentsInvoiceVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListRecentPaymentsRecentPaymentsInvoiceOrder { + final String id; + final String? eventName; + ListRecentPaymentsRecentPaymentsInvoiceOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsRecentPaymentsInvoiceOrder otherTyped = other as ListRecentPaymentsRecentPaymentsInvoiceOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + return json; + } + + ListRecentPaymentsRecentPaymentsInvoiceOrder({ + required this.id, + this.eventName, + }); +} + +@immutable +class ListRecentPaymentsData { + final List recentPayments; + ListRecentPaymentsData.fromJson(dynamic json): + + recentPayments = (json['recentPayments'] as List) + .map((e) => ListRecentPaymentsRecentPayments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsData otherTyped = other as ListRecentPaymentsData; + return recentPayments == otherTyped.recentPayments; + + } + @override + int get hashCode => recentPayments.hashCode; + + + Map toJson() { + Map json = {}; + json['recentPayments'] = recentPayments.map((e) => e.toJson()).toList(); + return json; + } + + ListRecentPaymentsData({ + required this.recentPayments, + }); +} + +@immutable +class ListRecentPaymentsVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListRecentPaymentsVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsVariables otherTyped = other as ListRecentPaymentsVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListRecentPaymentsVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_application_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_application_id.dart new file mode 100644 index 00000000..da902a94 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_application_id.dart @@ -0,0 +1,607 @@ +part of 'generated.dart'; + +class ListRecentPaymentsByApplicationIdVariablesBuilder { + String applicationId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListRecentPaymentsByApplicationIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListRecentPaymentsByApplicationIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListRecentPaymentsByApplicationIdVariablesBuilder(this._dataConnect, {required this.applicationId,}); + Deserializer dataDeserializer = (dynamic json) => ListRecentPaymentsByApplicationIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListRecentPaymentsByApplicationIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListRecentPaymentsByApplicationIdVariables vars= ListRecentPaymentsByApplicationIdVariables(applicationId: applicationId,offset: _offset,limit: _limit,); + return _dataConnect.query("listRecentPaymentsByApplicationId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListRecentPaymentsByApplicationIdRecentPayments { + final String id; + final String? workedTime; + final EnumValue? status; + final String staffId; + final String applicationId; + final String invoiceId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListRecentPaymentsByApplicationIdRecentPaymentsApplication application; + final ListRecentPaymentsByApplicationIdRecentPaymentsInvoice invoice; + ListRecentPaymentsByApplicationIdRecentPayments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workedTime = json['workedTime'] == null ? null : nativeFromJson(json['workedTime']), + status = json['status'] == null ? null : recentPaymentStatusDeserializer(json['status']), + staffId = nativeFromJson(json['staffId']), + applicationId = nativeFromJson(json['applicationId']), + invoiceId = nativeFromJson(json['invoiceId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + application = ListRecentPaymentsByApplicationIdRecentPaymentsApplication.fromJson(json['application']), + invoice = ListRecentPaymentsByApplicationIdRecentPaymentsInvoice.fromJson(json['invoice']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByApplicationIdRecentPayments otherTyped = other as ListRecentPaymentsByApplicationIdRecentPayments; + return id == otherTyped.id && + workedTime == otherTyped.workedTime && + status == otherTyped.status && + staffId == otherTyped.staffId && + applicationId == otherTyped.applicationId && + invoiceId == otherTyped.invoiceId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + application == otherTyped.application && + invoice == otherTyped.invoice; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workedTime.hashCode, status.hashCode, staffId.hashCode, applicationId.hashCode, invoiceId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, application.hashCode, invoice.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (workedTime != null) { + json['workedTime'] = nativeToJson(workedTime); + } + if (status != null) { + json['status'] = + recentPaymentStatusSerializer(status!) + ; + } + json['staffId'] = nativeToJson(staffId); + json['applicationId'] = nativeToJson(applicationId); + json['invoiceId'] = nativeToJson(invoiceId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['application'] = application.toJson(); + json['invoice'] = invoice.toJson(); + return json; + } + + ListRecentPaymentsByApplicationIdRecentPayments({ + required this.id, + this.workedTime, + this.status, + required this.staffId, + required this.applicationId, + required this.invoiceId, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.application, + required this.invoice, + }); +} + +@immutable +class ListRecentPaymentsByApplicationIdRecentPaymentsApplication { + final String id; + final EnumValue status; + final ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRole shiftRole; + ListRecentPaymentsByApplicationIdRecentPaymentsApplication.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + status = applicationStatusDeserializer(json['status']), + shiftRole = ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByApplicationIdRecentPaymentsApplication otherTyped = other as ListRecentPaymentsByApplicationIdRecentPaymentsApplication; + return id == otherTyped.id && + status == otherTyped.status && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, status.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['status'] = + applicationStatusSerializer(status) + ; + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + ListRecentPaymentsByApplicationIdRecentPaymentsApplication({ + required this.id, + required this.status, + required this.shiftRole, + }); +} + +@immutable +class ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRole { + final double? hours; + final double? totalValue; + final ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRoleRole role; + final ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRoleShift shift; + ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRole.fromJson(dynamic json): + + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRoleRole.fromJson(json['role']), + shift = ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRoleShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRole otherTyped = other as ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRole; + return hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([hours.hashCode, totalValue.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRole({ + this.hours, + this.totalValue, + required this.role, + required this.shift, + }); +} + +@immutable +class ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRoleRole { + final String id; + final String name; + final double costPerHour; + ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRoleRole otherTyped = other as ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRoleShift { + final String id; + final String title; + final Timestamp? date; + final String? locationAddress; + ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRoleShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRoleShift otherTyped = other as ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRoleShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + locationAddress == otherTyped.locationAddress; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, locationAddress.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + return json; + } + + ListRecentPaymentsByApplicationIdRecentPaymentsApplicationShiftRoleShift({ + required this.id, + required this.title, + this.date, + this.locationAddress, + }); +} + +@immutable +class ListRecentPaymentsByApplicationIdRecentPaymentsInvoice { + final String id; + final String invoiceNumber; + final EnumValue status; + final double amount; + final ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceBusiness business; + final ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceVendor vendor; + final ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceOrder order; + ListRecentPaymentsByApplicationIdRecentPaymentsInvoice.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + status = invoiceStatusDeserializer(json['status']), + amount = nativeFromJson(json['amount']), + business = ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceBusiness.fromJson(json['business']), + vendor = ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceVendor.fromJson(json['vendor']), + order = ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByApplicationIdRecentPaymentsInvoice otherTyped = other as ListRecentPaymentsByApplicationIdRecentPaymentsInvoice; + return id == otherTyped.id && + invoiceNumber == otherTyped.invoiceNumber && + status == otherTyped.status && + amount == otherTyped.amount && + business == otherTyped.business && + vendor == otherTyped.vendor && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, invoiceNumber.hashCode, status.hashCode, amount.hashCode, business.hashCode, vendor.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['status'] = + invoiceStatusSerializer(status) + ; + json['amount'] = nativeToJson(amount); + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListRecentPaymentsByApplicationIdRecentPaymentsInvoice({ + required this.id, + required this.invoiceNumber, + required this.status, + required this.amount, + required this.business, + required this.vendor, + required this.order, + }); +} + +@immutable +class ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceBusiness { + final String id; + final String businessName; + ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceBusiness otherTyped = other as ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceVendor { + final String id; + final String companyName; + ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceVendor otherTyped = other as ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceOrder { + final String id; + final String? eventName; + final String? location; + ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + location = json['location'] == null ? null : nativeFromJson(json['location']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceOrder otherTyped = other as ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + location == otherTyped.location; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, location.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + return json; + } + + ListRecentPaymentsByApplicationIdRecentPaymentsInvoiceOrder({ + required this.id, + this.eventName, + this.location, + }); +} + +@immutable +class ListRecentPaymentsByApplicationIdData { + final List recentPayments; + ListRecentPaymentsByApplicationIdData.fromJson(dynamic json): + + recentPayments = (json['recentPayments'] as List) + .map((e) => ListRecentPaymentsByApplicationIdRecentPayments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByApplicationIdData otherTyped = other as ListRecentPaymentsByApplicationIdData; + return recentPayments == otherTyped.recentPayments; + + } + @override + int get hashCode => recentPayments.hashCode; + + + Map toJson() { + Map json = {}; + json['recentPayments'] = recentPayments.map((e) => e.toJson()).toList(); + return json; + } + + ListRecentPaymentsByApplicationIdData({ + required this.recentPayments, + }); +} + +@immutable +class ListRecentPaymentsByApplicationIdVariables { + final String applicationId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListRecentPaymentsByApplicationIdVariables.fromJson(Map json): + + applicationId = nativeFromJson(json['applicationId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByApplicationIdVariables otherTyped = other as ListRecentPaymentsByApplicationIdVariables; + return applicationId == otherTyped.applicationId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([applicationId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['applicationId'] = nativeToJson(applicationId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListRecentPaymentsByApplicationIdVariables({ + required this.applicationId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_business_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_business_id.dart new file mode 100644 index 00000000..bbe69db2 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_business_id.dart @@ -0,0 +1,657 @@ +part of 'generated.dart'; + +class ListRecentPaymentsByBusinessIdVariablesBuilder { + String businessId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListRecentPaymentsByBusinessIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListRecentPaymentsByBusinessIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListRecentPaymentsByBusinessIdVariablesBuilder(this._dataConnect, {required this.businessId,}); + Deserializer dataDeserializer = (dynamic json) => ListRecentPaymentsByBusinessIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListRecentPaymentsByBusinessIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListRecentPaymentsByBusinessIdVariables vars= ListRecentPaymentsByBusinessIdVariables(businessId: businessId,offset: _offset,limit: _limit,); + return _dataConnect.query("listRecentPaymentsByBusinessId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListRecentPaymentsByBusinessIdRecentPayments { + final String id; + final String? workedTime; + final EnumValue? status; + final String staffId; + final String applicationId; + final String invoiceId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListRecentPaymentsByBusinessIdRecentPaymentsApplication application; + final ListRecentPaymentsByBusinessIdRecentPaymentsInvoice invoice; + ListRecentPaymentsByBusinessIdRecentPayments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workedTime = json['workedTime'] == null ? null : nativeFromJson(json['workedTime']), + status = json['status'] == null ? null : recentPaymentStatusDeserializer(json['status']), + staffId = nativeFromJson(json['staffId']), + applicationId = nativeFromJson(json['applicationId']), + invoiceId = nativeFromJson(json['invoiceId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + application = ListRecentPaymentsByBusinessIdRecentPaymentsApplication.fromJson(json['application']), + invoice = ListRecentPaymentsByBusinessIdRecentPaymentsInvoice.fromJson(json['invoice']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByBusinessIdRecentPayments otherTyped = other as ListRecentPaymentsByBusinessIdRecentPayments; + return id == otherTyped.id && + workedTime == otherTyped.workedTime && + status == otherTyped.status && + staffId == otherTyped.staffId && + applicationId == otherTyped.applicationId && + invoiceId == otherTyped.invoiceId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + application == otherTyped.application && + invoice == otherTyped.invoice; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workedTime.hashCode, status.hashCode, staffId.hashCode, applicationId.hashCode, invoiceId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, application.hashCode, invoice.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (workedTime != null) { + json['workedTime'] = nativeToJson(workedTime); + } + if (status != null) { + json['status'] = + recentPaymentStatusSerializer(status!) + ; + } + json['staffId'] = nativeToJson(staffId); + json['applicationId'] = nativeToJson(applicationId); + json['invoiceId'] = nativeToJson(invoiceId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['application'] = application.toJson(); + json['invoice'] = invoice.toJson(); + return json; + } + + ListRecentPaymentsByBusinessIdRecentPayments({ + required this.id, + this.workedTime, + this.status, + required this.staffId, + required this.applicationId, + required this.invoiceId, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.application, + required this.invoice, + }); +} + +@immutable +class ListRecentPaymentsByBusinessIdRecentPaymentsApplication { + final String id; + final String staffId; + final Timestamp? checkInTime; + final Timestamp? checkOutTime; + final ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRole shiftRole; + ListRecentPaymentsByBusinessIdRecentPaymentsApplication.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + checkInTime = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']), + checkOutTime = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']), + shiftRole = ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByBusinessIdRecentPaymentsApplication otherTyped = other as ListRecentPaymentsByBusinessIdRecentPaymentsApplication; + return id == otherTyped.id && + staffId == otherTyped.staffId && + checkInTime == otherTyped.checkInTime && + checkOutTime == otherTyped.checkOutTime && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, checkInTime.hashCode, checkOutTime.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + if (checkInTime != null) { + json['checkInTime'] = checkInTime!.toJson(); + } + if (checkOutTime != null) { + json['checkOutTime'] = checkOutTime!.toJson(); + } + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + ListRecentPaymentsByBusinessIdRecentPaymentsApplication({ + required this.id, + required this.staffId, + this.checkInTime, + this.checkOutTime, + required this.shiftRole, + }); +} + +@immutable +class ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRole { + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? totalValue; + final ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRoleRole role; + final ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRoleShift shift; + ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRole.fromJson(dynamic json): + + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRoleRole.fromJson(json['role']), + shift = ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRoleShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRole otherTyped = other as ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRole; + return startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([startTime.hashCode, endTime.hashCode, hours.hashCode, totalValue.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRole({ + this.startTime, + this.endTime, + this.hours, + this.totalValue, + required this.role, + required this.shift, + }); +} + +@immutable +class ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRoleRole { + final String id; + final String name; + final double costPerHour; + ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRoleRole otherTyped = other as ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRoleShift { + final String id; + final String title; + final Timestamp? date; + final String? location; + final String? locationAddress; + final String? description; + ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRoleShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + description = json['description'] == null ? null : nativeFromJson(json['description']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRoleShift otherTyped = other as ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRoleShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + description == otherTyped.description; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, location.hashCode, locationAddress.hashCode, description.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + return json; + } + + ListRecentPaymentsByBusinessIdRecentPaymentsApplicationShiftRoleShift({ + required this.id, + required this.title, + this.date, + this.location, + this.locationAddress, + this.description, + }); +} + +@immutable +class ListRecentPaymentsByBusinessIdRecentPaymentsInvoice { + final String id; + final String invoiceNumber; + final EnumValue status; + final Timestamp issueDate; + final Timestamp dueDate; + final double amount; + final ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceBusiness business; + final ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceVendor vendor; + final ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceOrder order; + ListRecentPaymentsByBusinessIdRecentPaymentsInvoice.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + status = invoiceStatusDeserializer(json['status']), + issueDate = Timestamp.fromJson(json['issueDate']), + dueDate = Timestamp.fromJson(json['dueDate']), + amount = nativeFromJson(json['amount']), + business = ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceBusiness.fromJson(json['business']), + vendor = ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceVendor.fromJson(json['vendor']), + order = ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByBusinessIdRecentPaymentsInvoice otherTyped = other as ListRecentPaymentsByBusinessIdRecentPaymentsInvoice; + return id == otherTyped.id && + invoiceNumber == otherTyped.invoiceNumber && + status == otherTyped.status && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + amount == otherTyped.amount && + business == otherTyped.business && + vendor == otherTyped.vendor && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, invoiceNumber.hashCode, status.hashCode, issueDate.hashCode, dueDate.hashCode, amount.hashCode, business.hashCode, vendor.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['status'] = + invoiceStatusSerializer(status) + ; + json['issueDate'] = issueDate.toJson(); + json['dueDate'] = dueDate.toJson(); + json['amount'] = nativeToJson(amount); + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListRecentPaymentsByBusinessIdRecentPaymentsInvoice({ + required this.id, + required this.invoiceNumber, + required this.status, + required this.issueDate, + required this.dueDate, + required this.amount, + required this.business, + required this.vendor, + required this.order, + }); +} + +@immutable +class ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceBusiness { + final String id; + final String businessName; + ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceBusiness otherTyped = other as ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceVendor { + final String id; + final String companyName; + ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceVendor otherTyped = other as ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceOrder { + final String id; + final String? eventName; + final String? location; + ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + location = json['location'] == null ? null : nativeFromJson(json['location']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceOrder otherTyped = other as ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + location == otherTyped.location; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, location.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + return json; + } + + ListRecentPaymentsByBusinessIdRecentPaymentsInvoiceOrder({ + required this.id, + this.eventName, + this.location, + }); +} + +@immutable +class ListRecentPaymentsByBusinessIdData { + final List recentPayments; + ListRecentPaymentsByBusinessIdData.fromJson(dynamic json): + + recentPayments = (json['recentPayments'] as List) + .map((e) => ListRecentPaymentsByBusinessIdRecentPayments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByBusinessIdData otherTyped = other as ListRecentPaymentsByBusinessIdData; + return recentPayments == otherTyped.recentPayments; + + } + @override + int get hashCode => recentPayments.hashCode; + + + Map toJson() { + Map json = {}; + json['recentPayments'] = recentPayments.map((e) => e.toJson()).toList(); + return json; + } + + ListRecentPaymentsByBusinessIdData({ + required this.recentPayments, + }); +} + +@immutable +class ListRecentPaymentsByBusinessIdVariables { + final String businessId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListRecentPaymentsByBusinessIdVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByBusinessIdVariables otherTyped = other as ListRecentPaymentsByBusinessIdVariables; + return businessId == otherTyped.businessId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListRecentPaymentsByBusinessIdVariables({ + required this.businessId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_invoice_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_invoice_id.dart new file mode 100644 index 00000000..2989392a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_invoice_id.dart @@ -0,0 +1,605 @@ +part of 'generated.dart'; + +class ListRecentPaymentsByInvoiceIdVariablesBuilder { + String invoiceId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListRecentPaymentsByInvoiceIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListRecentPaymentsByInvoiceIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListRecentPaymentsByInvoiceIdVariablesBuilder(this._dataConnect, {required this.invoiceId,}); + Deserializer dataDeserializer = (dynamic json) => ListRecentPaymentsByInvoiceIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListRecentPaymentsByInvoiceIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListRecentPaymentsByInvoiceIdVariables vars= ListRecentPaymentsByInvoiceIdVariables(invoiceId: invoiceId,offset: _offset,limit: _limit,); + return _dataConnect.query("listRecentPaymentsByInvoiceId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListRecentPaymentsByInvoiceIdRecentPayments { + final String id; + final String? workedTime; + final EnumValue? status; + final String staffId; + final String applicationId; + final String invoiceId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListRecentPaymentsByInvoiceIdRecentPaymentsApplication application; + final ListRecentPaymentsByInvoiceIdRecentPaymentsInvoice invoice; + ListRecentPaymentsByInvoiceIdRecentPayments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workedTime = json['workedTime'] == null ? null : nativeFromJson(json['workedTime']), + status = json['status'] == null ? null : recentPaymentStatusDeserializer(json['status']), + staffId = nativeFromJson(json['staffId']), + applicationId = nativeFromJson(json['applicationId']), + invoiceId = nativeFromJson(json['invoiceId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + application = ListRecentPaymentsByInvoiceIdRecentPaymentsApplication.fromJson(json['application']), + invoice = ListRecentPaymentsByInvoiceIdRecentPaymentsInvoice.fromJson(json['invoice']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdRecentPayments otherTyped = other as ListRecentPaymentsByInvoiceIdRecentPayments; + return id == otherTyped.id && + workedTime == otherTyped.workedTime && + status == otherTyped.status && + staffId == otherTyped.staffId && + applicationId == otherTyped.applicationId && + invoiceId == otherTyped.invoiceId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + application == otherTyped.application && + invoice == otherTyped.invoice; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workedTime.hashCode, status.hashCode, staffId.hashCode, applicationId.hashCode, invoiceId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, application.hashCode, invoice.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (workedTime != null) { + json['workedTime'] = nativeToJson(workedTime); + } + if (status != null) { + json['status'] = + recentPaymentStatusSerializer(status!) + ; + } + json['staffId'] = nativeToJson(staffId); + json['applicationId'] = nativeToJson(applicationId); + json['invoiceId'] = nativeToJson(invoiceId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['application'] = application.toJson(); + json['invoice'] = invoice.toJson(); + return json; + } + + ListRecentPaymentsByInvoiceIdRecentPayments({ + required this.id, + this.workedTime, + this.status, + required this.staffId, + required this.applicationId, + required this.invoiceId, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.application, + required this.invoice, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdRecentPaymentsApplication { + final String id; + final String staffId; + final ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRole shiftRole; + ListRecentPaymentsByInvoiceIdRecentPaymentsApplication.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + shiftRole = ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdRecentPaymentsApplication otherTyped = other as ListRecentPaymentsByInvoiceIdRecentPaymentsApplication; + return id == otherTyped.id && + staffId == otherTyped.staffId && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + ListRecentPaymentsByInvoiceIdRecentPaymentsApplication({ + required this.id, + required this.staffId, + required this.shiftRole, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRole { + final double? hours; + final double? totalValue; + final ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRoleRole role; + final ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRoleShift shift; + ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRole.fromJson(dynamic json): + + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRoleRole.fromJson(json['role']), + shift = ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRoleShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRole otherTyped = other as ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRole; + return hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([hours.hashCode, totalValue.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRole({ + this.hours, + this.totalValue, + required this.role, + required this.shift, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRoleRole { + final String id; + final String name; + final double costPerHour; + ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRoleRole otherTyped = other as ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRoleShift { + final String id; + final String title; + final Timestamp? date; + final String? locationAddress; + ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRoleShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRoleShift otherTyped = other as ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRoleShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + locationAddress == otherTyped.locationAddress; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, locationAddress.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + return json; + } + + ListRecentPaymentsByInvoiceIdRecentPaymentsApplicationShiftRoleShift({ + required this.id, + required this.title, + this.date, + this.locationAddress, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdRecentPaymentsInvoice { + final String id; + final String invoiceNumber; + final EnumValue status; + final double amount; + final ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceBusiness business; + final ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceVendor vendor; + final ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceOrder order; + ListRecentPaymentsByInvoiceIdRecentPaymentsInvoice.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + status = invoiceStatusDeserializer(json['status']), + amount = nativeFromJson(json['amount']), + business = ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceBusiness.fromJson(json['business']), + vendor = ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceVendor.fromJson(json['vendor']), + order = ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdRecentPaymentsInvoice otherTyped = other as ListRecentPaymentsByInvoiceIdRecentPaymentsInvoice; + return id == otherTyped.id && + invoiceNumber == otherTyped.invoiceNumber && + status == otherTyped.status && + amount == otherTyped.amount && + business == otherTyped.business && + vendor == otherTyped.vendor && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, invoiceNumber.hashCode, status.hashCode, amount.hashCode, business.hashCode, vendor.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['status'] = + invoiceStatusSerializer(status) + ; + json['amount'] = nativeToJson(amount); + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListRecentPaymentsByInvoiceIdRecentPaymentsInvoice({ + required this.id, + required this.invoiceNumber, + required this.status, + required this.amount, + required this.business, + required this.vendor, + required this.order, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceBusiness { + final String id; + final String businessName; + ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceBusiness otherTyped = other as ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceVendor { + final String id; + final String companyName; + ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceVendor otherTyped = other as ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceOrder { + final String id; + final String? eventName; + final String? location; + ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + location = json['location'] == null ? null : nativeFromJson(json['location']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceOrder otherTyped = other as ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + location == otherTyped.location; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, location.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + return json; + } + + ListRecentPaymentsByInvoiceIdRecentPaymentsInvoiceOrder({ + required this.id, + this.eventName, + this.location, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdData { + final List recentPayments; + ListRecentPaymentsByInvoiceIdData.fromJson(dynamic json): + + recentPayments = (json['recentPayments'] as List) + .map((e) => ListRecentPaymentsByInvoiceIdRecentPayments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdData otherTyped = other as ListRecentPaymentsByInvoiceIdData; + return recentPayments == otherTyped.recentPayments; + + } + @override + int get hashCode => recentPayments.hashCode; + + + Map toJson() { + Map json = {}; + json['recentPayments'] = recentPayments.map((e) => e.toJson()).toList(); + return json; + } + + ListRecentPaymentsByInvoiceIdData({ + required this.recentPayments, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdVariables { + final String invoiceId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListRecentPaymentsByInvoiceIdVariables.fromJson(Map json): + + invoiceId = nativeFromJson(json['invoiceId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdVariables otherTyped = other as ListRecentPaymentsByInvoiceIdVariables; + return invoiceId == otherTyped.invoiceId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([invoiceId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['invoiceId'] = nativeToJson(invoiceId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListRecentPaymentsByInvoiceIdVariables({ + required this.invoiceId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_invoice_ids.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_invoice_ids.dart new file mode 100644 index 00000000..4bb711d1 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_invoice_ids.dart @@ -0,0 +1,602 @@ +part of 'generated.dart'; + +class ListRecentPaymentsByInvoiceIdsVariablesBuilder { + List invoiceIds; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListRecentPaymentsByInvoiceIdsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListRecentPaymentsByInvoiceIdsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListRecentPaymentsByInvoiceIdsVariablesBuilder(this._dataConnect, {required this.invoiceIds,}); + Deserializer dataDeserializer = (dynamic json) => ListRecentPaymentsByInvoiceIdsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListRecentPaymentsByInvoiceIdsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListRecentPaymentsByInvoiceIdsVariables vars= ListRecentPaymentsByInvoiceIdsVariables(invoiceIds: invoiceIds,offset: _offset,limit: _limit,); + return _dataConnect.query("listRecentPaymentsByInvoiceIds", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListRecentPaymentsByInvoiceIdsRecentPayments { + final String id; + final String? workedTime; + final EnumValue? status; + final String staffId; + final String applicationId; + final String invoiceId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListRecentPaymentsByInvoiceIdsRecentPaymentsApplication application; + final ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoice invoice; + ListRecentPaymentsByInvoiceIdsRecentPayments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workedTime = json['workedTime'] == null ? null : nativeFromJson(json['workedTime']), + status = json['status'] == null ? null : recentPaymentStatusDeserializer(json['status']), + staffId = nativeFromJson(json['staffId']), + applicationId = nativeFromJson(json['applicationId']), + invoiceId = nativeFromJson(json['invoiceId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + application = ListRecentPaymentsByInvoiceIdsRecentPaymentsApplication.fromJson(json['application']), + invoice = ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoice.fromJson(json['invoice']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdsRecentPayments otherTyped = other as ListRecentPaymentsByInvoiceIdsRecentPayments; + return id == otherTyped.id && + workedTime == otherTyped.workedTime && + status == otherTyped.status && + staffId == otherTyped.staffId && + applicationId == otherTyped.applicationId && + invoiceId == otherTyped.invoiceId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + application == otherTyped.application && + invoice == otherTyped.invoice; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workedTime.hashCode, status.hashCode, staffId.hashCode, applicationId.hashCode, invoiceId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, application.hashCode, invoice.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (workedTime != null) { + json['workedTime'] = nativeToJson(workedTime); + } + if (status != null) { + json['status'] = + recentPaymentStatusSerializer(status!) + ; + } + json['staffId'] = nativeToJson(staffId); + json['applicationId'] = nativeToJson(applicationId); + json['invoiceId'] = nativeToJson(invoiceId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['application'] = application.toJson(); + json['invoice'] = invoice.toJson(); + return json; + } + + ListRecentPaymentsByInvoiceIdsRecentPayments({ + required this.id, + this.workedTime, + this.status, + required this.staffId, + required this.applicationId, + required this.invoiceId, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.application, + required this.invoice, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdsRecentPaymentsApplication { + final String id; + final ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRole shiftRole; + ListRecentPaymentsByInvoiceIdsRecentPaymentsApplication.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftRole = ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdsRecentPaymentsApplication otherTyped = other as ListRecentPaymentsByInvoiceIdsRecentPaymentsApplication; + return id == otherTyped.id && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + ListRecentPaymentsByInvoiceIdsRecentPaymentsApplication({ + required this.id, + required this.shiftRole, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRole { + final double? hours; + final double? totalValue; + final ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleRole role; + final ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleShift shift; + ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRole.fromJson(dynamic json): + + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleRole.fromJson(json['role']), + shift = ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRole otherTyped = other as ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRole; + return hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([hours.hashCode, totalValue.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRole({ + this.hours, + this.totalValue, + required this.role, + required this.shift, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleRole { + final String id; + final String name; + final double costPerHour; + ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleRole otherTyped = other as ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleShift { + final String id; + final String title; + final Timestamp? date; + final String? locationAddress; + ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleShift otherTyped = other as ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + locationAddress == otherTyped.locationAddress; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, locationAddress.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + return json; + } + + ListRecentPaymentsByInvoiceIdsRecentPaymentsApplicationShiftRoleShift({ + required this.id, + required this.title, + this.date, + this.locationAddress, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoice { + final String id; + final String invoiceNumber; + final EnumValue status; + final double amount; + final ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceBusiness business; + final ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceVendor vendor; + final ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceOrder order; + ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoice.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + status = invoiceStatusDeserializer(json['status']), + amount = nativeFromJson(json['amount']), + business = ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceBusiness.fromJson(json['business']), + vendor = ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceVendor.fromJson(json['vendor']), + order = ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoice otherTyped = other as ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoice; + return id == otherTyped.id && + invoiceNumber == otherTyped.invoiceNumber && + status == otherTyped.status && + amount == otherTyped.amount && + business == otherTyped.business && + vendor == otherTyped.vendor && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, invoiceNumber.hashCode, status.hashCode, amount.hashCode, business.hashCode, vendor.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['status'] = + invoiceStatusSerializer(status) + ; + json['amount'] = nativeToJson(amount); + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoice({ + required this.id, + required this.invoiceNumber, + required this.status, + required this.amount, + required this.business, + required this.vendor, + required this.order, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceBusiness { + final String id; + final String businessName; + ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceBusiness otherTyped = other as ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceVendor { + final String id; + final String companyName; + ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceVendor otherTyped = other as ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceOrder { + final String id; + final String? eventName; + final String? location; + ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + location = json['location'] == null ? null : nativeFromJson(json['location']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceOrder otherTyped = other as ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + location == otherTyped.location; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, location.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + return json; + } + + ListRecentPaymentsByInvoiceIdsRecentPaymentsInvoiceOrder({ + required this.id, + this.eventName, + this.location, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdsData { + final List recentPayments; + ListRecentPaymentsByInvoiceIdsData.fromJson(dynamic json): + + recentPayments = (json['recentPayments'] as List) + .map((e) => ListRecentPaymentsByInvoiceIdsRecentPayments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdsData otherTyped = other as ListRecentPaymentsByInvoiceIdsData; + return recentPayments == otherTyped.recentPayments; + + } + @override + int get hashCode => recentPayments.hashCode; + + + Map toJson() { + Map json = {}; + json['recentPayments'] = recentPayments.map((e) => e.toJson()).toList(); + return json; + } + + ListRecentPaymentsByInvoiceIdsData({ + required this.recentPayments, + }); +} + +@immutable +class ListRecentPaymentsByInvoiceIdsVariables { + final List invoiceIds; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListRecentPaymentsByInvoiceIdsVariables.fromJson(Map json): + + invoiceIds = (json['invoiceIds'] as List) + .map((e) => nativeFromJson(e)) + .toList() { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByInvoiceIdsVariables otherTyped = other as ListRecentPaymentsByInvoiceIdsVariables; + return invoiceIds == otherTyped.invoiceIds && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([invoiceIds.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['invoiceIds'] = invoiceIds.map((e) => nativeToJson(e)).toList(); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListRecentPaymentsByInvoiceIdsVariables({ + required this.invoiceIds, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_staff_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_staff_id.dart new file mode 100644 index 00000000..de171230 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_staff_id.dart @@ -0,0 +1,631 @@ +part of 'generated.dart'; + +class ListRecentPaymentsByStaffIdVariablesBuilder { + String staffId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListRecentPaymentsByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListRecentPaymentsByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListRecentPaymentsByStaffIdVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => ListRecentPaymentsByStaffIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListRecentPaymentsByStaffIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListRecentPaymentsByStaffIdVariables vars= ListRecentPaymentsByStaffIdVariables(staffId: staffId,offset: _offset,limit: _limit,); + return _dataConnect.query("listRecentPaymentsByStaffId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListRecentPaymentsByStaffIdRecentPayments { + final String id; + final String? workedTime; + final EnumValue? status; + final String staffId; + final String applicationId; + final String invoiceId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListRecentPaymentsByStaffIdRecentPaymentsApplication application; + final ListRecentPaymentsByStaffIdRecentPaymentsInvoice invoice; + ListRecentPaymentsByStaffIdRecentPayments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workedTime = json['workedTime'] == null ? null : nativeFromJson(json['workedTime']), + status = json['status'] == null ? null : recentPaymentStatusDeserializer(json['status']), + staffId = nativeFromJson(json['staffId']), + applicationId = nativeFromJson(json['applicationId']), + invoiceId = nativeFromJson(json['invoiceId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + application = ListRecentPaymentsByStaffIdRecentPaymentsApplication.fromJson(json['application']), + invoice = ListRecentPaymentsByStaffIdRecentPaymentsInvoice.fromJson(json['invoice']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStaffIdRecentPayments otherTyped = other as ListRecentPaymentsByStaffIdRecentPayments; + return id == otherTyped.id && + workedTime == otherTyped.workedTime && + status == otherTyped.status && + staffId == otherTyped.staffId && + applicationId == otherTyped.applicationId && + invoiceId == otherTyped.invoiceId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + application == otherTyped.application && + invoice == otherTyped.invoice; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workedTime.hashCode, status.hashCode, staffId.hashCode, applicationId.hashCode, invoiceId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, application.hashCode, invoice.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (workedTime != null) { + json['workedTime'] = nativeToJson(workedTime); + } + if (status != null) { + json['status'] = + recentPaymentStatusSerializer(status!) + ; + } + json['staffId'] = nativeToJson(staffId); + json['applicationId'] = nativeToJson(applicationId); + json['invoiceId'] = nativeToJson(invoiceId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['application'] = application.toJson(); + json['invoice'] = invoice.toJson(); + return json; + } + + ListRecentPaymentsByStaffIdRecentPayments({ + required this.id, + this.workedTime, + this.status, + required this.staffId, + required this.applicationId, + required this.invoiceId, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.application, + required this.invoice, + }); +} + +@immutable +class ListRecentPaymentsByStaffIdRecentPaymentsApplication { + final String id; + final EnumValue status; + final ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRole shiftRole; + ListRecentPaymentsByStaffIdRecentPaymentsApplication.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + status = applicationStatusDeserializer(json['status']), + shiftRole = ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStaffIdRecentPaymentsApplication otherTyped = other as ListRecentPaymentsByStaffIdRecentPaymentsApplication; + return id == otherTyped.id && + status == otherTyped.status && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, status.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['status'] = + applicationStatusSerializer(status) + ; + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + ListRecentPaymentsByStaffIdRecentPaymentsApplication({ + required this.id, + required this.status, + required this.shiftRole, + }); +} + +@immutable +class ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRole { + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? totalValue; + final ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRoleRole role; + final ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRoleShift shift; + ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRole.fromJson(dynamic json): + + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRoleRole.fromJson(json['role']), + shift = ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRoleShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRole otherTyped = other as ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRole; + return startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([startTime.hashCode, endTime.hashCode, hours.hashCode, totalValue.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRole({ + this.startTime, + this.endTime, + this.hours, + this.totalValue, + required this.role, + required this.shift, + }); +} + +@immutable +class ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRoleRole { + final String id; + final String name; + final double costPerHour; + ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRoleRole otherTyped = other as ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRoleShift { + final String id; + final String title; + final Timestamp? date; + final String? locationAddress; + ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRoleShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRoleShift otherTyped = other as ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRoleShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + locationAddress == otherTyped.locationAddress; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, locationAddress.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + return json; + } + + ListRecentPaymentsByStaffIdRecentPaymentsApplicationShiftRoleShift({ + required this.id, + required this.title, + this.date, + this.locationAddress, + }); +} + +@immutable +class ListRecentPaymentsByStaffIdRecentPaymentsInvoice { + final String id; + final String invoiceNumber; + final EnumValue status; + final Timestamp issueDate; + final Timestamp dueDate; + final double amount; + final ListRecentPaymentsByStaffIdRecentPaymentsInvoiceBusiness business; + final ListRecentPaymentsByStaffIdRecentPaymentsInvoiceVendor vendor; + final ListRecentPaymentsByStaffIdRecentPaymentsInvoiceOrder order; + ListRecentPaymentsByStaffIdRecentPaymentsInvoice.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + status = invoiceStatusDeserializer(json['status']), + issueDate = Timestamp.fromJson(json['issueDate']), + dueDate = Timestamp.fromJson(json['dueDate']), + amount = nativeFromJson(json['amount']), + business = ListRecentPaymentsByStaffIdRecentPaymentsInvoiceBusiness.fromJson(json['business']), + vendor = ListRecentPaymentsByStaffIdRecentPaymentsInvoiceVendor.fromJson(json['vendor']), + order = ListRecentPaymentsByStaffIdRecentPaymentsInvoiceOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStaffIdRecentPaymentsInvoice otherTyped = other as ListRecentPaymentsByStaffIdRecentPaymentsInvoice; + return id == otherTyped.id && + invoiceNumber == otherTyped.invoiceNumber && + status == otherTyped.status && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + amount == otherTyped.amount && + business == otherTyped.business && + vendor == otherTyped.vendor && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, invoiceNumber.hashCode, status.hashCode, issueDate.hashCode, dueDate.hashCode, amount.hashCode, business.hashCode, vendor.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['status'] = + invoiceStatusSerializer(status) + ; + json['issueDate'] = issueDate.toJson(); + json['dueDate'] = dueDate.toJson(); + json['amount'] = nativeToJson(amount); + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListRecentPaymentsByStaffIdRecentPaymentsInvoice({ + required this.id, + required this.invoiceNumber, + required this.status, + required this.issueDate, + required this.dueDate, + required this.amount, + required this.business, + required this.vendor, + required this.order, + }); +} + +@immutable +class ListRecentPaymentsByStaffIdRecentPaymentsInvoiceBusiness { + final String id; + final String businessName; + ListRecentPaymentsByStaffIdRecentPaymentsInvoiceBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStaffIdRecentPaymentsInvoiceBusiness otherTyped = other as ListRecentPaymentsByStaffIdRecentPaymentsInvoiceBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListRecentPaymentsByStaffIdRecentPaymentsInvoiceBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListRecentPaymentsByStaffIdRecentPaymentsInvoiceVendor { + final String id; + final String companyName; + ListRecentPaymentsByStaffIdRecentPaymentsInvoiceVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStaffIdRecentPaymentsInvoiceVendor otherTyped = other as ListRecentPaymentsByStaffIdRecentPaymentsInvoiceVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListRecentPaymentsByStaffIdRecentPaymentsInvoiceVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListRecentPaymentsByStaffIdRecentPaymentsInvoiceOrder { + final String id; + final String? eventName; + final String? location; + ListRecentPaymentsByStaffIdRecentPaymentsInvoiceOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + location = json['location'] == null ? null : nativeFromJson(json['location']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStaffIdRecentPaymentsInvoiceOrder otherTyped = other as ListRecentPaymentsByStaffIdRecentPaymentsInvoiceOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + location == otherTyped.location; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, location.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + return json; + } + + ListRecentPaymentsByStaffIdRecentPaymentsInvoiceOrder({ + required this.id, + this.eventName, + this.location, + }); +} + +@immutable +class ListRecentPaymentsByStaffIdData { + final List recentPayments; + ListRecentPaymentsByStaffIdData.fromJson(dynamic json): + + recentPayments = (json['recentPayments'] as List) + .map((e) => ListRecentPaymentsByStaffIdRecentPayments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStaffIdData otherTyped = other as ListRecentPaymentsByStaffIdData; + return recentPayments == otherTyped.recentPayments; + + } + @override + int get hashCode => recentPayments.hashCode; + + + Map toJson() { + Map json = {}; + json['recentPayments'] = recentPayments.map((e) => e.toJson()).toList(); + return json; + } + + ListRecentPaymentsByStaffIdData({ + required this.recentPayments, + }); +} + +@immutable +class ListRecentPaymentsByStaffIdVariables { + final String staffId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListRecentPaymentsByStaffIdVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStaffIdVariables otherTyped = other as ListRecentPaymentsByStaffIdVariables; + return staffId == otherTyped.staffId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListRecentPaymentsByStaffIdVariables({ + required this.staffId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_status.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_status.dart new file mode 100644 index 00000000..716e335e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_recent_payments_by_status.dart @@ -0,0 +1,602 @@ +part of 'generated.dart'; + +class ListRecentPaymentsByStatusVariablesBuilder { + RecentPaymentStatus status; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListRecentPaymentsByStatusVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListRecentPaymentsByStatusVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListRecentPaymentsByStatusVariablesBuilder(this._dataConnect, {required this.status,}); + Deserializer dataDeserializer = (dynamic json) => ListRecentPaymentsByStatusData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListRecentPaymentsByStatusVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListRecentPaymentsByStatusVariables vars= ListRecentPaymentsByStatusVariables(status: status,offset: _offset,limit: _limit,); + return _dataConnect.query("listRecentPaymentsByStatus", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListRecentPaymentsByStatusRecentPayments { + final String id; + final String? workedTime; + final EnumValue? status; + final String staffId; + final String applicationId; + final String invoiceId; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListRecentPaymentsByStatusRecentPaymentsApplication application; + final ListRecentPaymentsByStatusRecentPaymentsInvoice invoice; + ListRecentPaymentsByStatusRecentPayments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workedTime = json['workedTime'] == null ? null : nativeFromJson(json['workedTime']), + status = json['status'] == null ? null : recentPaymentStatusDeserializer(json['status']), + staffId = nativeFromJson(json['staffId']), + applicationId = nativeFromJson(json['applicationId']), + invoiceId = nativeFromJson(json['invoiceId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + application = ListRecentPaymentsByStatusRecentPaymentsApplication.fromJson(json['application']), + invoice = ListRecentPaymentsByStatusRecentPaymentsInvoice.fromJson(json['invoice']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStatusRecentPayments otherTyped = other as ListRecentPaymentsByStatusRecentPayments; + return id == otherTyped.id && + workedTime == otherTyped.workedTime && + status == otherTyped.status && + staffId == otherTyped.staffId && + applicationId == otherTyped.applicationId && + invoiceId == otherTyped.invoiceId && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + application == otherTyped.application && + invoice == otherTyped.invoice; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workedTime.hashCode, status.hashCode, staffId.hashCode, applicationId.hashCode, invoiceId.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, application.hashCode, invoice.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (workedTime != null) { + json['workedTime'] = nativeToJson(workedTime); + } + if (status != null) { + json['status'] = + recentPaymentStatusSerializer(status!) + ; + } + json['staffId'] = nativeToJson(staffId); + json['applicationId'] = nativeToJson(applicationId); + json['invoiceId'] = nativeToJson(invoiceId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['application'] = application.toJson(); + json['invoice'] = invoice.toJson(); + return json; + } + + ListRecentPaymentsByStatusRecentPayments({ + required this.id, + this.workedTime, + this.status, + required this.staffId, + required this.applicationId, + required this.invoiceId, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.application, + required this.invoice, + }); +} + +@immutable +class ListRecentPaymentsByStatusRecentPaymentsApplication { + final String id; + final ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRole shiftRole; + ListRecentPaymentsByStatusRecentPaymentsApplication.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftRole = ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRole.fromJson(json['shiftRole']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStatusRecentPaymentsApplication otherTyped = other as ListRecentPaymentsByStatusRecentPaymentsApplication; + return id == otherTyped.id && + shiftRole == otherTyped.shiftRole; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftRole.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftRole'] = shiftRole.toJson(); + return json; + } + + ListRecentPaymentsByStatusRecentPaymentsApplication({ + required this.id, + required this.shiftRole, + }); +} + +@immutable +class ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRole { + final double? hours; + final double? totalValue; + final ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRoleRole role; + final ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRoleShift shift; + ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRole.fromJson(dynamic json): + + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRoleRole.fromJson(json['role']), + shift = ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRoleShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRole otherTyped = other as ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRole; + return hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([hours.hashCode, totalValue.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRole({ + this.hours, + this.totalValue, + required this.role, + required this.shift, + }); +} + +@immutable +class ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRoleRole { + final String id; + final String name; + final double costPerHour; + ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRoleRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRoleRole otherTyped = other as ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRoleRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRoleRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRoleShift { + final String id; + final String title; + final Timestamp? date; + final String? locationAddress; + ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRoleShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRoleShift otherTyped = other as ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRoleShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + locationAddress == otherTyped.locationAddress; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, locationAddress.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + return json; + } + + ListRecentPaymentsByStatusRecentPaymentsApplicationShiftRoleShift({ + required this.id, + required this.title, + this.date, + this.locationAddress, + }); +} + +@immutable +class ListRecentPaymentsByStatusRecentPaymentsInvoice { + final String id; + final String invoiceNumber; + final EnumValue status; + final double amount; + final ListRecentPaymentsByStatusRecentPaymentsInvoiceBusiness business; + final ListRecentPaymentsByStatusRecentPaymentsInvoiceVendor vendor; + final ListRecentPaymentsByStatusRecentPaymentsInvoiceOrder order; + ListRecentPaymentsByStatusRecentPaymentsInvoice.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + invoiceNumber = nativeFromJson(json['invoiceNumber']), + status = invoiceStatusDeserializer(json['status']), + amount = nativeFromJson(json['amount']), + business = ListRecentPaymentsByStatusRecentPaymentsInvoiceBusiness.fromJson(json['business']), + vendor = ListRecentPaymentsByStatusRecentPaymentsInvoiceVendor.fromJson(json['vendor']), + order = ListRecentPaymentsByStatusRecentPaymentsInvoiceOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStatusRecentPaymentsInvoice otherTyped = other as ListRecentPaymentsByStatusRecentPaymentsInvoice; + return id == otherTyped.id && + invoiceNumber == otherTyped.invoiceNumber && + status == otherTyped.status && + amount == otherTyped.amount && + business == otherTyped.business && + vendor == otherTyped.vendor && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, invoiceNumber.hashCode, status.hashCode, amount.hashCode, business.hashCode, vendor.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['invoiceNumber'] = nativeToJson(invoiceNumber); + json['status'] = + invoiceStatusSerializer(status) + ; + json['amount'] = nativeToJson(amount); + json['business'] = business.toJson(); + json['vendor'] = vendor.toJson(); + json['order'] = order.toJson(); + return json; + } + + ListRecentPaymentsByStatusRecentPaymentsInvoice({ + required this.id, + required this.invoiceNumber, + required this.status, + required this.amount, + required this.business, + required this.vendor, + required this.order, + }); +} + +@immutable +class ListRecentPaymentsByStatusRecentPaymentsInvoiceBusiness { + final String id; + final String businessName; + ListRecentPaymentsByStatusRecentPaymentsInvoiceBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStatusRecentPaymentsInvoiceBusiness otherTyped = other as ListRecentPaymentsByStatusRecentPaymentsInvoiceBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListRecentPaymentsByStatusRecentPaymentsInvoiceBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListRecentPaymentsByStatusRecentPaymentsInvoiceVendor { + final String id; + final String companyName; + ListRecentPaymentsByStatusRecentPaymentsInvoiceVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStatusRecentPaymentsInvoiceVendor otherTyped = other as ListRecentPaymentsByStatusRecentPaymentsInvoiceVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListRecentPaymentsByStatusRecentPaymentsInvoiceVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListRecentPaymentsByStatusRecentPaymentsInvoiceOrder { + final String id; + final String? eventName; + final String? location; + ListRecentPaymentsByStatusRecentPaymentsInvoiceOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + location = json['location'] == null ? null : nativeFromJson(json['location']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStatusRecentPaymentsInvoiceOrder otherTyped = other as ListRecentPaymentsByStatusRecentPaymentsInvoiceOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + location == otherTyped.location; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, location.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + return json; + } + + ListRecentPaymentsByStatusRecentPaymentsInvoiceOrder({ + required this.id, + this.eventName, + this.location, + }); +} + +@immutable +class ListRecentPaymentsByStatusData { + final List recentPayments; + ListRecentPaymentsByStatusData.fromJson(dynamic json): + + recentPayments = (json['recentPayments'] as List) + .map((e) => ListRecentPaymentsByStatusRecentPayments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStatusData otherTyped = other as ListRecentPaymentsByStatusData; + return recentPayments == otherTyped.recentPayments; + + } + @override + int get hashCode => recentPayments.hashCode; + + + Map toJson() { + Map json = {}; + json['recentPayments'] = recentPayments.map((e) => e.toJson()).toList(); + return json; + } + + ListRecentPaymentsByStatusData({ + required this.recentPayments, + }); +} + +@immutable +class ListRecentPaymentsByStatusVariables { + final RecentPaymentStatus status; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListRecentPaymentsByStatusVariables.fromJson(Map json): + + status = RecentPaymentStatus.values.byName(json['status']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRecentPaymentsByStatusVariables otherTyped = other as ListRecentPaymentsByStatusVariables; + return status == otherTyped.status && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([status.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['status'] = + status.name + ; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListRecentPaymentsByStatusVariables({ + required this.status, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_role_categories.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_role_categories.dart new file mode 100644 index 00000000..2f24fe12 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_role_categories.dart @@ -0,0 +1,114 @@ +part of 'generated.dart'; + +class ListRoleCategoriesVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListRoleCategoriesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListRoleCategoriesData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listRoleCategories", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListRoleCategoriesRoleCategories { + final String id; + final String roleName; + final EnumValue category; + final Timestamp? createdAt; + final Timestamp? updatedAt; + ListRoleCategoriesRoleCategories.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + roleName = nativeFromJson(json['roleName']), + category = roleCategoryTypeDeserializer(json['category']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRoleCategoriesRoleCategories otherTyped = other as ListRoleCategoriesRoleCategories; + return id == otherTyped.id && + roleName == otherTyped.roleName && + category == otherTyped.category && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, roleName.hashCode, category.hashCode, createdAt.hashCode, updatedAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['roleName'] = nativeToJson(roleName); + json['category'] = + roleCategoryTypeSerializer(category) + ; + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + return json; + } + + ListRoleCategoriesRoleCategories({ + required this.id, + required this.roleName, + required this.category, + this.createdAt, + this.updatedAt, + }); +} + +@immutable +class ListRoleCategoriesData { + final List roleCategories; + ListRoleCategoriesData.fromJson(dynamic json): + + roleCategories = (json['roleCategories'] as List) + .map((e) => ListRoleCategoriesRoleCategories.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRoleCategoriesData otherTyped = other as ListRoleCategoriesData; + return roleCategories == otherTyped.roleCategories; + + } + @override + int get hashCode => roleCategories.hashCode; + + + Map toJson() { + Map json = {}; + json['roleCategories'] = roleCategories.map((e) => e.toJson()).toList(); + return json; + } + + ListRoleCategoriesData({ + required this.roleCategories, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_roles.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_roles.dart new file mode 100644 index 00000000..7a3f4f6e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_roles.dart @@ -0,0 +1,115 @@ +part of 'generated.dart'; + +class ListRolesVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListRolesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListRolesData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listRoles", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListRolesRoles { + final String id; + final String name; + final double costPerHour; + final String vendorId; + final String roleCategoryId; + final Timestamp? createdAt; + ListRolesRoles.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']), + vendorId = nativeFromJson(json['vendorId']), + roleCategoryId = nativeFromJson(json['roleCategoryId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRolesRoles otherTyped = other as ListRolesRoles; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour && + vendorId == otherTyped.vendorId && + roleCategoryId == otherTyped.roleCategoryId && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode, vendorId.hashCode, roleCategoryId.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + json['vendorId'] = nativeToJson(vendorId); + json['roleCategoryId'] = nativeToJson(roleCategoryId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + ListRolesRoles({ + required this.id, + required this.name, + required this.costPerHour, + required this.vendorId, + required this.roleCategoryId, + this.createdAt, + }); +} + +@immutable +class ListRolesData { + final List roles; + ListRolesData.fromJson(dynamic json): + + roles = (json['roles'] as List) + .map((e) => ListRolesRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRolesData otherTyped = other as ListRolesData; + return roles == otherTyped.roles; + + } + @override + int get hashCode => roles.hashCode; + + + Map toJson() { + Map json = {}; + json['roles'] = roles.map((e) => e.toJson()).toList(); + return json; + } + + ListRolesData({ + required this.roles, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_roles_by_vendor_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_roles_by_vendor_id.dart new file mode 100644 index 00000000..cc651fa5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_roles_by_vendor_id.dart @@ -0,0 +1,151 @@ +part of 'generated.dart'; + +class ListRolesByVendorIdVariablesBuilder { + String vendorId; + + final FirebaseDataConnect _dataConnect; + ListRolesByVendorIdVariablesBuilder(this._dataConnect, {required this.vendorId,}); + Deserializer dataDeserializer = (dynamic json) => ListRolesByVendorIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListRolesByVendorIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListRolesByVendorIdVariables vars= ListRolesByVendorIdVariables(vendorId: vendorId,); + return _dataConnect.query("listRolesByVendorId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListRolesByVendorIdRoles { + final String id; + final String name; + final double costPerHour; + final String vendorId; + final String roleCategoryId; + final Timestamp? createdAt; + ListRolesByVendorIdRoles.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']), + vendorId = nativeFromJson(json['vendorId']), + roleCategoryId = nativeFromJson(json['roleCategoryId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRolesByVendorIdRoles otherTyped = other as ListRolesByVendorIdRoles; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour && + vendorId == otherTyped.vendorId && + roleCategoryId == otherTyped.roleCategoryId && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode, vendorId.hashCode, roleCategoryId.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + json['vendorId'] = nativeToJson(vendorId); + json['roleCategoryId'] = nativeToJson(roleCategoryId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + ListRolesByVendorIdRoles({ + required this.id, + required this.name, + required this.costPerHour, + required this.vendorId, + required this.roleCategoryId, + this.createdAt, + }); +} + +@immutable +class ListRolesByVendorIdData { + final List roles; + ListRolesByVendorIdData.fromJson(dynamic json): + + roles = (json['roles'] as List) + .map((e) => ListRolesByVendorIdRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRolesByVendorIdData otherTyped = other as ListRolesByVendorIdData; + return roles == otherTyped.roles; + + } + @override + int get hashCode => roles.hashCode; + + + Map toJson() { + Map json = {}; + json['roles'] = roles.map((e) => e.toJson()).toList(); + return json; + } + + ListRolesByVendorIdData({ + required this.roles, + }); +} + +@immutable +class ListRolesByVendorIdVariables { + final String vendorId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListRolesByVendorIdVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRolesByVendorIdVariables otherTyped = other as ListRolesByVendorIdVariables; + return vendorId == otherTyped.vendorId; + + } + @override + int get hashCode => vendorId.hashCode; + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + return json; + } + + ListRolesByVendorIdVariables({ + required this.vendorId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_roles_byrole_category_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_roles_byrole_category_id.dart new file mode 100644 index 00000000..518fec18 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_roles_byrole_category_id.dart @@ -0,0 +1,151 @@ +part of 'generated.dart'; + +class ListRolesByroleCategoryIdVariablesBuilder { + String roleCategoryId; + + final FirebaseDataConnect _dataConnect; + ListRolesByroleCategoryIdVariablesBuilder(this._dataConnect, {required this.roleCategoryId,}); + Deserializer dataDeserializer = (dynamic json) => ListRolesByroleCategoryIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListRolesByroleCategoryIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListRolesByroleCategoryIdVariables vars= ListRolesByroleCategoryIdVariables(roleCategoryId: roleCategoryId,); + return _dataConnect.query("listRolesByroleCategoryId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListRolesByroleCategoryIdRoles { + final String id; + final String name; + final double costPerHour; + final String vendorId; + final String roleCategoryId; + final Timestamp? createdAt; + ListRolesByroleCategoryIdRoles.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']), + vendorId = nativeFromJson(json['vendorId']), + roleCategoryId = nativeFromJson(json['roleCategoryId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRolesByroleCategoryIdRoles otherTyped = other as ListRolesByroleCategoryIdRoles; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour && + vendorId == otherTyped.vendorId && + roleCategoryId == otherTyped.roleCategoryId && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode, vendorId.hashCode, roleCategoryId.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + json['vendorId'] = nativeToJson(vendorId); + json['roleCategoryId'] = nativeToJson(roleCategoryId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + ListRolesByroleCategoryIdRoles({ + required this.id, + required this.name, + required this.costPerHour, + required this.vendorId, + required this.roleCategoryId, + this.createdAt, + }); +} + +@immutable +class ListRolesByroleCategoryIdData { + final List roles; + ListRolesByroleCategoryIdData.fromJson(dynamic json): + + roles = (json['roles'] as List) + .map((e) => ListRolesByroleCategoryIdRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRolesByroleCategoryIdData otherTyped = other as ListRolesByroleCategoryIdData; + return roles == otherTyped.roles; + + } + @override + int get hashCode => roles.hashCode; + + + Map toJson() { + Map json = {}; + json['roles'] = roles.map((e) => e.toJson()).toList(); + return json; + } + + ListRolesByroleCategoryIdData({ + required this.roles, + }); +} + +@immutable +class ListRolesByroleCategoryIdVariables { + final String roleCategoryId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListRolesByroleCategoryIdVariables.fromJson(Map json): + + roleCategoryId = nativeFromJson(json['roleCategoryId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListRolesByroleCategoryIdVariables otherTyped = other as ListRolesByroleCategoryIdVariables; + return roleCategoryId == otherTyped.roleCategoryId; + + } + @override + int get hashCode => roleCategoryId.hashCode; + + + Map toJson() { + Map json = {}; + json['roleCategoryId'] = nativeToJson(roleCategoryId); + return json; + } + + ListRolesByroleCategoryIdVariables({ + required this.roleCategoryId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_business_and_date_range.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_business_and_date_range.dart new file mode 100644 index 00000000..f0aca6be --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_business_and_date_range.dart @@ -0,0 +1,373 @@ +part of 'generated.dart'; + +class ListShiftRolesByBusinessAndDateRangeVariablesBuilder { + String businessId; + Timestamp start; + Timestamp end; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListShiftRolesByBusinessAndDateRangeVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftRolesByBusinessAndDateRangeVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListShiftRolesByBusinessAndDateRangeVariablesBuilder(this._dataConnect, {required this.businessId,required this.start,required this.end,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftRolesByBusinessAndDateRangeData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftRolesByBusinessAndDateRangeVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftRolesByBusinessAndDateRangeVariables vars= ListShiftRolesByBusinessAndDateRangeVariables(businessId: businessId,start: start,end: end,offset: _offset,limit: _limit,); + return _dataConnect.query("listShiftRolesByBusinessAndDateRange", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftRolesByBusinessAndDateRangeShiftRoles { + final String shiftId; + final String roleId; + final int count; + final int? assigned; + final double? hours; + final Timestamp? startTime; + final Timestamp? endTime; + final double? totalValue; + final ListShiftRolesByBusinessAndDateRangeShiftRolesRole role; + final ListShiftRolesByBusinessAndDateRangeShiftRolesShift shift; + ListShiftRolesByBusinessAndDateRangeShiftRoles.fromJson(dynamic json): + + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']), + count = nativeFromJson(json['count']), + assigned = json['assigned'] == null ? null : nativeFromJson(json['assigned']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = ListShiftRolesByBusinessAndDateRangeShiftRolesRole.fromJson(json['role']), + shift = ListShiftRolesByBusinessAndDateRangeShiftRolesShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessAndDateRangeShiftRoles otherTyped = other as ListShiftRolesByBusinessAndDateRangeShiftRoles; + return shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + hours == otherTyped.hours && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + totalValue == otherTyped.totalValue && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, hours.hashCode, startTime.hashCode, endTime.hashCode, totalValue.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + json['count'] = nativeToJson(count); + if (assigned != null) { + json['assigned'] = nativeToJson(assigned); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListShiftRolesByBusinessAndDateRangeShiftRoles({ + required this.shiftId, + required this.roleId, + required this.count, + this.assigned, + this.hours, + this.startTime, + this.endTime, + this.totalValue, + required this.role, + required this.shift, + }); +} + +@immutable +class ListShiftRolesByBusinessAndDateRangeShiftRolesRole { + final String id; + final String name; + ListShiftRolesByBusinessAndDateRangeShiftRolesRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessAndDateRangeShiftRolesRole otherTyped = other as ListShiftRolesByBusinessAndDateRangeShiftRolesRole; + return id == otherTyped.id && + name == otherTyped.name; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + return json; + } + + ListShiftRolesByBusinessAndDateRangeShiftRolesRole({ + required this.id, + required this.name, + }); +} + +@immutable +class ListShiftRolesByBusinessAndDateRangeShiftRolesShift { + final String id; + final Timestamp? date; + final String? location; + final String? locationAddress; + final String title; + final EnumValue? status; + final ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder order; + ListShiftRolesByBusinessAndDateRangeShiftRolesShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + title = nativeFromJson(json['title']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + order = ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessAndDateRangeShiftRolesShift otherTyped = other as ListShiftRolesByBusinessAndDateRangeShiftRolesShift; + return id == otherTyped.id && + date == otherTyped.date && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + title == otherTyped.title && + status == otherTyped.status && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, date.hashCode, location.hashCode, locationAddress.hashCode, title.hashCode, status.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (date != null) { + json['date'] = date!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + json['title'] = nativeToJson(title); + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + json['order'] = order.toJson(); + return json; + } + + ListShiftRolesByBusinessAndDateRangeShiftRolesShift({ + required this.id, + this.date, + this.location, + this.locationAddress, + required this.title, + this.status, + required this.order, + }); +} + +@immutable +class ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder { + final String id; + ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder otherTyped = other as ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder({ + required this.id, + }); +} + +@immutable +class ListShiftRolesByBusinessAndDateRangeData { + final List shiftRoles; + ListShiftRolesByBusinessAndDateRangeData.fromJson(dynamic json): + + shiftRoles = (json['shiftRoles'] as List) + .map((e) => ListShiftRolesByBusinessAndDateRangeShiftRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessAndDateRangeData otherTyped = other as ListShiftRolesByBusinessAndDateRangeData; + return shiftRoles == otherTyped.shiftRoles; + + } + @override + int get hashCode => shiftRoles.hashCode; + + + Map toJson() { + Map json = {}; + json['shiftRoles'] = shiftRoles.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftRolesByBusinessAndDateRangeData({ + required this.shiftRoles, + }); +} + +@immutable +class ListShiftRolesByBusinessAndDateRangeVariables { + final String businessId; + final Timestamp start; + final Timestamp end; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftRolesByBusinessAndDateRangeVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']), + start = Timestamp.fromJson(json['start']), + end = Timestamp.fromJson(json['end']) { + + + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessAndDateRangeVariables otherTyped = other as ListShiftRolesByBusinessAndDateRangeVariables; + return businessId == otherTyped.businessId && + start == otherTyped.start && + end == otherTyped.end && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, start.hashCode, end.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + json['start'] = start.toJson(); + json['end'] = end.toJson(); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListShiftRolesByBusinessAndDateRangeVariables({ + required this.businessId, + required this.start, + required this.end, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_business_and_order.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_business_and_order.dart new file mode 100644 index 00000000..0893e2ba --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_business_and_order.dart @@ -0,0 +1,404 @@ +part of 'generated.dart'; + +class ListShiftRolesByBusinessAndOrderVariablesBuilder { + String businessId; + String orderId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListShiftRolesByBusinessAndOrderVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftRolesByBusinessAndOrderVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListShiftRolesByBusinessAndOrderVariablesBuilder(this._dataConnect, {required this.businessId,required this.orderId,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftRolesByBusinessAndOrderData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftRolesByBusinessAndOrderVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftRolesByBusinessAndOrderVariables vars= ListShiftRolesByBusinessAndOrderVariables(businessId: businessId,orderId: orderId,offset: _offset,limit: _limit,); + return _dataConnect.query("listShiftRolesByBusinessAndOrder", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftRolesByBusinessAndOrderShiftRoles { + final String id; + final String shiftId; + final String roleId; + final int count; + final int? assigned; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final EnumValue? breakType; + final double? totalValue; + final Timestamp? createdAt; + final ListShiftRolesByBusinessAndOrderShiftRolesRole role; + final ListShiftRolesByBusinessAndOrderShiftRolesShift shift; + ListShiftRolesByBusinessAndOrderShiftRoles.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']), + count = nativeFromJson(json['count']), + assigned = json['assigned'] == null ? null : nativeFromJson(json['assigned']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + breakType = json['breakType'] == null ? null : breakDurationDeserializer(json['breakType']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + role = ListShiftRolesByBusinessAndOrderShiftRolesRole.fromJson(json['role']), + shift = ListShiftRolesByBusinessAndOrderShiftRolesShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessAndOrderShiftRoles otherTyped = other as ListShiftRolesByBusinessAndOrderShiftRoles; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + breakType == otherTyped.breakType && + totalValue == otherTyped.totalValue && + createdAt == otherTyped.createdAt && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, breakType.hashCode, totalValue.hashCode, createdAt.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + json['count'] = nativeToJson(count); + if (assigned != null) { + json['assigned'] = nativeToJson(assigned); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (breakType != null) { + json['breakType'] = + breakDurationSerializer(breakType!) + ; + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListShiftRolesByBusinessAndOrderShiftRoles({ + required this.id, + required this.shiftId, + required this.roleId, + required this.count, + this.assigned, + this.startTime, + this.endTime, + this.hours, + this.breakType, + this.totalValue, + this.createdAt, + required this.role, + required this.shift, + }); +} + +@immutable +class ListShiftRolesByBusinessAndOrderShiftRolesRole { + final String id; + final String name; + final double costPerHour; + ListShiftRolesByBusinessAndOrderShiftRolesRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessAndOrderShiftRolesRole otherTyped = other as ListShiftRolesByBusinessAndOrderShiftRolesRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListShiftRolesByBusinessAndOrderShiftRolesRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListShiftRolesByBusinessAndOrderShiftRolesShift { + final String id; + final String title; + final Timestamp? date; + final String orderId; + final String? location; + final String? locationAddress; + final ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder order; + ListShiftRolesByBusinessAndOrderShiftRolesShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + orderId = nativeFromJson(json['orderId']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + order = ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessAndOrderShiftRolesShift otherTyped = other as ListShiftRolesByBusinessAndOrderShiftRolesShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + orderId == otherTyped.orderId && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, orderId.hashCode, location.hashCode, locationAddress.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + json['orderId'] = nativeToJson(orderId); + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + json['order'] = order.toJson(); + return json; + } + + ListShiftRolesByBusinessAndOrderShiftRolesShift({ + required this.id, + required this.title, + this.date, + required this.orderId, + this.location, + this.locationAddress, + required this.order, + }); +} + +@immutable +class ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder { + final String? vendorId; + final Timestamp? date; + final String? location; + ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder.fromJson(dynamic json): + + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + location = json['location'] == null ? null : nativeFromJson(json['location']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder otherTyped = other as ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder; + return vendorId == otherTyped.vendorId && + date == otherTyped.date && + location == otherTyped.location; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, date.hashCode, location.hashCode]); + + + Map toJson() { + Map json = {}; + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + if (date != null) { + json['date'] = date!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + return json; + } + + ListShiftRolesByBusinessAndOrderShiftRolesShiftOrder({ + this.vendorId, + this.date, + this.location, + }); +} + +@immutable +class ListShiftRolesByBusinessAndOrderData { + final List shiftRoles; + ListShiftRolesByBusinessAndOrderData.fromJson(dynamic json): + + shiftRoles = (json['shiftRoles'] as List) + .map((e) => ListShiftRolesByBusinessAndOrderShiftRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessAndOrderData otherTyped = other as ListShiftRolesByBusinessAndOrderData; + return shiftRoles == otherTyped.shiftRoles; + + } + @override + int get hashCode => shiftRoles.hashCode; + + + Map toJson() { + Map json = {}; + json['shiftRoles'] = shiftRoles.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftRolesByBusinessAndOrderData({ + required this.shiftRoles, + }); +} + +@immutable +class ListShiftRolesByBusinessAndOrderVariables { + final String businessId; + final String orderId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftRolesByBusinessAndOrderVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']), + orderId = nativeFromJson(json['orderId']) { + + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessAndOrderVariables otherTyped = other as ListShiftRolesByBusinessAndOrderVariables; + return businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, orderId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + json['orderId'] = nativeToJson(orderId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListShiftRolesByBusinessAndOrderVariables({ + required this.businessId, + required this.orderId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_business_date_range_completed_orders.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_business_date_range_completed_orders.dart new file mode 100644 index 00000000..0a0809f0 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_business_date_range_completed_orders.dart @@ -0,0 +1,385 @@ +part of 'generated.dart'; + +class ListShiftRolesByBusinessDateRangeCompletedOrdersVariablesBuilder { + String businessId; + Timestamp start; + Timestamp end; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListShiftRolesByBusinessDateRangeCompletedOrdersVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftRolesByBusinessDateRangeCompletedOrdersVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListShiftRolesByBusinessDateRangeCompletedOrdersVariablesBuilder(this._dataConnect, {required this.businessId,required this.start,required this.end,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftRolesByBusinessDateRangeCompletedOrdersData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftRolesByBusinessDateRangeCompletedOrdersVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftRolesByBusinessDateRangeCompletedOrdersVariables vars= ListShiftRolesByBusinessDateRangeCompletedOrdersVariables(businessId: businessId,start: start,end: end,offset: _offset,limit: _limit,); + return _dataConnect.query("listShiftRolesByBusinessDateRangeCompletedOrders", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRoles { + final String shiftId; + final String roleId; + final int count; + final int? assigned; + final double? hours; + final Timestamp? startTime; + final Timestamp? endTime; + final double? totalValue; + final ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesRole role; + final ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesShift shift; + ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRoles.fromJson(dynamic json): + + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']), + count = nativeFromJson(json['count']), + assigned = json['assigned'] == null ? null : nativeFromJson(json['assigned']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + role = ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesRole.fromJson(json['role']), + shift = ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRoles otherTyped = other as ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRoles; + return shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + hours == otherTyped.hours && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + totalValue == otherTyped.totalValue && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, hours.hashCode, startTime.hashCode, endTime.hashCode, totalValue.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + json['count'] = nativeToJson(count); + if (assigned != null) { + json['assigned'] = nativeToJson(assigned); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRoles({ + required this.shiftId, + required this.roleId, + required this.count, + this.assigned, + this.hours, + this.startTime, + this.endTime, + this.totalValue, + required this.role, + required this.shift, + }); +} + +@immutable +class ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesRole { + final String id; + final String name; + final double costPerHour; + ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesRole otherTyped = other as ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesShift { + final String id; + final Timestamp? date; + final String? location; + final String? locationAddress; + final String title; + final EnumValue? status; + final ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesShiftOrder order; + ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + title = nativeFromJson(json['title']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + order = ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesShift otherTyped = other as ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesShift; + return id == otherTyped.id && + date == otherTyped.date && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + title == otherTyped.title && + status == otherTyped.status && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, date.hashCode, location.hashCode, locationAddress.hashCode, title.hashCode, status.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (date != null) { + json['date'] = date!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + json['title'] = nativeToJson(title); + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + json['order'] = order.toJson(); + return json; + } + + ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesShift({ + required this.id, + this.date, + this.location, + this.locationAddress, + required this.title, + this.status, + required this.order, + }); +} + +@immutable +class ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesShiftOrder { + final String id; + final EnumValue orderType; + ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesShiftOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + orderType = orderTypeDeserializer(json['orderType']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesShiftOrder otherTyped = other as ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesShiftOrder; + return id == otherTyped.id && + orderType == otherTyped.orderType; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, orderType.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['orderType'] = + orderTypeSerializer(orderType) + ; + return json; + } + + ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRolesShiftOrder({ + required this.id, + required this.orderType, + }); +} + +@immutable +class ListShiftRolesByBusinessDateRangeCompletedOrdersData { + final List shiftRoles; + ListShiftRolesByBusinessDateRangeCompletedOrdersData.fromJson(dynamic json): + + shiftRoles = (json['shiftRoles'] as List) + .map((e) => ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessDateRangeCompletedOrdersData otherTyped = other as ListShiftRolesByBusinessDateRangeCompletedOrdersData; + return shiftRoles == otherTyped.shiftRoles; + + } + @override + int get hashCode => shiftRoles.hashCode; + + + Map toJson() { + Map json = {}; + json['shiftRoles'] = shiftRoles.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftRolesByBusinessDateRangeCompletedOrdersData({ + required this.shiftRoles, + }); +} + +@immutable +class ListShiftRolesByBusinessDateRangeCompletedOrdersVariables { + final String businessId; + final Timestamp start; + final Timestamp end; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftRolesByBusinessDateRangeCompletedOrdersVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']), + start = Timestamp.fromJson(json['start']), + end = Timestamp.fromJson(json['end']) { + + + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByBusinessDateRangeCompletedOrdersVariables otherTyped = other as ListShiftRolesByBusinessDateRangeCompletedOrdersVariables; + return businessId == otherTyped.businessId && + start == otherTyped.start && + end == otherTyped.end && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, start.hashCode, end.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + json['start'] = start.toJson(); + json['end'] = end.toJson(); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListShiftRolesByBusinessDateRangeCompletedOrdersVariables({ + required this.businessId, + required this.start, + required this.end, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_role_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_role_id.dart new file mode 100644 index 00000000..5a2d4f5e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_role_id.dart @@ -0,0 +1,491 @@ +part of 'generated.dart'; + +class ListShiftRolesByRoleIdVariablesBuilder { + String roleId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListShiftRolesByRoleIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftRolesByRoleIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListShiftRolesByRoleIdVariablesBuilder(this._dataConnect, {required this.roleId,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftRolesByRoleIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftRolesByRoleIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftRolesByRoleIdVariables vars= ListShiftRolesByRoleIdVariables(roleId: roleId,offset: _offset,limit: _limit,); + return _dataConnect.query("listShiftRolesByRoleId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftRolesByRoleIdShiftRoles { + final String id; + final String shiftId; + final String roleId; + final int count; + final int? assigned; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final String? department; + final String? uniform; + final EnumValue? breakType; + final double? totalValue; + final Timestamp? createdAt; + final ListShiftRolesByRoleIdShiftRolesRole role; + final ListShiftRolesByRoleIdShiftRolesShift shift; + ListShiftRolesByRoleIdShiftRoles.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']), + count = nativeFromJson(json['count']), + assigned = json['assigned'] == null ? null : nativeFromJson(json['assigned']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + department = json['department'] == null ? null : nativeFromJson(json['department']), + uniform = json['uniform'] == null ? null : nativeFromJson(json['uniform']), + breakType = json['breakType'] == null ? null : breakDurationDeserializer(json['breakType']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + role = ListShiftRolesByRoleIdShiftRolesRole.fromJson(json['role']), + shift = ListShiftRolesByRoleIdShiftRolesShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByRoleIdShiftRoles otherTyped = other as ListShiftRolesByRoleIdShiftRoles; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + department == otherTyped.department && + uniform == otherTyped.uniform && + breakType == otherTyped.breakType && + totalValue == otherTyped.totalValue && + createdAt == otherTyped.createdAt && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, department.hashCode, uniform.hashCode, breakType.hashCode, totalValue.hashCode, createdAt.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + json['count'] = nativeToJson(count); + if (assigned != null) { + json['assigned'] = nativeToJson(assigned); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (department != null) { + json['department'] = nativeToJson(department); + } + if (uniform != null) { + json['uniform'] = nativeToJson(uniform); + } + if (breakType != null) { + json['breakType'] = + breakDurationSerializer(breakType!) + ; + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListShiftRolesByRoleIdShiftRoles({ + required this.id, + required this.shiftId, + required this.roleId, + required this.count, + this.assigned, + this.startTime, + this.endTime, + this.hours, + this.department, + this.uniform, + this.breakType, + this.totalValue, + this.createdAt, + required this.role, + required this.shift, + }); +} + +@immutable +class ListShiftRolesByRoleIdShiftRolesRole { + final String id; + final String name; + final double costPerHour; + ListShiftRolesByRoleIdShiftRolesRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByRoleIdShiftRolesRole otherTyped = other as ListShiftRolesByRoleIdShiftRolesRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListShiftRolesByRoleIdShiftRolesRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListShiftRolesByRoleIdShiftRolesShift { + final String? location; + final String? locationAddress; + final String? description; + final String orderId; + final ListShiftRolesByRoleIdShiftRolesShiftOrder order; + ListShiftRolesByRoleIdShiftRolesShift.fromJson(dynamic json): + + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + orderId = nativeFromJson(json['orderId']), + order = ListShiftRolesByRoleIdShiftRolesShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByRoleIdShiftRolesShift otherTyped = other as ListShiftRolesByRoleIdShiftRolesShift; + return location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + description == otherTyped.description && + orderId == otherTyped.orderId && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([location.hashCode, locationAddress.hashCode, description.hashCode, orderId.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + json['orderId'] = nativeToJson(orderId); + json['order'] = order.toJson(); + return json; + } + + ListShiftRolesByRoleIdShiftRolesShift({ + this.location, + this.locationAddress, + this.description, + required this.orderId, + required this.order, + }); +} + +@immutable +class ListShiftRolesByRoleIdShiftRolesShiftOrder { + final AnyValue? recurringDays; + final AnyValue? permanentDays; + final String? notes; + final ListShiftRolesByRoleIdShiftRolesShiftOrderBusiness business; + final ListShiftRolesByRoleIdShiftRolesShiftOrderVendor? vendor; + ListShiftRolesByRoleIdShiftRolesShiftOrder.fromJson(dynamic json): + + recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), + permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + business = ListShiftRolesByRoleIdShiftRolesShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : ListShiftRolesByRoleIdShiftRolesShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByRoleIdShiftRolesShiftOrder otherTyped = other as ListShiftRolesByRoleIdShiftRolesShiftOrder; + return recurringDays == otherTyped.recurringDays && + permanentDays == otherTyped.permanentDays && + notes == otherTyped.notes && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([recurringDays.hashCode, permanentDays.hashCode, notes.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + if (recurringDays != null) { + json['recurringDays'] = recurringDays!.toJson(); + } + if (permanentDays != null) { + json['permanentDays'] = permanentDays!.toJson(); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + ListShiftRolesByRoleIdShiftRolesShiftOrder({ + this.recurringDays, + this.permanentDays, + this.notes, + required this.business, + this.vendor, + }); +} + +@immutable +class ListShiftRolesByRoleIdShiftRolesShiftOrderBusiness { + final String id; + final String businessName; + ListShiftRolesByRoleIdShiftRolesShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByRoleIdShiftRolesShiftOrderBusiness otherTyped = other as ListShiftRolesByRoleIdShiftRolesShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListShiftRolesByRoleIdShiftRolesShiftOrderBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListShiftRolesByRoleIdShiftRolesShiftOrderVendor { + final String id; + final String companyName; + ListShiftRolesByRoleIdShiftRolesShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByRoleIdShiftRolesShiftOrderVendor otherTyped = other as ListShiftRolesByRoleIdShiftRolesShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListShiftRolesByRoleIdShiftRolesShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListShiftRolesByRoleIdData { + final List shiftRoles; + ListShiftRolesByRoleIdData.fromJson(dynamic json): + + shiftRoles = (json['shiftRoles'] as List) + .map((e) => ListShiftRolesByRoleIdShiftRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByRoleIdData otherTyped = other as ListShiftRolesByRoleIdData; + return shiftRoles == otherTyped.shiftRoles; + + } + @override + int get hashCode => shiftRoles.hashCode; + + + Map toJson() { + Map json = {}; + json['shiftRoles'] = shiftRoles.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftRolesByRoleIdData({ + required this.shiftRoles, + }); +} + +@immutable +class ListShiftRolesByRoleIdVariables { + final String roleId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftRolesByRoleIdVariables.fromJson(Map json): + + roleId = nativeFromJson(json['roleId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByRoleIdVariables otherTyped = other as ListShiftRolesByRoleIdVariables; + return roleId == otherTyped.roleId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([roleId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['roleId'] = nativeToJson(roleId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListShiftRolesByRoleIdVariables({ + required this.roleId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_shift_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_shift_id.dart new file mode 100644 index 00000000..85424e08 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_shift_id.dart @@ -0,0 +1,491 @@ +part of 'generated.dart'; + +class ListShiftRolesByShiftIdVariablesBuilder { + String shiftId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListShiftRolesByShiftIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftRolesByShiftIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListShiftRolesByShiftIdVariablesBuilder(this._dataConnect, {required this.shiftId,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftRolesByShiftIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftRolesByShiftIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftRolesByShiftIdVariables vars= ListShiftRolesByShiftIdVariables(shiftId: shiftId,offset: _offset,limit: _limit,); + return _dataConnect.query("listShiftRolesByShiftId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftRolesByShiftIdShiftRoles { + final String id; + final String shiftId; + final String roleId; + final int count; + final int? assigned; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final String? department; + final String? uniform; + final EnumValue? breakType; + final double? totalValue; + final Timestamp? createdAt; + final ListShiftRolesByShiftIdShiftRolesRole role; + final ListShiftRolesByShiftIdShiftRolesShift shift; + ListShiftRolesByShiftIdShiftRoles.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']), + count = nativeFromJson(json['count']), + assigned = json['assigned'] == null ? null : nativeFromJson(json['assigned']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + department = json['department'] == null ? null : nativeFromJson(json['department']), + uniform = json['uniform'] == null ? null : nativeFromJson(json['uniform']), + breakType = json['breakType'] == null ? null : breakDurationDeserializer(json['breakType']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + role = ListShiftRolesByShiftIdShiftRolesRole.fromJson(json['role']), + shift = ListShiftRolesByShiftIdShiftRolesShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdShiftRoles otherTyped = other as ListShiftRolesByShiftIdShiftRoles; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + department == otherTyped.department && + uniform == otherTyped.uniform && + breakType == otherTyped.breakType && + totalValue == otherTyped.totalValue && + createdAt == otherTyped.createdAt && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, department.hashCode, uniform.hashCode, breakType.hashCode, totalValue.hashCode, createdAt.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + json['count'] = nativeToJson(count); + if (assigned != null) { + json['assigned'] = nativeToJson(assigned); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (department != null) { + json['department'] = nativeToJson(department); + } + if (uniform != null) { + json['uniform'] = nativeToJson(uniform); + } + if (breakType != null) { + json['breakType'] = + breakDurationSerializer(breakType!) + ; + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListShiftRolesByShiftIdShiftRoles({ + required this.id, + required this.shiftId, + required this.roleId, + required this.count, + this.assigned, + this.startTime, + this.endTime, + this.hours, + this.department, + this.uniform, + this.breakType, + this.totalValue, + this.createdAt, + required this.role, + required this.shift, + }); +} + +@immutable +class ListShiftRolesByShiftIdShiftRolesRole { + final String id; + final String name; + final double costPerHour; + ListShiftRolesByShiftIdShiftRolesRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdShiftRolesRole otherTyped = other as ListShiftRolesByShiftIdShiftRolesRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListShiftRolesByShiftIdShiftRolesRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListShiftRolesByShiftIdShiftRolesShift { + final String? location; + final String? locationAddress; + final String? description; + final String orderId; + final ListShiftRolesByShiftIdShiftRolesShiftOrder order; + ListShiftRolesByShiftIdShiftRolesShift.fromJson(dynamic json): + + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + orderId = nativeFromJson(json['orderId']), + order = ListShiftRolesByShiftIdShiftRolesShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdShiftRolesShift otherTyped = other as ListShiftRolesByShiftIdShiftRolesShift; + return location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + description == otherTyped.description && + orderId == otherTyped.orderId && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([location.hashCode, locationAddress.hashCode, description.hashCode, orderId.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + json['orderId'] = nativeToJson(orderId); + json['order'] = order.toJson(); + return json; + } + + ListShiftRolesByShiftIdShiftRolesShift({ + this.location, + this.locationAddress, + this.description, + required this.orderId, + required this.order, + }); +} + +@immutable +class ListShiftRolesByShiftIdShiftRolesShiftOrder { + final AnyValue? recurringDays; + final AnyValue? permanentDays; + final String? notes; + final ListShiftRolesByShiftIdShiftRolesShiftOrderBusiness business; + final ListShiftRolesByShiftIdShiftRolesShiftOrderVendor? vendor; + ListShiftRolesByShiftIdShiftRolesShiftOrder.fromJson(dynamic json): + + recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), + permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + business = ListShiftRolesByShiftIdShiftRolesShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : ListShiftRolesByShiftIdShiftRolesShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdShiftRolesShiftOrder otherTyped = other as ListShiftRolesByShiftIdShiftRolesShiftOrder; + return recurringDays == otherTyped.recurringDays && + permanentDays == otherTyped.permanentDays && + notes == otherTyped.notes && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([recurringDays.hashCode, permanentDays.hashCode, notes.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + if (recurringDays != null) { + json['recurringDays'] = recurringDays!.toJson(); + } + if (permanentDays != null) { + json['permanentDays'] = permanentDays!.toJson(); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + ListShiftRolesByShiftIdShiftRolesShiftOrder({ + this.recurringDays, + this.permanentDays, + this.notes, + required this.business, + this.vendor, + }); +} + +@immutable +class ListShiftRolesByShiftIdShiftRolesShiftOrderBusiness { + final String id; + final String businessName; + ListShiftRolesByShiftIdShiftRolesShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdShiftRolesShiftOrderBusiness otherTyped = other as ListShiftRolesByShiftIdShiftRolesShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListShiftRolesByShiftIdShiftRolesShiftOrderBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListShiftRolesByShiftIdShiftRolesShiftOrderVendor { + final String id; + final String companyName; + ListShiftRolesByShiftIdShiftRolesShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdShiftRolesShiftOrderVendor otherTyped = other as ListShiftRolesByShiftIdShiftRolesShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListShiftRolesByShiftIdShiftRolesShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListShiftRolesByShiftIdData { + final List shiftRoles; + ListShiftRolesByShiftIdData.fromJson(dynamic json): + + shiftRoles = (json['shiftRoles'] as List) + .map((e) => ListShiftRolesByShiftIdShiftRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdData otherTyped = other as ListShiftRolesByShiftIdData; + return shiftRoles == otherTyped.shiftRoles; + + } + @override + int get hashCode => shiftRoles.hashCode; + + + Map toJson() { + Map json = {}; + json['shiftRoles'] = shiftRoles.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftRolesByShiftIdData({ + required this.shiftRoles, + }); +} + +@immutable +class ListShiftRolesByShiftIdVariables { + final String shiftId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftRolesByShiftIdVariables.fromJson(Map json): + + shiftId = nativeFromJson(json['shiftId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdVariables otherTyped = other as ListShiftRolesByShiftIdVariables; + return shiftId == otherTyped.shiftId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListShiftRolesByShiftIdVariables({ + required this.shiftId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_shift_id_and_time_range.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_shift_id_and_time_range.dart new file mode 100644 index 00000000..9aaaa817 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_shift_id_and_time_range.dart @@ -0,0 +1,505 @@ +part of 'generated.dart'; + +class ListShiftRolesByShiftIdAndTimeRangeVariablesBuilder { + String shiftId; + Timestamp start; + Timestamp end; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListShiftRolesByShiftIdAndTimeRangeVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftRolesByShiftIdAndTimeRangeVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListShiftRolesByShiftIdAndTimeRangeVariablesBuilder(this._dataConnect, {required this.shiftId,required this.start,required this.end,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftRolesByShiftIdAndTimeRangeData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftRolesByShiftIdAndTimeRangeVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftRolesByShiftIdAndTimeRangeVariables vars= ListShiftRolesByShiftIdAndTimeRangeVariables(shiftId: shiftId,start: start,end: end,offset: _offset,limit: _limit,); + return _dataConnect.query("listShiftRolesByShiftIdAndTimeRange", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftRolesByShiftIdAndTimeRangeShiftRoles { + final String id; + final String shiftId; + final String roleId; + final int count; + final int? assigned; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final String? department; + final String? uniform; + final EnumValue? breakType; + final double? totalValue; + final Timestamp? createdAt; + final ListShiftRolesByShiftIdAndTimeRangeShiftRolesRole role; + final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShift shift; + ListShiftRolesByShiftIdAndTimeRangeShiftRoles.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']), + count = nativeFromJson(json['count']), + assigned = json['assigned'] == null ? null : nativeFromJson(json['assigned']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + department = json['department'] == null ? null : nativeFromJson(json['department']), + uniform = json['uniform'] == null ? null : nativeFromJson(json['uniform']), + breakType = json['breakType'] == null ? null : breakDurationDeserializer(json['breakType']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + role = ListShiftRolesByShiftIdAndTimeRangeShiftRolesRole.fromJson(json['role']), + shift = ListShiftRolesByShiftIdAndTimeRangeShiftRolesShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdAndTimeRangeShiftRoles otherTyped = other as ListShiftRolesByShiftIdAndTimeRangeShiftRoles; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + department == otherTyped.department && + uniform == otherTyped.uniform && + breakType == otherTyped.breakType && + totalValue == otherTyped.totalValue && + createdAt == otherTyped.createdAt && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, department.hashCode, uniform.hashCode, breakType.hashCode, totalValue.hashCode, createdAt.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + json['count'] = nativeToJson(count); + if (assigned != null) { + json['assigned'] = nativeToJson(assigned); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (department != null) { + json['department'] = nativeToJson(department); + } + if (uniform != null) { + json['uniform'] = nativeToJson(uniform); + } + if (breakType != null) { + json['breakType'] = + breakDurationSerializer(breakType!) + ; + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListShiftRolesByShiftIdAndTimeRangeShiftRoles({ + required this.id, + required this.shiftId, + required this.roleId, + required this.count, + this.assigned, + this.startTime, + this.endTime, + this.hours, + this.department, + this.uniform, + this.breakType, + this.totalValue, + this.createdAt, + required this.role, + required this.shift, + }); +} + +@immutable +class ListShiftRolesByShiftIdAndTimeRangeShiftRolesRole { + final String id; + final String name; + final double costPerHour; + ListShiftRolesByShiftIdAndTimeRangeShiftRolesRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdAndTimeRangeShiftRolesRole otherTyped = other as ListShiftRolesByShiftIdAndTimeRangeShiftRolesRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListShiftRolesByShiftIdAndTimeRangeShiftRolesRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListShiftRolesByShiftIdAndTimeRangeShiftRolesShift { + final String? location; + final String? locationAddress; + final String? description; + final String orderId; + final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder order; + ListShiftRolesByShiftIdAndTimeRangeShiftRolesShift.fromJson(dynamic json): + + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + orderId = nativeFromJson(json['orderId']), + order = ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShift otherTyped = other as ListShiftRolesByShiftIdAndTimeRangeShiftRolesShift; + return location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + description == otherTyped.description && + orderId == otherTyped.orderId && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([location.hashCode, locationAddress.hashCode, description.hashCode, orderId.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + json['orderId'] = nativeToJson(orderId); + json['order'] = order.toJson(); + return json; + } + + ListShiftRolesByShiftIdAndTimeRangeShiftRolesShift({ + this.location, + this.locationAddress, + this.description, + required this.orderId, + required this.order, + }); +} + +@immutable +class ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder { + final AnyValue? recurringDays; + final AnyValue? permanentDays; + final String? notes; + final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderBusiness business; + final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderVendor? vendor; + ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder.fromJson(dynamic json): + + recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), + permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + business = ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder otherTyped = other as ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder; + return recurringDays == otherTyped.recurringDays && + permanentDays == otherTyped.permanentDays && + notes == otherTyped.notes && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([recurringDays.hashCode, permanentDays.hashCode, notes.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + if (recurringDays != null) { + json['recurringDays'] = recurringDays!.toJson(); + } + if (permanentDays != null) { + json['permanentDays'] = permanentDays!.toJson(); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder({ + this.recurringDays, + this.permanentDays, + this.notes, + required this.business, + this.vendor, + }); +} + +@immutable +class ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderBusiness { + final String id; + final String businessName; + ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderBusiness otherTyped = other as ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderVendor { + final String id; + final String companyName; + ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderVendor otherTyped = other as ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListShiftRolesByShiftIdAndTimeRangeData { + final List shiftRoles; + ListShiftRolesByShiftIdAndTimeRangeData.fromJson(dynamic json): + + shiftRoles = (json['shiftRoles'] as List) + .map((e) => ListShiftRolesByShiftIdAndTimeRangeShiftRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdAndTimeRangeData otherTyped = other as ListShiftRolesByShiftIdAndTimeRangeData; + return shiftRoles == otherTyped.shiftRoles; + + } + @override + int get hashCode => shiftRoles.hashCode; + + + Map toJson() { + Map json = {}; + json['shiftRoles'] = shiftRoles.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftRolesByShiftIdAndTimeRangeData({ + required this.shiftRoles, + }); +} + +@immutable +class ListShiftRolesByShiftIdAndTimeRangeVariables { + final String shiftId; + final Timestamp start; + final Timestamp end; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftRolesByShiftIdAndTimeRangeVariables.fromJson(Map json): + + shiftId = nativeFromJson(json['shiftId']), + start = Timestamp.fromJson(json['start']), + end = Timestamp.fromJson(json['end']) { + + + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByShiftIdAndTimeRangeVariables otherTyped = other as ListShiftRolesByShiftIdAndTimeRangeVariables; + return shiftId == otherTyped.shiftId && + start == otherTyped.start && + end == otherTyped.end && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, start.hashCode, end.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + json['start'] = start.toJson(); + json['end'] = end.toJson(); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListShiftRolesByShiftIdAndTimeRangeVariables({ + required this.shiftId, + required this.start, + required this.end, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_vendor_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_vendor_id.dart new file mode 100644 index 00000000..24f1bfc0 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shift_roles_by_vendor_id.dart @@ -0,0 +1,553 @@ +part of 'generated.dart'; + +class ListShiftRolesByVendorIdVariablesBuilder { + String vendorId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListShiftRolesByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftRolesByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListShiftRolesByVendorIdVariablesBuilder(this._dataConnect, {required this.vendorId,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftRolesByVendorIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftRolesByVendorIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftRolesByVendorIdVariables vars= ListShiftRolesByVendorIdVariables(vendorId: vendorId,offset: _offset,limit: _limit,); + return _dataConnect.query("listShiftRolesByVendorId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftRolesByVendorIdShiftRoles { + final String id; + final String shiftId; + final String roleId; + final int count; + final int? assigned; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final String? department; + final String? uniform; + final EnumValue? breakType; + final double? totalValue; + final Timestamp? createdAt; + final ListShiftRolesByVendorIdShiftRolesRole role; + final ListShiftRolesByVendorIdShiftRolesShift shift; + ListShiftRolesByVendorIdShiftRoles.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']), + count = nativeFromJson(json['count']), + assigned = json['assigned'] == null ? null : nativeFromJson(json['assigned']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + department = json['department'] == null ? null : nativeFromJson(json['department']), + uniform = json['uniform'] == null ? null : nativeFromJson(json['uniform']), + breakType = json['breakType'] == null ? null : breakDurationDeserializer(json['breakType']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + role = ListShiftRolesByVendorIdShiftRolesRole.fromJson(json['role']), + shift = ListShiftRolesByVendorIdShiftRolesShift.fromJson(json['shift']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByVendorIdShiftRoles otherTyped = other as ListShiftRolesByVendorIdShiftRoles; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + department == otherTyped.department && + uniform == otherTyped.uniform && + breakType == otherTyped.breakType && + totalValue == otherTyped.totalValue && + createdAt == otherTyped.createdAt && + role == otherTyped.role && + shift == otherTyped.shift; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, department.hashCode, uniform.hashCode, breakType.hashCode, totalValue.hashCode, createdAt.hashCode, role.hashCode, shift.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + json['count'] = nativeToJson(count); + if (assigned != null) { + json['assigned'] = nativeToJson(assigned); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (department != null) { + json['department'] = nativeToJson(department); + } + if (uniform != null) { + json['uniform'] = nativeToJson(uniform); + } + if (breakType != null) { + json['breakType'] = + breakDurationSerializer(breakType!) + ; + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['role'] = role.toJson(); + json['shift'] = shift.toJson(); + return json; + } + + ListShiftRolesByVendorIdShiftRoles({ + required this.id, + required this.shiftId, + required this.roleId, + required this.count, + this.assigned, + this.startTime, + this.endTime, + this.hours, + this.department, + this.uniform, + this.breakType, + this.totalValue, + this.createdAt, + required this.role, + required this.shift, + }); +} + +@immutable +class ListShiftRolesByVendorIdShiftRolesRole { + final String id; + final String name; + final double costPerHour; + ListShiftRolesByVendorIdShiftRolesRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByVendorIdShiftRolesRole otherTyped = other as ListShiftRolesByVendorIdShiftRolesRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListShiftRolesByVendorIdShiftRolesRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListShiftRolesByVendorIdShiftRolesShift { + final String id; + final String title; + final Timestamp? date; + final String? location; + final String? locationAddress; + final String? description; + final String orderId; + final ListShiftRolesByVendorIdShiftRolesShiftOrder order; + ListShiftRolesByVendorIdShiftRolesShift.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + orderId = nativeFromJson(json['orderId']), + order = ListShiftRolesByVendorIdShiftRolesShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByVendorIdShiftRolesShift otherTyped = other as ListShiftRolesByVendorIdShiftRolesShift; + return id == otherTyped.id && + title == otherTyped.title && + date == otherTyped.date && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + description == otherTyped.description && + orderId == otherTyped.orderId && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, location.hashCode, locationAddress.hashCode, description.hashCode, orderId.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (date != null) { + json['date'] = date!.toJson(); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + json['orderId'] = nativeToJson(orderId); + json['order'] = order.toJson(); + return json; + } + + ListShiftRolesByVendorIdShiftRolesShift({ + required this.id, + required this.title, + this.date, + this.location, + this.locationAddress, + this.description, + required this.orderId, + required this.order, + }); +} + +@immutable +class ListShiftRolesByVendorIdShiftRolesShiftOrder { + final String id; + final String? eventName; + final String? vendorId; + final String businessId; + final EnumValue orderType; + final EnumValue status; + final Timestamp? date; + final AnyValue? recurringDays; + final AnyValue? permanentDays; + final String? notes; + final ListShiftRolesByVendorIdShiftRolesShiftOrderBusiness business; + final ListShiftRolesByVendorIdShiftRolesShiftOrderVendor? vendor; + ListShiftRolesByVendorIdShiftRolesShiftOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = nativeFromJson(json['businessId']), + orderType = orderTypeDeserializer(json['orderType']), + status = orderStatusDeserializer(json['status']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']), + permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + business = ListShiftRolesByVendorIdShiftRolesShiftOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : ListShiftRolesByVendorIdShiftRolesShiftOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByVendorIdShiftRolesShiftOrder otherTyped = other as ListShiftRolesByVendorIdShiftRolesShiftOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderType == otherTyped.orderType && + status == otherTyped.status && + date == otherTyped.date && + recurringDays == otherTyped.recurringDays && + permanentDays == otherTyped.permanentDays && + notes == otherTyped.notes && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, vendorId.hashCode, businessId.hashCode, orderType.hashCode, status.hashCode, date.hashCode, recurringDays.hashCode, permanentDays.hashCode, notes.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + json['businessId'] = nativeToJson(businessId); + json['orderType'] = + orderTypeSerializer(orderType) + ; + json['status'] = + orderStatusSerializer(status) + ; + if (date != null) { + json['date'] = date!.toJson(); + } + if (recurringDays != null) { + json['recurringDays'] = recurringDays!.toJson(); + } + if (permanentDays != null) { + json['permanentDays'] = permanentDays!.toJson(); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + ListShiftRolesByVendorIdShiftRolesShiftOrder({ + required this.id, + this.eventName, + this.vendorId, + required this.businessId, + required this.orderType, + required this.status, + this.date, + this.recurringDays, + this.permanentDays, + this.notes, + required this.business, + this.vendor, + }); +} + +@immutable +class ListShiftRolesByVendorIdShiftRolesShiftOrderBusiness { + final String id; + final String businessName; + ListShiftRolesByVendorIdShiftRolesShiftOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByVendorIdShiftRolesShiftOrderBusiness otherTyped = other as ListShiftRolesByVendorIdShiftRolesShiftOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListShiftRolesByVendorIdShiftRolesShiftOrderBusiness({ + required this.id, + required this.businessName, + }); +} + +@immutable +class ListShiftRolesByVendorIdShiftRolesShiftOrderVendor { + final String id; + final String companyName; + ListShiftRolesByVendorIdShiftRolesShiftOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByVendorIdShiftRolesShiftOrderVendor otherTyped = other as ListShiftRolesByVendorIdShiftRolesShiftOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListShiftRolesByVendorIdShiftRolesShiftOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListShiftRolesByVendorIdData { + final List shiftRoles; + ListShiftRolesByVendorIdData.fromJson(dynamic json): + + shiftRoles = (json['shiftRoles'] as List) + .map((e) => ListShiftRolesByVendorIdShiftRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByVendorIdData otherTyped = other as ListShiftRolesByVendorIdData; + return shiftRoles == otherTyped.shiftRoles; + + } + @override + int get hashCode => shiftRoles.hashCode; + + + Map toJson() { + Map json = {}; + json['shiftRoles'] = shiftRoles.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftRolesByVendorIdData({ + required this.shiftRoles, + }); +} + +@immutable +class ListShiftRolesByVendorIdVariables { + final String vendorId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftRolesByVendorIdVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftRolesByVendorIdVariables otherTyped = other as ListShiftRolesByVendorIdVariables; + return vendorId == otherTyped.vendorId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListShiftRolesByVendorIdVariables({ + required this.vendorId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts.dart new file mode 100644 index 00000000..ae16b741 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts.dart @@ -0,0 +1,473 @@ +part of 'generated.dart'; + +class ListShiftsVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListShiftsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListShiftsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListShiftsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListShiftsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftsVariables vars= ListShiftsVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listShifts", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftsShifts { + final String id; + final String title; + final String orderId; + final Timestamp? date; + final Timestamp? startTime; + final Timestamp? endTime; + final double? hours; + final double? cost; + final String? location; + final String? locationAddress; + final double? latitude; + final double? longitude; + final String? description; + final EnumValue? status; + final int? workersNeeded; + final int? filled; + final Timestamp? filledAt; + final List? managers; + final int? durationDays; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListShiftsShiftsOrder order; + ListShiftsShifts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + orderId = nativeFromJson(json['orderId']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + cost = json['cost'] == null ? null : nativeFromJson(json['cost']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + locationAddress = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']), + latitude = json['latitude'] == null ? null : nativeFromJson(json['latitude']), + longitude = json['longitude'] == null ? null : nativeFromJson(json['longitude']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson(json['workersNeeded']), + filled = json['filled'] == null ? null : nativeFromJson(json['filled']), + filledAt = json['filledAt'] == null ? null : Timestamp.fromJson(json['filledAt']), + managers = json['managers'] == null ? null : (json['managers'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(), + durationDays = json['durationDays'] == null ? null : nativeFromJson(json['durationDays']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + order = ListShiftsShiftsOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsShifts otherTyped = other as ListShiftsShifts; + return id == otherTyped.id && + title == otherTyped.title && + orderId == otherTyped.orderId && + date == otherTyped.date && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + cost == otherTyped.cost && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + latitude == otherTyped.latitude && + longitude == otherTyped.longitude && + description == otherTyped.description && + status == otherTyped.status && + workersNeeded == otherTyped.workersNeeded && + filled == otherTyped.filled && + filledAt == otherTyped.filledAt && + managers == otherTyped.managers && + durationDays == otherTyped.durationDays && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + json['orderId'] = nativeToJson(orderId); + if (date != null) { + json['date'] = date!.toJson(); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (cost != null) { + json['cost'] = nativeToJson(cost); + } + if (location != null) { + json['location'] = nativeToJson(location); + } + if (locationAddress != null) { + json['locationAddress'] = nativeToJson(locationAddress); + } + if (latitude != null) { + json['latitude'] = nativeToJson(latitude); + } + if (longitude != null) { + json['longitude'] = nativeToJson(longitude); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + if (workersNeeded != null) { + json['workersNeeded'] = nativeToJson(workersNeeded); + } + if (filled != null) { + json['filled'] = nativeToJson(filled); + } + if (filledAt != null) { + json['filledAt'] = filledAt!.toJson(); + } + if (managers != null) { + json['managers'] = managers?.map((e) => e!.toJson()).toList(); + } + if (durationDays != null) { + json['durationDays'] = nativeToJson(durationDays); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['order'] = order.toJson(); + return json; + } + + ListShiftsShifts({ + required this.id, + required this.title, + required this.orderId, + this.date, + this.startTime, + this.endTime, + this.hours, + this.cost, + this.location, + this.locationAddress, + this.latitude, + this.longitude, + this.description, + this.status, + this.workersNeeded, + this.filled, + this.filledAt, + this.managers, + this.durationDays, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.order, + }); +} + +@immutable +class ListShiftsShiftsOrder { + final String id; + final String? eventName; + final EnumValue status; + final EnumValue orderType; + final String businessId; + final String? vendorId; + final ListShiftsShiftsOrderBusiness business; + final ListShiftsShiftsOrderVendor? vendor; + ListShiftsShiftsOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + status = orderStatusDeserializer(json['status']), + orderType = orderTypeDeserializer(json['orderType']), + businessId = nativeFromJson(json['businessId']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + business = ListShiftsShiftsOrderBusiness.fromJson(json['business']), + vendor = json['vendor'] == null ? null : ListShiftsShiftsOrderVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsShiftsOrder otherTyped = other as ListShiftsShiftsOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + status == otherTyped.status && + orderType == otherTyped.orderType && + businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + business == otherTyped.business && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, status.hashCode, orderType.hashCode, businessId.hashCode, vendorId.hashCode, business.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['status'] = + orderStatusSerializer(status) + ; + json['orderType'] = + orderTypeSerializer(orderType) + ; + json['businessId'] = nativeToJson(businessId); + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + json['business'] = business.toJson(); + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + return json; + } + + ListShiftsShiftsOrder({ + required this.id, + this.eventName, + required this.status, + required this.orderType, + required this.businessId, + this.vendorId, + required this.business, + this.vendor, + }); +} + +@immutable +class ListShiftsShiftsOrderBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + ListShiftsShiftsOrderBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsShiftsOrderBusiness otherTyped = other as ListShiftsShiftsOrderBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + ListShiftsShiftsOrderBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class ListShiftsShiftsOrderVendor { + final String id; + final String companyName; + ListShiftsShiftsOrderVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsShiftsOrderVendor otherTyped = other as ListShiftsShiftsOrderVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListShiftsShiftsOrderVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListShiftsData { + final List shifts; + ListShiftsData.fromJson(dynamic json): + + shifts = (json['shifts'] as List) + .map((e) => ListShiftsShifts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsData otherTyped = other as ListShiftsData; + return shifts == otherTyped.shifts; + + } + @override + int get hashCode => shifts.hashCode; + + + Map toJson() { + Map json = {}; + json['shifts'] = shifts.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftsData({ + required this.shifts, + }); +} + +@immutable +class ListShiftsVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftsVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsVariables otherTyped = other as ListShiftsVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListShiftsVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_coverage.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_coverage.dart new file mode 100644 index 00000000..d5339823 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_coverage.dart @@ -0,0 +1,166 @@ +part of 'generated.dart'; + +class ListShiftsForCoverageVariablesBuilder { + String businessId; + Timestamp startDate; + Timestamp endDate; + + final FirebaseDataConnect _dataConnect; + ListShiftsForCoverageVariablesBuilder(this._dataConnect, {required this.businessId,required this.startDate,required this.endDate,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftsForCoverageData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftsForCoverageVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftsForCoverageVariables vars= ListShiftsForCoverageVariables(businessId: businessId,startDate: startDate,endDate: endDate,); + return _dataConnect.query("listShiftsForCoverage", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftsForCoverageShifts { + final String id; + final Timestamp? date; + final int? workersNeeded; + final int? filled; + final EnumValue? status; + ListShiftsForCoverageShifts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson(json['workersNeeded']), + filled = json['filled'] == null ? null : nativeFromJson(json['filled']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForCoverageShifts otherTyped = other as ListShiftsForCoverageShifts; + return id == otherTyped.id && + date == otherTyped.date && + workersNeeded == otherTyped.workersNeeded && + filled == otherTyped.filled && + status == otherTyped.status; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, date.hashCode, workersNeeded.hashCode, filled.hashCode, status.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (date != null) { + json['date'] = date!.toJson(); + } + if (workersNeeded != null) { + json['workersNeeded'] = nativeToJson(workersNeeded); + } + if (filled != null) { + json['filled'] = nativeToJson(filled); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + return json; + } + + ListShiftsForCoverageShifts({ + required this.id, + this.date, + this.workersNeeded, + this.filled, + this.status, + }); +} + +@immutable +class ListShiftsForCoverageData { + final List shifts; + ListShiftsForCoverageData.fromJson(dynamic json): + + shifts = (json['shifts'] as List) + .map((e) => ListShiftsForCoverageShifts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForCoverageData otherTyped = other as ListShiftsForCoverageData; + return shifts == otherTyped.shifts; + + } + @override + int get hashCode => shifts.hashCode; + + + Map toJson() { + Map json = {}; + json['shifts'] = shifts.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftsForCoverageData({ + required this.shifts, + }); +} + +@immutable +class ListShiftsForCoverageVariables { + final String businessId; + final Timestamp startDate; + final Timestamp endDate; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftsForCoverageVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']), + startDate = Timestamp.fromJson(json['startDate']), + endDate = Timestamp.fromJson(json['endDate']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForCoverageVariables otherTyped = other as ListShiftsForCoverageVariables; + return businessId == otherTyped.businessId && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, startDate.hashCode, endDate.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + json['startDate'] = startDate.toJson(); + json['endDate'] = endDate.toJson(); + return json; + } + + ListShiftsForCoverageVariables({ + required this.businessId, + required this.startDate, + required this.endDate, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_daily_ops_by_business.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_daily_ops_by_business.dart new file mode 100644 index 00000000..dd65a054 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_daily_ops_by_business.dart @@ -0,0 +1,179 @@ +part of 'generated.dart'; + +class ListShiftsForDailyOpsByBusinessVariablesBuilder { + String businessId; + Timestamp date; + + final FirebaseDataConnect _dataConnect; + ListShiftsForDailyOpsByBusinessVariablesBuilder(this._dataConnect, {required this.businessId,required this.date,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftsForDailyOpsByBusinessData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftsForDailyOpsByBusinessVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftsForDailyOpsByBusinessVariables vars= ListShiftsForDailyOpsByBusinessVariables(businessId: businessId,date: date,); + return _dataConnect.query("listShiftsForDailyOpsByBusiness", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftsForDailyOpsByBusinessShifts { + final String id; + final String title; + final String? location; + final Timestamp? startTime; + final Timestamp? endTime; + final int? workersNeeded; + final int? filled; + final EnumValue? status; + ListShiftsForDailyOpsByBusinessShifts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson(json['workersNeeded']), + filled = json['filled'] == null ? null : nativeFromJson(json['filled']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForDailyOpsByBusinessShifts otherTyped = other as ListShiftsForDailyOpsByBusinessShifts; + return id == otherTyped.id && + title == otherTyped.title && + location == otherTyped.location && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + workersNeeded == otherTyped.workersNeeded && + filled == otherTyped.filled && + status == otherTyped.status; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, location.hashCode, startTime.hashCode, endTime.hashCode, workersNeeded.hashCode, filled.hashCode, status.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (location != null) { + json['location'] = nativeToJson(location); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (workersNeeded != null) { + json['workersNeeded'] = nativeToJson(workersNeeded); + } + if (filled != null) { + json['filled'] = nativeToJson(filled); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + return json; + } + + ListShiftsForDailyOpsByBusinessShifts({ + required this.id, + required this.title, + this.location, + this.startTime, + this.endTime, + this.workersNeeded, + this.filled, + this.status, + }); +} + +@immutable +class ListShiftsForDailyOpsByBusinessData { + final List shifts; + ListShiftsForDailyOpsByBusinessData.fromJson(dynamic json): + + shifts = (json['shifts'] as List) + .map((e) => ListShiftsForDailyOpsByBusinessShifts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForDailyOpsByBusinessData otherTyped = other as ListShiftsForDailyOpsByBusinessData; + return shifts == otherTyped.shifts; + + } + @override + int get hashCode => shifts.hashCode; + + + Map toJson() { + Map json = {}; + json['shifts'] = shifts.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftsForDailyOpsByBusinessData({ + required this.shifts, + }); +} + +@immutable +class ListShiftsForDailyOpsByBusinessVariables { + final String businessId; + final Timestamp date; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftsForDailyOpsByBusinessVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']), + date = Timestamp.fromJson(json['date']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForDailyOpsByBusinessVariables otherTyped = other as ListShiftsForDailyOpsByBusinessVariables; + return businessId == otherTyped.businessId && + date == otherTyped.date; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, date.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + json['date'] = date.toJson(); + return json; + } + + ListShiftsForDailyOpsByBusinessVariables({ + required this.businessId, + required this.date, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_daily_ops_by_vendor.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_daily_ops_by_vendor.dart new file mode 100644 index 00000000..6bd940e5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_daily_ops_by_vendor.dart @@ -0,0 +1,179 @@ +part of 'generated.dart'; + +class ListShiftsForDailyOpsByVendorVariablesBuilder { + String vendorId; + Timestamp date; + + final FirebaseDataConnect _dataConnect; + ListShiftsForDailyOpsByVendorVariablesBuilder(this._dataConnect, {required this.vendorId,required this.date,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftsForDailyOpsByVendorData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftsForDailyOpsByVendorVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftsForDailyOpsByVendorVariables vars= ListShiftsForDailyOpsByVendorVariables(vendorId: vendorId,date: date,); + return _dataConnect.query("listShiftsForDailyOpsByVendor", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftsForDailyOpsByVendorShifts { + final String id; + final String title; + final String? location; + final Timestamp? startTime; + final Timestamp? endTime; + final int? workersNeeded; + final int? filled; + final EnumValue? status; + ListShiftsForDailyOpsByVendorShifts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + title = nativeFromJson(json['title']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']), + endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']), + workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson(json['workersNeeded']), + filled = json['filled'] == null ? null : nativeFromJson(json['filled']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForDailyOpsByVendorShifts otherTyped = other as ListShiftsForDailyOpsByVendorShifts; + return id == otherTyped.id && + title == otherTyped.title && + location == otherTyped.location && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + workersNeeded == otherTyped.workersNeeded && + filled == otherTyped.filled && + status == otherTyped.status; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, location.hashCode, startTime.hashCode, endTime.hashCode, workersNeeded.hashCode, filled.hashCode, status.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['title'] = nativeToJson(title); + if (location != null) { + json['location'] = nativeToJson(location); + } + if (startTime != null) { + json['startTime'] = startTime!.toJson(); + } + if (endTime != null) { + json['endTime'] = endTime!.toJson(); + } + if (workersNeeded != null) { + json['workersNeeded'] = nativeToJson(workersNeeded); + } + if (filled != null) { + json['filled'] = nativeToJson(filled); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + return json; + } + + ListShiftsForDailyOpsByVendorShifts({ + required this.id, + required this.title, + this.location, + this.startTime, + this.endTime, + this.workersNeeded, + this.filled, + this.status, + }); +} + +@immutable +class ListShiftsForDailyOpsByVendorData { + final List shifts; + ListShiftsForDailyOpsByVendorData.fromJson(dynamic json): + + shifts = (json['shifts'] as List) + .map((e) => ListShiftsForDailyOpsByVendorShifts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForDailyOpsByVendorData otherTyped = other as ListShiftsForDailyOpsByVendorData; + return shifts == otherTyped.shifts; + + } + @override + int get hashCode => shifts.hashCode; + + + Map toJson() { + Map json = {}; + json['shifts'] = shifts.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftsForDailyOpsByVendorData({ + required this.shifts, + }); +} + +@immutable +class ListShiftsForDailyOpsByVendorVariables { + final String vendorId; + final Timestamp date; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftsForDailyOpsByVendorVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']), + date = Timestamp.fromJson(json['date']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForDailyOpsByVendorVariables otherTyped = other as ListShiftsForDailyOpsByVendorVariables; + return vendorId == otherTyped.vendorId && + date == otherTyped.date; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, date.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + json['date'] = date.toJson(); + return json; + } + + ListShiftsForDailyOpsByVendorVariables({ + required this.vendorId, + required this.date, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_forecast_by_business.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_forecast_by_business.dart new file mode 100644 index 00000000..c6cd9b72 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_forecast_by_business.dart @@ -0,0 +1,173 @@ +part of 'generated.dart'; + +class ListShiftsForForecastByBusinessVariablesBuilder { + String businessId; + Timestamp startDate; + Timestamp endDate; + + final FirebaseDataConnect _dataConnect; + ListShiftsForForecastByBusinessVariablesBuilder(this._dataConnect, {required this.businessId,required this.startDate,required this.endDate,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftsForForecastByBusinessData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftsForForecastByBusinessVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftsForForecastByBusinessVariables vars= ListShiftsForForecastByBusinessVariables(businessId: businessId,startDate: startDate,endDate: endDate,); + return _dataConnect.query("listShiftsForForecastByBusiness", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftsForForecastByBusinessShifts { + final String id; + final Timestamp? date; + final int? workersNeeded; + final double? hours; + final double? cost; + final EnumValue? status; + ListShiftsForForecastByBusinessShifts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson(json['workersNeeded']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + cost = json['cost'] == null ? null : nativeFromJson(json['cost']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForForecastByBusinessShifts otherTyped = other as ListShiftsForForecastByBusinessShifts; + return id == otherTyped.id && + date == otherTyped.date && + workersNeeded == otherTyped.workersNeeded && + hours == otherTyped.hours && + cost == otherTyped.cost && + status == otherTyped.status; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, date.hashCode, workersNeeded.hashCode, hours.hashCode, cost.hashCode, status.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (date != null) { + json['date'] = date!.toJson(); + } + if (workersNeeded != null) { + json['workersNeeded'] = nativeToJson(workersNeeded); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (cost != null) { + json['cost'] = nativeToJson(cost); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + return json; + } + + ListShiftsForForecastByBusinessShifts({ + required this.id, + this.date, + this.workersNeeded, + this.hours, + this.cost, + this.status, + }); +} + +@immutable +class ListShiftsForForecastByBusinessData { + final List shifts; + ListShiftsForForecastByBusinessData.fromJson(dynamic json): + + shifts = (json['shifts'] as List) + .map((e) => ListShiftsForForecastByBusinessShifts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForForecastByBusinessData otherTyped = other as ListShiftsForForecastByBusinessData; + return shifts == otherTyped.shifts; + + } + @override + int get hashCode => shifts.hashCode; + + + Map toJson() { + Map json = {}; + json['shifts'] = shifts.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftsForForecastByBusinessData({ + required this.shifts, + }); +} + +@immutable +class ListShiftsForForecastByBusinessVariables { + final String businessId; + final Timestamp startDate; + final Timestamp endDate; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftsForForecastByBusinessVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']), + startDate = Timestamp.fromJson(json['startDate']), + endDate = Timestamp.fromJson(json['endDate']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForForecastByBusinessVariables otherTyped = other as ListShiftsForForecastByBusinessVariables; + return businessId == otherTyped.businessId && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, startDate.hashCode, endDate.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + json['startDate'] = startDate.toJson(); + json['endDate'] = endDate.toJson(); + return json; + } + + ListShiftsForForecastByBusinessVariables({ + required this.businessId, + required this.startDate, + required this.endDate, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_forecast_by_vendor.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_forecast_by_vendor.dart new file mode 100644 index 00000000..b4a435b7 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_forecast_by_vendor.dart @@ -0,0 +1,173 @@ +part of 'generated.dart'; + +class ListShiftsForForecastByVendorVariablesBuilder { + String vendorId; + Timestamp startDate; + Timestamp endDate; + + final FirebaseDataConnect _dataConnect; + ListShiftsForForecastByVendorVariablesBuilder(this._dataConnect, {required this.vendorId,required this.startDate,required this.endDate,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftsForForecastByVendorData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftsForForecastByVendorVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftsForForecastByVendorVariables vars= ListShiftsForForecastByVendorVariables(vendorId: vendorId,startDate: startDate,endDate: endDate,); + return _dataConnect.query("listShiftsForForecastByVendor", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftsForForecastByVendorShifts { + final String id; + final Timestamp? date; + final int? workersNeeded; + final double? hours; + final double? cost; + final EnumValue? status; + ListShiftsForForecastByVendorShifts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson(json['workersNeeded']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + cost = json['cost'] == null ? null : nativeFromJson(json['cost']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForForecastByVendorShifts otherTyped = other as ListShiftsForForecastByVendorShifts; + return id == otherTyped.id && + date == otherTyped.date && + workersNeeded == otherTyped.workersNeeded && + hours == otherTyped.hours && + cost == otherTyped.cost && + status == otherTyped.status; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, date.hashCode, workersNeeded.hashCode, hours.hashCode, cost.hashCode, status.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (date != null) { + json['date'] = date!.toJson(); + } + if (workersNeeded != null) { + json['workersNeeded'] = nativeToJson(workersNeeded); + } + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (cost != null) { + json['cost'] = nativeToJson(cost); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + return json; + } + + ListShiftsForForecastByVendorShifts({ + required this.id, + this.date, + this.workersNeeded, + this.hours, + this.cost, + this.status, + }); +} + +@immutable +class ListShiftsForForecastByVendorData { + final List shifts; + ListShiftsForForecastByVendorData.fromJson(dynamic json): + + shifts = (json['shifts'] as List) + .map((e) => ListShiftsForForecastByVendorShifts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForForecastByVendorData otherTyped = other as ListShiftsForForecastByVendorData; + return shifts == otherTyped.shifts; + + } + @override + int get hashCode => shifts.hashCode; + + + Map toJson() { + Map json = {}; + json['shifts'] = shifts.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftsForForecastByVendorData({ + required this.shifts, + }); +} + +@immutable +class ListShiftsForForecastByVendorVariables { + final String vendorId; + final Timestamp startDate; + final Timestamp endDate; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftsForForecastByVendorVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']), + startDate = Timestamp.fromJson(json['startDate']), + endDate = Timestamp.fromJson(json['endDate']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForForecastByVendorVariables otherTyped = other as ListShiftsForForecastByVendorVariables; + return vendorId == otherTyped.vendorId && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, startDate.hashCode, endDate.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + json['startDate'] = startDate.toJson(); + json['endDate'] = endDate.toJson(); + return json; + } + + ListShiftsForForecastByVendorVariables({ + required this.vendorId, + required this.startDate, + required this.endDate, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_no_show_range_by_business.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_no_show_range_by_business.dart new file mode 100644 index 00000000..7d4856b1 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_no_show_range_by_business.dart @@ -0,0 +1,143 @@ +part of 'generated.dart'; + +class ListShiftsForNoShowRangeByBusinessVariablesBuilder { + String businessId; + Timestamp startDate; + Timestamp endDate; + + final FirebaseDataConnect _dataConnect; + ListShiftsForNoShowRangeByBusinessVariablesBuilder(this._dataConnect, {required this.businessId,required this.startDate,required this.endDate,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftsForNoShowRangeByBusinessData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftsForNoShowRangeByBusinessVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftsForNoShowRangeByBusinessVariables vars= ListShiftsForNoShowRangeByBusinessVariables(businessId: businessId,startDate: startDate,endDate: endDate,); + return _dataConnect.query("listShiftsForNoShowRangeByBusiness", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftsForNoShowRangeByBusinessShifts { + final String id; + final Timestamp? date; + ListShiftsForNoShowRangeByBusinessShifts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForNoShowRangeByBusinessShifts otherTyped = other as ListShiftsForNoShowRangeByBusinessShifts; + return id == otherTyped.id && + date == otherTyped.date; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, date.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (date != null) { + json['date'] = date!.toJson(); + } + return json; + } + + ListShiftsForNoShowRangeByBusinessShifts({ + required this.id, + this.date, + }); +} + +@immutable +class ListShiftsForNoShowRangeByBusinessData { + final List shifts; + ListShiftsForNoShowRangeByBusinessData.fromJson(dynamic json): + + shifts = (json['shifts'] as List) + .map((e) => ListShiftsForNoShowRangeByBusinessShifts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForNoShowRangeByBusinessData otherTyped = other as ListShiftsForNoShowRangeByBusinessData; + return shifts == otherTyped.shifts; + + } + @override + int get hashCode => shifts.hashCode; + + + Map toJson() { + Map json = {}; + json['shifts'] = shifts.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftsForNoShowRangeByBusinessData({ + required this.shifts, + }); +} + +@immutable +class ListShiftsForNoShowRangeByBusinessVariables { + final String businessId; + final Timestamp startDate; + final Timestamp endDate; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftsForNoShowRangeByBusinessVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']), + startDate = Timestamp.fromJson(json['startDate']), + endDate = Timestamp.fromJson(json['endDate']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForNoShowRangeByBusinessVariables otherTyped = other as ListShiftsForNoShowRangeByBusinessVariables; + return businessId == otherTyped.businessId && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, startDate.hashCode, endDate.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + json['startDate'] = startDate.toJson(); + json['endDate'] = endDate.toJson(); + return json; + } + + ListShiftsForNoShowRangeByBusinessVariables({ + required this.businessId, + required this.startDate, + required this.endDate, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_no_show_range_by_vendor.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_no_show_range_by_vendor.dart new file mode 100644 index 00000000..24d37aae --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_no_show_range_by_vendor.dart @@ -0,0 +1,143 @@ +part of 'generated.dart'; + +class ListShiftsForNoShowRangeByVendorVariablesBuilder { + String vendorId; + Timestamp startDate; + Timestamp endDate; + + final FirebaseDataConnect _dataConnect; + ListShiftsForNoShowRangeByVendorVariablesBuilder(this._dataConnect, {required this.vendorId,required this.startDate,required this.endDate,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftsForNoShowRangeByVendorData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftsForNoShowRangeByVendorVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftsForNoShowRangeByVendorVariables vars= ListShiftsForNoShowRangeByVendorVariables(vendorId: vendorId,startDate: startDate,endDate: endDate,); + return _dataConnect.query("listShiftsForNoShowRangeByVendor", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftsForNoShowRangeByVendorShifts { + final String id; + final Timestamp? date; + ListShiftsForNoShowRangeByVendorShifts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForNoShowRangeByVendorShifts otherTyped = other as ListShiftsForNoShowRangeByVendorShifts; + return id == otherTyped.id && + date == otherTyped.date; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, date.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (date != null) { + json['date'] = date!.toJson(); + } + return json; + } + + ListShiftsForNoShowRangeByVendorShifts({ + required this.id, + this.date, + }); +} + +@immutable +class ListShiftsForNoShowRangeByVendorData { + final List shifts; + ListShiftsForNoShowRangeByVendorData.fromJson(dynamic json): + + shifts = (json['shifts'] as List) + .map((e) => ListShiftsForNoShowRangeByVendorShifts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForNoShowRangeByVendorData otherTyped = other as ListShiftsForNoShowRangeByVendorData; + return shifts == otherTyped.shifts; + + } + @override + int get hashCode => shifts.hashCode; + + + Map toJson() { + Map json = {}; + json['shifts'] = shifts.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftsForNoShowRangeByVendorData({ + required this.shifts, + }); +} + +@immutable +class ListShiftsForNoShowRangeByVendorVariables { + final String vendorId; + final Timestamp startDate; + final Timestamp endDate; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftsForNoShowRangeByVendorVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']), + startDate = Timestamp.fromJson(json['startDate']), + endDate = Timestamp.fromJson(json['endDate']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForNoShowRangeByVendorVariables otherTyped = other as ListShiftsForNoShowRangeByVendorVariables; + return vendorId == otherTyped.vendorId && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, startDate.hashCode, endDate.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + json['startDate'] = startDate.toJson(); + json['endDate'] = endDate.toJson(); + return json; + } + + ListShiftsForNoShowRangeByVendorVariables({ + required this.vendorId, + required this.startDate, + required this.endDate, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_performance_by_business.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_performance_by_business.dart new file mode 100644 index 00000000..8b6ac2ae --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_performance_by_business.dart @@ -0,0 +1,173 @@ +part of 'generated.dart'; + +class ListShiftsForPerformanceByBusinessVariablesBuilder { + String businessId; + Timestamp startDate; + Timestamp endDate; + + final FirebaseDataConnect _dataConnect; + ListShiftsForPerformanceByBusinessVariablesBuilder(this._dataConnect, {required this.businessId,required this.startDate,required this.endDate,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftsForPerformanceByBusinessData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftsForPerformanceByBusinessVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftsForPerformanceByBusinessVariables vars= ListShiftsForPerformanceByBusinessVariables(businessId: businessId,startDate: startDate,endDate: endDate,); + return _dataConnect.query("listShiftsForPerformanceByBusiness", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftsForPerformanceByBusinessShifts { + final String id; + final int? workersNeeded; + final int? filled; + final EnumValue? status; + final Timestamp? createdAt; + final Timestamp? filledAt; + ListShiftsForPerformanceByBusinessShifts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson(json['workersNeeded']), + filled = json['filled'] == null ? null : nativeFromJson(json['filled']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + filledAt = json['filledAt'] == null ? null : Timestamp.fromJson(json['filledAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForPerformanceByBusinessShifts otherTyped = other as ListShiftsForPerformanceByBusinessShifts; + return id == otherTyped.id && + workersNeeded == otherTyped.workersNeeded && + filled == otherTyped.filled && + status == otherTyped.status && + createdAt == otherTyped.createdAt && + filledAt == otherTyped.filledAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workersNeeded.hashCode, filled.hashCode, status.hashCode, createdAt.hashCode, filledAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (workersNeeded != null) { + json['workersNeeded'] = nativeToJson(workersNeeded); + } + if (filled != null) { + json['filled'] = nativeToJson(filled); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (filledAt != null) { + json['filledAt'] = filledAt!.toJson(); + } + return json; + } + + ListShiftsForPerformanceByBusinessShifts({ + required this.id, + this.workersNeeded, + this.filled, + this.status, + this.createdAt, + this.filledAt, + }); +} + +@immutable +class ListShiftsForPerformanceByBusinessData { + final List shifts; + ListShiftsForPerformanceByBusinessData.fromJson(dynamic json): + + shifts = (json['shifts'] as List) + .map((e) => ListShiftsForPerformanceByBusinessShifts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForPerformanceByBusinessData otherTyped = other as ListShiftsForPerformanceByBusinessData; + return shifts == otherTyped.shifts; + + } + @override + int get hashCode => shifts.hashCode; + + + Map toJson() { + Map json = {}; + json['shifts'] = shifts.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftsForPerformanceByBusinessData({ + required this.shifts, + }); +} + +@immutable +class ListShiftsForPerformanceByBusinessVariables { + final String businessId; + final Timestamp startDate; + final Timestamp endDate; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftsForPerformanceByBusinessVariables.fromJson(Map json): + + businessId = nativeFromJson(json['businessId']), + startDate = Timestamp.fromJson(json['startDate']), + endDate = Timestamp.fromJson(json['endDate']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForPerformanceByBusinessVariables otherTyped = other as ListShiftsForPerformanceByBusinessVariables; + return businessId == otherTyped.businessId && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate; + + } + @override + int get hashCode => Object.hashAll([businessId.hashCode, startDate.hashCode, endDate.hashCode]); + + + Map toJson() { + Map json = {}; + json['businessId'] = nativeToJson(businessId); + json['startDate'] = startDate.toJson(); + json['endDate'] = endDate.toJson(); + return json; + } + + ListShiftsForPerformanceByBusinessVariables({ + required this.businessId, + required this.startDate, + required this.endDate, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_performance_by_vendor.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_performance_by_vendor.dart new file mode 100644 index 00000000..12364962 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_shifts_for_performance_by_vendor.dart @@ -0,0 +1,173 @@ +part of 'generated.dart'; + +class ListShiftsForPerformanceByVendorVariablesBuilder { + String vendorId; + Timestamp startDate; + Timestamp endDate; + + final FirebaseDataConnect _dataConnect; + ListShiftsForPerformanceByVendorVariablesBuilder(this._dataConnect, {required this.vendorId,required this.startDate,required this.endDate,}); + Deserializer dataDeserializer = (dynamic json) => ListShiftsForPerformanceByVendorData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListShiftsForPerformanceByVendorVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListShiftsForPerformanceByVendorVariables vars= ListShiftsForPerformanceByVendorVariables(vendorId: vendorId,startDate: startDate,endDate: endDate,); + return _dataConnect.query("listShiftsForPerformanceByVendor", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListShiftsForPerformanceByVendorShifts { + final String id; + final int? workersNeeded; + final int? filled; + final EnumValue? status; + final Timestamp? createdAt; + final Timestamp? filledAt; + ListShiftsForPerformanceByVendorShifts.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson(json['workersNeeded']), + filled = json['filled'] == null ? null : nativeFromJson(json['filled']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + filledAt = json['filledAt'] == null ? null : Timestamp.fromJson(json['filledAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForPerformanceByVendorShifts otherTyped = other as ListShiftsForPerformanceByVendorShifts; + return id == otherTyped.id && + workersNeeded == otherTyped.workersNeeded && + filled == otherTyped.filled && + status == otherTyped.status && + createdAt == otherTyped.createdAt && + filledAt == otherTyped.filledAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workersNeeded.hashCode, filled.hashCode, status.hashCode, createdAt.hashCode, filledAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (workersNeeded != null) { + json['workersNeeded'] = nativeToJson(workersNeeded); + } + if (filled != null) { + json['filled'] = nativeToJson(filled); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (filledAt != null) { + json['filledAt'] = filledAt!.toJson(); + } + return json; + } + + ListShiftsForPerformanceByVendorShifts({ + required this.id, + this.workersNeeded, + this.filled, + this.status, + this.createdAt, + this.filledAt, + }); +} + +@immutable +class ListShiftsForPerformanceByVendorData { + final List shifts; + ListShiftsForPerformanceByVendorData.fromJson(dynamic json): + + shifts = (json['shifts'] as List) + .map((e) => ListShiftsForPerformanceByVendorShifts.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForPerformanceByVendorData otherTyped = other as ListShiftsForPerformanceByVendorData; + return shifts == otherTyped.shifts; + + } + @override + int get hashCode => shifts.hashCode; + + + Map toJson() { + Map json = {}; + json['shifts'] = shifts.map((e) => e.toJson()).toList(); + return json; + } + + ListShiftsForPerformanceByVendorData({ + required this.shifts, + }); +} + +@immutable +class ListShiftsForPerformanceByVendorVariables { + final String vendorId; + final Timestamp startDate; + final Timestamp endDate; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListShiftsForPerformanceByVendorVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']), + startDate = Timestamp.fromJson(json['startDate']), + endDate = Timestamp.fromJson(json['endDate']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListShiftsForPerformanceByVendorVariables otherTyped = other as ListShiftsForPerformanceByVendorVariables; + return vendorId == otherTyped.vendorId && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, startDate.hashCode, endDate.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + json['startDate'] = startDate.toJson(); + json['endDate'] = endDate.toJson(); + return json; + } + + ListShiftsForPerformanceByVendorVariables({ + required this.vendorId, + required this.startDate, + required this.endDate, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff.dart new file mode 100644 index 00000000..4a2c16f7 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff.dart @@ -0,0 +1,330 @@ +part of 'generated.dart'; + +class ListStaffVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListStaffVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListStaffData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listStaff", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListStaffStaffs { + final String id; + final String userId; + final String fullName; + final String? level; + final String? role; + final String? phone; + final String? email; + final String? photoUrl; + final int? totalShifts; + final double? averageRating; + final int? onTimeRate; + final int? noShowCount; + final int? cancellationCount; + final int? reliabilityScore; + final int? xp; + final AnyValue? badges; + final bool? isRecommended; + final String? bio; + final AnyValue? industries; + final AnyValue? preferredLocations; + final int? maxDistanceMiles; + final AnyValue? languages; + final AnyValue? itemsAttire; + final String? ownerId; + final Timestamp? createdAt; + final EnumValue? department; + final String? hubId; + final String? manager; + final EnumValue? english; + final EnumValue? backgroundCheckStatus; + final EnumValue? employmentType; + final String? initial; + final bool? englishRequired; + final String? city; + final String? addres; + ListStaffStaffs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + userId = nativeFromJson(json['userId']), + fullName = nativeFromJson(json['fullName']), + level = json['level'] == null ? null : nativeFromJson(json['level']), + role = json['role'] == null ? null : nativeFromJson(json['role']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']), + totalShifts = json['totalShifts'] == null ? null : nativeFromJson(json['totalShifts']), + averageRating = json['averageRating'] == null ? null : nativeFromJson(json['averageRating']), + onTimeRate = json['onTimeRate'] == null ? null : nativeFromJson(json['onTimeRate']), + noShowCount = json['noShowCount'] == null ? null : nativeFromJson(json['noShowCount']), + cancellationCount = json['cancellationCount'] == null ? null : nativeFromJson(json['cancellationCount']), + reliabilityScore = json['reliabilityScore'] == null ? null : nativeFromJson(json['reliabilityScore']), + xp = json['xp'] == null ? null : nativeFromJson(json['xp']), + badges = json['badges'] == null ? null : AnyValue.fromJson(json['badges']), + isRecommended = json['isRecommended'] == null ? null : nativeFromJson(json['isRecommended']), + bio = json['bio'] == null ? null : nativeFromJson(json['bio']), + industries = json['industries'] == null ? null : AnyValue.fromJson(json['industries']), + preferredLocations = json['preferredLocations'] == null ? null : AnyValue.fromJson(json['preferredLocations']), + maxDistanceMiles = json['maxDistanceMiles'] == null ? null : nativeFromJson(json['maxDistanceMiles']), + languages = json['languages'] == null ? null : AnyValue.fromJson(json['languages']), + itemsAttire = json['itemsAttire'] == null ? null : AnyValue.fromJson(json['itemsAttire']), + ownerId = json['ownerId'] == null ? null : nativeFromJson(json['ownerId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + department = json['department'] == null ? null : departmentTypeDeserializer(json['department']), + hubId = json['hubId'] == null ? null : nativeFromJson(json['hubId']), + manager = json['manager'] == null ? null : nativeFromJson(json['manager']), + english = json['english'] == null ? null : englishProficiencyDeserializer(json['english']), + backgroundCheckStatus = json['backgroundCheckStatus'] == null ? null : backgroundCheckStatusDeserializer(json['backgroundCheckStatus']), + employmentType = json['employmentType'] == null ? null : employmentTypeDeserializer(json['employmentType']), + initial = json['initial'] == null ? null : nativeFromJson(json['initial']), + englishRequired = json['englishRequired'] == null ? null : nativeFromJson(json['englishRequired']), + city = json['city'] == null ? null : nativeFromJson(json['city']), + addres = json['addres'] == null ? null : nativeFromJson(json['addres']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffStaffs otherTyped = other as ListStaffStaffs; + return id == otherTyped.id && + userId == otherTyped.userId && + fullName == otherTyped.fullName && + level == otherTyped.level && + role == otherTyped.role && + phone == otherTyped.phone && + email == otherTyped.email && + photoUrl == otherTyped.photoUrl && + totalShifts == otherTyped.totalShifts && + averageRating == otherTyped.averageRating && + onTimeRate == otherTyped.onTimeRate && + noShowCount == otherTyped.noShowCount && + cancellationCount == otherTyped.cancellationCount && + reliabilityScore == otherTyped.reliabilityScore && + xp == otherTyped.xp && + badges == otherTyped.badges && + isRecommended == otherTyped.isRecommended && + bio == otherTyped.bio && + industries == otherTyped.industries && + preferredLocations == otherTyped.preferredLocations && + maxDistanceMiles == otherTyped.maxDistanceMiles && + languages == otherTyped.languages && + itemsAttire == otherTyped.itemsAttire && + ownerId == otherTyped.ownerId && + createdAt == otherTyped.createdAt && + department == otherTyped.department && + hubId == otherTyped.hubId && + manager == otherTyped.manager && + english == otherTyped.english && + backgroundCheckStatus == otherTyped.backgroundCheckStatus && + employmentType == otherTyped.employmentType && + initial == otherTyped.initial && + englishRequired == otherTyped.englishRequired && + city == otherTyped.city && + addres == otherTyped.addres; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, fullName.hashCode, level.hashCode, role.hashCode, phone.hashCode, email.hashCode, photoUrl.hashCode, totalShifts.hashCode, averageRating.hashCode, onTimeRate.hashCode, noShowCount.hashCode, cancellationCount.hashCode, reliabilityScore.hashCode, xp.hashCode, badges.hashCode, isRecommended.hashCode, bio.hashCode, industries.hashCode, preferredLocations.hashCode, maxDistanceMiles.hashCode, languages.hashCode, itemsAttire.hashCode, ownerId.hashCode, createdAt.hashCode, department.hashCode, hubId.hashCode, manager.hashCode, english.hashCode, backgroundCheckStatus.hashCode, employmentType.hashCode, initial.hashCode, englishRequired.hashCode, city.hashCode, addres.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['userId'] = nativeToJson(userId); + json['fullName'] = nativeToJson(fullName); + if (level != null) { + json['level'] = nativeToJson(level); + } + if (role != null) { + json['role'] = nativeToJson(role); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + if (totalShifts != null) { + json['totalShifts'] = nativeToJson(totalShifts); + } + if (averageRating != null) { + json['averageRating'] = nativeToJson(averageRating); + } + if (onTimeRate != null) { + json['onTimeRate'] = nativeToJson(onTimeRate); + } + if (noShowCount != null) { + json['noShowCount'] = nativeToJson(noShowCount); + } + if (cancellationCount != null) { + json['cancellationCount'] = nativeToJson(cancellationCount); + } + if (reliabilityScore != null) { + json['reliabilityScore'] = nativeToJson(reliabilityScore); + } + if (xp != null) { + json['xp'] = nativeToJson(xp); + } + if (badges != null) { + json['badges'] = badges!.toJson(); + } + if (isRecommended != null) { + json['isRecommended'] = nativeToJson(isRecommended); + } + if (bio != null) { + json['bio'] = nativeToJson(bio); + } + if (industries != null) { + json['industries'] = industries!.toJson(); + } + if (preferredLocations != null) { + json['preferredLocations'] = preferredLocations!.toJson(); + } + if (maxDistanceMiles != null) { + json['maxDistanceMiles'] = nativeToJson(maxDistanceMiles); + } + if (languages != null) { + json['languages'] = languages!.toJson(); + } + if (itemsAttire != null) { + json['itemsAttire'] = itemsAttire!.toJson(); + } + if (ownerId != null) { + json['ownerId'] = nativeToJson(ownerId); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (department != null) { + json['department'] = + departmentTypeSerializer(department!) + ; + } + if (hubId != null) { + json['hubId'] = nativeToJson(hubId); + } + if (manager != null) { + json['manager'] = nativeToJson(manager); + } + if (english != null) { + json['english'] = + englishProficiencySerializer(english!) + ; + } + if (backgroundCheckStatus != null) { + json['backgroundCheckStatus'] = + backgroundCheckStatusSerializer(backgroundCheckStatus!) + ; + } + if (employmentType != null) { + json['employmentType'] = + employmentTypeSerializer(employmentType!) + ; + } + if (initial != null) { + json['initial'] = nativeToJson(initial); + } + if (englishRequired != null) { + json['englishRequired'] = nativeToJson(englishRequired); + } + if (city != null) { + json['city'] = nativeToJson(city); + } + if (addres != null) { + json['addres'] = nativeToJson(addres); + } + return json; + } + + ListStaffStaffs({ + required this.id, + required this.userId, + required this.fullName, + this.level, + this.role, + this.phone, + this.email, + this.photoUrl, + this.totalShifts, + this.averageRating, + this.onTimeRate, + this.noShowCount, + this.cancellationCount, + this.reliabilityScore, + this.xp, + this.badges, + this.isRecommended, + this.bio, + this.industries, + this.preferredLocations, + this.maxDistanceMiles, + this.languages, + this.itemsAttire, + this.ownerId, + this.createdAt, + this.department, + this.hubId, + this.manager, + this.english, + this.backgroundCheckStatus, + this.employmentType, + this.initial, + this.englishRequired, + this.city, + this.addres, + }); +} + +@immutable +class ListStaffData { + final List staffs; + ListStaffData.fromJson(dynamic json): + + staffs = (json['staffs'] as List) + .map((e) => ListStaffStaffs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffData otherTyped = other as ListStaffData; + return staffs == otherTyped.staffs; + + } + @override + int get hashCode => staffs.hashCode; + + + Map toJson() { + Map json = {}; + json['staffs'] = staffs.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffData({ + required this.staffs, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_availabilities.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_availabilities.dart new file mode 100644 index 00000000..e0a252e6 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_availabilities.dart @@ -0,0 +1,248 @@ +part of 'generated.dart'; + +class ListStaffAvailabilitiesVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListStaffAvailabilitiesVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffAvailabilitiesVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListStaffAvailabilitiesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListStaffAvailabilitiesData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListStaffAvailabilitiesVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListStaffAvailabilitiesVariables vars= ListStaffAvailabilitiesVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listStaffAvailabilities", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListStaffAvailabilitiesStaffAvailabilities { + final String id; + final String staffId; + final EnumValue day; + final EnumValue slot; + final EnumValue status; + final String? notes; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListStaffAvailabilitiesStaffAvailabilitiesStaff staff; + ListStaffAvailabilitiesStaffAvailabilities.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + day = dayOfWeekDeserializer(json['day']), + slot = availabilitySlotDeserializer(json['slot']), + status = availabilityStatusDeserializer(json['status']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + staff = ListStaffAvailabilitiesStaffAvailabilitiesStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilitiesStaffAvailabilities otherTyped = other as ListStaffAvailabilitiesStaffAvailabilities; + return id == otherTyped.id && + staffId == otherTyped.staffId && + day == otherTyped.day && + slot == otherTyped.slot && + status == otherTyped.status && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, day.hashCode, slot.hashCode, status.hashCode, notes.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['day'] = + dayOfWeekSerializer(day) + ; + json['slot'] = + availabilitySlotSerializer(slot) + ; + json['status'] = + availabilityStatusSerializer(status) + ; + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['staff'] = staff.toJson(); + return json; + } + + ListStaffAvailabilitiesStaffAvailabilities({ + required this.id, + required this.staffId, + required this.day, + required this.slot, + required this.status, + this.notes, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.staff, + }); +} + +@immutable +class ListStaffAvailabilitiesStaffAvailabilitiesStaff { + final String id; + final String fullName; + ListStaffAvailabilitiesStaffAvailabilitiesStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilitiesStaffAvailabilitiesStaff otherTyped = other as ListStaffAvailabilitiesStaffAvailabilitiesStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListStaffAvailabilitiesStaffAvailabilitiesStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListStaffAvailabilitiesData { + final List staffAvailabilities; + ListStaffAvailabilitiesData.fromJson(dynamic json): + + staffAvailabilities = (json['staffAvailabilities'] as List) + .map((e) => ListStaffAvailabilitiesStaffAvailabilities.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilitiesData otherTyped = other as ListStaffAvailabilitiesData; + return staffAvailabilities == otherTyped.staffAvailabilities; + + } + @override + int get hashCode => staffAvailabilities.hashCode; + + + Map toJson() { + Map json = {}; + json['staffAvailabilities'] = staffAvailabilities.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffAvailabilitiesData({ + required this.staffAvailabilities, + }); +} + +@immutable +class ListStaffAvailabilitiesVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListStaffAvailabilitiesVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilitiesVariables otherTyped = other as ListStaffAvailabilitiesVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListStaffAvailabilitiesVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_availabilities_by_day.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_availabilities_by_day.dart new file mode 100644 index 00000000..a387b3a9 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_availabilities_by_day.dart @@ -0,0 +1,257 @@ +part of 'generated.dart'; + +class ListStaffAvailabilitiesByDayVariablesBuilder { + DayOfWeek day; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListStaffAvailabilitiesByDayVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffAvailabilitiesByDayVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListStaffAvailabilitiesByDayVariablesBuilder(this._dataConnect, {required this.day,}); + Deserializer dataDeserializer = (dynamic json) => ListStaffAvailabilitiesByDayData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListStaffAvailabilitiesByDayVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListStaffAvailabilitiesByDayVariables vars= ListStaffAvailabilitiesByDayVariables(day: day,offset: _offset,limit: _limit,); + return _dataConnect.query("listStaffAvailabilitiesByDay", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListStaffAvailabilitiesByDayStaffAvailabilities { + final String id; + final String staffId; + final EnumValue day; + final EnumValue slot; + final EnumValue status; + final String? notes; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListStaffAvailabilitiesByDayStaffAvailabilitiesStaff staff; + ListStaffAvailabilitiesByDayStaffAvailabilities.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + day = dayOfWeekDeserializer(json['day']), + slot = availabilitySlotDeserializer(json['slot']), + status = availabilityStatusDeserializer(json['status']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + staff = ListStaffAvailabilitiesByDayStaffAvailabilitiesStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilitiesByDayStaffAvailabilities otherTyped = other as ListStaffAvailabilitiesByDayStaffAvailabilities; + return id == otherTyped.id && + staffId == otherTyped.staffId && + day == otherTyped.day && + slot == otherTyped.slot && + status == otherTyped.status && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, day.hashCode, slot.hashCode, status.hashCode, notes.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['day'] = + dayOfWeekSerializer(day) + ; + json['slot'] = + availabilitySlotSerializer(slot) + ; + json['status'] = + availabilityStatusSerializer(status) + ; + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['staff'] = staff.toJson(); + return json; + } + + ListStaffAvailabilitiesByDayStaffAvailabilities({ + required this.id, + required this.staffId, + required this.day, + required this.slot, + required this.status, + this.notes, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.staff, + }); +} + +@immutable +class ListStaffAvailabilitiesByDayStaffAvailabilitiesStaff { + final String id; + final String fullName; + ListStaffAvailabilitiesByDayStaffAvailabilitiesStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilitiesByDayStaffAvailabilitiesStaff otherTyped = other as ListStaffAvailabilitiesByDayStaffAvailabilitiesStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListStaffAvailabilitiesByDayStaffAvailabilitiesStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListStaffAvailabilitiesByDayData { + final List staffAvailabilities; + ListStaffAvailabilitiesByDayData.fromJson(dynamic json): + + staffAvailabilities = (json['staffAvailabilities'] as List) + .map((e) => ListStaffAvailabilitiesByDayStaffAvailabilities.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilitiesByDayData otherTyped = other as ListStaffAvailabilitiesByDayData; + return staffAvailabilities == otherTyped.staffAvailabilities; + + } + @override + int get hashCode => staffAvailabilities.hashCode; + + + Map toJson() { + Map json = {}; + json['staffAvailabilities'] = staffAvailabilities.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffAvailabilitiesByDayData({ + required this.staffAvailabilities, + }); +} + +@immutable +class ListStaffAvailabilitiesByDayVariables { + final DayOfWeek day; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListStaffAvailabilitiesByDayVariables.fromJson(Map json): + + day = DayOfWeek.values.byName(json['day']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilitiesByDayVariables otherTyped = other as ListStaffAvailabilitiesByDayVariables; + return day == otherTyped.day && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([day.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['day'] = + day.name + ; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListStaffAvailabilitiesByDayVariables({ + required this.day, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_availabilities_by_staff_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_availabilities_by_staff_id.dart new file mode 100644 index 00000000..b945f777 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_availabilities_by_staff_id.dart @@ -0,0 +1,255 @@ +part of 'generated.dart'; + +class ListStaffAvailabilitiesByStaffIdVariablesBuilder { + String staffId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListStaffAvailabilitiesByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffAvailabilitiesByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListStaffAvailabilitiesByStaffIdVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => ListStaffAvailabilitiesByStaffIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListStaffAvailabilitiesByStaffIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListStaffAvailabilitiesByStaffIdVariables vars= ListStaffAvailabilitiesByStaffIdVariables(staffId: staffId,offset: _offset,limit: _limit,); + return _dataConnect.query("listStaffAvailabilitiesByStaffId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListStaffAvailabilitiesByStaffIdStaffAvailabilities { + final String id; + final String staffId; + final EnumValue day; + final EnumValue slot; + final EnumValue status; + final String? notes; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListStaffAvailabilitiesByStaffIdStaffAvailabilitiesStaff staff; + ListStaffAvailabilitiesByStaffIdStaffAvailabilities.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + day = dayOfWeekDeserializer(json['day']), + slot = availabilitySlotDeserializer(json['slot']), + status = availabilityStatusDeserializer(json['status']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + staff = ListStaffAvailabilitiesByStaffIdStaffAvailabilitiesStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilitiesByStaffIdStaffAvailabilities otherTyped = other as ListStaffAvailabilitiesByStaffIdStaffAvailabilities; + return id == otherTyped.id && + staffId == otherTyped.staffId && + day == otherTyped.day && + slot == otherTyped.slot && + status == otherTyped.status && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, day.hashCode, slot.hashCode, status.hashCode, notes.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['day'] = + dayOfWeekSerializer(day) + ; + json['slot'] = + availabilitySlotSerializer(slot) + ; + json['status'] = + availabilityStatusSerializer(status) + ; + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['staff'] = staff.toJson(); + return json; + } + + ListStaffAvailabilitiesByStaffIdStaffAvailabilities({ + required this.id, + required this.staffId, + required this.day, + required this.slot, + required this.status, + this.notes, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.staff, + }); +} + +@immutable +class ListStaffAvailabilitiesByStaffIdStaffAvailabilitiesStaff { + final String id; + final String fullName; + ListStaffAvailabilitiesByStaffIdStaffAvailabilitiesStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilitiesByStaffIdStaffAvailabilitiesStaff otherTyped = other as ListStaffAvailabilitiesByStaffIdStaffAvailabilitiesStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListStaffAvailabilitiesByStaffIdStaffAvailabilitiesStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListStaffAvailabilitiesByStaffIdData { + final List staffAvailabilities; + ListStaffAvailabilitiesByStaffIdData.fromJson(dynamic json): + + staffAvailabilities = (json['staffAvailabilities'] as List) + .map((e) => ListStaffAvailabilitiesByStaffIdStaffAvailabilities.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilitiesByStaffIdData otherTyped = other as ListStaffAvailabilitiesByStaffIdData; + return staffAvailabilities == otherTyped.staffAvailabilities; + + } + @override + int get hashCode => staffAvailabilities.hashCode; + + + Map toJson() { + Map json = {}; + json['staffAvailabilities'] = staffAvailabilities.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffAvailabilitiesByStaffIdData({ + required this.staffAvailabilities, + }); +} + +@immutable +class ListStaffAvailabilitiesByStaffIdVariables { + final String staffId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListStaffAvailabilitiesByStaffIdVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilitiesByStaffIdVariables otherTyped = other as ListStaffAvailabilitiesByStaffIdVariables; + return staffId == otherTyped.staffId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListStaffAvailabilitiesByStaffIdVariables({ + required this.staffId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_availability_stats.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_availability_stats.dart new file mode 100644 index 00000000..0dd30a2b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_availability_stats.dart @@ -0,0 +1,269 @@ +part of 'generated.dart'; + +class ListStaffAvailabilityStatsVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListStaffAvailabilityStatsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffAvailabilityStatsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListStaffAvailabilityStatsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListStaffAvailabilityStatsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListStaffAvailabilityStatsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListStaffAvailabilityStatsVariables vars= ListStaffAvailabilityStatsVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listStaffAvailabilityStats", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListStaffAvailabilityStatsStaffAvailabilityStatss { + final String id; + final String staffId; + final int? needWorkIndex; + final int? utilizationPercentage; + final int? predictedAvailabilityScore; + final int? scheduledHoursThisPeriod; + final int? desiredHoursThisPeriod; + final Timestamp? lastShiftDate; + final int? acceptanceRate; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListStaffAvailabilityStatsStaffAvailabilityStatssStaff staff; + ListStaffAvailabilityStatsStaffAvailabilityStatss.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + needWorkIndex = json['needWorkIndex'] == null ? null : nativeFromJson(json['needWorkIndex']), + utilizationPercentage = json['utilizationPercentage'] == null ? null : nativeFromJson(json['utilizationPercentage']), + predictedAvailabilityScore = json['predictedAvailabilityScore'] == null ? null : nativeFromJson(json['predictedAvailabilityScore']), + scheduledHoursThisPeriod = json['scheduledHoursThisPeriod'] == null ? null : nativeFromJson(json['scheduledHoursThisPeriod']), + desiredHoursThisPeriod = json['desiredHoursThisPeriod'] == null ? null : nativeFromJson(json['desiredHoursThisPeriod']), + lastShiftDate = json['lastShiftDate'] == null ? null : Timestamp.fromJson(json['lastShiftDate']), + acceptanceRate = json['acceptanceRate'] == null ? null : nativeFromJson(json['acceptanceRate']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + staff = ListStaffAvailabilityStatsStaffAvailabilityStatssStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilityStatsStaffAvailabilityStatss otherTyped = other as ListStaffAvailabilityStatsStaffAvailabilityStatss; + return id == otherTyped.id && + staffId == otherTyped.staffId && + needWorkIndex == otherTyped.needWorkIndex && + utilizationPercentage == otherTyped.utilizationPercentage && + predictedAvailabilityScore == otherTyped.predictedAvailabilityScore && + scheduledHoursThisPeriod == otherTyped.scheduledHoursThisPeriod && + desiredHoursThisPeriod == otherTyped.desiredHoursThisPeriod && + lastShiftDate == otherTyped.lastShiftDate && + acceptanceRate == otherTyped.acceptanceRate && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, needWorkIndex.hashCode, utilizationPercentage.hashCode, predictedAvailabilityScore.hashCode, scheduledHoursThisPeriod.hashCode, desiredHoursThisPeriod.hashCode, lastShiftDate.hashCode, acceptanceRate.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + if (needWorkIndex != null) { + json['needWorkIndex'] = nativeToJson(needWorkIndex); + } + if (utilizationPercentage != null) { + json['utilizationPercentage'] = nativeToJson(utilizationPercentage); + } + if (predictedAvailabilityScore != null) { + json['predictedAvailabilityScore'] = nativeToJson(predictedAvailabilityScore); + } + if (scheduledHoursThisPeriod != null) { + json['scheduledHoursThisPeriod'] = nativeToJson(scheduledHoursThisPeriod); + } + if (desiredHoursThisPeriod != null) { + json['desiredHoursThisPeriod'] = nativeToJson(desiredHoursThisPeriod); + } + if (lastShiftDate != null) { + json['lastShiftDate'] = lastShiftDate!.toJson(); + } + if (acceptanceRate != null) { + json['acceptanceRate'] = nativeToJson(acceptanceRate); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['staff'] = staff.toJson(); + return json; + } + + ListStaffAvailabilityStatsStaffAvailabilityStatss({ + required this.id, + required this.staffId, + this.needWorkIndex, + this.utilizationPercentage, + this.predictedAvailabilityScore, + this.scheduledHoursThisPeriod, + this.desiredHoursThisPeriod, + this.lastShiftDate, + this.acceptanceRate, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.staff, + }); +} + +@immutable +class ListStaffAvailabilityStatsStaffAvailabilityStatssStaff { + final String id; + final String fullName; + ListStaffAvailabilityStatsStaffAvailabilityStatssStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilityStatsStaffAvailabilityStatssStaff otherTyped = other as ListStaffAvailabilityStatsStaffAvailabilityStatssStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListStaffAvailabilityStatsStaffAvailabilityStatssStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListStaffAvailabilityStatsData { + final List staffAvailabilityStatss; + ListStaffAvailabilityStatsData.fromJson(dynamic json): + + staffAvailabilityStatss = (json['staffAvailabilityStatss'] as List) + .map((e) => ListStaffAvailabilityStatsStaffAvailabilityStatss.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilityStatsData otherTyped = other as ListStaffAvailabilityStatsData; + return staffAvailabilityStatss == otherTyped.staffAvailabilityStatss; + + } + @override + int get hashCode => staffAvailabilityStatss.hashCode; + + + Map toJson() { + Map json = {}; + json['staffAvailabilityStatss'] = staffAvailabilityStatss.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffAvailabilityStatsData({ + required this.staffAvailabilityStatss, + }); +} + +@immutable +class ListStaffAvailabilityStatsVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListStaffAvailabilityStatsVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffAvailabilityStatsVariables otherTyped = other as ListStaffAvailabilityStatsVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListStaffAvailabilityStatsVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_courses_by_course_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_courses_by_course_id.dart new file mode 100644 index 00000000..700007e5 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_courses_by_course_id.dart @@ -0,0 +1,216 @@ +part of 'generated.dart'; + +class ListStaffCoursesByCourseIdVariablesBuilder { + String courseId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListStaffCoursesByCourseIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffCoursesByCourseIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListStaffCoursesByCourseIdVariablesBuilder(this._dataConnect, {required this.courseId,}); + Deserializer dataDeserializer = (dynamic json) => ListStaffCoursesByCourseIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListStaffCoursesByCourseIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListStaffCoursesByCourseIdVariables vars= ListStaffCoursesByCourseIdVariables(courseId: courseId,offset: _offset,limit: _limit,); + return _dataConnect.query("listStaffCoursesByCourseId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListStaffCoursesByCourseIdStaffCourses { + final String id; + final String staffId; + final String courseId; + final int? progressPercent; + final bool? completed; + final Timestamp? completedAt; + final Timestamp? startedAt; + final Timestamp? lastAccessedAt; + final Timestamp? createdAt; + final Timestamp? updatedAt; + ListStaffCoursesByCourseIdStaffCourses.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + courseId = nativeFromJson(json['courseId']), + progressPercent = json['progressPercent'] == null ? null : nativeFromJson(json['progressPercent']), + completed = json['completed'] == null ? null : nativeFromJson(json['completed']), + completedAt = json['completedAt'] == null ? null : Timestamp.fromJson(json['completedAt']), + startedAt = json['startedAt'] == null ? null : Timestamp.fromJson(json['startedAt']), + lastAccessedAt = json['lastAccessedAt'] == null ? null : Timestamp.fromJson(json['lastAccessedAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffCoursesByCourseIdStaffCourses otherTyped = other as ListStaffCoursesByCourseIdStaffCourses; + return id == otherTyped.id && + staffId == otherTyped.staffId && + courseId == otherTyped.courseId && + progressPercent == otherTyped.progressPercent && + completed == otherTyped.completed && + completedAt == otherTyped.completedAt && + startedAt == otherTyped.startedAt && + lastAccessedAt == otherTyped.lastAccessedAt && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, courseId.hashCode, progressPercent.hashCode, completed.hashCode, completedAt.hashCode, startedAt.hashCode, lastAccessedAt.hashCode, createdAt.hashCode, updatedAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['courseId'] = nativeToJson(courseId); + if (progressPercent != null) { + json['progressPercent'] = nativeToJson(progressPercent); + } + if (completed != null) { + json['completed'] = nativeToJson(completed); + } + if (completedAt != null) { + json['completedAt'] = completedAt!.toJson(); + } + if (startedAt != null) { + json['startedAt'] = startedAt!.toJson(); + } + if (lastAccessedAt != null) { + json['lastAccessedAt'] = lastAccessedAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + return json; + } + + ListStaffCoursesByCourseIdStaffCourses({ + required this.id, + required this.staffId, + required this.courseId, + this.progressPercent, + this.completed, + this.completedAt, + this.startedAt, + this.lastAccessedAt, + this.createdAt, + this.updatedAt, + }); +} + +@immutable +class ListStaffCoursesByCourseIdData { + final List staffCourses; + ListStaffCoursesByCourseIdData.fromJson(dynamic json): + + staffCourses = (json['staffCourses'] as List) + .map((e) => ListStaffCoursesByCourseIdStaffCourses.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffCoursesByCourseIdData otherTyped = other as ListStaffCoursesByCourseIdData; + return staffCourses == otherTyped.staffCourses; + + } + @override + int get hashCode => staffCourses.hashCode; + + + Map toJson() { + Map json = {}; + json['staffCourses'] = staffCourses.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffCoursesByCourseIdData({ + required this.staffCourses, + }); +} + +@immutable +class ListStaffCoursesByCourseIdVariables { + final String courseId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListStaffCoursesByCourseIdVariables.fromJson(Map json): + + courseId = nativeFromJson(json['courseId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffCoursesByCourseIdVariables otherTyped = other as ListStaffCoursesByCourseIdVariables; + return courseId == otherTyped.courseId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([courseId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['courseId'] = nativeToJson(courseId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListStaffCoursesByCourseIdVariables({ + required this.courseId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_courses_by_staff_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_courses_by_staff_id.dart new file mode 100644 index 00000000..e2663e4a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_courses_by_staff_id.dart @@ -0,0 +1,216 @@ +part of 'generated.dart'; + +class ListStaffCoursesByStaffIdVariablesBuilder { + String staffId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListStaffCoursesByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffCoursesByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListStaffCoursesByStaffIdVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => ListStaffCoursesByStaffIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListStaffCoursesByStaffIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListStaffCoursesByStaffIdVariables vars= ListStaffCoursesByStaffIdVariables(staffId: staffId,offset: _offset,limit: _limit,); + return _dataConnect.query("listStaffCoursesByStaffId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListStaffCoursesByStaffIdStaffCourses { + final String id; + final String staffId; + final String courseId; + final int? progressPercent; + final bool? completed; + final Timestamp? completedAt; + final Timestamp? startedAt; + final Timestamp? lastAccessedAt; + final Timestamp? createdAt; + final Timestamp? updatedAt; + ListStaffCoursesByStaffIdStaffCourses.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + courseId = nativeFromJson(json['courseId']), + progressPercent = json['progressPercent'] == null ? null : nativeFromJson(json['progressPercent']), + completed = json['completed'] == null ? null : nativeFromJson(json['completed']), + completedAt = json['completedAt'] == null ? null : Timestamp.fromJson(json['completedAt']), + startedAt = json['startedAt'] == null ? null : Timestamp.fromJson(json['startedAt']), + lastAccessedAt = json['lastAccessedAt'] == null ? null : Timestamp.fromJson(json['lastAccessedAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffCoursesByStaffIdStaffCourses otherTyped = other as ListStaffCoursesByStaffIdStaffCourses; + return id == otherTyped.id && + staffId == otherTyped.staffId && + courseId == otherTyped.courseId && + progressPercent == otherTyped.progressPercent && + completed == otherTyped.completed && + completedAt == otherTyped.completedAt && + startedAt == otherTyped.startedAt && + lastAccessedAt == otherTyped.lastAccessedAt && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, courseId.hashCode, progressPercent.hashCode, completed.hashCode, completedAt.hashCode, startedAt.hashCode, lastAccessedAt.hashCode, createdAt.hashCode, updatedAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['courseId'] = nativeToJson(courseId); + if (progressPercent != null) { + json['progressPercent'] = nativeToJson(progressPercent); + } + if (completed != null) { + json['completed'] = nativeToJson(completed); + } + if (completedAt != null) { + json['completedAt'] = completedAt!.toJson(); + } + if (startedAt != null) { + json['startedAt'] = startedAt!.toJson(); + } + if (lastAccessedAt != null) { + json['lastAccessedAt'] = lastAccessedAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + return json; + } + + ListStaffCoursesByStaffIdStaffCourses({ + required this.id, + required this.staffId, + required this.courseId, + this.progressPercent, + this.completed, + this.completedAt, + this.startedAt, + this.lastAccessedAt, + this.createdAt, + this.updatedAt, + }); +} + +@immutable +class ListStaffCoursesByStaffIdData { + final List staffCourses; + ListStaffCoursesByStaffIdData.fromJson(dynamic json): + + staffCourses = (json['staffCourses'] as List) + .map((e) => ListStaffCoursesByStaffIdStaffCourses.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffCoursesByStaffIdData otherTyped = other as ListStaffCoursesByStaffIdData; + return staffCourses == otherTyped.staffCourses; + + } + @override + int get hashCode => staffCourses.hashCode; + + + Map toJson() { + Map json = {}; + json['staffCourses'] = staffCourses.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffCoursesByStaffIdData({ + required this.staffCourses, + }); +} + +@immutable +class ListStaffCoursesByStaffIdVariables { + final String staffId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListStaffCoursesByStaffIdVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffCoursesByStaffIdVariables otherTyped = other as ListStaffCoursesByStaffIdVariables; + return staffId == otherTyped.staffId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListStaffCoursesByStaffIdVariables({ + required this.staffId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_documents_by_document_type.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_documents_by_document_type.dart new file mode 100644 index 00000000..8f47e917 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_documents_by_document_type.dart @@ -0,0 +1,246 @@ +part of 'generated.dart'; + +class ListStaffDocumentsByDocumentTypeVariablesBuilder { + DocumentType documentType; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListStaffDocumentsByDocumentTypeVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffDocumentsByDocumentTypeVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListStaffDocumentsByDocumentTypeVariablesBuilder(this._dataConnect, {required this.documentType,}); + Deserializer dataDeserializer = (dynamic json) => ListStaffDocumentsByDocumentTypeData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListStaffDocumentsByDocumentTypeVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListStaffDocumentsByDocumentTypeVariables vars= ListStaffDocumentsByDocumentTypeVariables(documentType: documentType,offset: _offset,limit: _limit,); + return _dataConnect.query("listStaffDocumentsByDocumentType", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListStaffDocumentsByDocumentTypeStaffDocuments { + final String id; + final String staffId; + final String staffName; + final String documentId; + final EnumValue status; + final String? documentUrl; + final Timestamp? expiryDate; + final ListStaffDocumentsByDocumentTypeStaffDocumentsDocument document; + ListStaffDocumentsByDocumentTypeStaffDocuments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + staffName = nativeFromJson(json['staffName']), + documentId = nativeFromJson(json['documentId']), + status = documentStatusDeserializer(json['status']), + documentUrl = json['documentUrl'] == null ? null : nativeFromJson(json['documentUrl']), + expiryDate = json['expiryDate'] == null ? null : Timestamp.fromJson(json['expiryDate']), + document = ListStaffDocumentsByDocumentTypeStaffDocumentsDocument.fromJson(json['document']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffDocumentsByDocumentTypeStaffDocuments otherTyped = other as ListStaffDocumentsByDocumentTypeStaffDocuments; + return id == otherTyped.id && + staffId == otherTyped.staffId && + staffName == otherTyped.staffName && + documentId == otherTyped.documentId && + status == otherTyped.status && + documentUrl == otherTyped.documentUrl && + expiryDate == otherTyped.expiryDate && + document == otherTyped.document; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, staffName.hashCode, documentId.hashCode, status.hashCode, documentUrl.hashCode, expiryDate.hashCode, document.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['staffName'] = nativeToJson(staffName); + json['documentId'] = nativeToJson(documentId); + json['status'] = + documentStatusSerializer(status) + ; + if (documentUrl != null) { + json['documentUrl'] = nativeToJson(documentUrl); + } + if (expiryDate != null) { + json['expiryDate'] = expiryDate!.toJson(); + } + json['document'] = document.toJson(); + return json; + } + + ListStaffDocumentsByDocumentTypeStaffDocuments({ + required this.id, + required this.staffId, + required this.staffName, + required this.documentId, + required this.status, + this.documentUrl, + this.expiryDate, + required this.document, + }); +} + +@immutable +class ListStaffDocumentsByDocumentTypeStaffDocumentsDocument { + final String id; + final String name; + final EnumValue documentType; + ListStaffDocumentsByDocumentTypeStaffDocumentsDocument.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + documentType = documentTypeDeserializer(json['documentType']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffDocumentsByDocumentTypeStaffDocumentsDocument otherTyped = other as ListStaffDocumentsByDocumentTypeStaffDocumentsDocument; + return id == otherTyped.id && + name == otherTyped.name && + documentType == otherTyped.documentType; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, documentType.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['documentType'] = + documentTypeSerializer(documentType) + ; + return json; + } + + ListStaffDocumentsByDocumentTypeStaffDocumentsDocument({ + required this.id, + required this.name, + required this.documentType, + }); +} + +@immutable +class ListStaffDocumentsByDocumentTypeData { + final List staffDocuments; + ListStaffDocumentsByDocumentTypeData.fromJson(dynamic json): + + staffDocuments = (json['staffDocuments'] as List) + .map((e) => ListStaffDocumentsByDocumentTypeStaffDocuments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffDocumentsByDocumentTypeData otherTyped = other as ListStaffDocumentsByDocumentTypeData; + return staffDocuments == otherTyped.staffDocuments; + + } + @override + int get hashCode => staffDocuments.hashCode; + + + Map toJson() { + Map json = {}; + json['staffDocuments'] = staffDocuments.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffDocumentsByDocumentTypeData({ + required this.staffDocuments, + }); +} + +@immutable +class ListStaffDocumentsByDocumentTypeVariables { + final DocumentType documentType; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListStaffDocumentsByDocumentTypeVariables.fromJson(Map json): + + documentType = DocumentType.values.byName(json['documentType']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffDocumentsByDocumentTypeVariables otherTyped = other as ListStaffDocumentsByDocumentTypeVariables; + return documentType == otherTyped.documentType && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([documentType.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['documentType'] = + documentType.name + ; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListStaffDocumentsByDocumentTypeVariables({ + required this.documentType, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_documents_by_staff_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_documents_by_staff_id.dart new file mode 100644 index 00000000..2d5d2155 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_documents_by_staff_id.dart @@ -0,0 +1,258 @@ +part of 'generated.dart'; + +class ListStaffDocumentsByStaffIdVariablesBuilder { + String staffId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListStaffDocumentsByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffDocumentsByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListStaffDocumentsByStaffIdVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => ListStaffDocumentsByStaffIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListStaffDocumentsByStaffIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListStaffDocumentsByStaffIdVariables vars= ListStaffDocumentsByStaffIdVariables(staffId: staffId,offset: _offset,limit: _limit,); + return _dataConnect.query("listStaffDocumentsByStaffId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListStaffDocumentsByStaffIdStaffDocuments { + final String id; + final String staffId; + final String staffName; + final String documentId; + final EnumValue status; + final String? documentUrl; + final Timestamp? expiryDate; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final ListStaffDocumentsByStaffIdStaffDocumentsDocument document; + ListStaffDocumentsByStaffIdStaffDocuments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + staffName = nativeFromJson(json['staffName']), + documentId = nativeFromJson(json['documentId']), + status = documentStatusDeserializer(json['status']), + documentUrl = json['documentUrl'] == null ? null : nativeFromJson(json['documentUrl']), + expiryDate = json['expiryDate'] == null ? null : Timestamp.fromJson(json['expiryDate']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + document = ListStaffDocumentsByStaffIdStaffDocumentsDocument.fromJson(json['document']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffDocumentsByStaffIdStaffDocuments otherTyped = other as ListStaffDocumentsByStaffIdStaffDocuments; + return id == otherTyped.id && + staffId == otherTyped.staffId && + staffName == otherTyped.staffName && + documentId == otherTyped.documentId && + status == otherTyped.status && + documentUrl == otherTyped.documentUrl && + expiryDate == otherTyped.expiryDate && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + document == otherTyped.document; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, staffName.hashCode, documentId.hashCode, status.hashCode, documentUrl.hashCode, expiryDate.hashCode, createdAt.hashCode, updatedAt.hashCode, document.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['staffName'] = nativeToJson(staffName); + json['documentId'] = nativeToJson(documentId); + json['status'] = + documentStatusSerializer(status) + ; + if (documentUrl != null) { + json['documentUrl'] = nativeToJson(documentUrl); + } + if (expiryDate != null) { + json['expiryDate'] = expiryDate!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + json['document'] = document.toJson(); + return json; + } + + ListStaffDocumentsByStaffIdStaffDocuments({ + required this.id, + required this.staffId, + required this.staffName, + required this.documentId, + required this.status, + this.documentUrl, + this.expiryDate, + this.createdAt, + this.updatedAt, + required this.document, + }); +} + +@immutable +class ListStaffDocumentsByStaffIdStaffDocumentsDocument { + final String id; + final String name; + final EnumValue documentType; + ListStaffDocumentsByStaffIdStaffDocumentsDocument.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + documentType = documentTypeDeserializer(json['documentType']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffDocumentsByStaffIdStaffDocumentsDocument otherTyped = other as ListStaffDocumentsByStaffIdStaffDocumentsDocument; + return id == otherTyped.id && + name == otherTyped.name && + documentType == otherTyped.documentType; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, documentType.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['documentType'] = + documentTypeSerializer(documentType) + ; + return json; + } + + ListStaffDocumentsByStaffIdStaffDocumentsDocument({ + required this.id, + required this.name, + required this.documentType, + }); +} + +@immutable +class ListStaffDocumentsByStaffIdData { + final List staffDocuments; + ListStaffDocumentsByStaffIdData.fromJson(dynamic json): + + staffDocuments = (json['staffDocuments'] as List) + .map((e) => ListStaffDocumentsByStaffIdStaffDocuments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffDocumentsByStaffIdData otherTyped = other as ListStaffDocumentsByStaffIdData; + return staffDocuments == otherTyped.staffDocuments; + + } + @override + int get hashCode => staffDocuments.hashCode; + + + Map toJson() { + Map json = {}; + json['staffDocuments'] = staffDocuments.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffDocumentsByStaffIdData({ + required this.staffDocuments, + }); +} + +@immutable +class ListStaffDocumentsByStaffIdVariables { + final String staffId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListStaffDocumentsByStaffIdVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffDocumentsByStaffIdVariables otherTyped = other as ListStaffDocumentsByStaffIdVariables; + return staffId == otherTyped.staffId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListStaffDocumentsByStaffIdVariables({ + required this.staffId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_documents_by_status.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_documents_by_status.dart new file mode 100644 index 00000000..1bb9e23f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_documents_by_status.dart @@ -0,0 +1,246 @@ +part of 'generated.dart'; + +class ListStaffDocumentsByStatusVariablesBuilder { + DocumentStatus status; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListStaffDocumentsByStatusVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffDocumentsByStatusVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListStaffDocumentsByStatusVariablesBuilder(this._dataConnect, {required this.status,}); + Deserializer dataDeserializer = (dynamic json) => ListStaffDocumentsByStatusData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListStaffDocumentsByStatusVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListStaffDocumentsByStatusVariables vars= ListStaffDocumentsByStatusVariables(status: status,offset: _offset,limit: _limit,); + return _dataConnect.query("listStaffDocumentsByStatus", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListStaffDocumentsByStatusStaffDocuments { + final String id; + final String staffId; + final String staffName; + final String documentId; + final EnumValue status; + final String? documentUrl; + final Timestamp? expiryDate; + final ListStaffDocumentsByStatusStaffDocumentsDocument document; + ListStaffDocumentsByStatusStaffDocuments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + staffName = nativeFromJson(json['staffName']), + documentId = nativeFromJson(json['documentId']), + status = documentStatusDeserializer(json['status']), + documentUrl = json['documentUrl'] == null ? null : nativeFromJson(json['documentUrl']), + expiryDate = json['expiryDate'] == null ? null : Timestamp.fromJson(json['expiryDate']), + document = ListStaffDocumentsByStatusStaffDocumentsDocument.fromJson(json['document']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffDocumentsByStatusStaffDocuments otherTyped = other as ListStaffDocumentsByStatusStaffDocuments; + return id == otherTyped.id && + staffId == otherTyped.staffId && + staffName == otherTyped.staffName && + documentId == otherTyped.documentId && + status == otherTyped.status && + documentUrl == otherTyped.documentUrl && + expiryDate == otherTyped.expiryDate && + document == otherTyped.document; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, staffName.hashCode, documentId.hashCode, status.hashCode, documentUrl.hashCode, expiryDate.hashCode, document.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['staffName'] = nativeToJson(staffName); + json['documentId'] = nativeToJson(documentId); + json['status'] = + documentStatusSerializer(status) + ; + if (documentUrl != null) { + json['documentUrl'] = nativeToJson(documentUrl); + } + if (expiryDate != null) { + json['expiryDate'] = expiryDate!.toJson(); + } + json['document'] = document.toJson(); + return json; + } + + ListStaffDocumentsByStatusStaffDocuments({ + required this.id, + required this.staffId, + required this.staffName, + required this.documentId, + required this.status, + this.documentUrl, + this.expiryDate, + required this.document, + }); +} + +@immutable +class ListStaffDocumentsByStatusStaffDocumentsDocument { + final String id; + final String name; + final EnumValue documentType; + ListStaffDocumentsByStatusStaffDocumentsDocument.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + documentType = documentTypeDeserializer(json['documentType']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffDocumentsByStatusStaffDocumentsDocument otherTyped = other as ListStaffDocumentsByStatusStaffDocumentsDocument; + return id == otherTyped.id && + name == otherTyped.name && + documentType == otherTyped.documentType; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, documentType.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['documentType'] = + documentTypeSerializer(documentType) + ; + return json; + } + + ListStaffDocumentsByStatusStaffDocumentsDocument({ + required this.id, + required this.name, + required this.documentType, + }); +} + +@immutable +class ListStaffDocumentsByStatusData { + final List staffDocuments; + ListStaffDocumentsByStatusData.fromJson(dynamic json): + + staffDocuments = (json['staffDocuments'] as List) + .map((e) => ListStaffDocumentsByStatusStaffDocuments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffDocumentsByStatusData otherTyped = other as ListStaffDocumentsByStatusData; + return staffDocuments == otherTyped.staffDocuments; + + } + @override + int get hashCode => staffDocuments.hashCode; + + + Map toJson() { + Map json = {}; + json['staffDocuments'] = staffDocuments.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffDocumentsByStatusData({ + required this.staffDocuments, + }); +} + +@immutable +class ListStaffDocumentsByStatusVariables { + final DocumentStatus status; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListStaffDocumentsByStatusVariables.fromJson(Map json): + + status = DocumentStatus.values.byName(json['status']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffDocumentsByStatusVariables otherTyped = other as ListStaffDocumentsByStatusVariables; + return status == otherTyped.status && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([status.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['status'] = + status.name + ; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListStaffDocumentsByStatusVariables({ + required this.status, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_for_no_show_report.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_for_no_show_report.dart new file mode 100644 index 00000000..e111c216 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_for_no_show_report.dart @@ -0,0 +1,145 @@ +part of 'generated.dart'; + +class ListStaffForNoShowReportVariablesBuilder { + List staffIds; + + final FirebaseDataConnect _dataConnect; + ListStaffForNoShowReportVariablesBuilder(this._dataConnect, {required this.staffIds,}); + Deserializer dataDeserializer = (dynamic json) => ListStaffForNoShowReportData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListStaffForNoShowReportVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListStaffForNoShowReportVariables vars= ListStaffForNoShowReportVariables(staffIds: staffIds,); + return _dataConnect.query("listStaffForNoShowReport", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListStaffForNoShowReportStaffs { + final String id; + final String fullName; + final int? noShowCount; + final int? reliabilityScore; + ListStaffForNoShowReportStaffs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']), + noShowCount = json['noShowCount'] == null ? null : nativeFromJson(json['noShowCount']), + reliabilityScore = json['reliabilityScore'] == null ? null : nativeFromJson(json['reliabilityScore']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffForNoShowReportStaffs otherTyped = other as ListStaffForNoShowReportStaffs; + return id == otherTyped.id && + fullName == otherTyped.fullName && + noShowCount == otherTyped.noShowCount && + reliabilityScore == otherTyped.reliabilityScore; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, noShowCount.hashCode, reliabilityScore.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + if (noShowCount != null) { + json['noShowCount'] = nativeToJson(noShowCount); + } + if (reliabilityScore != null) { + json['reliabilityScore'] = nativeToJson(reliabilityScore); + } + return json; + } + + ListStaffForNoShowReportStaffs({ + required this.id, + required this.fullName, + this.noShowCount, + this.reliabilityScore, + }); +} + +@immutable +class ListStaffForNoShowReportData { + final List staffs; + ListStaffForNoShowReportData.fromJson(dynamic json): + + staffs = (json['staffs'] as List) + .map((e) => ListStaffForNoShowReportStaffs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffForNoShowReportData otherTyped = other as ListStaffForNoShowReportData; + return staffs == otherTyped.staffs; + + } + @override + int get hashCode => staffs.hashCode; + + + Map toJson() { + Map json = {}; + json['staffs'] = staffs.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffForNoShowReportData({ + required this.staffs, + }); +} + +@immutable +class ListStaffForNoShowReportVariables { + final List staffIds; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListStaffForNoShowReportVariables.fromJson(Map json): + + staffIds = (json['staffIds'] as List) + .map((e) => nativeFromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffForNoShowReportVariables otherTyped = other as ListStaffForNoShowReportVariables; + return staffIds == otherTyped.staffIds; + + } + @override + int get hashCode => staffIds.hashCode; + + + Map toJson() { + Map json = {}; + json['staffIds'] = staffIds.map((e) => nativeToJson(e)).toList(); + return json; + } + + ListStaffForNoShowReportVariables({ + required this.staffIds, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_for_performance.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_for_performance.dart new file mode 100644 index 00000000..65ed71a9 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_for_performance.dart @@ -0,0 +1,154 @@ +part of 'generated.dart'; + +class ListStaffForPerformanceVariablesBuilder { + List staffIds; + + final FirebaseDataConnect _dataConnect; + ListStaffForPerformanceVariablesBuilder(this._dataConnect, {required this.staffIds,}); + Deserializer dataDeserializer = (dynamic json) => ListStaffForPerformanceData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListStaffForPerformanceVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListStaffForPerformanceVariables vars= ListStaffForPerformanceVariables(staffIds: staffIds,); + return _dataConnect.query("listStaffForPerformance", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListStaffForPerformanceStaffs { + final String id; + final double? averageRating; + final int? onTimeRate; + final int? noShowCount; + final int? reliabilityScore; + ListStaffForPerformanceStaffs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + averageRating = json['averageRating'] == null ? null : nativeFromJson(json['averageRating']), + onTimeRate = json['onTimeRate'] == null ? null : nativeFromJson(json['onTimeRate']), + noShowCount = json['noShowCount'] == null ? null : nativeFromJson(json['noShowCount']), + reliabilityScore = json['reliabilityScore'] == null ? null : nativeFromJson(json['reliabilityScore']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffForPerformanceStaffs otherTyped = other as ListStaffForPerformanceStaffs; + return id == otherTyped.id && + averageRating == otherTyped.averageRating && + onTimeRate == otherTyped.onTimeRate && + noShowCount == otherTyped.noShowCount && + reliabilityScore == otherTyped.reliabilityScore; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, averageRating.hashCode, onTimeRate.hashCode, noShowCount.hashCode, reliabilityScore.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (averageRating != null) { + json['averageRating'] = nativeToJson(averageRating); + } + if (onTimeRate != null) { + json['onTimeRate'] = nativeToJson(onTimeRate); + } + if (noShowCount != null) { + json['noShowCount'] = nativeToJson(noShowCount); + } + if (reliabilityScore != null) { + json['reliabilityScore'] = nativeToJson(reliabilityScore); + } + return json; + } + + ListStaffForPerformanceStaffs({ + required this.id, + this.averageRating, + this.onTimeRate, + this.noShowCount, + this.reliabilityScore, + }); +} + +@immutable +class ListStaffForPerformanceData { + final List staffs; + ListStaffForPerformanceData.fromJson(dynamic json): + + staffs = (json['staffs'] as List) + .map((e) => ListStaffForPerformanceStaffs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffForPerformanceData otherTyped = other as ListStaffForPerformanceData; + return staffs == otherTyped.staffs; + + } + @override + int get hashCode => staffs.hashCode; + + + Map toJson() { + Map json = {}; + json['staffs'] = staffs.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffForPerformanceData({ + required this.staffs, + }); +} + +@immutable +class ListStaffForPerformanceVariables { + final List staffIds; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListStaffForPerformanceVariables.fromJson(Map json): + + staffIds = (json['staffIds'] as List) + .map((e) => nativeFromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffForPerformanceVariables otherTyped = other as ListStaffForPerformanceVariables; + return staffIds == otherTyped.staffIds; + + } + @override + int get hashCode => staffIds.hashCode; + + + Map toJson() { + Map json = {}; + json['staffIds'] = staffIds.map((e) => nativeToJson(e)).toList(); + return json; + } + + ListStaffForPerformanceVariables({ + required this.staffIds, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_roles.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_roles.dart new file mode 100644 index 00000000..d8c9f919 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_roles.dart @@ -0,0 +1,288 @@ +part of 'generated.dart'; + +class ListStaffRolesVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListStaffRolesVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffRolesVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListStaffRolesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListStaffRolesData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListStaffRolesVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListStaffRolesVariables vars= ListStaffRolesVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listStaffRoles", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListStaffRolesStaffRoles { + final String id; + final String staffId; + final String roleId; + final Timestamp? createdAt; + final EnumValue? roleType; + final ListStaffRolesStaffRolesStaff staff; + final ListStaffRolesStaffRolesRole role; + ListStaffRolesStaffRoles.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + roleId = nativeFromJson(json['roleId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + roleType = json['roleType'] == null ? null : roleTypeDeserializer(json['roleType']), + staff = ListStaffRolesStaffRolesStaff.fromJson(json['staff']), + role = ListStaffRolesStaffRolesRole.fromJson(json['role']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffRolesStaffRoles otherTyped = other as ListStaffRolesStaffRoles; + return id == otherTyped.id && + staffId == otherTyped.staffId && + roleId == otherTyped.roleId && + createdAt == otherTyped.createdAt && + roleType == otherTyped.roleType && + staff == otherTyped.staff && + role == otherTyped.role; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, roleId.hashCode, createdAt.hashCode, roleType.hashCode, staff.hashCode, role.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['roleId'] = nativeToJson(roleId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (roleType != null) { + json['roleType'] = + roleTypeSerializer(roleType!) + ; + } + json['staff'] = staff.toJson(); + json['role'] = role.toJson(); + return json; + } + + ListStaffRolesStaffRoles({ + required this.id, + required this.staffId, + required this.roleId, + this.createdAt, + this.roleType, + required this.staff, + required this.role, + }); +} + +@immutable +class ListStaffRolesStaffRolesStaff { + final String id; + final String fullName; + final String userId; + final String? email; + final String? phone; + ListStaffRolesStaffRolesStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']), + userId = nativeFromJson(json['userId']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffRolesStaffRolesStaff otherTyped = other as ListStaffRolesStaffRolesStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName && + userId == otherTyped.userId && + email == otherTyped.email && + phone == otherTyped.phone; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, userId.hashCode, email.hashCode, phone.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + json['userId'] = nativeToJson(userId); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + return json; + } + + ListStaffRolesStaffRolesStaff({ + required this.id, + required this.fullName, + required this.userId, + this.email, + this.phone, + }); +} + +@immutable +class ListStaffRolesStaffRolesRole { + final String id; + final String name; + final double costPerHour; + ListStaffRolesStaffRolesRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffRolesStaffRolesRole otherTyped = other as ListStaffRolesStaffRolesRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListStaffRolesStaffRolesRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListStaffRolesData { + final List staffRoles; + ListStaffRolesData.fromJson(dynamic json): + + staffRoles = (json['staffRoles'] as List) + .map((e) => ListStaffRolesStaffRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffRolesData otherTyped = other as ListStaffRolesData; + return staffRoles == otherTyped.staffRoles; + + } + @override + int get hashCode => staffRoles.hashCode; + + + Map toJson() { + Map json = {}; + json['staffRoles'] = staffRoles.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffRolesData({ + required this.staffRoles, + }); +} + +@immutable +class ListStaffRolesVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListStaffRolesVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffRolesVariables otherTyped = other as ListStaffRolesVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListStaffRolesVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_roles_by_role_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_roles_by_role_id.dart new file mode 100644 index 00000000..2796711c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_roles_by_role_id.dart @@ -0,0 +1,246 @@ +part of 'generated.dart'; + +class ListStaffRolesByRoleIdVariablesBuilder { + String roleId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListStaffRolesByRoleIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffRolesByRoleIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListStaffRolesByRoleIdVariablesBuilder(this._dataConnect, {required this.roleId,}); + Deserializer dataDeserializer = (dynamic json) => ListStaffRolesByRoleIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListStaffRolesByRoleIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListStaffRolesByRoleIdVariables vars= ListStaffRolesByRoleIdVariables(roleId: roleId,offset: _offset,limit: _limit,); + return _dataConnect.query("listStaffRolesByRoleId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListStaffRolesByRoleIdStaffRoles { + final String id; + final String staffId; + final String roleId; + final Timestamp? createdAt; + final EnumValue? roleType; + final ListStaffRolesByRoleIdStaffRolesStaff staff; + ListStaffRolesByRoleIdStaffRoles.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + roleId = nativeFromJson(json['roleId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + roleType = json['roleType'] == null ? null : roleTypeDeserializer(json['roleType']), + staff = ListStaffRolesByRoleIdStaffRolesStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffRolesByRoleIdStaffRoles otherTyped = other as ListStaffRolesByRoleIdStaffRoles; + return id == otherTyped.id && + staffId == otherTyped.staffId && + roleId == otherTyped.roleId && + createdAt == otherTyped.createdAt && + roleType == otherTyped.roleType && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, roleId.hashCode, createdAt.hashCode, roleType.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['roleId'] = nativeToJson(roleId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (roleType != null) { + json['roleType'] = + roleTypeSerializer(roleType!) + ; + } + json['staff'] = staff.toJson(); + return json; + } + + ListStaffRolesByRoleIdStaffRoles({ + required this.id, + required this.staffId, + required this.roleId, + this.createdAt, + this.roleType, + required this.staff, + }); +} + +@immutable +class ListStaffRolesByRoleIdStaffRolesStaff { + final String id; + final String fullName; + final String userId; + final String? email; + final String? phone; + ListStaffRolesByRoleIdStaffRolesStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']), + userId = nativeFromJson(json['userId']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffRolesByRoleIdStaffRolesStaff otherTyped = other as ListStaffRolesByRoleIdStaffRolesStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName && + userId == otherTyped.userId && + email == otherTyped.email && + phone == otherTyped.phone; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, userId.hashCode, email.hashCode, phone.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + json['userId'] = nativeToJson(userId); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + return json; + } + + ListStaffRolesByRoleIdStaffRolesStaff({ + required this.id, + required this.fullName, + required this.userId, + this.email, + this.phone, + }); +} + +@immutable +class ListStaffRolesByRoleIdData { + final List staffRoles; + ListStaffRolesByRoleIdData.fromJson(dynamic json): + + staffRoles = (json['staffRoles'] as List) + .map((e) => ListStaffRolesByRoleIdStaffRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffRolesByRoleIdData otherTyped = other as ListStaffRolesByRoleIdData; + return staffRoles == otherTyped.staffRoles; + + } + @override + int get hashCode => staffRoles.hashCode; + + + Map toJson() { + Map json = {}; + json['staffRoles'] = staffRoles.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffRolesByRoleIdData({ + required this.staffRoles, + }); +} + +@immutable +class ListStaffRolesByRoleIdVariables { + final String roleId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListStaffRolesByRoleIdVariables.fromJson(Map json): + + roleId = nativeFromJson(json['roleId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffRolesByRoleIdVariables otherTyped = other as ListStaffRolesByRoleIdVariables; + return roleId == otherTyped.roleId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([roleId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['roleId'] = nativeToJson(roleId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListStaffRolesByRoleIdVariables({ + required this.roleId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_roles_by_staff_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_roles_by_staff_id.dart new file mode 100644 index 00000000..39248b02 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_staff_roles_by_staff_id.dart @@ -0,0 +1,232 @@ +part of 'generated.dart'; + +class ListStaffRolesByStaffIdVariablesBuilder { + String staffId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListStaffRolesByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListStaffRolesByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListStaffRolesByStaffIdVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => ListStaffRolesByStaffIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListStaffRolesByStaffIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListStaffRolesByStaffIdVariables vars= ListStaffRolesByStaffIdVariables(staffId: staffId,offset: _offset,limit: _limit,); + return _dataConnect.query("listStaffRolesByStaffId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListStaffRolesByStaffIdStaffRoles { + final String id; + final String staffId; + final String roleId; + final Timestamp? createdAt; + final EnumValue? roleType; + final ListStaffRolesByStaffIdStaffRolesRole role; + ListStaffRolesByStaffIdStaffRoles.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + roleId = nativeFromJson(json['roleId']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + roleType = json['roleType'] == null ? null : roleTypeDeserializer(json['roleType']), + role = ListStaffRolesByStaffIdStaffRolesRole.fromJson(json['role']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffRolesByStaffIdStaffRoles otherTyped = other as ListStaffRolesByStaffIdStaffRoles; + return id == otherTyped.id && + staffId == otherTyped.staffId && + roleId == otherTyped.roleId && + createdAt == otherTyped.createdAt && + roleType == otherTyped.roleType && + role == otherTyped.role; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, roleId.hashCode, createdAt.hashCode, roleType.hashCode, role.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['roleId'] = nativeToJson(roleId); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (roleType != null) { + json['roleType'] = + roleTypeSerializer(roleType!) + ; + } + json['role'] = role.toJson(); + return json; + } + + ListStaffRolesByStaffIdStaffRoles({ + required this.id, + required this.staffId, + required this.roleId, + this.createdAt, + this.roleType, + required this.role, + }); +} + +@immutable +class ListStaffRolesByStaffIdStaffRolesRole { + final String id; + final String name; + final double costPerHour; + ListStaffRolesByStaffIdStaffRolesRole.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffRolesByStaffIdStaffRolesRole otherTyped = other as ListStaffRolesByStaffIdStaffRolesRole; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListStaffRolesByStaffIdStaffRolesRole({ + required this.id, + required this.name, + required this.costPerHour, + }); +} + +@immutable +class ListStaffRolesByStaffIdData { + final List staffRoles; + ListStaffRolesByStaffIdData.fromJson(dynamic json): + + staffRoles = (json['staffRoles'] as List) + .map((e) => ListStaffRolesByStaffIdStaffRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffRolesByStaffIdData otherTyped = other as ListStaffRolesByStaffIdData; + return staffRoles == otherTyped.staffRoles; + + } + @override + int get hashCode => staffRoles.hashCode; + + + Map toJson() { + Map json = {}; + json['staffRoles'] = staffRoles.map((e) => e.toJson()).toList(); + return json; + } + + ListStaffRolesByStaffIdData({ + required this.staffRoles, + }); +} + +@immutable +class ListStaffRolesByStaffIdVariables { + final String staffId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListStaffRolesByStaffIdVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListStaffRolesByStaffIdVariables otherTyped = other as ListStaffRolesByStaffIdVariables; + return staffId == otherTyped.staffId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListStaffRolesByStaffIdVariables({ + required this.staffId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_task_comments.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_task_comments.dart new file mode 100644 index 00000000..acf74e6b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_task_comments.dart @@ -0,0 +1,197 @@ +part of 'generated.dart'; + +class ListTaskCommentsVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListTaskCommentsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListTaskCommentsData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listTaskComments", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListTaskCommentsTaskComments { + final String id; + final String taskId; + final String teamMemberId; + final String comment; + final bool isSystem; + final Timestamp? createdAt; + final ListTaskCommentsTaskCommentsTeamMember teamMember; + ListTaskCommentsTaskComments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + taskId = nativeFromJson(json['taskId']), + teamMemberId = nativeFromJson(json['teamMemberId']), + comment = nativeFromJson(json['comment']), + isSystem = nativeFromJson(json['isSystem']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + teamMember = ListTaskCommentsTaskCommentsTeamMember.fromJson(json['teamMember']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTaskCommentsTaskComments otherTyped = other as ListTaskCommentsTaskComments; + return id == otherTyped.id && + taskId == otherTyped.taskId && + teamMemberId == otherTyped.teamMemberId && + comment == otherTyped.comment && + isSystem == otherTyped.isSystem && + createdAt == otherTyped.createdAt && + teamMember == otherTyped.teamMember; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, taskId.hashCode, teamMemberId.hashCode, comment.hashCode, isSystem.hashCode, createdAt.hashCode, teamMember.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['taskId'] = nativeToJson(taskId); + json['teamMemberId'] = nativeToJson(teamMemberId); + json['comment'] = nativeToJson(comment); + json['isSystem'] = nativeToJson(isSystem); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['teamMember'] = teamMember.toJson(); + return json; + } + + ListTaskCommentsTaskComments({ + required this.id, + required this.taskId, + required this.teamMemberId, + required this.comment, + required this.isSystem, + this.createdAt, + required this.teamMember, + }); +} + +@immutable +class ListTaskCommentsTaskCommentsTeamMember { + final ListTaskCommentsTaskCommentsTeamMemberUser user; + ListTaskCommentsTaskCommentsTeamMember.fromJson(dynamic json): + + user = ListTaskCommentsTaskCommentsTeamMemberUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTaskCommentsTaskCommentsTeamMember otherTyped = other as ListTaskCommentsTaskCommentsTeamMember; + return user == otherTyped.user; + + } + @override + int get hashCode => user.hashCode; + + + Map toJson() { + Map json = {}; + json['user'] = user.toJson(); + return json; + } + + ListTaskCommentsTaskCommentsTeamMember({ + required this.user, + }); +} + +@immutable +class ListTaskCommentsTaskCommentsTeamMemberUser { + final String? fullName; + final String? email; + ListTaskCommentsTaskCommentsTeamMemberUser.fromJson(dynamic json): + + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTaskCommentsTaskCommentsTeamMemberUser otherTyped = other as ListTaskCommentsTaskCommentsTeamMemberUser; + return fullName == otherTyped.fullName && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([fullName.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + ListTaskCommentsTaskCommentsTeamMemberUser({ + this.fullName, + this.email, + }); +} + +@immutable +class ListTaskCommentsData { + final List taskComments; + ListTaskCommentsData.fromJson(dynamic json): + + taskComments = (json['taskComments'] as List) + .map((e) => ListTaskCommentsTaskComments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTaskCommentsData otherTyped = other as ListTaskCommentsData; + return taskComments == otherTyped.taskComments; + + } + @override + int get hashCode => taskComments.hashCode; + + + Map toJson() { + Map json = {}; + json['taskComments'] = taskComments.map((e) => e.toJson()).toList(); + return json; + } + + ListTaskCommentsData({ + required this.taskComments, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_tasks.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_tasks.dart new file mode 100644 index 00000000..26fd9f29 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_tasks.dart @@ -0,0 +1,177 @@ +part of 'generated.dart'; + +class ListTasksVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListTasksVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListTasksData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listTasks", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListTasksTasks { + final String id; + final String taskName; + final String? description; + final EnumValue priority; + final EnumValue status; + final Timestamp? dueDate; + final int? progress; + final int? orderIndex; + final int? commentCount; + final int? attachmentCount; + final AnyValue? files; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + ListTasksTasks.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + taskName = nativeFromJson(json['taskName']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + priority = taskPriorityDeserializer(json['priority']), + status = taskStatusDeserializer(json['status']), + dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']), + progress = json['progress'] == null ? null : nativeFromJson(json['progress']), + orderIndex = json['orderIndex'] == null ? null : nativeFromJson(json['orderIndex']), + commentCount = json['commentCount'] == null ? null : nativeFromJson(json['commentCount']), + attachmentCount = json['attachmentCount'] == null ? null : nativeFromJson(json['attachmentCount']), + files = json['files'] == null ? null : AnyValue.fromJson(json['files']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTasksTasks otherTyped = other as ListTasksTasks; + return id == otherTyped.id && + taskName == otherTyped.taskName && + description == otherTyped.description && + priority == otherTyped.priority && + status == otherTyped.status && + dueDate == otherTyped.dueDate && + progress == otherTyped.progress && + orderIndex == otherTyped.orderIndex && + commentCount == otherTyped.commentCount && + attachmentCount == otherTyped.attachmentCount && + files == otherTyped.files && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, taskName.hashCode, description.hashCode, priority.hashCode, status.hashCode, dueDate.hashCode, progress.hashCode, orderIndex.hashCode, commentCount.hashCode, attachmentCount.hashCode, files.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['taskName'] = nativeToJson(taskName); + if (description != null) { + json['description'] = nativeToJson(description); + } + json['priority'] = + taskPrioritySerializer(priority) + ; + json['status'] = + taskStatusSerializer(status) + ; + if (dueDate != null) { + json['dueDate'] = dueDate!.toJson(); + } + if (progress != null) { + json['progress'] = nativeToJson(progress); + } + if (orderIndex != null) { + json['orderIndex'] = nativeToJson(orderIndex); + } + if (commentCount != null) { + json['commentCount'] = nativeToJson(commentCount); + } + if (attachmentCount != null) { + json['attachmentCount'] = nativeToJson(attachmentCount); + } + if (files != null) { + json['files'] = files!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + ListTasksTasks({ + required this.id, + required this.taskName, + this.description, + required this.priority, + required this.status, + this.dueDate, + this.progress, + this.orderIndex, + this.commentCount, + this.attachmentCount, + this.files, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class ListTasksData { + final List tasks; + ListTasksData.fromJson(dynamic json): + + tasks = (json['tasks'] as List) + .map((e) => ListTasksTasks.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTasksData otherTyped = other as ListTasksData; + return tasks == otherTyped.tasks; + + } + @override + int get hashCode => tasks.hashCode; + + + Map toJson() { + Map json = {}; + json['tasks'] = tasks.map((e) => e.toJson()).toList(); + return json; + } + + ListTasksData({ + required this.tasks, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_tax_forms.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_tax_forms.dart new file mode 100644 index 00000000..3884f7cd --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_tax_forms.dart @@ -0,0 +1,154 @@ +part of 'generated.dart'; + +class ListTaxFormsVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListTaxFormsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListTaxFormsData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listTaxForms", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListTaxFormsTaxForms { + final String id; + final EnumValue formType; + final String title; + final String? subtitle; + final String? description; + final EnumValue status; + final String staffId; + final AnyValue? formData; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + ListTaxFormsTaxForms.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + formType = taxFormTypeDeserializer(json['formType']), + title = nativeFromJson(json['title']), + subtitle = json['subtitle'] == null ? null : nativeFromJson(json['subtitle']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + status = taxFormStatusDeserializer(json['status']), + staffId = nativeFromJson(json['staffId']), + formData = json['formData'] == null ? null : AnyValue.fromJson(json['formData']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTaxFormsTaxForms otherTyped = other as ListTaxFormsTaxForms; + return id == otherTyped.id && + formType == otherTyped.formType && + title == otherTyped.title && + subtitle == otherTyped.subtitle && + description == otherTyped.description && + status == otherTyped.status && + staffId == otherTyped.staffId && + formData == otherTyped.formData && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, formType.hashCode, title.hashCode, subtitle.hashCode, description.hashCode, status.hashCode, staffId.hashCode, formData.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['formType'] = + taxFormTypeSerializer(formType) + ; + json['title'] = nativeToJson(title); + if (subtitle != null) { + json['subtitle'] = nativeToJson(subtitle); + } + if (description != null) { + json['description'] = nativeToJson(description); + } + json['status'] = + taxFormStatusSerializer(status) + ; + json['staffId'] = nativeToJson(staffId); + if (formData != null) { + json['formData'] = formData!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + ListTaxFormsTaxForms({ + required this.id, + required this.formType, + required this.title, + this.subtitle, + this.description, + required this.status, + required this.staffId, + this.formData, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class ListTaxFormsData { + final List taxForms; + ListTaxFormsData.fromJson(dynamic json): + + taxForms = (json['taxForms'] as List) + .map((e) => ListTaxFormsTaxForms.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTaxFormsData otherTyped = other as ListTaxFormsData; + return taxForms == otherTyped.taxForms; + + } + @override + int get hashCode => taxForms.hashCode; + + + Map toJson() { + Map json = {}; + json['taxForms'] = taxForms.map((e) => e.toJson()).toList(); + return json; + } + + ListTaxFormsData({ + required this.taxForms, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_hubs.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_hubs.dart new file mode 100644 index 00000000..4c6a91c1 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_hubs.dart @@ -0,0 +1,164 @@ +part of 'generated.dart'; + +class ListTeamHubsVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListTeamHubsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListTeamHubsData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listTeamHubs", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListTeamHubsTeamHubs { + final String id; + final String teamId; + final String hubName; + final String address; + final String? city; + final String? state; + final String? zipCode; + final String? managerName; + final bool isActive; + final AnyValue? departments; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + ListTeamHubsTeamHubs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + teamId = nativeFromJson(json['teamId']), + hubName = nativeFromJson(json['hubName']), + address = nativeFromJson(json['address']), + city = json['city'] == null ? null : nativeFromJson(json['city']), + state = json['state'] == null ? null : nativeFromJson(json['state']), + zipCode = json['zipCode'] == null ? null : nativeFromJson(json['zipCode']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + isActive = nativeFromJson(json['isActive']), + departments = json['departments'] == null ? null : AnyValue.fromJson(json['departments']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamHubsTeamHubs otherTyped = other as ListTeamHubsTeamHubs; + return id == otherTyped.id && + teamId == otherTyped.teamId && + hubName == otherTyped.hubName && + address == otherTyped.address && + city == otherTyped.city && + state == otherTyped.state && + zipCode == otherTyped.zipCode && + managerName == otherTyped.managerName && + isActive == otherTyped.isActive && + departments == otherTyped.departments && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, teamId.hashCode, hubName.hashCode, address.hashCode, city.hashCode, state.hashCode, zipCode.hashCode, managerName.hashCode, isActive.hashCode, departments.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['teamId'] = nativeToJson(teamId); + json['hubName'] = nativeToJson(hubName); + json['address'] = nativeToJson(address); + if (city != null) { + json['city'] = nativeToJson(city); + } + if (state != null) { + json['state'] = nativeToJson(state); + } + if (zipCode != null) { + json['zipCode'] = nativeToJson(zipCode); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + json['isActive'] = nativeToJson(isActive); + if (departments != null) { + json['departments'] = departments!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + ListTeamHubsTeamHubs({ + required this.id, + required this.teamId, + required this.hubName, + required this.address, + this.city, + this.state, + this.zipCode, + this.managerName, + required this.isActive, + this.departments, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class ListTeamHubsData { + final List teamHubs; + ListTeamHubsData.fromJson(dynamic json): + + teamHubs = (json['teamHubs'] as List) + .map((e) => ListTeamHubsTeamHubs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamHubsData otherTyped = other as ListTeamHubsData; + return teamHubs == otherTyped.teamHubs; + + } + @override + int get hashCode => teamHubs.hashCode; + + + Map toJson() { + Map json = {}; + json['teamHubs'] = teamHubs.map((e) => e.toJson()).toList(); + return json; + } + + ListTeamHubsData({ + required this.teamHubs, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_hubs_by_owner_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_hubs_by_owner_id.dart new file mode 100644 index 00000000..23c9d218 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_hubs_by_owner_id.dart @@ -0,0 +1,186 @@ +part of 'generated.dart'; + +class ListTeamHubsByOwnerIdVariablesBuilder { + String ownerId; + + final FirebaseDataConnect _dataConnect; + ListTeamHubsByOwnerIdVariablesBuilder(this._dataConnect, {required this.ownerId,}); + Deserializer dataDeserializer = (dynamic json) => ListTeamHubsByOwnerIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListTeamHubsByOwnerIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListTeamHubsByOwnerIdVariables vars= ListTeamHubsByOwnerIdVariables(ownerId: ownerId,); + return _dataConnect.query("listTeamHubsByOwnerId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListTeamHubsByOwnerIdTeamHubs { + final String id; + final String teamId; + final String hubName; + final String address; + final String? city; + final String? state; + final String? zipCode; + final String? managerName; + final bool isActive; + final AnyValue? departments; + final Timestamp? createdAt; + ListTeamHubsByOwnerIdTeamHubs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + teamId = nativeFromJson(json['teamId']), + hubName = nativeFromJson(json['hubName']), + address = nativeFromJson(json['address']), + city = json['city'] == null ? null : nativeFromJson(json['city']), + state = json['state'] == null ? null : nativeFromJson(json['state']), + zipCode = json['zipCode'] == null ? null : nativeFromJson(json['zipCode']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + isActive = nativeFromJson(json['isActive']), + departments = json['departments'] == null ? null : AnyValue.fromJson(json['departments']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamHubsByOwnerIdTeamHubs otherTyped = other as ListTeamHubsByOwnerIdTeamHubs; + return id == otherTyped.id && + teamId == otherTyped.teamId && + hubName == otherTyped.hubName && + address == otherTyped.address && + city == otherTyped.city && + state == otherTyped.state && + zipCode == otherTyped.zipCode && + managerName == otherTyped.managerName && + isActive == otherTyped.isActive && + departments == otherTyped.departments && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, teamId.hashCode, hubName.hashCode, address.hashCode, city.hashCode, state.hashCode, zipCode.hashCode, managerName.hashCode, isActive.hashCode, departments.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['teamId'] = nativeToJson(teamId); + json['hubName'] = nativeToJson(hubName); + json['address'] = nativeToJson(address); + if (city != null) { + json['city'] = nativeToJson(city); + } + if (state != null) { + json['state'] = nativeToJson(state); + } + if (zipCode != null) { + json['zipCode'] = nativeToJson(zipCode); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + json['isActive'] = nativeToJson(isActive); + if (departments != null) { + json['departments'] = departments!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + ListTeamHubsByOwnerIdTeamHubs({ + required this.id, + required this.teamId, + required this.hubName, + required this.address, + this.city, + this.state, + this.zipCode, + this.managerName, + required this.isActive, + this.departments, + this.createdAt, + }); +} + +@immutable +class ListTeamHubsByOwnerIdData { + final List teamHubs; + ListTeamHubsByOwnerIdData.fromJson(dynamic json): + + teamHubs = (json['teamHubs'] as List) + .map((e) => ListTeamHubsByOwnerIdTeamHubs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamHubsByOwnerIdData otherTyped = other as ListTeamHubsByOwnerIdData; + return teamHubs == otherTyped.teamHubs; + + } + @override + int get hashCode => teamHubs.hashCode; + + + Map toJson() { + Map json = {}; + json['teamHubs'] = teamHubs.map((e) => e.toJson()).toList(); + return json; + } + + ListTeamHubsByOwnerIdData({ + required this.teamHubs, + }); +} + +@immutable +class ListTeamHubsByOwnerIdVariables { + final String ownerId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListTeamHubsByOwnerIdVariables.fromJson(Map json): + + ownerId = nativeFromJson(json['ownerId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamHubsByOwnerIdVariables otherTyped = other as ListTeamHubsByOwnerIdVariables; + return ownerId == otherTyped.ownerId; + + } + @override + int get hashCode => ownerId.hashCode; + + + Map toJson() { + Map json = {}; + json['ownerId'] = nativeToJson(ownerId); + return json; + } + + ListTeamHubsByOwnerIdVariables({ + required this.ownerId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_hud_departments.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_hud_departments.dart new file mode 100644 index 00000000..66f6cd2b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_hud_departments.dart @@ -0,0 +1,218 @@ +part of 'generated.dart'; + +class ListTeamHudDepartmentsVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListTeamHudDepartmentsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListTeamHudDepartmentsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListTeamHudDepartmentsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListTeamHudDepartmentsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListTeamHudDepartmentsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListTeamHudDepartmentsVariables vars= ListTeamHudDepartmentsVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listTeamHudDepartments", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListTeamHudDepartmentsTeamHudDepartments { + final String id; + final String name; + final String? costCenter; + final String teamHubId; + final ListTeamHudDepartmentsTeamHudDepartmentsTeamHub teamHub; + final Timestamp? createdAt; + ListTeamHudDepartmentsTeamHudDepartments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costCenter = json['costCenter'] == null ? null : nativeFromJson(json['costCenter']), + teamHubId = nativeFromJson(json['teamHubId']), + teamHub = ListTeamHudDepartmentsTeamHudDepartmentsTeamHub.fromJson(json['teamHub']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamHudDepartmentsTeamHudDepartments otherTyped = other as ListTeamHudDepartmentsTeamHudDepartments; + return id == otherTyped.id && + name == otherTyped.name && + costCenter == otherTyped.costCenter && + teamHubId == otherTyped.teamHubId && + teamHub == otherTyped.teamHub && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costCenter.hashCode, teamHubId.hashCode, teamHub.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + if (costCenter != null) { + json['costCenter'] = nativeToJson(costCenter); + } + json['teamHubId'] = nativeToJson(teamHubId); + json['teamHub'] = teamHub.toJson(); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + ListTeamHudDepartmentsTeamHudDepartments({ + required this.id, + required this.name, + this.costCenter, + required this.teamHubId, + required this.teamHub, + this.createdAt, + }); +} + +@immutable +class ListTeamHudDepartmentsTeamHudDepartmentsTeamHub { + final String id; + final String hubName; + ListTeamHudDepartmentsTeamHudDepartmentsTeamHub.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + hubName = nativeFromJson(json['hubName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamHudDepartmentsTeamHudDepartmentsTeamHub otherTyped = other as ListTeamHudDepartmentsTeamHudDepartmentsTeamHub; + return id == otherTyped.id && + hubName == otherTyped.hubName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, hubName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['hubName'] = nativeToJson(hubName); + return json; + } + + ListTeamHudDepartmentsTeamHudDepartmentsTeamHub({ + required this.id, + required this.hubName, + }); +} + +@immutable +class ListTeamHudDepartmentsData { + final List teamHudDepartments; + ListTeamHudDepartmentsData.fromJson(dynamic json): + + teamHudDepartments = (json['teamHudDepartments'] as List) + .map((e) => ListTeamHudDepartmentsTeamHudDepartments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamHudDepartmentsData otherTyped = other as ListTeamHudDepartmentsData; + return teamHudDepartments == otherTyped.teamHudDepartments; + + } + @override + int get hashCode => teamHudDepartments.hashCode; + + + Map toJson() { + Map json = {}; + json['teamHudDepartments'] = teamHudDepartments.map((e) => e.toJson()).toList(); + return json; + } + + ListTeamHudDepartmentsData({ + required this.teamHudDepartments, + }); +} + +@immutable +class ListTeamHudDepartmentsVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListTeamHudDepartmentsVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamHudDepartmentsVariables otherTyped = other as ListTeamHudDepartmentsVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListTeamHudDepartmentsVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_hud_departments_by_team_hub_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_hud_departments_by_team_hub_id.dart new file mode 100644 index 00000000..e9c26d44 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_hud_departments_by_team_hub_id.dart @@ -0,0 +1,225 @@ +part of 'generated.dart'; + +class ListTeamHudDepartmentsByTeamHubIdVariablesBuilder { + String teamHubId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListTeamHudDepartmentsByTeamHubIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListTeamHudDepartmentsByTeamHubIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListTeamHudDepartmentsByTeamHubIdVariablesBuilder(this._dataConnect, {required this.teamHubId,}); + Deserializer dataDeserializer = (dynamic json) => ListTeamHudDepartmentsByTeamHubIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListTeamHudDepartmentsByTeamHubIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListTeamHudDepartmentsByTeamHubIdVariables vars= ListTeamHudDepartmentsByTeamHubIdVariables(teamHubId: teamHubId,offset: _offset,limit: _limit,); + return _dataConnect.query("listTeamHudDepartmentsByTeamHubId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListTeamHudDepartmentsByTeamHubIdTeamHudDepartments { + final String id; + final String name; + final String? costCenter; + final String teamHubId; + final ListTeamHudDepartmentsByTeamHubIdTeamHudDepartmentsTeamHub teamHub; + final Timestamp? createdAt; + ListTeamHudDepartmentsByTeamHubIdTeamHudDepartments.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + costCenter = json['costCenter'] == null ? null : nativeFromJson(json['costCenter']), + teamHubId = nativeFromJson(json['teamHubId']), + teamHub = ListTeamHudDepartmentsByTeamHubIdTeamHudDepartmentsTeamHub.fromJson(json['teamHub']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamHudDepartmentsByTeamHubIdTeamHudDepartments otherTyped = other as ListTeamHudDepartmentsByTeamHubIdTeamHudDepartments; + return id == otherTyped.id && + name == otherTyped.name && + costCenter == otherTyped.costCenter && + teamHubId == otherTyped.teamHubId && + teamHub == otherTyped.teamHub && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costCenter.hashCode, teamHubId.hashCode, teamHub.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + if (costCenter != null) { + json['costCenter'] = nativeToJson(costCenter); + } + json['teamHubId'] = nativeToJson(teamHubId); + json['teamHub'] = teamHub.toJson(); + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + ListTeamHudDepartmentsByTeamHubIdTeamHudDepartments({ + required this.id, + required this.name, + this.costCenter, + required this.teamHubId, + required this.teamHub, + this.createdAt, + }); +} + +@immutable +class ListTeamHudDepartmentsByTeamHubIdTeamHudDepartmentsTeamHub { + final String id; + final String hubName; + ListTeamHudDepartmentsByTeamHubIdTeamHudDepartmentsTeamHub.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + hubName = nativeFromJson(json['hubName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamHudDepartmentsByTeamHubIdTeamHudDepartmentsTeamHub otherTyped = other as ListTeamHudDepartmentsByTeamHubIdTeamHudDepartmentsTeamHub; + return id == otherTyped.id && + hubName == otherTyped.hubName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, hubName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['hubName'] = nativeToJson(hubName); + return json; + } + + ListTeamHudDepartmentsByTeamHubIdTeamHudDepartmentsTeamHub({ + required this.id, + required this.hubName, + }); +} + +@immutable +class ListTeamHudDepartmentsByTeamHubIdData { + final List teamHudDepartments; + ListTeamHudDepartmentsByTeamHubIdData.fromJson(dynamic json): + + teamHudDepartments = (json['teamHudDepartments'] as List) + .map((e) => ListTeamHudDepartmentsByTeamHubIdTeamHudDepartments.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamHudDepartmentsByTeamHubIdData otherTyped = other as ListTeamHudDepartmentsByTeamHubIdData; + return teamHudDepartments == otherTyped.teamHudDepartments; + + } + @override + int get hashCode => teamHudDepartments.hashCode; + + + Map toJson() { + Map json = {}; + json['teamHudDepartments'] = teamHudDepartments.map((e) => e.toJson()).toList(); + return json; + } + + ListTeamHudDepartmentsByTeamHubIdData({ + required this.teamHudDepartments, + }); +} + +@immutable +class ListTeamHudDepartmentsByTeamHubIdVariables { + final String teamHubId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListTeamHudDepartmentsByTeamHubIdVariables.fromJson(Map json): + + teamHubId = nativeFromJson(json['teamHubId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamHudDepartmentsByTeamHubIdVariables otherTyped = other as ListTeamHudDepartmentsByTeamHubIdVariables; + return teamHubId == otherTyped.teamHubId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([teamHubId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['teamHubId'] = nativeToJson(teamHubId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListTeamHudDepartmentsByTeamHubIdVariables({ + required this.teamHubId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_members.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_members.dart new file mode 100644 index 00000000..f07ca60d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_team_members.dart @@ -0,0 +1,224 @@ +part of 'generated.dart'; + +class ListTeamMembersVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListTeamMembersVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListTeamMembersData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listTeamMembers", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListTeamMembersTeamMembers { + final String id; + final String teamId; + final EnumValue role; + final String? title; + final String? department; + final String? teamHubId; + final bool? isActive; + final Timestamp? createdAt; + final ListTeamMembersTeamMembersUser user; + final ListTeamMembersTeamMembersTeamHub? teamHub; + ListTeamMembersTeamMembers.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + teamId = nativeFromJson(json['teamId']), + role = teamMemberRoleDeserializer(json['role']), + title = json['title'] == null ? null : nativeFromJson(json['title']), + department = json['department'] == null ? null : nativeFromJson(json['department']), + teamHubId = json['teamHubId'] == null ? null : nativeFromJson(json['teamHubId']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + user = ListTeamMembersTeamMembersUser.fromJson(json['user']), + teamHub = json['teamHub'] == null ? null : ListTeamMembersTeamMembersTeamHub.fromJson(json['teamHub']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamMembersTeamMembers otherTyped = other as ListTeamMembersTeamMembers; + return id == otherTyped.id && + teamId == otherTyped.teamId && + role == otherTyped.role && + title == otherTyped.title && + department == otherTyped.department && + teamHubId == otherTyped.teamHubId && + isActive == otherTyped.isActive && + createdAt == otherTyped.createdAt && + user == otherTyped.user && + teamHub == otherTyped.teamHub; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, teamId.hashCode, role.hashCode, title.hashCode, department.hashCode, teamHubId.hashCode, isActive.hashCode, createdAt.hashCode, user.hashCode, teamHub.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['teamId'] = nativeToJson(teamId); + json['role'] = + teamMemberRoleSerializer(role) + ; + if (title != null) { + json['title'] = nativeToJson(title); + } + if (department != null) { + json['department'] = nativeToJson(department); + } + if (teamHubId != null) { + json['teamHubId'] = nativeToJson(teamHubId); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['user'] = user.toJson(); + if (teamHub != null) { + json['teamHub'] = teamHub!.toJson(); + } + return json; + } + + ListTeamMembersTeamMembers({ + required this.id, + required this.teamId, + required this.role, + this.title, + this.department, + this.teamHubId, + this.isActive, + this.createdAt, + required this.user, + this.teamHub, + }); +} + +@immutable +class ListTeamMembersTeamMembersUser { + final String? fullName; + final String? email; + ListTeamMembersTeamMembersUser.fromJson(dynamic json): + + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + email = json['email'] == null ? null : nativeFromJson(json['email']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamMembersTeamMembersUser otherTyped = other as ListTeamMembersTeamMembersUser; + return fullName == otherTyped.fullName && + email == otherTyped.email; + + } + @override + int get hashCode => Object.hashAll([fullName.hashCode, email.hashCode]); + + + Map toJson() { + Map json = {}; + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + if (email != null) { + json['email'] = nativeToJson(email); + } + return json; + } + + ListTeamMembersTeamMembersUser({ + this.fullName, + this.email, + }); +} + +@immutable +class ListTeamMembersTeamMembersTeamHub { + final String hubName; + ListTeamMembersTeamMembersTeamHub.fromJson(dynamic json): + + hubName = nativeFromJson(json['hubName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamMembersTeamMembersTeamHub otherTyped = other as ListTeamMembersTeamMembersTeamHub; + return hubName == otherTyped.hubName; + + } + @override + int get hashCode => hubName.hashCode; + + + Map toJson() { + Map json = {}; + json['hubName'] = nativeToJson(hubName); + return json; + } + + ListTeamMembersTeamMembersTeamHub({ + required this.hubName, + }); +} + +@immutable +class ListTeamMembersData { + final List teamMembers; + ListTeamMembersData.fromJson(dynamic json): + + teamMembers = (json['teamMembers'] as List) + .map((e) => ListTeamMembersTeamMembers.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamMembersData otherTyped = other as ListTeamMembersData; + return teamMembers == otherTyped.teamMembers; + + } + @override + int get hashCode => teamMembers.hashCode; + + + Map toJson() { + Map json = {}; + json['teamMembers'] = teamMembers.map((e) => e.toJson()).toList(); + return json; + } + + ListTeamMembersData({ + required this.teamMembers, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_teams.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_teams.dart new file mode 100644 index 00000000..e13a121d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_teams.dart @@ -0,0 +1,199 @@ +part of 'generated.dart'; + +class ListTeamsVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListTeamsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListTeamsData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listTeams", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListTeamsTeams { + final String id; + final String teamName; + final String ownerId; + final String ownerName; + final String ownerRole; + final String? email; + final String? companyLogo; + final int? totalMembers; + final int? activeMembers; + final int? totalHubs; + final AnyValue? departments; + final int? favoriteStaffCount; + final int? blockedStaffCount; + final AnyValue? favoriteStaff; + final AnyValue? blockedStaff; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + ListTeamsTeams.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + teamName = nativeFromJson(json['teamName']), + ownerId = nativeFromJson(json['ownerId']), + ownerName = nativeFromJson(json['ownerName']), + ownerRole = nativeFromJson(json['ownerRole']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + companyLogo = json['companyLogo'] == null ? null : nativeFromJson(json['companyLogo']), + totalMembers = json['totalMembers'] == null ? null : nativeFromJson(json['totalMembers']), + activeMembers = json['activeMembers'] == null ? null : nativeFromJson(json['activeMembers']), + totalHubs = json['totalHubs'] == null ? null : nativeFromJson(json['totalHubs']), + departments = json['departments'] == null ? null : AnyValue.fromJson(json['departments']), + favoriteStaffCount = json['favoriteStaffCount'] == null ? null : nativeFromJson(json['favoriteStaffCount']), + blockedStaffCount = json['blockedStaffCount'] == null ? null : nativeFromJson(json['blockedStaffCount']), + favoriteStaff = json['favoriteStaff'] == null ? null : AnyValue.fromJson(json['favoriteStaff']), + blockedStaff = json['blockedStaff'] == null ? null : AnyValue.fromJson(json['blockedStaff']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamsTeams otherTyped = other as ListTeamsTeams; + return id == otherTyped.id && + teamName == otherTyped.teamName && + ownerId == otherTyped.ownerId && + ownerName == otherTyped.ownerName && + ownerRole == otherTyped.ownerRole && + email == otherTyped.email && + companyLogo == otherTyped.companyLogo && + totalMembers == otherTyped.totalMembers && + activeMembers == otherTyped.activeMembers && + totalHubs == otherTyped.totalHubs && + departments == otherTyped.departments && + favoriteStaffCount == otherTyped.favoriteStaffCount && + blockedStaffCount == otherTyped.blockedStaffCount && + favoriteStaff == otherTyped.favoriteStaff && + blockedStaff == otherTyped.blockedStaff && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, teamName.hashCode, ownerId.hashCode, ownerName.hashCode, ownerRole.hashCode, email.hashCode, companyLogo.hashCode, totalMembers.hashCode, activeMembers.hashCode, totalHubs.hashCode, departments.hashCode, favoriteStaffCount.hashCode, blockedStaffCount.hashCode, favoriteStaff.hashCode, blockedStaff.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['teamName'] = nativeToJson(teamName); + json['ownerId'] = nativeToJson(ownerId); + json['ownerName'] = nativeToJson(ownerName); + json['ownerRole'] = nativeToJson(ownerRole); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (companyLogo != null) { + json['companyLogo'] = nativeToJson(companyLogo); + } + if (totalMembers != null) { + json['totalMembers'] = nativeToJson(totalMembers); + } + if (activeMembers != null) { + json['activeMembers'] = nativeToJson(activeMembers); + } + if (totalHubs != null) { + json['totalHubs'] = nativeToJson(totalHubs); + } + if (departments != null) { + json['departments'] = departments!.toJson(); + } + if (favoriteStaffCount != null) { + json['favoriteStaffCount'] = nativeToJson(favoriteStaffCount); + } + if (blockedStaffCount != null) { + json['blockedStaffCount'] = nativeToJson(blockedStaffCount); + } + if (favoriteStaff != null) { + json['favoriteStaff'] = favoriteStaff!.toJson(); + } + if (blockedStaff != null) { + json['blockedStaff'] = blockedStaff!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + ListTeamsTeams({ + required this.id, + required this.teamName, + required this.ownerId, + required this.ownerName, + required this.ownerRole, + this.email, + this.companyLogo, + this.totalMembers, + this.activeMembers, + this.totalHubs, + this.departments, + this.favoriteStaffCount, + this.blockedStaffCount, + this.favoriteStaff, + this.blockedStaff, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class ListTeamsData { + final List teams; + ListTeamsData.fromJson(dynamic json): + + teams = (json['teams'] as List) + .map((e) => ListTeamsTeams.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTeamsData otherTyped = other as ListTeamsData; + return teams == otherTyped.teams; + + } + @override + int get hashCode => teams.hashCode; + + + Map toJson() { + Map json = {}; + json['teams'] = teams.map((e) => e.toJson()).toList(); + return json; + } + + ListTeamsData({ + required this.teams, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_timesheets_for_spend.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_timesheets_for_spend.dart new file mode 100644 index 00000000..fd390c76 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_timesheets_for_spend.dart @@ -0,0 +1,318 @@ +part of 'generated.dart'; + +class ListTimesheetsForSpendVariablesBuilder { + Timestamp startTime; + Timestamp endTime; + + final FirebaseDataConnect _dataConnect; + ListTimesheetsForSpendVariablesBuilder(this._dataConnect, {required this.startTime,required this.endTime,}); + Deserializer dataDeserializer = (dynamic json) => ListTimesheetsForSpendData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListTimesheetsForSpendVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListTimesheetsForSpendVariables vars= ListTimesheetsForSpendVariables(startTime: startTime,endTime: endTime,); + return _dataConnect.query("listTimesheetsForSpend", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListTimesheetsForSpendShiftRoles { + final String id; + final double? hours; + final double? totalValue; + final ListTimesheetsForSpendShiftRolesShift shift; + final ListTimesheetsForSpendShiftRolesRole role; + ListTimesheetsForSpendShiftRoles.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + hours = json['hours'] == null ? null : nativeFromJson(json['hours']), + totalValue = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']), + shift = ListTimesheetsForSpendShiftRolesShift.fromJson(json['shift']), + role = ListTimesheetsForSpendShiftRolesRole.fromJson(json['role']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTimesheetsForSpendShiftRoles otherTyped = other as ListTimesheetsForSpendShiftRoles; + return id == otherTyped.id && + hours == otherTyped.hours && + totalValue == otherTyped.totalValue && + shift == otherTyped.shift && + role == otherTyped.role; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, hours.hashCode, totalValue.hashCode, shift.hashCode, role.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (hours != null) { + json['hours'] = nativeToJson(hours); + } + if (totalValue != null) { + json['totalValue'] = nativeToJson(totalValue); + } + json['shift'] = shift.toJson(); + json['role'] = role.toJson(); + return json; + } + + ListTimesheetsForSpendShiftRoles({ + required this.id, + this.hours, + this.totalValue, + required this.shift, + required this.role, + }); +} + +@immutable +class ListTimesheetsForSpendShiftRolesShift { + final String title; + final String? location; + final EnumValue? status; + final Timestamp? date; + final ListTimesheetsForSpendShiftRolesShiftOrder order; + ListTimesheetsForSpendShiftRolesShift.fromJson(dynamic json): + + title = nativeFromJson(json['title']), + location = json['location'] == null ? null : nativeFromJson(json['location']), + status = json['status'] == null ? null : shiftStatusDeserializer(json['status']), + date = json['date'] == null ? null : Timestamp.fromJson(json['date']), + order = ListTimesheetsForSpendShiftRolesShiftOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTimesheetsForSpendShiftRolesShift otherTyped = other as ListTimesheetsForSpendShiftRolesShift; + return title == otherTyped.title && + location == otherTyped.location && + status == otherTyped.status && + date == otherTyped.date && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([title.hashCode, location.hashCode, status.hashCode, date.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['title'] = nativeToJson(title); + if (location != null) { + json['location'] = nativeToJson(location); + } + if (status != null) { + json['status'] = + shiftStatusSerializer(status!) + ; + } + if (date != null) { + json['date'] = date!.toJson(); + } + json['order'] = order.toJson(); + return json; + } + + ListTimesheetsForSpendShiftRolesShift({ + required this.title, + this.location, + this.status, + this.date, + required this.order, + }); +} + +@immutable +class ListTimesheetsForSpendShiftRolesShiftOrder { + final ListTimesheetsForSpendShiftRolesShiftOrderBusiness business; + ListTimesheetsForSpendShiftRolesShiftOrder.fromJson(dynamic json): + + business = ListTimesheetsForSpendShiftRolesShiftOrderBusiness.fromJson(json['business']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTimesheetsForSpendShiftRolesShiftOrder otherTyped = other as ListTimesheetsForSpendShiftRolesShiftOrder; + return business == otherTyped.business; + + } + @override + int get hashCode => business.hashCode; + + + Map toJson() { + Map json = {}; + json['business'] = business.toJson(); + return json; + } + + ListTimesheetsForSpendShiftRolesShiftOrder({ + required this.business, + }); +} + +@immutable +class ListTimesheetsForSpendShiftRolesShiftOrderBusiness { + final String businessName; + ListTimesheetsForSpendShiftRolesShiftOrderBusiness.fromJson(dynamic json): + + businessName = nativeFromJson(json['businessName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTimesheetsForSpendShiftRolesShiftOrderBusiness otherTyped = other as ListTimesheetsForSpendShiftRolesShiftOrderBusiness; + return businessName == otherTyped.businessName; + + } + @override + int get hashCode => businessName.hashCode; + + + Map toJson() { + Map json = {}; + json['businessName'] = nativeToJson(businessName); + return json; + } + + ListTimesheetsForSpendShiftRolesShiftOrderBusiness({ + required this.businessName, + }); +} + +@immutable +class ListTimesheetsForSpendShiftRolesRole { + final double costPerHour; + ListTimesheetsForSpendShiftRolesRole.fromJson(dynamic json): + + costPerHour = nativeFromJson(json['costPerHour']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTimesheetsForSpendShiftRolesRole otherTyped = other as ListTimesheetsForSpendShiftRolesRole; + return costPerHour == otherTyped.costPerHour; + + } + @override + int get hashCode => costPerHour.hashCode; + + + Map toJson() { + Map json = {}; + json['costPerHour'] = nativeToJson(costPerHour); + return json; + } + + ListTimesheetsForSpendShiftRolesRole({ + required this.costPerHour, + }); +} + +@immutable +class ListTimesheetsForSpendData { + final List shiftRoles; + ListTimesheetsForSpendData.fromJson(dynamic json): + + shiftRoles = (json['shiftRoles'] as List) + .map((e) => ListTimesheetsForSpendShiftRoles.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTimesheetsForSpendData otherTyped = other as ListTimesheetsForSpendData; + return shiftRoles == otherTyped.shiftRoles; + + } + @override + int get hashCode => shiftRoles.hashCode; + + + Map toJson() { + Map json = {}; + json['shiftRoles'] = shiftRoles.map((e) => e.toJson()).toList(); + return json; + } + + ListTimesheetsForSpendData({ + required this.shiftRoles, + }); +} + +@immutable +class ListTimesheetsForSpendVariables { + final Timestamp startTime; + final Timestamp endTime; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListTimesheetsForSpendVariables.fromJson(Map json): + + startTime = Timestamp.fromJson(json['startTime']), + endTime = Timestamp.fromJson(json['endTime']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListTimesheetsForSpendVariables otherTyped = other as ListTimesheetsForSpendVariables; + return startTime == otherTyped.startTime && + endTime == otherTyped.endTime; + + } + @override + int get hashCode => Object.hashAll([startTime.hashCode, endTime.hashCode]); + + + Map toJson() { + Map json = {}; + json['startTime'] = startTime.toJson(); + json['endTime'] = endTime.toJson(); + return json; + } + + ListTimesheetsForSpendVariables({ + required this.startTime, + required this.endTime, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_unread_activity_logs_by_user_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_unread_activity_logs_by_user_id.dart new file mode 100644 index 00000000..2b2dc06e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_unread_activity_logs_by_user_id.dart @@ -0,0 +1,249 @@ +part of 'generated.dart'; + +class ListUnreadActivityLogsByUserIdVariablesBuilder { + String userId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListUnreadActivityLogsByUserIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListUnreadActivityLogsByUserIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListUnreadActivityLogsByUserIdVariablesBuilder(this._dataConnect, {required this.userId,}); + Deserializer dataDeserializer = (dynamic json) => ListUnreadActivityLogsByUserIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListUnreadActivityLogsByUserIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListUnreadActivityLogsByUserIdVariables vars= ListUnreadActivityLogsByUserIdVariables(userId: userId,offset: _offset,limit: _limit,); + return _dataConnect.query("listUnreadActivityLogsByUserId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListUnreadActivityLogsByUserIdActivityLogs { + final String id; + final String userId; + final Timestamp date; + final String? hourStart; + final String? hourEnd; + final String? totalhours; + final EnumValue? iconType; + final String? iconColor; + final String title; + final String description; + final bool? isRead; + final EnumValue activityType; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + ListUnreadActivityLogsByUserIdActivityLogs.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + userId = nativeFromJson(json['userId']), + date = Timestamp.fromJson(json['date']), + hourStart = json['hourStart'] == null ? null : nativeFromJson(json['hourStart']), + hourEnd = json['hourEnd'] == null ? null : nativeFromJson(json['hourEnd']), + totalhours = json['totalhours'] == null ? null : nativeFromJson(json['totalhours']), + iconType = json['iconType'] == null ? null : activityIconTypeDeserializer(json['iconType']), + iconColor = json['iconColor'] == null ? null : nativeFromJson(json['iconColor']), + title = nativeFromJson(json['title']), + description = nativeFromJson(json['description']), + isRead = json['isRead'] == null ? null : nativeFromJson(json['isRead']), + activityType = activityTypeDeserializer(json['activityType']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUnreadActivityLogsByUserIdActivityLogs otherTyped = other as ListUnreadActivityLogsByUserIdActivityLogs; + return id == otherTyped.id && + userId == otherTyped.userId && + date == otherTyped.date && + hourStart == otherTyped.hourStart && + hourEnd == otherTyped.hourEnd && + totalhours == otherTyped.totalhours && + iconType == otherTyped.iconType && + iconColor == otherTyped.iconColor && + title == otherTyped.title && + description == otherTyped.description && + isRead == otherTyped.isRead && + activityType == otherTyped.activityType && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, date.hashCode, hourStart.hashCode, hourEnd.hashCode, totalhours.hashCode, iconType.hashCode, iconColor.hashCode, title.hashCode, description.hashCode, isRead.hashCode, activityType.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['userId'] = nativeToJson(userId); + json['date'] = date.toJson(); + if (hourStart != null) { + json['hourStart'] = nativeToJson(hourStart); + } + if (hourEnd != null) { + json['hourEnd'] = nativeToJson(hourEnd); + } + if (totalhours != null) { + json['totalhours'] = nativeToJson(totalhours); + } + if (iconType != null) { + json['iconType'] = + activityIconTypeSerializer(iconType!) + ; + } + if (iconColor != null) { + json['iconColor'] = nativeToJson(iconColor); + } + json['title'] = nativeToJson(title); + json['description'] = nativeToJson(description); + if (isRead != null) { + json['isRead'] = nativeToJson(isRead); + } + json['activityType'] = + activityTypeSerializer(activityType) + ; + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + ListUnreadActivityLogsByUserIdActivityLogs({ + required this.id, + required this.userId, + required this.date, + this.hourStart, + this.hourEnd, + this.totalhours, + this.iconType, + this.iconColor, + required this.title, + required this.description, + this.isRead, + required this.activityType, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class ListUnreadActivityLogsByUserIdData { + final List activityLogs; + ListUnreadActivityLogsByUserIdData.fromJson(dynamic json): + + activityLogs = (json['activityLogs'] as List) + .map((e) => ListUnreadActivityLogsByUserIdActivityLogs.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUnreadActivityLogsByUserIdData otherTyped = other as ListUnreadActivityLogsByUserIdData; + return activityLogs == otherTyped.activityLogs; + + } + @override + int get hashCode => activityLogs.hashCode; + + + Map toJson() { + Map json = {}; + json['activityLogs'] = activityLogs.map((e) => e.toJson()).toList(); + return json; + } + + ListUnreadActivityLogsByUserIdData({ + required this.activityLogs, + }); +} + +@immutable +class ListUnreadActivityLogsByUserIdVariables { + final String userId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListUnreadActivityLogsByUserIdVariables.fromJson(Map json): + + userId = nativeFromJson(json['userId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUnreadActivityLogsByUserIdVariables otherTyped = other as ListUnreadActivityLogsByUserIdVariables; + return userId == otherTyped.userId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([userId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['userId'] = nativeToJson(userId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListUnreadActivityLogsByUserIdVariables({ + required this.userId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_unread_user_conversations_by_user_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_unread_user_conversations_by_user_id.dart new file mode 100644 index 00000000..1b8528a9 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_unread_user_conversations_by_user_id.dart @@ -0,0 +1,280 @@ +part of 'generated.dart'; + +class ListUnreadUserConversationsByUserIdVariablesBuilder { + String userId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListUnreadUserConversationsByUserIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListUnreadUserConversationsByUserIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListUnreadUserConversationsByUserIdVariablesBuilder(this._dataConnect, {required this.userId,}); + Deserializer dataDeserializer = (dynamic json) => ListUnreadUserConversationsByUserIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListUnreadUserConversationsByUserIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListUnreadUserConversationsByUserIdVariables vars= ListUnreadUserConversationsByUserIdVariables(userId: userId,offset: _offset,limit: _limit,); + return _dataConnect.query("listUnreadUserConversationsByUserId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListUnreadUserConversationsByUserIdUserConversations { + final String id; + final String conversationId; + final String userId; + final int? unreadCount; + final Timestamp? lastReadAt; + final Timestamp? createdAt; + final ListUnreadUserConversationsByUserIdUserConversationsConversation conversation; + ListUnreadUserConversationsByUserIdUserConversations.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']), + unreadCount = json['unreadCount'] == null ? null : nativeFromJson(json['unreadCount']), + lastReadAt = json['lastReadAt'] == null ? null : Timestamp.fromJson(json['lastReadAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + conversation = ListUnreadUserConversationsByUserIdUserConversationsConversation.fromJson(json['conversation']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUnreadUserConversationsByUserIdUserConversations otherTyped = other as ListUnreadUserConversationsByUserIdUserConversations; + return id == otherTyped.id && + conversationId == otherTyped.conversationId && + userId == otherTyped.userId && + unreadCount == otherTyped.unreadCount && + lastReadAt == otherTyped.lastReadAt && + createdAt == otherTyped.createdAt && + conversation == otherTyped.conversation; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, conversationId.hashCode, userId.hashCode, unreadCount.hashCode, lastReadAt.hashCode, createdAt.hashCode, conversation.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + if (unreadCount != null) { + json['unreadCount'] = nativeToJson(unreadCount); + } + if (lastReadAt != null) { + json['lastReadAt'] = lastReadAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['conversation'] = conversation.toJson(); + return json; + } + + ListUnreadUserConversationsByUserIdUserConversations({ + required this.id, + required this.conversationId, + required this.userId, + this.unreadCount, + this.lastReadAt, + this.createdAt, + required this.conversation, + }); +} + +@immutable +class ListUnreadUserConversationsByUserIdUserConversationsConversation { + final String id; + final String? subject; + final EnumValue? status; + final EnumValue? conversationType; + final bool? isGroup; + final String? groupName; + final String? lastMessage; + final Timestamp? lastMessageAt; + ListUnreadUserConversationsByUserIdUserConversationsConversation.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + subject = json['subject'] == null ? null : nativeFromJson(json['subject']), + status = json['status'] == null ? null : conversationStatusDeserializer(json['status']), + conversationType = json['conversationType'] == null ? null : conversationTypeDeserializer(json['conversationType']), + isGroup = json['isGroup'] == null ? null : nativeFromJson(json['isGroup']), + groupName = json['groupName'] == null ? null : nativeFromJson(json['groupName']), + lastMessage = json['lastMessage'] == null ? null : nativeFromJson(json['lastMessage']), + lastMessageAt = json['lastMessageAt'] == null ? null : Timestamp.fromJson(json['lastMessageAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUnreadUserConversationsByUserIdUserConversationsConversation otherTyped = other as ListUnreadUserConversationsByUserIdUserConversationsConversation; + return id == otherTyped.id && + subject == otherTyped.subject && + status == otherTyped.status && + conversationType == otherTyped.conversationType && + isGroup == otherTyped.isGroup && + groupName == otherTyped.groupName && + lastMessage == otherTyped.lastMessage && + lastMessageAt == otherTyped.lastMessageAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, subject.hashCode, status.hashCode, conversationType.hashCode, isGroup.hashCode, groupName.hashCode, lastMessage.hashCode, lastMessageAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (subject != null) { + json['subject'] = nativeToJson(subject); + } + if (status != null) { + json['status'] = + conversationStatusSerializer(status!) + ; + } + if (conversationType != null) { + json['conversationType'] = + conversationTypeSerializer(conversationType!) + ; + } + if (isGroup != null) { + json['isGroup'] = nativeToJson(isGroup); + } + if (groupName != null) { + json['groupName'] = nativeToJson(groupName); + } + if (lastMessage != null) { + json['lastMessage'] = nativeToJson(lastMessage); + } + if (lastMessageAt != null) { + json['lastMessageAt'] = lastMessageAt!.toJson(); + } + return json; + } + + ListUnreadUserConversationsByUserIdUserConversationsConversation({ + required this.id, + this.subject, + this.status, + this.conversationType, + this.isGroup, + this.groupName, + this.lastMessage, + this.lastMessageAt, + }); +} + +@immutable +class ListUnreadUserConversationsByUserIdData { + final List userConversations; + ListUnreadUserConversationsByUserIdData.fromJson(dynamic json): + + userConversations = (json['userConversations'] as List) + .map((e) => ListUnreadUserConversationsByUserIdUserConversations.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUnreadUserConversationsByUserIdData otherTyped = other as ListUnreadUserConversationsByUserIdData; + return userConversations == otherTyped.userConversations; + + } + @override + int get hashCode => userConversations.hashCode; + + + Map toJson() { + Map json = {}; + json['userConversations'] = userConversations.map((e) => e.toJson()).toList(); + return json; + } + + ListUnreadUserConversationsByUserIdData({ + required this.userConversations, + }); +} + +@immutable +class ListUnreadUserConversationsByUserIdVariables { + final String userId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListUnreadUserConversationsByUserIdVariables.fromJson(Map json): + + userId = nativeFromJson(json['userId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUnreadUserConversationsByUserIdVariables otherTyped = other as ListUnreadUserConversationsByUserIdVariables; + return userId == otherTyped.userId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([userId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['userId'] = nativeToJson(userId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListUnreadUserConversationsByUserIdVariables({ + required this.userId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_user_conversations.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_user_conversations.dart new file mode 100644 index 00000000..e7aafd8d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_user_conversations.dart @@ -0,0 +1,333 @@ +part of 'generated.dart'; + +class ListUserConversationsVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListUserConversationsVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListUserConversationsVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListUserConversationsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListUserConversationsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListUserConversationsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListUserConversationsVariables vars= ListUserConversationsVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listUserConversations", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListUserConversationsUserConversations { + final String id; + final String conversationId; + final String userId; + final int? unreadCount; + final Timestamp? lastReadAt; + final Timestamp? createdAt; + final ListUserConversationsUserConversationsConversation conversation; + final ListUserConversationsUserConversationsUser user; + ListUserConversationsUserConversations.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']), + unreadCount = json['unreadCount'] == null ? null : nativeFromJson(json['unreadCount']), + lastReadAt = json['lastReadAt'] == null ? null : Timestamp.fromJson(json['lastReadAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + conversation = ListUserConversationsUserConversationsConversation.fromJson(json['conversation']), + user = ListUserConversationsUserConversationsUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUserConversationsUserConversations otherTyped = other as ListUserConversationsUserConversations; + return id == otherTyped.id && + conversationId == otherTyped.conversationId && + userId == otherTyped.userId && + unreadCount == otherTyped.unreadCount && + lastReadAt == otherTyped.lastReadAt && + createdAt == otherTyped.createdAt && + conversation == otherTyped.conversation && + user == otherTyped.user; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, conversationId.hashCode, userId.hashCode, unreadCount.hashCode, lastReadAt.hashCode, createdAt.hashCode, conversation.hashCode, user.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + if (unreadCount != null) { + json['unreadCount'] = nativeToJson(unreadCount); + } + if (lastReadAt != null) { + json['lastReadAt'] = lastReadAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['conversation'] = conversation.toJson(); + json['user'] = user.toJson(); + return json; + } + + ListUserConversationsUserConversations({ + required this.id, + required this.conversationId, + required this.userId, + this.unreadCount, + this.lastReadAt, + this.createdAt, + required this.conversation, + required this.user, + }); +} + +@immutable +class ListUserConversationsUserConversationsConversation { + final String id; + final String? subject; + final EnumValue? status; + final EnumValue? conversationType; + final bool? isGroup; + final String? groupName; + final String? lastMessage; + final Timestamp? lastMessageAt; + final Timestamp? createdAt; + ListUserConversationsUserConversationsConversation.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + subject = json['subject'] == null ? null : nativeFromJson(json['subject']), + status = json['status'] == null ? null : conversationStatusDeserializer(json['status']), + conversationType = json['conversationType'] == null ? null : conversationTypeDeserializer(json['conversationType']), + isGroup = json['isGroup'] == null ? null : nativeFromJson(json['isGroup']), + groupName = json['groupName'] == null ? null : nativeFromJson(json['groupName']), + lastMessage = json['lastMessage'] == null ? null : nativeFromJson(json['lastMessage']), + lastMessageAt = json['lastMessageAt'] == null ? null : Timestamp.fromJson(json['lastMessageAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUserConversationsUserConversationsConversation otherTyped = other as ListUserConversationsUserConversationsConversation; + return id == otherTyped.id && + subject == otherTyped.subject && + status == otherTyped.status && + conversationType == otherTyped.conversationType && + isGroup == otherTyped.isGroup && + groupName == otherTyped.groupName && + lastMessage == otherTyped.lastMessage && + lastMessageAt == otherTyped.lastMessageAt && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, subject.hashCode, status.hashCode, conversationType.hashCode, isGroup.hashCode, groupName.hashCode, lastMessage.hashCode, lastMessageAt.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (subject != null) { + json['subject'] = nativeToJson(subject); + } + if (status != null) { + json['status'] = + conversationStatusSerializer(status!) + ; + } + if (conversationType != null) { + json['conversationType'] = + conversationTypeSerializer(conversationType!) + ; + } + if (isGroup != null) { + json['isGroup'] = nativeToJson(isGroup); + } + if (groupName != null) { + json['groupName'] = nativeToJson(groupName); + } + if (lastMessage != null) { + json['lastMessage'] = nativeToJson(lastMessage); + } + if (lastMessageAt != null) { + json['lastMessageAt'] = lastMessageAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + ListUserConversationsUserConversationsConversation({ + required this.id, + this.subject, + this.status, + this.conversationType, + this.isGroup, + this.groupName, + this.lastMessage, + this.lastMessageAt, + this.createdAt, + }); +} + +@immutable +class ListUserConversationsUserConversationsUser { + final String id; + final String? fullName; + final String? photoUrl; + ListUserConversationsUserConversationsUser.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUserConversationsUserConversationsUser otherTyped = other as ListUserConversationsUserConversationsUser; + return id == otherTyped.id && + fullName == otherTyped.fullName && + photoUrl == otherTyped.photoUrl; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, photoUrl.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + return json; + } + + ListUserConversationsUserConversationsUser({ + required this.id, + this.fullName, + this.photoUrl, + }); +} + +@immutable +class ListUserConversationsData { + final List userConversations; + ListUserConversationsData.fromJson(dynamic json): + + userConversations = (json['userConversations'] as List) + .map((e) => ListUserConversationsUserConversations.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUserConversationsData otherTyped = other as ListUserConversationsData; + return userConversations == otherTyped.userConversations; + + } + @override + int get hashCode => userConversations.hashCode; + + + Map toJson() { + Map json = {}; + json['userConversations'] = userConversations.map((e) => e.toJson()).toList(); + return json; + } + + ListUserConversationsData({ + required this.userConversations, + }); +} + +@immutable +class ListUserConversationsVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListUserConversationsVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUserConversationsVariables otherTyped = other as ListUserConversationsVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListUserConversationsVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_user_conversations_by_conversation_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_user_conversations_by_conversation_id.dart new file mode 100644 index 00000000..67741598 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_user_conversations_by_conversation_id.dart @@ -0,0 +1,241 @@ +part of 'generated.dart'; + +class ListUserConversationsByConversationIdVariablesBuilder { + String conversationId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListUserConversationsByConversationIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListUserConversationsByConversationIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListUserConversationsByConversationIdVariablesBuilder(this._dataConnect, {required this.conversationId,}); + Deserializer dataDeserializer = (dynamic json) => ListUserConversationsByConversationIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListUserConversationsByConversationIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListUserConversationsByConversationIdVariables vars= ListUserConversationsByConversationIdVariables(conversationId: conversationId,offset: _offset,limit: _limit,); + return _dataConnect.query("listUserConversationsByConversationId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListUserConversationsByConversationIdUserConversations { + final String id; + final String conversationId; + final String userId; + final int? unreadCount; + final Timestamp? lastReadAt; + final Timestamp? createdAt; + final ListUserConversationsByConversationIdUserConversationsUser user; + ListUserConversationsByConversationIdUserConversations.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']), + unreadCount = json['unreadCount'] == null ? null : nativeFromJson(json['unreadCount']), + lastReadAt = json['lastReadAt'] == null ? null : Timestamp.fromJson(json['lastReadAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + user = ListUserConversationsByConversationIdUserConversationsUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUserConversationsByConversationIdUserConversations otherTyped = other as ListUserConversationsByConversationIdUserConversations; + return id == otherTyped.id && + conversationId == otherTyped.conversationId && + userId == otherTyped.userId && + unreadCount == otherTyped.unreadCount && + lastReadAt == otherTyped.lastReadAt && + createdAt == otherTyped.createdAt && + user == otherTyped.user; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, conversationId.hashCode, userId.hashCode, unreadCount.hashCode, lastReadAt.hashCode, createdAt.hashCode, user.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + if (unreadCount != null) { + json['unreadCount'] = nativeToJson(unreadCount); + } + if (lastReadAt != null) { + json['lastReadAt'] = lastReadAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['user'] = user.toJson(); + return json; + } + + ListUserConversationsByConversationIdUserConversations({ + required this.id, + required this.conversationId, + required this.userId, + this.unreadCount, + this.lastReadAt, + this.createdAt, + required this.user, + }); +} + +@immutable +class ListUserConversationsByConversationIdUserConversationsUser { + final String id; + final String? fullName; + final String? photoUrl; + ListUserConversationsByConversationIdUserConversationsUser.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUserConversationsByConversationIdUserConversationsUser otherTyped = other as ListUserConversationsByConversationIdUserConversationsUser; + return id == otherTyped.id && + fullName == otherTyped.fullName && + photoUrl == otherTyped.photoUrl; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, photoUrl.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + return json; + } + + ListUserConversationsByConversationIdUserConversationsUser({ + required this.id, + this.fullName, + this.photoUrl, + }); +} + +@immutable +class ListUserConversationsByConversationIdData { + final List userConversations; + ListUserConversationsByConversationIdData.fromJson(dynamic json): + + userConversations = (json['userConversations'] as List) + .map((e) => ListUserConversationsByConversationIdUserConversations.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUserConversationsByConversationIdData otherTyped = other as ListUserConversationsByConversationIdData; + return userConversations == otherTyped.userConversations; + + } + @override + int get hashCode => userConversations.hashCode; + + + Map toJson() { + Map json = {}; + json['userConversations'] = userConversations.map((e) => e.toJson()).toList(); + return json; + } + + ListUserConversationsByConversationIdData({ + required this.userConversations, + }); +} + +@immutable +class ListUserConversationsByConversationIdVariables { + final String conversationId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListUserConversationsByConversationIdVariables.fromJson(Map json): + + conversationId = nativeFromJson(json['conversationId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUserConversationsByConversationIdVariables otherTyped = other as ListUserConversationsByConversationIdVariables; + return conversationId == otherTyped.conversationId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([conversationId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['conversationId'] = nativeToJson(conversationId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListUserConversationsByConversationIdVariables({ + required this.conversationId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_user_conversations_by_user_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_user_conversations_by_user_id.dart new file mode 100644 index 00000000..fee3854e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_user_conversations_by_user_id.dart @@ -0,0 +1,354 @@ +part of 'generated.dart'; + +class ListUserConversationsByUserIdVariablesBuilder { + String userId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListUserConversationsByUserIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListUserConversationsByUserIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListUserConversationsByUserIdVariablesBuilder(this._dataConnect, {required this.userId,}); + Deserializer dataDeserializer = (dynamic json) => ListUserConversationsByUserIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListUserConversationsByUserIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListUserConversationsByUserIdVariables vars= ListUserConversationsByUserIdVariables(userId: userId,offset: _offset,limit: _limit,); + return _dataConnect.query("listUserConversationsByUserId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListUserConversationsByUserIdUserConversations { + final String id; + final String conversationId; + final String userId; + final int? unreadCount; + final Timestamp? lastReadAt; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListUserConversationsByUserIdUserConversationsConversation conversation; + final ListUserConversationsByUserIdUserConversationsUser user; + ListUserConversationsByUserIdUserConversations.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']), + unreadCount = json['unreadCount'] == null ? null : nativeFromJson(json['unreadCount']), + lastReadAt = json['lastReadAt'] == null ? null : Timestamp.fromJson(json['lastReadAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + conversation = ListUserConversationsByUserIdUserConversationsConversation.fromJson(json['conversation']), + user = ListUserConversationsByUserIdUserConversationsUser.fromJson(json['user']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUserConversationsByUserIdUserConversations otherTyped = other as ListUserConversationsByUserIdUserConversations; + return id == otherTyped.id && + conversationId == otherTyped.conversationId && + userId == otherTyped.userId && + unreadCount == otherTyped.unreadCount && + lastReadAt == otherTyped.lastReadAt && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + conversation == otherTyped.conversation && + user == otherTyped.user; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, conversationId.hashCode, userId.hashCode, unreadCount.hashCode, lastReadAt.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, conversation.hashCode, user.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + if (unreadCount != null) { + json['unreadCount'] = nativeToJson(unreadCount); + } + if (lastReadAt != null) { + json['lastReadAt'] = lastReadAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['conversation'] = conversation.toJson(); + json['user'] = user.toJson(); + return json; + } + + ListUserConversationsByUserIdUserConversations({ + required this.id, + required this.conversationId, + required this.userId, + this.unreadCount, + this.lastReadAt, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.conversation, + required this.user, + }); +} + +@immutable +class ListUserConversationsByUserIdUserConversationsConversation { + final String id; + final String? subject; + final EnumValue? status; + final EnumValue? conversationType; + final bool? isGroup; + final String? groupName; + final String? lastMessage; + final Timestamp? lastMessageAt; + final Timestamp? createdAt; + ListUserConversationsByUserIdUserConversationsConversation.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + subject = json['subject'] == null ? null : nativeFromJson(json['subject']), + status = json['status'] == null ? null : conversationStatusDeserializer(json['status']), + conversationType = json['conversationType'] == null ? null : conversationTypeDeserializer(json['conversationType']), + isGroup = json['isGroup'] == null ? null : nativeFromJson(json['isGroup']), + groupName = json['groupName'] == null ? null : nativeFromJson(json['groupName']), + lastMessage = json['lastMessage'] == null ? null : nativeFromJson(json['lastMessage']), + lastMessageAt = json['lastMessageAt'] == null ? null : Timestamp.fromJson(json['lastMessageAt']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUserConversationsByUserIdUserConversationsConversation otherTyped = other as ListUserConversationsByUserIdUserConversationsConversation; + return id == otherTyped.id && + subject == otherTyped.subject && + status == otherTyped.status && + conversationType == otherTyped.conversationType && + isGroup == otherTyped.isGroup && + groupName == otherTyped.groupName && + lastMessage == otherTyped.lastMessage && + lastMessageAt == otherTyped.lastMessageAt && + createdAt == otherTyped.createdAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, subject.hashCode, status.hashCode, conversationType.hashCode, isGroup.hashCode, groupName.hashCode, lastMessage.hashCode, lastMessageAt.hashCode, createdAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (subject != null) { + json['subject'] = nativeToJson(subject); + } + if (status != null) { + json['status'] = + conversationStatusSerializer(status!) + ; + } + if (conversationType != null) { + json['conversationType'] = + conversationTypeSerializer(conversationType!) + ; + } + if (isGroup != null) { + json['isGroup'] = nativeToJson(isGroup); + } + if (groupName != null) { + json['groupName'] = nativeToJson(groupName); + } + if (lastMessage != null) { + json['lastMessage'] = nativeToJson(lastMessage); + } + if (lastMessageAt != null) { + json['lastMessageAt'] = lastMessageAt!.toJson(); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + return json; + } + + ListUserConversationsByUserIdUserConversationsConversation({ + required this.id, + this.subject, + this.status, + this.conversationType, + this.isGroup, + this.groupName, + this.lastMessage, + this.lastMessageAt, + this.createdAt, + }); +} + +@immutable +class ListUserConversationsByUserIdUserConversationsUser { + final String id; + final String? fullName; + final String? photoUrl; + ListUserConversationsByUserIdUserConversationsUser.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUserConversationsByUserIdUserConversationsUser otherTyped = other as ListUserConversationsByUserIdUserConversationsUser; + return id == otherTyped.id && + fullName == otherTyped.fullName && + photoUrl == otherTyped.photoUrl; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode, photoUrl.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + return json; + } + + ListUserConversationsByUserIdUserConversationsUser({ + required this.id, + this.fullName, + this.photoUrl, + }); +} + +@immutable +class ListUserConversationsByUserIdData { + final List userConversations; + ListUserConversationsByUserIdData.fromJson(dynamic json): + + userConversations = (json['userConversations'] as List) + .map((e) => ListUserConversationsByUserIdUserConversations.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUserConversationsByUserIdData otherTyped = other as ListUserConversationsByUserIdData; + return userConversations == otherTyped.userConversations; + + } + @override + int get hashCode => userConversations.hashCode; + + + Map toJson() { + Map json = {}; + json['userConversations'] = userConversations.map((e) => e.toJson()).toList(); + return json; + } + + ListUserConversationsByUserIdData({ + required this.userConversations, + }); +} + +@immutable +class ListUserConversationsByUserIdVariables { + final String userId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListUserConversationsByUserIdVariables.fromJson(Map json): + + userId = nativeFromJson(json['userId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUserConversationsByUserIdVariables otherTyped = other as ListUserConversationsByUserIdVariables; + return userId == otherTyped.userId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([userId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['userId'] = nativeToJson(userId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListUserConversationsByUserIdVariables({ + required this.userId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_users.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_users.dart new file mode 100644 index 00000000..b628142a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_users.dart @@ -0,0 +1,137 @@ +part of 'generated.dart'; + +class ListUsersVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListUsersVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListUsersData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listUsers", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListUsersUsers { + final String id; + final String? email; + final String? fullName; + final EnumValue role; + final String? userRole; + final String? photoUrl; + final Timestamp? createdDate; + final Timestamp? updatedDate; + ListUsersUsers.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + fullName = json['fullName'] == null ? null : nativeFromJson(json['fullName']), + role = userBaseRoleDeserializer(json['role']), + userRole = json['userRole'] == null ? null : nativeFromJson(json['userRole']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']), + createdDate = json['createdDate'] == null ? null : Timestamp.fromJson(json['createdDate']), + updatedDate = json['updatedDate'] == null ? null : Timestamp.fromJson(json['updatedDate']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUsersUsers otherTyped = other as ListUsersUsers; + return id == otherTyped.id && + email == otherTyped.email && + fullName == otherTyped.fullName && + role == otherTyped.role && + userRole == otherTyped.userRole && + photoUrl == otherTyped.photoUrl && + createdDate == otherTyped.createdDate && + updatedDate == otherTyped.updatedDate; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, email.hashCode, fullName.hashCode, role.hashCode, userRole.hashCode, photoUrl.hashCode, createdDate.hashCode, updatedDate.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (fullName != null) { + json['fullName'] = nativeToJson(fullName); + } + json['role'] = + userBaseRoleSerializer(role) + ; + if (userRole != null) { + json['userRole'] = nativeToJson(userRole); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + if (createdDate != null) { + json['createdDate'] = createdDate!.toJson(); + } + if (updatedDate != null) { + json['updatedDate'] = updatedDate!.toJson(); + } + return json; + } + + ListUsersUsers({ + required this.id, + this.email, + this.fullName, + required this.role, + this.userRole, + this.photoUrl, + this.createdDate, + this.updatedDate, + }); +} + +@immutable +class ListUsersData { + final List users; + ListUsersData.fromJson(dynamic json): + + users = (json['users'] as List) + .map((e) => ListUsersUsers.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListUsersData otherTyped = other as ListUsersData; + return users == otherTyped.users; + + } + @override + int get hashCode => users.hashCode; + + + Map toJson() { + Map json = {}; + json['users'] = users.map((e) => e.toJson()).toList(); + return json; + } + + ListUsersData({ + required this.users, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_vendor_benefit_plans.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_vendor_benefit_plans.dart new file mode 100644 index 00000000..2aee6cf6 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_vendor_benefit_plans.dart @@ -0,0 +1,248 @@ +part of 'generated.dart'; + +class ListVendorBenefitPlansVariablesBuilder { + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; + ListVendorBenefitPlansVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListVendorBenefitPlansVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListVendorBenefitPlansVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListVendorBenefitPlansData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListVendorBenefitPlansVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListVendorBenefitPlansVariables vars= ListVendorBenefitPlansVariables(offset: _offset,limit: _limit,); + return _dataConnect.query("listVendorBenefitPlans", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListVendorBenefitPlansVendorBenefitPlans { + final String id; + final String vendorId; + final String title; + final String? description; + final String? requestLabel; + final int? total; + final bool? isActive; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListVendorBenefitPlansVendorBenefitPlansVendor vendor; + ListVendorBenefitPlansVendorBenefitPlans.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + title = nativeFromJson(json['title']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + requestLabel = json['requestLabel'] == null ? null : nativeFromJson(json['requestLabel']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + vendor = ListVendorBenefitPlansVendorBenefitPlansVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListVendorBenefitPlansVendorBenefitPlans otherTyped = other as ListVendorBenefitPlansVendorBenefitPlans; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + title == otherTyped.title && + description == otherTyped.description && + requestLabel == otherTyped.requestLabel && + total == otherTyped.total && + isActive == otherTyped.isActive && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, title.hashCode, description.hashCode, requestLabel.hashCode, total.hashCode, isActive.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + json['title'] = nativeToJson(title); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (requestLabel != null) { + json['requestLabel'] = nativeToJson(requestLabel); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['vendor'] = vendor.toJson(); + return json; + } + + ListVendorBenefitPlansVendorBenefitPlans({ + required this.id, + required this.vendorId, + required this.title, + this.description, + this.requestLabel, + this.total, + this.isActive, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.vendor, + }); +} + +@immutable +class ListVendorBenefitPlansVendorBenefitPlansVendor { + final String companyName; + ListVendorBenefitPlansVendorBenefitPlansVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListVendorBenefitPlansVendorBenefitPlansVendor otherTyped = other as ListVendorBenefitPlansVendorBenefitPlansVendor; + return companyName == otherTyped.companyName; + + } + @override + int get hashCode => companyName.hashCode; + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListVendorBenefitPlansVendorBenefitPlansVendor({ + required this.companyName, + }); +} + +@immutable +class ListVendorBenefitPlansData { + final List vendorBenefitPlans; + ListVendorBenefitPlansData.fromJson(dynamic json): + + vendorBenefitPlans = (json['vendorBenefitPlans'] as List) + .map((e) => ListVendorBenefitPlansVendorBenefitPlans.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListVendorBenefitPlansData otherTyped = other as ListVendorBenefitPlansData; + return vendorBenefitPlans == otherTyped.vendorBenefitPlans; + + } + @override + int get hashCode => vendorBenefitPlans.hashCode; + + + Map toJson() { + Map json = {}; + json['vendorBenefitPlans'] = vendorBenefitPlans.map((e) => e.toJson()).toList(); + return json; + } + + ListVendorBenefitPlansData({ + required this.vendorBenefitPlans, + }); +} + +@immutable +class ListVendorBenefitPlansVariables { + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListVendorBenefitPlansVariables.fromJson(Map json) { + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListVendorBenefitPlansVariables otherTyped = other as ListVendorBenefitPlansVariables; + return offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListVendorBenefitPlansVariables({ + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_vendor_benefit_plans_by_vendor_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_vendor_benefit_plans_by_vendor_id.dart new file mode 100644 index 00000000..47704ee3 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_vendor_benefit_plans_by_vendor_id.dart @@ -0,0 +1,255 @@ +part of 'generated.dart'; + +class ListVendorBenefitPlansByVendorIdVariablesBuilder { + String vendorId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListVendorBenefitPlansByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListVendorBenefitPlansByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListVendorBenefitPlansByVendorIdVariablesBuilder(this._dataConnect, {required this.vendorId,}); + Deserializer dataDeserializer = (dynamic json) => ListVendorBenefitPlansByVendorIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListVendorBenefitPlansByVendorIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListVendorBenefitPlansByVendorIdVariables vars= ListVendorBenefitPlansByVendorIdVariables(vendorId: vendorId,offset: _offset,limit: _limit,); + return _dataConnect.query("listVendorBenefitPlansByVendorId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListVendorBenefitPlansByVendorIdVendorBenefitPlans { + final String id; + final String vendorId; + final String title; + final String? description; + final String? requestLabel; + final int? total; + final bool? isActive; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final ListVendorBenefitPlansByVendorIdVendorBenefitPlansVendor vendor; + ListVendorBenefitPlansByVendorIdVendorBenefitPlans.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + title = nativeFromJson(json['title']), + description = json['description'] == null ? null : nativeFromJson(json['description']), + requestLabel = json['requestLabel'] == null ? null : nativeFromJson(json['requestLabel']), + total = json['total'] == null ? null : nativeFromJson(json['total']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + vendor = ListVendorBenefitPlansByVendorIdVendorBenefitPlansVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListVendorBenefitPlansByVendorIdVendorBenefitPlans otherTyped = other as ListVendorBenefitPlansByVendorIdVendorBenefitPlans; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + title == otherTyped.title && + description == otherTyped.description && + requestLabel == otherTyped.requestLabel && + total == otherTyped.total && + isActive == otherTyped.isActive && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, title.hashCode, description.hashCode, requestLabel.hashCode, total.hashCode, isActive.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + json['title'] = nativeToJson(title); + if (description != null) { + json['description'] = nativeToJson(description); + } + if (requestLabel != null) { + json['requestLabel'] = nativeToJson(requestLabel); + } + if (total != null) { + json['total'] = nativeToJson(total); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + json['vendor'] = vendor.toJson(); + return json; + } + + ListVendorBenefitPlansByVendorIdVendorBenefitPlans({ + required this.id, + required this.vendorId, + required this.title, + this.description, + this.requestLabel, + this.total, + this.isActive, + this.createdAt, + this.updatedAt, + this.createdBy, + required this.vendor, + }); +} + +@immutable +class ListVendorBenefitPlansByVendorIdVendorBenefitPlansVendor { + final String companyName; + ListVendorBenefitPlansByVendorIdVendorBenefitPlansVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListVendorBenefitPlansByVendorIdVendorBenefitPlansVendor otherTyped = other as ListVendorBenefitPlansByVendorIdVendorBenefitPlansVendor; + return companyName == otherTyped.companyName; + + } + @override + int get hashCode => companyName.hashCode; + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListVendorBenefitPlansByVendorIdVendorBenefitPlansVendor({ + required this.companyName, + }); +} + +@immutable +class ListVendorBenefitPlansByVendorIdData { + final List vendorBenefitPlans; + ListVendorBenefitPlansByVendorIdData.fromJson(dynamic json): + + vendorBenefitPlans = (json['vendorBenefitPlans'] as List) + .map((e) => ListVendorBenefitPlansByVendorIdVendorBenefitPlans.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListVendorBenefitPlansByVendorIdData otherTyped = other as ListVendorBenefitPlansByVendorIdData; + return vendorBenefitPlans == otherTyped.vendorBenefitPlans; + + } + @override + int get hashCode => vendorBenefitPlans.hashCode; + + + Map toJson() { + Map json = {}; + json['vendorBenefitPlans'] = vendorBenefitPlans.map((e) => e.toJson()).toList(); + return json; + } + + ListVendorBenefitPlansByVendorIdData({ + required this.vendorBenefitPlans, + }); +} + +@immutable +class ListVendorBenefitPlansByVendorIdVariables { + final String vendorId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListVendorBenefitPlansByVendorIdVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListVendorBenefitPlansByVendorIdVariables otherTyped = other as ListVendorBenefitPlansByVendorIdVariables; + return vendorId == otherTyped.vendorId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListVendorBenefitPlansByVendorIdVariables({ + required this.vendorId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_vendor_rates.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_vendor_rates.dart new file mode 100644 index 00000000..20b178cc --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_vendor_rates.dart @@ -0,0 +1,204 @@ +part of 'generated.dart'; + +class ListVendorRatesVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListVendorRatesVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListVendorRatesData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listVendorRates", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListVendorRatesVendorRates { + final String id; + final String vendorId; + final String? roleName; + final EnumValue? category; + final double? clientRate; + final double? employeeWage; + final double? markupPercentage; + final double? vendorFeePercentage; + final bool? isActive; + final String? notes; + final Timestamp? createdAt; + final ListVendorRatesVendorRatesVendor vendor; + ListVendorRatesVendorRates.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + roleName = json['roleName'] == null ? null : nativeFromJson(json['roleName']), + category = json['category'] == null ? null : categoryTypeDeserializer(json['category']), + clientRate = json['clientRate'] == null ? null : nativeFromJson(json['clientRate']), + employeeWage = json['employeeWage'] == null ? null : nativeFromJson(json['employeeWage']), + markupPercentage = json['markupPercentage'] == null ? null : nativeFromJson(json['markupPercentage']), + vendorFeePercentage = json['vendorFeePercentage'] == null ? null : nativeFromJson(json['vendorFeePercentage']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + vendor = ListVendorRatesVendorRatesVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListVendorRatesVendorRates otherTyped = other as ListVendorRatesVendorRates; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + roleName == otherTyped.roleName && + category == otherTyped.category && + clientRate == otherTyped.clientRate && + employeeWage == otherTyped.employeeWage && + markupPercentage == otherTyped.markupPercentage && + vendorFeePercentage == otherTyped.vendorFeePercentage && + isActive == otherTyped.isActive && + notes == otherTyped.notes && + createdAt == otherTyped.createdAt && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, roleName.hashCode, category.hashCode, clientRate.hashCode, employeeWage.hashCode, markupPercentage.hashCode, vendorFeePercentage.hashCode, isActive.hashCode, notes.hashCode, createdAt.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + if (roleName != null) { + json['roleName'] = nativeToJson(roleName); + } + if (category != null) { + json['category'] = + categoryTypeSerializer(category!) + ; + } + if (clientRate != null) { + json['clientRate'] = nativeToJson(clientRate); + } + if (employeeWage != null) { + json['employeeWage'] = nativeToJson(employeeWage); + } + if (markupPercentage != null) { + json['markupPercentage'] = nativeToJson(markupPercentage); + } + if (vendorFeePercentage != null) { + json['vendorFeePercentage'] = nativeToJson(vendorFeePercentage); + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['vendor'] = vendor.toJson(); + return json; + } + + ListVendorRatesVendorRates({ + required this.id, + required this.vendorId, + this.roleName, + this.category, + this.clientRate, + this.employeeWage, + this.markupPercentage, + this.vendorFeePercentage, + this.isActive, + this.notes, + this.createdAt, + required this.vendor, + }); +} + +@immutable +class ListVendorRatesVendorRatesVendor { + final String companyName; + final String? region; + ListVendorRatesVendorRatesVendor.fromJson(dynamic json): + + companyName = nativeFromJson(json['companyName']), + region = json['region'] == null ? null : nativeFromJson(json['region']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListVendorRatesVendorRatesVendor otherTyped = other as ListVendorRatesVendorRatesVendor; + return companyName == otherTyped.companyName && + region == otherTyped.region; + + } + @override + int get hashCode => Object.hashAll([companyName.hashCode, region.hashCode]); + + + Map toJson() { + Map json = {}; + json['companyName'] = nativeToJson(companyName); + if (region != null) { + json['region'] = nativeToJson(region); + } + return json; + } + + ListVendorRatesVendorRatesVendor({ + required this.companyName, + this.region, + }); +} + +@immutable +class ListVendorRatesData { + final List vendorRates; + ListVendorRatesData.fromJson(dynamic json): + + vendorRates = (json['vendorRates'] as List) + .map((e) => ListVendorRatesVendorRates.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListVendorRatesData otherTyped = other as ListVendorRatesData; + return vendorRates == otherTyped.vendorRates; + + } + @override + int get hashCode => vendorRates.hashCode; + + + Map toJson() { + Map json = {}; + json['vendorRates'] = vendorRates.map((e) => e.toJson()).toList(); + return json; + } + + ListVendorRatesData({ + required this.vendorRates, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_vendors.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_vendors.dart new file mode 100644 index 00000000..03280e62 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_vendors.dart @@ -0,0 +1,249 @@ +part of 'generated.dart'; + +class ListVendorsVariablesBuilder { + + final FirebaseDataConnect _dataConnect; + ListVendorsVariablesBuilder(this._dataConnect, ); + Deserializer dataDeserializer = (dynamic json) => ListVendorsData.fromJson(jsonDecode(json)); + + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + + return _dataConnect.query("listVendors", dataDeserializer, emptySerializer, null); + } +} + +@immutable +class ListVendorsVendors { + final String id; + final String userId; + final String companyName; + final String? email; + final String? phone; + final String? photoUrl; + final String? address; + final String? billingAddress; + final String? timezone; + final String? legalName; + final String? doingBusinessAs; + final String? region; + final String? state; + final String? city; + final String? serviceSpecialty; + final EnumValue? approvalStatus; + final bool? isActive; + final double? markup; + final double? fee; + final double? csat; + final EnumValue? tier; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + ListVendorsVendors.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + userId = nativeFromJson(json['userId']), + companyName = nativeFromJson(json['companyName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + phone = json['phone'] == null ? null : nativeFromJson(json['phone']), + photoUrl = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']), + address = json['address'] == null ? null : nativeFromJson(json['address']), + billingAddress = json['billingAddress'] == null ? null : nativeFromJson(json['billingAddress']), + timezone = json['timezone'] == null ? null : nativeFromJson(json['timezone']), + legalName = json['legalName'] == null ? null : nativeFromJson(json['legalName']), + doingBusinessAs = json['doingBusinessAs'] == null ? null : nativeFromJson(json['doingBusinessAs']), + region = json['region'] == null ? null : nativeFromJson(json['region']), + state = json['state'] == null ? null : nativeFromJson(json['state']), + city = json['city'] == null ? null : nativeFromJson(json['city']), + serviceSpecialty = json['serviceSpecialty'] == null ? null : nativeFromJson(json['serviceSpecialty']), + approvalStatus = json['approvalStatus'] == null ? null : approvalStatusDeserializer(json['approvalStatus']), + isActive = json['isActive'] == null ? null : nativeFromJson(json['isActive']), + markup = json['markup'] == null ? null : nativeFromJson(json['markup']), + fee = json['fee'] == null ? null : nativeFromJson(json['fee']), + csat = json['csat'] == null ? null : nativeFromJson(json['csat']), + tier = json['tier'] == null ? null : vendorTierDeserializer(json['tier']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListVendorsVendors otherTyped = other as ListVendorsVendors; + return id == otherTyped.id && + userId == otherTyped.userId && + companyName == otherTyped.companyName && + email == otherTyped.email && + phone == otherTyped.phone && + photoUrl == otherTyped.photoUrl && + address == otherTyped.address && + billingAddress == otherTyped.billingAddress && + timezone == otherTyped.timezone && + legalName == otherTyped.legalName && + doingBusinessAs == otherTyped.doingBusinessAs && + region == otherTyped.region && + state == otherTyped.state && + city == otherTyped.city && + serviceSpecialty == otherTyped.serviceSpecialty && + approvalStatus == otherTyped.approvalStatus && + isActive == otherTyped.isActive && + markup == otherTyped.markup && + fee == otherTyped.fee && + csat == otherTyped.csat && + tier == otherTyped.tier && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, companyName.hashCode, email.hashCode, phone.hashCode, photoUrl.hashCode, address.hashCode, billingAddress.hashCode, timezone.hashCode, legalName.hashCode, doingBusinessAs.hashCode, region.hashCode, state.hashCode, city.hashCode, serviceSpecialty.hashCode, approvalStatus.hashCode, isActive.hashCode, markup.hashCode, fee.hashCode, csat.hashCode, tier.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['userId'] = nativeToJson(userId); + json['companyName'] = nativeToJson(companyName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (phone != null) { + json['phone'] = nativeToJson(phone); + } + if (photoUrl != null) { + json['photoUrl'] = nativeToJson(photoUrl); + } + if (address != null) { + json['address'] = nativeToJson(address); + } + if (billingAddress != null) { + json['billingAddress'] = nativeToJson(billingAddress); + } + if (timezone != null) { + json['timezone'] = nativeToJson(timezone); + } + if (legalName != null) { + json['legalName'] = nativeToJson(legalName); + } + if (doingBusinessAs != null) { + json['doingBusinessAs'] = nativeToJson(doingBusinessAs); + } + if (region != null) { + json['region'] = nativeToJson(region); + } + if (state != null) { + json['state'] = nativeToJson(state); + } + if (city != null) { + json['city'] = nativeToJson(city); + } + if (serviceSpecialty != null) { + json['serviceSpecialty'] = nativeToJson(serviceSpecialty); + } + if (approvalStatus != null) { + json['approvalStatus'] = + approvalStatusSerializer(approvalStatus!) + ; + } + if (isActive != null) { + json['isActive'] = nativeToJson(isActive); + } + if (markup != null) { + json['markup'] = nativeToJson(markup); + } + if (fee != null) { + json['fee'] = nativeToJson(fee); + } + if (csat != null) { + json['csat'] = nativeToJson(csat); + } + if (tier != null) { + json['tier'] = + vendorTierSerializer(tier!) + ; + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + return json; + } + + ListVendorsVendors({ + required this.id, + required this.userId, + required this.companyName, + this.email, + this.phone, + this.photoUrl, + this.address, + this.billingAddress, + this.timezone, + this.legalName, + this.doingBusinessAs, + this.region, + this.state, + this.city, + this.serviceSpecialty, + this.approvalStatus, + this.isActive, + this.markup, + this.fee, + this.csat, + this.tier, + this.createdAt, + this.updatedAt, + this.createdBy, + }); +} + +@immutable +class ListVendorsData { + final List vendors; + ListVendorsData.fromJson(dynamic json): + + vendors = (json['vendors'] as List) + .map((e) => ListVendorsVendors.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListVendorsData otherTyped = other as ListVendorsData; + return vendors == otherTyped.vendors; + + } + @override + int get hashCode => vendors.hashCode; + + + Map toJson() { + Map json = {}; + json['vendors'] = vendors.map((e) => e.toJson()).toList(); + return json; + } + + ListVendorsData({ + required this.vendors, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_workforce_by_staff_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_workforce_by_staff_id.dart new file mode 100644 index 00000000..8cdaa962 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_workforce_by_staff_id.dart @@ -0,0 +1,243 @@ +part of 'generated.dart'; + +class ListWorkforceByStaffIdVariablesBuilder { + String staffId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListWorkforceByStaffIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListWorkforceByStaffIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListWorkforceByStaffIdVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => ListWorkforceByStaffIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListWorkforceByStaffIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListWorkforceByStaffIdVariables vars= ListWorkforceByStaffIdVariables(staffId: staffId,offset: _offset,limit: _limit,); + return _dataConnect.query("listWorkforceByStaffId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListWorkforceByStaffIdWorkforces { + final String id; + final String vendorId; + final String workforceNumber; + final EnumValue? employmentType; + final EnumValue? status; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final ListWorkforceByStaffIdWorkforcesVendor vendor; + ListWorkforceByStaffIdWorkforces.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + vendorId = nativeFromJson(json['vendorId']), + workforceNumber = nativeFromJson(json['workforceNumber']), + employmentType = json['employmentType'] == null ? null : workforceEmploymentTypeDeserializer(json['employmentType']), + status = json['status'] == null ? null : workforceStatusDeserializer(json['status']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + vendor = ListWorkforceByStaffIdWorkforcesVendor.fromJson(json['vendor']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListWorkforceByStaffIdWorkforces otherTyped = other as ListWorkforceByStaffIdWorkforces; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + workforceNumber == otherTyped.workforceNumber && + employmentType == otherTyped.employmentType && + status == otherTyped.status && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + vendor == otherTyped.vendor; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, workforceNumber.hashCode, employmentType.hashCode, status.hashCode, createdAt.hashCode, updatedAt.hashCode, vendor.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['vendorId'] = nativeToJson(vendorId); + json['workforceNumber'] = nativeToJson(workforceNumber); + if (employmentType != null) { + json['employmentType'] = + workforceEmploymentTypeSerializer(employmentType!) + ; + } + if (status != null) { + json['status'] = + workforceStatusSerializer(status!) + ; + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + json['vendor'] = vendor.toJson(); + return json; + } + + ListWorkforceByStaffIdWorkforces({ + required this.id, + required this.vendorId, + required this.workforceNumber, + this.employmentType, + this.status, + this.createdAt, + this.updatedAt, + required this.vendor, + }); +} + +@immutable +class ListWorkforceByStaffIdWorkforcesVendor { + final String id; + final String companyName; + ListWorkforceByStaffIdWorkforcesVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListWorkforceByStaffIdWorkforcesVendor otherTyped = other as ListWorkforceByStaffIdWorkforcesVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + ListWorkforceByStaffIdWorkforcesVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class ListWorkforceByStaffIdData { + final List workforces; + ListWorkforceByStaffIdData.fromJson(dynamic json): + + workforces = (json['workforces'] as List) + .map((e) => ListWorkforceByStaffIdWorkforces.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListWorkforceByStaffIdData otherTyped = other as ListWorkforceByStaffIdData; + return workforces == otherTyped.workforces; + + } + @override + int get hashCode => workforces.hashCode; + + + Map toJson() { + Map json = {}; + json['workforces'] = workforces.map((e) => e.toJson()).toList(); + return json; + } + + ListWorkforceByStaffIdData({ + required this.workforces, + }); +} + +@immutable +class ListWorkforceByStaffIdVariables { + final String staffId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListWorkforceByStaffIdVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListWorkforceByStaffIdVariables otherTyped = other as ListWorkforceByStaffIdVariables; + return staffId == otherTyped.staffId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListWorkforceByStaffIdVariables({ + required this.staffId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_workforce_by_vendor_id.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_workforce_by_vendor_id.dart new file mode 100644 index 00000000..c8975e17 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/list_workforce_by_vendor_id.dart @@ -0,0 +1,236 @@ +part of 'generated.dart'; + +class ListWorkforceByVendorIdVariablesBuilder { + String vendorId; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; ListWorkforceByVendorIdVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + ListWorkforceByVendorIdVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + ListWorkforceByVendorIdVariablesBuilder(this._dataConnect, {required this.vendorId,}); + Deserializer dataDeserializer = (dynamic json) => ListWorkforceByVendorIdData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (ListWorkforceByVendorIdVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + ListWorkforceByVendorIdVariables vars= ListWorkforceByVendorIdVariables(vendorId: vendorId,offset: _offset,limit: _limit,); + return _dataConnect.query("listWorkforceByVendorId", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class ListWorkforceByVendorIdWorkforces { + final String id; + final String staffId; + final String workforceNumber; + final EnumValue? employmentType; + final EnumValue? status; + final Timestamp? createdAt; + final ListWorkforceByVendorIdWorkforcesStaff staff; + ListWorkforceByVendorIdWorkforces.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + staffId = nativeFromJson(json['staffId']), + workforceNumber = nativeFromJson(json['workforceNumber']), + employmentType = json['employmentType'] == null ? null : workforceEmploymentTypeDeserializer(json['employmentType']), + status = json['status'] == null ? null : workforceStatusDeserializer(json['status']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + staff = ListWorkforceByVendorIdWorkforcesStaff.fromJson(json['staff']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListWorkforceByVendorIdWorkforces otherTyped = other as ListWorkforceByVendorIdWorkforces; + return id == otherTyped.id && + staffId == otherTyped.staffId && + workforceNumber == otherTyped.workforceNumber && + employmentType == otherTyped.employmentType && + status == otherTyped.status && + createdAt == otherTyped.createdAt && + staff == otherTyped.staff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, workforceNumber.hashCode, employmentType.hashCode, status.hashCode, createdAt.hashCode, staff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['staffId'] = nativeToJson(staffId); + json['workforceNumber'] = nativeToJson(workforceNumber); + if (employmentType != null) { + json['employmentType'] = + workforceEmploymentTypeSerializer(employmentType!) + ; + } + if (status != null) { + json['status'] = + workforceStatusSerializer(status!) + ; + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + json['staff'] = staff.toJson(); + return json; + } + + ListWorkforceByVendorIdWorkforces({ + required this.id, + required this.staffId, + required this.workforceNumber, + this.employmentType, + this.status, + this.createdAt, + required this.staff, + }); +} + +@immutable +class ListWorkforceByVendorIdWorkforcesStaff { + final String id; + final String fullName; + ListWorkforceByVendorIdWorkforcesStaff.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + fullName = nativeFromJson(json['fullName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListWorkforceByVendorIdWorkforcesStaff otherTyped = other as ListWorkforceByVendorIdWorkforcesStaff; + return id == otherTyped.id && + fullName == otherTyped.fullName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['fullName'] = nativeToJson(fullName); + return json; + } + + ListWorkforceByVendorIdWorkforcesStaff({ + required this.id, + required this.fullName, + }); +} + +@immutable +class ListWorkforceByVendorIdData { + final List workforces; + ListWorkforceByVendorIdData.fromJson(dynamic json): + + workforces = (json['workforces'] as List) + .map((e) => ListWorkforceByVendorIdWorkforces.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListWorkforceByVendorIdData otherTyped = other as ListWorkforceByVendorIdData; + return workforces == otherTyped.workforces; + + } + @override + int get hashCode => workforces.hashCode; + + + Map toJson() { + Map json = {}; + json['workforces'] = workforces.map((e) => e.toJson()).toList(); + return json; + } + + ListWorkforceByVendorIdData({ + required this.workforces, + }); +} + +@immutable +class ListWorkforceByVendorIdVariables { + final String vendorId; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + ListWorkforceByVendorIdVariables.fromJson(Map json): + + vendorId = nativeFromJson(json['vendorId']) { + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final ListWorkforceByVendorIdVariables otherTyped = other as ListWorkforceByVendorIdVariables; + return vendorId == otherTyped.vendorId && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([vendorId.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorId'] = nativeToJson(vendorId); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + ListWorkforceByVendorIdVariables({ + required this.vendorId, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/mark_activity_log_as_read.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/mark_activity_log_as_read.dart new file mode 100644 index 00000000..e1f9ed7f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/mark_activity_log_as_read.dart @@ -0,0 +1,124 @@ +part of 'generated.dart'; + +class MarkActivityLogAsReadVariablesBuilder { + String id; + + final FirebaseDataConnect _dataConnect; + MarkActivityLogAsReadVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => MarkActivityLogAsReadData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (MarkActivityLogAsReadVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + MarkActivityLogAsReadVariables vars= MarkActivityLogAsReadVariables(id: id,); + return _dataConnect.mutation("markActivityLogAsRead", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class MarkActivityLogAsReadActivityLogUpdate { + final String id; + MarkActivityLogAsReadActivityLogUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final MarkActivityLogAsReadActivityLogUpdate otherTyped = other as MarkActivityLogAsReadActivityLogUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + MarkActivityLogAsReadActivityLogUpdate({ + required this.id, + }); +} + +@immutable +class MarkActivityLogAsReadData { + final MarkActivityLogAsReadActivityLogUpdate? activityLog_update; + MarkActivityLogAsReadData.fromJson(dynamic json): + + activityLog_update = json['activityLog_update'] == null ? null : MarkActivityLogAsReadActivityLogUpdate.fromJson(json['activityLog_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final MarkActivityLogAsReadData otherTyped = other as MarkActivityLogAsReadData; + return activityLog_update == otherTyped.activityLog_update; + + } + @override + int get hashCode => activityLog_update.hashCode; + + + Map toJson() { + Map json = {}; + if (activityLog_update != null) { + json['activityLog_update'] = activityLog_update!.toJson(); + } + return json; + } + + MarkActivityLogAsReadData({ + this.activityLog_update, + }); +} + +@immutable +class MarkActivityLogAsReadVariables { + final String id; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + MarkActivityLogAsReadVariables.fromJson(Map json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final MarkActivityLogAsReadVariables otherTyped = other as MarkActivityLogAsReadVariables; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + MarkActivityLogAsReadVariables({ + required this.id, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/mark_activity_logs_as_read.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/mark_activity_logs_as_read.dart new file mode 100644 index 00000000..c976961d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/mark_activity_logs_as_read.dart @@ -0,0 +1,90 @@ +part of 'generated.dart'; + +class MarkActivityLogsAsReadVariablesBuilder { + List ids; + + final FirebaseDataConnect _dataConnect; + MarkActivityLogsAsReadVariablesBuilder(this._dataConnect, {required this.ids,}); + Deserializer dataDeserializer = (dynamic json) => MarkActivityLogsAsReadData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (MarkActivityLogsAsReadVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + MarkActivityLogsAsReadVariables vars= MarkActivityLogsAsReadVariables(ids: ids,); + return _dataConnect.mutation("markActivityLogsAsRead", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class MarkActivityLogsAsReadData { + final int activityLog_updateMany; + MarkActivityLogsAsReadData.fromJson(dynamic json): + + activityLog_updateMany = nativeFromJson(json['activityLog_updateMany']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final MarkActivityLogsAsReadData otherTyped = other as MarkActivityLogsAsReadData; + return activityLog_updateMany == otherTyped.activityLog_updateMany; + + } + @override + int get hashCode => activityLog_updateMany.hashCode; + + + Map toJson() { + Map json = {}; + json['activityLog_updateMany'] = nativeToJson(activityLog_updateMany); + return json; + } + + MarkActivityLogsAsReadData({ + required this.activityLog_updateMany, + }); +} + +@immutable +class MarkActivityLogsAsReadVariables { + final List ids; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + MarkActivityLogsAsReadVariables.fromJson(Map json): + + ids = (json['ids'] as List) + .map((e) => nativeFromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final MarkActivityLogsAsReadVariables otherTyped = other as MarkActivityLogsAsReadVariables; + return ids == otherTyped.ids; + + } + @override + int get hashCode => ids.hashCode; + + + Map toJson() { + Map json = {}; + json['ids'] = ids.map((e) => nativeToJson(e)).toList(); + return json; + } + + MarkActivityLogsAsReadVariables({ + required this.ids, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/mark_conversation_as_read.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/mark_conversation_as_read.dart new file mode 100644 index 00000000..d24fd1fc --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/mark_conversation_as_read.dart @@ -0,0 +1,154 @@ +part of 'generated.dart'; + +class MarkConversationAsReadVariablesBuilder { + String conversationId; + String userId; + Optional _lastReadAt = Optional.optional((json) => json['lastReadAt'] = Timestamp.fromJson(json['lastReadAt']), defaultSerializer); + + final FirebaseDataConnect _dataConnect; MarkConversationAsReadVariablesBuilder lastReadAt(Timestamp? t) { + _lastReadAt.value = t; + return this; + } + + MarkConversationAsReadVariablesBuilder(this._dataConnect, {required this.conversationId,required this.userId,}); + Deserializer dataDeserializer = (dynamic json) => MarkConversationAsReadData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (MarkConversationAsReadVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + MarkConversationAsReadVariables vars= MarkConversationAsReadVariables(conversationId: conversationId,userId: userId,lastReadAt: _lastReadAt,); + return _dataConnect.mutation("markConversationAsRead", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class MarkConversationAsReadUserConversationUpdate { + final String conversationId; + final String userId; + MarkConversationAsReadUserConversationUpdate.fromJson(dynamic json): + + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final MarkConversationAsReadUserConversationUpdate otherTyped = other as MarkConversationAsReadUserConversationUpdate; + return conversationId == otherTyped.conversationId && + userId == otherTyped.userId; + + } + @override + int get hashCode => Object.hashAll([conversationId.hashCode, userId.hashCode]); + + + Map toJson() { + Map json = {}; + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + return json; + } + + MarkConversationAsReadUserConversationUpdate({ + required this.conversationId, + required this.userId, + }); +} + +@immutable +class MarkConversationAsReadData { + final MarkConversationAsReadUserConversationUpdate? userConversation_update; + MarkConversationAsReadData.fromJson(dynamic json): + + userConversation_update = json['userConversation_update'] == null ? null : MarkConversationAsReadUserConversationUpdate.fromJson(json['userConversation_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final MarkConversationAsReadData otherTyped = other as MarkConversationAsReadData; + return userConversation_update == otherTyped.userConversation_update; + + } + @override + int get hashCode => userConversation_update.hashCode; + + + Map toJson() { + Map json = {}; + if (userConversation_update != null) { + json['userConversation_update'] = userConversation_update!.toJson(); + } + return json; + } + + MarkConversationAsReadData({ + this.userConversation_update, + }); +} + +@immutable +class MarkConversationAsReadVariables { + final String conversationId; + final String userId; + late final OptionallastReadAt; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + MarkConversationAsReadVariables.fromJson(Map json): + + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']) { + + + + + lastReadAt = Optional.optional((json) => json['lastReadAt'] = Timestamp.fromJson(json['lastReadAt']), defaultSerializer); + lastReadAt.value = json['lastReadAt'] == null ? null : Timestamp.fromJson(json['lastReadAt']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final MarkConversationAsReadVariables otherTyped = other as MarkConversationAsReadVariables; + return conversationId == otherTyped.conversationId && + userId == otherTyped.userId && + lastReadAt == otherTyped.lastReadAt; + + } + @override + int get hashCode => Object.hashAll([conversationId.hashCode, userId.hashCode, lastReadAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + if(lastReadAt.state == OptionalState.set) { + json['lastReadAt'] = lastReadAt.toJson(); + } + return json; + } + + MarkConversationAsReadVariables({ + required this.conversationId, + required this.userId, + required this.lastReadAt, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/search_invoice_templates_by_owner_and_name.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/search_invoice_templates_by_owner_and_name.dart new file mode 100644 index 00000000..8dc4e87b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/search_invoice_templates_by_owner_and_name.dart @@ -0,0 +1,491 @@ +part of 'generated.dart'; + +class SearchInvoiceTemplatesByOwnerAndNameVariablesBuilder { + String ownerId; + String name; + Optional _offset = Optional.optional(nativeFromJson, nativeToJson); + Optional _limit = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; SearchInvoiceTemplatesByOwnerAndNameVariablesBuilder offset(int? t) { + _offset.value = t; + return this; + } + SearchInvoiceTemplatesByOwnerAndNameVariablesBuilder limit(int? t) { + _limit.value = t; + return this; + } + + SearchInvoiceTemplatesByOwnerAndNameVariablesBuilder(this._dataConnect, {required this.ownerId,required this.name,}); + Deserializer dataDeserializer = (dynamic json) => SearchInvoiceTemplatesByOwnerAndNameData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (SearchInvoiceTemplatesByOwnerAndNameVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + QueryRef ref() { + SearchInvoiceTemplatesByOwnerAndNameVariables vars= SearchInvoiceTemplatesByOwnerAndNameVariables(ownerId: ownerId,name: name,offset: _offset,limit: _limit,); + return _dataConnect.query("searchInvoiceTemplatesByOwnerAndName", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplates { + final String id; + final String name; + final String ownerId; + final String? vendorId; + final String? businessId; + final String? orderId; + final EnumValue? paymentTerms; + final String? invoiceNumber; + final Timestamp? issueDate; + final Timestamp? dueDate; + final String? hub; + final String? managerName; + final String? vendorNumber; + final AnyValue? roles; + final AnyValue? charges; + final double? otherCharges; + final double? subtotal; + final double? amount; + final String? notes; + final int? staffCount; + final int? chargesCount; + final Timestamp? createdAt; + final Timestamp? updatedAt; + final String? createdBy; + final SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesVendor? vendor; + final SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesBusiness? business; + final SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesOrder? order; + SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplates.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + name = nativeFromJson(json['name']), + ownerId = nativeFromJson(json['ownerId']), + vendorId = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']), + businessId = json['businessId'] == null ? null : nativeFromJson(json['businessId']), + orderId = json['orderId'] == null ? null : nativeFromJson(json['orderId']), + paymentTerms = json['paymentTerms'] == null ? null : inovicePaymentTermsTempDeserializer(json['paymentTerms']), + invoiceNumber = json['invoiceNumber'] == null ? null : nativeFromJson(json['invoiceNumber']), + issueDate = json['issueDate'] == null ? null : Timestamp.fromJson(json['issueDate']), + dueDate = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']), + hub = json['hub'] == null ? null : nativeFromJson(json['hub']), + managerName = json['managerName'] == null ? null : nativeFromJson(json['managerName']), + vendorNumber = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']), + roles = json['roles'] == null ? null : AnyValue.fromJson(json['roles']), + charges = json['charges'] == null ? null : AnyValue.fromJson(json['charges']), + otherCharges = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']), + subtotal = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']), + amount = json['amount'] == null ? null : nativeFromJson(json['amount']), + notes = json['notes'] == null ? null : nativeFromJson(json['notes']), + staffCount = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']), + chargesCount = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']), + createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']), + updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']), + createdBy = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']), + vendor = json['vendor'] == null ? null : SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesVendor.fromJson(json['vendor']), + business = json['business'] == null ? null : SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesBusiness.fromJson(json['business']), + order = json['order'] == null ? null : SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesOrder.fromJson(json['order']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplates otherTyped = other as SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplates; + return id == otherTyped.id && + name == otherTyped.name && + ownerId == otherTyped.ownerId && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + createdAt == otherTyped.createdAt && + updatedAt == otherTyped.updatedAt && + createdBy == otherTyped.createdBy && + vendor == otherTyped.vendor && + business == otherTyped.business && + order == otherTyped.order; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, ownerId.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, vendor.hashCode, business.hashCode, order.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['name'] = nativeToJson(name); + json['ownerId'] = nativeToJson(ownerId); + if (vendorId != null) { + json['vendorId'] = nativeToJson(vendorId); + } + if (businessId != null) { + json['businessId'] = nativeToJson(businessId); + } + if (orderId != null) { + json['orderId'] = nativeToJson(orderId); + } + if (paymentTerms != null) { + json['paymentTerms'] = + inovicePaymentTermsTempSerializer(paymentTerms!) + ; + } + if (invoiceNumber != null) { + json['invoiceNumber'] = nativeToJson(invoiceNumber); + } + if (issueDate != null) { + json['issueDate'] = issueDate!.toJson(); + } + if (dueDate != null) { + json['dueDate'] = dueDate!.toJson(); + } + if (hub != null) { + json['hub'] = nativeToJson(hub); + } + if (managerName != null) { + json['managerName'] = nativeToJson(managerName); + } + if (vendorNumber != null) { + json['vendorNumber'] = nativeToJson(vendorNumber); + } + if (roles != null) { + json['roles'] = roles!.toJson(); + } + if (charges != null) { + json['charges'] = charges!.toJson(); + } + if (otherCharges != null) { + json['otherCharges'] = nativeToJson(otherCharges); + } + if (subtotal != null) { + json['subtotal'] = nativeToJson(subtotal); + } + if (amount != null) { + json['amount'] = nativeToJson(amount); + } + if (notes != null) { + json['notes'] = nativeToJson(notes); + } + if (staffCount != null) { + json['staffCount'] = nativeToJson(staffCount); + } + if (chargesCount != null) { + json['chargesCount'] = nativeToJson(chargesCount); + } + if (createdAt != null) { + json['createdAt'] = createdAt!.toJson(); + } + if (updatedAt != null) { + json['updatedAt'] = updatedAt!.toJson(); + } + if (createdBy != null) { + json['createdBy'] = nativeToJson(createdBy); + } + if (vendor != null) { + json['vendor'] = vendor!.toJson(); + } + if (business != null) { + json['business'] = business!.toJson(); + } + if (order != null) { + json['order'] = order!.toJson(); + } + return json; + } + + SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplates({ + required this.id, + required this.name, + required this.ownerId, + this.vendorId, + this.businessId, + this.orderId, + this.paymentTerms, + this.invoiceNumber, + this.issueDate, + this.dueDate, + this.hub, + this.managerName, + this.vendorNumber, + this.roles, + this.charges, + this.otherCharges, + this.subtotal, + this.amount, + this.notes, + this.staffCount, + this.chargesCount, + this.createdAt, + this.updatedAt, + this.createdBy, + this.vendor, + this.business, + this.order, + }); +} + +@immutable +class SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesVendor { + final String id; + final String companyName; + SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesVendor.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + companyName = nativeFromJson(json['companyName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesVendor otherTyped = other as SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesVendor; + return id == otherTyped.id && + companyName == otherTyped.companyName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['companyName'] = nativeToJson(companyName); + return json; + } + + SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesVendor({ + required this.id, + required this.companyName, + }); +} + +@immutable +class SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesBusiness { + final String id; + final String businessName; + final String? email; + final String? contactName; + SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesBusiness.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + businessName = nativeFromJson(json['businessName']), + email = json['email'] == null ? null : nativeFromJson(json['email']), + contactName = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesBusiness otherTyped = other as SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesBusiness; + return id == otherTyped.id && + businessName == otherTyped.businessName && + email == otherTyped.email && + contactName == otherTyped.contactName; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, email.hashCode, contactName.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['businessName'] = nativeToJson(businessName); + if (email != null) { + json['email'] = nativeToJson(email); + } + if (contactName != null) { + json['contactName'] = nativeToJson(contactName); + } + return json; + } + + SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesBusiness({ + required this.id, + required this.businessName, + this.email, + this.contactName, + }); +} + +@immutable +class SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesOrder { + final String id; + final String? eventName; + final EnumValue status; + final EnumValue orderType; + SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesOrder.fromJson(dynamic json): + + id = nativeFromJson(json['id']), + eventName = json['eventName'] == null ? null : nativeFromJson(json['eventName']), + status = orderStatusDeserializer(json['status']), + orderType = orderTypeDeserializer(json['orderType']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesOrder otherTyped = other as SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesOrder; + return id == otherTyped.id && + eventName == otherTyped.eventName && + status == otherTyped.status && + orderType == otherTyped.orderType; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, status.hashCode, orderType.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if (eventName != null) { + json['eventName'] = nativeToJson(eventName); + } + json['status'] = + orderStatusSerializer(status) + ; + json['orderType'] = + orderTypeSerializer(orderType) + ; + return json; + } + + SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplatesOrder({ + required this.id, + this.eventName, + required this.status, + required this.orderType, + }); +} + +@immutable +class SearchInvoiceTemplatesByOwnerAndNameData { + final List invoiceTemplates; + SearchInvoiceTemplatesByOwnerAndNameData.fromJson(dynamic json): + + invoiceTemplates = (json['invoiceTemplates'] as List) + .map((e) => SearchInvoiceTemplatesByOwnerAndNameInvoiceTemplates.fromJson(e)) + .toList(); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final SearchInvoiceTemplatesByOwnerAndNameData otherTyped = other as SearchInvoiceTemplatesByOwnerAndNameData; + return invoiceTemplates == otherTyped.invoiceTemplates; + + } + @override + int get hashCode => invoiceTemplates.hashCode; + + + Map toJson() { + Map json = {}; + json['invoiceTemplates'] = invoiceTemplates.map((e) => e.toJson()).toList(); + return json; + } + + SearchInvoiceTemplatesByOwnerAndNameData({ + required this.invoiceTemplates, + }); +} + +@immutable +class SearchInvoiceTemplatesByOwnerAndNameVariables { + final String ownerId; + final String name; + late final Optionaloffset; + late final Optionallimit; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + SearchInvoiceTemplatesByOwnerAndNameVariables.fromJson(Map json): + + ownerId = nativeFromJson(json['ownerId']), + name = nativeFromJson(json['name']) { + + + + + offset = Optional.optional(nativeFromJson, nativeToJson); + offset.value = json['offset'] == null ? null : nativeFromJson(json['offset']); + + + limit = Optional.optional(nativeFromJson, nativeToJson); + limit.value = json['limit'] == null ? null : nativeFromJson(json['limit']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final SearchInvoiceTemplatesByOwnerAndNameVariables otherTyped = other as SearchInvoiceTemplatesByOwnerAndNameVariables; + return ownerId == otherTyped.ownerId && + name == otherTyped.name && + offset == otherTyped.offset && + limit == otherTyped.limit; + + } + @override + int get hashCode => Object.hashAll([ownerId.hashCode, name.hashCode, offset.hashCode, limit.hashCode]); + + + Map toJson() { + Map json = {}; + json['ownerId'] = nativeToJson(ownerId); + json['name'] = nativeToJson(name); + if(offset.state == OptionalState.set) { + json['offset'] = offset.toJson(); + } + if(limit.state == OptionalState.set) { + json['limit'] = limit.toJson(); + } + return json; + } + + SearchInvoiceTemplatesByOwnerAndNameVariables({ + required this.ownerId, + required this.name, + required this.offset, + required this.limit, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_account.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_account.dart new file mode 100644 index 00000000..45c9489c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_account.dart @@ -0,0 +1,187 @@ +part of 'generated.dart'; + +class UpdateAccountVariablesBuilder { + String id; + Optional _bank = Optional.optional(nativeFromJson, nativeToJson); + Optional _type = Optional.optional((data) => AccountType.values.byName(data), enumSerializer); + Optional _last4 = Optional.optional(nativeFromJson, nativeToJson); + Optional _isPrimary = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateAccountVariablesBuilder bank(String? t) { + _bank.value = t; + return this; + } + UpdateAccountVariablesBuilder type(AccountType? t) { + _type.value = t; + return this; + } + UpdateAccountVariablesBuilder last4(String? t) { + _last4.value = t; + return this; + } + UpdateAccountVariablesBuilder isPrimary(bool? t) { + _isPrimary.value = t; + return this; + } + + UpdateAccountVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateAccountData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateAccountVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateAccountVariables vars= UpdateAccountVariables(id: id,bank: _bank,type: _type,last4: _last4,isPrimary: _isPrimary,); + return _dataConnect.mutation("updateAccount", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateAccountAccountUpdate { + final String id; + UpdateAccountAccountUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateAccountAccountUpdate otherTyped = other as UpdateAccountAccountUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateAccountAccountUpdate({ + required this.id, + }); +} + +@immutable +class UpdateAccountData { + final UpdateAccountAccountUpdate? account_update; + UpdateAccountData.fromJson(dynamic json): + + account_update = json['account_update'] == null ? null : UpdateAccountAccountUpdate.fromJson(json['account_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateAccountData otherTyped = other as UpdateAccountData; + return account_update == otherTyped.account_update; + + } + @override + int get hashCode => account_update.hashCode; + + + Map toJson() { + Map json = {}; + if (account_update != null) { + json['account_update'] = account_update!.toJson(); + } + return json; + } + + UpdateAccountData({ + this.account_update, + }); +} + +@immutable +class UpdateAccountVariables { + final String id; + late final Optionalbank; + late final Optionaltype; + late final Optionallast4; + late final OptionalisPrimary; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateAccountVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + bank = Optional.optional(nativeFromJson, nativeToJson); + bank.value = json['bank'] == null ? null : nativeFromJson(json['bank']); + + + type = Optional.optional((data) => AccountType.values.byName(data), enumSerializer); + type.value = json['type'] == null ? null : AccountType.values.byName(json['type']); + + + last4 = Optional.optional(nativeFromJson, nativeToJson); + last4.value = json['last4'] == null ? null : nativeFromJson(json['last4']); + + + isPrimary = Optional.optional(nativeFromJson, nativeToJson); + isPrimary.value = json['isPrimary'] == null ? null : nativeFromJson(json['isPrimary']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateAccountVariables otherTyped = other as UpdateAccountVariables; + return id == otherTyped.id && + bank == otherTyped.bank && + type == otherTyped.type && + last4 == otherTyped.last4 && + isPrimary == otherTyped.isPrimary; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, bank.hashCode, type.hashCode, last4.hashCode, isPrimary.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(bank.state == OptionalState.set) { + json['bank'] = bank.toJson(); + } + if(type.state == OptionalState.set) { + json['type'] = type.toJson(); + } + if(last4.state == OptionalState.set) { + json['last4'] = last4.toJson(); + } + if(isPrimary.state == OptionalState.set) { + json['isPrimary'] = isPrimary.toJson(); + } + return json; + } + + UpdateAccountVariables({ + required this.id, + required this.bank, + required this.type, + required this.last4, + required this.isPrimary, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_activity_log.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_activity_log.dart new file mode 100644 index 00000000..9e226064 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_activity_log.dart @@ -0,0 +1,292 @@ +part of 'generated.dart'; + +class UpdateActivityLogVariablesBuilder { + String id; + Optional _userId = Optional.optional(nativeFromJson, nativeToJson); + Optional _date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer); + Optional _hourStart = Optional.optional(nativeFromJson, nativeToJson); + Optional _hourEnd = Optional.optional(nativeFromJson, nativeToJson); + Optional _totalhours = Optional.optional(nativeFromJson, nativeToJson); + Optional _iconType = Optional.optional((data) => ActivityIconType.values.byName(data), enumSerializer); + Optional _iconColor = Optional.optional(nativeFromJson, nativeToJson); + Optional _title = Optional.optional(nativeFromJson, nativeToJson); + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + Optional _isRead = Optional.optional(nativeFromJson, nativeToJson); + Optional _activityType = Optional.optional((data) => ActivityType.values.byName(data), enumSerializer); + + final FirebaseDataConnect _dataConnect; UpdateActivityLogVariablesBuilder userId(String? t) { + _userId.value = t; + return this; + } + UpdateActivityLogVariablesBuilder date(Timestamp? t) { + _date.value = t; + return this; + } + UpdateActivityLogVariablesBuilder hourStart(String? t) { + _hourStart.value = t; + return this; + } + UpdateActivityLogVariablesBuilder hourEnd(String? t) { + _hourEnd.value = t; + return this; + } + UpdateActivityLogVariablesBuilder totalhours(String? t) { + _totalhours.value = t; + return this; + } + UpdateActivityLogVariablesBuilder iconType(ActivityIconType? t) { + _iconType.value = t; + return this; + } + UpdateActivityLogVariablesBuilder iconColor(String? t) { + _iconColor.value = t; + return this; + } + UpdateActivityLogVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + UpdateActivityLogVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + UpdateActivityLogVariablesBuilder isRead(bool? t) { + _isRead.value = t; + return this; + } + UpdateActivityLogVariablesBuilder activityType(ActivityType? t) { + _activityType.value = t; + return this; + } + + UpdateActivityLogVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateActivityLogData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateActivityLogVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateActivityLogVariables vars= UpdateActivityLogVariables(id: id,userId: _userId,date: _date,hourStart: _hourStart,hourEnd: _hourEnd,totalhours: _totalhours,iconType: _iconType,iconColor: _iconColor,title: _title,description: _description,isRead: _isRead,activityType: _activityType,); + return _dataConnect.mutation("updateActivityLog", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateActivityLogActivityLogUpdate { + final String id; + UpdateActivityLogActivityLogUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateActivityLogActivityLogUpdate otherTyped = other as UpdateActivityLogActivityLogUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateActivityLogActivityLogUpdate({ + required this.id, + }); +} + +@immutable +class UpdateActivityLogData { + final UpdateActivityLogActivityLogUpdate? activityLog_update; + UpdateActivityLogData.fromJson(dynamic json): + + activityLog_update = json['activityLog_update'] == null ? null : UpdateActivityLogActivityLogUpdate.fromJson(json['activityLog_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateActivityLogData otherTyped = other as UpdateActivityLogData; + return activityLog_update == otherTyped.activityLog_update; + + } + @override + int get hashCode => activityLog_update.hashCode; + + + Map toJson() { + Map json = {}; + if (activityLog_update != null) { + json['activityLog_update'] = activityLog_update!.toJson(); + } + return json; + } + + UpdateActivityLogData({ + this.activityLog_update, + }); +} + +@immutable +class UpdateActivityLogVariables { + final String id; + late final OptionaluserId; + late final Optionaldate; + late final OptionalhourStart; + late final OptionalhourEnd; + late final Optionaltotalhours; + late final OptionaliconType; + late final OptionaliconColor; + late final Optionaltitle; + late final Optionaldescription; + late final OptionalisRead; + late final OptionalactivityType; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateActivityLogVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + userId = Optional.optional(nativeFromJson, nativeToJson); + userId.value = json['userId'] == null ? null : nativeFromJson(json['userId']); + + + date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer); + date.value = json['date'] == null ? null : Timestamp.fromJson(json['date']); + + + hourStart = Optional.optional(nativeFromJson, nativeToJson); + hourStart.value = json['hourStart'] == null ? null : nativeFromJson(json['hourStart']); + + + hourEnd = Optional.optional(nativeFromJson, nativeToJson); + hourEnd.value = json['hourEnd'] == null ? null : nativeFromJson(json['hourEnd']); + + + totalhours = Optional.optional(nativeFromJson, nativeToJson); + totalhours.value = json['totalhours'] == null ? null : nativeFromJson(json['totalhours']); + + + iconType = Optional.optional((data) => ActivityIconType.values.byName(data), enumSerializer); + iconType.value = json['iconType'] == null ? null : ActivityIconType.values.byName(json['iconType']); + + + iconColor = Optional.optional(nativeFromJson, nativeToJson); + iconColor.value = json['iconColor'] == null ? null : nativeFromJson(json['iconColor']); + + + title = Optional.optional(nativeFromJson, nativeToJson); + title.value = json['title'] == null ? null : nativeFromJson(json['title']); + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + + isRead = Optional.optional(nativeFromJson, nativeToJson); + isRead.value = json['isRead'] == null ? null : nativeFromJson(json['isRead']); + + + activityType = Optional.optional((data) => ActivityType.values.byName(data), enumSerializer); + activityType.value = json['activityType'] == null ? null : ActivityType.values.byName(json['activityType']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateActivityLogVariables otherTyped = other as UpdateActivityLogVariables; + return id == otherTyped.id && + userId == otherTyped.userId && + date == otherTyped.date && + hourStart == otherTyped.hourStart && + hourEnd == otherTyped.hourEnd && + totalhours == otherTyped.totalhours && + iconType == otherTyped.iconType && + iconColor == otherTyped.iconColor && + title == otherTyped.title && + description == otherTyped.description && + isRead == otherTyped.isRead && + activityType == otherTyped.activityType; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, date.hashCode, hourStart.hashCode, hourEnd.hashCode, totalhours.hashCode, iconType.hashCode, iconColor.hashCode, title.hashCode, description.hashCode, isRead.hashCode, activityType.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(userId.state == OptionalState.set) { + json['userId'] = userId.toJson(); + } + if(date.state == OptionalState.set) { + json['date'] = date.toJson(); + } + if(hourStart.state == OptionalState.set) { + json['hourStart'] = hourStart.toJson(); + } + if(hourEnd.state == OptionalState.set) { + json['hourEnd'] = hourEnd.toJson(); + } + if(totalhours.state == OptionalState.set) { + json['totalhours'] = totalhours.toJson(); + } + if(iconType.state == OptionalState.set) { + json['iconType'] = iconType.toJson(); + } + if(iconColor.state == OptionalState.set) { + json['iconColor'] = iconColor.toJson(); + } + if(title.state == OptionalState.set) { + json['title'] = title.toJson(); + } + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + if(isRead.state == OptionalState.set) { + json['isRead'] = isRead.toJson(); + } + if(activityType.state == OptionalState.set) { + json['activityType'] = activityType.toJson(); + } + return json; + } + + UpdateActivityLogVariables({ + required this.id, + required this.userId, + required this.date, + required this.hourStart, + required this.hourEnd, + required this.totalhours, + required this.iconType, + required this.iconColor, + required this.title, + required this.description, + required this.isRead, + required this.activityType, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_application_status.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_application_status.dart new file mode 100644 index 00000000..0d8c8165 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_application_status.dart @@ -0,0 +1,209 @@ +part of 'generated.dart'; + +class UpdateApplicationStatusVariablesBuilder { + String id; + Optional _shiftId = Optional.optional(nativeFromJson, nativeToJson); + Optional _staffId = Optional.optional(nativeFromJson, nativeToJson); + Optional _status = Optional.optional((data) => ApplicationStatus.values.byName(data), enumSerializer); + Optional _checkInTime = Optional.optional((json) => json['checkInTime'] = Timestamp.fromJson(json['checkInTime']), defaultSerializer); + Optional _checkOutTime = Optional.optional((json) => json['checkOutTime'] = Timestamp.fromJson(json['checkOutTime']), defaultSerializer); + String roleId; + + final FirebaseDataConnect _dataConnect; UpdateApplicationStatusVariablesBuilder shiftId(String? t) { + _shiftId.value = t; + return this; + } + UpdateApplicationStatusVariablesBuilder staffId(String? t) { + _staffId.value = t; + return this; + } + UpdateApplicationStatusVariablesBuilder status(ApplicationStatus? t) { + _status.value = t; + return this; + } + UpdateApplicationStatusVariablesBuilder checkInTime(Timestamp? t) { + _checkInTime.value = t; + return this; + } + UpdateApplicationStatusVariablesBuilder checkOutTime(Timestamp? t) { + _checkOutTime.value = t; + return this; + } + + UpdateApplicationStatusVariablesBuilder(this._dataConnect, {required this.id,required this.roleId,}); + Deserializer dataDeserializer = (dynamic json) => UpdateApplicationStatusData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateApplicationStatusVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateApplicationStatusVariables vars= UpdateApplicationStatusVariables(id: id,shiftId: _shiftId,staffId: _staffId,status: _status,checkInTime: _checkInTime,checkOutTime: _checkOutTime,roleId: roleId,); + return _dataConnect.mutation("updateApplicationStatus", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateApplicationStatusApplicationUpdate { + final String id; + UpdateApplicationStatusApplicationUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateApplicationStatusApplicationUpdate otherTyped = other as UpdateApplicationStatusApplicationUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateApplicationStatusApplicationUpdate({ + required this.id, + }); +} + +@immutable +class UpdateApplicationStatusData { + final UpdateApplicationStatusApplicationUpdate? application_update; + UpdateApplicationStatusData.fromJson(dynamic json): + + application_update = json['application_update'] == null ? null : UpdateApplicationStatusApplicationUpdate.fromJson(json['application_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateApplicationStatusData otherTyped = other as UpdateApplicationStatusData; + return application_update == otherTyped.application_update; + + } + @override + int get hashCode => application_update.hashCode; + + + Map toJson() { + Map json = {}; + if (application_update != null) { + json['application_update'] = application_update!.toJson(); + } + return json; + } + + UpdateApplicationStatusData({ + this.application_update, + }); +} + +@immutable +class UpdateApplicationStatusVariables { + final String id; + late final OptionalshiftId; + late final OptionalstaffId; + late final Optionalstatus; + late final OptionalcheckInTime; + late final OptionalcheckOutTime; + final String roleId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateApplicationStatusVariables.fromJson(Map json): + + id = nativeFromJson(json['id']), + roleId = nativeFromJson(json['roleId']) { + + + + shiftId = Optional.optional(nativeFromJson, nativeToJson); + shiftId.value = json['shiftId'] == null ? null : nativeFromJson(json['shiftId']); + + + staffId = Optional.optional(nativeFromJson, nativeToJson); + staffId.value = json['staffId'] == null ? null : nativeFromJson(json['staffId']); + + + status = Optional.optional((data) => ApplicationStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : ApplicationStatus.values.byName(json['status']); + + + checkInTime = Optional.optional((json) => json['checkInTime'] = Timestamp.fromJson(json['checkInTime']), defaultSerializer); + checkInTime.value = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']); + + + checkOutTime = Optional.optional((json) => json['checkOutTime'] = Timestamp.fromJson(json['checkOutTime']), defaultSerializer); + checkOutTime.value = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']); + + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateApplicationStatusVariables otherTyped = other as UpdateApplicationStatusVariables; + return id == otherTyped.id && + shiftId == otherTyped.shiftId && + staffId == otherTyped.staffId && + status == otherTyped.status && + checkInTime == otherTyped.checkInTime && + checkOutTime == otherTyped.checkOutTime && + roleId == otherTyped.roleId; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, staffId.hashCode, status.hashCode, checkInTime.hashCode, checkOutTime.hashCode, roleId.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(shiftId.state == OptionalState.set) { + json['shiftId'] = shiftId.toJson(); + } + if(staffId.state == OptionalState.set) { + json['staffId'] = staffId.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(checkInTime.state == OptionalState.set) { + json['checkInTime'] = checkInTime.toJson(); + } + if(checkOutTime.state == OptionalState.set) { + json['checkOutTime'] = checkOutTime.toJson(); + } + json['roleId'] = nativeToJson(roleId); + return json; + } + + UpdateApplicationStatusVariables({ + required this.id, + required this.shiftId, + required this.staffId, + required this.status, + required this.checkInTime, + required this.checkOutTime, + required this.roleId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_assignment.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_assignment.dart new file mode 100644 index 00000000..940cad0b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_assignment.dart @@ -0,0 +1,293 @@ +part of 'generated.dart'; + +class UpdateAssignmentVariablesBuilder { + String id; + Optional _title = Optional.optional(nativeFromJson, nativeToJson); + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + Optional _instructions = Optional.optional(nativeFromJson, nativeToJson); + Optional _status = Optional.optional((data) => AssignmentStatus.values.byName(data), enumSerializer); + Optional _tipsAvailable = Optional.optional(nativeFromJson, nativeToJson); + Optional _travelTime = Optional.optional(nativeFromJson, nativeToJson); + Optional _mealProvided = Optional.optional(nativeFromJson, nativeToJson); + Optional _parkingAvailable = Optional.optional(nativeFromJson, nativeToJson); + Optional _gasCompensation = Optional.optional(nativeFromJson, nativeToJson); + Optional> _managers = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer)); + String roleId; + String shiftId; + + final FirebaseDataConnect _dataConnect; UpdateAssignmentVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + UpdateAssignmentVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + UpdateAssignmentVariablesBuilder instructions(String? t) { + _instructions.value = t; + return this; + } + UpdateAssignmentVariablesBuilder status(AssignmentStatus? t) { + _status.value = t; + return this; + } + UpdateAssignmentVariablesBuilder tipsAvailable(bool? t) { + _tipsAvailable.value = t; + return this; + } + UpdateAssignmentVariablesBuilder travelTime(bool? t) { + _travelTime.value = t; + return this; + } + UpdateAssignmentVariablesBuilder mealProvided(bool? t) { + _mealProvided.value = t; + return this; + } + UpdateAssignmentVariablesBuilder parkingAvailable(bool? t) { + _parkingAvailable.value = t; + return this; + } + UpdateAssignmentVariablesBuilder gasCompensation(bool? t) { + _gasCompensation.value = t; + return this; + } + UpdateAssignmentVariablesBuilder managers(List? t) { + _managers.value = t; + return this; + } + + UpdateAssignmentVariablesBuilder(this._dataConnect, {required this.id,required this.roleId,required this.shiftId,}); + Deserializer dataDeserializer = (dynamic json) => UpdateAssignmentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateAssignmentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateAssignmentVariables vars= UpdateAssignmentVariables(id: id,title: _title,description: _description,instructions: _instructions,status: _status,tipsAvailable: _tipsAvailable,travelTime: _travelTime,mealProvided: _mealProvided,parkingAvailable: _parkingAvailable,gasCompensation: _gasCompensation,managers: _managers,roleId: roleId,shiftId: shiftId,); + return _dataConnect.mutation("UpdateAssignment", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateAssignmentAssignmentUpdate { + final String id; + UpdateAssignmentAssignmentUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateAssignmentAssignmentUpdate otherTyped = other as UpdateAssignmentAssignmentUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateAssignmentAssignmentUpdate({ + required this.id, + }); +} + +@immutable +class UpdateAssignmentData { + final UpdateAssignmentAssignmentUpdate? assignment_update; + UpdateAssignmentData.fromJson(dynamic json): + + assignment_update = json['assignment_update'] == null ? null : UpdateAssignmentAssignmentUpdate.fromJson(json['assignment_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateAssignmentData otherTyped = other as UpdateAssignmentData; + return assignment_update == otherTyped.assignment_update; + + } + @override + int get hashCode => assignment_update.hashCode; + + + Map toJson() { + Map json = {}; + if (assignment_update != null) { + json['assignment_update'] = assignment_update!.toJson(); + } + return json; + } + + UpdateAssignmentData({ + this.assignment_update, + }); +} + +@immutable +class UpdateAssignmentVariables { + final String id; + late final Optionaltitle; + late final Optionaldescription; + late final Optionalinstructions; + late final Optionalstatus; + late final OptionaltipsAvailable; + late final OptionaltravelTime; + late final OptionalmealProvided; + late final OptionalparkingAvailable; + late final OptionalgasCompensation; + late final Optional>managers; + final String roleId; + final String shiftId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateAssignmentVariables.fromJson(Map json): + + id = nativeFromJson(json['id']), + roleId = nativeFromJson(json['roleId']), + shiftId = nativeFromJson(json['shiftId']) { + + + + title = Optional.optional(nativeFromJson, nativeToJson); + title.value = json['title'] == null ? null : nativeFromJson(json['title']); + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + + instructions = Optional.optional(nativeFromJson, nativeToJson); + instructions.value = json['instructions'] == null ? null : nativeFromJson(json['instructions']); + + + status = Optional.optional((data) => AssignmentStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : AssignmentStatus.values.byName(json['status']); + + + tipsAvailable = Optional.optional(nativeFromJson, nativeToJson); + tipsAvailable.value = json['tipsAvailable'] == null ? null : nativeFromJson(json['tipsAvailable']); + + + travelTime = Optional.optional(nativeFromJson, nativeToJson); + travelTime.value = json['travelTime'] == null ? null : nativeFromJson(json['travelTime']); + + + mealProvided = Optional.optional(nativeFromJson, nativeToJson); + mealProvided.value = json['mealProvided'] == null ? null : nativeFromJson(json['mealProvided']); + + + parkingAvailable = Optional.optional(nativeFromJson, nativeToJson); + parkingAvailable.value = json['parkingAvailable'] == null ? null : nativeFromJson(json['parkingAvailable']); + + + gasCompensation = Optional.optional(nativeFromJson, nativeToJson); + gasCompensation.value = json['gasCompensation'] == null ? null : nativeFromJson(json['gasCompensation']); + + + managers = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer)); + managers.value = json['managers'] == null ? null : (json['managers'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(); + + + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateAssignmentVariables otherTyped = other as UpdateAssignmentVariables; + return id == otherTyped.id && + title == otherTyped.title && + description == otherTyped.description && + instructions == otherTyped.instructions && + status == otherTyped.status && + tipsAvailable == otherTyped.tipsAvailable && + travelTime == otherTyped.travelTime && + mealProvided == otherTyped.mealProvided && + parkingAvailable == otherTyped.parkingAvailable && + gasCompensation == otherTyped.gasCompensation && + managers == otherTyped.managers && + roleId == otherTyped.roleId && + shiftId == otherTyped.shiftId; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, description.hashCode, instructions.hashCode, status.hashCode, tipsAvailable.hashCode, travelTime.hashCode, mealProvided.hashCode, parkingAvailable.hashCode, gasCompensation.hashCode, managers.hashCode, roleId.hashCode, shiftId.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(title.state == OptionalState.set) { + json['title'] = title.toJson(); + } + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + if(instructions.state == OptionalState.set) { + json['instructions'] = instructions.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(tipsAvailable.state == OptionalState.set) { + json['tipsAvailable'] = tipsAvailable.toJson(); + } + if(travelTime.state == OptionalState.set) { + json['travelTime'] = travelTime.toJson(); + } + if(mealProvided.state == OptionalState.set) { + json['mealProvided'] = mealProvided.toJson(); + } + if(parkingAvailable.state == OptionalState.set) { + json['parkingAvailable'] = parkingAvailable.toJson(); + } + if(gasCompensation.state == OptionalState.set) { + json['gasCompensation'] = gasCompensation.toJson(); + } + if(managers.state == OptionalState.set) { + json['managers'] = managers.toJson(); + } + json['roleId'] = nativeToJson(roleId); + json['shiftId'] = nativeToJson(shiftId); + return json; + } + + UpdateAssignmentVariables({ + required this.id, + required this.title, + required this.description, + required this.instructions, + required this.status, + required this.tipsAvailable, + required this.travelTime, + required this.mealProvided, + required this.parkingAvailable, + required this.gasCompensation, + required this.managers, + required this.roleId, + required this.shiftId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_attire_option.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_attire_option.dart new file mode 100644 index 00000000..8644bbf1 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_attire_option.dart @@ -0,0 +1,217 @@ +part of 'generated.dart'; + +class UpdateAttireOptionVariablesBuilder { + String id; + Optional _itemId = Optional.optional(nativeFromJson, nativeToJson); + Optional _label = Optional.optional(nativeFromJson, nativeToJson); + Optional _icon = Optional.optional(nativeFromJson, nativeToJson); + Optional _imageUrl = Optional.optional(nativeFromJson, nativeToJson); + Optional _isMandatory = Optional.optional(nativeFromJson, nativeToJson); + Optional _vendorId = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateAttireOptionVariablesBuilder itemId(String? t) { + _itemId.value = t; + return this; + } + UpdateAttireOptionVariablesBuilder label(String? t) { + _label.value = t; + return this; + } + UpdateAttireOptionVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + UpdateAttireOptionVariablesBuilder imageUrl(String? t) { + _imageUrl.value = t; + return this; + } + UpdateAttireOptionVariablesBuilder isMandatory(bool? t) { + _isMandatory.value = t; + return this; + } + UpdateAttireOptionVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + + UpdateAttireOptionVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateAttireOptionData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateAttireOptionVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateAttireOptionVariables vars= UpdateAttireOptionVariables(id: id,itemId: _itemId,label: _label,icon: _icon,imageUrl: _imageUrl,isMandatory: _isMandatory,vendorId: _vendorId,); + return _dataConnect.mutation("updateAttireOption", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateAttireOptionAttireOptionUpdate { + final String id; + UpdateAttireOptionAttireOptionUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateAttireOptionAttireOptionUpdate otherTyped = other as UpdateAttireOptionAttireOptionUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateAttireOptionAttireOptionUpdate({ + required this.id, + }); +} + +@immutable +class UpdateAttireOptionData { + final UpdateAttireOptionAttireOptionUpdate? attireOption_update; + UpdateAttireOptionData.fromJson(dynamic json): + + attireOption_update = json['attireOption_update'] == null ? null : UpdateAttireOptionAttireOptionUpdate.fromJson(json['attireOption_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateAttireOptionData otherTyped = other as UpdateAttireOptionData; + return attireOption_update == otherTyped.attireOption_update; + + } + @override + int get hashCode => attireOption_update.hashCode; + + + Map toJson() { + Map json = {}; + if (attireOption_update != null) { + json['attireOption_update'] = attireOption_update!.toJson(); + } + return json; + } + + UpdateAttireOptionData({ + this.attireOption_update, + }); +} + +@immutable +class UpdateAttireOptionVariables { + final String id; + late final OptionalitemId; + late final Optionallabel; + late final Optionalicon; + late final OptionalimageUrl; + late final OptionalisMandatory; + late final OptionalvendorId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateAttireOptionVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + itemId = Optional.optional(nativeFromJson, nativeToJson); + itemId.value = json['itemId'] == null ? null : nativeFromJson(json['itemId']); + + + label = Optional.optional(nativeFromJson, nativeToJson); + label.value = json['label'] == null ? null : nativeFromJson(json['label']); + + + icon = Optional.optional(nativeFromJson, nativeToJson); + icon.value = json['icon'] == null ? null : nativeFromJson(json['icon']); + + + imageUrl = Optional.optional(nativeFromJson, nativeToJson); + imageUrl.value = json['imageUrl'] == null ? null : nativeFromJson(json['imageUrl']); + + + isMandatory = Optional.optional(nativeFromJson, nativeToJson); + isMandatory.value = json['isMandatory'] == null ? null : nativeFromJson(json['isMandatory']); + + + vendorId = Optional.optional(nativeFromJson, nativeToJson); + vendorId.value = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateAttireOptionVariables otherTyped = other as UpdateAttireOptionVariables; + return id == otherTyped.id && + itemId == otherTyped.itemId && + label == otherTyped.label && + icon == otherTyped.icon && + imageUrl == otherTyped.imageUrl && + isMandatory == otherTyped.isMandatory && + vendorId == otherTyped.vendorId; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, itemId.hashCode, label.hashCode, icon.hashCode, imageUrl.hashCode, isMandatory.hashCode, vendorId.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(itemId.state == OptionalState.set) { + json['itemId'] = itemId.toJson(); + } + if(label.state == OptionalState.set) { + json['label'] = label.toJson(); + } + if(icon.state == OptionalState.set) { + json['icon'] = icon.toJson(); + } + if(imageUrl.state == OptionalState.set) { + json['imageUrl'] = imageUrl.toJson(); + } + if(isMandatory.state == OptionalState.set) { + json['isMandatory'] = isMandatory.toJson(); + } + if(vendorId.state == OptionalState.set) { + json['vendorId'] = vendorId.toJson(); + } + return json; + } + + UpdateAttireOptionVariables({ + required this.id, + required this.itemId, + required this.label, + required this.icon, + required this.imageUrl, + required this.isMandatory, + required this.vendorId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_benefits_data.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_benefits_data.dart new file mode 100644 index 00000000..a087af12 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_benefits_data.dart @@ -0,0 +1,154 @@ +part of 'generated.dart'; + +class UpdateBenefitsDataVariablesBuilder { + String staffId; + String vendorBenefitPlanId; + Optional _current = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateBenefitsDataVariablesBuilder current(int? t) { + _current.value = t; + return this; + } + + UpdateBenefitsDataVariablesBuilder(this._dataConnect, {required this.staffId,required this.vendorBenefitPlanId,}); + Deserializer dataDeserializer = (dynamic json) => UpdateBenefitsDataData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateBenefitsDataVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateBenefitsDataVariables vars= UpdateBenefitsDataVariables(staffId: staffId,vendorBenefitPlanId: vendorBenefitPlanId,current: _current,); + return _dataConnect.mutation("updateBenefitsData", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateBenefitsDataBenefitsDataUpdate { + final String vendorBenefitPlanId; + final String staffId; + UpdateBenefitsDataBenefitsDataUpdate.fromJson(dynamic json): + + vendorBenefitPlanId = nativeFromJson(json['vendorBenefitPlanId']), + staffId = nativeFromJson(json['staffId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateBenefitsDataBenefitsDataUpdate otherTyped = other as UpdateBenefitsDataBenefitsDataUpdate; + return vendorBenefitPlanId == otherTyped.vendorBenefitPlanId && + staffId == otherTyped.staffId; + + } + @override + int get hashCode => Object.hashAll([vendorBenefitPlanId.hashCode, staffId.hashCode]); + + + Map toJson() { + Map json = {}; + json['vendorBenefitPlanId'] = nativeToJson(vendorBenefitPlanId); + json['staffId'] = nativeToJson(staffId); + return json; + } + + UpdateBenefitsDataBenefitsDataUpdate({ + required this.vendorBenefitPlanId, + required this.staffId, + }); +} + +@immutable +class UpdateBenefitsDataData { + final UpdateBenefitsDataBenefitsDataUpdate? benefitsData_update; + UpdateBenefitsDataData.fromJson(dynamic json): + + benefitsData_update = json['benefitsData_update'] == null ? null : UpdateBenefitsDataBenefitsDataUpdate.fromJson(json['benefitsData_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateBenefitsDataData otherTyped = other as UpdateBenefitsDataData; + return benefitsData_update == otherTyped.benefitsData_update; + + } + @override + int get hashCode => benefitsData_update.hashCode; + + + Map toJson() { + Map json = {}; + if (benefitsData_update != null) { + json['benefitsData_update'] = benefitsData_update!.toJson(); + } + return json; + } + + UpdateBenefitsDataData({ + this.benefitsData_update, + }); +} + +@immutable +class UpdateBenefitsDataVariables { + final String staffId; + final String vendorBenefitPlanId; + late final Optionalcurrent; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateBenefitsDataVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + vendorBenefitPlanId = nativeFromJson(json['vendorBenefitPlanId']) { + + + + + current = Optional.optional(nativeFromJson, nativeToJson); + current.value = json['current'] == null ? null : nativeFromJson(json['current']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateBenefitsDataVariables otherTyped = other as UpdateBenefitsDataVariables; + return staffId == otherTyped.staffId && + vendorBenefitPlanId == otherTyped.vendorBenefitPlanId && + current == otherTyped.current; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, vendorBenefitPlanId.hashCode, current.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['vendorBenefitPlanId'] = nativeToJson(vendorBenefitPlanId); + if(current.state == OptionalState.set) { + json['current'] = current.toJson(); + } + return json; + } + + UpdateBenefitsDataVariables({ + required this.staffId, + required this.vendorBenefitPlanId, + required this.current, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_business.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_business.dart new file mode 100644 index 00000000..f5f1760a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_business.dart @@ -0,0 +1,322 @@ +part of 'generated.dart'; + +class UpdateBusinessVariablesBuilder { + String id; + Optional _businessName = Optional.optional(nativeFromJson, nativeToJson); + Optional _contactName = Optional.optional(nativeFromJson, nativeToJson); + Optional _companyLogoUrl = Optional.optional(nativeFromJson, nativeToJson); + Optional _phone = Optional.optional(nativeFromJson, nativeToJson); + Optional _email = Optional.optional(nativeFromJson, nativeToJson); + Optional _hubBuilding = Optional.optional(nativeFromJson, nativeToJson); + Optional _address = Optional.optional(nativeFromJson, nativeToJson); + Optional _city = Optional.optional(nativeFromJson, nativeToJson); + Optional _area = Optional.optional((data) => BusinessArea.values.byName(data), enumSerializer); + Optional _sector = Optional.optional((data) => BusinessSector.values.byName(data), enumSerializer); + Optional _rateGroup = Optional.optional((data) => BusinessRateGroup.values.byName(data), enumSerializer); + Optional _status = Optional.optional((data) => BusinessStatus.values.byName(data), enumSerializer); + Optional _notes = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateBusinessVariablesBuilder businessName(String? t) { + _businessName.value = t; + return this; + } + UpdateBusinessVariablesBuilder contactName(String? t) { + _contactName.value = t; + return this; + } + UpdateBusinessVariablesBuilder companyLogoUrl(String? t) { + _companyLogoUrl.value = t; + return this; + } + UpdateBusinessVariablesBuilder phone(String? t) { + _phone.value = t; + return this; + } + UpdateBusinessVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + UpdateBusinessVariablesBuilder hubBuilding(String? t) { + _hubBuilding.value = t; + return this; + } + UpdateBusinessVariablesBuilder address(String? t) { + _address.value = t; + return this; + } + UpdateBusinessVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + UpdateBusinessVariablesBuilder area(BusinessArea? t) { + _area.value = t; + return this; + } + UpdateBusinessVariablesBuilder sector(BusinessSector? t) { + _sector.value = t; + return this; + } + UpdateBusinessVariablesBuilder rateGroup(BusinessRateGroup? t) { + _rateGroup.value = t; + return this; + } + UpdateBusinessVariablesBuilder status(BusinessStatus? t) { + _status.value = t; + return this; + } + UpdateBusinessVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + + UpdateBusinessVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateBusinessData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateBusinessVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateBusinessVariables vars= UpdateBusinessVariables(id: id,businessName: _businessName,contactName: _contactName,companyLogoUrl: _companyLogoUrl,phone: _phone,email: _email,hubBuilding: _hubBuilding,address: _address,city: _city,area: _area,sector: _sector,rateGroup: _rateGroup,status: _status,notes: _notes,); + return _dataConnect.mutation("updateBusiness", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateBusinessBusinessUpdate { + final String id; + UpdateBusinessBusinessUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateBusinessBusinessUpdate otherTyped = other as UpdateBusinessBusinessUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateBusinessBusinessUpdate({ + required this.id, + }); +} + +@immutable +class UpdateBusinessData { + final UpdateBusinessBusinessUpdate? business_update; + UpdateBusinessData.fromJson(dynamic json): + + business_update = json['business_update'] == null ? null : UpdateBusinessBusinessUpdate.fromJson(json['business_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateBusinessData otherTyped = other as UpdateBusinessData; + return business_update == otherTyped.business_update; + + } + @override + int get hashCode => business_update.hashCode; + + + Map toJson() { + Map json = {}; + if (business_update != null) { + json['business_update'] = business_update!.toJson(); + } + return json; + } + + UpdateBusinessData({ + this.business_update, + }); +} + +@immutable +class UpdateBusinessVariables { + final String id; + late final OptionalbusinessName; + late final OptionalcontactName; + late final OptionalcompanyLogoUrl; + late final Optionalphone; + late final Optionalemail; + late final OptionalhubBuilding; + late final Optionaladdress; + late final Optionalcity; + late final Optionalarea; + late final Optionalsector; + late final OptionalrateGroup; + late final Optionalstatus; + late final Optionalnotes; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateBusinessVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + businessName = Optional.optional(nativeFromJson, nativeToJson); + businessName.value = json['businessName'] == null ? null : nativeFromJson(json['businessName']); + + + contactName = Optional.optional(nativeFromJson, nativeToJson); + contactName.value = json['contactName'] == null ? null : nativeFromJson(json['contactName']); + + + companyLogoUrl = Optional.optional(nativeFromJson, nativeToJson); + companyLogoUrl.value = json['companyLogoUrl'] == null ? null : nativeFromJson(json['companyLogoUrl']); + + + phone = Optional.optional(nativeFromJson, nativeToJson); + phone.value = json['phone'] == null ? null : nativeFromJson(json['phone']); + + + email = Optional.optional(nativeFromJson, nativeToJson); + email.value = json['email'] == null ? null : nativeFromJson(json['email']); + + + hubBuilding = Optional.optional(nativeFromJson, nativeToJson); + hubBuilding.value = json['hubBuilding'] == null ? null : nativeFromJson(json['hubBuilding']); + + + address = Optional.optional(nativeFromJson, nativeToJson); + address.value = json['address'] == null ? null : nativeFromJson(json['address']); + + + city = Optional.optional(nativeFromJson, nativeToJson); + city.value = json['city'] == null ? null : nativeFromJson(json['city']); + + + area = Optional.optional((data) => BusinessArea.values.byName(data), enumSerializer); + area.value = json['area'] == null ? null : BusinessArea.values.byName(json['area']); + + + sector = Optional.optional((data) => BusinessSector.values.byName(data), enumSerializer); + sector.value = json['sector'] == null ? null : BusinessSector.values.byName(json['sector']); + + + rateGroup = Optional.optional((data) => BusinessRateGroup.values.byName(data), enumSerializer); + rateGroup.value = json['rateGroup'] == null ? null : BusinessRateGroup.values.byName(json['rateGroup']); + + + status = Optional.optional((data) => BusinessStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : BusinessStatus.values.byName(json['status']); + + + notes = Optional.optional(nativeFromJson, nativeToJson); + notes.value = json['notes'] == null ? null : nativeFromJson(json['notes']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateBusinessVariables otherTyped = other as UpdateBusinessVariables; + return id == otherTyped.id && + businessName == otherTyped.businessName && + contactName == otherTyped.contactName && + companyLogoUrl == otherTyped.companyLogoUrl && + phone == otherTyped.phone && + email == otherTyped.email && + hubBuilding == otherTyped.hubBuilding && + address == otherTyped.address && + city == otherTyped.city && + area == otherTyped.area && + sector == otherTyped.sector && + rateGroup == otherTyped.rateGroup && + status == otherTyped.status && + notes == otherTyped.notes; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, contactName.hashCode, companyLogoUrl.hashCode, phone.hashCode, email.hashCode, hubBuilding.hashCode, address.hashCode, city.hashCode, area.hashCode, sector.hashCode, rateGroup.hashCode, status.hashCode, notes.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(businessName.state == OptionalState.set) { + json['businessName'] = businessName.toJson(); + } + if(contactName.state == OptionalState.set) { + json['contactName'] = contactName.toJson(); + } + if(companyLogoUrl.state == OptionalState.set) { + json['companyLogoUrl'] = companyLogoUrl.toJson(); + } + if(phone.state == OptionalState.set) { + json['phone'] = phone.toJson(); + } + if(email.state == OptionalState.set) { + json['email'] = email.toJson(); + } + if(hubBuilding.state == OptionalState.set) { + json['hubBuilding'] = hubBuilding.toJson(); + } + if(address.state == OptionalState.set) { + json['address'] = address.toJson(); + } + if(city.state == OptionalState.set) { + json['city'] = city.toJson(); + } + if(area.state == OptionalState.set) { + json['area'] = area.toJson(); + } + if(sector.state == OptionalState.set) { + json['sector'] = sector.toJson(); + } + if(rateGroup.state == OptionalState.set) { + json['rateGroup'] = rateGroup.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(notes.state == OptionalState.set) { + json['notes'] = notes.toJson(); + } + return json; + } + + UpdateBusinessVariables({ + required this.id, + required this.businessName, + required this.contactName, + required this.companyLogoUrl, + required this.phone, + required this.email, + required this.hubBuilding, + required this.address, + required this.city, + required this.area, + required this.sector, + required this.rateGroup, + required this.status, + required this.notes, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_category.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_category.dart new file mode 100644 index 00000000..1fdfde46 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_category.dart @@ -0,0 +1,172 @@ +part of 'generated.dart'; + +class UpdateCategoryVariablesBuilder { + String id; + Optional _categoryId = Optional.optional(nativeFromJson, nativeToJson); + Optional _label = Optional.optional(nativeFromJson, nativeToJson); + Optional _icon = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateCategoryVariablesBuilder categoryId(String? t) { + _categoryId.value = t; + return this; + } + UpdateCategoryVariablesBuilder label(String? t) { + _label.value = t; + return this; + } + UpdateCategoryVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + + UpdateCategoryVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateCategoryData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateCategoryVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateCategoryVariables vars= UpdateCategoryVariables(id: id,categoryId: _categoryId,label: _label,icon: _icon,); + return _dataConnect.mutation("updateCategory", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateCategoryCategoryUpdate { + final String id; + UpdateCategoryCategoryUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateCategoryCategoryUpdate otherTyped = other as UpdateCategoryCategoryUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateCategoryCategoryUpdate({ + required this.id, + }); +} + +@immutable +class UpdateCategoryData { + final UpdateCategoryCategoryUpdate? category_update; + UpdateCategoryData.fromJson(dynamic json): + + category_update = json['category_update'] == null ? null : UpdateCategoryCategoryUpdate.fromJson(json['category_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateCategoryData otherTyped = other as UpdateCategoryData; + return category_update == otherTyped.category_update; + + } + @override + int get hashCode => category_update.hashCode; + + + Map toJson() { + Map json = {}; + if (category_update != null) { + json['category_update'] = category_update!.toJson(); + } + return json; + } + + UpdateCategoryData({ + this.category_update, + }); +} + +@immutable +class UpdateCategoryVariables { + final String id; + late final OptionalcategoryId; + late final Optionallabel; + late final Optionalicon; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateCategoryVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + categoryId = Optional.optional(nativeFromJson, nativeToJson); + categoryId.value = json['categoryId'] == null ? null : nativeFromJson(json['categoryId']); + + + label = Optional.optional(nativeFromJson, nativeToJson); + label.value = json['label'] == null ? null : nativeFromJson(json['label']); + + + icon = Optional.optional(nativeFromJson, nativeToJson); + icon.value = json['icon'] == null ? null : nativeFromJson(json['icon']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateCategoryVariables otherTyped = other as UpdateCategoryVariables; + return id == otherTyped.id && + categoryId == otherTyped.categoryId && + label == otherTyped.label && + icon == otherTyped.icon; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, categoryId.hashCode, label.hashCode, icon.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(categoryId.state == OptionalState.set) { + json['categoryId'] = categoryId.toJson(); + } + if(label.state == OptionalState.set) { + json['label'] = label.toJson(); + } + if(icon.state == OptionalState.set) { + json['icon'] = icon.toJson(); + } + return json; + } + + UpdateCategoryVariables({ + required this.id, + required this.categoryId, + required this.label, + required this.icon, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_certificate.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_certificate.dart new file mode 100644 index 00000000..7dfc4207 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_certificate.dart @@ -0,0 +1,292 @@ +part of 'generated.dart'; + +class UpdateCertificateVariablesBuilder { + String id; + Optional _name = Optional.optional(nativeFromJson, nativeToJson); + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + Optional _expiry = Optional.optional((json) => json['expiry'] = Timestamp.fromJson(json['expiry']), defaultSerializer); + Optional _status = Optional.optional((data) => CertificateStatus.values.byName(data), enumSerializer); + Optional _fileUrl = Optional.optional(nativeFromJson, nativeToJson); + Optional _icon = Optional.optional(nativeFromJson, nativeToJson); + Optional _staffId = Optional.optional(nativeFromJson, nativeToJson); + Optional _certificationType = Optional.optional((data) => ComplianceType.values.byName(data), enumSerializer); + Optional _issuer = Optional.optional(nativeFromJson, nativeToJson); + Optional _validationStatus = Optional.optional((data) => ValidationStatus.values.byName(data), enumSerializer); + Optional _certificateNumber = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateCertificateVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateCertificateVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + UpdateCertificateVariablesBuilder expiry(Timestamp? t) { + _expiry.value = t; + return this; + } + UpdateCertificateVariablesBuilder status(CertificateStatus? t) { + _status.value = t; + return this; + } + UpdateCertificateVariablesBuilder fileUrl(String? t) { + _fileUrl.value = t; + return this; + } + UpdateCertificateVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + UpdateCertificateVariablesBuilder staffId(String? t) { + _staffId.value = t; + return this; + } + UpdateCertificateVariablesBuilder certificationType(ComplianceType? t) { + _certificationType.value = t; + return this; + } + UpdateCertificateVariablesBuilder issuer(String? t) { + _issuer.value = t; + return this; + } + UpdateCertificateVariablesBuilder validationStatus(ValidationStatus? t) { + _validationStatus.value = t; + return this; + } + UpdateCertificateVariablesBuilder certificateNumber(String? t) { + _certificateNumber.value = t; + return this; + } + + UpdateCertificateVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateCertificateData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateCertificateVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateCertificateVariables vars= UpdateCertificateVariables(id: id,name: _name,description: _description,expiry: _expiry,status: _status,fileUrl: _fileUrl,icon: _icon,staffId: _staffId,certificationType: _certificationType,issuer: _issuer,validationStatus: _validationStatus,certificateNumber: _certificateNumber,); + return _dataConnect.mutation("UpdateCertificate", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateCertificateCertificateUpdate { + final String id; + UpdateCertificateCertificateUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateCertificateCertificateUpdate otherTyped = other as UpdateCertificateCertificateUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateCertificateCertificateUpdate({ + required this.id, + }); +} + +@immutable +class UpdateCertificateData { + final UpdateCertificateCertificateUpdate? certificate_update; + UpdateCertificateData.fromJson(dynamic json): + + certificate_update = json['certificate_update'] == null ? null : UpdateCertificateCertificateUpdate.fromJson(json['certificate_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateCertificateData otherTyped = other as UpdateCertificateData; + return certificate_update == otherTyped.certificate_update; + + } + @override + int get hashCode => certificate_update.hashCode; + + + Map toJson() { + Map json = {}; + if (certificate_update != null) { + json['certificate_update'] = certificate_update!.toJson(); + } + return json; + } + + UpdateCertificateData({ + this.certificate_update, + }); +} + +@immutable +class UpdateCertificateVariables { + final String id; + late final Optionalname; + late final Optionaldescription; + late final Optionalexpiry; + late final Optionalstatus; + late final OptionalfileUrl; + late final Optionalicon; + late final OptionalstaffId; + late final OptionalcertificationType; + late final Optionalissuer; + late final OptionalvalidationStatus; + late final OptionalcertificateNumber; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateCertificateVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + name = Optional.optional(nativeFromJson, nativeToJson); + name.value = json['name'] == null ? null : nativeFromJson(json['name']); + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + + expiry = Optional.optional((json) => json['expiry'] = Timestamp.fromJson(json['expiry']), defaultSerializer); + expiry.value = json['expiry'] == null ? null : Timestamp.fromJson(json['expiry']); + + + status = Optional.optional((data) => CertificateStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : CertificateStatus.values.byName(json['status']); + + + fileUrl = Optional.optional(nativeFromJson, nativeToJson); + fileUrl.value = json['fileUrl'] == null ? null : nativeFromJson(json['fileUrl']); + + + icon = Optional.optional(nativeFromJson, nativeToJson); + icon.value = json['icon'] == null ? null : nativeFromJson(json['icon']); + + + staffId = Optional.optional(nativeFromJson, nativeToJson); + staffId.value = json['staffId'] == null ? null : nativeFromJson(json['staffId']); + + + certificationType = Optional.optional((data) => ComplianceType.values.byName(data), enumSerializer); + certificationType.value = json['certificationType'] == null ? null : ComplianceType.values.byName(json['certificationType']); + + + issuer = Optional.optional(nativeFromJson, nativeToJson); + issuer.value = json['issuer'] == null ? null : nativeFromJson(json['issuer']); + + + validationStatus = Optional.optional((data) => ValidationStatus.values.byName(data), enumSerializer); + validationStatus.value = json['validationStatus'] == null ? null : ValidationStatus.values.byName(json['validationStatus']); + + + certificateNumber = Optional.optional(nativeFromJson, nativeToJson); + certificateNumber.value = json['certificateNumber'] == null ? null : nativeFromJson(json['certificateNumber']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateCertificateVariables otherTyped = other as UpdateCertificateVariables; + return id == otherTyped.id && + name == otherTyped.name && + description == otherTyped.description && + expiry == otherTyped.expiry && + status == otherTyped.status && + fileUrl == otherTyped.fileUrl && + icon == otherTyped.icon && + staffId == otherTyped.staffId && + certificationType == otherTyped.certificationType && + issuer == otherTyped.issuer && + validationStatus == otherTyped.validationStatus && + certificateNumber == otherTyped.certificateNumber; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, description.hashCode, expiry.hashCode, status.hashCode, fileUrl.hashCode, icon.hashCode, staffId.hashCode, certificationType.hashCode, issuer.hashCode, validationStatus.hashCode, certificateNumber.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(name.state == OptionalState.set) { + json['name'] = name.toJson(); + } + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + if(expiry.state == OptionalState.set) { + json['expiry'] = expiry.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(fileUrl.state == OptionalState.set) { + json['fileUrl'] = fileUrl.toJson(); + } + if(icon.state == OptionalState.set) { + json['icon'] = icon.toJson(); + } + if(staffId.state == OptionalState.set) { + json['staffId'] = staffId.toJson(); + } + if(certificationType.state == OptionalState.set) { + json['certificationType'] = certificationType.toJson(); + } + if(issuer.state == OptionalState.set) { + json['issuer'] = issuer.toJson(); + } + if(validationStatus.state == OptionalState.set) { + json['validationStatus'] = validationStatus.toJson(); + } + if(certificateNumber.state == OptionalState.set) { + json['certificateNumber'] = certificateNumber.toJson(); + } + return json; + } + + UpdateCertificateVariables({ + required this.id, + required this.name, + required this.description, + required this.expiry, + required this.status, + required this.fileUrl, + required this.icon, + required this.staffId, + required this.certificationType, + required this.issuer, + required this.validationStatus, + required this.certificateNumber, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_client_feedback.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_client_feedback.dart new file mode 100644 index 00000000..4bb86003 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_client_feedback.dart @@ -0,0 +1,217 @@ +part of 'generated.dart'; + +class UpdateClientFeedbackVariablesBuilder { + String id; + Optional _businessId = Optional.optional(nativeFromJson, nativeToJson); + Optional _vendorId = Optional.optional(nativeFromJson, nativeToJson); + Optional _rating = Optional.optional(nativeFromJson, nativeToJson); + Optional _comment = Optional.optional(nativeFromJson, nativeToJson); + Optional _date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer); + Optional _createdBy = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateClientFeedbackVariablesBuilder businessId(String? t) { + _businessId.value = t; + return this; + } + UpdateClientFeedbackVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + UpdateClientFeedbackVariablesBuilder rating(int? t) { + _rating.value = t; + return this; + } + UpdateClientFeedbackVariablesBuilder comment(String? t) { + _comment.value = t; + return this; + } + UpdateClientFeedbackVariablesBuilder date(Timestamp? t) { + _date.value = t; + return this; + } + UpdateClientFeedbackVariablesBuilder createdBy(String? t) { + _createdBy.value = t; + return this; + } + + UpdateClientFeedbackVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateClientFeedbackData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateClientFeedbackVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateClientFeedbackVariables vars= UpdateClientFeedbackVariables(id: id,businessId: _businessId,vendorId: _vendorId,rating: _rating,comment: _comment,date: _date,createdBy: _createdBy,); + return _dataConnect.mutation("updateClientFeedback", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateClientFeedbackClientFeedbackUpdate { + final String id; + UpdateClientFeedbackClientFeedbackUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateClientFeedbackClientFeedbackUpdate otherTyped = other as UpdateClientFeedbackClientFeedbackUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateClientFeedbackClientFeedbackUpdate({ + required this.id, + }); +} + +@immutable +class UpdateClientFeedbackData { + final UpdateClientFeedbackClientFeedbackUpdate? clientFeedback_update; + UpdateClientFeedbackData.fromJson(dynamic json): + + clientFeedback_update = json['clientFeedback_update'] == null ? null : UpdateClientFeedbackClientFeedbackUpdate.fromJson(json['clientFeedback_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateClientFeedbackData otherTyped = other as UpdateClientFeedbackData; + return clientFeedback_update == otherTyped.clientFeedback_update; + + } + @override + int get hashCode => clientFeedback_update.hashCode; + + + Map toJson() { + Map json = {}; + if (clientFeedback_update != null) { + json['clientFeedback_update'] = clientFeedback_update!.toJson(); + } + return json; + } + + UpdateClientFeedbackData({ + this.clientFeedback_update, + }); +} + +@immutable +class UpdateClientFeedbackVariables { + final String id; + late final OptionalbusinessId; + late final OptionalvendorId; + late final Optionalrating; + late final Optionalcomment; + late final Optionaldate; + late final OptionalcreatedBy; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateClientFeedbackVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + businessId = Optional.optional(nativeFromJson, nativeToJson); + businessId.value = json['businessId'] == null ? null : nativeFromJson(json['businessId']); + + + vendorId = Optional.optional(nativeFromJson, nativeToJson); + vendorId.value = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + + + rating = Optional.optional(nativeFromJson, nativeToJson); + rating.value = json['rating'] == null ? null : nativeFromJson(json['rating']); + + + comment = Optional.optional(nativeFromJson, nativeToJson); + comment.value = json['comment'] == null ? null : nativeFromJson(json['comment']); + + + date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer); + date.value = json['date'] == null ? null : Timestamp.fromJson(json['date']); + + + createdBy = Optional.optional(nativeFromJson, nativeToJson); + createdBy.value = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateClientFeedbackVariables otherTyped = other as UpdateClientFeedbackVariables; + return id == otherTyped.id && + businessId == otherTyped.businessId && + vendorId == otherTyped.vendorId && + rating == otherTyped.rating && + comment == otherTyped.comment && + date == otherTyped.date && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, businessId.hashCode, vendorId.hashCode, rating.hashCode, comment.hashCode, date.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(businessId.state == OptionalState.set) { + json['businessId'] = businessId.toJson(); + } + if(vendorId.state == OptionalState.set) { + json['vendorId'] = vendorId.toJson(); + } + if(rating.state == OptionalState.set) { + json['rating'] = rating.toJson(); + } + if(comment.state == OptionalState.set) { + json['comment'] = comment.toJson(); + } + if(date.state == OptionalState.set) { + json['date'] = date.toJson(); + } + if(createdBy.state == OptionalState.set) { + json['createdBy'] = createdBy.toJson(); + } + return json; + } + + UpdateClientFeedbackVariables({ + required this.id, + required this.businessId, + required this.vendorId, + required this.rating, + required this.comment, + required this.date, + required this.createdBy, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_conversation.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_conversation.dart new file mode 100644 index 00000000..8b89f213 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_conversation.dart @@ -0,0 +1,232 @@ +part of 'generated.dart'; + +class UpdateConversationVariablesBuilder { + String id; + Optional _subject = Optional.optional(nativeFromJson, nativeToJson); + Optional _status = Optional.optional((data) => ConversationStatus.values.byName(data), enumSerializer); + Optional _conversationType = Optional.optional((data) => ConversationType.values.byName(data), enumSerializer); + Optional _isGroup = Optional.optional(nativeFromJson, nativeToJson); + Optional _groupName = Optional.optional(nativeFromJson, nativeToJson); + Optional _lastMessage = Optional.optional(nativeFromJson, nativeToJson); + Optional _lastMessageAt = Optional.optional((json) => json['lastMessageAt'] = Timestamp.fromJson(json['lastMessageAt']), defaultSerializer); + + final FirebaseDataConnect _dataConnect; UpdateConversationVariablesBuilder subject(String? t) { + _subject.value = t; + return this; + } + UpdateConversationVariablesBuilder status(ConversationStatus? t) { + _status.value = t; + return this; + } + UpdateConversationVariablesBuilder conversationType(ConversationType? t) { + _conversationType.value = t; + return this; + } + UpdateConversationVariablesBuilder isGroup(bool? t) { + _isGroup.value = t; + return this; + } + UpdateConversationVariablesBuilder groupName(String? t) { + _groupName.value = t; + return this; + } + UpdateConversationVariablesBuilder lastMessage(String? t) { + _lastMessage.value = t; + return this; + } + UpdateConversationVariablesBuilder lastMessageAt(Timestamp? t) { + _lastMessageAt.value = t; + return this; + } + + UpdateConversationVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateConversationData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateConversationVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateConversationVariables vars= UpdateConversationVariables(id: id,subject: _subject,status: _status,conversationType: _conversationType,isGroup: _isGroup,groupName: _groupName,lastMessage: _lastMessage,lastMessageAt: _lastMessageAt,); + return _dataConnect.mutation("updateConversation", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateConversationConversationUpdate { + final String id; + UpdateConversationConversationUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateConversationConversationUpdate otherTyped = other as UpdateConversationConversationUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateConversationConversationUpdate({ + required this.id, + }); +} + +@immutable +class UpdateConversationData { + final UpdateConversationConversationUpdate? conversation_update; + UpdateConversationData.fromJson(dynamic json): + + conversation_update = json['conversation_update'] == null ? null : UpdateConversationConversationUpdate.fromJson(json['conversation_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateConversationData otherTyped = other as UpdateConversationData; + return conversation_update == otherTyped.conversation_update; + + } + @override + int get hashCode => conversation_update.hashCode; + + + Map toJson() { + Map json = {}; + if (conversation_update != null) { + json['conversation_update'] = conversation_update!.toJson(); + } + return json; + } + + UpdateConversationData({ + this.conversation_update, + }); +} + +@immutable +class UpdateConversationVariables { + final String id; + late final Optionalsubject; + late final Optionalstatus; + late final OptionalconversationType; + late final OptionalisGroup; + late final OptionalgroupName; + late final OptionallastMessage; + late final OptionallastMessageAt; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateConversationVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + subject = Optional.optional(nativeFromJson, nativeToJson); + subject.value = json['subject'] == null ? null : nativeFromJson(json['subject']); + + + status = Optional.optional((data) => ConversationStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : ConversationStatus.values.byName(json['status']); + + + conversationType = Optional.optional((data) => ConversationType.values.byName(data), enumSerializer); + conversationType.value = json['conversationType'] == null ? null : ConversationType.values.byName(json['conversationType']); + + + isGroup = Optional.optional(nativeFromJson, nativeToJson); + isGroup.value = json['isGroup'] == null ? null : nativeFromJson(json['isGroup']); + + + groupName = Optional.optional(nativeFromJson, nativeToJson); + groupName.value = json['groupName'] == null ? null : nativeFromJson(json['groupName']); + + + lastMessage = Optional.optional(nativeFromJson, nativeToJson); + lastMessage.value = json['lastMessage'] == null ? null : nativeFromJson(json['lastMessage']); + + + lastMessageAt = Optional.optional((json) => json['lastMessageAt'] = Timestamp.fromJson(json['lastMessageAt']), defaultSerializer); + lastMessageAt.value = json['lastMessageAt'] == null ? null : Timestamp.fromJson(json['lastMessageAt']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateConversationVariables otherTyped = other as UpdateConversationVariables; + return id == otherTyped.id && + subject == otherTyped.subject && + status == otherTyped.status && + conversationType == otherTyped.conversationType && + isGroup == otherTyped.isGroup && + groupName == otherTyped.groupName && + lastMessage == otherTyped.lastMessage && + lastMessageAt == otherTyped.lastMessageAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, subject.hashCode, status.hashCode, conversationType.hashCode, isGroup.hashCode, groupName.hashCode, lastMessage.hashCode, lastMessageAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(subject.state == OptionalState.set) { + json['subject'] = subject.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(conversationType.state == OptionalState.set) { + json['conversationType'] = conversationType.toJson(); + } + if(isGroup.state == OptionalState.set) { + json['isGroup'] = isGroup.toJson(); + } + if(groupName.state == OptionalState.set) { + json['groupName'] = groupName.toJson(); + } + if(lastMessage.state == OptionalState.set) { + json['lastMessage'] = lastMessage.toJson(); + } + if(lastMessageAt.state == OptionalState.set) { + json['lastMessageAt'] = lastMessageAt.toJson(); + } + return json; + } + + UpdateConversationVariables({ + required this.id, + required this.subject, + required this.status, + required this.conversationType, + required this.isGroup, + required this.groupName, + required this.lastMessage, + required this.lastMessageAt, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_conversation_last_message.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_conversation_last_message.dart new file mode 100644 index 00000000..8ca20bac --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_conversation_last_message.dart @@ -0,0 +1,157 @@ +part of 'generated.dart'; + +class UpdateConversationLastMessageVariablesBuilder { + String id; + Optional _lastMessage = Optional.optional(nativeFromJson, nativeToJson); + Optional _lastMessageAt = Optional.optional((json) => json['lastMessageAt'] = Timestamp.fromJson(json['lastMessageAt']), defaultSerializer); + + final FirebaseDataConnect _dataConnect; UpdateConversationLastMessageVariablesBuilder lastMessage(String? t) { + _lastMessage.value = t; + return this; + } + UpdateConversationLastMessageVariablesBuilder lastMessageAt(Timestamp? t) { + _lastMessageAt.value = t; + return this; + } + + UpdateConversationLastMessageVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateConversationLastMessageData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateConversationLastMessageVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateConversationLastMessageVariables vars= UpdateConversationLastMessageVariables(id: id,lastMessage: _lastMessage,lastMessageAt: _lastMessageAt,); + return _dataConnect.mutation("updateConversationLastMessage", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateConversationLastMessageConversationUpdate { + final String id; + UpdateConversationLastMessageConversationUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateConversationLastMessageConversationUpdate otherTyped = other as UpdateConversationLastMessageConversationUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateConversationLastMessageConversationUpdate({ + required this.id, + }); +} + +@immutable +class UpdateConversationLastMessageData { + final UpdateConversationLastMessageConversationUpdate? conversation_update; + UpdateConversationLastMessageData.fromJson(dynamic json): + + conversation_update = json['conversation_update'] == null ? null : UpdateConversationLastMessageConversationUpdate.fromJson(json['conversation_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateConversationLastMessageData otherTyped = other as UpdateConversationLastMessageData; + return conversation_update == otherTyped.conversation_update; + + } + @override + int get hashCode => conversation_update.hashCode; + + + Map toJson() { + Map json = {}; + if (conversation_update != null) { + json['conversation_update'] = conversation_update!.toJson(); + } + return json; + } + + UpdateConversationLastMessageData({ + this.conversation_update, + }); +} + +@immutable +class UpdateConversationLastMessageVariables { + final String id; + late final OptionallastMessage; + late final OptionallastMessageAt; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateConversationLastMessageVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + lastMessage = Optional.optional(nativeFromJson, nativeToJson); + lastMessage.value = json['lastMessage'] == null ? null : nativeFromJson(json['lastMessage']); + + + lastMessageAt = Optional.optional((json) => json['lastMessageAt'] = Timestamp.fromJson(json['lastMessageAt']), defaultSerializer); + lastMessageAt.value = json['lastMessageAt'] == null ? null : Timestamp.fromJson(json['lastMessageAt']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateConversationLastMessageVariables otherTyped = other as UpdateConversationLastMessageVariables; + return id == otherTyped.id && + lastMessage == otherTyped.lastMessage && + lastMessageAt == otherTyped.lastMessageAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, lastMessage.hashCode, lastMessageAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(lastMessage.state == OptionalState.set) { + json['lastMessage'] = lastMessage.toJson(); + } + if(lastMessageAt.state == OptionalState.set) { + json['lastMessageAt'] = lastMessageAt.toJson(); + } + return json; + } + + UpdateConversationLastMessageVariables({ + required this.id, + required this.lastMessage, + required this.lastMessageAt, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_course.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_course.dart new file mode 100644 index 00000000..5d45c7d6 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_course.dart @@ -0,0 +1,239 @@ +part of 'generated.dart'; + +class UpdateCourseVariablesBuilder { + String id; + Optional _title = Optional.optional(nativeFromJson, nativeToJson); + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + Optional _thumbnailUrl = Optional.optional(nativeFromJson, nativeToJson); + Optional _durationMinutes = Optional.optional(nativeFromJson, nativeToJson); + Optional _xpReward = Optional.optional(nativeFromJson, nativeToJson); + String categoryId; + Optional _levelRequired = Optional.optional(nativeFromJson, nativeToJson); + Optional _isCertification = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateCourseVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + UpdateCourseVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + UpdateCourseVariablesBuilder thumbnailUrl(String? t) { + _thumbnailUrl.value = t; + return this; + } + UpdateCourseVariablesBuilder durationMinutes(int? t) { + _durationMinutes.value = t; + return this; + } + UpdateCourseVariablesBuilder xpReward(int? t) { + _xpReward.value = t; + return this; + } + UpdateCourseVariablesBuilder levelRequired(String? t) { + _levelRequired.value = t; + return this; + } + UpdateCourseVariablesBuilder isCertification(bool? t) { + _isCertification.value = t; + return this; + } + + UpdateCourseVariablesBuilder(this._dataConnect, {required this.id,required this.categoryId,}); + Deserializer dataDeserializer = (dynamic json) => UpdateCourseData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateCourseVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateCourseVariables vars= UpdateCourseVariables(id: id,title: _title,description: _description,thumbnailUrl: _thumbnailUrl,durationMinutes: _durationMinutes,xpReward: _xpReward,categoryId: categoryId,levelRequired: _levelRequired,isCertification: _isCertification,); + return _dataConnect.mutation("updateCourse", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateCourseCourseUpdate { + final String id; + UpdateCourseCourseUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateCourseCourseUpdate otherTyped = other as UpdateCourseCourseUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateCourseCourseUpdate({ + required this.id, + }); +} + +@immutable +class UpdateCourseData { + final UpdateCourseCourseUpdate? course_update; + UpdateCourseData.fromJson(dynamic json): + + course_update = json['course_update'] == null ? null : UpdateCourseCourseUpdate.fromJson(json['course_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateCourseData otherTyped = other as UpdateCourseData; + return course_update == otherTyped.course_update; + + } + @override + int get hashCode => course_update.hashCode; + + + Map toJson() { + Map json = {}; + if (course_update != null) { + json['course_update'] = course_update!.toJson(); + } + return json; + } + + UpdateCourseData({ + this.course_update, + }); +} + +@immutable +class UpdateCourseVariables { + final String id; + late final Optionaltitle; + late final Optionaldescription; + late final OptionalthumbnailUrl; + late final OptionaldurationMinutes; + late final OptionalxpReward; + final String categoryId; + late final OptionallevelRequired; + late final OptionalisCertification; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateCourseVariables.fromJson(Map json): + + id = nativeFromJson(json['id']), + categoryId = nativeFromJson(json['categoryId']) { + + + + title = Optional.optional(nativeFromJson, nativeToJson); + title.value = json['title'] == null ? null : nativeFromJson(json['title']); + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + + thumbnailUrl = Optional.optional(nativeFromJson, nativeToJson); + thumbnailUrl.value = json['thumbnailUrl'] == null ? null : nativeFromJson(json['thumbnailUrl']); + + + durationMinutes = Optional.optional(nativeFromJson, nativeToJson); + durationMinutes.value = json['durationMinutes'] == null ? null : nativeFromJson(json['durationMinutes']); + + + xpReward = Optional.optional(nativeFromJson, nativeToJson); + xpReward.value = json['xpReward'] == null ? null : nativeFromJson(json['xpReward']); + + + + levelRequired = Optional.optional(nativeFromJson, nativeToJson); + levelRequired.value = json['levelRequired'] == null ? null : nativeFromJson(json['levelRequired']); + + + isCertification = Optional.optional(nativeFromJson, nativeToJson); + isCertification.value = json['isCertification'] == null ? null : nativeFromJson(json['isCertification']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateCourseVariables otherTyped = other as UpdateCourseVariables; + return id == otherTyped.id && + title == otherTyped.title && + description == otherTyped.description && + thumbnailUrl == otherTyped.thumbnailUrl && + durationMinutes == otherTyped.durationMinutes && + xpReward == otherTyped.xpReward && + categoryId == otherTyped.categoryId && + levelRequired == otherTyped.levelRequired && + isCertification == otherTyped.isCertification; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, description.hashCode, thumbnailUrl.hashCode, durationMinutes.hashCode, xpReward.hashCode, categoryId.hashCode, levelRequired.hashCode, isCertification.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(title.state == OptionalState.set) { + json['title'] = title.toJson(); + } + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + if(thumbnailUrl.state == OptionalState.set) { + json['thumbnailUrl'] = thumbnailUrl.toJson(); + } + if(durationMinutes.state == OptionalState.set) { + json['durationMinutes'] = durationMinutes.toJson(); + } + if(xpReward.state == OptionalState.set) { + json['xpReward'] = xpReward.toJson(); + } + json['categoryId'] = nativeToJson(categoryId); + if(levelRequired.state == OptionalState.set) { + json['levelRequired'] = levelRequired.toJson(); + } + if(isCertification.state == OptionalState.set) { + json['isCertification'] = isCertification.toJson(); + } + return json; + } + + UpdateCourseVariables({ + required this.id, + required this.title, + required this.description, + required this.thumbnailUrl, + required this.durationMinutes, + required this.xpReward, + required this.categoryId, + required this.levelRequired, + required this.isCertification, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_custom_rate_card.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_custom_rate_card.dart new file mode 100644 index 00000000..4b70966a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_custom_rate_card.dart @@ -0,0 +1,187 @@ +part of 'generated.dart'; + +class UpdateCustomRateCardVariablesBuilder { + String id; + Optional _name = Optional.optional(nativeFromJson, nativeToJson); + Optional _baseBook = Optional.optional(nativeFromJson, nativeToJson); + Optional _discount = Optional.optional(nativeFromJson, nativeToJson); + Optional _isDefault = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateCustomRateCardVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateCustomRateCardVariablesBuilder baseBook(String? t) { + _baseBook.value = t; + return this; + } + UpdateCustomRateCardVariablesBuilder discount(double? t) { + _discount.value = t; + return this; + } + UpdateCustomRateCardVariablesBuilder isDefault(bool? t) { + _isDefault.value = t; + return this; + } + + UpdateCustomRateCardVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateCustomRateCardData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateCustomRateCardVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateCustomRateCardVariables vars= UpdateCustomRateCardVariables(id: id,name: _name,baseBook: _baseBook,discount: _discount,isDefault: _isDefault,); + return _dataConnect.mutation("updateCustomRateCard", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateCustomRateCardCustomRateCardUpdate { + final String id; + UpdateCustomRateCardCustomRateCardUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateCustomRateCardCustomRateCardUpdate otherTyped = other as UpdateCustomRateCardCustomRateCardUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateCustomRateCardCustomRateCardUpdate({ + required this.id, + }); +} + +@immutable +class UpdateCustomRateCardData { + final UpdateCustomRateCardCustomRateCardUpdate? customRateCard_update; + UpdateCustomRateCardData.fromJson(dynamic json): + + customRateCard_update = json['customRateCard_update'] == null ? null : UpdateCustomRateCardCustomRateCardUpdate.fromJson(json['customRateCard_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateCustomRateCardData otherTyped = other as UpdateCustomRateCardData; + return customRateCard_update == otherTyped.customRateCard_update; + + } + @override + int get hashCode => customRateCard_update.hashCode; + + + Map toJson() { + Map json = {}; + if (customRateCard_update != null) { + json['customRateCard_update'] = customRateCard_update!.toJson(); + } + return json; + } + + UpdateCustomRateCardData({ + this.customRateCard_update, + }); +} + +@immutable +class UpdateCustomRateCardVariables { + final String id; + late final Optionalname; + late final OptionalbaseBook; + late final Optionaldiscount; + late final OptionalisDefault; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateCustomRateCardVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + name = Optional.optional(nativeFromJson, nativeToJson); + name.value = json['name'] == null ? null : nativeFromJson(json['name']); + + + baseBook = Optional.optional(nativeFromJson, nativeToJson); + baseBook.value = json['baseBook'] == null ? null : nativeFromJson(json['baseBook']); + + + discount = Optional.optional(nativeFromJson, nativeToJson); + discount.value = json['discount'] == null ? null : nativeFromJson(json['discount']); + + + isDefault = Optional.optional(nativeFromJson, nativeToJson); + isDefault.value = json['isDefault'] == null ? null : nativeFromJson(json['isDefault']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateCustomRateCardVariables otherTyped = other as UpdateCustomRateCardVariables; + return id == otherTyped.id && + name == otherTyped.name && + baseBook == otherTyped.baseBook && + discount == otherTyped.discount && + isDefault == otherTyped.isDefault; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, baseBook.hashCode, discount.hashCode, isDefault.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(name.state == OptionalState.set) { + json['name'] = name.toJson(); + } + if(baseBook.state == OptionalState.set) { + json['baseBook'] = baseBook.toJson(); + } + if(discount.state == OptionalState.set) { + json['discount'] = discount.toJson(); + } + if(isDefault.state == OptionalState.set) { + json['isDefault'] = isDefault.toJson(); + } + return json; + } + + UpdateCustomRateCardVariables({ + required this.id, + required this.name, + required this.baseBook, + required this.discount, + required this.isDefault, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_document.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_document.dart new file mode 100644 index 00000000..ab803a9b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_document.dart @@ -0,0 +1,172 @@ +part of 'generated.dart'; + +class UpdateDocumentVariablesBuilder { + String id; + Optional _documentType = Optional.optional((data) => DocumentType.values.byName(data), enumSerializer); + Optional _name = Optional.optional(nativeFromJson, nativeToJson); + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateDocumentVariablesBuilder documentType(DocumentType? t) { + _documentType.value = t; + return this; + } + UpdateDocumentVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateDocumentVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + + UpdateDocumentVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateDocumentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateDocumentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateDocumentVariables vars= UpdateDocumentVariables(id: id,documentType: _documentType,name: _name,description: _description,); + return _dataConnect.mutation("updateDocument", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateDocumentDocumentUpdate { + final String id; + UpdateDocumentDocumentUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateDocumentDocumentUpdate otherTyped = other as UpdateDocumentDocumentUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateDocumentDocumentUpdate({ + required this.id, + }); +} + +@immutable +class UpdateDocumentData { + final UpdateDocumentDocumentUpdate? document_update; + UpdateDocumentData.fromJson(dynamic json): + + document_update = json['document_update'] == null ? null : UpdateDocumentDocumentUpdate.fromJson(json['document_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateDocumentData otherTyped = other as UpdateDocumentData; + return document_update == otherTyped.document_update; + + } + @override + int get hashCode => document_update.hashCode; + + + Map toJson() { + Map json = {}; + if (document_update != null) { + json['document_update'] = document_update!.toJson(); + } + return json; + } + + UpdateDocumentData({ + this.document_update, + }); +} + +@immutable +class UpdateDocumentVariables { + final String id; + late final OptionaldocumentType; + late final Optionalname; + late final Optionaldescription; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateDocumentVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + documentType = Optional.optional((data) => DocumentType.values.byName(data), enumSerializer); + documentType.value = json['documentType'] == null ? null : DocumentType.values.byName(json['documentType']); + + + name = Optional.optional(nativeFromJson, nativeToJson); + name.value = json['name'] == null ? null : nativeFromJson(json['name']); + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateDocumentVariables otherTyped = other as UpdateDocumentVariables; + return id == otherTyped.id && + documentType == otherTyped.documentType && + name == otherTyped.name && + description == otherTyped.description; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, documentType.hashCode, name.hashCode, description.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(documentType.state == OptionalState.set) { + json['documentType'] = documentType.toJson(); + } + if(name.state == OptionalState.set) { + json['name'] = name.toJson(); + } + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + return json; + } + + UpdateDocumentVariables({ + required this.id, + required this.documentType, + required this.name, + required this.description, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_emergency_contact.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_emergency_contact.dart new file mode 100644 index 00000000..88642214 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_emergency_contact.dart @@ -0,0 +1,172 @@ +part of 'generated.dart'; + +class UpdateEmergencyContactVariablesBuilder { + String id; + Optional _name = Optional.optional(nativeFromJson, nativeToJson); + Optional _phone = Optional.optional(nativeFromJson, nativeToJson); + Optional _relationship = Optional.optional((data) => RelationshipType.values.byName(data), enumSerializer); + + final FirebaseDataConnect _dataConnect; UpdateEmergencyContactVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateEmergencyContactVariablesBuilder phone(String? t) { + _phone.value = t; + return this; + } + UpdateEmergencyContactVariablesBuilder relationship(RelationshipType? t) { + _relationship.value = t; + return this; + } + + UpdateEmergencyContactVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateEmergencyContactData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateEmergencyContactVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateEmergencyContactVariables vars= UpdateEmergencyContactVariables(id: id,name: _name,phone: _phone,relationship: _relationship,); + return _dataConnect.mutation("updateEmergencyContact", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateEmergencyContactEmergencyContactUpdate { + final String id; + UpdateEmergencyContactEmergencyContactUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateEmergencyContactEmergencyContactUpdate otherTyped = other as UpdateEmergencyContactEmergencyContactUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateEmergencyContactEmergencyContactUpdate({ + required this.id, + }); +} + +@immutable +class UpdateEmergencyContactData { + final UpdateEmergencyContactEmergencyContactUpdate? emergencyContact_update; + UpdateEmergencyContactData.fromJson(dynamic json): + + emergencyContact_update = json['emergencyContact_update'] == null ? null : UpdateEmergencyContactEmergencyContactUpdate.fromJson(json['emergencyContact_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateEmergencyContactData otherTyped = other as UpdateEmergencyContactData; + return emergencyContact_update == otherTyped.emergencyContact_update; + + } + @override + int get hashCode => emergencyContact_update.hashCode; + + + Map toJson() { + Map json = {}; + if (emergencyContact_update != null) { + json['emergencyContact_update'] = emergencyContact_update!.toJson(); + } + return json; + } + + UpdateEmergencyContactData({ + this.emergencyContact_update, + }); +} + +@immutable +class UpdateEmergencyContactVariables { + final String id; + late final Optionalname; + late final Optionalphone; + late final Optionalrelationship; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateEmergencyContactVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + name = Optional.optional(nativeFromJson, nativeToJson); + name.value = json['name'] == null ? null : nativeFromJson(json['name']); + + + phone = Optional.optional(nativeFromJson, nativeToJson); + phone.value = json['phone'] == null ? null : nativeFromJson(json['phone']); + + + relationship = Optional.optional((data) => RelationshipType.values.byName(data), enumSerializer); + relationship.value = json['relationship'] == null ? null : RelationshipType.values.byName(json['relationship']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateEmergencyContactVariables otherTyped = other as UpdateEmergencyContactVariables; + return id == otherTyped.id && + name == otherTyped.name && + phone == otherTyped.phone && + relationship == otherTyped.relationship; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, phone.hashCode, relationship.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(name.state == OptionalState.set) { + json['name'] = name.toJson(); + } + if(phone.state == OptionalState.set) { + json['phone'] = phone.toJson(); + } + if(relationship.state == OptionalState.set) { + json['relationship'] = relationship.toJson(); + } + return json; + } + + UpdateEmergencyContactVariables({ + required this.id, + required this.name, + required this.phone, + required this.relationship, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_faq_data.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_faq_data.dart new file mode 100644 index 00000000..ec75f99a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_faq_data.dart @@ -0,0 +1,159 @@ +part of 'generated.dart'; + +class UpdateFaqDataVariablesBuilder { + String id; + Optional _category = Optional.optional(nativeFromJson, nativeToJson); + Optional> _questions = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer)); + + final FirebaseDataConnect _dataConnect; UpdateFaqDataVariablesBuilder category(String? t) { + _category.value = t; + return this; + } + UpdateFaqDataVariablesBuilder questions(List? t) { + _questions.value = t; + return this; + } + + UpdateFaqDataVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateFaqDataData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateFaqDataVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateFaqDataVariables vars= UpdateFaqDataVariables(id: id,category: _category,questions: _questions,); + return _dataConnect.mutation("updateFaqData", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateFaqDataFaqDataUpdate { + final String id; + UpdateFaqDataFaqDataUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateFaqDataFaqDataUpdate otherTyped = other as UpdateFaqDataFaqDataUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateFaqDataFaqDataUpdate({ + required this.id, + }); +} + +@immutable +class UpdateFaqDataData { + final UpdateFaqDataFaqDataUpdate? faqData_update; + UpdateFaqDataData.fromJson(dynamic json): + + faqData_update = json['faqData_update'] == null ? null : UpdateFaqDataFaqDataUpdate.fromJson(json['faqData_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateFaqDataData otherTyped = other as UpdateFaqDataData; + return faqData_update == otherTyped.faqData_update; + + } + @override + int get hashCode => faqData_update.hashCode; + + + Map toJson() { + Map json = {}; + if (faqData_update != null) { + json['faqData_update'] = faqData_update!.toJson(); + } + return json; + } + + UpdateFaqDataData({ + this.faqData_update, + }); +} + +@immutable +class UpdateFaqDataVariables { + final String id; + late final Optionalcategory; + late final Optional>questions; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateFaqDataVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + category = Optional.optional(nativeFromJson, nativeToJson); + category.value = json['category'] == null ? null : nativeFromJson(json['category']); + + + questions = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer)); + questions.value = json['questions'] == null ? null : (json['questions'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateFaqDataVariables otherTyped = other as UpdateFaqDataVariables; + return id == otherTyped.id && + category == otherTyped.category && + questions == otherTyped.questions; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, category.hashCode, questions.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(category.state == OptionalState.set) { + json['category'] = category.toJson(); + } + if(questions.state == OptionalState.set) { + json['questions'] = questions.toJson(); + } + return json; + } + + UpdateFaqDataVariables({ + required this.id, + required this.category, + required this.questions, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_hub.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_hub.dart new file mode 100644 index 00000000..76fd54b9 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_hub.dart @@ -0,0 +1,202 @@ +part of 'generated.dart'; + +class UpdateHubVariablesBuilder { + String id; + Optional _name = Optional.optional(nativeFromJson, nativeToJson); + Optional _locationName = Optional.optional(nativeFromJson, nativeToJson); + Optional _address = Optional.optional(nativeFromJson, nativeToJson); + Optional _nfcTagId = Optional.optional(nativeFromJson, nativeToJson); + Optional _ownerId = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateHubVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateHubVariablesBuilder locationName(String? t) { + _locationName.value = t; + return this; + } + UpdateHubVariablesBuilder address(String? t) { + _address.value = t; + return this; + } + UpdateHubVariablesBuilder nfcTagId(String? t) { + _nfcTagId.value = t; + return this; + } + UpdateHubVariablesBuilder ownerId(String? t) { + _ownerId.value = t; + return this; + } + + UpdateHubVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateHubData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateHubVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateHubVariables vars= UpdateHubVariables(id: id,name: _name,locationName: _locationName,address: _address,nfcTagId: _nfcTagId,ownerId: _ownerId,); + return _dataConnect.mutation("updateHub", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateHubHubUpdate { + final String id; + UpdateHubHubUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateHubHubUpdate otherTyped = other as UpdateHubHubUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateHubHubUpdate({ + required this.id, + }); +} + +@immutable +class UpdateHubData { + final UpdateHubHubUpdate? hub_update; + UpdateHubData.fromJson(dynamic json): + + hub_update = json['hub_update'] == null ? null : UpdateHubHubUpdate.fromJson(json['hub_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateHubData otherTyped = other as UpdateHubData; + return hub_update == otherTyped.hub_update; + + } + @override + int get hashCode => hub_update.hashCode; + + + Map toJson() { + Map json = {}; + if (hub_update != null) { + json['hub_update'] = hub_update!.toJson(); + } + return json; + } + + UpdateHubData({ + this.hub_update, + }); +} + +@immutable +class UpdateHubVariables { + final String id; + late final Optionalname; + late final OptionallocationName; + late final Optionaladdress; + late final OptionalnfcTagId; + late final OptionalownerId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateHubVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + name = Optional.optional(nativeFromJson, nativeToJson); + name.value = json['name'] == null ? null : nativeFromJson(json['name']); + + + locationName = Optional.optional(nativeFromJson, nativeToJson); + locationName.value = json['locationName'] == null ? null : nativeFromJson(json['locationName']); + + + address = Optional.optional(nativeFromJson, nativeToJson); + address.value = json['address'] == null ? null : nativeFromJson(json['address']); + + + nfcTagId = Optional.optional(nativeFromJson, nativeToJson); + nfcTagId.value = json['nfcTagId'] == null ? null : nativeFromJson(json['nfcTagId']); + + + ownerId = Optional.optional(nativeFromJson, nativeToJson); + ownerId.value = json['ownerId'] == null ? null : nativeFromJson(json['ownerId']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateHubVariables otherTyped = other as UpdateHubVariables; + return id == otherTyped.id && + name == otherTyped.name && + locationName == otherTyped.locationName && + address == otherTyped.address && + nfcTagId == otherTyped.nfcTagId && + ownerId == otherTyped.ownerId; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, locationName.hashCode, address.hashCode, nfcTagId.hashCode, ownerId.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(name.state == OptionalState.set) { + json['name'] = name.toJson(); + } + if(locationName.state == OptionalState.set) { + json['locationName'] = locationName.toJson(); + } + if(address.state == OptionalState.set) { + json['address'] = address.toJson(); + } + if(nfcTagId.state == OptionalState.set) { + json['nfcTagId'] = nfcTagId.toJson(); + } + if(ownerId.state == OptionalState.set) { + json['ownerId'] = ownerId.toJson(); + } + return json; + } + + UpdateHubVariables({ + required this.id, + required this.name, + required this.locationName, + required this.address, + required this.nfcTagId, + required this.ownerId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_invoice.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_invoice.dart new file mode 100644 index 00000000..8cdc5a81 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_invoice.dart @@ -0,0 +1,457 @@ +part of 'generated.dart'; + +class UpdateInvoiceVariablesBuilder { + String id; + Optional _status = Optional.optional((data) => InvoiceStatus.values.byName(data), enumSerializer); + Optional _vendorId = Optional.optional(nativeFromJson, nativeToJson); + Optional _businessId = Optional.optional(nativeFromJson, nativeToJson); + Optional _orderId = Optional.optional(nativeFromJson, nativeToJson); + Optional _paymentTerms = Optional.optional((data) => InovicePaymentTerms.values.byName(data), enumSerializer); + Optional _invoiceNumber = Optional.optional(nativeFromJson, nativeToJson); + Optional _issueDate = Optional.optional((json) => json['issueDate'] = Timestamp.fromJson(json['issueDate']), defaultSerializer); + Optional _dueDate = Optional.optional((json) => json['dueDate'] = Timestamp.fromJson(json['dueDate']), defaultSerializer); + Optional _hub = Optional.optional(nativeFromJson, nativeToJson); + Optional _managerName = Optional.optional(nativeFromJson, nativeToJson); + Optional _vendorNumber = Optional.optional(nativeFromJson, nativeToJson); + Optional _roles = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _charges = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _otherCharges = Optional.optional(nativeFromJson, nativeToJson); + Optional _subtotal = Optional.optional(nativeFromJson, nativeToJson); + Optional _amount = Optional.optional(nativeFromJson, nativeToJson); + Optional _notes = Optional.optional(nativeFromJson, nativeToJson); + Optional _staffCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _chargesCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _disputedItems = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _disputeReason = Optional.optional(nativeFromJson, nativeToJson); + Optional _disputeDetails = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateInvoiceVariablesBuilder status(InvoiceStatus? t) { + _status.value = t; + return this; + } + UpdateInvoiceVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + UpdateInvoiceVariablesBuilder businessId(String? t) { + _businessId.value = t; + return this; + } + UpdateInvoiceVariablesBuilder orderId(String? t) { + _orderId.value = t; + return this; + } + UpdateInvoiceVariablesBuilder paymentTerms(InovicePaymentTerms? t) { + _paymentTerms.value = t; + return this; + } + UpdateInvoiceVariablesBuilder invoiceNumber(String? t) { + _invoiceNumber.value = t; + return this; + } + UpdateInvoiceVariablesBuilder issueDate(Timestamp? t) { + _issueDate.value = t; + return this; + } + UpdateInvoiceVariablesBuilder dueDate(Timestamp? t) { + _dueDate.value = t; + return this; + } + UpdateInvoiceVariablesBuilder hub(String? t) { + _hub.value = t; + return this; + } + UpdateInvoiceVariablesBuilder managerName(String? t) { + _managerName.value = t; + return this; + } + UpdateInvoiceVariablesBuilder vendorNumber(String? t) { + _vendorNumber.value = t; + return this; + } + UpdateInvoiceVariablesBuilder roles(AnyValue? t) { + _roles.value = t; + return this; + } + UpdateInvoiceVariablesBuilder charges(AnyValue? t) { + _charges.value = t; + return this; + } + UpdateInvoiceVariablesBuilder otherCharges(double? t) { + _otherCharges.value = t; + return this; + } + UpdateInvoiceVariablesBuilder subtotal(double? t) { + _subtotal.value = t; + return this; + } + UpdateInvoiceVariablesBuilder amount(double? t) { + _amount.value = t; + return this; + } + UpdateInvoiceVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + UpdateInvoiceVariablesBuilder staffCount(int? t) { + _staffCount.value = t; + return this; + } + UpdateInvoiceVariablesBuilder chargesCount(int? t) { + _chargesCount.value = t; + return this; + } + UpdateInvoiceVariablesBuilder disputedItems(AnyValue? t) { + _disputedItems.value = t; + return this; + } + UpdateInvoiceVariablesBuilder disputeReason(String? t) { + _disputeReason.value = t; + return this; + } + UpdateInvoiceVariablesBuilder disputeDetails(String? t) { + _disputeDetails.value = t; + return this; + } + + UpdateInvoiceVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateInvoiceData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateInvoiceVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateInvoiceVariables vars= UpdateInvoiceVariables(id: id,status: _status,vendorId: _vendorId,businessId: _businessId,orderId: _orderId,paymentTerms: _paymentTerms,invoiceNumber: _invoiceNumber,issueDate: _issueDate,dueDate: _dueDate,hub: _hub,managerName: _managerName,vendorNumber: _vendorNumber,roles: _roles,charges: _charges,otherCharges: _otherCharges,subtotal: _subtotal,amount: _amount,notes: _notes,staffCount: _staffCount,chargesCount: _chargesCount,disputedItems: _disputedItems,disputeReason: _disputeReason,disputeDetails: _disputeDetails,); + return _dataConnect.mutation("updateInvoice", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateInvoiceInvoiceUpdate { + final String id; + UpdateInvoiceInvoiceUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateInvoiceInvoiceUpdate otherTyped = other as UpdateInvoiceInvoiceUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateInvoiceInvoiceUpdate({ + required this.id, + }); +} + +@immutable +class UpdateInvoiceData { + final UpdateInvoiceInvoiceUpdate? invoice_update; + UpdateInvoiceData.fromJson(dynamic json): + + invoice_update = json['invoice_update'] == null ? null : UpdateInvoiceInvoiceUpdate.fromJson(json['invoice_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateInvoiceData otherTyped = other as UpdateInvoiceData; + return invoice_update == otherTyped.invoice_update; + + } + @override + int get hashCode => invoice_update.hashCode; + + + Map toJson() { + Map json = {}; + if (invoice_update != null) { + json['invoice_update'] = invoice_update!.toJson(); + } + return json; + } + + UpdateInvoiceData({ + this.invoice_update, + }); +} + +@immutable +class UpdateInvoiceVariables { + final String id; + late final Optionalstatus; + late final OptionalvendorId; + late final OptionalbusinessId; + late final OptionalorderId; + late final OptionalpaymentTerms; + late final OptionalinvoiceNumber; + late final OptionalissueDate; + late final OptionaldueDate; + late final Optionalhub; + late final OptionalmanagerName; + late final OptionalvendorNumber; + late final Optionalroles; + late final Optionalcharges; + late final OptionalotherCharges; + late final Optionalsubtotal; + late final Optionalamount; + late final Optionalnotes; + late final OptionalstaffCount; + late final OptionalchargesCount; + late final OptionaldisputedItems; + late final OptionaldisputeReason; + late final OptionaldisputeDetails; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateInvoiceVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + status = Optional.optional((data) => InvoiceStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : InvoiceStatus.values.byName(json['status']); + + + vendorId = Optional.optional(nativeFromJson, nativeToJson); + vendorId.value = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + + + businessId = Optional.optional(nativeFromJson, nativeToJson); + businessId.value = json['businessId'] == null ? null : nativeFromJson(json['businessId']); + + + orderId = Optional.optional(nativeFromJson, nativeToJson); + orderId.value = json['orderId'] == null ? null : nativeFromJson(json['orderId']); + + + paymentTerms = Optional.optional((data) => InovicePaymentTerms.values.byName(data), enumSerializer); + paymentTerms.value = json['paymentTerms'] == null ? null : InovicePaymentTerms.values.byName(json['paymentTerms']); + + + invoiceNumber = Optional.optional(nativeFromJson, nativeToJson); + invoiceNumber.value = json['invoiceNumber'] == null ? null : nativeFromJson(json['invoiceNumber']); + + + issueDate = Optional.optional((json) => json['issueDate'] = Timestamp.fromJson(json['issueDate']), defaultSerializer); + issueDate.value = json['issueDate'] == null ? null : Timestamp.fromJson(json['issueDate']); + + + dueDate = Optional.optional((json) => json['dueDate'] = Timestamp.fromJson(json['dueDate']), defaultSerializer); + dueDate.value = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']); + + + hub = Optional.optional(nativeFromJson, nativeToJson); + hub.value = json['hub'] == null ? null : nativeFromJson(json['hub']); + + + managerName = Optional.optional(nativeFromJson, nativeToJson); + managerName.value = json['managerName'] == null ? null : nativeFromJson(json['managerName']); + + + vendorNumber = Optional.optional(nativeFromJson, nativeToJson); + vendorNumber.value = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']); + + + roles = Optional.optional(AnyValue.fromJson, defaultSerializer); + roles.value = json['roles'] == null ? null : AnyValue.fromJson(json['roles']); + + + charges = Optional.optional(AnyValue.fromJson, defaultSerializer); + charges.value = json['charges'] == null ? null : AnyValue.fromJson(json['charges']); + + + otherCharges = Optional.optional(nativeFromJson, nativeToJson); + otherCharges.value = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']); + + + subtotal = Optional.optional(nativeFromJson, nativeToJson); + subtotal.value = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']); + + + amount = Optional.optional(nativeFromJson, nativeToJson); + amount.value = json['amount'] == null ? null : nativeFromJson(json['amount']); + + + notes = Optional.optional(nativeFromJson, nativeToJson); + notes.value = json['notes'] == null ? null : nativeFromJson(json['notes']); + + + staffCount = Optional.optional(nativeFromJson, nativeToJson); + staffCount.value = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']); + + + chargesCount = Optional.optional(nativeFromJson, nativeToJson); + chargesCount.value = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']); + + + disputedItems = Optional.optional(AnyValue.fromJson, defaultSerializer); + disputedItems.value = json['disputedItems'] == null ? null : AnyValue.fromJson(json['disputedItems']); + + + disputeReason = Optional.optional(nativeFromJson, nativeToJson); + disputeReason.value = json['disputeReason'] == null ? null : nativeFromJson(json['disputeReason']); + + + disputeDetails = Optional.optional(nativeFromJson, nativeToJson); + disputeDetails.value = json['disputeDetails'] == null ? null : nativeFromJson(json['disputeDetails']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateInvoiceVariables otherTyped = other as UpdateInvoiceVariables; + return id == otherTyped.id && + status == otherTyped.status && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount && + disputedItems == otherTyped.disputedItems && + disputeReason == otherTyped.disputeReason && + disputeDetails == otherTyped.disputeDetails; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, status.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode, disputedItems.hashCode, disputeReason.hashCode, disputeDetails.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(vendorId.state == OptionalState.set) { + json['vendorId'] = vendorId.toJson(); + } + if(businessId.state == OptionalState.set) { + json['businessId'] = businessId.toJson(); + } + if(orderId.state == OptionalState.set) { + json['orderId'] = orderId.toJson(); + } + if(paymentTerms.state == OptionalState.set) { + json['paymentTerms'] = paymentTerms.toJson(); + } + if(invoiceNumber.state == OptionalState.set) { + json['invoiceNumber'] = invoiceNumber.toJson(); + } + if(issueDate.state == OptionalState.set) { + json['issueDate'] = issueDate.toJson(); + } + if(dueDate.state == OptionalState.set) { + json['dueDate'] = dueDate.toJson(); + } + if(hub.state == OptionalState.set) { + json['hub'] = hub.toJson(); + } + if(managerName.state == OptionalState.set) { + json['managerName'] = managerName.toJson(); + } + if(vendorNumber.state == OptionalState.set) { + json['vendorNumber'] = vendorNumber.toJson(); + } + if(roles.state == OptionalState.set) { + json['roles'] = roles.toJson(); + } + if(charges.state == OptionalState.set) { + json['charges'] = charges.toJson(); + } + if(otherCharges.state == OptionalState.set) { + json['otherCharges'] = otherCharges.toJson(); + } + if(subtotal.state == OptionalState.set) { + json['subtotal'] = subtotal.toJson(); + } + if(amount.state == OptionalState.set) { + json['amount'] = amount.toJson(); + } + if(notes.state == OptionalState.set) { + json['notes'] = notes.toJson(); + } + if(staffCount.state == OptionalState.set) { + json['staffCount'] = staffCount.toJson(); + } + if(chargesCount.state == OptionalState.set) { + json['chargesCount'] = chargesCount.toJson(); + } + if(disputedItems.state == OptionalState.set) { + json['disputedItems'] = disputedItems.toJson(); + } + if(disputeReason.state == OptionalState.set) { + json['disputeReason'] = disputeReason.toJson(); + } + if(disputeDetails.state == OptionalState.set) { + json['disputeDetails'] = disputeDetails.toJson(); + } + return json; + } + + UpdateInvoiceVariables({ + required this.id, + required this.status, + required this.vendorId, + required this.businessId, + required this.orderId, + required this.paymentTerms, + required this.invoiceNumber, + required this.issueDate, + required this.dueDate, + required this.hub, + required this.managerName, + required this.vendorNumber, + required this.roles, + required this.charges, + required this.otherCharges, + required this.subtotal, + required this.amount, + required this.notes, + required this.staffCount, + required this.chargesCount, + required this.disputedItems, + required this.disputeReason, + required this.disputeDetails, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_invoice_template.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_invoice_template.dart new file mode 100644 index 00000000..3cb12633 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_invoice_template.dart @@ -0,0 +1,427 @@ +part of 'generated.dart'; + +class UpdateInvoiceTemplateVariablesBuilder { + String id; + Optional _name = Optional.optional(nativeFromJson, nativeToJson); + Optional _ownerId = Optional.optional(nativeFromJson, nativeToJson); + Optional _vendorId = Optional.optional(nativeFromJson, nativeToJson); + Optional _businessId = Optional.optional(nativeFromJson, nativeToJson); + Optional _orderId = Optional.optional(nativeFromJson, nativeToJson); + Optional _paymentTerms = Optional.optional((data) => InovicePaymentTermsTemp.values.byName(data), enumSerializer); + Optional _invoiceNumber = Optional.optional(nativeFromJson, nativeToJson); + Optional _issueDate = Optional.optional((json) => json['issueDate'] = Timestamp.fromJson(json['issueDate']), defaultSerializer); + Optional _dueDate = Optional.optional((json) => json['dueDate'] = Timestamp.fromJson(json['dueDate']), defaultSerializer); + Optional _hub = Optional.optional(nativeFromJson, nativeToJson); + Optional _managerName = Optional.optional(nativeFromJson, nativeToJson); + Optional _vendorNumber = Optional.optional(nativeFromJson, nativeToJson); + Optional _roles = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _charges = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _otherCharges = Optional.optional(nativeFromJson, nativeToJson); + Optional _subtotal = Optional.optional(nativeFromJson, nativeToJson); + Optional _amount = Optional.optional(nativeFromJson, nativeToJson); + Optional _notes = Optional.optional(nativeFromJson, nativeToJson); + Optional _staffCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _chargesCount = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateInvoiceTemplateVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder ownerId(String? t) { + _ownerId.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder businessId(String? t) { + _businessId.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder orderId(String? t) { + _orderId.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder paymentTerms(InovicePaymentTermsTemp? t) { + _paymentTerms.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder invoiceNumber(String? t) { + _invoiceNumber.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder issueDate(Timestamp? t) { + _issueDate.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder dueDate(Timestamp? t) { + _dueDate.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder hub(String? t) { + _hub.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder managerName(String? t) { + _managerName.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder vendorNumber(String? t) { + _vendorNumber.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder roles(AnyValue? t) { + _roles.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder charges(AnyValue? t) { + _charges.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder otherCharges(double? t) { + _otherCharges.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder subtotal(double? t) { + _subtotal.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder amount(double? t) { + _amount.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder staffCount(int? t) { + _staffCount.value = t; + return this; + } + UpdateInvoiceTemplateVariablesBuilder chargesCount(int? t) { + _chargesCount.value = t; + return this; + } + + UpdateInvoiceTemplateVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateInvoiceTemplateData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateInvoiceTemplateVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateInvoiceTemplateVariables vars= UpdateInvoiceTemplateVariables(id: id,name: _name,ownerId: _ownerId,vendorId: _vendorId,businessId: _businessId,orderId: _orderId,paymentTerms: _paymentTerms,invoiceNumber: _invoiceNumber,issueDate: _issueDate,dueDate: _dueDate,hub: _hub,managerName: _managerName,vendorNumber: _vendorNumber,roles: _roles,charges: _charges,otherCharges: _otherCharges,subtotal: _subtotal,amount: _amount,notes: _notes,staffCount: _staffCount,chargesCount: _chargesCount,); + return _dataConnect.mutation("updateInvoiceTemplate", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateInvoiceTemplateInvoiceTemplateUpdate { + final String id; + UpdateInvoiceTemplateInvoiceTemplateUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateInvoiceTemplateInvoiceTemplateUpdate otherTyped = other as UpdateInvoiceTemplateInvoiceTemplateUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateInvoiceTemplateInvoiceTemplateUpdate({ + required this.id, + }); +} + +@immutable +class UpdateInvoiceTemplateData { + final UpdateInvoiceTemplateInvoiceTemplateUpdate? invoiceTemplate_update; + UpdateInvoiceTemplateData.fromJson(dynamic json): + + invoiceTemplate_update = json['invoiceTemplate_update'] == null ? null : UpdateInvoiceTemplateInvoiceTemplateUpdate.fromJson(json['invoiceTemplate_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateInvoiceTemplateData otherTyped = other as UpdateInvoiceTemplateData; + return invoiceTemplate_update == otherTyped.invoiceTemplate_update; + + } + @override + int get hashCode => invoiceTemplate_update.hashCode; + + + Map toJson() { + Map json = {}; + if (invoiceTemplate_update != null) { + json['invoiceTemplate_update'] = invoiceTemplate_update!.toJson(); + } + return json; + } + + UpdateInvoiceTemplateData({ + this.invoiceTemplate_update, + }); +} + +@immutable +class UpdateInvoiceTemplateVariables { + final String id; + late final Optionalname; + late final OptionalownerId; + late final OptionalvendorId; + late final OptionalbusinessId; + late final OptionalorderId; + late final OptionalpaymentTerms; + late final OptionalinvoiceNumber; + late final OptionalissueDate; + late final OptionaldueDate; + late final Optionalhub; + late final OptionalmanagerName; + late final OptionalvendorNumber; + late final Optionalroles; + late final Optionalcharges; + late final OptionalotherCharges; + late final Optionalsubtotal; + late final Optionalamount; + late final Optionalnotes; + late final OptionalstaffCount; + late final OptionalchargesCount; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateInvoiceTemplateVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + name = Optional.optional(nativeFromJson, nativeToJson); + name.value = json['name'] == null ? null : nativeFromJson(json['name']); + + + ownerId = Optional.optional(nativeFromJson, nativeToJson); + ownerId.value = json['ownerId'] == null ? null : nativeFromJson(json['ownerId']); + + + vendorId = Optional.optional(nativeFromJson, nativeToJson); + vendorId.value = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + + + businessId = Optional.optional(nativeFromJson, nativeToJson); + businessId.value = json['businessId'] == null ? null : nativeFromJson(json['businessId']); + + + orderId = Optional.optional(nativeFromJson, nativeToJson); + orderId.value = json['orderId'] == null ? null : nativeFromJson(json['orderId']); + + + paymentTerms = Optional.optional((data) => InovicePaymentTermsTemp.values.byName(data), enumSerializer); + paymentTerms.value = json['paymentTerms'] == null ? null : InovicePaymentTermsTemp.values.byName(json['paymentTerms']); + + + invoiceNumber = Optional.optional(nativeFromJson, nativeToJson); + invoiceNumber.value = json['invoiceNumber'] == null ? null : nativeFromJson(json['invoiceNumber']); + + + issueDate = Optional.optional((json) => json['issueDate'] = Timestamp.fromJson(json['issueDate']), defaultSerializer); + issueDate.value = json['issueDate'] == null ? null : Timestamp.fromJson(json['issueDate']); + + + dueDate = Optional.optional((json) => json['dueDate'] = Timestamp.fromJson(json['dueDate']), defaultSerializer); + dueDate.value = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']); + + + hub = Optional.optional(nativeFromJson, nativeToJson); + hub.value = json['hub'] == null ? null : nativeFromJson(json['hub']); + + + managerName = Optional.optional(nativeFromJson, nativeToJson); + managerName.value = json['managerName'] == null ? null : nativeFromJson(json['managerName']); + + + vendorNumber = Optional.optional(nativeFromJson, nativeToJson); + vendorNumber.value = json['vendorNumber'] == null ? null : nativeFromJson(json['vendorNumber']); + + + roles = Optional.optional(AnyValue.fromJson, defaultSerializer); + roles.value = json['roles'] == null ? null : AnyValue.fromJson(json['roles']); + + + charges = Optional.optional(AnyValue.fromJson, defaultSerializer); + charges.value = json['charges'] == null ? null : AnyValue.fromJson(json['charges']); + + + otherCharges = Optional.optional(nativeFromJson, nativeToJson); + otherCharges.value = json['otherCharges'] == null ? null : nativeFromJson(json['otherCharges']); + + + subtotal = Optional.optional(nativeFromJson, nativeToJson); + subtotal.value = json['subtotal'] == null ? null : nativeFromJson(json['subtotal']); + + + amount = Optional.optional(nativeFromJson, nativeToJson); + amount.value = json['amount'] == null ? null : nativeFromJson(json['amount']); + + + notes = Optional.optional(nativeFromJson, nativeToJson); + notes.value = json['notes'] == null ? null : nativeFromJson(json['notes']); + + + staffCount = Optional.optional(nativeFromJson, nativeToJson); + staffCount.value = json['staffCount'] == null ? null : nativeFromJson(json['staffCount']); + + + chargesCount = Optional.optional(nativeFromJson, nativeToJson); + chargesCount.value = json['chargesCount'] == null ? null : nativeFromJson(json['chargesCount']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateInvoiceTemplateVariables otherTyped = other as UpdateInvoiceTemplateVariables; + return id == otherTyped.id && + name == otherTyped.name && + ownerId == otherTyped.ownerId && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + orderId == otherTyped.orderId && + paymentTerms == otherTyped.paymentTerms && + invoiceNumber == otherTyped.invoiceNumber && + issueDate == otherTyped.issueDate && + dueDate == otherTyped.dueDate && + hub == otherTyped.hub && + managerName == otherTyped.managerName && + vendorNumber == otherTyped.vendorNumber && + roles == otherTyped.roles && + charges == otherTyped.charges && + otherCharges == otherTyped.otherCharges && + subtotal == otherTyped.subtotal && + amount == otherTyped.amount && + notes == otherTyped.notes && + staffCount == otherTyped.staffCount && + chargesCount == otherTyped.chargesCount; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, ownerId.hashCode, vendorId.hashCode, businessId.hashCode, orderId.hashCode, paymentTerms.hashCode, invoiceNumber.hashCode, issueDate.hashCode, dueDate.hashCode, hub.hashCode, managerName.hashCode, vendorNumber.hashCode, roles.hashCode, charges.hashCode, otherCharges.hashCode, subtotal.hashCode, amount.hashCode, notes.hashCode, staffCount.hashCode, chargesCount.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(name.state == OptionalState.set) { + json['name'] = name.toJson(); + } + if(ownerId.state == OptionalState.set) { + json['ownerId'] = ownerId.toJson(); + } + if(vendorId.state == OptionalState.set) { + json['vendorId'] = vendorId.toJson(); + } + if(businessId.state == OptionalState.set) { + json['businessId'] = businessId.toJson(); + } + if(orderId.state == OptionalState.set) { + json['orderId'] = orderId.toJson(); + } + if(paymentTerms.state == OptionalState.set) { + json['paymentTerms'] = paymentTerms.toJson(); + } + if(invoiceNumber.state == OptionalState.set) { + json['invoiceNumber'] = invoiceNumber.toJson(); + } + if(issueDate.state == OptionalState.set) { + json['issueDate'] = issueDate.toJson(); + } + if(dueDate.state == OptionalState.set) { + json['dueDate'] = dueDate.toJson(); + } + if(hub.state == OptionalState.set) { + json['hub'] = hub.toJson(); + } + if(managerName.state == OptionalState.set) { + json['managerName'] = managerName.toJson(); + } + if(vendorNumber.state == OptionalState.set) { + json['vendorNumber'] = vendorNumber.toJson(); + } + if(roles.state == OptionalState.set) { + json['roles'] = roles.toJson(); + } + if(charges.state == OptionalState.set) { + json['charges'] = charges.toJson(); + } + if(otherCharges.state == OptionalState.set) { + json['otherCharges'] = otherCharges.toJson(); + } + if(subtotal.state == OptionalState.set) { + json['subtotal'] = subtotal.toJson(); + } + if(amount.state == OptionalState.set) { + json['amount'] = amount.toJson(); + } + if(notes.state == OptionalState.set) { + json['notes'] = notes.toJson(); + } + if(staffCount.state == OptionalState.set) { + json['staffCount'] = staffCount.toJson(); + } + if(chargesCount.state == OptionalState.set) { + json['chargesCount'] = chargesCount.toJson(); + } + return json; + } + + UpdateInvoiceTemplateVariables({ + required this.id, + required this.name, + required this.ownerId, + required this.vendorId, + required this.businessId, + required this.orderId, + required this.paymentTerms, + required this.invoiceNumber, + required this.issueDate, + required this.dueDate, + required this.hub, + required this.managerName, + required this.vendorNumber, + required this.roles, + required this.charges, + required this.otherCharges, + required this.subtotal, + required this.amount, + required this.notes, + required this.staffCount, + required this.chargesCount, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_level.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_level.dart new file mode 100644 index 00000000..0385a5bf --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_level.dart @@ -0,0 +1,187 @@ +part of 'generated.dart'; + +class UpdateLevelVariablesBuilder { + String id; + Optional _name = Optional.optional(nativeFromJson, nativeToJson); + Optional _xpRequired = Optional.optional(nativeFromJson, nativeToJson); + Optional _icon = Optional.optional(nativeFromJson, nativeToJson); + Optional _colors = Optional.optional(AnyValue.fromJson, defaultSerializer); + + final FirebaseDataConnect _dataConnect; UpdateLevelVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateLevelVariablesBuilder xpRequired(int? t) { + _xpRequired.value = t; + return this; + } + UpdateLevelVariablesBuilder icon(String? t) { + _icon.value = t; + return this; + } + UpdateLevelVariablesBuilder colors(AnyValue? t) { + _colors.value = t; + return this; + } + + UpdateLevelVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateLevelData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateLevelVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateLevelVariables vars= UpdateLevelVariables(id: id,name: _name,xpRequired: _xpRequired,icon: _icon,colors: _colors,); + return _dataConnect.mutation("updateLevel", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateLevelLevelUpdate { + final String id; + UpdateLevelLevelUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateLevelLevelUpdate otherTyped = other as UpdateLevelLevelUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateLevelLevelUpdate({ + required this.id, + }); +} + +@immutable +class UpdateLevelData { + final UpdateLevelLevelUpdate? level_update; + UpdateLevelData.fromJson(dynamic json): + + level_update = json['level_update'] == null ? null : UpdateLevelLevelUpdate.fromJson(json['level_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateLevelData otherTyped = other as UpdateLevelData; + return level_update == otherTyped.level_update; + + } + @override + int get hashCode => level_update.hashCode; + + + Map toJson() { + Map json = {}; + if (level_update != null) { + json['level_update'] = level_update!.toJson(); + } + return json; + } + + UpdateLevelData({ + this.level_update, + }); +} + +@immutable +class UpdateLevelVariables { + final String id; + late final Optionalname; + late final OptionalxpRequired; + late final Optionalicon; + late final Optionalcolors; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateLevelVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + name = Optional.optional(nativeFromJson, nativeToJson); + name.value = json['name'] == null ? null : nativeFromJson(json['name']); + + + xpRequired = Optional.optional(nativeFromJson, nativeToJson); + xpRequired.value = json['xpRequired'] == null ? null : nativeFromJson(json['xpRequired']); + + + icon = Optional.optional(nativeFromJson, nativeToJson); + icon.value = json['icon'] == null ? null : nativeFromJson(json['icon']); + + + colors = Optional.optional(AnyValue.fromJson, defaultSerializer); + colors.value = json['colors'] == null ? null : AnyValue.fromJson(json['colors']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateLevelVariables otherTyped = other as UpdateLevelVariables; + return id == otherTyped.id && + name == otherTyped.name && + xpRequired == otherTyped.xpRequired && + icon == otherTyped.icon && + colors == otherTyped.colors; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, xpRequired.hashCode, icon.hashCode, colors.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(name.state == OptionalState.set) { + json['name'] = name.toJson(); + } + if(xpRequired.state == OptionalState.set) { + json['xpRequired'] = xpRequired.toJson(); + } + if(icon.state == OptionalState.set) { + json['icon'] = icon.toJson(); + } + if(colors.state == OptionalState.set) { + json['colors'] = colors.toJson(); + } + return json; + } + + UpdateLevelVariables({ + required this.id, + required this.name, + required this.xpRequired, + required this.icon, + required this.colors, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_message.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_message.dart new file mode 100644 index 00000000..466a250a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_message.dart @@ -0,0 +1,187 @@ +part of 'generated.dart'; + +class UpdateMessageVariablesBuilder { + String id; + Optional _conversationId = Optional.optional(nativeFromJson, nativeToJson); + Optional _senderId = Optional.optional(nativeFromJson, nativeToJson); + Optional _content = Optional.optional(nativeFromJson, nativeToJson); + Optional _isSystem = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateMessageVariablesBuilder conversationId(String? t) { + _conversationId.value = t; + return this; + } + UpdateMessageVariablesBuilder senderId(String? t) { + _senderId.value = t; + return this; + } + UpdateMessageVariablesBuilder content(String? t) { + _content.value = t; + return this; + } + UpdateMessageVariablesBuilder isSystem(bool? t) { + _isSystem.value = t; + return this; + } + + UpdateMessageVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateMessageData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateMessageVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateMessageVariables vars= UpdateMessageVariables(id: id,conversationId: _conversationId,senderId: _senderId,content: _content,isSystem: _isSystem,); + return _dataConnect.mutation("updateMessage", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateMessageMessageUpdate { + final String id; + UpdateMessageMessageUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateMessageMessageUpdate otherTyped = other as UpdateMessageMessageUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateMessageMessageUpdate({ + required this.id, + }); +} + +@immutable +class UpdateMessageData { + final UpdateMessageMessageUpdate? message_update; + UpdateMessageData.fromJson(dynamic json): + + message_update = json['message_update'] == null ? null : UpdateMessageMessageUpdate.fromJson(json['message_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateMessageData otherTyped = other as UpdateMessageData; + return message_update == otherTyped.message_update; + + } + @override + int get hashCode => message_update.hashCode; + + + Map toJson() { + Map json = {}; + if (message_update != null) { + json['message_update'] = message_update!.toJson(); + } + return json; + } + + UpdateMessageData({ + this.message_update, + }); +} + +@immutable +class UpdateMessageVariables { + final String id; + late final OptionalconversationId; + late final OptionalsenderId; + late final Optionalcontent; + late final OptionalisSystem; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateMessageVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + conversationId = Optional.optional(nativeFromJson, nativeToJson); + conversationId.value = json['conversationId'] == null ? null : nativeFromJson(json['conversationId']); + + + senderId = Optional.optional(nativeFromJson, nativeToJson); + senderId.value = json['senderId'] == null ? null : nativeFromJson(json['senderId']); + + + content = Optional.optional(nativeFromJson, nativeToJson); + content.value = json['content'] == null ? null : nativeFromJson(json['content']); + + + isSystem = Optional.optional(nativeFromJson, nativeToJson); + isSystem.value = json['isSystem'] == null ? null : nativeFromJson(json['isSystem']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateMessageVariables otherTyped = other as UpdateMessageVariables; + return id == otherTyped.id && + conversationId == otherTyped.conversationId && + senderId == otherTyped.senderId && + content == otherTyped.content && + isSystem == otherTyped.isSystem; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, conversationId.hashCode, senderId.hashCode, content.hashCode, isSystem.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(conversationId.state == OptionalState.set) { + json['conversationId'] = conversationId.toJson(); + } + if(senderId.state == OptionalState.set) { + json['senderId'] = senderId.toJson(); + } + if(content.state == OptionalState.set) { + json['content'] = content.toJson(); + } + if(isSystem.state == OptionalState.set) { + json['isSystem'] = isSystem.toJson(); + } + return json; + } + + UpdateMessageVariables({ + required this.id, + required this.conversationId, + required this.senderId, + required this.content, + required this.isSystem, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_order.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_order.dart new file mode 100644 index 00000000..3caecfea --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_order.dart @@ -0,0 +1,397 @@ +part of 'generated.dart'; + +class UpdateOrderVariablesBuilder { + String id; + Optional _vendorId = Optional.optional(nativeFromJson, nativeToJson); + Optional _businessId = Optional.optional(nativeFromJson, nativeToJson); + Optional _location = Optional.optional(nativeFromJson, nativeToJson); + Optional _status = Optional.optional((data) => OrderStatus.values.byName(data), enumSerializer); + Optional _date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer); + Optional _startDate = Optional.optional((json) => json['startDate'] = Timestamp.fromJson(json['startDate']), defaultSerializer); + Optional _endDate = Optional.optional((json) => json['endDate'] = Timestamp.fromJson(json['endDate']), defaultSerializer); + Optional _total = Optional.optional(nativeFromJson, nativeToJson); + Optional _eventName = Optional.optional(nativeFromJson, nativeToJson); + Optional _assignedStaff = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _shifts = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _requested = Optional.optional(nativeFromJson, nativeToJson); + Optional _hub = Optional.optional(nativeFromJson, nativeToJson); + Optional _recurringDays = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _permanentDays = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _notes = Optional.optional(nativeFromJson, nativeToJson); + Optional _detectedConflicts = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _poReference = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateOrderVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + UpdateOrderVariablesBuilder businessId(String? t) { + _businessId.value = t; + return this; + } + UpdateOrderVariablesBuilder location(String? t) { + _location.value = t; + return this; + } + UpdateOrderVariablesBuilder status(OrderStatus? t) { + _status.value = t; + return this; + } + UpdateOrderVariablesBuilder date(Timestamp? t) { + _date.value = t; + return this; + } + UpdateOrderVariablesBuilder startDate(Timestamp? t) { + _startDate.value = t; + return this; + } + UpdateOrderVariablesBuilder endDate(Timestamp? t) { + _endDate.value = t; + return this; + } + UpdateOrderVariablesBuilder total(double? t) { + _total.value = t; + return this; + } + UpdateOrderVariablesBuilder eventName(String? t) { + _eventName.value = t; + return this; + } + UpdateOrderVariablesBuilder assignedStaff(AnyValue? t) { + _assignedStaff.value = t; + return this; + } + UpdateOrderVariablesBuilder shifts(AnyValue? t) { + _shifts.value = t; + return this; + } + UpdateOrderVariablesBuilder requested(int? t) { + _requested.value = t; + return this; + } + UpdateOrderVariablesBuilder hub(String? t) { + _hub.value = t; + return this; + } + UpdateOrderVariablesBuilder recurringDays(AnyValue? t) { + _recurringDays.value = t; + return this; + } + UpdateOrderVariablesBuilder permanentDays(AnyValue? t) { + _permanentDays.value = t; + return this; + } + UpdateOrderVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + UpdateOrderVariablesBuilder detectedConflicts(AnyValue? t) { + _detectedConflicts.value = t; + return this; + } + UpdateOrderVariablesBuilder poReference(String? t) { + _poReference.value = t; + return this; + } + + UpdateOrderVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateOrderData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateOrderVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateOrderVariables vars= UpdateOrderVariables(id: id,vendorId: _vendorId,businessId: _businessId,location: _location,status: _status,date: _date,startDate: _startDate,endDate: _endDate,total: _total,eventName: _eventName,assignedStaff: _assignedStaff,shifts: _shifts,requested: _requested,hub: _hub,recurringDays: _recurringDays,permanentDays: _permanentDays,notes: _notes,detectedConflicts: _detectedConflicts,poReference: _poReference,); + return _dataConnect.mutation("updateOrder", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateOrderOrderUpdate { + final String id; + UpdateOrderOrderUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateOrderOrderUpdate otherTyped = other as UpdateOrderOrderUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateOrderOrderUpdate({ + required this.id, + }); +} + +@immutable +class UpdateOrderData { + final UpdateOrderOrderUpdate? order_update; + UpdateOrderData.fromJson(dynamic json): + + order_update = json['order_update'] == null ? null : UpdateOrderOrderUpdate.fromJson(json['order_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateOrderData otherTyped = other as UpdateOrderData; + return order_update == otherTyped.order_update; + + } + @override + int get hashCode => order_update.hashCode; + + + Map toJson() { + Map json = {}; + if (order_update != null) { + json['order_update'] = order_update!.toJson(); + } + return json; + } + + UpdateOrderData({ + this.order_update, + }); +} + +@immutable +class UpdateOrderVariables { + final String id; + late final OptionalvendorId; + late final OptionalbusinessId; + late final Optionallocation; + late final Optionalstatus; + late final Optionaldate; + late final OptionalstartDate; + late final OptionalendDate; + late final Optionaltotal; + late final OptionaleventName; + late final OptionalassignedStaff; + late final Optionalshifts; + late final Optionalrequested; + late final Optionalhub; + late final OptionalrecurringDays; + late final OptionalpermanentDays; + late final Optionalnotes; + late final OptionaldetectedConflicts; + late final OptionalpoReference; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateOrderVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + vendorId = Optional.optional(nativeFromJson, nativeToJson); + vendorId.value = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + + + businessId = Optional.optional(nativeFromJson, nativeToJson); + businessId.value = json['businessId'] == null ? null : nativeFromJson(json['businessId']); + + + location = Optional.optional(nativeFromJson, nativeToJson); + location.value = json['location'] == null ? null : nativeFromJson(json['location']); + + + status = Optional.optional((data) => OrderStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : OrderStatus.values.byName(json['status']); + + + date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer); + date.value = json['date'] == null ? null : Timestamp.fromJson(json['date']); + + + startDate = Optional.optional((json) => json['startDate'] = Timestamp.fromJson(json['startDate']), defaultSerializer); + startDate.value = json['startDate'] == null ? null : Timestamp.fromJson(json['startDate']); + + + endDate = Optional.optional((json) => json['endDate'] = Timestamp.fromJson(json['endDate']), defaultSerializer); + endDate.value = json['endDate'] == null ? null : Timestamp.fromJson(json['endDate']); + + + total = Optional.optional(nativeFromJson, nativeToJson); + total.value = json['total'] == null ? null : nativeFromJson(json['total']); + + + eventName = Optional.optional(nativeFromJson, nativeToJson); + eventName.value = json['eventName'] == null ? null : nativeFromJson(json['eventName']); + + + assignedStaff = Optional.optional(AnyValue.fromJson, defaultSerializer); + assignedStaff.value = json['assignedStaff'] == null ? null : AnyValue.fromJson(json['assignedStaff']); + + + shifts = Optional.optional(AnyValue.fromJson, defaultSerializer); + shifts.value = json['shifts'] == null ? null : AnyValue.fromJson(json['shifts']); + + + requested = Optional.optional(nativeFromJson, nativeToJson); + requested.value = json['requested'] == null ? null : nativeFromJson(json['requested']); + + + hub = Optional.optional(nativeFromJson, nativeToJson); + hub.value = json['hub'] == null ? null : nativeFromJson(json['hub']); + + + recurringDays = Optional.optional(AnyValue.fromJson, defaultSerializer); + recurringDays.value = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']); + + + permanentDays = Optional.optional(AnyValue.fromJson, defaultSerializer); + permanentDays.value = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']); + + + notes = Optional.optional(nativeFromJson, nativeToJson); + notes.value = json['notes'] == null ? null : nativeFromJson(json['notes']); + + + detectedConflicts = Optional.optional(AnyValue.fromJson, defaultSerializer); + detectedConflicts.value = json['detectedConflicts'] == null ? null : AnyValue.fromJson(json['detectedConflicts']); + + + poReference = Optional.optional(nativeFromJson, nativeToJson); + poReference.value = json['poReference'] == null ? null : nativeFromJson(json['poReference']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateOrderVariables otherTyped = other as UpdateOrderVariables; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + businessId == otherTyped.businessId && + location == otherTyped.location && + status == otherTyped.status && + date == otherTyped.date && + startDate == otherTyped.startDate && + endDate == otherTyped.endDate && + total == otherTyped.total && + eventName == otherTyped.eventName && + assignedStaff == otherTyped.assignedStaff && + shifts == otherTyped.shifts && + requested == otherTyped.requested && + hub == otherTyped.hub && + recurringDays == otherTyped.recurringDays && + permanentDays == otherTyped.permanentDays && + notes == otherTyped.notes && + detectedConflicts == otherTyped.detectedConflicts && + poReference == otherTyped.poReference; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, businessId.hashCode, location.hashCode, status.hashCode, date.hashCode, startDate.hashCode, endDate.hashCode, total.hashCode, eventName.hashCode, assignedStaff.hashCode, shifts.hashCode, requested.hashCode, hub.hashCode, recurringDays.hashCode, permanentDays.hashCode, notes.hashCode, detectedConflicts.hashCode, poReference.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(vendorId.state == OptionalState.set) { + json['vendorId'] = vendorId.toJson(); + } + if(businessId.state == OptionalState.set) { + json['businessId'] = businessId.toJson(); + } + if(location.state == OptionalState.set) { + json['location'] = location.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(date.state == OptionalState.set) { + json['date'] = date.toJson(); + } + if(startDate.state == OptionalState.set) { + json['startDate'] = startDate.toJson(); + } + if(endDate.state == OptionalState.set) { + json['endDate'] = endDate.toJson(); + } + if(total.state == OptionalState.set) { + json['total'] = total.toJson(); + } + if(eventName.state == OptionalState.set) { + json['eventName'] = eventName.toJson(); + } + if(assignedStaff.state == OptionalState.set) { + json['assignedStaff'] = assignedStaff.toJson(); + } + if(shifts.state == OptionalState.set) { + json['shifts'] = shifts.toJson(); + } + if(requested.state == OptionalState.set) { + json['requested'] = requested.toJson(); + } + if(hub.state == OptionalState.set) { + json['hub'] = hub.toJson(); + } + if(recurringDays.state == OptionalState.set) { + json['recurringDays'] = recurringDays.toJson(); + } + if(permanentDays.state == OptionalState.set) { + json['permanentDays'] = permanentDays.toJson(); + } + if(notes.state == OptionalState.set) { + json['notes'] = notes.toJson(); + } + if(detectedConflicts.state == OptionalState.set) { + json['detectedConflicts'] = detectedConflicts.toJson(); + } + if(poReference.state == OptionalState.set) { + json['poReference'] = poReference.toJson(); + } + return json; + } + + UpdateOrderVariables({ + required this.id, + required this.vendorId, + required this.businessId, + required this.location, + required this.status, + required this.date, + required this.startDate, + required this.endDate, + required this.total, + required this.eventName, + required this.assignedStaff, + required this.shifts, + required this.requested, + required this.hub, + required this.recurringDays, + required this.permanentDays, + required this.notes, + required this.detectedConflicts, + required this.poReference, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_recent_payment.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_recent_payment.dart new file mode 100644 index 00000000..f2ff0280 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_recent_payment.dart @@ -0,0 +1,202 @@ +part of 'generated.dart'; + +class UpdateRecentPaymentVariablesBuilder { + String id; + Optional _workedTime = Optional.optional(nativeFromJson, nativeToJson); + Optional _status = Optional.optional((data) => RecentPaymentStatus.values.byName(data), enumSerializer); + Optional _staffId = Optional.optional(nativeFromJson, nativeToJson); + Optional _applicationId = Optional.optional(nativeFromJson, nativeToJson); + Optional _invoiceId = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateRecentPaymentVariablesBuilder workedTime(String? t) { + _workedTime.value = t; + return this; + } + UpdateRecentPaymentVariablesBuilder status(RecentPaymentStatus? t) { + _status.value = t; + return this; + } + UpdateRecentPaymentVariablesBuilder staffId(String? t) { + _staffId.value = t; + return this; + } + UpdateRecentPaymentVariablesBuilder applicationId(String? t) { + _applicationId.value = t; + return this; + } + UpdateRecentPaymentVariablesBuilder invoiceId(String? t) { + _invoiceId.value = t; + return this; + } + + UpdateRecentPaymentVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateRecentPaymentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateRecentPaymentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateRecentPaymentVariables vars= UpdateRecentPaymentVariables(id: id,workedTime: _workedTime,status: _status,staffId: _staffId,applicationId: _applicationId,invoiceId: _invoiceId,); + return _dataConnect.mutation("updateRecentPayment", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateRecentPaymentRecentPaymentUpdate { + final String id; + UpdateRecentPaymentRecentPaymentUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateRecentPaymentRecentPaymentUpdate otherTyped = other as UpdateRecentPaymentRecentPaymentUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateRecentPaymentRecentPaymentUpdate({ + required this.id, + }); +} + +@immutable +class UpdateRecentPaymentData { + final UpdateRecentPaymentRecentPaymentUpdate? recentPayment_update; + UpdateRecentPaymentData.fromJson(dynamic json): + + recentPayment_update = json['recentPayment_update'] == null ? null : UpdateRecentPaymentRecentPaymentUpdate.fromJson(json['recentPayment_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateRecentPaymentData otherTyped = other as UpdateRecentPaymentData; + return recentPayment_update == otherTyped.recentPayment_update; + + } + @override + int get hashCode => recentPayment_update.hashCode; + + + Map toJson() { + Map json = {}; + if (recentPayment_update != null) { + json['recentPayment_update'] = recentPayment_update!.toJson(); + } + return json; + } + + UpdateRecentPaymentData({ + this.recentPayment_update, + }); +} + +@immutable +class UpdateRecentPaymentVariables { + final String id; + late final OptionalworkedTime; + late final Optionalstatus; + late final OptionalstaffId; + late final OptionalapplicationId; + late final OptionalinvoiceId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateRecentPaymentVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + workedTime = Optional.optional(nativeFromJson, nativeToJson); + workedTime.value = json['workedTime'] == null ? null : nativeFromJson(json['workedTime']); + + + status = Optional.optional((data) => RecentPaymentStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : RecentPaymentStatus.values.byName(json['status']); + + + staffId = Optional.optional(nativeFromJson, nativeToJson); + staffId.value = json['staffId'] == null ? null : nativeFromJson(json['staffId']); + + + applicationId = Optional.optional(nativeFromJson, nativeToJson); + applicationId.value = json['applicationId'] == null ? null : nativeFromJson(json['applicationId']); + + + invoiceId = Optional.optional(nativeFromJson, nativeToJson); + invoiceId.value = json['invoiceId'] == null ? null : nativeFromJson(json['invoiceId']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateRecentPaymentVariables otherTyped = other as UpdateRecentPaymentVariables; + return id == otherTyped.id && + workedTime == otherTyped.workedTime && + status == otherTyped.status && + staffId == otherTyped.staffId && + applicationId == otherTyped.applicationId && + invoiceId == otherTyped.invoiceId; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workedTime.hashCode, status.hashCode, staffId.hashCode, applicationId.hashCode, invoiceId.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(workedTime.state == OptionalState.set) { + json['workedTime'] = workedTime.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(staffId.state == OptionalState.set) { + json['staffId'] = staffId.toJson(); + } + if(applicationId.state == OptionalState.set) { + json['applicationId'] = applicationId.toJson(); + } + if(invoiceId.state == OptionalState.set) { + json['invoiceId'] = invoiceId.toJson(); + } + return json; + } + + UpdateRecentPaymentVariables({ + required this.id, + required this.workedTime, + required this.status, + required this.staffId, + required this.applicationId, + required this.invoiceId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_role.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_role.dart new file mode 100644 index 00000000..a7ed336c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_role.dart @@ -0,0 +1,164 @@ +part of 'generated.dart'; + +class UpdateRoleVariablesBuilder { + String id; + Optional _name = Optional.optional(nativeFromJson, nativeToJson); + Optional _costPerHour = Optional.optional(nativeFromJson, nativeToJson); + String roleCategoryId; + + final FirebaseDataConnect _dataConnect; UpdateRoleVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateRoleVariablesBuilder costPerHour(double? t) { + _costPerHour.value = t; + return this; + } + + UpdateRoleVariablesBuilder(this._dataConnect, {required this.id,required this.roleCategoryId,}); + Deserializer dataDeserializer = (dynamic json) => UpdateRoleData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateRoleVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateRoleVariables vars= UpdateRoleVariables(id: id,name: _name,costPerHour: _costPerHour,roleCategoryId: roleCategoryId,); + return _dataConnect.mutation("updateRole", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateRoleRoleUpdate { + final String id; + UpdateRoleRoleUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateRoleRoleUpdate otherTyped = other as UpdateRoleRoleUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateRoleRoleUpdate({ + required this.id, + }); +} + +@immutable +class UpdateRoleData { + final UpdateRoleRoleUpdate? role_update; + UpdateRoleData.fromJson(dynamic json): + + role_update = json['role_update'] == null ? null : UpdateRoleRoleUpdate.fromJson(json['role_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateRoleData otherTyped = other as UpdateRoleData; + return role_update == otherTyped.role_update; + + } + @override + int get hashCode => role_update.hashCode; + + + Map toJson() { + Map json = {}; + if (role_update != null) { + json['role_update'] = role_update!.toJson(); + } + return json; + } + + UpdateRoleData({ + this.role_update, + }); +} + +@immutable +class UpdateRoleVariables { + final String id; + late final Optionalname; + late final OptionalcostPerHour; + final String roleCategoryId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateRoleVariables.fromJson(Map json): + + id = nativeFromJson(json['id']), + roleCategoryId = nativeFromJson(json['roleCategoryId']) { + + + + name = Optional.optional(nativeFromJson, nativeToJson); + name.value = json['name'] == null ? null : nativeFromJson(json['name']); + + + costPerHour = Optional.optional(nativeFromJson, nativeToJson); + costPerHour.value = json['costPerHour'] == null ? null : nativeFromJson(json['costPerHour']); + + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateRoleVariables otherTyped = other as UpdateRoleVariables; + return id == otherTyped.id && + name == otherTyped.name && + costPerHour == otherTyped.costPerHour && + roleCategoryId == otherTyped.roleCategoryId; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costPerHour.hashCode, roleCategoryId.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(name.state == OptionalState.set) { + json['name'] = name.toJson(); + } + if(costPerHour.state == OptionalState.set) { + json['costPerHour'] = costPerHour.toJson(); + } + json['roleCategoryId'] = nativeToJson(roleCategoryId); + return json; + } + + UpdateRoleVariables({ + required this.id, + required this.name, + required this.costPerHour, + required this.roleCategoryId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_role_category.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_role_category.dart new file mode 100644 index 00000000..80f2f027 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_role_category.dart @@ -0,0 +1,157 @@ +part of 'generated.dart'; + +class UpdateRoleCategoryVariablesBuilder { + String id; + Optional _roleName = Optional.optional(nativeFromJson, nativeToJson); + Optional _category = Optional.optional((data) => RoleCategoryType.values.byName(data), enumSerializer); + + final FirebaseDataConnect _dataConnect; UpdateRoleCategoryVariablesBuilder roleName(String? t) { + _roleName.value = t; + return this; + } + UpdateRoleCategoryVariablesBuilder category(RoleCategoryType? t) { + _category.value = t; + return this; + } + + UpdateRoleCategoryVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateRoleCategoryData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateRoleCategoryVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateRoleCategoryVariables vars= UpdateRoleCategoryVariables(id: id,roleName: _roleName,category: _category,); + return _dataConnect.mutation("updateRoleCategory", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateRoleCategoryRoleCategoryUpdate { + final String id; + UpdateRoleCategoryRoleCategoryUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateRoleCategoryRoleCategoryUpdate otherTyped = other as UpdateRoleCategoryRoleCategoryUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateRoleCategoryRoleCategoryUpdate({ + required this.id, + }); +} + +@immutable +class UpdateRoleCategoryData { + final UpdateRoleCategoryRoleCategoryUpdate? roleCategory_update; + UpdateRoleCategoryData.fromJson(dynamic json): + + roleCategory_update = json['roleCategory_update'] == null ? null : UpdateRoleCategoryRoleCategoryUpdate.fromJson(json['roleCategory_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateRoleCategoryData otherTyped = other as UpdateRoleCategoryData; + return roleCategory_update == otherTyped.roleCategory_update; + + } + @override + int get hashCode => roleCategory_update.hashCode; + + + Map toJson() { + Map json = {}; + if (roleCategory_update != null) { + json['roleCategory_update'] = roleCategory_update!.toJson(); + } + return json; + } + + UpdateRoleCategoryData({ + this.roleCategory_update, + }); +} + +@immutable +class UpdateRoleCategoryVariables { + final String id; + late final OptionalroleName; + late final Optionalcategory; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateRoleCategoryVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + roleName = Optional.optional(nativeFromJson, nativeToJson); + roleName.value = json['roleName'] == null ? null : nativeFromJson(json['roleName']); + + + category = Optional.optional((data) => RoleCategoryType.values.byName(data), enumSerializer); + category.value = json['category'] == null ? null : RoleCategoryType.values.byName(json['category']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateRoleCategoryVariables otherTyped = other as UpdateRoleCategoryVariables; + return id == otherTyped.id && + roleName == otherTyped.roleName && + category == otherTyped.category; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, roleName.hashCode, category.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(roleName.state == OptionalState.set) { + json['roleName'] = roleName.toJson(); + } + if(category.state == OptionalState.set) { + json['category'] = category.toJson(); + } + return json; + } + + UpdateRoleCategoryVariables({ + required this.id, + required this.roleName, + required this.category, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_shift.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_shift.dart new file mode 100644 index 00000000..8739955f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_shift.dart @@ -0,0 +1,399 @@ +part of 'generated.dart'; + +class UpdateShiftVariablesBuilder { + String id; + Optional _title = Optional.optional(nativeFromJson, nativeToJson); + Optional _orderId = Optional.optional(nativeFromJson, nativeToJson); + Optional _date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer); + Optional _startTime = Optional.optional((json) => json['startTime'] = Timestamp.fromJson(json['startTime']), defaultSerializer); + Optional _endTime = Optional.optional((json) => json['endTime'] = Timestamp.fromJson(json['endTime']), defaultSerializer); + Optional _hours = Optional.optional(nativeFromJson, nativeToJson); + Optional _cost = Optional.optional(nativeFromJson, nativeToJson); + Optional _location = Optional.optional(nativeFromJson, nativeToJson); + Optional _locationAddress = Optional.optional(nativeFromJson, nativeToJson); + Optional _latitude = Optional.optional(nativeFromJson, nativeToJson); + Optional _longitude = Optional.optional(nativeFromJson, nativeToJson); + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + Optional _status = Optional.optional((data) => ShiftStatus.values.byName(data), enumSerializer); + Optional _workersNeeded = Optional.optional(nativeFromJson, nativeToJson); + Optional _filled = Optional.optional(nativeFromJson, nativeToJson); + Optional _filledAt = Optional.optional((json) => json['filledAt'] = Timestamp.fromJson(json['filledAt']), defaultSerializer); + Optional> _managers = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer)); + Optional _durationDays = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateShiftVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + UpdateShiftVariablesBuilder orderId(String? t) { + _orderId.value = t; + return this; + } + UpdateShiftVariablesBuilder date(Timestamp? t) { + _date.value = t; + return this; + } + UpdateShiftVariablesBuilder startTime(Timestamp? t) { + _startTime.value = t; + return this; + } + UpdateShiftVariablesBuilder endTime(Timestamp? t) { + _endTime.value = t; + return this; + } + UpdateShiftVariablesBuilder hours(double? t) { + _hours.value = t; + return this; + } + UpdateShiftVariablesBuilder cost(double? t) { + _cost.value = t; + return this; + } + UpdateShiftVariablesBuilder location(String? t) { + _location.value = t; + return this; + } + UpdateShiftVariablesBuilder locationAddress(String? t) { + _locationAddress.value = t; + return this; + } + UpdateShiftVariablesBuilder latitude(double? t) { + _latitude.value = t; + return this; + } + UpdateShiftVariablesBuilder longitude(double? t) { + _longitude.value = t; + return this; + } + UpdateShiftVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + UpdateShiftVariablesBuilder status(ShiftStatus? t) { + _status.value = t; + return this; + } + UpdateShiftVariablesBuilder workersNeeded(int? t) { + _workersNeeded.value = t; + return this; + } + UpdateShiftVariablesBuilder filled(int? t) { + _filled.value = t; + return this; + } + UpdateShiftVariablesBuilder filledAt(Timestamp? t) { + _filledAt.value = t; + return this; + } + UpdateShiftVariablesBuilder managers(List? t) { + _managers.value = t; + return this; + } + UpdateShiftVariablesBuilder durationDays(int? t) { + _durationDays.value = t; + return this; + } + + UpdateShiftVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateShiftData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateShiftVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateShiftVariables vars= UpdateShiftVariables(id: id,title: _title,orderId: _orderId,date: _date,startTime: _startTime,endTime: _endTime,hours: _hours,cost: _cost,location: _location,locationAddress: _locationAddress,latitude: _latitude,longitude: _longitude,description: _description,status: _status,workersNeeded: _workersNeeded,filled: _filled,filledAt: _filledAt,managers: _managers,durationDays: _durationDays,); + return _dataConnect.mutation("updateShift", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateShiftShiftUpdate { + final String id; + UpdateShiftShiftUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateShiftShiftUpdate otherTyped = other as UpdateShiftShiftUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateShiftShiftUpdate({ + required this.id, + }); +} + +@immutable +class UpdateShiftData { + final UpdateShiftShiftUpdate? shift_update; + UpdateShiftData.fromJson(dynamic json): + + shift_update = json['shift_update'] == null ? null : UpdateShiftShiftUpdate.fromJson(json['shift_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateShiftData otherTyped = other as UpdateShiftData; + return shift_update == otherTyped.shift_update; + + } + @override + int get hashCode => shift_update.hashCode; + + + Map toJson() { + Map json = {}; + if (shift_update != null) { + json['shift_update'] = shift_update!.toJson(); + } + return json; + } + + UpdateShiftData({ + this.shift_update, + }); +} + +@immutable +class UpdateShiftVariables { + final String id; + late final Optionaltitle; + late final OptionalorderId; + late final Optionaldate; + late final OptionalstartTime; + late final OptionalendTime; + late final Optionalhours; + late final Optionalcost; + late final Optionallocation; + late final OptionallocationAddress; + late final Optionallatitude; + late final Optionallongitude; + late final Optionaldescription; + late final Optionalstatus; + late final OptionalworkersNeeded; + late final Optionalfilled; + late final OptionalfilledAt; + late final Optional>managers; + late final OptionaldurationDays; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateShiftVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + title = Optional.optional(nativeFromJson, nativeToJson); + title.value = json['title'] == null ? null : nativeFromJson(json['title']); + + + orderId = Optional.optional(nativeFromJson, nativeToJson); + orderId.value = json['orderId'] == null ? null : nativeFromJson(json['orderId']); + + + date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer); + date.value = json['date'] == null ? null : Timestamp.fromJson(json['date']); + + + startTime = Optional.optional((json) => json['startTime'] = Timestamp.fromJson(json['startTime']), defaultSerializer); + startTime.value = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']); + + + endTime = Optional.optional((json) => json['endTime'] = Timestamp.fromJson(json['endTime']), defaultSerializer); + endTime.value = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']); + + + hours = Optional.optional(nativeFromJson, nativeToJson); + hours.value = json['hours'] == null ? null : nativeFromJson(json['hours']); + + + cost = Optional.optional(nativeFromJson, nativeToJson); + cost.value = json['cost'] == null ? null : nativeFromJson(json['cost']); + + + location = Optional.optional(nativeFromJson, nativeToJson); + location.value = json['location'] == null ? null : nativeFromJson(json['location']); + + + locationAddress = Optional.optional(nativeFromJson, nativeToJson); + locationAddress.value = json['locationAddress'] == null ? null : nativeFromJson(json['locationAddress']); + + + latitude = Optional.optional(nativeFromJson, nativeToJson); + latitude.value = json['latitude'] == null ? null : nativeFromJson(json['latitude']); + + + longitude = Optional.optional(nativeFromJson, nativeToJson); + longitude.value = json['longitude'] == null ? null : nativeFromJson(json['longitude']); + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + + status = Optional.optional((data) => ShiftStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : ShiftStatus.values.byName(json['status']); + + + workersNeeded = Optional.optional(nativeFromJson, nativeToJson); + workersNeeded.value = json['workersNeeded'] == null ? null : nativeFromJson(json['workersNeeded']); + + + filled = Optional.optional(nativeFromJson, nativeToJson); + filled.value = json['filled'] == null ? null : nativeFromJson(json['filled']); + + + filledAt = Optional.optional((json) => json['filledAt'] = Timestamp.fromJson(json['filledAt']), defaultSerializer); + filledAt.value = json['filledAt'] == null ? null : Timestamp.fromJson(json['filledAt']); + + + managers = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer)); + managers.value = json['managers'] == null ? null : (json['managers'] as List) + .map((e) => AnyValue.fromJson(e)) + .toList(); + + + durationDays = Optional.optional(nativeFromJson, nativeToJson); + durationDays.value = json['durationDays'] == null ? null : nativeFromJson(json['durationDays']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateShiftVariables otherTyped = other as UpdateShiftVariables; + return id == otherTyped.id && + title == otherTyped.title && + orderId == otherTyped.orderId && + date == otherTyped.date && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + cost == otherTyped.cost && + location == otherTyped.location && + locationAddress == otherTyped.locationAddress && + latitude == otherTyped.latitude && + longitude == otherTyped.longitude && + description == otherTyped.description && + status == otherTyped.status && + workersNeeded == otherTyped.workersNeeded && + filled == otherTyped.filled && + filledAt == otherTyped.filledAt && + managers == otherTyped.managers && + durationDays == otherTyped.durationDays; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(title.state == OptionalState.set) { + json['title'] = title.toJson(); + } + if(orderId.state == OptionalState.set) { + json['orderId'] = orderId.toJson(); + } + if(date.state == OptionalState.set) { + json['date'] = date.toJson(); + } + if(startTime.state == OptionalState.set) { + json['startTime'] = startTime.toJson(); + } + if(endTime.state == OptionalState.set) { + json['endTime'] = endTime.toJson(); + } + if(hours.state == OptionalState.set) { + json['hours'] = hours.toJson(); + } + if(cost.state == OptionalState.set) { + json['cost'] = cost.toJson(); + } + if(location.state == OptionalState.set) { + json['location'] = location.toJson(); + } + if(locationAddress.state == OptionalState.set) { + json['locationAddress'] = locationAddress.toJson(); + } + if(latitude.state == OptionalState.set) { + json['latitude'] = latitude.toJson(); + } + if(longitude.state == OptionalState.set) { + json['longitude'] = longitude.toJson(); + } + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(workersNeeded.state == OptionalState.set) { + json['workersNeeded'] = workersNeeded.toJson(); + } + if(filled.state == OptionalState.set) { + json['filled'] = filled.toJson(); + } + if(filledAt.state == OptionalState.set) { + json['filledAt'] = filledAt.toJson(); + } + if(managers.state == OptionalState.set) { + json['managers'] = managers.toJson(); + } + if(durationDays.state == OptionalState.set) { + json['durationDays'] = durationDays.toJson(); + } + return json; + } + + UpdateShiftVariables({ + required this.id, + required this.title, + required this.orderId, + required this.date, + required this.startTime, + required this.endTime, + required this.hours, + required this.cost, + required this.location, + required this.locationAddress, + required this.latitude, + required this.longitude, + required this.description, + required this.status, + required this.workersNeeded, + required this.filled, + required this.filledAt, + required this.managers, + required this.durationDays, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_shift_role.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_shift_role.dart new file mode 100644 index 00000000..e85ddb18 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_shift_role.dart @@ -0,0 +1,274 @@ +part of 'generated.dart'; + +class UpdateShiftRoleVariablesBuilder { + String shiftId; + String roleId; + Optional _count = Optional.optional(nativeFromJson, nativeToJson); + Optional _assigned = Optional.optional(nativeFromJson, nativeToJson); + Optional _startTime = Optional.optional((json) => json['startTime'] = Timestamp.fromJson(json['startTime']), defaultSerializer); + Optional _endTime = Optional.optional((json) => json['endTime'] = Timestamp.fromJson(json['endTime']), defaultSerializer); + Optional _hours = Optional.optional(nativeFromJson, nativeToJson); + Optional _department = Optional.optional(nativeFromJson, nativeToJson); + Optional _uniform = Optional.optional(nativeFromJson, nativeToJson); + Optional _breakType = Optional.optional((data) => BreakDuration.values.byName(data), enumSerializer); + Optional _totalValue = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateShiftRoleVariablesBuilder count(int? t) { + _count.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder assigned(int? t) { + _assigned.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder startTime(Timestamp? t) { + _startTime.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder endTime(Timestamp? t) { + _endTime.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder hours(double? t) { + _hours.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder department(String? t) { + _department.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder uniform(String? t) { + _uniform.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder breakType(BreakDuration? t) { + _breakType.value = t; + return this; + } + UpdateShiftRoleVariablesBuilder totalValue(double? t) { + _totalValue.value = t; + return this; + } + + UpdateShiftRoleVariablesBuilder(this._dataConnect, {required this.shiftId,required this.roleId,}); + Deserializer dataDeserializer = (dynamic json) => UpdateShiftRoleData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateShiftRoleVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateShiftRoleVariables vars= UpdateShiftRoleVariables(shiftId: shiftId,roleId: roleId,count: _count,assigned: _assigned,startTime: _startTime,endTime: _endTime,hours: _hours,department: _department,uniform: _uniform,breakType: _breakType,totalValue: _totalValue,); + return _dataConnect.mutation("updateShiftRole", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateShiftRoleShiftRoleUpdate { + final String shiftId; + final String roleId; + UpdateShiftRoleShiftRoleUpdate.fromJson(dynamic json): + + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateShiftRoleShiftRoleUpdate otherTyped = other as UpdateShiftRoleShiftRoleUpdate; + return shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + return json; + } + + UpdateShiftRoleShiftRoleUpdate({ + required this.shiftId, + required this.roleId, + }); +} + +@immutable +class UpdateShiftRoleData { + final UpdateShiftRoleShiftRoleUpdate? shiftRole_update; + UpdateShiftRoleData.fromJson(dynamic json): + + shiftRole_update = json['shiftRole_update'] == null ? null : UpdateShiftRoleShiftRoleUpdate.fromJson(json['shiftRole_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateShiftRoleData otherTyped = other as UpdateShiftRoleData; + return shiftRole_update == otherTyped.shiftRole_update; + + } + @override + int get hashCode => shiftRole_update.hashCode; + + + Map toJson() { + Map json = {}; + if (shiftRole_update != null) { + json['shiftRole_update'] = shiftRole_update!.toJson(); + } + return json; + } + + UpdateShiftRoleData({ + this.shiftRole_update, + }); +} + +@immutable +class UpdateShiftRoleVariables { + final String shiftId; + final String roleId; + late final Optionalcount; + late final Optionalassigned; + late final OptionalstartTime; + late final OptionalendTime; + late final Optionalhours; + late final Optionaldepartment; + late final Optionaluniform; + late final OptionalbreakType; + late final OptionaltotalValue; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateShiftRoleVariables.fromJson(Map json): + + shiftId = nativeFromJson(json['shiftId']), + roleId = nativeFromJson(json['roleId']) { + + + + + count = Optional.optional(nativeFromJson, nativeToJson); + count.value = json['count'] == null ? null : nativeFromJson(json['count']); + + + assigned = Optional.optional(nativeFromJson, nativeToJson); + assigned.value = json['assigned'] == null ? null : nativeFromJson(json['assigned']); + + + startTime = Optional.optional((json) => json['startTime'] = Timestamp.fromJson(json['startTime']), defaultSerializer); + startTime.value = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']); + + + endTime = Optional.optional((json) => json['endTime'] = Timestamp.fromJson(json['endTime']), defaultSerializer); + endTime.value = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']); + + + hours = Optional.optional(nativeFromJson, nativeToJson); + hours.value = json['hours'] == null ? null : nativeFromJson(json['hours']); + + + department = Optional.optional(nativeFromJson, nativeToJson); + department.value = json['department'] == null ? null : nativeFromJson(json['department']); + + + uniform = Optional.optional(nativeFromJson, nativeToJson); + uniform.value = json['uniform'] == null ? null : nativeFromJson(json['uniform']); + + + breakType = Optional.optional((data) => BreakDuration.values.byName(data), enumSerializer); + breakType.value = json['breakType'] == null ? null : BreakDuration.values.byName(json['breakType']); + + + totalValue = Optional.optional(nativeFromJson, nativeToJson); + totalValue.value = json['totalValue'] == null ? null : nativeFromJson(json['totalValue']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateShiftRoleVariables otherTyped = other as UpdateShiftRoleVariables; + return shiftId == otherTyped.shiftId && + roleId == otherTyped.roleId && + count == otherTyped.count && + assigned == otherTyped.assigned && + startTime == otherTyped.startTime && + endTime == otherTyped.endTime && + hours == otherTyped.hours && + department == otherTyped.department && + uniform == otherTyped.uniform && + breakType == otherTyped.breakType && + totalValue == otherTyped.totalValue; + + } + @override + int get hashCode => Object.hashAll([shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, department.hashCode, uniform.hashCode, breakType.hashCode, totalValue.hashCode]); + + + Map toJson() { + Map json = {}; + json['shiftId'] = nativeToJson(shiftId); + json['roleId'] = nativeToJson(roleId); + if(count.state == OptionalState.set) { + json['count'] = count.toJson(); + } + if(assigned.state == OptionalState.set) { + json['assigned'] = assigned.toJson(); + } + if(startTime.state == OptionalState.set) { + json['startTime'] = startTime.toJson(); + } + if(endTime.state == OptionalState.set) { + json['endTime'] = endTime.toJson(); + } + if(hours.state == OptionalState.set) { + json['hours'] = hours.toJson(); + } + if(department.state == OptionalState.set) { + json['department'] = department.toJson(); + } + if(uniform.state == OptionalState.set) { + json['uniform'] = uniform.toJson(); + } + if(breakType.state == OptionalState.set) { + json['breakType'] = breakType.toJson(); + } + if(totalValue.state == OptionalState.set) { + json['totalValue'] = totalValue.toJson(); + } + return json; + } + + UpdateShiftRoleVariables({ + required this.shiftId, + required this.roleId, + required this.count, + required this.assigned, + required this.startTime, + required this.endTime, + required this.hours, + required this.department, + required this.uniform, + required this.breakType, + required this.totalValue, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff.dart new file mode 100644 index 00000000..2c7a7a26 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff.dart @@ -0,0 +1,622 @@ +part of 'generated.dart'; + +class UpdateStaffVariablesBuilder { + String id; + Optional _userId = Optional.optional(nativeFromJson, nativeToJson); + Optional _fullName = Optional.optional(nativeFromJson, nativeToJson); + Optional _level = Optional.optional(nativeFromJson, nativeToJson); + Optional _role = Optional.optional(nativeFromJson, nativeToJson); + Optional _phone = Optional.optional(nativeFromJson, nativeToJson); + Optional _email = Optional.optional(nativeFromJson, nativeToJson); + Optional _photoUrl = Optional.optional(nativeFromJson, nativeToJson); + Optional _totalShifts = Optional.optional(nativeFromJson, nativeToJson); + Optional _averageRating = Optional.optional(nativeFromJson, nativeToJson); + Optional _onTimeRate = Optional.optional(nativeFromJson, nativeToJson); + Optional _noShowCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _cancellationCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _reliabilityScore = Optional.optional(nativeFromJson, nativeToJson); + Optional _bio = Optional.optional(nativeFromJson, nativeToJson); + Optional _industries = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _preferredLocations = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _maxDistanceMiles = Optional.optional(nativeFromJson, nativeToJson); + Optional _languages = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _itemsAttire = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _xp = Optional.optional(nativeFromJson, nativeToJson); + Optional _badges = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _isRecommended = Optional.optional(nativeFromJson, nativeToJson); + Optional _ownerId = Optional.optional(nativeFromJson, nativeToJson); + Optional _department = Optional.optional((data) => DepartmentType.values.byName(data), enumSerializer); + Optional _hubId = Optional.optional(nativeFromJson, nativeToJson); + Optional _manager = Optional.optional(nativeFromJson, nativeToJson); + Optional _english = Optional.optional((data) => EnglishProficiency.values.byName(data), enumSerializer); + Optional _backgroundCheckStatus = Optional.optional((data) => BackgroundCheckStatus.values.byName(data), enumSerializer); + Optional _employmentType = Optional.optional((data) => EmploymentType.values.byName(data), enumSerializer); + Optional _initial = Optional.optional(nativeFromJson, nativeToJson); + Optional _englishRequired = Optional.optional(nativeFromJson, nativeToJson); + Optional _city = Optional.optional(nativeFromJson, nativeToJson); + Optional _addres = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateStaffVariablesBuilder userId(String? t) { + _userId.value = t; + return this; + } + UpdateStaffVariablesBuilder fullName(String? t) { + _fullName.value = t; + return this; + } + UpdateStaffVariablesBuilder level(String? t) { + _level.value = t; + return this; + } + UpdateStaffVariablesBuilder role(String? t) { + _role.value = t; + return this; + } + UpdateStaffVariablesBuilder phone(String? t) { + _phone.value = t; + return this; + } + UpdateStaffVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + UpdateStaffVariablesBuilder photoUrl(String? t) { + _photoUrl.value = t; + return this; + } + UpdateStaffVariablesBuilder totalShifts(int? t) { + _totalShifts.value = t; + return this; + } + UpdateStaffVariablesBuilder averageRating(double? t) { + _averageRating.value = t; + return this; + } + UpdateStaffVariablesBuilder onTimeRate(int? t) { + _onTimeRate.value = t; + return this; + } + UpdateStaffVariablesBuilder noShowCount(int? t) { + _noShowCount.value = t; + return this; + } + UpdateStaffVariablesBuilder cancellationCount(int? t) { + _cancellationCount.value = t; + return this; + } + UpdateStaffVariablesBuilder reliabilityScore(int? t) { + _reliabilityScore.value = t; + return this; + } + UpdateStaffVariablesBuilder bio(String? t) { + _bio.value = t; + return this; + } + UpdateStaffVariablesBuilder industries(AnyValue? t) { + _industries.value = t; + return this; + } + UpdateStaffVariablesBuilder preferredLocations(AnyValue? t) { + _preferredLocations.value = t; + return this; + } + UpdateStaffVariablesBuilder maxDistanceMiles(int? t) { + _maxDistanceMiles.value = t; + return this; + } + UpdateStaffVariablesBuilder languages(AnyValue? t) { + _languages.value = t; + return this; + } + UpdateStaffVariablesBuilder itemsAttire(AnyValue? t) { + _itemsAttire.value = t; + return this; + } + UpdateStaffVariablesBuilder xp(int? t) { + _xp.value = t; + return this; + } + UpdateStaffVariablesBuilder badges(AnyValue? t) { + _badges.value = t; + return this; + } + UpdateStaffVariablesBuilder isRecommended(bool? t) { + _isRecommended.value = t; + return this; + } + UpdateStaffVariablesBuilder ownerId(String? t) { + _ownerId.value = t; + return this; + } + UpdateStaffVariablesBuilder department(DepartmentType? t) { + _department.value = t; + return this; + } + UpdateStaffVariablesBuilder hubId(String? t) { + _hubId.value = t; + return this; + } + UpdateStaffVariablesBuilder manager(String? t) { + _manager.value = t; + return this; + } + UpdateStaffVariablesBuilder english(EnglishProficiency? t) { + _english.value = t; + return this; + } + UpdateStaffVariablesBuilder backgroundCheckStatus(BackgroundCheckStatus? t) { + _backgroundCheckStatus.value = t; + return this; + } + UpdateStaffVariablesBuilder employmentType(EmploymentType? t) { + _employmentType.value = t; + return this; + } + UpdateStaffVariablesBuilder initial(String? t) { + _initial.value = t; + return this; + } + UpdateStaffVariablesBuilder englishRequired(bool? t) { + _englishRequired.value = t; + return this; + } + UpdateStaffVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + UpdateStaffVariablesBuilder addres(String? t) { + _addres.value = t; + return this; + } + + UpdateStaffVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateStaffData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateStaffVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateStaffVariables vars= UpdateStaffVariables(id: id,userId: _userId,fullName: _fullName,level: _level,role: _role,phone: _phone,email: _email,photoUrl: _photoUrl,totalShifts: _totalShifts,averageRating: _averageRating,onTimeRate: _onTimeRate,noShowCount: _noShowCount,cancellationCount: _cancellationCount,reliabilityScore: _reliabilityScore,bio: _bio,industries: _industries,preferredLocations: _preferredLocations,maxDistanceMiles: _maxDistanceMiles,languages: _languages,itemsAttire: _itemsAttire,xp: _xp,badges: _badges,isRecommended: _isRecommended,ownerId: _ownerId,department: _department,hubId: _hubId,manager: _manager,english: _english,backgroundCheckStatus: _backgroundCheckStatus,employmentType: _employmentType,initial: _initial,englishRequired: _englishRequired,city: _city,addres: _addres,); + return _dataConnect.mutation("UpdateStaff", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateStaffStaffUpdate { + final String id; + UpdateStaffStaffUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffStaffUpdate otherTyped = other as UpdateStaffStaffUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateStaffStaffUpdate({ + required this.id, + }); +} + +@immutable +class UpdateStaffData { + final UpdateStaffStaffUpdate? staff_update; + UpdateStaffData.fromJson(dynamic json): + + staff_update = json['staff_update'] == null ? null : UpdateStaffStaffUpdate.fromJson(json['staff_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffData otherTyped = other as UpdateStaffData; + return staff_update == otherTyped.staff_update; + + } + @override + int get hashCode => staff_update.hashCode; + + + Map toJson() { + Map json = {}; + if (staff_update != null) { + json['staff_update'] = staff_update!.toJson(); + } + return json; + } + + UpdateStaffData({ + this.staff_update, + }); +} + +@immutable +class UpdateStaffVariables { + final String id; + late final OptionaluserId; + late final OptionalfullName; + late final Optionallevel; + late final Optionalrole; + late final Optionalphone; + late final Optionalemail; + late final OptionalphotoUrl; + late final OptionaltotalShifts; + late final OptionalaverageRating; + late final OptionalonTimeRate; + late final OptionalnoShowCount; + late final OptionalcancellationCount; + late final OptionalreliabilityScore; + late final Optionalbio; + late final Optionalindustries; + late final OptionalpreferredLocations; + late final OptionalmaxDistanceMiles; + late final Optionallanguages; + late final OptionalitemsAttire; + late final Optionalxp; + late final Optionalbadges; + late final OptionalisRecommended; + late final OptionalownerId; + late final Optionaldepartment; + late final OptionalhubId; + late final Optionalmanager; + late final Optionalenglish; + late final OptionalbackgroundCheckStatus; + late final OptionalemploymentType; + late final Optionalinitial; + late final OptionalenglishRequired; + late final Optionalcity; + late final Optionaladdres; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateStaffVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + userId = Optional.optional(nativeFromJson, nativeToJson); + userId.value = json['userId'] == null ? null : nativeFromJson(json['userId']); + + + fullName = Optional.optional(nativeFromJson, nativeToJson); + fullName.value = json['fullName'] == null ? null : nativeFromJson(json['fullName']); + + + level = Optional.optional(nativeFromJson, nativeToJson); + level.value = json['level'] == null ? null : nativeFromJson(json['level']); + + + role = Optional.optional(nativeFromJson, nativeToJson); + role.value = json['role'] == null ? null : nativeFromJson(json['role']); + + + phone = Optional.optional(nativeFromJson, nativeToJson); + phone.value = json['phone'] == null ? null : nativeFromJson(json['phone']); + + + email = Optional.optional(nativeFromJson, nativeToJson); + email.value = json['email'] == null ? null : nativeFromJson(json['email']); + + + photoUrl = Optional.optional(nativeFromJson, nativeToJson); + photoUrl.value = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + + + totalShifts = Optional.optional(nativeFromJson, nativeToJson); + totalShifts.value = json['totalShifts'] == null ? null : nativeFromJson(json['totalShifts']); + + + averageRating = Optional.optional(nativeFromJson, nativeToJson); + averageRating.value = json['averageRating'] == null ? null : nativeFromJson(json['averageRating']); + + + onTimeRate = Optional.optional(nativeFromJson, nativeToJson); + onTimeRate.value = json['onTimeRate'] == null ? null : nativeFromJson(json['onTimeRate']); + + + noShowCount = Optional.optional(nativeFromJson, nativeToJson); + noShowCount.value = json['noShowCount'] == null ? null : nativeFromJson(json['noShowCount']); + + + cancellationCount = Optional.optional(nativeFromJson, nativeToJson); + cancellationCount.value = json['cancellationCount'] == null ? null : nativeFromJson(json['cancellationCount']); + + + reliabilityScore = Optional.optional(nativeFromJson, nativeToJson); + reliabilityScore.value = json['reliabilityScore'] == null ? null : nativeFromJson(json['reliabilityScore']); + + + bio = Optional.optional(nativeFromJson, nativeToJson); + bio.value = json['bio'] == null ? null : nativeFromJson(json['bio']); + + + industries = Optional.optional(AnyValue.fromJson, defaultSerializer); + industries.value = json['industries'] == null ? null : AnyValue.fromJson(json['industries']); + + + preferredLocations = Optional.optional(AnyValue.fromJson, defaultSerializer); + preferredLocations.value = json['preferredLocations'] == null ? null : AnyValue.fromJson(json['preferredLocations']); + + + maxDistanceMiles = Optional.optional(nativeFromJson, nativeToJson); + maxDistanceMiles.value = json['maxDistanceMiles'] == null ? null : nativeFromJson(json['maxDistanceMiles']); + + + languages = Optional.optional(AnyValue.fromJson, defaultSerializer); + languages.value = json['languages'] == null ? null : AnyValue.fromJson(json['languages']); + + + itemsAttire = Optional.optional(AnyValue.fromJson, defaultSerializer); + itemsAttire.value = json['itemsAttire'] == null ? null : AnyValue.fromJson(json['itemsAttire']); + + + xp = Optional.optional(nativeFromJson, nativeToJson); + xp.value = json['xp'] == null ? null : nativeFromJson(json['xp']); + + + badges = Optional.optional(AnyValue.fromJson, defaultSerializer); + badges.value = json['badges'] == null ? null : AnyValue.fromJson(json['badges']); + + + isRecommended = Optional.optional(nativeFromJson, nativeToJson); + isRecommended.value = json['isRecommended'] == null ? null : nativeFromJson(json['isRecommended']); + + + ownerId = Optional.optional(nativeFromJson, nativeToJson); + ownerId.value = json['ownerId'] == null ? null : nativeFromJson(json['ownerId']); + + + department = Optional.optional((data) => DepartmentType.values.byName(data), enumSerializer); + department.value = json['department'] == null ? null : DepartmentType.values.byName(json['department']); + + + hubId = Optional.optional(nativeFromJson, nativeToJson); + hubId.value = json['hubId'] == null ? null : nativeFromJson(json['hubId']); + + + manager = Optional.optional(nativeFromJson, nativeToJson); + manager.value = json['manager'] == null ? null : nativeFromJson(json['manager']); + + + english = Optional.optional((data) => EnglishProficiency.values.byName(data), enumSerializer); + english.value = json['english'] == null ? null : EnglishProficiency.values.byName(json['english']); + + + backgroundCheckStatus = Optional.optional((data) => BackgroundCheckStatus.values.byName(data), enumSerializer); + backgroundCheckStatus.value = json['backgroundCheckStatus'] == null ? null : BackgroundCheckStatus.values.byName(json['backgroundCheckStatus']); + + + employmentType = Optional.optional((data) => EmploymentType.values.byName(data), enumSerializer); + employmentType.value = json['employmentType'] == null ? null : EmploymentType.values.byName(json['employmentType']); + + + initial = Optional.optional(nativeFromJson, nativeToJson); + initial.value = json['initial'] == null ? null : nativeFromJson(json['initial']); + + + englishRequired = Optional.optional(nativeFromJson, nativeToJson); + englishRequired.value = json['englishRequired'] == null ? null : nativeFromJson(json['englishRequired']); + + + city = Optional.optional(nativeFromJson, nativeToJson); + city.value = json['city'] == null ? null : nativeFromJson(json['city']); + + + addres = Optional.optional(nativeFromJson, nativeToJson); + addres.value = json['addres'] == null ? null : nativeFromJson(json['addres']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffVariables otherTyped = other as UpdateStaffVariables; + return id == otherTyped.id && + userId == otherTyped.userId && + fullName == otherTyped.fullName && + level == otherTyped.level && + role == otherTyped.role && + phone == otherTyped.phone && + email == otherTyped.email && + photoUrl == otherTyped.photoUrl && + totalShifts == otherTyped.totalShifts && + averageRating == otherTyped.averageRating && + onTimeRate == otherTyped.onTimeRate && + noShowCount == otherTyped.noShowCount && + cancellationCount == otherTyped.cancellationCount && + reliabilityScore == otherTyped.reliabilityScore && + bio == otherTyped.bio && + industries == otherTyped.industries && + preferredLocations == otherTyped.preferredLocations && + maxDistanceMiles == otherTyped.maxDistanceMiles && + languages == otherTyped.languages && + itemsAttire == otherTyped.itemsAttire && + xp == otherTyped.xp && + badges == otherTyped.badges && + isRecommended == otherTyped.isRecommended && + ownerId == otherTyped.ownerId && + department == otherTyped.department && + hubId == otherTyped.hubId && + manager == otherTyped.manager && + english == otherTyped.english && + backgroundCheckStatus == otherTyped.backgroundCheckStatus && + employmentType == otherTyped.employmentType && + initial == otherTyped.initial && + englishRequired == otherTyped.englishRequired && + city == otherTyped.city && + addres == otherTyped.addres; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, fullName.hashCode, level.hashCode, role.hashCode, phone.hashCode, email.hashCode, photoUrl.hashCode, totalShifts.hashCode, averageRating.hashCode, onTimeRate.hashCode, noShowCount.hashCode, cancellationCount.hashCode, reliabilityScore.hashCode, bio.hashCode, industries.hashCode, preferredLocations.hashCode, maxDistanceMiles.hashCode, languages.hashCode, itemsAttire.hashCode, xp.hashCode, badges.hashCode, isRecommended.hashCode, ownerId.hashCode, department.hashCode, hubId.hashCode, manager.hashCode, english.hashCode, backgroundCheckStatus.hashCode, employmentType.hashCode, initial.hashCode, englishRequired.hashCode, city.hashCode, addres.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(userId.state == OptionalState.set) { + json['userId'] = userId.toJson(); + } + if(fullName.state == OptionalState.set) { + json['fullName'] = fullName.toJson(); + } + if(level.state == OptionalState.set) { + json['level'] = level.toJson(); + } + if(role.state == OptionalState.set) { + json['role'] = role.toJson(); + } + if(phone.state == OptionalState.set) { + json['phone'] = phone.toJson(); + } + if(email.state == OptionalState.set) { + json['email'] = email.toJson(); + } + if(photoUrl.state == OptionalState.set) { + json['photoUrl'] = photoUrl.toJson(); + } + if(totalShifts.state == OptionalState.set) { + json['totalShifts'] = totalShifts.toJson(); + } + if(averageRating.state == OptionalState.set) { + json['averageRating'] = averageRating.toJson(); + } + if(onTimeRate.state == OptionalState.set) { + json['onTimeRate'] = onTimeRate.toJson(); + } + if(noShowCount.state == OptionalState.set) { + json['noShowCount'] = noShowCount.toJson(); + } + if(cancellationCount.state == OptionalState.set) { + json['cancellationCount'] = cancellationCount.toJson(); + } + if(reliabilityScore.state == OptionalState.set) { + json['reliabilityScore'] = reliabilityScore.toJson(); + } + if(bio.state == OptionalState.set) { + json['bio'] = bio.toJson(); + } + if(industries.state == OptionalState.set) { + json['industries'] = industries.toJson(); + } + if(preferredLocations.state == OptionalState.set) { + json['preferredLocations'] = preferredLocations.toJson(); + } + if(maxDistanceMiles.state == OptionalState.set) { + json['maxDistanceMiles'] = maxDistanceMiles.toJson(); + } + if(languages.state == OptionalState.set) { + json['languages'] = languages.toJson(); + } + if(itemsAttire.state == OptionalState.set) { + json['itemsAttire'] = itemsAttire.toJson(); + } + if(xp.state == OptionalState.set) { + json['xp'] = xp.toJson(); + } + if(badges.state == OptionalState.set) { + json['badges'] = badges.toJson(); + } + if(isRecommended.state == OptionalState.set) { + json['isRecommended'] = isRecommended.toJson(); + } + if(ownerId.state == OptionalState.set) { + json['ownerId'] = ownerId.toJson(); + } + if(department.state == OptionalState.set) { + json['department'] = department.toJson(); + } + if(hubId.state == OptionalState.set) { + json['hubId'] = hubId.toJson(); + } + if(manager.state == OptionalState.set) { + json['manager'] = manager.toJson(); + } + if(english.state == OptionalState.set) { + json['english'] = english.toJson(); + } + if(backgroundCheckStatus.state == OptionalState.set) { + json['backgroundCheckStatus'] = backgroundCheckStatus.toJson(); + } + if(employmentType.state == OptionalState.set) { + json['employmentType'] = employmentType.toJson(); + } + if(initial.state == OptionalState.set) { + json['initial'] = initial.toJson(); + } + if(englishRequired.state == OptionalState.set) { + json['englishRequired'] = englishRequired.toJson(); + } + if(city.state == OptionalState.set) { + json['city'] = city.toJson(); + } + if(addres.state == OptionalState.set) { + json['addres'] = addres.toJson(); + } + return json; + } + + UpdateStaffVariables({ + required this.id, + required this.userId, + required this.fullName, + required this.level, + required this.role, + required this.phone, + required this.email, + required this.photoUrl, + required this.totalShifts, + required this.averageRating, + required this.onTimeRate, + required this.noShowCount, + required this.cancellationCount, + required this.reliabilityScore, + required this.bio, + required this.industries, + required this.preferredLocations, + required this.maxDistanceMiles, + required this.languages, + required this.itemsAttire, + required this.xp, + required this.badges, + required this.isRecommended, + required this.ownerId, + required this.department, + required this.hubId, + required this.manager, + required this.english, + required this.backgroundCheckStatus, + required this.employmentType, + required this.initial, + required this.englishRequired, + required this.city, + required this.addres, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff_availability.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff_availability.dart new file mode 100644 index 00000000..d8d4009a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff_availability.dart @@ -0,0 +1,189 @@ +part of 'generated.dart'; + +class UpdateStaffAvailabilityVariablesBuilder { + String staffId; + DayOfWeek day; + AvailabilitySlot slot; + Optional _status = Optional.optional((data) => AvailabilityStatus.values.byName(data), enumSerializer); + Optional _notes = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateStaffAvailabilityVariablesBuilder status(AvailabilityStatus? t) { + _status.value = t; + return this; + } + UpdateStaffAvailabilityVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + + UpdateStaffAvailabilityVariablesBuilder(this._dataConnect, {required this.staffId,required this.day,required this.slot,}); + Deserializer dataDeserializer = (dynamic json) => UpdateStaffAvailabilityData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateStaffAvailabilityVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateStaffAvailabilityVariables vars= UpdateStaffAvailabilityVariables(staffId: staffId,day: day,slot: slot,status: _status,notes: _notes,); + return _dataConnect.mutation("updateStaffAvailability", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateStaffAvailabilityStaffAvailabilityUpdate { + final String staffId; + final EnumValue day; + final EnumValue slot; + UpdateStaffAvailabilityStaffAvailabilityUpdate.fromJson(dynamic json): + + staffId = nativeFromJson(json['staffId']), + day = dayOfWeekDeserializer(json['day']), + slot = availabilitySlotDeserializer(json['slot']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffAvailabilityStaffAvailabilityUpdate otherTyped = other as UpdateStaffAvailabilityStaffAvailabilityUpdate; + return staffId == otherTyped.staffId && + day == otherTyped.day && + slot == otherTyped.slot; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, day.hashCode, slot.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['day'] = + dayOfWeekSerializer(day) + ; + json['slot'] = + availabilitySlotSerializer(slot) + ; + return json; + } + + UpdateStaffAvailabilityStaffAvailabilityUpdate({ + required this.staffId, + required this.day, + required this.slot, + }); +} + +@immutable +class UpdateStaffAvailabilityData { + final UpdateStaffAvailabilityStaffAvailabilityUpdate? staffAvailability_update; + UpdateStaffAvailabilityData.fromJson(dynamic json): + + staffAvailability_update = json['staffAvailability_update'] == null ? null : UpdateStaffAvailabilityStaffAvailabilityUpdate.fromJson(json['staffAvailability_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffAvailabilityData otherTyped = other as UpdateStaffAvailabilityData; + return staffAvailability_update == otherTyped.staffAvailability_update; + + } + @override + int get hashCode => staffAvailability_update.hashCode; + + + Map toJson() { + Map json = {}; + if (staffAvailability_update != null) { + json['staffAvailability_update'] = staffAvailability_update!.toJson(); + } + return json; + } + + UpdateStaffAvailabilityData({ + this.staffAvailability_update, + }); +} + +@immutable +class UpdateStaffAvailabilityVariables { + final String staffId; + final DayOfWeek day; + final AvailabilitySlot slot; + late final Optionalstatus; + late final Optionalnotes; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateStaffAvailabilityVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + day = DayOfWeek.values.byName(json['day']), + slot = AvailabilitySlot.values.byName(json['slot']) { + + + + + + status = Optional.optional((data) => AvailabilityStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : AvailabilityStatus.values.byName(json['status']); + + + notes = Optional.optional(nativeFromJson, nativeToJson); + notes.value = json['notes'] == null ? null : nativeFromJson(json['notes']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffAvailabilityVariables otherTyped = other as UpdateStaffAvailabilityVariables; + return staffId == otherTyped.staffId && + day == otherTyped.day && + slot == otherTyped.slot && + status == otherTyped.status && + notes == otherTyped.notes; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, day.hashCode, slot.hashCode, status.hashCode, notes.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['day'] = + day.name + ; + json['slot'] = + slot.name + ; + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(notes.state == OptionalState.set) { + json['notes'] = notes.toJson(); + } + return json; + } + + UpdateStaffAvailabilityVariables({ + required this.staffId, + required this.day, + required this.slot, + required this.status, + required this.notes, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff_availability_stats.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff_availability_stats.dart new file mode 100644 index 00000000..860769a1 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff_availability_stats.dart @@ -0,0 +1,232 @@ +part of 'generated.dart'; + +class UpdateStaffAvailabilityStatsVariablesBuilder { + String staffId; + Optional _needWorkIndex = Optional.optional(nativeFromJson, nativeToJson); + Optional _utilizationPercentage = Optional.optional(nativeFromJson, nativeToJson); + Optional _predictedAvailabilityScore = Optional.optional(nativeFromJson, nativeToJson); + Optional _scheduledHoursThisPeriod = Optional.optional(nativeFromJson, nativeToJson); + Optional _desiredHoursThisPeriod = Optional.optional(nativeFromJson, nativeToJson); + Optional _lastShiftDate = Optional.optional((json) => json['lastShiftDate'] = Timestamp.fromJson(json['lastShiftDate']), defaultSerializer); + Optional _acceptanceRate = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateStaffAvailabilityStatsVariablesBuilder needWorkIndex(int? t) { + _needWorkIndex.value = t; + return this; + } + UpdateStaffAvailabilityStatsVariablesBuilder utilizationPercentage(int? t) { + _utilizationPercentage.value = t; + return this; + } + UpdateStaffAvailabilityStatsVariablesBuilder predictedAvailabilityScore(int? t) { + _predictedAvailabilityScore.value = t; + return this; + } + UpdateStaffAvailabilityStatsVariablesBuilder scheduledHoursThisPeriod(int? t) { + _scheduledHoursThisPeriod.value = t; + return this; + } + UpdateStaffAvailabilityStatsVariablesBuilder desiredHoursThisPeriod(int? t) { + _desiredHoursThisPeriod.value = t; + return this; + } + UpdateStaffAvailabilityStatsVariablesBuilder lastShiftDate(Timestamp? t) { + _lastShiftDate.value = t; + return this; + } + UpdateStaffAvailabilityStatsVariablesBuilder acceptanceRate(int? t) { + _acceptanceRate.value = t; + return this; + } + + UpdateStaffAvailabilityStatsVariablesBuilder(this._dataConnect, {required this.staffId,}); + Deserializer dataDeserializer = (dynamic json) => UpdateStaffAvailabilityStatsData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateStaffAvailabilityStatsVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateStaffAvailabilityStatsVariables vars= UpdateStaffAvailabilityStatsVariables(staffId: staffId,needWorkIndex: _needWorkIndex,utilizationPercentage: _utilizationPercentage,predictedAvailabilityScore: _predictedAvailabilityScore,scheduledHoursThisPeriod: _scheduledHoursThisPeriod,desiredHoursThisPeriod: _desiredHoursThisPeriod,lastShiftDate: _lastShiftDate,acceptanceRate: _acceptanceRate,); + return _dataConnect.mutation("updateStaffAvailabilityStats", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateStaffAvailabilityStatsStaffAvailabilityStatsUpdate { + final String staffId; + UpdateStaffAvailabilityStatsStaffAvailabilityStatsUpdate.fromJson(dynamic json): + + staffId = nativeFromJson(json['staffId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffAvailabilityStatsStaffAvailabilityStatsUpdate otherTyped = other as UpdateStaffAvailabilityStatsStaffAvailabilityStatsUpdate; + return staffId == otherTyped.staffId; + + } + @override + int get hashCode => staffId.hashCode; + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + return json; + } + + UpdateStaffAvailabilityStatsStaffAvailabilityStatsUpdate({ + required this.staffId, + }); +} + +@immutable +class UpdateStaffAvailabilityStatsData { + final UpdateStaffAvailabilityStatsStaffAvailabilityStatsUpdate? staffAvailabilityStats_update; + UpdateStaffAvailabilityStatsData.fromJson(dynamic json): + + staffAvailabilityStats_update = json['staffAvailabilityStats_update'] == null ? null : UpdateStaffAvailabilityStatsStaffAvailabilityStatsUpdate.fromJson(json['staffAvailabilityStats_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffAvailabilityStatsData otherTyped = other as UpdateStaffAvailabilityStatsData; + return staffAvailabilityStats_update == otherTyped.staffAvailabilityStats_update; + + } + @override + int get hashCode => staffAvailabilityStats_update.hashCode; + + + Map toJson() { + Map json = {}; + if (staffAvailabilityStats_update != null) { + json['staffAvailabilityStats_update'] = staffAvailabilityStats_update!.toJson(); + } + return json; + } + + UpdateStaffAvailabilityStatsData({ + this.staffAvailabilityStats_update, + }); +} + +@immutable +class UpdateStaffAvailabilityStatsVariables { + final String staffId; + late final OptionalneedWorkIndex; + late final OptionalutilizationPercentage; + late final OptionalpredictedAvailabilityScore; + late final OptionalscheduledHoursThisPeriod; + late final OptionaldesiredHoursThisPeriod; + late final OptionallastShiftDate; + late final OptionalacceptanceRate; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateStaffAvailabilityStatsVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']) { + + + + needWorkIndex = Optional.optional(nativeFromJson, nativeToJson); + needWorkIndex.value = json['needWorkIndex'] == null ? null : nativeFromJson(json['needWorkIndex']); + + + utilizationPercentage = Optional.optional(nativeFromJson, nativeToJson); + utilizationPercentage.value = json['utilizationPercentage'] == null ? null : nativeFromJson(json['utilizationPercentage']); + + + predictedAvailabilityScore = Optional.optional(nativeFromJson, nativeToJson); + predictedAvailabilityScore.value = json['predictedAvailabilityScore'] == null ? null : nativeFromJson(json['predictedAvailabilityScore']); + + + scheduledHoursThisPeriod = Optional.optional(nativeFromJson, nativeToJson); + scheduledHoursThisPeriod.value = json['scheduledHoursThisPeriod'] == null ? null : nativeFromJson(json['scheduledHoursThisPeriod']); + + + desiredHoursThisPeriod = Optional.optional(nativeFromJson, nativeToJson); + desiredHoursThisPeriod.value = json['desiredHoursThisPeriod'] == null ? null : nativeFromJson(json['desiredHoursThisPeriod']); + + + lastShiftDate = Optional.optional((json) => json['lastShiftDate'] = Timestamp.fromJson(json['lastShiftDate']), defaultSerializer); + lastShiftDate.value = json['lastShiftDate'] == null ? null : Timestamp.fromJson(json['lastShiftDate']); + + + acceptanceRate = Optional.optional(nativeFromJson, nativeToJson); + acceptanceRate.value = json['acceptanceRate'] == null ? null : nativeFromJson(json['acceptanceRate']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffAvailabilityStatsVariables otherTyped = other as UpdateStaffAvailabilityStatsVariables; + return staffId == otherTyped.staffId && + needWorkIndex == otherTyped.needWorkIndex && + utilizationPercentage == otherTyped.utilizationPercentage && + predictedAvailabilityScore == otherTyped.predictedAvailabilityScore && + scheduledHoursThisPeriod == otherTyped.scheduledHoursThisPeriod && + desiredHoursThisPeriod == otherTyped.desiredHoursThisPeriod && + lastShiftDate == otherTyped.lastShiftDate && + acceptanceRate == otherTyped.acceptanceRate; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, needWorkIndex.hashCode, utilizationPercentage.hashCode, predictedAvailabilityScore.hashCode, scheduledHoursThisPeriod.hashCode, desiredHoursThisPeriod.hashCode, lastShiftDate.hashCode, acceptanceRate.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + if(needWorkIndex.state == OptionalState.set) { + json['needWorkIndex'] = needWorkIndex.toJson(); + } + if(utilizationPercentage.state == OptionalState.set) { + json['utilizationPercentage'] = utilizationPercentage.toJson(); + } + if(predictedAvailabilityScore.state == OptionalState.set) { + json['predictedAvailabilityScore'] = predictedAvailabilityScore.toJson(); + } + if(scheduledHoursThisPeriod.state == OptionalState.set) { + json['scheduledHoursThisPeriod'] = scheduledHoursThisPeriod.toJson(); + } + if(desiredHoursThisPeriod.state == OptionalState.set) { + json['desiredHoursThisPeriod'] = desiredHoursThisPeriod.toJson(); + } + if(lastShiftDate.state == OptionalState.set) { + json['lastShiftDate'] = lastShiftDate.toJson(); + } + if(acceptanceRate.state == OptionalState.set) { + json['acceptanceRate'] = acceptanceRate.toJson(); + } + return json; + } + + UpdateStaffAvailabilityStatsVariables({ + required this.staffId, + required this.needWorkIndex, + required this.utilizationPercentage, + required this.predictedAvailabilityScore, + required this.scheduledHoursThisPeriod, + required this.desiredHoursThisPeriod, + required this.lastShiftDate, + required this.acceptanceRate, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff_course.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff_course.dart new file mode 100644 index 00000000..69ac6b65 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff_course.dart @@ -0,0 +1,202 @@ +part of 'generated.dart'; + +class UpdateStaffCourseVariablesBuilder { + String id; + Optional _progressPercent = Optional.optional(nativeFromJson, nativeToJson); + Optional _completed = Optional.optional(nativeFromJson, nativeToJson); + Optional _completedAt = Optional.optional((json) => json['completedAt'] = Timestamp.fromJson(json['completedAt']), defaultSerializer); + Optional _startedAt = Optional.optional((json) => json['startedAt'] = Timestamp.fromJson(json['startedAt']), defaultSerializer); + Optional _lastAccessedAt = Optional.optional((json) => json['lastAccessedAt'] = Timestamp.fromJson(json['lastAccessedAt']), defaultSerializer); + + final FirebaseDataConnect _dataConnect; UpdateStaffCourseVariablesBuilder progressPercent(int? t) { + _progressPercent.value = t; + return this; + } + UpdateStaffCourseVariablesBuilder completed(bool? t) { + _completed.value = t; + return this; + } + UpdateStaffCourseVariablesBuilder completedAt(Timestamp? t) { + _completedAt.value = t; + return this; + } + UpdateStaffCourseVariablesBuilder startedAt(Timestamp? t) { + _startedAt.value = t; + return this; + } + UpdateStaffCourseVariablesBuilder lastAccessedAt(Timestamp? t) { + _lastAccessedAt.value = t; + return this; + } + + UpdateStaffCourseVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateStaffCourseData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateStaffCourseVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateStaffCourseVariables vars= UpdateStaffCourseVariables(id: id,progressPercent: _progressPercent,completed: _completed,completedAt: _completedAt,startedAt: _startedAt,lastAccessedAt: _lastAccessedAt,); + return _dataConnect.mutation("updateStaffCourse", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateStaffCourseStaffCourseUpdate { + final String id; + UpdateStaffCourseStaffCourseUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffCourseStaffCourseUpdate otherTyped = other as UpdateStaffCourseStaffCourseUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateStaffCourseStaffCourseUpdate({ + required this.id, + }); +} + +@immutable +class UpdateStaffCourseData { + final UpdateStaffCourseStaffCourseUpdate? staffCourse_update; + UpdateStaffCourseData.fromJson(dynamic json): + + staffCourse_update = json['staffCourse_update'] == null ? null : UpdateStaffCourseStaffCourseUpdate.fromJson(json['staffCourse_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffCourseData otherTyped = other as UpdateStaffCourseData; + return staffCourse_update == otherTyped.staffCourse_update; + + } + @override + int get hashCode => staffCourse_update.hashCode; + + + Map toJson() { + Map json = {}; + if (staffCourse_update != null) { + json['staffCourse_update'] = staffCourse_update!.toJson(); + } + return json; + } + + UpdateStaffCourseData({ + this.staffCourse_update, + }); +} + +@immutable +class UpdateStaffCourseVariables { + final String id; + late final OptionalprogressPercent; + late final Optionalcompleted; + late final OptionalcompletedAt; + late final OptionalstartedAt; + late final OptionallastAccessedAt; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateStaffCourseVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + progressPercent = Optional.optional(nativeFromJson, nativeToJson); + progressPercent.value = json['progressPercent'] == null ? null : nativeFromJson(json['progressPercent']); + + + completed = Optional.optional(nativeFromJson, nativeToJson); + completed.value = json['completed'] == null ? null : nativeFromJson(json['completed']); + + + completedAt = Optional.optional((json) => json['completedAt'] = Timestamp.fromJson(json['completedAt']), defaultSerializer); + completedAt.value = json['completedAt'] == null ? null : Timestamp.fromJson(json['completedAt']); + + + startedAt = Optional.optional((json) => json['startedAt'] = Timestamp.fromJson(json['startedAt']), defaultSerializer); + startedAt.value = json['startedAt'] == null ? null : Timestamp.fromJson(json['startedAt']); + + + lastAccessedAt = Optional.optional((json) => json['lastAccessedAt'] = Timestamp.fromJson(json['lastAccessedAt']), defaultSerializer); + lastAccessedAt.value = json['lastAccessedAt'] == null ? null : Timestamp.fromJson(json['lastAccessedAt']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffCourseVariables otherTyped = other as UpdateStaffCourseVariables; + return id == otherTyped.id && + progressPercent == otherTyped.progressPercent && + completed == otherTyped.completed && + completedAt == otherTyped.completedAt && + startedAt == otherTyped.startedAt && + lastAccessedAt == otherTyped.lastAccessedAt; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, progressPercent.hashCode, completed.hashCode, completedAt.hashCode, startedAt.hashCode, lastAccessedAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(progressPercent.state == OptionalState.set) { + json['progressPercent'] = progressPercent.toJson(); + } + if(completed.state == OptionalState.set) { + json['completed'] = completed.toJson(); + } + if(completedAt.state == OptionalState.set) { + json['completedAt'] = completedAt.toJson(); + } + if(startedAt.state == OptionalState.set) { + json['startedAt'] = startedAt.toJson(); + } + if(lastAccessedAt.state == OptionalState.set) { + json['lastAccessedAt'] = lastAccessedAt.toJson(); + } + return json; + } + + UpdateStaffCourseVariables({ + required this.id, + required this.progressPercent, + required this.completed, + required this.completedAt, + required this.startedAt, + required this.lastAccessedAt, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff_document.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff_document.dart new file mode 100644 index 00000000..df83921b --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_staff_document.dart @@ -0,0 +1,184 @@ +part of 'generated.dart'; + +class UpdateStaffDocumentVariablesBuilder { + String staffId; + String documentId; + Optional _status = Optional.optional((data) => DocumentStatus.values.byName(data), enumSerializer); + Optional _documentUrl = Optional.optional(nativeFromJson, nativeToJson); + Optional _expiryDate = Optional.optional((json) => json['expiryDate'] = Timestamp.fromJson(json['expiryDate']), defaultSerializer); + + final FirebaseDataConnect _dataConnect; UpdateStaffDocumentVariablesBuilder status(DocumentStatus? t) { + _status.value = t; + return this; + } + UpdateStaffDocumentVariablesBuilder documentUrl(String? t) { + _documentUrl.value = t; + return this; + } + UpdateStaffDocumentVariablesBuilder expiryDate(Timestamp? t) { + _expiryDate.value = t; + return this; + } + + UpdateStaffDocumentVariablesBuilder(this._dataConnect, {required this.staffId,required this.documentId,}); + Deserializer dataDeserializer = (dynamic json) => UpdateStaffDocumentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateStaffDocumentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateStaffDocumentVariables vars= UpdateStaffDocumentVariables(staffId: staffId,documentId: documentId,status: _status,documentUrl: _documentUrl,expiryDate: _expiryDate,); + return _dataConnect.mutation("updateStaffDocument", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateStaffDocumentStaffDocumentUpdate { + final String staffId; + final String documentId; + UpdateStaffDocumentStaffDocumentUpdate.fromJson(dynamic json): + + staffId = nativeFromJson(json['staffId']), + documentId = nativeFromJson(json['documentId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffDocumentStaffDocumentUpdate otherTyped = other as UpdateStaffDocumentStaffDocumentUpdate; + return staffId == otherTyped.staffId && + documentId == otherTyped.documentId; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, documentId.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['documentId'] = nativeToJson(documentId); + return json; + } + + UpdateStaffDocumentStaffDocumentUpdate({ + required this.staffId, + required this.documentId, + }); +} + +@immutable +class UpdateStaffDocumentData { + final UpdateStaffDocumentStaffDocumentUpdate? staffDocument_update; + UpdateStaffDocumentData.fromJson(dynamic json): + + staffDocument_update = json['staffDocument_update'] == null ? null : UpdateStaffDocumentStaffDocumentUpdate.fromJson(json['staffDocument_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffDocumentData otherTyped = other as UpdateStaffDocumentData; + return staffDocument_update == otherTyped.staffDocument_update; + + } + @override + int get hashCode => staffDocument_update.hashCode; + + + Map toJson() { + Map json = {}; + if (staffDocument_update != null) { + json['staffDocument_update'] = staffDocument_update!.toJson(); + } + return json; + } + + UpdateStaffDocumentData({ + this.staffDocument_update, + }); +} + +@immutable +class UpdateStaffDocumentVariables { + final String staffId; + final String documentId; + late final Optionalstatus; + late final OptionaldocumentUrl; + late final OptionalexpiryDate; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateStaffDocumentVariables.fromJson(Map json): + + staffId = nativeFromJson(json['staffId']), + documentId = nativeFromJson(json['documentId']) { + + + + + status = Optional.optional((data) => DocumentStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : DocumentStatus.values.byName(json['status']); + + + documentUrl = Optional.optional(nativeFromJson, nativeToJson); + documentUrl.value = json['documentUrl'] == null ? null : nativeFromJson(json['documentUrl']); + + + expiryDate = Optional.optional((json) => json['expiryDate'] = Timestamp.fromJson(json['expiryDate']), defaultSerializer); + expiryDate.value = json['expiryDate'] == null ? null : Timestamp.fromJson(json['expiryDate']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateStaffDocumentVariables otherTyped = other as UpdateStaffDocumentVariables; + return staffId == otherTyped.staffId && + documentId == otherTyped.documentId && + status == otherTyped.status && + documentUrl == otherTyped.documentUrl && + expiryDate == otherTyped.expiryDate; + + } + @override + int get hashCode => Object.hashAll([staffId.hashCode, documentId.hashCode, status.hashCode, documentUrl.hashCode, expiryDate.hashCode]); + + + Map toJson() { + Map json = {}; + json['staffId'] = nativeToJson(staffId); + json['documentId'] = nativeToJson(documentId); + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(documentUrl.state == OptionalState.set) { + json['documentUrl'] = documentUrl.toJson(); + } + if(expiryDate.state == OptionalState.set) { + json['expiryDate'] = expiryDate.toJson(); + } + return json; + } + + UpdateStaffDocumentVariables({ + required this.staffId, + required this.documentId, + required this.status, + required this.documentUrl, + required this.expiryDate, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_task.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_task.dart new file mode 100644 index 00000000..465f12ed --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_task.dart @@ -0,0 +1,292 @@ +part of 'generated.dart'; + +class UpdateTaskVariablesBuilder { + String id; + Optional _taskName = Optional.optional(nativeFromJson, nativeToJson); + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + Optional _priority = Optional.optional((data) => TaskPriority.values.byName(data), enumSerializer); + Optional _status = Optional.optional((data) => TaskStatus.values.byName(data), enumSerializer); + Optional _dueDate = Optional.optional((json) => json['dueDate'] = Timestamp.fromJson(json['dueDate']), defaultSerializer); + Optional _progress = Optional.optional(nativeFromJson, nativeToJson); + Optional _assignedMembers = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _orderIndex = Optional.optional(nativeFromJson, nativeToJson); + Optional _commentCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _attachmentCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _files = Optional.optional(AnyValue.fromJson, defaultSerializer); + + final FirebaseDataConnect _dataConnect; UpdateTaskVariablesBuilder taskName(String? t) { + _taskName.value = t; + return this; + } + UpdateTaskVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + UpdateTaskVariablesBuilder priority(TaskPriority? t) { + _priority.value = t; + return this; + } + UpdateTaskVariablesBuilder status(TaskStatus? t) { + _status.value = t; + return this; + } + UpdateTaskVariablesBuilder dueDate(Timestamp? t) { + _dueDate.value = t; + return this; + } + UpdateTaskVariablesBuilder progress(int? t) { + _progress.value = t; + return this; + } + UpdateTaskVariablesBuilder assignedMembers(AnyValue? t) { + _assignedMembers.value = t; + return this; + } + UpdateTaskVariablesBuilder orderIndex(int? t) { + _orderIndex.value = t; + return this; + } + UpdateTaskVariablesBuilder commentCount(int? t) { + _commentCount.value = t; + return this; + } + UpdateTaskVariablesBuilder attachmentCount(int? t) { + _attachmentCount.value = t; + return this; + } + UpdateTaskVariablesBuilder files(AnyValue? t) { + _files.value = t; + return this; + } + + UpdateTaskVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateTaskData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateTaskVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateTaskVariables vars= UpdateTaskVariables(id: id,taskName: _taskName,description: _description,priority: _priority,status: _status,dueDate: _dueDate,progress: _progress,assignedMembers: _assignedMembers,orderIndex: _orderIndex,commentCount: _commentCount,attachmentCount: _attachmentCount,files: _files,); + return _dataConnect.mutation("updateTask", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateTaskTaskUpdate { + final String id; + UpdateTaskTaskUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTaskTaskUpdate otherTyped = other as UpdateTaskTaskUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateTaskTaskUpdate({ + required this.id, + }); +} + +@immutable +class UpdateTaskData { + final UpdateTaskTaskUpdate? task_update; + UpdateTaskData.fromJson(dynamic json): + + task_update = json['task_update'] == null ? null : UpdateTaskTaskUpdate.fromJson(json['task_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTaskData otherTyped = other as UpdateTaskData; + return task_update == otherTyped.task_update; + + } + @override + int get hashCode => task_update.hashCode; + + + Map toJson() { + Map json = {}; + if (task_update != null) { + json['task_update'] = task_update!.toJson(); + } + return json; + } + + UpdateTaskData({ + this.task_update, + }); +} + +@immutable +class UpdateTaskVariables { + final String id; + late final OptionaltaskName; + late final Optionaldescription; + late final Optionalpriority; + late final Optionalstatus; + late final OptionaldueDate; + late final Optionalprogress; + late final OptionalassignedMembers; + late final OptionalorderIndex; + late final OptionalcommentCount; + late final OptionalattachmentCount; + late final Optionalfiles; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateTaskVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + taskName = Optional.optional(nativeFromJson, nativeToJson); + taskName.value = json['taskName'] == null ? null : nativeFromJson(json['taskName']); + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + + priority = Optional.optional((data) => TaskPriority.values.byName(data), enumSerializer); + priority.value = json['priority'] == null ? null : TaskPriority.values.byName(json['priority']); + + + status = Optional.optional((data) => TaskStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : TaskStatus.values.byName(json['status']); + + + dueDate = Optional.optional((json) => json['dueDate'] = Timestamp.fromJson(json['dueDate']), defaultSerializer); + dueDate.value = json['dueDate'] == null ? null : Timestamp.fromJson(json['dueDate']); + + + progress = Optional.optional(nativeFromJson, nativeToJson); + progress.value = json['progress'] == null ? null : nativeFromJson(json['progress']); + + + assignedMembers = Optional.optional(AnyValue.fromJson, defaultSerializer); + assignedMembers.value = json['assignedMembers'] == null ? null : AnyValue.fromJson(json['assignedMembers']); + + + orderIndex = Optional.optional(nativeFromJson, nativeToJson); + orderIndex.value = json['orderIndex'] == null ? null : nativeFromJson(json['orderIndex']); + + + commentCount = Optional.optional(nativeFromJson, nativeToJson); + commentCount.value = json['commentCount'] == null ? null : nativeFromJson(json['commentCount']); + + + attachmentCount = Optional.optional(nativeFromJson, nativeToJson); + attachmentCount.value = json['attachmentCount'] == null ? null : nativeFromJson(json['attachmentCount']); + + + files = Optional.optional(AnyValue.fromJson, defaultSerializer); + files.value = json['files'] == null ? null : AnyValue.fromJson(json['files']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTaskVariables otherTyped = other as UpdateTaskVariables; + return id == otherTyped.id && + taskName == otherTyped.taskName && + description == otherTyped.description && + priority == otherTyped.priority && + status == otherTyped.status && + dueDate == otherTyped.dueDate && + progress == otherTyped.progress && + assignedMembers == otherTyped.assignedMembers && + orderIndex == otherTyped.orderIndex && + commentCount == otherTyped.commentCount && + attachmentCount == otherTyped.attachmentCount && + files == otherTyped.files; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, taskName.hashCode, description.hashCode, priority.hashCode, status.hashCode, dueDate.hashCode, progress.hashCode, assignedMembers.hashCode, orderIndex.hashCode, commentCount.hashCode, attachmentCount.hashCode, files.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(taskName.state == OptionalState.set) { + json['taskName'] = taskName.toJson(); + } + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + if(priority.state == OptionalState.set) { + json['priority'] = priority.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(dueDate.state == OptionalState.set) { + json['dueDate'] = dueDate.toJson(); + } + if(progress.state == OptionalState.set) { + json['progress'] = progress.toJson(); + } + if(assignedMembers.state == OptionalState.set) { + json['assignedMembers'] = assignedMembers.toJson(); + } + if(orderIndex.state == OptionalState.set) { + json['orderIndex'] = orderIndex.toJson(); + } + if(commentCount.state == OptionalState.set) { + json['commentCount'] = commentCount.toJson(); + } + if(attachmentCount.state == OptionalState.set) { + json['attachmentCount'] = attachmentCount.toJson(); + } + if(files.state == OptionalState.set) { + json['files'] = files.toJson(); + } + return json; + } + + UpdateTaskVariables({ + required this.id, + required this.taskName, + required this.description, + required this.priority, + required this.status, + required this.dueDate, + required this.progress, + required this.assignedMembers, + required this.orderIndex, + required this.commentCount, + required this.attachmentCount, + required this.files, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_task_comment.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_task_comment.dart new file mode 100644 index 00000000..8e5b81c1 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_task_comment.dart @@ -0,0 +1,157 @@ +part of 'generated.dart'; + +class UpdateTaskCommentVariablesBuilder { + String id; + Optional _comment = Optional.optional(nativeFromJson, nativeToJson); + Optional _isSystem = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateTaskCommentVariablesBuilder comment(String? t) { + _comment.value = t; + return this; + } + UpdateTaskCommentVariablesBuilder isSystem(bool? t) { + _isSystem.value = t; + return this; + } + + UpdateTaskCommentVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateTaskCommentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateTaskCommentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateTaskCommentVariables vars= UpdateTaskCommentVariables(id: id,comment: _comment,isSystem: _isSystem,); + return _dataConnect.mutation("updateTaskComment", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateTaskCommentTaskCommentUpdate { + final String id; + UpdateTaskCommentTaskCommentUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTaskCommentTaskCommentUpdate otherTyped = other as UpdateTaskCommentTaskCommentUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateTaskCommentTaskCommentUpdate({ + required this.id, + }); +} + +@immutable +class UpdateTaskCommentData { + final UpdateTaskCommentTaskCommentUpdate? taskComment_update; + UpdateTaskCommentData.fromJson(dynamic json): + + taskComment_update = json['taskComment_update'] == null ? null : UpdateTaskCommentTaskCommentUpdate.fromJson(json['taskComment_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTaskCommentData otherTyped = other as UpdateTaskCommentData; + return taskComment_update == otherTyped.taskComment_update; + + } + @override + int get hashCode => taskComment_update.hashCode; + + + Map toJson() { + Map json = {}; + if (taskComment_update != null) { + json['taskComment_update'] = taskComment_update!.toJson(); + } + return json; + } + + UpdateTaskCommentData({ + this.taskComment_update, + }); +} + +@immutable +class UpdateTaskCommentVariables { + final String id; + late final Optionalcomment; + late final OptionalisSystem; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateTaskCommentVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + comment = Optional.optional(nativeFromJson, nativeToJson); + comment.value = json['comment'] == null ? null : nativeFromJson(json['comment']); + + + isSystem = Optional.optional(nativeFromJson, nativeToJson); + isSystem.value = json['isSystem'] == null ? null : nativeFromJson(json['isSystem']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTaskCommentVariables otherTyped = other as UpdateTaskCommentVariables; + return id == otherTyped.id && + comment == otherTyped.comment && + isSystem == otherTyped.isSystem; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, comment.hashCode, isSystem.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(comment.state == OptionalState.set) { + json['comment'] = comment.toJson(); + } + if(isSystem.state == OptionalState.set) { + json['isSystem'] = isSystem.toJson(); + } + return json; + } + + UpdateTaskCommentVariables({ + required this.id, + required this.comment, + required this.isSystem, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_tax_form.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_tax_form.dart new file mode 100644 index 00000000..abef65fc --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_tax_form.dart @@ -0,0 +1,202 @@ +part of 'generated.dart'; + +class UpdateTaxFormVariablesBuilder { + String id; + Optional _status = Optional.optional((data) => TaxFormStatus.values.byName(data), enumSerializer); + Optional _formData = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _title = Optional.optional(nativeFromJson, nativeToJson); + Optional _subtitle = Optional.optional(nativeFromJson, nativeToJson); + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateTaxFormVariablesBuilder status(TaxFormStatus? t) { + _status.value = t; + return this; + } + UpdateTaxFormVariablesBuilder formData(AnyValue? t) { + _formData.value = t; + return this; + } + UpdateTaxFormVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + UpdateTaxFormVariablesBuilder subtitle(String? t) { + _subtitle.value = t; + return this; + } + UpdateTaxFormVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + + UpdateTaxFormVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateTaxFormData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateTaxFormVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateTaxFormVariables vars= UpdateTaxFormVariables(id: id,status: _status,formData: _formData,title: _title,subtitle: _subtitle,description: _description,); + return _dataConnect.mutation("updateTaxForm", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateTaxFormTaxFormUpdate { + final String id; + UpdateTaxFormTaxFormUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTaxFormTaxFormUpdate otherTyped = other as UpdateTaxFormTaxFormUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateTaxFormTaxFormUpdate({ + required this.id, + }); +} + +@immutable +class UpdateTaxFormData { + final UpdateTaxFormTaxFormUpdate? taxForm_update; + UpdateTaxFormData.fromJson(dynamic json): + + taxForm_update = json['taxForm_update'] == null ? null : UpdateTaxFormTaxFormUpdate.fromJson(json['taxForm_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTaxFormData otherTyped = other as UpdateTaxFormData; + return taxForm_update == otherTyped.taxForm_update; + + } + @override + int get hashCode => taxForm_update.hashCode; + + + Map toJson() { + Map json = {}; + if (taxForm_update != null) { + json['taxForm_update'] = taxForm_update!.toJson(); + } + return json; + } + + UpdateTaxFormData({ + this.taxForm_update, + }); +} + +@immutable +class UpdateTaxFormVariables { + final String id; + late final Optionalstatus; + late final OptionalformData; + late final Optionaltitle; + late final Optionalsubtitle; + late final Optionaldescription; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateTaxFormVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + status = Optional.optional((data) => TaxFormStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : TaxFormStatus.values.byName(json['status']); + + + formData = Optional.optional(AnyValue.fromJson, defaultSerializer); + formData.value = json['formData'] == null ? null : AnyValue.fromJson(json['formData']); + + + title = Optional.optional(nativeFromJson, nativeToJson); + title.value = json['title'] == null ? null : nativeFromJson(json['title']); + + + subtitle = Optional.optional(nativeFromJson, nativeToJson); + subtitle.value = json['subtitle'] == null ? null : nativeFromJson(json['subtitle']); + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTaxFormVariables otherTyped = other as UpdateTaxFormVariables; + return id == otherTyped.id && + status == otherTyped.status && + formData == otherTyped.formData && + title == otherTyped.title && + subtitle == otherTyped.subtitle && + description == otherTyped.description; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, status.hashCode, formData.hashCode, title.hashCode, subtitle.hashCode, description.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + if(formData.state == OptionalState.set) { + json['formData'] = formData.toJson(); + } + if(title.state == OptionalState.set) { + json['title'] = title.toJson(); + } + if(subtitle.state == OptionalState.set) { + json['subtitle'] = subtitle.toJson(); + } + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + return json; + } + + UpdateTaxFormVariables({ + required this.id, + required this.status, + required this.formData, + required this.title, + required this.subtitle, + required this.description, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team.dart new file mode 100644 index 00000000..9c13f057 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team.dart @@ -0,0 +1,307 @@ +part of 'generated.dart'; + +class UpdateTeamVariablesBuilder { + String id; + Optional _teamName = Optional.optional(nativeFromJson, nativeToJson); + Optional _ownerName = Optional.optional(nativeFromJson, nativeToJson); + Optional _ownerRole = Optional.optional(nativeFromJson, nativeToJson); + Optional _companyLogo = Optional.optional(nativeFromJson, nativeToJson); + Optional _totalMembers = Optional.optional(nativeFromJson, nativeToJson); + Optional _activeMembers = Optional.optional(nativeFromJson, nativeToJson); + Optional _totalHubs = Optional.optional(nativeFromJson, nativeToJson); + Optional _departments = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _favoriteStaffCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _blockedStaffCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _favoriteStaff = Optional.optional(AnyValue.fromJson, defaultSerializer); + Optional _blockedStaff = Optional.optional(AnyValue.fromJson, defaultSerializer); + + final FirebaseDataConnect _dataConnect; UpdateTeamVariablesBuilder teamName(String? t) { + _teamName.value = t; + return this; + } + UpdateTeamVariablesBuilder ownerName(String? t) { + _ownerName.value = t; + return this; + } + UpdateTeamVariablesBuilder ownerRole(String? t) { + _ownerRole.value = t; + return this; + } + UpdateTeamVariablesBuilder companyLogo(String? t) { + _companyLogo.value = t; + return this; + } + UpdateTeamVariablesBuilder totalMembers(int? t) { + _totalMembers.value = t; + return this; + } + UpdateTeamVariablesBuilder activeMembers(int? t) { + _activeMembers.value = t; + return this; + } + UpdateTeamVariablesBuilder totalHubs(int? t) { + _totalHubs.value = t; + return this; + } + UpdateTeamVariablesBuilder departments(AnyValue? t) { + _departments.value = t; + return this; + } + UpdateTeamVariablesBuilder favoriteStaffCount(int? t) { + _favoriteStaffCount.value = t; + return this; + } + UpdateTeamVariablesBuilder blockedStaffCount(int? t) { + _blockedStaffCount.value = t; + return this; + } + UpdateTeamVariablesBuilder favoriteStaff(AnyValue? t) { + _favoriteStaff.value = t; + return this; + } + UpdateTeamVariablesBuilder blockedStaff(AnyValue? t) { + _blockedStaff.value = t; + return this; + } + + UpdateTeamVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateTeamData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateTeamVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateTeamVariables vars= UpdateTeamVariables(id: id,teamName: _teamName,ownerName: _ownerName,ownerRole: _ownerRole,companyLogo: _companyLogo,totalMembers: _totalMembers,activeMembers: _activeMembers,totalHubs: _totalHubs,departments: _departments,favoriteStaffCount: _favoriteStaffCount,blockedStaffCount: _blockedStaffCount,favoriteStaff: _favoriteStaff,blockedStaff: _blockedStaff,); + return _dataConnect.mutation("updateTeam", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateTeamTeamUpdate { + final String id; + UpdateTeamTeamUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamTeamUpdate otherTyped = other as UpdateTeamTeamUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateTeamTeamUpdate({ + required this.id, + }); +} + +@immutable +class UpdateTeamData { + final UpdateTeamTeamUpdate? team_update; + UpdateTeamData.fromJson(dynamic json): + + team_update = json['team_update'] == null ? null : UpdateTeamTeamUpdate.fromJson(json['team_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamData otherTyped = other as UpdateTeamData; + return team_update == otherTyped.team_update; + + } + @override + int get hashCode => team_update.hashCode; + + + Map toJson() { + Map json = {}; + if (team_update != null) { + json['team_update'] = team_update!.toJson(); + } + return json; + } + + UpdateTeamData({ + this.team_update, + }); +} + +@immutable +class UpdateTeamVariables { + final String id; + late final OptionalteamName; + late final OptionalownerName; + late final OptionalownerRole; + late final OptionalcompanyLogo; + late final OptionaltotalMembers; + late final OptionalactiveMembers; + late final OptionaltotalHubs; + late final Optionaldepartments; + late final OptionalfavoriteStaffCount; + late final OptionalblockedStaffCount; + late final OptionalfavoriteStaff; + late final OptionalblockedStaff; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateTeamVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + teamName = Optional.optional(nativeFromJson, nativeToJson); + teamName.value = json['teamName'] == null ? null : nativeFromJson(json['teamName']); + + + ownerName = Optional.optional(nativeFromJson, nativeToJson); + ownerName.value = json['ownerName'] == null ? null : nativeFromJson(json['ownerName']); + + + ownerRole = Optional.optional(nativeFromJson, nativeToJson); + ownerRole.value = json['ownerRole'] == null ? null : nativeFromJson(json['ownerRole']); + + + companyLogo = Optional.optional(nativeFromJson, nativeToJson); + companyLogo.value = json['companyLogo'] == null ? null : nativeFromJson(json['companyLogo']); + + + totalMembers = Optional.optional(nativeFromJson, nativeToJson); + totalMembers.value = json['totalMembers'] == null ? null : nativeFromJson(json['totalMembers']); + + + activeMembers = Optional.optional(nativeFromJson, nativeToJson); + activeMembers.value = json['activeMembers'] == null ? null : nativeFromJson(json['activeMembers']); + + + totalHubs = Optional.optional(nativeFromJson, nativeToJson); + totalHubs.value = json['totalHubs'] == null ? null : nativeFromJson(json['totalHubs']); + + + departments = Optional.optional(AnyValue.fromJson, defaultSerializer); + departments.value = json['departments'] == null ? null : AnyValue.fromJson(json['departments']); + + + favoriteStaffCount = Optional.optional(nativeFromJson, nativeToJson); + favoriteStaffCount.value = json['favoriteStaffCount'] == null ? null : nativeFromJson(json['favoriteStaffCount']); + + + blockedStaffCount = Optional.optional(nativeFromJson, nativeToJson); + blockedStaffCount.value = json['blockedStaffCount'] == null ? null : nativeFromJson(json['blockedStaffCount']); + + + favoriteStaff = Optional.optional(AnyValue.fromJson, defaultSerializer); + favoriteStaff.value = json['favoriteStaff'] == null ? null : AnyValue.fromJson(json['favoriteStaff']); + + + blockedStaff = Optional.optional(AnyValue.fromJson, defaultSerializer); + blockedStaff.value = json['blockedStaff'] == null ? null : AnyValue.fromJson(json['blockedStaff']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamVariables otherTyped = other as UpdateTeamVariables; + return id == otherTyped.id && + teamName == otherTyped.teamName && + ownerName == otherTyped.ownerName && + ownerRole == otherTyped.ownerRole && + companyLogo == otherTyped.companyLogo && + totalMembers == otherTyped.totalMembers && + activeMembers == otherTyped.activeMembers && + totalHubs == otherTyped.totalHubs && + departments == otherTyped.departments && + favoriteStaffCount == otherTyped.favoriteStaffCount && + blockedStaffCount == otherTyped.blockedStaffCount && + favoriteStaff == otherTyped.favoriteStaff && + blockedStaff == otherTyped.blockedStaff; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, teamName.hashCode, ownerName.hashCode, ownerRole.hashCode, companyLogo.hashCode, totalMembers.hashCode, activeMembers.hashCode, totalHubs.hashCode, departments.hashCode, favoriteStaffCount.hashCode, blockedStaffCount.hashCode, favoriteStaff.hashCode, blockedStaff.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(teamName.state == OptionalState.set) { + json['teamName'] = teamName.toJson(); + } + if(ownerName.state == OptionalState.set) { + json['ownerName'] = ownerName.toJson(); + } + if(ownerRole.state == OptionalState.set) { + json['ownerRole'] = ownerRole.toJson(); + } + if(companyLogo.state == OptionalState.set) { + json['companyLogo'] = companyLogo.toJson(); + } + if(totalMembers.state == OptionalState.set) { + json['totalMembers'] = totalMembers.toJson(); + } + if(activeMembers.state == OptionalState.set) { + json['activeMembers'] = activeMembers.toJson(); + } + if(totalHubs.state == OptionalState.set) { + json['totalHubs'] = totalHubs.toJson(); + } + if(departments.state == OptionalState.set) { + json['departments'] = departments.toJson(); + } + if(favoriteStaffCount.state == OptionalState.set) { + json['favoriteStaffCount'] = favoriteStaffCount.toJson(); + } + if(blockedStaffCount.state == OptionalState.set) { + json['blockedStaffCount'] = blockedStaffCount.toJson(); + } + if(favoriteStaff.state == OptionalState.set) { + json['favoriteStaff'] = favoriteStaff.toJson(); + } + if(blockedStaff.state == OptionalState.set) { + json['blockedStaff'] = blockedStaff.toJson(); + } + return json; + } + + UpdateTeamVariables({ + required this.id, + required this.teamName, + required this.ownerName, + required this.ownerRole, + required this.companyLogo, + required this.totalMembers, + required this.activeMembers, + required this.totalHubs, + required this.departments, + required this.favoriteStaffCount, + required this.blockedStaffCount, + required this.favoriteStaff, + required this.blockedStaff, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team_hub.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team_hub.dart new file mode 100644 index 00000000..a1b41ac2 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team_hub.dart @@ -0,0 +1,247 @@ +part of 'generated.dart'; + +class UpdateTeamHubVariablesBuilder { + String id; + Optional _hubName = Optional.optional(nativeFromJson, nativeToJson); + Optional _address = Optional.optional(nativeFromJson, nativeToJson); + Optional _city = Optional.optional(nativeFromJson, nativeToJson); + Optional _state = Optional.optional(nativeFromJson, nativeToJson); + Optional _zipCode = Optional.optional(nativeFromJson, nativeToJson); + Optional _managerName = Optional.optional(nativeFromJson, nativeToJson); + Optional _isActive = Optional.optional(nativeFromJson, nativeToJson); + Optional _departments = Optional.optional(AnyValue.fromJson, defaultSerializer); + + final FirebaseDataConnect _dataConnect; UpdateTeamHubVariablesBuilder hubName(String? t) { + _hubName.value = t; + return this; + } + UpdateTeamHubVariablesBuilder address(String? t) { + _address.value = t; + return this; + } + UpdateTeamHubVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + UpdateTeamHubVariablesBuilder state(String? t) { + _state.value = t; + return this; + } + UpdateTeamHubVariablesBuilder zipCode(String? t) { + _zipCode.value = t; + return this; + } + UpdateTeamHubVariablesBuilder managerName(String? t) { + _managerName.value = t; + return this; + } + UpdateTeamHubVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + UpdateTeamHubVariablesBuilder departments(AnyValue? t) { + _departments.value = t; + return this; + } + + UpdateTeamHubVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateTeamHubData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateTeamHubVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateTeamHubVariables vars= UpdateTeamHubVariables(id: id,hubName: _hubName,address: _address,city: _city,state: _state,zipCode: _zipCode,managerName: _managerName,isActive: _isActive,departments: _departments,); + return _dataConnect.mutation("updateTeamHub", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateTeamHubTeamHubUpdate { + final String id; + UpdateTeamHubTeamHubUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamHubTeamHubUpdate otherTyped = other as UpdateTeamHubTeamHubUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateTeamHubTeamHubUpdate({ + required this.id, + }); +} + +@immutable +class UpdateTeamHubData { + final UpdateTeamHubTeamHubUpdate? teamHub_update; + UpdateTeamHubData.fromJson(dynamic json): + + teamHub_update = json['teamHub_update'] == null ? null : UpdateTeamHubTeamHubUpdate.fromJson(json['teamHub_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamHubData otherTyped = other as UpdateTeamHubData; + return teamHub_update == otherTyped.teamHub_update; + + } + @override + int get hashCode => teamHub_update.hashCode; + + + Map toJson() { + Map json = {}; + if (teamHub_update != null) { + json['teamHub_update'] = teamHub_update!.toJson(); + } + return json; + } + + UpdateTeamHubData({ + this.teamHub_update, + }); +} + +@immutable +class UpdateTeamHubVariables { + final String id; + late final OptionalhubName; + late final Optionaladdress; + late final Optionalcity; + late final Optionalstate; + late final OptionalzipCode; + late final OptionalmanagerName; + late final OptionalisActive; + late final Optionaldepartments; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateTeamHubVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + hubName = Optional.optional(nativeFromJson, nativeToJson); + hubName.value = json['hubName'] == null ? null : nativeFromJson(json['hubName']); + + + address = Optional.optional(nativeFromJson, nativeToJson); + address.value = json['address'] == null ? null : nativeFromJson(json['address']); + + + city = Optional.optional(nativeFromJson, nativeToJson); + city.value = json['city'] == null ? null : nativeFromJson(json['city']); + + + state = Optional.optional(nativeFromJson, nativeToJson); + state.value = json['state'] == null ? null : nativeFromJson(json['state']); + + + zipCode = Optional.optional(nativeFromJson, nativeToJson); + zipCode.value = json['zipCode'] == null ? null : nativeFromJson(json['zipCode']); + + + managerName = Optional.optional(nativeFromJson, nativeToJson); + managerName.value = json['managerName'] == null ? null : nativeFromJson(json['managerName']); + + + isActive = Optional.optional(nativeFromJson, nativeToJson); + isActive.value = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + + + departments = Optional.optional(AnyValue.fromJson, defaultSerializer); + departments.value = json['departments'] == null ? null : AnyValue.fromJson(json['departments']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamHubVariables otherTyped = other as UpdateTeamHubVariables; + return id == otherTyped.id && + hubName == otherTyped.hubName && + address == otherTyped.address && + city == otherTyped.city && + state == otherTyped.state && + zipCode == otherTyped.zipCode && + managerName == otherTyped.managerName && + isActive == otherTyped.isActive && + departments == otherTyped.departments; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, hubName.hashCode, address.hashCode, city.hashCode, state.hashCode, zipCode.hashCode, managerName.hashCode, isActive.hashCode, departments.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(hubName.state == OptionalState.set) { + json['hubName'] = hubName.toJson(); + } + if(address.state == OptionalState.set) { + json['address'] = address.toJson(); + } + if(city.state == OptionalState.set) { + json['city'] = city.toJson(); + } + if(state.state == OptionalState.set) { + json['state'] = state.toJson(); + } + if(zipCode.state == OptionalState.set) { + json['zipCode'] = zipCode.toJson(); + } + if(managerName.state == OptionalState.set) { + json['managerName'] = managerName.toJson(); + } + if(isActive.state == OptionalState.set) { + json['isActive'] = isActive.toJson(); + } + if(departments.state == OptionalState.set) { + json['departments'] = departments.toJson(); + } + return json; + } + + UpdateTeamHubVariables({ + required this.id, + required this.hubName, + required this.address, + required this.city, + required this.state, + required this.zipCode, + required this.managerName, + required this.isActive, + required this.departments, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team_hud_department.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team_hud_department.dart new file mode 100644 index 00000000..618bc4ef --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team_hud_department.dart @@ -0,0 +1,172 @@ +part of 'generated.dart'; + +class UpdateTeamHudDepartmentVariablesBuilder { + String id; + Optional _name = Optional.optional(nativeFromJson, nativeToJson); + Optional _costCenter = Optional.optional(nativeFromJson, nativeToJson); + Optional _teamHubId = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateTeamHudDepartmentVariablesBuilder name(String? t) { + _name.value = t; + return this; + } + UpdateTeamHudDepartmentVariablesBuilder costCenter(String? t) { + _costCenter.value = t; + return this; + } + UpdateTeamHudDepartmentVariablesBuilder teamHubId(String? t) { + _teamHubId.value = t; + return this; + } + + UpdateTeamHudDepartmentVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateTeamHudDepartmentData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateTeamHudDepartmentVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateTeamHudDepartmentVariables vars= UpdateTeamHudDepartmentVariables(id: id,name: _name,costCenter: _costCenter,teamHubId: _teamHubId,); + return _dataConnect.mutation("updateTeamHudDepartment", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateTeamHudDepartmentTeamHudDepartmentUpdate { + final String id; + UpdateTeamHudDepartmentTeamHudDepartmentUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamHudDepartmentTeamHudDepartmentUpdate otherTyped = other as UpdateTeamHudDepartmentTeamHudDepartmentUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateTeamHudDepartmentTeamHudDepartmentUpdate({ + required this.id, + }); +} + +@immutable +class UpdateTeamHudDepartmentData { + final UpdateTeamHudDepartmentTeamHudDepartmentUpdate? teamHudDepartment_update; + UpdateTeamHudDepartmentData.fromJson(dynamic json): + + teamHudDepartment_update = json['teamHudDepartment_update'] == null ? null : UpdateTeamHudDepartmentTeamHudDepartmentUpdate.fromJson(json['teamHudDepartment_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamHudDepartmentData otherTyped = other as UpdateTeamHudDepartmentData; + return teamHudDepartment_update == otherTyped.teamHudDepartment_update; + + } + @override + int get hashCode => teamHudDepartment_update.hashCode; + + + Map toJson() { + Map json = {}; + if (teamHudDepartment_update != null) { + json['teamHudDepartment_update'] = teamHudDepartment_update!.toJson(); + } + return json; + } + + UpdateTeamHudDepartmentData({ + this.teamHudDepartment_update, + }); +} + +@immutable +class UpdateTeamHudDepartmentVariables { + final String id; + late final Optionalname; + late final OptionalcostCenter; + late final OptionalteamHubId; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateTeamHudDepartmentVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + name = Optional.optional(nativeFromJson, nativeToJson); + name.value = json['name'] == null ? null : nativeFromJson(json['name']); + + + costCenter = Optional.optional(nativeFromJson, nativeToJson); + costCenter.value = json['costCenter'] == null ? null : nativeFromJson(json['costCenter']); + + + teamHubId = Optional.optional(nativeFromJson, nativeToJson); + teamHubId.value = json['teamHubId'] == null ? null : nativeFromJson(json['teamHubId']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamHudDepartmentVariables otherTyped = other as UpdateTeamHudDepartmentVariables; + return id == otherTyped.id && + name == otherTyped.name && + costCenter == otherTyped.costCenter && + teamHubId == otherTyped.teamHubId; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, name.hashCode, costCenter.hashCode, teamHubId.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(name.state == OptionalState.set) { + json['name'] = name.toJson(); + } + if(costCenter.state == OptionalState.set) { + json['costCenter'] = costCenter.toJson(); + } + if(teamHubId.state == OptionalState.set) { + json['teamHubId'] = teamHubId.toJson(); + } + return json; + } + + UpdateTeamHudDepartmentVariables({ + required this.id, + required this.name, + required this.costCenter, + required this.teamHubId, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team_member.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team_member.dart new file mode 100644 index 00000000..e58f0dd0 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team_member.dart @@ -0,0 +1,217 @@ +part of 'generated.dart'; + +class UpdateTeamMemberVariablesBuilder { + String id; + Optional _role = Optional.optional((data) => TeamMemberRole.values.byName(data), enumSerializer); + Optional _title = Optional.optional(nativeFromJson, nativeToJson); + Optional _department = Optional.optional(nativeFromJson, nativeToJson); + Optional _teamHubId = Optional.optional(nativeFromJson, nativeToJson); + Optional _isActive = Optional.optional(nativeFromJson, nativeToJson); + Optional _inviteStatus = Optional.optional((data) => TeamMemberInviteStatus.values.byName(data), enumSerializer); + + final FirebaseDataConnect _dataConnect; UpdateTeamMemberVariablesBuilder role(TeamMemberRole? t) { + _role.value = t; + return this; + } + UpdateTeamMemberVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + UpdateTeamMemberVariablesBuilder department(String? t) { + _department.value = t; + return this; + } + UpdateTeamMemberVariablesBuilder teamHubId(String? t) { + _teamHubId.value = t; + return this; + } + UpdateTeamMemberVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + UpdateTeamMemberVariablesBuilder inviteStatus(TeamMemberInviteStatus? t) { + _inviteStatus.value = t; + return this; + } + + UpdateTeamMemberVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateTeamMemberData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateTeamMemberVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateTeamMemberVariables vars= UpdateTeamMemberVariables(id: id,role: _role,title: _title,department: _department,teamHubId: _teamHubId,isActive: _isActive,inviteStatus: _inviteStatus,); + return _dataConnect.mutation("updateTeamMember", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateTeamMemberTeamMemberUpdate { + final String id; + UpdateTeamMemberTeamMemberUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamMemberTeamMemberUpdate otherTyped = other as UpdateTeamMemberTeamMemberUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateTeamMemberTeamMemberUpdate({ + required this.id, + }); +} + +@immutable +class UpdateTeamMemberData { + final UpdateTeamMemberTeamMemberUpdate? teamMember_update; + UpdateTeamMemberData.fromJson(dynamic json): + + teamMember_update = json['teamMember_update'] == null ? null : UpdateTeamMemberTeamMemberUpdate.fromJson(json['teamMember_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamMemberData otherTyped = other as UpdateTeamMemberData; + return teamMember_update == otherTyped.teamMember_update; + + } + @override + int get hashCode => teamMember_update.hashCode; + + + Map toJson() { + Map json = {}; + if (teamMember_update != null) { + json['teamMember_update'] = teamMember_update!.toJson(); + } + return json; + } + + UpdateTeamMemberData({ + this.teamMember_update, + }); +} + +@immutable +class UpdateTeamMemberVariables { + final String id; + late final Optionalrole; + late final Optionaltitle; + late final Optionaldepartment; + late final OptionalteamHubId; + late final OptionalisActive; + late final OptionalinviteStatus; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateTeamMemberVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + role = Optional.optional((data) => TeamMemberRole.values.byName(data), enumSerializer); + role.value = json['role'] == null ? null : TeamMemberRole.values.byName(json['role']); + + + title = Optional.optional(nativeFromJson, nativeToJson); + title.value = json['title'] == null ? null : nativeFromJson(json['title']); + + + department = Optional.optional(nativeFromJson, nativeToJson); + department.value = json['department'] == null ? null : nativeFromJson(json['department']); + + + teamHubId = Optional.optional(nativeFromJson, nativeToJson); + teamHubId.value = json['teamHubId'] == null ? null : nativeFromJson(json['teamHubId']); + + + isActive = Optional.optional(nativeFromJson, nativeToJson); + isActive.value = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + + + inviteStatus = Optional.optional((data) => TeamMemberInviteStatus.values.byName(data), enumSerializer); + inviteStatus.value = json['inviteStatus'] == null ? null : TeamMemberInviteStatus.values.byName(json['inviteStatus']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamMemberVariables otherTyped = other as UpdateTeamMemberVariables; + return id == otherTyped.id && + role == otherTyped.role && + title == otherTyped.title && + department == otherTyped.department && + teamHubId == otherTyped.teamHubId && + isActive == otherTyped.isActive && + inviteStatus == otherTyped.inviteStatus; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, role.hashCode, title.hashCode, department.hashCode, teamHubId.hashCode, isActive.hashCode, inviteStatus.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(role.state == OptionalState.set) { + json['role'] = role.toJson(); + } + if(title.state == OptionalState.set) { + json['title'] = title.toJson(); + } + if(department.state == OptionalState.set) { + json['department'] = department.toJson(); + } + if(teamHubId.state == OptionalState.set) { + json['teamHubId'] = teamHubId.toJson(); + } + if(isActive.state == OptionalState.set) { + json['isActive'] = isActive.toJson(); + } + if(inviteStatus.state == OptionalState.set) { + json['inviteStatus'] = inviteStatus.toJson(); + } + return json; + } + + UpdateTeamMemberVariables({ + required this.id, + required this.role, + required this.title, + required this.department, + required this.teamHubId, + required this.isActive, + required this.inviteStatus, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team_member_invite_status.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team_member_invite_status.dart new file mode 100644 index 00000000..02178b04 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_team_member_invite_status.dart @@ -0,0 +1,132 @@ +part of 'generated.dart'; + +class UpdateTeamMemberInviteStatusVariablesBuilder { + String id; + TeamMemberInviteStatus inviteStatus; + + final FirebaseDataConnect _dataConnect; + UpdateTeamMemberInviteStatusVariablesBuilder(this._dataConnect, {required this.id,required this.inviteStatus,}); + Deserializer dataDeserializer = (dynamic json) => UpdateTeamMemberInviteStatusData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateTeamMemberInviteStatusVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateTeamMemberInviteStatusVariables vars= UpdateTeamMemberInviteStatusVariables(id: id,inviteStatus: inviteStatus,); + return _dataConnect.mutation("updateTeamMemberInviteStatus", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateTeamMemberInviteStatusTeamMemberUpdate { + final String id; + UpdateTeamMemberInviteStatusTeamMemberUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamMemberInviteStatusTeamMemberUpdate otherTyped = other as UpdateTeamMemberInviteStatusTeamMemberUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateTeamMemberInviteStatusTeamMemberUpdate({ + required this.id, + }); +} + +@immutable +class UpdateTeamMemberInviteStatusData { + final UpdateTeamMemberInviteStatusTeamMemberUpdate? teamMember_update; + UpdateTeamMemberInviteStatusData.fromJson(dynamic json): + + teamMember_update = json['teamMember_update'] == null ? null : UpdateTeamMemberInviteStatusTeamMemberUpdate.fromJson(json['teamMember_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamMemberInviteStatusData otherTyped = other as UpdateTeamMemberInviteStatusData; + return teamMember_update == otherTyped.teamMember_update; + + } + @override + int get hashCode => teamMember_update.hashCode; + + + Map toJson() { + Map json = {}; + if (teamMember_update != null) { + json['teamMember_update'] = teamMember_update!.toJson(); + } + return json; + } + + UpdateTeamMemberInviteStatusData({ + this.teamMember_update, + }); +} + +@immutable +class UpdateTeamMemberInviteStatusVariables { + final String id; + final TeamMemberInviteStatus inviteStatus; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateTeamMemberInviteStatusVariables.fromJson(Map json): + + id = nativeFromJson(json['id']), + inviteStatus = TeamMemberInviteStatus.values.byName(json['inviteStatus']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateTeamMemberInviteStatusVariables otherTyped = other as UpdateTeamMemberInviteStatusVariables; + return id == otherTyped.id && + inviteStatus == otherTyped.inviteStatus; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, inviteStatus.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + json['inviteStatus'] = + inviteStatus.name + ; + return json; + } + + UpdateTeamMemberInviteStatusVariables({ + required this.id, + required this.inviteStatus, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_user.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_user.dart new file mode 100644 index 00000000..b1cf739c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_user.dart @@ -0,0 +1,202 @@ +part of 'generated.dart'; + +class UpdateUserVariablesBuilder { + String id; + Optional _email = Optional.optional(nativeFromJson, nativeToJson); + Optional _fullName = Optional.optional(nativeFromJson, nativeToJson); + Optional _role = Optional.optional((data) => UserBaseRole.values.byName(data), enumSerializer); + Optional _userRole = Optional.optional(nativeFromJson, nativeToJson); + Optional _photoUrl = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateUserVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + UpdateUserVariablesBuilder fullName(String? t) { + _fullName.value = t; + return this; + } + UpdateUserVariablesBuilder role(UserBaseRole? t) { + _role.value = t; + return this; + } + UpdateUserVariablesBuilder userRole(String? t) { + _userRole.value = t; + return this; + } + UpdateUserVariablesBuilder photoUrl(String? t) { + _photoUrl.value = t; + return this; + } + + UpdateUserVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateUserData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateUserVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateUserVariables vars= UpdateUserVariables(id: id,email: _email,fullName: _fullName,role: _role,userRole: _userRole,photoUrl: _photoUrl,); + return _dataConnect.mutation("UpdateUser", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateUserUserUpdate { + final String id; + UpdateUserUserUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateUserUserUpdate otherTyped = other as UpdateUserUserUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateUserUserUpdate({ + required this.id, + }); +} + +@immutable +class UpdateUserData { + final UpdateUserUserUpdate? user_update; + UpdateUserData.fromJson(dynamic json): + + user_update = json['user_update'] == null ? null : UpdateUserUserUpdate.fromJson(json['user_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateUserData otherTyped = other as UpdateUserData; + return user_update == otherTyped.user_update; + + } + @override + int get hashCode => user_update.hashCode; + + + Map toJson() { + Map json = {}; + if (user_update != null) { + json['user_update'] = user_update!.toJson(); + } + return json; + } + + UpdateUserData({ + this.user_update, + }); +} + +@immutable +class UpdateUserVariables { + final String id; + late final Optionalemail; + late final OptionalfullName; + late final Optionalrole; + late final OptionaluserRole; + late final OptionalphotoUrl; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateUserVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + email = Optional.optional(nativeFromJson, nativeToJson); + email.value = json['email'] == null ? null : nativeFromJson(json['email']); + + + fullName = Optional.optional(nativeFromJson, nativeToJson); + fullName.value = json['fullName'] == null ? null : nativeFromJson(json['fullName']); + + + role = Optional.optional((data) => UserBaseRole.values.byName(data), enumSerializer); + role.value = json['role'] == null ? null : UserBaseRole.values.byName(json['role']); + + + userRole = Optional.optional(nativeFromJson, nativeToJson); + userRole.value = json['userRole'] == null ? null : nativeFromJson(json['userRole']); + + + photoUrl = Optional.optional(nativeFromJson, nativeToJson); + photoUrl.value = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateUserVariables otherTyped = other as UpdateUserVariables; + return id == otherTyped.id && + email == otherTyped.email && + fullName == otherTyped.fullName && + role == otherTyped.role && + userRole == otherTyped.userRole && + photoUrl == otherTyped.photoUrl; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, email.hashCode, fullName.hashCode, role.hashCode, userRole.hashCode, photoUrl.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(email.state == OptionalState.set) { + json['email'] = email.toJson(); + } + if(fullName.state == OptionalState.set) { + json['fullName'] = fullName.toJson(); + } + if(role.state == OptionalState.set) { + json['role'] = role.toJson(); + } + if(userRole.state == OptionalState.set) { + json['userRole'] = userRole.toJson(); + } + if(photoUrl.state == OptionalState.set) { + json['photoUrl'] = photoUrl.toJson(); + } + return json; + } + + UpdateUserVariables({ + required this.id, + required this.email, + required this.fullName, + required this.role, + required this.userRole, + required this.photoUrl, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_user_conversation.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_user_conversation.dart new file mode 100644 index 00000000..997f92a0 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_user_conversation.dart @@ -0,0 +1,169 @@ +part of 'generated.dart'; + +class UpdateUserConversationVariablesBuilder { + String conversationId; + String userId; + Optional _unreadCount = Optional.optional(nativeFromJson, nativeToJson); + Optional _lastReadAt = Optional.optional((json) => json['lastReadAt'] = Timestamp.fromJson(json['lastReadAt']), defaultSerializer); + + final FirebaseDataConnect _dataConnect; UpdateUserConversationVariablesBuilder unreadCount(int? t) { + _unreadCount.value = t; + return this; + } + UpdateUserConversationVariablesBuilder lastReadAt(Timestamp? t) { + _lastReadAt.value = t; + return this; + } + + UpdateUserConversationVariablesBuilder(this._dataConnect, {required this.conversationId,required this.userId,}); + Deserializer dataDeserializer = (dynamic json) => UpdateUserConversationData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateUserConversationVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateUserConversationVariables vars= UpdateUserConversationVariables(conversationId: conversationId,userId: userId,unreadCount: _unreadCount,lastReadAt: _lastReadAt,); + return _dataConnect.mutation("updateUserConversation", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateUserConversationUserConversationUpdate { + final String conversationId; + final String userId; + UpdateUserConversationUserConversationUpdate.fromJson(dynamic json): + + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateUserConversationUserConversationUpdate otherTyped = other as UpdateUserConversationUserConversationUpdate; + return conversationId == otherTyped.conversationId && + userId == otherTyped.userId; + + } + @override + int get hashCode => Object.hashAll([conversationId.hashCode, userId.hashCode]); + + + Map toJson() { + Map json = {}; + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + return json; + } + + UpdateUserConversationUserConversationUpdate({ + required this.conversationId, + required this.userId, + }); +} + +@immutable +class UpdateUserConversationData { + final UpdateUserConversationUserConversationUpdate? userConversation_update; + UpdateUserConversationData.fromJson(dynamic json): + + userConversation_update = json['userConversation_update'] == null ? null : UpdateUserConversationUserConversationUpdate.fromJson(json['userConversation_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateUserConversationData otherTyped = other as UpdateUserConversationData; + return userConversation_update == otherTyped.userConversation_update; + + } + @override + int get hashCode => userConversation_update.hashCode; + + + Map toJson() { + Map json = {}; + if (userConversation_update != null) { + json['userConversation_update'] = userConversation_update!.toJson(); + } + return json; + } + + UpdateUserConversationData({ + this.userConversation_update, + }); +} + +@immutable +class UpdateUserConversationVariables { + final String conversationId; + final String userId; + late final OptionalunreadCount; + late final OptionallastReadAt; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateUserConversationVariables.fromJson(Map json): + + conversationId = nativeFromJson(json['conversationId']), + userId = nativeFromJson(json['userId']) { + + + + + unreadCount = Optional.optional(nativeFromJson, nativeToJson); + unreadCount.value = json['unreadCount'] == null ? null : nativeFromJson(json['unreadCount']); + + + lastReadAt = Optional.optional((json) => json['lastReadAt'] = Timestamp.fromJson(json['lastReadAt']), defaultSerializer); + lastReadAt.value = json['lastReadAt'] == null ? null : Timestamp.fromJson(json['lastReadAt']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateUserConversationVariables otherTyped = other as UpdateUserConversationVariables; + return conversationId == otherTyped.conversationId && + userId == otherTyped.userId && + unreadCount == otherTyped.unreadCount && + lastReadAt == otherTyped.lastReadAt; + + } + @override + int get hashCode => Object.hashAll([conversationId.hashCode, userId.hashCode, unreadCount.hashCode, lastReadAt.hashCode]); + + + Map toJson() { + Map json = {}; + json['conversationId'] = nativeToJson(conversationId); + json['userId'] = nativeToJson(userId); + if(unreadCount.state == OptionalState.set) { + json['unreadCount'] = unreadCount.toJson(); + } + if(lastReadAt.state == OptionalState.set) { + json['lastReadAt'] = lastReadAt.toJson(); + } + return json; + } + + UpdateUserConversationVariables({ + required this.conversationId, + required this.userId, + required this.unreadCount, + required this.lastReadAt, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_vendor.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_vendor.dart new file mode 100644 index 00000000..307a6c4c --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_vendor.dart @@ -0,0 +1,412 @@ +part of 'generated.dart'; + +class UpdateVendorVariablesBuilder { + String id; + Optional _companyName = Optional.optional(nativeFromJson, nativeToJson); + Optional _email = Optional.optional(nativeFromJson, nativeToJson); + Optional _phone = Optional.optional(nativeFromJson, nativeToJson); + Optional _photoUrl = Optional.optional(nativeFromJson, nativeToJson); + Optional _address = Optional.optional(nativeFromJson, nativeToJson); + Optional _billingAddress = Optional.optional(nativeFromJson, nativeToJson); + Optional _timezone = Optional.optional(nativeFromJson, nativeToJson); + Optional _legalName = Optional.optional(nativeFromJson, nativeToJson); + Optional _doingBusinessAs = Optional.optional(nativeFromJson, nativeToJson); + Optional _region = Optional.optional(nativeFromJson, nativeToJson); + Optional _state = Optional.optional(nativeFromJson, nativeToJson); + Optional _city = Optional.optional(nativeFromJson, nativeToJson); + Optional _serviceSpecialty = Optional.optional(nativeFromJson, nativeToJson); + Optional _approvalStatus = Optional.optional((data) => ApprovalStatus.values.byName(data), enumSerializer); + Optional _isActive = Optional.optional(nativeFromJson, nativeToJson); + Optional _markup = Optional.optional(nativeFromJson, nativeToJson); + Optional _fee = Optional.optional(nativeFromJson, nativeToJson); + Optional _csat = Optional.optional(nativeFromJson, nativeToJson); + Optional _tier = Optional.optional((data) => VendorTier.values.byName(data), enumSerializer); + + final FirebaseDataConnect _dataConnect; UpdateVendorVariablesBuilder companyName(String? t) { + _companyName.value = t; + return this; + } + UpdateVendorVariablesBuilder email(String? t) { + _email.value = t; + return this; + } + UpdateVendorVariablesBuilder phone(String? t) { + _phone.value = t; + return this; + } + UpdateVendorVariablesBuilder photoUrl(String? t) { + _photoUrl.value = t; + return this; + } + UpdateVendorVariablesBuilder address(String? t) { + _address.value = t; + return this; + } + UpdateVendorVariablesBuilder billingAddress(String? t) { + _billingAddress.value = t; + return this; + } + UpdateVendorVariablesBuilder timezone(String? t) { + _timezone.value = t; + return this; + } + UpdateVendorVariablesBuilder legalName(String? t) { + _legalName.value = t; + return this; + } + UpdateVendorVariablesBuilder doingBusinessAs(String? t) { + _doingBusinessAs.value = t; + return this; + } + UpdateVendorVariablesBuilder region(String? t) { + _region.value = t; + return this; + } + UpdateVendorVariablesBuilder state(String? t) { + _state.value = t; + return this; + } + UpdateVendorVariablesBuilder city(String? t) { + _city.value = t; + return this; + } + UpdateVendorVariablesBuilder serviceSpecialty(String? t) { + _serviceSpecialty.value = t; + return this; + } + UpdateVendorVariablesBuilder approvalStatus(ApprovalStatus? t) { + _approvalStatus.value = t; + return this; + } + UpdateVendorVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + UpdateVendorVariablesBuilder markup(double? t) { + _markup.value = t; + return this; + } + UpdateVendorVariablesBuilder fee(double? t) { + _fee.value = t; + return this; + } + UpdateVendorVariablesBuilder csat(double? t) { + _csat.value = t; + return this; + } + UpdateVendorVariablesBuilder tier(VendorTier? t) { + _tier.value = t; + return this; + } + + UpdateVendorVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateVendorData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateVendorVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateVendorVariables vars= UpdateVendorVariables(id: id,companyName: _companyName,email: _email,phone: _phone,photoUrl: _photoUrl,address: _address,billingAddress: _billingAddress,timezone: _timezone,legalName: _legalName,doingBusinessAs: _doingBusinessAs,region: _region,state: _state,city: _city,serviceSpecialty: _serviceSpecialty,approvalStatus: _approvalStatus,isActive: _isActive,markup: _markup,fee: _fee,csat: _csat,tier: _tier,); + return _dataConnect.mutation("updateVendor", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateVendorVendorUpdate { + final String id; + UpdateVendorVendorUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateVendorVendorUpdate otherTyped = other as UpdateVendorVendorUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateVendorVendorUpdate({ + required this.id, + }); +} + +@immutable +class UpdateVendorData { + final UpdateVendorVendorUpdate? vendor_update; + UpdateVendorData.fromJson(dynamic json): + + vendor_update = json['vendor_update'] == null ? null : UpdateVendorVendorUpdate.fromJson(json['vendor_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateVendorData otherTyped = other as UpdateVendorData; + return vendor_update == otherTyped.vendor_update; + + } + @override + int get hashCode => vendor_update.hashCode; + + + Map toJson() { + Map json = {}; + if (vendor_update != null) { + json['vendor_update'] = vendor_update!.toJson(); + } + return json; + } + + UpdateVendorData({ + this.vendor_update, + }); +} + +@immutable +class UpdateVendorVariables { + final String id; + late final OptionalcompanyName; + late final Optionalemail; + late final Optionalphone; + late final OptionalphotoUrl; + late final Optionaladdress; + late final OptionalbillingAddress; + late final Optionaltimezone; + late final OptionallegalName; + late final OptionaldoingBusinessAs; + late final Optionalregion; + late final Optionalstate; + late final Optionalcity; + late final OptionalserviceSpecialty; + late final OptionalapprovalStatus; + late final OptionalisActive; + late final Optionalmarkup; + late final Optionalfee; + late final Optionalcsat; + late final Optionaltier; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateVendorVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + companyName = Optional.optional(nativeFromJson, nativeToJson); + companyName.value = json['companyName'] == null ? null : nativeFromJson(json['companyName']); + + + email = Optional.optional(nativeFromJson, nativeToJson); + email.value = json['email'] == null ? null : nativeFromJson(json['email']); + + + phone = Optional.optional(nativeFromJson, nativeToJson); + phone.value = json['phone'] == null ? null : nativeFromJson(json['phone']); + + + photoUrl = Optional.optional(nativeFromJson, nativeToJson); + photoUrl.value = json['photoUrl'] == null ? null : nativeFromJson(json['photoUrl']); + + + address = Optional.optional(nativeFromJson, nativeToJson); + address.value = json['address'] == null ? null : nativeFromJson(json['address']); + + + billingAddress = Optional.optional(nativeFromJson, nativeToJson); + billingAddress.value = json['billingAddress'] == null ? null : nativeFromJson(json['billingAddress']); + + + timezone = Optional.optional(nativeFromJson, nativeToJson); + timezone.value = json['timezone'] == null ? null : nativeFromJson(json['timezone']); + + + legalName = Optional.optional(nativeFromJson, nativeToJson); + legalName.value = json['legalName'] == null ? null : nativeFromJson(json['legalName']); + + + doingBusinessAs = Optional.optional(nativeFromJson, nativeToJson); + doingBusinessAs.value = json['doingBusinessAs'] == null ? null : nativeFromJson(json['doingBusinessAs']); + + + region = Optional.optional(nativeFromJson, nativeToJson); + region.value = json['region'] == null ? null : nativeFromJson(json['region']); + + + state = Optional.optional(nativeFromJson, nativeToJson); + state.value = json['state'] == null ? null : nativeFromJson(json['state']); + + + city = Optional.optional(nativeFromJson, nativeToJson); + city.value = json['city'] == null ? null : nativeFromJson(json['city']); + + + serviceSpecialty = Optional.optional(nativeFromJson, nativeToJson); + serviceSpecialty.value = json['serviceSpecialty'] == null ? null : nativeFromJson(json['serviceSpecialty']); + + + approvalStatus = Optional.optional((data) => ApprovalStatus.values.byName(data), enumSerializer); + approvalStatus.value = json['approvalStatus'] == null ? null : ApprovalStatus.values.byName(json['approvalStatus']); + + + isActive = Optional.optional(nativeFromJson, nativeToJson); + isActive.value = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + + + markup = Optional.optional(nativeFromJson, nativeToJson); + markup.value = json['markup'] == null ? null : nativeFromJson(json['markup']); + + + fee = Optional.optional(nativeFromJson, nativeToJson); + fee.value = json['fee'] == null ? null : nativeFromJson(json['fee']); + + + csat = Optional.optional(nativeFromJson, nativeToJson); + csat.value = json['csat'] == null ? null : nativeFromJson(json['csat']); + + + tier = Optional.optional((data) => VendorTier.values.byName(data), enumSerializer); + tier.value = json['tier'] == null ? null : VendorTier.values.byName(json['tier']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateVendorVariables otherTyped = other as UpdateVendorVariables; + return id == otherTyped.id && + companyName == otherTyped.companyName && + email == otherTyped.email && + phone == otherTyped.phone && + photoUrl == otherTyped.photoUrl && + address == otherTyped.address && + billingAddress == otherTyped.billingAddress && + timezone == otherTyped.timezone && + legalName == otherTyped.legalName && + doingBusinessAs == otherTyped.doingBusinessAs && + region == otherTyped.region && + state == otherTyped.state && + city == otherTyped.city && + serviceSpecialty == otherTyped.serviceSpecialty && + approvalStatus == otherTyped.approvalStatus && + isActive == otherTyped.isActive && + markup == otherTyped.markup && + fee == otherTyped.fee && + csat == otherTyped.csat && + tier == otherTyped.tier; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode, email.hashCode, phone.hashCode, photoUrl.hashCode, address.hashCode, billingAddress.hashCode, timezone.hashCode, legalName.hashCode, doingBusinessAs.hashCode, region.hashCode, state.hashCode, city.hashCode, serviceSpecialty.hashCode, approvalStatus.hashCode, isActive.hashCode, markup.hashCode, fee.hashCode, csat.hashCode, tier.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(companyName.state == OptionalState.set) { + json['companyName'] = companyName.toJson(); + } + if(email.state == OptionalState.set) { + json['email'] = email.toJson(); + } + if(phone.state == OptionalState.set) { + json['phone'] = phone.toJson(); + } + if(photoUrl.state == OptionalState.set) { + json['photoUrl'] = photoUrl.toJson(); + } + if(address.state == OptionalState.set) { + json['address'] = address.toJson(); + } + if(billingAddress.state == OptionalState.set) { + json['billingAddress'] = billingAddress.toJson(); + } + if(timezone.state == OptionalState.set) { + json['timezone'] = timezone.toJson(); + } + if(legalName.state == OptionalState.set) { + json['legalName'] = legalName.toJson(); + } + if(doingBusinessAs.state == OptionalState.set) { + json['doingBusinessAs'] = doingBusinessAs.toJson(); + } + if(region.state == OptionalState.set) { + json['region'] = region.toJson(); + } + if(state.state == OptionalState.set) { + json['state'] = state.toJson(); + } + if(city.state == OptionalState.set) { + json['city'] = city.toJson(); + } + if(serviceSpecialty.state == OptionalState.set) { + json['serviceSpecialty'] = serviceSpecialty.toJson(); + } + if(approvalStatus.state == OptionalState.set) { + json['approvalStatus'] = approvalStatus.toJson(); + } + if(isActive.state == OptionalState.set) { + json['isActive'] = isActive.toJson(); + } + if(markup.state == OptionalState.set) { + json['markup'] = markup.toJson(); + } + if(fee.state == OptionalState.set) { + json['fee'] = fee.toJson(); + } + if(csat.state == OptionalState.set) { + json['csat'] = csat.toJson(); + } + if(tier.state == OptionalState.set) { + json['tier'] = tier.toJson(); + } + return json; + } + + UpdateVendorVariables({ + required this.id, + required this.companyName, + required this.email, + required this.phone, + required this.photoUrl, + required this.address, + required this.billingAddress, + required this.timezone, + required this.legalName, + required this.doingBusinessAs, + required this.region, + required this.state, + required this.city, + required this.serviceSpecialty, + required this.approvalStatus, + required this.isActive, + required this.markup, + required this.fee, + required this.csat, + required this.tier, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_vendor_benefit_plan.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_vendor_benefit_plan.dart new file mode 100644 index 00000000..1701bb78 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_vendor_benefit_plan.dart @@ -0,0 +1,232 @@ +part of 'generated.dart'; + +class UpdateVendorBenefitPlanVariablesBuilder { + String id; + Optional _vendorId = Optional.optional(nativeFromJson, nativeToJson); + Optional _title = Optional.optional(nativeFromJson, nativeToJson); + Optional _description = Optional.optional(nativeFromJson, nativeToJson); + Optional _requestLabel = Optional.optional(nativeFromJson, nativeToJson); + Optional _total = Optional.optional(nativeFromJson, nativeToJson); + Optional _isActive = Optional.optional(nativeFromJson, nativeToJson); + Optional _createdBy = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateVendorBenefitPlanVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + UpdateVendorBenefitPlanVariablesBuilder title(String? t) { + _title.value = t; + return this; + } + UpdateVendorBenefitPlanVariablesBuilder description(String? t) { + _description.value = t; + return this; + } + UpdateVendorBenefitPlanVariablesBuilder requestLabel(String? t) { + _requestLabel.value = t; + return this; + } + UpdateVendorBenefitPlanVariablesBuilder total(int? t) { + _total.value = t; + return this; + } + UpdateVendorBenefitPlanVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + UpdateVendorBenefitPlanVariablesBuilder createdBy(String? t) { + _createdBy.value = t; + return this; + } + + UpdateVendorBenefitPlanVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateVendorBenefitPlanData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateVendorBenefitPlanVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateVendorBenefitPlanVariables vars= UpdateVendorBenefitPlanVariables(id: id,vendorId: _vendorId,title: _title,description: _description,requestLabel: _requestLabel,total: _total,isActive: _isActive,createdBy: _createdBy,); + return _dataConnect.mutation("updateVendorBenefitPlan", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateVendorBenefitPlanVendorBenefitPlanUpdate { + final String id; + UpdateVendorBenefitPlanVendorBenefitPlanUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateVendorBenefitPlanVendorBenefitPlanUpdate otherTyped = other as UpdateVendorBenefitPlanVendorBenefitPlanUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateVendorBenefitPlanVendorBenefitPlanUpdate({ + required this.id, + }); +} + +@immutable +class UpdateVendorBenefitPlanData { + final UpdateVendorBenefitPlanVendorBenefitPlanUpdate? vendorBenefitPlan_update; + UpdateVendorBenefitPlanData.fromJson(dynamic json): + + vendorBenefitPlan_update = json['vendorBenefitPlan_update'] == null ? null : UpdateVendorBenefitPlanVendorBenefitPlanUpdate.fromJson(json['vendorBenefitPlan_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateVendorBenefitPlanData otherTyped = other as UpdateVendorBenefitPlanData; + return vendorBenefitPlan_update == otherTyped.vendorBenefitPlan_update; + + } + @override + int get hashCode => vendorBenefitPlan_update.hashCode; + + + Map toJson() { + Map json = {}; + if (vendorBenefitPlan_update != null) { + json['vendorBenefitPlan_update'] = vendorBenefitPlan_update!.toJson(); + } + return json; + } + + UpdateVendorBenefitPlanData({ + this.vendorBenefitPlan_update, + }); +} + +@immutable +class UpdateVendorBenefitPlanVariables { + final String id; + late final OptionalvendorId; + late final Optionaltitle; + late final Optionaldescription; + late final OptionalrequestLabel; + late final Optionaltotal; + late final OptionalisActive; + late final OptionalcreatedBy; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateVendorBenefitPlanVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + vendorId = Optional.optional(nativeFromJson, nativeToJson); + vendorId.value = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + + + title = Optional.optional(nativeFromJson, nativeToJson); + title.value = json['title'] == null ? null : nativeFromJson(json['title']); + + + description = Optional.optional(nativeFromJson, nativeToJson); + description.value = json['description'] == null ? null : nativeFromJson(json['description']); + + + requestLabel = Optional.optional(nativeFromJson, nativeToJson); + requestLabel.value = json['requestLabel'] == null ? null : nativeFromJson(json['requestLabel']); + + + total = Optional.optional(nativeFromJson, nativeToJson); + total.value = json['total'] == null ? null : nativeFromJson(json['total']); + + + isActive = Optional.optional(nativeFromJson, nativeToJson); + isActive.value = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + + + createdBy = Optional.optional(nativeFromJson, nativeToJson); + createdBy.value = json['createdBy'] == null ? null : nativeFromJson(json['createdBy']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateVendorBenefitPlanVariables otherTyped = other as UpdateVendorBenefitPlanVariables; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + title == otherTyped.title && + description == otherTyped.description && + requestLabel == otherTyped.requestLabel && + total == otherTyped.total && + isActive == otherTyped.isActive && + createdBy == otherTyped.createdBy; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, title.hashCode, description.hashCode, requestLabel.hashCode, total.hashCode, isActive.hashCode, createdBy.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(vendorId.state == OptionalState.set) { + json['vendorId'] = vendorId.toJson(); + } + if(title.state == OptionalState.set) { + json['title'] = title.toJson(); + } + if(description.state == OptionalState.set) { + json['description'] = description.toJson(); + } + if(requestLabel.state == OptionalState.set) { + json['requestLabel'] = requestLabel.toJson(); + } + if(total.state == OptionalState.set) { + json['total'] = total.toJson(); + } + if(isActive.state == OptionalState.set) { + json['isActive'] = isActive.toJson(); + } + if(createdBy.state == OptionalState.set) { + json['createdBy'] = createdBy.toJson(); + } + return json; + } + + UpdateVendorBenefitPlanVariables({ + required this.id, + required this.vendorId, + required this.title, + required this.description, + required this.requestLabel, + required this.total, + required this.isActive, + required this.createdBy, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_vendor_rate.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_vendor_rate.dart new file mode 100644 index 00000000..882c840d --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_vendor_rate.dart @@ -0,0 +1,262 @@ +part of 'generated.dart'; + +class UpdateVendorRateVariablesBuilder { + String id; + Optional _vendorId = Optional.optional(nativeFromJson, nativeToJson); + Optional _roleName = Optional.optional(nativeFromJson, nativeToJson); + Optional _category = Optional.optional((data) => CategoryType.values.byName(data), enumSerializer); + Optional _clientRate = Optional.optional(nativeFromJson, nativeToJson); + Optional _employeeWage = Optional.optional(nativeFromJson, nativeToJson); + Optional _markupPercentage = Optional.optional(nativeFromJson, nativeToJson); + Optional _vendorFeePercentage = Optional.optional(nativeFromJson, nativeToJson); + Optional _isActive = Optional.optional(nativeFromJson, nativeToJson); + Optional _notes = Optional.optional(nativeFromJson, nativeToJson); + + final FirebaseDataConnect _dataConnect; UpdateVendorRateVariablesBuilder vendorId(String? t) { + _vendorId.value = t; + return this; + } + UpdateVendorRateVariablesBuilder roleName(String? t) { + _roleName.value = t; + return this; + } + UpdateVendorRateVariablesBuilder category(CategoryType? t) { + _category.value = t; + return this; + } + UpdateVendorRateVariablesBuilder clientRate(double? t) { + _clientRate.value = t; + return this; + } + UpdateVendorRateVariablesBuilder employeeWage(double? t) { + _employeeWage.value = t; + return this; + } + UpdateVendorRateVariablesBuilder markupPercentage(double? t) { + _markupPercentage.value = t; + return this; + } + UpdateVendorRateVariablesBuilder vendorFeePercentage(double? t) { + _vendorFeePercentage.value = t; + return this; + } + UpdateVendorRateVariablesBuilder isActive(bool? t) { + _isActive.value = t; + return this; + } + UpdateVendorRateVariablesBuilder notes(String? t) { + _notes.value = t; + return this; + } + + UpdateVendorRateVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateVendorRateData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateVendorRateVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateVendorRateVariables vars= UpdateVendorRateVariables(id: id,vendorId: _vendorId,roleName: _roleName,category: _category,clientRate: _clientRate,employeeWage: _employeeWage,markupPercentage: _markupPercentage,vendorFeePercentage: _vendorFeePercentage,isActive: _isActive,notes: _notes,); + return _dataConnect.mutation("updateVendorRate", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateVendorRateVendorRateUpdate { + final String id; + UpdateVendorRateVendorRateUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateVendorRateVendorRateUpdate otherTyped = other as UpdateVendorRateVendorRateUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateVendorRateVendorRateUpdate({ + required this.id, + }); +} + +@immutable +class UpdateVendorRateData { + final UpdateVendorRateVendorRateUpdate? vendorRate_update; + UpdateVendorRateData.fromJson(dynamic json): + + vendorRate_update = json['vendorRate_update'] == null ? null : UpdateVendorRateVendorRateUpdate.fromJson(json['vendorRate_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateVendorRateData otherTyped = other as UpdateVendorRateData; + return vendorRate_update == otherTyped.vendorRate_update; + + } + @override + int get hashCode => vendorRate_update.hashCode; + + + Map toJson() { + Map json = {}; + if (vendorRate_update != null) { + json['vendorRate_update'] = vendorRate_update!.toJson(); + } + return json; + } + + UpdateVendorRateData({ + this.vendorRate_update, + }); +} + +@immutable +class UpdateVendorRateVariables { + final String id; + late final OptionalvendorId; + late final OptionalroleName; + late final Optionalcategory; + late final OptionalclientRate; + late final OptionalemployeeWage; + late final OptionalmarkupPercentage; + late final OptionalvendorFeePercentage; + late final OptionalisActive; + late final Optionalnotes; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateVendorRateVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + vendorId = Optional.optional(nativeFromJson, nativeToJson); + vendorId.value = json['vendorId'] == null ? null : nativeFromJson(json['vendorId']); + + + roleName = Optional.optional(nativeFromJson, nativeToJson); + roleName.value = json['roleName'] == null ? null : nativeFromJson(json['roleName']); + + + category = Optional.optional((data) => CategoryType.values.byName(data), enumSerializer); + category.value = json['category'] == null ? null : CategoryType.values.byName(json['category']); + + + clientRate = Optional.optional(nativeFromJson, nativeToJson); + clientRate.value = json['clientRate'] == null ? null : nativeFromJson(json['clientRate']); + + + employeeWage = Optional.optional(nativeFromJson, nativeToJson); + employeeWage.value = json['employeeWage'] == null ? null : nativeFromJson(json['employeeWage']); + + + markupPercentage = Optional.optional(nativeFromJson, nativeToJson); + markupPercentage.value = json['markupPercentage'] == null ? null : nativeFromJson(json['markupPercentage']); + + + vendorFeePercentage = Optional.optional(nativeFromJson, nativeToJson); + vendorFeePercentage.value = json['vendorFeePercentage'] == null ? null : nativeFromJson(json['vendorFeePercentage']); + + + isActive = Optional.optional(nativeFromJson, nativeToJson); + isActive.value = json['isActive'] == null ? null : nativeFromJson(json['isActive']); + + + notes = Optional.optional(nativeFromJson, nativeToJson); + notes.value = json['notes'] == null ? null : nativeFromJson(json['notes']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateVendorRateVariables otherTyped = other as UpdateVendorRateVariables; + return id == otherTyped.id && + vendorId == otherTyped.vendorId && + roleName == otherTyped.roleName && + category == otherTyped.category && + clientRate == otherTyped.clientRate && + employeeWage == otherTyped.employeeWage && + markupPercentage == otherTyped.markupPercentage && + vendorFeePercentage == otherTyped.vendorFeePercentage && + isActive == otherTyped.isActive && + notes == otherTyped.notes; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, roleName.hashCode, category.hashCode, clientRate.hashCode, employeeWage.hashCode, markupPercentage.hashCode, vendorFeePercentage.hashCode, isActive.hashCode, notes.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(vendorId.state == OptionalState.set) { + json['vendorId'] = vendorId.toJson(); + } + if(roleName.state == OptionalState.set) { + json['roleName'] = roleName.toJson(); + } + if(category.state == OptionalState.set) { + json['category'] = category.toJson(); + } + if(clientRate.state == OptionalState.set) { + json['clientRate'] = clientRate.toJson(); + } + if(employeeWage.state == OptionalState.set) { + json['employeeWage'] = employeeWage.toJson(); + } + if(markupPercentage.state == OptionalState.set) { + json['markupPercentage'] = markupPercentage.toJson(); + } + if(vendorFeePercentage.state == OptionalState.set) { + json['vendorFeePercentage'] = vendorFeePercentage.toJson(); + } + if(isActive.state == OptionalState.set) { + json['isActive'] = isActive.toJson(); + } + if(notes.state == OptionalState.set) { + json['notes'] = notes.toJson(); + } + return json; + } + + UpdateVendorRateVariables({ + required this.id, + required this.vendorId, + required this.roleName, + required this.category, + required this.clientRate, + required this.employeeWage, + required this.markupPercentage, + required this.vendorFeePercentage, + required this.isActive, + required this.notes, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_workforce.dart b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_workforce.dart new file mode 100644 index 00000000..7a5e9354 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/dataconnect_generated/update_workforce.dart @@ -0,0 +1,172 @@ +part of 'generated.dart'; + +class UpdateWorkforceVariablesBuilder { + String id; + Optional _workforceNumber = Optional.optional(nativeFromJson, nativeToJson); + Optional _employmentType = Optional.optional((data) => WorkforceEmploymentType.values.byName(data), enumSerializer); + Optional _status = Optional.optional((data) => WorkforceStatus.values.byName(data), enumSerializer); + + final FirebaseDataConnect _dataConnect; UpdateWorkforceVariablesBuilder workforceNumber(String? t) { + _workforceNumber.value = t; + return this; + } + UpdateWorkforceVariablesBuilder employmentType(WorkforceEmploymentType? t) { + _employmentType.value = t; + return this; + } + UpdateWorkforceVariablesBuilder status(WorkforceStatus? t) { + _status.value = t; + return this; + } + + UpdateWorkforceVariablesBuilder(this._dataConnect, {required this.id,}); + Deserializer dataDeserializer = (dynamic json) => UpdateWorkforceData.fromJson(jsonDecode(json)); + Serializer varsSerializer = (UpdateWorkforceVariables vars) => jsonEncode(vars.toJson()); + Future> execute() { + return ref().execute(); + } + + MutationRef ref() { + UpdateWorkforceVariables vars= UpdateWorkforceVariables(id: id,workforceNumber: _workforceNumber,employmentType: _employmentType,status: _status,); + return _dataConnect.mutation("updateWorkforce", dataDeserializer, varsSerializer, vars); + } +} + +@immutable +class UpdateWorkforceWorkforceUpdate { + final String id; + UpdateWorkforceWorkforceUpdate.fromJson(dynamic json): + + id = nativeFromJson(json['id']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateWorkforceWorkforceUpdate otherTyped = other as UpdateWorkforceWorkforceUpdate; + return id == otherTyped.id; + + } + @override + int get hashCode => id.hashCode; + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + return json; + } + + UpdateWorkforceWorkforceUpdate({ + required this.id, + }); +} + +@immutable +class UpdateWorkforceData { + final UpdateWorkforceWorkforceUpdate? workforce_update; + UpdateWorkforceData.fromJson(dynamic json): + + workforce_update = json['workforce_update'] == null ? null : UpdateWorkforceWorkforceUpdate.fromJson(json['workforce_update']); + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateWorkforceData otherTyped = other as UpdateWorkforceData; + return workforce_update == otherTyped.workforce_update; + + } + @override + int get hashCode => workforce_update.hashCode; + + + Map toJson() { + Map json = {}; + if (workforce_update != null) { + json['workforce_update'] = workforce_update!.toJson(); + } + return json; + } + + UpdateWorkforceData({ + this.workforce_update, + }); +} + +@immutable +class UpdateWorkforceVariables { + final String id; + late final OptionalworkforceNumber; + late final OptionalemploymentType; + late final Optionalstatus; + @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.') + UpdateWorkforceVariables.fromJson(Map json): + + id = nativeFromJson(json['id']) { + + + + workforceNumber = Optional.optional(nativeFromJson, nativeToJson); + workforceNumber.value = json['workforceNumber'] == null ? null : nativeFromJson(json['workforceNumber']); + + + employmentType = Optional.optional((data) => WorkforceEmploymentType.values.byName(data), enumSerializer); + employmentType.value = json['employmentType'] == null ? null : WorkforceEmploymentType.values.byName(json['employmentType']); + + + status = Optional.optional((data) => WorkforceStatus.values.byName(data), enumSerializer); + status.value = json['status'] == null ? null : WorkforceStatus.values.byName(json['status']); + + } + @override + bool operator ==(Object other) { + if(identical(this, other)) { + return true; + } + if(other.runtimeType != runtimeType) { + return false; + } + + final UpdateWorkforceVariables otherTyped = other as UpdateWorkforceVariables; + return id == otherTyped.id && + workforceNumber == otherTyped.workforceNumber && + employmentType == otherTyped.employmentType && + status == otherTyped.status; + + } + @override + int get hashCode => Object.hashAll([id.hashCode, workforceNumber.hashCode, employmentType.hashCode, status.hashCode]); + + + Map toJson() { + Map json = {}; + json['id'] = nativeToJson(id); + if(workforceNumber.state == OptionalState.set) { + json['workforceNumber'] = workforceNumber.toJson(); + } + if(employmentType.state == OptionalState.set) { + json['employmentType'] = employmentType.toJson(); + } + if(status.state == OptionalState.set) { + json['status'] = status.toJson(); + } + return json; + } + + UpdateWorkforceVariables({ + required this.id, + required this.workforceNumber, + required this.employmentType, + required this.status, + }); +} + diff --git a/apps/mobile/packages/data_connect/lib/src/mocks/auth_repository_mock.dart b/apps/mobile/packages/data_connect/lib/src/mocks/auth_repository_mock.dart new file mode 100644 index 00000000..1b571cb3 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/mocks/auth_repository_mock.dart @@ -0,0 +1,48 @@ +import 'package:krow_domain/krow_domain.dart'; + +// TODO: Implement AuthRepositoryInterface once defined in a feature package. +class AuthRepositoryMock { + Stream get currentUser => Stream.value( + const User(id: 'mock_user_1', email: 'test@krow.com', role: 'staff'), + ); + + Future signInWithPhone(String phoneNumber) async { + await Future.delayed(const Duration(milliseconds: 500)); + return 'mock_verification_id'; + } + + Future verifyOtp(String verificationId, String smsCode) async { + await Future.delayed(const Duration(milliseconds: 500)); + return const User(id: 'mock_user_1', email: 'test@krow.com', role: 'staff'); + } + + Future signOut() async { + await Future.delayed(const Duration(milliseconds: 200)); + } + + /// Signs in a user with email and password (Mock). + Future signInWithEmail(String email, String password) async { + await Future.delayed(const Duration(milliseconds: 500)); + return User(id: 'mock_client_1', email: email, role: 'client_admin'); + } + + /// Registers a new user with email and password (Mock). + Future signUpWithEmail( + String email, + String password, + String companyName, + ) async { + await Future.delayed(const Duration(milliseconds: 500)); + return User(id: 'mock_client_new', email: email, role: 'client_admin'); + } + + /// Authenticates using a social provider (Mock). + Future signInWithSocial(String provider) async { + await Future.delayed(const Duration(milliseconds: 500)); + return const User( + id: 'mock_social_user', + email: 'social@example.com', + role: 'client_admin', + ); + } +} diff --git a/apps/mobile/packages/data_connect/lib/src/mocks/business_repository_mock.dart b/apps/mobile/packages/data_connect/lib/src/mocks/business_repository_mock.dart new file mode 100644 index 00000000..6ed624ef --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/mocks/business_repository_mock.dart @@ -0,0 +1,54 @@ +import 'package:krow_domain/krow_domain.dart'; + +// TODO: Implement BusinessRepositoryInterface once defined in a feature package. +class BusinessRepositoryMock { + Future getBusiness(String id) async { + await Future.delayed(const Duration(milliseconds: 300)); + return const Business( + id: 'biz_1', + name: 'Acme Events Ltd', + registrationNumber: 'REG123456', + status: BusinessStatus.active, + avatar: 'https://via.placeholder.com/150', + ); + } + + Future> getHubs(String businessId) async { + await Future.delayed(const Duration(milliseconds: 300)); + return [ + const Hub( + id: 'hub_1', + businessId: 'biz_1', + name: 'London HQ', + address: '123 Oxford Street, London', + status: HubStatus.active, + ), + ]; + } + + Future createHub({ + required String businessId, + required String name, + required String address, + }) async { + await Future.delayed(const Duration(milliseconds: 500)); + return Hub( + id: 'hub_${DateTime.now().millisecondsSinceEpoch}', + businessId: businessId, + name: name, + address: address, + status: HubStatus.active, + ); + } + + Future deleteHub(String id) async { + await Future.delayed(const Duration(milliseconds: 300)); + } + + Future assignNfcTag({ + required String hubId, + required String nfcTagId, + }) async { + await Future.delayed(const Duration(milliseconds: 500)); + } +} diff --git a/apps/mobile/packages/data_connect/lib/src/mocks/event_repository_mock.dart b/apps/mobile/packages/data_connect/lib/src/mocks/event_repository_mock.dart new file mode 100644 index 00000000..4bbfb69e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/mocks/event_repository_mock.dart @@ -0,0 +1,58 @@ +import 'package:krow_domain/krow_domain.dart'; + +// TODO: Implement EventRepositoryInterface once defined in a feature package. +class EventRepositoryMock { + Future applyForPosition(String positionId, String staffId) async { + await Future.delayed(const Duration(milliseconds: 600)); + return Assignment( + id: 'assign_1', + positionId: positionId, + staffId: staffId, + status: AssignmentStatus.assigned, + ); + } + + Future getEvent(String id) async { + await Future.delayed(const Duration(milliseconds: 300)); + return _mockEvent; + } + + Future> getEventShifts(String eventId) async { + await Future.delayed(const Duration(milliseconds: 300)); + return [ + const EventShift( + id: 'shift_1', + eventId: 'event_1', + name: 'Morning Setup', + address: 'Hyde Park, London', + ), + ]; + } + + Future> getStaffAssignments(String staffId) async { + await Future.delayed(const Duration(milliseconds: 500)); + return [ + const Assignment( + id: 'assign_1', + positionId: 'pos_1', + staffId: 'staff_1', + status: AssignmentStatus.confirmed, + ), + ]; + } + + Future> getUpcomingEvents() async { + await Future.delayed(const Duration(milliseconds: 800)); + return [_mockEvent]; + } + + static final Event _mockEvent = Event( + id: 'event_1', + businessId: 'biz_1', + hubId: 'hub_1', + name: 'Summer Festival 2026', + date: DateTime.now().add(const Duration(days: 10)), + status: EventStatus.active, + contractType: 'freelance', + ); +} \ No newline at end of file diff --git a/apps/mobile/packages/data_connect/lib/src/mocks/financial_repository_mock.dart b/apps/mobile/packages/data_connect/lib/src/mocks/financial_repository_mock.dart new file mode 100644 index 00000000..0ae0c513 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/mocks/financial_repository_mock.dart @@ -0,0 +1,55 @@ +import 'package:krow_domain/krow_domain.dart'; + +// TODO: Implement FinancialRepositoryInterface once defined in a feature package. +class FinancialRepositoryMock { + Future> getInvoices(String businessId) async { + await Future.delayed(const Duration(milliseconds: 500)); + return [ + const Invoice( + id: 'inv_1', + eventId: 'event_1', + businessId: 'biz_1', + status: InvoiceStatus.paid, + totalAmount: 1500.0, + workAmount: 1400.0, + addonsAmount: 100.0, + ), + ]; + } + + Future> getStaffPayments(String staffId) async { + await Future.delayed(const Duration(milliseconds: 500)); + return [ + StaffPayment( + id: 'pay_1', + staffId: staffId, + assignmentId: 'assign_1', + amount: 120.0, + status: PaymentStatus.paid, + paidAt: DateTime.now().subtract(const Duration(days: 2)), + ), + ]; + } + + Future> getInvoiceItems(String invoiceId) async { + await Future.delayed(const Duration(milliseconds: 500)); + return [ + const InvoiceItem( + id: 'item_1', + invoiceId: 'inv_1', + staffId: 'staff_1', + workHours: 8.0, + rate: 25.0, + amount: 200.0, + ), + const InvoiceItem( + id: 'item_2', + invoiceId: 'inv_1', + staffId: 'staff_2', + workHours: 6.0, + rate: 30.0, + amount: 180.0, + ), + ]; + } +} diff --git a/apps/mobile/packages/data_connect/lib/src/mocks/home_repository_mock.dart b/apps/mobile/packages/data_connect/lib/src/mocks/home_repository_mock.dart new file mode 100644 index 00000000..3da2699a --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/mocks/home_repository_mock.dart @@ -0,0 +1,32 @@ +import 'package:krow_domain/krow_domain.dart'; +import '../session/client_session_store.dart'; + +/// Mock implementation of data source for Home dashboard data. +/// +/// This mock simulates backend responses for dashboard-related queries. +class HomeRepositoryMock { + /// Returns a mock [HomeDashboardData]. + Future getDashboardData() async { + // Simulate network delay + await Future.delayed(const Duration(milliseconds: 500)); + + return const HomeDashboardData( + weeklySpending: 4250.0, + next7DaysSpending: 6100.0, + weeklyShifts: 12, + next7DaysScheduled: 18, + totalNeeded: 10, + totalFilled: 8, + ); + } + + /// Returns the current user's session data. + /// + /// Returns a tuple of (businessName, photoUrl). + (String, String?) getUserSession() { + final ClientSession? session = ClientSessionStore.instance.session; + final String businessName = session?.business?.businessName ?? 'Your Company'; + final String? photoUrl = session?.userPhotoUrl; + return (businessName, photoUrl); + } +} diff --git a/apps/mobile/packages/data_connect/lib/src/mocks/order_repository_mock.dart b/apps/mobile/packages/data_connect/lib/src/mocks/order_repository_mock.dart new file mode 100644 index 00000000..3d856536 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/mocks/order_repository_mock.dart @@ -0,0 +1,159 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Mock implementation of order-related data operations. +/// +/// This class simulates backend responses for order types and order creation. +/// It is used by the feature-level repository implementations. +class OrderRepositoryMock { + /// Returns a list of available [OrderType]s. + Future> getOrderTypes() async { + await Future.delayed(const Duration(milliseconds: 500)); + return const [ + OrderType( + id: 'rapid', + titleKey: 'client_create_order.types.rapid', + descriptionKey: 'client_create_order.types.rapid_desc', + ), + OrderType( + id: 'one-time', + titleKey: 'client_create_order.types.one_time', + descriptionKey: 'client_create_order.types.one_time_desc', + ), + OrderType( + id: 'recurring', + titleKey: 'client_create_order.types.recurring', + descriptionKey: 'client_create_order.types.recurring_desc', + ), + OrderType( + id: 'permanent', + titleKey: 'client_create_order.types.permanent', + descriptionKey: 'client_create_order.types.permanent_desc', + ), + ]; + } + + /// Simulates creating a one-time order. + Future createOneTimeOrder(OneTimeOrder order) async { + await Future.delayed(const Duration(milliseconds: 800)); + } + + /// Simulates creating a rapid order. + Future createRapidOrder(String description) async { + await Future.delayed(const Duration(seconds: 1)); + } + + /// Returns a mock list of client orders. + Future> getOrders() async { + await Future.delayed(const Duration(milliseconds: 500)); + return [ + OrderItem( + id: '1', + orderId: 'order_1', + title: 'Server - Wedding', + clientName: 'Grand Plaza Hotel', + status: 'filled', + date: DateTime.now() + .add(const Duration(days: 1)) + .toIso8601String() + .split('T')[0], + startTime: '16:00', + endTime: '23:00', + location: 'Grand Plaza Hotel, 123 Main St', + locationAddress: 'Grand Plaza Hotel, 123 Main St', + filled: 10, + workersNeeded: 10, + hourlyRate: 22.0, + confirmedApps: List>.generate( + 10, + (int index) => { + 'id': 'app_$index', + 'worker_id': 'w_$index', + 'worker_name': 'Worker ${String.fromCharCode(65 + index)}', + 'status': 'confirmed', + 'check_in_time': index < 5 ? '15:55' : null, + }, + ), + ), + OrderItem( + id: '2', + orderId: 'order_2', + title: 'Bartender - Private Event', + clientName: 'Taste of the Town', + status: 'open', + date: DateTime.now() + .add(const Duration(days: 1)) + .toIso8601String() + .split('T')[0], + startTime: '18:00', + endTime: '02:00', + location: 'Downtown Loft, 456 High St', + locationAddress: 'Downtown Loft, 456 High St', + filled: 4, + workersNeeded: 5, + hourlyRate: 28.0, + confirmedApps: List>.generate( + 4, + (int index) => { + 'id': 'app_b_$index', + 'worker_id': 'w_b_$index', + 'worker_name': 'Bartender ${index + 1}', + 'status': 'confirmed', + }, + ), + ), + OrderItem( + id: '3', + orderId: 'order_3', + title: 'Event Staff', + clientName: 'City Center', + status: 'in_progress', + date: DateTime.now().toIso8601String().split('T')[0], + startTime: '08:00', + endTime: '16:00', + location: 'Convention Center, 789 Blvd', + locationAddress: 'Convention Center, 789 Blvd', + filled: 15, + workersNeeded: 15, + hourlyRate: 20.0, + confirmedApps: List>.generate( + 15, + (int index) => { + 'id': 'app_c_$index', + 'worker_id': 'w_c_$index', + 'worker_name': 'Staff ${index + 1}', + 'status': 'confirmed', + 'check_in_time': '07:55', + }, + ), + ), + OrderItem( + id: '4', + orderId: 'order_4', + title: 'Coat Check', + clientName: 'The Met Museum', + status: 'completed', + date: DateTime.now() + .subtract(const Duration(days: 1)) + .toIso8601String() + .split('T')[0], + startTime: '17:00', + endTime: '22:00', + location: 'The Met Museum, 1000 5th Ave', + locationAddress: 'The Met Museum, 1000 5th Ave', + filled: 2, + workersNeeded: 2, + hourlyRate: 18.0, + confirmedApps: List>.generate( + 2, + (int index) => { + 'id': 'app_d_$index', + 'worker_id': 'w_d_$index', + 'worker_name': 'Checker ${index + 1}', + 'status': 'confirmed', + 'check_in_time': '16:50', + }, + ), + ), + ]; + } +} diff --git a/apps/mobile/packages/data_connect/lib/src/mocks/profile_repository_mock.dart b/apps/mobile/packages/data_connect/lib/src/mocks/profile_repository_mock.dart new file mode 100644 index 00000000..e5688f29 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/mocks/profile_repository_mock.dart @@ -0,0 +1,90 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Mock implementation of profile-related data operations. +/// +/// This mock provides hardcoded staff profile data for development and testing. +/// It simulates the behavior of a real backend service without requiring +/// actual API calls or Firebase Data Connect. +/// +/// In production, this will be replaced with a real implementation that +/// interacts with Firebase Data Connect. +class ProfileRepositoryMock { + /// Fetches the staff profile for the given user ID. + /// + /// Returns a [Staff] entity with mock data. + /// Simulates a network delay to mirror real API behavior. + /// + /// Throws an exception if the profile cannot be retrieved. + Future getStaffProfile(String userId) async { + // Simulate network delay + await Future.delayed(const Duration(milliseconds: 500)); + + // Return mock staff profile data + return const Staff( + id: '93673c8f-91aa-405d-8647-f1aac29cc19b', + authProviderId: 't8P3fYh4y1cPoZbbVPXUhfQCsDo3', + name: 'Krower', + email: 'worker@krow.com', + phone: '555-123-4567', + status: StaffStatus.active, + avatar: null, + livePhoto: null, + address: null, + ); + } + + /// Signs out the current user. + /// + /// Simulates the sign-out process with a delay. + /// In a real implementation, this would clear session tokens, + /// update Firebase auth state, etc. + Future signOut() async { + // Simulate processing delay + await Future.delayed(const Duration(milliseconds: 300)); + } + + /// Fetches emergency contacts for the given staff ID. + /// + /// Returns a list of [EmergencyContact]. + Future> getEmergencyContacts(String staffId) async { + await Future.delayed(const Duration(milliseconds: 500)); + return [ + const EmergencyContact( + name: 'Jane Doe', + phone: '555-987-6543', + relationship: 'Family', + ), + ]; + } + + /// Saves emergency contacts for the given staff ID. + Future saveEmergencyContacts( + String staffId, + List contacts, + ) async { + await Future.delayed(const Duration(seconds: 1)); + // Simulate save + } + + /// Fetches selected industries for the given staff ID. + Future> getStaffIndustries(String staffId) async { + await Future.delayed(const Duration(milliseconds: 500)); + return ['hospitality', 'events']; + } + + /// Fetches selected skills for the given staff ID. + Future> getStaffSkills(String staffId) async { + await Future.delayed(const Duration(milliseconds: 500)); + return ['Bartending', 'Server']; + } + + /// Saves experience (industries and skills) for the given staff ID. + Future saveExperience( + String staffId, + List industries, + List skills, + ) async { + await Future.delayed(const Duration(seconds: 1)); + // Simulate save + } +} diff --git a/apps/mobile/packages/data_connect/lib/src/mocks/rating_repository_mock.dart b/apps/mobile/packages/data_connect/lib/src/mocks/rating_repository_mock.dart new file mode 100644 index 00000000..f679fa11 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/mocks/rating_repository_mock.dart @@ -0,0 +1,22 @@ +import 'package:krow_domain/krow_domain.dart'; + +// TODO: Implement RatingRepositoryInterface once defined in a feature package. +class RatingRepositoryMock { + Future> getStaffRatings(String staffId) async { + await Future.delayed(const Duration(milliseconds: 400)); + return [ + const StaffRating( + id: 'rate_1', + staffId: 'staff_1', + eventId: 'event_1', + businessId: 'biz_1', + rating: 5, + comment: 'Great work!', + ), + ]; + } + + Future submitRating(StaffRating rating) async { + await Future.delayed(const Duration(milliseconds: 500)); + } +} \ No newline at end of file diff --git a/apps/mobile/packages/data_connect/lib/src/mocks/shifts_repository_mock.dart b/apps/mobile/packages/data_connect/lib/src/mocks/shifts_repository_mock.dart new file mode 100644 index 00000000..eb0c3e92 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/mocks/shifts_repository_mock.dart @@ -0,0 +1,89 @@ +import 'package:krow_domain/krow_domain.dart'; +import 'package:intl/intl.dart'; + +// Mock Implementation for now. +class ShiftsRepositoryMock { + + Future> getMyShifts() async { + await Future.delayed(const Duration(milliseconds: 500)); + return [ + Shift( + id: 'm1', + title: 'Warehouse Assistant', + clientName: 'Amazon', + logoUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Amazon_2024.svg/500px-Amazon_2024.svg.png', + hourlyRate: 22.5, + date: DateFormat('yyyy-MM-dd').format(DateTime.now().add(const Duration(days: 1))), + startTime: '09:00', + endTime: '17:00', + location: 'Logistics Park', + locationAddress: '456 Industrial Way', + status: 'confirmed', + createdDate: DateTime.now().toIso8601String(), + description: 'Standard warehouse duties. Safety boots required.', + ), + ]; + } + + Future> getAvailableShifts() async { + await Future.delayed(const Duration(milliseconds: 500)); + return [ + Shift( + id: 'a1', + title: 'Bartender', + clientName: 'Club Luxe', + logoUrl: null, + hourlyRate: 30.0, + date: DateFormat('yyyy-MM-dd').format(DateTime.now().add(const Duration(days: 3))), + startTime: '20:00', + endTime: '02:00', + location: 'City Center', + locationAddress: '789 Nightlife Blvd', + status: 'open', + createdDate: DateTime.now().toIso8601String(), + description: 'Experience mixing cocktails required.', + ), + // Add more mocks if needed + ]; + } + + Future> getPendingAssignments() async { + await Future.delayed(const Duration(milliseconds: 500)); + return [ + Shift( + id: 'p1', + title: 'Event Server', + clientName: 'Grand Hotel', + logoUrl: null, + hourlyRate: 25.0, + date: DateFormat('yyyy-MM-dd').format(DateTime.now().add(const Duration(days: 2))), + startTime: '16:00', + endTime: '22:00', + location: 'Downtown', + locationAddress: '123 Main St', + status: 'pending', + createdDate: DateTime.now().toIso8601String(), + ), + ]; + } + + Future getShiftDetails(String shiftId) async { + await Future.delayed(const Duration(milliseconds: 500)); + return Shift( + id: shiftId, + title: 'Event Server', + clientName: 'Grand Hotel', + logoUrl: null, + hourlyRate: 25.0, + date: DateFormat('yyyy-MM-dd').format(DateTime.now()), + startTime: '16:00', + endTime: '22:00', + location: 'Downtown', + locationAddress: '123 Main St, New York, NY', + status: 'open', + createdDate: DateTime.now().toIso8601String(), + description: 'Provide exceptional customer service. Respond to guest requests or concerns promptly and professionally.', + managers: [], + ); + } +} diff --git a/apps/mobile/packages/data_connect/lib/src/mocks/skill_repository_mock.dart b/apps/mobile/packages/data_connect/lib/src/mocks/skill_repository_mock.dart new file mode 100644 index 00000000..f60187da --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/mocks/skill_repository_mock.dart @@ -0,0 +1,40 @@ +import 'package:krow_domain/krow_domain.dart'; + +// TODO: Implement SkillRepositoryInterface once defined in a feature package. +class SkillRepositoryMock { + Future addStaffSkill(StaffSkill skill) async { + await Future.delayed(const Duration(milliseconds: 500)); + } + + Future> getAllSkills() async { + await Future.delayed(const Duration(milliseconds: 300)); + return [ + const Skill( + id: 'skill_1', + categoryId: 'cat_1', + name: 'Bartender', + basePrice: 15.0, + ), + const Skill( + id: 'skill_2', + categoryId: 'cat_2', + name: 'Security Guard', + basePrice: 18.0, + ), + ]; + } + + Future> getStaffSkills(String staffId) async { + await Future.delayed(const Duration(milliseconds: 400)); + return [ + const StaffSkill( + id: 'staff_skill_1', + staffId: 'staff_1', + skillId: 'skill_1', + level: SkillLevel.skilled, + experienceYears: 3, + status: StaffSkillStatus.verified, + ), + ]; + } +} \ No newline at end of file diff --git a/apps/mobile/packages/data_connect/lib/src/mocks/staff_repository_mock.dart b/apps/mobile/packages/data_connect/lib/src/mocks/staff_repository_mock.dart new file mode 100644 index 00000000..c032464f --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/mocks/staff_repository_mock.dart @@ -0,0 +1,39 @@ +import 'package:krow_domain/krow_domain.dart'; + +// TODO: Implement StaffRepositoryInterface once defined in a feature package. +class StaffRepositoryMock { + Future createStaffProfile(Staff staff) async { + await Future.delayed(const Duration(milliseconds: 500)); + return staff; + } + + Future> getMemberships(String userId) async { + await Future.delayed(const Duration(milliseconds: 300)); + return [ + Membership( + id: 'mem_1', + userId: userId, + memberableId: 'biz_1', + memberableType: 'business', + role: 'staff', + ), + ]; + } + + Future getStaffProfile(String userId) async { + await Future.delayed(const Duration(milliseconds: 400)); + return Staff( + id: 'staff_1', + authProviderId: userId, + name: 'John Doe', + email: 'john@krow.com', + status: StaffStatus.active, + avatar: 'https://i.pravatar.cc/300', + ); + } + + Future updateStaffProfile(Staff staff) async { + await Future.delayed(const Duration(milliseconds: 500)); + return staff; + } +} \ No newline at end of file diff --git a/apps/mobile/packages/data_connect/lib/src/mocks/support_repository_mock.dart b/apps/mobile/packages/data_connect/lib/src/mocks/support_repository_mock.dart new file mode 100644 index 00000000..0722052e --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/mocks/support_repository_mock.dart @@ -0,0 +1,25 @@ +import 'package:krow_domain/krow_domain.dart'; + +// TODO: Implement SupportRepositoryInterface once defined in a feature package. +class SupportRepositoryMock { + Future> getTags() async { + await Future.delayed(const Duration(milliseconds: 200)); + return [ + const Tag(id: 'tag_1', label: 'Urgent'), + const Tag(id: 'tag_2', label: 'VIP Event'), + ]; + } + + Future> getWorkingAreas() async { + await Future.delayed(const Duration(milliseconds: 200)); + return [ + const WorkingArea( + id: 'area_1', + name: 'Central London', + centerLat: 51.5074, + centerLng: -0.1278, + radiusKm: 10.0, + ), + ]; + } +} \ No newline at end of file diff --git a/apps/mobile/packages/data_connect/lib/src/session/client_session_store.dart b/apps/mobile/packages/data_connect/lib/src/session/client_session_store.dart new file mode 100644 index 00000000..e17f22a4 --- /dev/null +++ b/apps/mobile/packages/data_connect/lib/src/session/client_session_store.dart @@ -0,0 +1,49 @@ +import 'package:krow_domain/krow_domain.dart' as domain; + +class ClientBusinessSession { + final String id; + final String businessName; + final String? email; + final String? city; + final String? contactName; + final String? companyLogoUrl; + + const ClientBusinessSession({ + required this.id, + required this.businessName, + this.email, + this.city, + this.contactName, + this.companyLogoUrl, + }); +} + +class ClientSession { + final domain.User user; + final String? userPhotoUrl; + final ClientBusinessSession? business; + + const ClientSession({ + required this.user, + required this.userPhotoUrl, + required this.business, + }); +} + +class ClientSessionStore { + ClientSession? _session; + + ClientSession? get session => _session; + + void setSession(ClientSession session) { + _session = session; + } + + void clear() { + _session = null; + } + + static final ClientSessionStore instance = ClientSessionStore._(); + + ClientSessionStore._(); +} diff --git a/apps/mobile/packages/data_connect/pubspec.yaml b/apps/mobile/packages/data_connect/pubspec.yaml new file mode 100644 index 00000000..45610427 --- /dev/null +++ b/apps/mobile/packages/data_connect/pubspec.yaml @@ -0,0 +1,16 @@ +name: krow_data_connect +description: Firebase Data Connect access layer. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + krow_domain: + path: ../domain + flutter_modular: ^6.3.0 diff --git a/apps/mobile/packages/design_system/.gitignore b/apps/mobile/packages/design_system/.gitignore new file mode 100644 index 00000000..dd5eb989 --- /dev/null +++ b/apps/mobile/packages/design_system/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.flutter-plugins-dependencies +/build/ +/coverage/ diff --git a/apps/mobile/packages/design_system/.metadata b/apps/mobile/packages/design_system/.metadata new file mode 100644 index 00000000..685c30f1 --- /dev/null +++ b/apps/mobile/packages/design_system/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "3b62efc2a3da49882f43c372e0bc53daef7295a6" + channel: "stable" + +project_type: package diff --git a/apps/mobile/packages/design_system/analysis_options.yaml b/apps/mobile/packages/design_system/analysis_options.yaml new file mode 100644 index 00000000..f04c6cf0 --- /dev/null +++ b/apps/mobile/packages/design_system/analysis_options.yaml @@ -0,0 +1 @@ +include: ../../analysis_options.yaml diff --git a/apps/mobile/packages/design_system/assets/logo-blue.png b/apps/mobile/packages/design_system/assets/logo-blue.png new file mode 100644 index 00000000..5d757231 Binary files /dev/null and b/apps/mobile/packages/design_system/assets/logo-blue.png differ diff --git a/apps/mobile/packages/design_system/assets/logo-yellow.png b/apps/mobile/packages/design_system/assets/logo-yellow.png new file mode 100644 index 00000000..ef04350b Binary files /dev/null and b/apps/mobile/packages/design_system/assets/logo-yellow.png differ diff --git a/apps/mobile/packages/design_system/lib/design_system.dart b/apps/mobile/packages/design_system/lib/design_system.dart new file mode 100644 index 00000000..5e2638b2 --- /dev/null +++ b/apps/mobile/packages/design_system/lib/design_system.dart @@ -0,0 +1,12 @@ +export 'src/ui_colors.dart'; +export 'src/ui_typography.dart'; +export 'src/ui_constants.dart'; +export 'src/ui_theme.dart'; +export 'src/ui_icons.dart'; +export 'src/ui_images_assets.dart'; +export 'src/widgets/ui_app_bar.dart'; +export 'src/widgets/ui_text_field.dart'; +export 'src/widgets/ui_step_indicator.dart'; +export 'src/widgets/ui_icon_button.dart'; +export 'src/widgets/ui_button.dart'; +export 'src/widgets/ui_chip.dart'; diff --git a/apps/mobile/packages/design_system/lib/src/ui_colors.dart b/apps/mobile/packages/design_system/lib/src/ui_colors.dart new file mode 100644 index 00000000..35c455cc --- /dev/null +++ b/apps/mobile/packages/design_system/lib/src/ui_colors.dart @@ -0,0 +1,322 @@ +import 'package:flutter/material.dart'; + +/// Static definitions of color palettes and semantic colors for the Staff Design System. +/// Values are defined in design_tokens_react.md. +class UiColors { + UiColors._(); + + // --------------------------------------------------------------------------- + // 1. Base Tokens + // --------------------------------------------------------------------------- + + /// Background color (#FAFBFC) + static const Color background = Color(0xFFFAFBFC); + + /// Foreground color (#121826) + static const Color foreground = Color(0xFF121826); + + /// Primary brand color blue (#0A39DF) + static const Color primary = Color(0xFF0A39DF); + + /// Foreground color on primary background (#F7FAFC) + static const Color primaryForeground = Color(0xFFF7FAFC); + + /// Inverse primary color (#9FABF1) + static const Color primaryInverse = Color(0xFF9FABF1); + + /// Secondary background color (#F1F3F5) + static const Color secondary = Color(0xFFF1F3F5); + + /// Foreground color on secondary background (#121826) + static const Color secondaryForeground = Color(0xFF121826); + + /// Muted background color (#F1F3F5) + static const Color muted = Color(0xFFF1F3F5); + + /// Muted foreground color (#6A7382) + static const Color mutedForeground = Color(0xFF6A7382); + + /// Accent yellow color (#F9E547) + static const Color accent = Color(0xFFF9E547); + + /// Foreground color on accent background (#4C460D) + static const Color accentForeground = Color(0xFF4C460D); + + /// Destructive red color (#F04444) + static const Color destructive = Color(0xFFF04444); + + /// Foreground color on destructive background (#FAFAFA) + static const Color destructiveForeground = Color(0xFFFAFAFA); + + /// Default border color (#D1D5DB) + static const Color border = Color(0xFFD1D5DB); + + /// Default input border color (#E7EAEE) + static const Color input = Color(0xFFF5F6F8); + + /// Focus ring color (#0A39DF) + static const Color ring = Color(0xFF0A39DF); + + // --------------------------------------------------------------------------- + // 2. Semantic Mappings + // --------------------------------------------------------------------------- + + // --- Background Colors --- + + /// Primary background (#FAFBFC) + static const Color bgPrimary = background; + + /// Secondary background (#F1F3F5) + static const Color bgSecondary = secondary; + + /// Tertiary background (#EDF0F2) + static const Color bgThird = Color(0xFFEDF0F2); + + /// Popup background (#FFFFFF) + static const Color bgPopup = Color(0xFFFFFFFF); + + /// Highlighted background (#FEF9C3) + static const Color bgHighlight = Color(0xFFFEF9C3); + + /// Menu background (#F8FAFC) + static const Color bgMenu = Color(0xFFF8FAFC); + + /// Banner background (#FFFFFF) + static const Color bgBanner = Color(0xFFFFFFFF); + + /// Overlay background (#000000 with 50% opacity) + static const Color bgOverlay = Color(0x80000000); + + /// Toast background (#121826) + static const Color toastBg = Color(0xFF121826); + + /// Input field background (#E3E6E9) + static const Color bgInputField = input; + + /// Footer banner background (#F1F5F9) + static const Color bgFooterBanner = Color(0xFFF1F5F9); + + // --- Text Colors --- + + /// Primary text (#121826) + static const Color textPrimary = foreground; + + /// Secondary text (#6A7382) + static const Color textSecondary = mutedForeground; + + /// Inactive text (#9CA3AF) + static const Color textInactive = Color(0xFF9CA3AF); + + /// Placeholder text (#9CA3AF) + static const Color textPlaceholder = Color(0xFF9CA3AF); + + /// Description text (#6A7382) + static const Color textDescription = mutedForeground; + + /// Success text (#10B981) + static const Color textSuccess = Color(0xFF10B981); + + /// Error text (#F04444) + static const Color textError = destructive; + + /// Deep error text for containers (#450A0A) + static const Color textErrorContainer = Color(0xFF450A0A); + + /// Warning text (#D97706) + static const Color textWarning = Color(0xFFD97706); + + /// Link text (#0A39DF) + static const Color textLink = primary; + + /// Filter text (#4B5563) + static const Color textFilter = Color(0xFF4B5563); + + // --- Icon Colors --- + + /// Primary icon (#121826) + static const Color iconPrimary = foreground; + + /// Secondary icon (#6A7382) + static const Color iconSecondary = mutedForeground; + + /// Tertiary icon (#9CA3AF) + static const Color iconThird = Color(0xFF9CA3AF); + + /// Inactive icon (#D1D5DB) + static const Color iconInactive = Color(0xFFD1D5DB); + + /// Active icon (#0A39DF) + static const Color iconActive = primary; + + /// Success icon (#10B981) + static const Color iconSuccess = Color(0xFF10B981); + + /// Error icon (#F04444) + static const Color iconError = destructive; + + // --- Loader Colors --- + + /// Active loader (#0A39DF) + static const Color loaderActive = primary; + + /// Inactive loader (#E2E8F0) + static const Color loaderInactive = Color(0xFFE2E8F0); + + // --- Pin Input Colors --- + + /// Unfilled pin (#E2E8F0) + static const Color pinUnfilled = Color(0xFFE2E8F0); + + /// Active pin (#0A39DF) + static const Color pinActive = primary; + + /// Inactive pin (#94A3B8) + static const Color pinInactive = Color(0xFF94A3B8); + + // --- Separator Colors --- + + /// Primary separator (#E3E6E9) + static const Color separatorPrimary = border; + + /// Secondary separator (#F1F5F9) + static const Color separatorSecondary = Color(0xFFF1F5F9); + + /// Special separator (#F9E547) + static const Color separatorSpecial = accent; + + // --- Tag Colors --- + + /// Default tag background (#F1F5F9) + static const Color tagValue = Color(0xFFF1F5F9); + + /// Pending state tag background (#FEF3C7) + static const Color tagPending = Color(0xFFFEF3C7); + + /// In-progress state tag background (#DBEAFE) + static const Color tagInProgress = Color(0xFFDBEAFE); + + /// Error state tag background (#FEE2E2) + static const Color tagError = Color(0xFFFEE2E2); + + /// Active state tag background (#DCFCE7) + static const Color tagActive = Color(0xFFDCFCE7); + + /// Frozen state tag background (#F3F4F6) + static const Color tagFreeze = Color(0xFFF3F4F6); + + /// Success state tag background (#DCFCE7) + static const Color tagSuccess = Color(0xFFDCFCE7); + + /// Refunded state tag background (#E0E7FF) + static const Color tagRefunded = Color(0xFFE0E7FF); + + // --- Border Colors --- + + /// Static border (#D1D5DB) + static const Color borderStill = border; + + /// Primary border (#D1D5DB) + static const Color borderPrimary = border; + + /// Error border (#F04444) + static const Color borderError = destructive; + + /// Focus border (#0A39DF) + static const Color borderFocus = ring; + + /// Inactive border (#F1F5F9) + static const Color borderInactive = Color(0xFFF1F5F9); + + // --- Button Colors --- + + /// Primary button default (#0A39DF) + static const Color buttonPrimaryStill = primary; + + /// Primary button hover (#082EB2) + static const Color buttonPrimaryHover = Color(0xFF082EB2); + + /// Primary button inactive (#F1F3F5) + static const Color buttonPrimaryInactive = secondary; + + /// Secondary button default (#F1F3F5) + static const Color buttonSecondaryStill = secondary; + + /// Secondary button hover (#E2E8F0) + static const Color buttonSecondaryHover = Color(0xFFE2E8F0); + + /// Secondary button inactive (#F3F4F6) + static const Color buttonSecondaryInactive = Color(0xFFF3F4F6); + + /// Button inactive state (#94A3B8) + static const Color buttonInactive = Color(0xFF94A3B8); + + /// Pin button background (#F8FAFC) + static const Color pinButtonBackground = Color(0xFFF8FAFC); + + // --- Switch Colors --- + + /// Switch active state (#10B981) + static const Color switchActive = Color(0xFF10B981); + + /// Switch inactive state (#CBD5E1) + static const Color switchInactive = Color(0xFFCBD5E1); + + /// Switch dot inactive state (#FFFFFF) + static const Color dotInactive = Color(0xFFFFFFFF); + + // --- Basic Colors --- + + /// Standard white (#FFFFFF) + static const Color white = Color(0xFFFFFFFF); + + /// Standard black (#000000) + static const Color black = Color(0xFF000000); + + /// Transparent color (0x00000000) + static const Color transparent = Color(0x00000000); + + /// Card background (#FFFFFF) + static const Color cardViewBackground = Color(0xFFFFFFFF); + + // --- Shadows --- + + /// Primary popup shadow (#000000 with 10% opacity) + static const Color popupShadow = Color(0x1A000000); + + // --------------------------------------------------------------------------- + // 3. ColorScheme + // --------------------------------------------------------------------------- + + /// Generates a ColorScheme based on the tokens. + static ColorScheme get colorScheme => const ColorScheme( + brightness: Brightness.light, + primary: primary, + onPrimary: primaryForeground, + primaryContainer: tagRefunded, + onPrimaryContainer: primary, + secondary: secondary, + onSecondary: secondaryForeground, + secondaryContainer: muted, + onSecondaryContainer: secondaryForeground, + tertiary: accent, + onTertiary: accentForeground, + tertiaryContainer: bgHighlight, + onTertiaryContainer: accentForeground, + error: destructive, + onError: destructiveForeground, + errorContainer: tagError, + onErrorContainer: textErrorContainer, + surface: background, + onSurface: foreground, + surfaceContainerHighest: muted, + onSurfaceVariant: mutedForeground, + outline: border, + outlineVariant: separatorSecondary, + shadow: black, + scrim: black, + inverseSurface: foreground, + onInverseSurface: background, + inversePrimary: primaryInverse, + surfaceTint: primary, + ); +} diff --git a/apps/mobile/packages/design_system/lib/src/ui_constants.dart b/apps/mobile/packages/design_system/lib/src/ui_constants.dart new file mode 100644 index 00000000..819699b1 --- /dev/null +++ b/apps/mobile/packages/design_system/lib/src/ui_constants.dart @@ -0,0 +1,40 @@ +import 'package:flutter/material.dart'; + +/// Design system constants for spacing, radii, and other layout properties. +class UiConstants { + UiConstants._(); + + // --- Border Radii --- + + /// Base radius: 12px + static const double radiusBase = 12.0; + static final BorderRadius radiusLg = BorderRadius.circular(radiusBase); + + /// Medium radius: 6px + static const double radiusMdValue = 6.0; + static final BorderRadius radiusMd = BorderRadius.circular(radiusMdValue); + + /// Small radius: 4px + static final BorderRadius radiusSm = BorderRadius.circular(4.0); + + /// Extra small radius: 2px + static final BorderRadius radiusXs = BorderRadius.circular(2.0); + + /// Large/Full radius + static final BorderRadius radiusFull = BorderRadius.circular(999.0); + + // --- Spacing --- + + static const double space0 = 0.0; + static const double space1 = 4.0; + static const double space2 = 8.0; + static const double space3 = 12.0; + static const double space4 = 16.0; + static const double space5 = 20.0; + static const double space6 = 24.0; + static const double space8 = 32.0; + static const double space10 = 40.0; + static const double space12 = 48.0; + static const double space14 = 56.0; + static const double space16 = 64.0; +} diff --git a/apps/mobile/packages/design_system/lib/src/ui_icons.dart b/apps/mobile/packages/design_system/lib/src/ui_icons.dart new file mode 100644 index 00000000..e035bf63 --- /dev/null +++ b/apps/mobile/packages/design_system/lib/src/ui_icons.dart @@ -0,0 +1,222 @@ +import 'package:flutter/widgets.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:lucide_icons/lucide_icons.dart'; + +/// The primary icon library used by the design system. +/// This allows for easier swapping of icon libraries in the future. +typedef _IconLib = LucideIcons; + +/// The secondary icon library used by the design system. +/// This allows for easier swapping of icon libraries in the future. +typedef _IconLib2 = FontAwesomeIcons; + +/// Static definitions of icons for the UI design system. +/// This class wraps the primary icon library to provide a consistent interface. +/// +/// example: +/// ```dart +/// Icon(UiIcons.home) +/// ``` +class UiIcons { + UiIcons._(); + + // --- Navigation --- + + /// Home icon + static const IconData home = _IconLib.home; + + /// Calendar icon for shifts or schedules + static const IconData calendar = _IconLib.calendar; + + /// Briefcase icon for jobs + static const IconData briefcase = _IconLib.briefcase; + + /// User icon for profile + static const IconData user = _IconLib.user; + + /// Users icon for groups or staff + static const IconData users = _IconLib.users; + + /// Settings icon + static const IconData settings = _IconLib.settings; + + // --- Actions --- + + /// Search icon + static const IconData search = _IconLib.search; + + /// Filter icon + static const IconData filter = _IconLib.filter; + + /// Plus/Add icon + static const IconData add = _IconLib.plus; + + /// Minus icon + static const IconData minus = _IconLib.minus; + + /// Edit icon + static const IconData edit = _IconLib.edit2; + + /// Delete/Trash icon + static const IconData delete = _IconLib.trash2; + + /// Checkmark icon + static const IconData check = _IconLib.check; + + /// X/Cancel icon + static const IconData close = _IconLib.x; + + /// Arrow right icon + static const IconData arrowRight = _IconLib.arrowRight; + + /// Arrow left icon + static const IconData arrowLeft = _IconLib.arrowLeft; + + /// Swap/Transfer icon + static const IconData swap = _IconLib.arrowLeftRight; + + /// Chevron right icon + static const IconData chevronRight = _IconLib.chevronRight; + + /// Chevron left icon + static const IconData chevronLeft = _IconLib.chevronLeft; + + /// Chevron down icon + static const IconData chevronDown = _IconLib.chevronDown; + + /// Chevron up icon + static const IconData chevronUp = _IconLib.chevronUp; + + // --- Status & Feedback --- + + /// Info icon + static const IconData info = _IconLib.info; + + /// Help/Circle icon + static const IconData help = _IconLib.helpCircle; + + /// Alert/Triangle icon for warnings + static const IconData warning = _IconLib.alertTriangle; + + /// Alert/Circle icon for errors + static const IconData error = _IconLib.alertCircle; + + /// Success/Check circle icon + static const IconData success = _IconLib.checkCircle2; + + // --- Miscellaneous --- + + /// Clock icon + static const IconData clock = _IconLib.clock; + + /// Log in icon + static const IconData logIn = _IconLib.logIn; + + /// Break icon (Coffee) + static const IconData breakIcon = _IconLib.coffee; + + /// Map pin icon for locations + static const IconData mapPin = _IconLib.mapPin; + + /// Dollar sign icon for payments/earnings + static const IconData dollar = _IconLib.dollarSign; + + /// Wallet icon + static const IconData wallet = _IconLib.wallet; + + /// Credit card icon + static const IconData creditCard = _IconLib.creditCard; + + /// Bell icon for notifications + static const IconData bell = _IconLib.bell; + + /// Log out icon + static const IconData logOut = _IconLib.logOut; + + /// File/Document icon + static const IconData file = _IconLib.fileText; + + /// Lock icon + static const IconData lock = _IconLib.lock; + + /// Shield check icon for compliance/security + static const IconData shield = _IconLib.shieldCheck; + + /// Sparkles icon for features or AI + static const IconData sparkles = _IconLib.sparkles; + + /// Navigation/Compass icon + static const IconData navigation = _IconLib.navigation; + + /// Star icon for ratings + static const IconData star = _IconLib.star; + + /// Camera icon for photo upload + static const IconData camera = _IconLib.camera; + + /// Mail icon + static const IconData mail = _IconLib.mail; + + /// Eye icon for visibility + static const IconData eye = _IconLib.eye; + + /// Eye off icon for hidden visibility + static const IconData eyeOff = _IconLib.eyeOff; + + /// Phone icon for calls + static const IconData phone = _IconLib.phone; + + /// Message circle icon for chat + static const IconData messageCircle = _IconLib.messageCircle; + + /// Building icon for companies + static const IconData building = _IconLib.building2; + + /// Zap icon for rapid actions + static const IconData zap = _IconLib.zap; + + /// Grip vertical icon for reordering + static const IconData gripVertical = _IconLib.gripVertical; + + /// Trending down icon for insights + static const IconData trendingDown = _IconLib.trendingDown; + + /// Target icon for metrics + static const IconData target = _IconLib.target; + + /// Rotate CCW icon for reordering + static const IconData rotateCcw = _IconLib.rotateCcw; + + /// Apple icon + static const IconData apple = _IconLib2.apple; + + /// Google icon + static const IconData google = _IconLib2.google; + + /// NFC icon + static const IconData nfc = _IconLib.nfc; + + /// Chart icon for reports + static const IconData chart = _IconLib.barChart3; + + /// Download icon + static const IconData download = _IconLib.download; + + /// Upload icon + static const IconData upload = _IconLib.upload; + + /// Upload Cloud icon + static const IconData uploadCloud = _IconLib.uploadCloud; + + /// File Check icon + static const IconData fileCheck = _IconLib.fileCheck; + + /// Utensils icon + static const IconData utensils = _IconLib.utensils; + + /// Wine icon + static const IconData wine = _IconLib.wine; + + /// Award icon + static const IconData award = _IconLib.award; +} diff --git a/apps/mobile/packages/design_system/lib/src/ui_images_assets.dart b/apps/mobile/packages/design_system/lib/src/ui_images_assets.dart new file mode 100644 index 00000000..14b32f0d --- /dev/null +++ b/apps/mobile/packages/design_system/lib/src/ui_images_assets.dart @@ -0,0 +1,14 @@ +/// Static definitions of image asset paths for the Design System. +/// +/// This class provides a centralized way to access image assets +/// stored within the `design_system` package. +class UiImageAssets { + UiImageAssets._(); + + /// The path to the yellow version of the logo image. + static const String logoYellow = + 'packages/design_system/assets/logo-yellow.png'; + + /// The path to the blue version of the logo image. + static const String logoBlue = 'packages/design_system/assets/logo-blue.png'; +} diff --git a/apps/mobile/packages/design_system/lib/src/ui_theme.dart b/apps/mobile/packages/design_system/lib/src/ui_theme.dart new file mode 100644 index 00000000..ae97f1b6 --- /dev/null +++ b/apps/mobile/packages/design_system/lib/src/ui_theme.dart @@ -0,0 +1,356 @@ +import 'package:flutter/material.dart'; +import 'ui_colors.dart'; +import 'ui_typography.dart'; +import 'ui_constants.dart'; + +/// The main entry point for the Staff Design System theme. +/// Assembles colors, typography, and constants into a comprehensive Material 3 theme. +/// +/// Adheres to the tokens defined in design_tokens_react.md. +class UiTheme { + UiTheme._(); + + /// Returns the light theme for the Staff application. + static ThemeData get light { + final ColorScheme colorScheme = UiColors.colorScheme; + final TextTheme textTheme = UiTypography.textTheme; + + return ThemeData( + useMaterial3: true, + colorScheme: colorScheme, + scaffoldBackgroundColor: UiColors.background, + primaryColor: UiColors.primary, + canvasColor: UiColors.background, + + // Typography + textTheme: textTheme, + + // Icon Theme + iconTheme: const IconThemeData(color: UiColors.iconPrimary, size: 24), + + // Text Selection Theme + textSelectionTheme: const TextSelectionThemeData( + cursorColor: UiColors.primary, + selectionColor: UiColors.primaryInverse, + selectionHandleColor: UiColors.primary, + ), + + // Divider Theme + dividerTheme: const DividerThemeData( + color: UiColors.separatorPrimary, + space: 1, + thickness: 1, + ), + + // Card Theme + cardTheme: CardThemeData( + color: UiColors.white, + elevation: 2, + shadowColor: UiColors.popupShadow, + shape: RoundedRectangleBorder( + borderRadius: UiConstants.radiusLg, + side: const BorderSide(color: UiColors.borderStill), + ), + margin: EdgeInsets.zero, + ), + + // Elevated Button Theme (Primary) + elevatedButtonTheme: ElevatedButtonThemeData( + style: + ElevatedButton.styleFrom( + elevation: 0, + backgroundColor: UiColors.buttonPrimaryStill, + foregroundColor: UiColors.primaryForeground, + disabledBackgroundColor: UiColors.buttonPrimaryInactive, + textStyle: UiTypography.buttonXL, + shape: RoundedRectangleBorder(borderRadius: UiConstants.radiusLg), + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space6, + vertical: UiConstants.space3, + ), + maximumSize: const Size(double.infinity, 54), + ).copyWith( + side: WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.disabled)) { + return const BorderSide( + color: UiColors.borderPrimary, + width: 0.5, + ); + } + return null; + }), + overlayColor: WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.hovered)) + return UiColors.buttonPrimaryHover; + return null; + }), + ), + ), + + // Text Button Theme + textButtonTheme: TextButtonThemeData( + style: TextButton.styleFrom( + foregroundColor: UiColors.textPrimary, + disabledForegroundColor: UiColors.textInactive, + textStyle: UiTypography.buttonXL, + shape: RoundedRectangleBorder(borderRadius: UiConstants.radiusLg), + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space4, + vertical: UiConstants.space2, + ), + maximumSize: const Size(double.infinity, 52), + ), + ), + + // Outlined Button Theme (Secondary) + outlinedButtonTheme: OutlinedButtonThemeData( + style: OutlinedButton.styleFrom( + elevation: 0, + backgroundColor: UiColors.buttonSecondaryStill, + foregroundColor: UiColors.primary, + side: const BorderSide(color: UiColors.borderFocus, width: 0.5), + textStyle: UiTypography.buttonXL, + shape: RoundedRectangleBorder(borderRadius: UiConstants.radiusLg), + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space4, + vertical: UiConstants.space3, + ), + maximumSize: const Size(double.infinity, 52), + ), + ), + + // Icon Button Theme + iconButtonTheme: IconButtonThemeData( + style: IconButton.styleFrom( + foregroundColor: UiColors.iconPrimary, + disabledForegroundColor: UiColors.iconInactive, + shape: RoundedRectangleBorder(borderRadius: UiConstants.radiusFull), + ), + ), + + // Floating Action Button Theme + floatingActionButtonTheme: const FloatingActionButtonThemeData( + backgroundColor: UiColors.primary, + foregroundColor: UiColors.primaryForeground, + elevation: 4, + shape: CircleBorder(), + ), + + // Tab Bar Theme + tabBarTheme: TabBarThemeData( + labelColor: UiColors.primary, + unselectedLabelColor: UiColors.textSecondary, + labelStyle: UiTypography.buttonM, + unselectedLabelStyle: UiTypography.buttonM, + indicatorSize: TabBarIndicatorSize.label, + indicator: const UnderlineTabIndicator( + borderSide: BorderSide(color: UiColors.primary, width: 2), + ), + ), + + // Input Theme + inputDecorationTheme: InputDecorationTheme( + filled: true, + fillColor: UiColors.bgInputField, + hintStyle: UiTypography.body2r.textPlaceholder, + labelStyle: UiTypography.body4r.textPrimary, + errorStyle: UiTypography.footnote1r.textError, + contentPadding: const EdgeInsets.symmetric( + horizontal: UiConstants.space3, + vertical: UiConstants.space3, + ), + border: OutlineInputBorder( + borderRadius: UiConstants.radiusMd, + borderSide: const BorderSide(color: UiColors.borderStill), + ), + enabledBorder: OutlineInputBorder( + borderRadius: UiConstants.radiusMd, + borderSide: const BorderSide(color: UiColors.borderStill), + ), + focusedBorder: OutlineInputBorder( + borderRadius: UiConstants.radiusMd, + borderSide: const BorderSide( + color: UiColors.borderFocus, + width: 0.75, + ), + ), + errorBorder: OutlineInputBorder( + borderRadius: UiConstants.radiusMd, + borderSide: const BorderSide(color: UiColors.textError), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: UiConstants.radiusMd, + borderSide: const BorderSide(color: UiColors.textError, width: 1), + ), + ), + + // List Tile Theme + listTileTheme: ListTileThemeData( + textColor: UiColors.textPrimary, + iconColor: UiColors.iconPrimary, + titleTextStyle: UiTypography.body1m, + subtitleTextStyle: UiTypography.body2r.textSecondary, + contentPadding: const EdgeInsets.symmetric( + horizontal: UiConstants.space4, + ), + tileColor: UiColors.transparent, + ), + + // Badge Theme + badgeTheme: BadgeThemeData( + backgroundColor: UiColors.primary, + textColor: UiColors.primaryForeground, + textStyle: UiTypography.footnote2m, + padding: const EdgeInsets.symmetric(horizontal: 4), + ), + + // App Bar Theme + appBarTheme: AppBarTheme( + backgroundColor: UiColors.background, + elevation: 0, + titleTextStyle: UiTypography.headline5m.textPrimary, + iconTheme: const IconThemeData(color: UiColors.iconThird, size: 20), + surfaceTintColor: UiColors.transparent, + ), + + // Dialog Theme + dialogTheme: DialogThemeData( + backgroundColor: UiColors.bgPopup, + elevation: 8, + shadowColor: UiColors.popupShadow, + shape: RoundedRectangleBorder(borderRadius: UiConstants.radiusLg), + titleTextStyle: UiTypography.headline2r.textPrimary, + contentTextStyle: UiTypography.body2r.textDescription, + ), + + // Bottom Navigation Bar Theme + bottomNavigationBarTheme: BottomNavigationBarThemeData( + backgroundColor: UiColors.white, + selectedItemColor: UiColors.primary, + unselectedItemColor: UiColors.textInactive, + selectedLabelStyle: UiTypography.footnote2m, + unselectedLabelStyle: UiTypography.footnote2r, + type: BottomNavigationBarType.fixed, + elevation: 8, + ), + + // Navigation Bar Theme (Modern M3 Bottom Nav) + navigationBarTheme: NavigationBarThemeData( + backgroundColor: UiColors.white, + indicatorColor: UiColors.primaryInverse.withAlpha(51), // 20% of 255 + labelTextStyle: WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.selected)) { + return UiTypography.footnote2m.textPrimary; + } + return UiTypography.footnote2r.textInactive; + }), + ), + + // Switch Theme + switchTheme: SwitchThemeData( + trackColor: WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.selected)) { + return UiColors.switchActive; + } + return UiColors.switchInactive; + }), + thumbColor: const WidgetStatePropertyAll(UiColors.white), + ), + + // Checkbox Theme + checkboxTheme: CheckboxThemeData( + fillColor: WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.selected)) return UiColors.primary; + return null; + }), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)), + ), + + // Radio Theme + radioTheme: RadioThemeData( + fillColor: WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.selected)) return UiColors.primary; + return null; + }), + ), + + // Slider Theme + sliderTheme: const SliderThemeData( + activeTrackColor: UiColors.primary, + inactiveTrackColor: UiColors.loaderInactive, + thumbColor: UiColors.primary, + overlayColor: UiColors.primaryInverse, + ), + + // Chip Theme + chipTheme: ChipThemeData( + backgroundColor: UiColors.bgSecondary, + labelStyle: UiTypography.footnote1m, + secondaryLabelStyle: UiTypography.footnote1m.white, + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + shape: RoundedRectangleBorder(borderRadius: UiConstants.radiusMd), + side: const BorderSide(color: UiColors.borderStill, width: 0.5), + ), + + // SnackBar Theme + snackBarTheme: SnackBarThemeData( + backgroundColor: UiColors.toastBg, + contentTextStyle: UiTypography.body2r.white, + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder(borderRadius: UiConstants.radiusMd), + elevation: 4, + ), + + // Bottom Sheet Theme + bottomSheetTheme: const BottomSheetThemeData( + backgroundColor: UiColors.bgSecondary, + modalBackgroundColor: UiColors.bgSecondary, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical(top: Radius.circular(32)), + ), + ), + + // Expansion Tile Theme + expansionTileTheme: ExpansionTileThemeData( + iconColor: UiColors.iconSecondary, + collapsedIconColor: UiColors.iconPrimary, + backgroundColor: UiColors.bgPopup, + collapsedBackgroundColor: UiColors.transparent, + textColor: UiColors.textPrimary, + collapsedTextColor: UiColors.textPrimary, + tilePadding: const EdgeInsets.symmetric(horizontal: UiConstants.space4), + shape: RoundedRectangleBorder(borderRadius: UiConstants.radiusMd), + collapsedShape: RoundedRectangleBorder( + borderRadius: UiConstants.radiusMd, + ), + ), + + // Menu Theme + menuTheme: MenuThemeData( + style: MenuStyle( + backgroundColor: WidgetStateProperty.all(UiColors.bgPopup), + elevation: WidgetStateProperty.all(4), + shape: WidgetStateProperty.all( + RoundedRectangleBorder(borderRadius: UiConstants.radiusMd), + ), + ), + ), + + // Tooltip Theme + tooltipTheme: TooltipThemeData( + decoration: BoxDecoration( + color: UiColors.toastBg.withAlpha(230), // ~90% of 255 + borderRadius: UiConstants.radiusMd, + ), + textStyle: UiTypography.footnote2r.white, + ), + + // Progress Indicator Theme + progressIndicatorTheme: const ProgressIndicatorThemeData( + color: UiColors.primary, + linearTrackColor: UiColors.loaderInactive, + linearMinHeight: 4, + ), + ); + } +} diff --git a/apps/mobile/packages/design_system/lib/src/ui_typography.dart b/apps/mobile/packages/design_system/lib/src/ui_typography.dart new file mode 100644 index 00000000..ed823b5e --- /dev/null +++ b/apps/mobile/packages/design_system/lib/src/ui_typography.dart @@ -0,0 +1,582 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:design_system/design_system.dart'; +import 'ui_colors.dart'; + +/// Static definitions of typography styles for the Staff Design System. +class UiTypography { + UiTypography._(); + + // --------------------------------------------------------------------------- + // 0. Base Font Styles + // --------------------------------------------------------------------------- + + /// The primary font family used throughout the design system. + static final TextStyle _primaryBase = GoogleFonts.instrumentSans(); + + /// The secondary font family used for display or specialized elements. + static final TextStyle _secondaryBase = GoogleFonts.spaceGrotesk(); + + // --------------------------------------------------------------------------- + // 1. Primary Typography (Instrument Sans) + // --------------------------------------------------------------------------- + + // --- 1.1 Display --- + + /// Display Large - Font: Instrument Sans, Size: 36, Height: 1.1 (#121826) + static final TextStyle displayL = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 36, + height: 1.1, + color: UiColors.textPrimary, + ); + + /// Display medium - Font: Instrument Sans, Size: 32, Height: 1.1 (#121826) + static final TextStyle displayM = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 32, + height: 1.1, + color: UiColors.textPrimary, + ); + + /// Display small - Font: Instrument Sans, Size: 32, Height: 1.1 (#121826) + static final TextStyle displayMb = _primaryBase.copyWith( + fontWeight: FontWeight.w600, + fontSize: 32, + height: 1.1, + color: UiColors.textPrimary, + ); + + /// Display 1 Medium - Font: Instrument Sans, Size: 26, Height: 1.1 (#121826) + static final TextStyle display1m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 26, + height: 1.1, + color: UiColors.textPrimary, + ); + + /// Display 1 Regular - Font: Instrument Sans, Size: 38, Height: 1.3 (#121826) + static final TextStyle display1r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 26, + height: 1.3, + letterSpacing: -1, + color: UiColors.textPrimary, + ); + + /// Display 1 Bold - Font: Instrument Sans, Size: 38, Height: 1.3 (#121826) + static final TextStyle display1b = _primaryBase.copyWith( + fontWeight: FontWeight.w600, + fontSize: 26, + height: 1.3, + letterSpacing: -1, + color: UiColors.textPrimary, + ); + + /// Display 2 Medium - Font: Instrument Sans, Size: 16, Height: 1.1 (#121826) + static final TextStyle display2m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 16, + height: 1.1, + color: UiColors.textPrimary, + ); + + /// Display 2 Regular - Font: Instrument Sans, Size: 28, Height: 1.5 (#121826) + static final TextStyle display2r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 16, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Display 3 Medium - Font: Instrument Sans, Size: 32, Height: 1.1 (#121826) + static final TextStyle display3m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 14, + height: 1.1, + color: UiColors.textPrimary, + ); + + /// Display 3 Regular - Font: Instrument Sans, Size: 32, Height: 1.3 (#121826) + static final TextStyle display3r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 14, + height: 1.3, + color: UiColors.textPrimary, + ); + + /// Display 3 Bold - Font: Instrument Sans, Size: 32, Height: 1.1 (#121826) + static final TextStyle display3b = _primaryBase.copyWith( + fontWeight: FontWeight.w600, + fontSize: 14, + height: 1.1, + color: UiColors.textPrimary, + ); + + // --- 1.2 Title --- + + /// Title 1 Medium - Font: Instrument Sans, Size: 18, Height: 1.5 (#121826) + static final TextStyle title1m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 18, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Title 1 Regular - Font: Instrument Sans, Size: 16, Height: 1.5 (#121826) + static final TextStyle title1r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 18, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Title 2 Bold - Font: Instrument Sans, Size: 20, Height: 1.1 (#121826) + static final TextStyle title2b = _primaryBase.copyWith( + fontWeight: FontWeight.w600, + fontSize: 16, + height: 1.1, + color: UiColors.textPrimary, + ); + + /// Title 2 Medium - Font: Instrument Sans, Size: 16, Height: 1.5 (#121826) + static final TextStyle title2m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 16, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Title 2 Regular - Font: Instrument Sans, Size: 16, Height: 1.5 (#121826) + static final TextStyle title2r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 16, + height: 1.5, + color: UiColors.textPrimary, + ); + + // --- 1.3 Headline --- + + /// Headline 1 Medium - Font: Instrument Sans, Size: 26, Height: 1.5 (#121826) + static final TextStyle headline1m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 26, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Headline 1 Regular - Font: Instrument Sans, Size: 26, Height: 1.5 (#121826) + static final TextStyle headline1r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 26, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Headline 2 Medium - Font: Instrument Sans, Size: 20, Height: 1.5 (#121826) + static final TextStyle headline2m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 22, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Headline 2 Regular - Font: Instrument Sans, Size: 20, Height: 1.5 (#121826) + static final TextStyle headline2r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 22, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Headline 3 Medium - Font: Instrument Sans, Size: 22, Height: 1.5 (#121826) + static final TextStyle headline3m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 20, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Headline 4 Medium - Font: Instrument Sans, Size: 22, Height: 1.5 (#121826) + static final TextStyle headline4m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 18, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Headline 4 Regular - Font: Instrument Sans, Size: 20, Height: 1.5 (#121826) + static final TextStyle headline4r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 18, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Headline 5 Regular - Font: Instrument Sans, Size: 18, Height: 1.5 (#121826) + static final TextStyle headline5r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 14, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Headline 5 Medium - Font: Instrument Sans, Size: 16, Height: 1.5 (#121826) + static final TextStyle headline5m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 16, + height: 1.5, + color: UiColors.textPrimary, + ); + + // --- 1.4 Title Uppercase --- + + /// Title Uppercase 2 Medium - Font: Instrument Sans, Size: 14, Height: 1.5, Spacing: 0.7 (#121826) + static final TextStyle titleUppercase2m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 14, + height: 1.5, + letterSpacing: 0.4, + color: UiColors.textPrimary, + ); + + /// Title Uppercase 3 Medium - Font: Instrument Sans, Size: 12, Height: 1.5, Spacing: 1.5 (#121826) + static final TextStyle titleUppercase3m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 12, + height: 1.5, + letterSpacing: 0.7, + color: UiColors.textPrimary, + ); + + /// Title Uppercase 4 Medium - Font: Instrument Sans, Size: 11, Height: 1.5, Spacing: 2.2 (#121826) + static final TextStyle titleUppercase4m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 11, + height: 1.5, + letterSpacing: 0.7, + color: UiColors.textPrimary, + ); + + /// Title Uppercase 4 Bold - Font: Instrument Sans, Size: 11, Height: 1.5, Spacing: 2.2 (#121826) + static final TextStyle titleUppercase4b = _primaryBase.copyWith( + fontWeight: FontWeight.w700, + fontSize: 11, + height: 1.5, + letterSpacing: 0.7, + color: UiColors.textPrimary, + ); + + // --- 1.5 Body --- + + /// Body 1 Bold - Font: Instrument Sans, Size: 16, Height: 1.5 (#121826) + static final TextStyle body1b = _primaryBase.copyWith( + fontWeight: FontWeight.w700, + fontSize: 16, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Body 1 Medium - Font: Instrument Sans, Size: 16, Height: 1.5 (#121826) + static final TextStyle body1m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 16, + height: 1.5, + letterSpacing: -0.025, + color: UiColors.textPrimary, + ); + + /// Body 1 Regular - Font: Instrument Sans, Size: 16, Height: 1.5 (#121826) + static final TextStyle body1r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 16, + height: 1.5, + letterSpacing: -0.05, + color: UiColors.textPrimary, + ); + + /// Body 2 Bold - Font: Instrument Sans, Size: 14, Height: 1.5 (#121826) + static final TextStyle body2b = _primaryBase.copyWith( + fontWeight: FontWeight.w700, + fontSize: 14, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Body 2 Medium - Font: Instrument Sans, Size: 14, Height: 1.5 (#121826) + static final TextStyle body2m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 14, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Body 2 Regular - Font: Instrument Sans, Size: 14, Height: 1.5, Spacing: 0.1 (#121826) + static final TextStyle body2r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 14, + height: 1.5, + letterSpacing: 0.1, + color: UiColors.textPrimary, + ); + + /// Body 3 Regular - Font: Instrument Sans, Size: 14, Height: 1.5, Spacing: -0.1 (#121826) + static final TextStyle body3r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 12, + height: 1.5, + letterSpacing: -0.1, + color: UiColors.textPrimary, + ); + + /// Body 3 Medium - Font: Instrument Sans, Size: 14, Height: 1.5, Spacing: -0.1 (#121826) + static final TextStyle body3m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 12, + height: 1.5, + letterSpacing: -0.1, + color: UiColors.textPrimary, + ); + + /// Body 4 Regular - Font: Instrument Sans, Size: 14, Height: 1.5, Spacing: 0.05 (#121826) + static final TextStyle body4r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 12, + height: 1.5, + letterSpacing: 0.05, + color: UiColors.textPrimary, + ); + + /// Body 4 Medium - Font: Instrument Sans, Size: 14, Height: 1.5, Spacing: 0.05 (#121826) + static final TextStyle body4m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 12, + height: 1.5, + letterSpacing: 0.05, + color: UiColors.textPrimary, + ); + + // --- 1.6 Footnote --- + + /// Footnote 1 Medium - Font: Instrument Sans, Size: 12, Height: 1.5 (#121826) + static final TextStyle footnote1m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 12, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Footnote 1 Regular - Font: Instrument Sans, Size: 12, Height: 1.5, Spacing: 0.05 (#121826) + static final TextStyle footnote1r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 12, + height: 1.5, + letterSpacing: 0.05, + color: UiColors.textPrimary, + ); + + /// Footnote 1 Bold - Font: Instrument Sans, Size: 12, Height: 1.5, Spacing: 0.05 (#121826) + static final TextStyle footnote1b = _primaryBase.copyWith( + fontWeight: FontWeight.w700, + fontSize: 12, + height: 1.5, + letterSpacing: 0.05, + color: UiColors.textPrimary, + ); + + /// Footnote 2 Medium - Font: Instrument Sans, Size: 10, Height: 1.5 (#121826) + static final TextStyle footnote2m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 10, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Footnote 2 Bold - Font: Instrument Sans, Size: 10, Height: 1.5 (#121826) + static final TextStyle footnote2b = _primaryBase.copyWith( + fontWeight: FontWeight.w700, + fontSize: 10, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Footnote 2 Regular - Font: Instrument Sans, Size: 10, Height: 1.5 (#121826) + static final TextStyle footnote2r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 10, + height: 1.5, + color: UiColors.textPrimary, + ); + + // --- 1.7 Button --- + + /// Button S - Font: Instrument Sans, Size: 10, Height: 1.5 (#121826) + static final TextStyle buttonS = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 10, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Button Medium - Font: Instrument Sans, Size: 12, Height: 1.5 (#121826) + static final TextStyle buttonM = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 12, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Button Large - Font: Instrument Sans, Size: 14, Height: 1.5 (#121826) + static final TextStyle buttonL = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 14, + height: 1.5, + color: UiColors.textPrimary, + ); + + /// Button XL - Font: Instrument Sans, Size: 16, Height: 1.5 (#121826) + static final TextStyle buttonXL = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 16, + height: 1.5, + color: UiColors.textPrimary, + ); + + // --- 1.8 Link --- + + /// Link 1 Regular - Font: Instrument Sans, Size: 16, Height: 1.5, Underlined (#0A39DF) + static final TextStyle link1r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 16, + height: 1.5, + color: UiColors.textLink, + decoration: TextDecoration.underline, + decorationColor: UiColors.textLink, + ); + + /// Link 2 Medium - Font: Instrument Sans, Size: 14, Height: 1.5, Underlined (#0A39DF) + static final TextStyle link2m = _primaryBase.copyWith( + fontWeight: FontWeight.w500, + fontSize: 14, + height: 1.5, + color: UiColors.textLink, + decoration: TextDecoration.underline, + decorationColor: UiColors.textLink, + ); + + /// Link 2 Regular - Font: Instrument Sans, Size: 14, Height: 1.5, Underlined (#0A39DF) + static final TextStyle link2r = _primaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 14, + height: 1.5, + color: UiColors.textLink, + decoration: TextDecoration.underline, + decorationColor: UiColors.textLink, + ); + + // --------------------------------------------------------------------------- + // 2. Secondary Typography (Space Grotesk) + // --------------------------------------------------------------------------- + + // --- 2.1 Display --- + + /// Display 1 Bold (Secondary) - Font: Space Grotesk, Size: 50, Height: 1.1 (#121826) + static final TextStyle secondaryDisplay1b = _secondaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 50, + height: 1.1, + color: UiColors.textPrimary, + ); + + /// Display 1 Regular (Secondary) - Font: Space Grotesk, Size: 50, Height: 1.1 (#121826) + static final TextStyle secondaryDisplay1r = _secondaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 50, + height: 1.1, + color: UiColors.textPrimary, + ); + + /// Display 2 Bold (Secondary) - Font: Space Grotesk, Size: 40, Height: 1.1 (#121826) + static final TextStyle secondaryDisplay2b = _secondaryBase.copyWith( + fontWeight: FontWeight.w700, + fontSize: 40, + height: 1.1, + color: UiColors.textPrimary, + ); + + /// Display 2 Regular (Secondary) - Font: Space Grotesk, Size: 40, Height: 1.1 (#121826) + static final TextStyle secondaryDisplay2r = _secondaryBase.copyWith( + fontWeight: FontWeight.w400, + fontSize: 40, + height: 1.1, + color: UiColors.textPrimary, + ); + + // --------------------------------------------------------------------------- + // 3. TextTheme Mapping + // --------------------------------------------------------------------------- + + /// Primary TextTheme + static TextTheme get textTheme => TextTheme( + displayLarge: display1r, + displayMedium: displayL, + displaySmall: display3m, + headlineLarge: headline1m, + headlineMedium: headline3m, + headlineSmall: headline2m, + titleLarge: title1m, + titleMedium: title2m, + titleSmall: body2m, + bodyLarge: body1r, + bodyMedium: body2r, + bodySmall: footnote1r, + labelLarge: buttonL, + labelMedium: buttonM, + labelSmall: footnote2r, + ); +} + +/// Extension to easily color text styles using the Staff Design System color palette. +extension TypographyColors on TextStyle { + /// Primary text color (#121826) + TextStyle get textPrimary => copyWith(color: UiColors.textPrimary); + + /// Secondary text color (#6A7382) + TextStyle get textSecondary => copyWith(color: UiColors.textSecondary); + + /// Inactive text color (#9CA3AF) + TextStyle get textInactive => copyWith(color: UiColors.textInactive); + + /// Tertiary text color (#9CA3AF) + TextStyle get textTertiary => copyWith(color: UiColors.textInactive); + + /// Placeholder text color (#9CA3AF) + TextStyle get textPlaceholder => copyWith(color: UiColors.textPlaceholder); + + /// Description text color (#6A7382) + TextStyle get textDescription => copyWith(color: UiColors.textDescription); + + /// Success text color (#10B981) + TextStyle get textSuccess => copyWith(color: UiColors.textSuccess); + + /// Error text color (#F04444) + TextStyle get textError => copyWith(color: UiColors.textError); + + /// Warning text color (#D97706) + TextStyle get textWarning => copyWith(color: UiColors.textWarning); + + /// Link text color (#0A39DF) + TextStyle get textLink => copyWith(color: UiColors.textLink); + + /// White text color (#FFFFFF) + TextStyle get white => copyWith(color: UiColors.white); + + /// Black text color (#000000) + TextStyle get black => copyWith(color: UiColors.black); + + /// Underline decoration + TextStyle get underline => copyWith(decoration: TextDecoration.underline); + + /// Active content color + TextStyle get activeContentColor => copyWith(color: UiColors.textPrimary); +} diff --git a/apps/mobile/packages/design_system/lib/src/widgets/ui_app_bar.dart b/apps/mobile/packages/design_system/lib/src/widgets/ui_app_bar.dart new file mode 100644 index 00000000..2af61b8b --- /dev/null +++ b/apps/mobile/packages/design_system/lib/src/widgets/ui_app_bar.dart @@ -0,0 +1,76 @@ +import 'package:flutter/material.dart'; + +import '../ui_icons.dart'; + +/// A custom AppBar for the Krow UI design system. +/// +/// This widget provides a consistent look and feel for top app bars across the application. +class UiAppBar extends StatelessWidget implements PreferredSizeWidget { + /// The title text to display in the app bar. + final String? title; + + /// A widget to display instead of the title text. + final Widget? titleWidget; + + /// The widget to display before the title. + /// Usually an [IconButton] for navigation. + final Widget? leading; + + /// A list of Widgets to display in a row after the [title] widget. + final List? actions; + + /// The height of the app bar. Defaults to [kToolbarHeight]. + final double height; + + /// Whether the title should be centered. + final bool centerTitle; + + /// Signature for the callback that is called when the leading button is pressed. + /// If [leading] is null, this callback will be used for a default back button. + final VoidCallback? onLeadingPressed; + + /// Whether to show a default back button if [leading] is null. + final bool showBackButton; + + /// This widget appears across the bottom of the app bar. + /// Typically a [TabBar]. Only widgets that implement [PreferredSizeWidget] can be used at the bottom of an app bar. + final PreferredSizeWidget? bottom; + + const UiAppBar({ + super.key, + this.title, + this.titleWidget, + this.leading, + this.actions, + this.height = kToolbarHeight, + this.centerTitle = true, + this.onLeadingPressed, + this.showBackButton = true, + this.bottom, + }); + + @override + Widget build(BuildContext context) { + return AppBar( + title: titleWidget ?? + (title != null + ? Text( + title!, + ) + : null), + leading: leading ?? + (showBackButton + ? IconButton( + icon: const Icon(UiIcons.chevronLeft, size: 20), + onPressed: onLeadingPressed ?? () => Navigator.of(context).pop(), + ) + : null), + actions: actions, + centerTitle: centerTitle, + bottom: bottom, + ); + } + + @override + Size get preferredSize => Size.fromHeight(height + (bottom?.preferredSize.height ?? 0.0)); +} diff --git a/apps/mobile/packages/design_system/lib/src/widgets/ui_button.dart b/apps/mobile/packages/design_system/lib/src/widgets/ui_button.dart new file mode 100644 index 00000000..7867798c --- /dev/null +++ b/apps/mobile/packages/design_system/lib/src/widgets/ui_button.dart @@ -0,0 +1,240 @@ +import 'package:flutter/material.dart'; +import '../ui_constants.dart'; + +/// A custom button widget with different variants and icon support. +class UiButton extends StatelessWidget { + /// The text to display on the button. + final String? text; + + /// Optional custom child widget. If provided, overrides text and icons. + final Widget? child; + + /// Callback when the button is tapped. + final VoidCallback? onPressed; + + /// Optional leading icon. + final IconData? leadingIcon; + + /// Optional trailing icon. + final IconData? trailingIcon; + + /// Optional Style + final ButtonStyle? style; + + /// The size of the icons. Defaults to 20. + final double iconSize; + + /// The size of the button. + final UiButtonSize size; + + /// Whether the button should take up the full width of its container. + final bool fullWidth; + + /// The button widget to use (ElevatedButton, OutlinedButton, or TextButton). + final Widget Function( + BuildContext context, + VoidCallback? onPressed, + ButtonStyle? style, + Widget child, + ) + buttonBuilder; + + /// Creates a [UiButton] with a custom button builder. + const UiButton({ + super.key, + this.text, + this.child, + required this.buttonBuilder, + this.onPressed, + this.leadingIcon, + this.trailingIcon, + this.style, + this.iconSize = 20, + this.size = UiButtonSize.medium, + this.fullWidth = false, + }) : assert( + text != null || child != null, + 'Either text or child must be provided', + ); + + /// Creates a primary button using [ElevatedButton]. + UiButton.primary({ + super.key, + this.text, + this.child, + this.onPressed, + this.leadingIcon, + this.trailingIcon, + this.style, + this.iconSize = 20, + this.size = UiButtonSize.medium, + this.fullWidth = false, + }) : buttonBuilder = _elevatedButtonBuilder, + assert( + text != null || child != null, + 'Either text or child must be provided', + ); + + /// Creates a secondary button using [OutlinedButton]. + UiButton.secondary({ + super.key, + this.text, + this.child, + this.onPressed, + this.leadingIcon, + this.trailingIcon, + this.style, + this.iconSize = 20, + this.size = UiButtonSize.medium, + this.fullWidth = false, + }) : buttonBuilder = _outlinedButtonBuilder, + assert( + text != null || child != null, + 'Either text or child must be provided', + ); + + /// Creates a text button using [TextButton]. + UiButton.text({ + super.key, + this.text, + this.child, + this.onPressed, + this.leadingIcon, + this.trailingIcon, + this.style, + this.iconSize = 20, + this.size = UiButtonSize.medium, + this.fullWidth = false, + }) : buttonBuilder = _textButtonBuilder, + assert( + text != null || child != null, + 'Either text or child must be provided', + ); + + /// Creates a ghost button (transparent background). + UiButton.ghost({ + super.key, + this.text, + this.child, + this.onPressed, + this.leadingIcon, + this.trailingIcon, + this.style, + this.iconSize = 20, + this.size = UiButtonSize.medium, + this.fullWidth = false, + }) : buttonBuilder = _textButtonBuilder, + assert( + text != null || child != null, + 'Either text or child must be provided', + ); + + @override + /// Builds the button UI. + Widget build(BuildContext context) { + final Widget button = buttonBuilder( + context, + onPressed, + style, + _buildButtonContent(), + ); + + if (fullWidth) { + return SizedBox(width: double.infinity, child: button); + } + + return button; + } + + /// Builds the button content with optional leading and trailing icons. + Widget _buildButtonContent() { + if (child != null) { + return child!; + } + + final String buttonText = text ?? ''; + + // Optimization: If no icons, return plain text to avoid Row layout overhead + if (leadingIcon == null && trailingIcon == null) { + return Text(buttonText, textAlign: TextAlign.center); + } + + // Multiple elements case: Use a Row with MainAxisSize.min + final List children = []; + + if (leadingIcon != null) { + children.add(Icon(leadingIcon, size: iconSize)); + } + + if (buttonText.isNotEmpty) { + if (leadingIcon != null) { + children.add(const SizedBox(width: UiConstants.space2)); + } + // Use flexible to ensure text doesn't force infinite width in flex parents + children.add( + Flexible( + child: Text( + buttonText, + textAlign: TextAlign.center, + overflow: TextOverflow.ellipsis, + ), + ), + ); + } + + if (trailingIcon != null) { + if (buttonText.isNotEmpty || leadingIcon != null) { + children.add(const SizedBox(width: UiConstants.space2)); + } + children.add(Icon(trailingIcon, size: iconSize)); + } + + return Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: children, + ); + } + + /// Builder for ElevatedButton. + static Widget _elevatedButtonBuilder( + BuildContext context, + VoidCallback? onPressed, + ButtonStyle? style, + Widget child, + ) { + return ElevatedButton(onPressed: onPressed, style: style, child: child); + } + + /// Builder for OutlinedButton. + static Widget _outlinedButtonBuilder( + BuildContext context, + VoidCallback? onPressed, + ButtonStyle? style, + Widget child, + ) { + return OutlinedButton(onPressed: onPressed, style: style, child: child); + } + + /// Builder for TextButton. + static Widget _textButtonBuilder( + BuildContext context, + VoidCallback? onPressed, + ButtonStyle? style, + Widget child, + ) { + return TextButton(onPressed: onPressed, style: style, child: child); + } +} + +/// Defines the size of a [UiButton]. +enum UiButtonSize { + /// Small button (compact) + small, + + /// Medium button (standard) + medium, + + /// Large button (prominent) + large, +} diff --git a/apps/mobile/packages/design_system/lib/src/widgets/ui_chip.dart b/apps/mobile/packages/design_system/lib/src/widgets/ui_chip.dart new file mode 100644 index 00000000..f7bd0177 --- /dev/null +++ b/apps/mobile/packages/design_system/lib/src/widgets/ui_chip.dart @@ -0,0 +1,190 @@ +import 'package:flutter/material.dart'; +import '../ui_colors.dart'; +import '../ui_constants.dart'; +import '../ui_typography.dart'; + +/// Sizes for the [UiChip] widget. +enum UiChipSize { + /// Small size (e.g. for tags in tight spaces). + small, + + /// Medium size (default). + medium, + + /// Large size (e.g. for standalone filters). + large, +} + +/// Themes for the [UiChip] widget. +enum UiChipVariant { + /// Primary style with solid background. + primary, + + /// Secondary style with light background. + secondary, + + /// Accent style with highlight background. + accent, +} + +/// A custom chip widget with supports for different sizes, themes, and icons. +class UiChip extends StatelessWidget { + /// The text label to display. + final String label; + + /// The size of the chip. Defaults to [UiChipSize.medium]. + final UiChipSize size; + + /// The theme variant of the chip. Defaults to [UiChipVariant.secondary]. + final UiChipVariant variant; + + /// Optional leading icon. + final IconData? leadingIcon; + + /// Optional trailing icon. + final IconData? trailingIcon; + + /// Callback when the chip is tapped. + final VoidCallback? onTap; + + /// Callback when the trailing icon is tapped (e.g. for removal). + final VoidCallback? onTrailingIconTap; + + /// Whether the chip is currently selected/active. + final bool isSelected; + + /// Creates a [UiChip]. + const UiChip({ + super.key, + required this.label, + this.size = UiChipSize.medium, + this.variant = UiChipVariant.secondary, + this.leadingIcon, + this.trailingIcon, + this.onTap, + this.onTrailingIconTap, + this.isSelected = false, + }); + + @override + Widget build(BuildContext context) { + final Color backgroundColor = _getBackgroundColor(); + final Color contentColor = _getContentColor(); + final TextStyle textStyle = _getTextStyle().copyWith(color: contentColor); + final EdgeInsets padding = _getPadding(); + final double iconSize = _getIconSize(); + + final Row content = Row( + mainAxisSize: MainAxisSize.min, + children: [ + if (leadingIcon != null) ...[ + Icon(leadingIcon, size: iconSize, color: contentColor), + SizedBox(width: _getGap()), + ], + Text(label, style: textStyle), + if (trailingIcon != null) ...[ + SizedBox(width: _getGap()), + GestureDetector( + onTap: onTrailingIconTap, + child: Icon(trailingIcon, size: iconSize, color: contentColor), + ), + ], + ], + ); + + return GestureDetector( + onTap: onTap, + child: AnimatedContainer( + duration: const Duration(milliseconds: 200), + padding: padding, + decoration: BoxDecoration( + color: backgroundColor, + borderRadius: UiConstants.radiusFull, + border: _getBorder(), + ), + child: content, + ), + ); + } + + Color _getBackgroundColor() { + if (!isSelected && variant == UiChipVariant.primary) { + return UiColors.white; + } + + switch (variant) { + case UiChipVariant.primary: + return UiColors.primary; + case UiChipVariant.secondary: + return UiColors.tagInProgress; + case UiChipVariant.accent: + return UiColors.accent; + } + } + + Color _getContentColor() { + if (!isSelected && variant == UiChipVariant.primary) { + return UiColors.textSecondary; + } + + switch (variant) { + case UiChipVariant.primary: + return UiColors.white; + case UiChipVariant.secondary: + return UiColors.primary; + case UiChipVariant.accent: + return UiColors.accentForeground; + } + } + + TextStyle _getTextStyle() { + switch (size) { + case UiChipSize.small: + return UiTypography.body3r; + case UiChipSize.medium: + return UiTypography.body2m; + case UiChipSize.large: + return UiTypography.body1m; + } + } + + EdgeInsets _getPadding() { + switch (size) { + case UiChipSize.small: + return const EdgeInsets.symmetric(horizontal: 10, vertical: 6); + case UiChipSize.medium: + return const EdgeInsets.symmetric(horizontal: 12, vertical: 8); + case UiChipSize.large: + return const EdgeInsets.symmetric(horizontal: 16, vertical: 10); + } + } + + double _getIconSize() { + switch (size) { + case UiChipSize.small: + return 12; + case UiChipSize.medium: + return 16; + case UiChipSize.large: + return 20; + } + } + + double _getGap() { + switch (size) { + case UiChipSize.small: + return UiConstants.space1; + case UiChipSize.medium: + return UiConstants.space1 + 2; + case UiChipSize.large: + return UiConstants.space2; + } + } + + BoxBorder? _getBorder() { + if (!isSelected && variant == UiChipVariant.primary) { + return Border.all(color: UiColors.border); + } + return null; + } +} diff --git a/apps/mobile/packages/design_system/lib/src/widgets/ui_icon_button.dart b/apps/mobile/packages/design_system/lib/src/widgets/ui_icon_button.dart new file mode 100644 index 00000000..d49ac67d --- /dev/null +++ b/apps/mobile/packages/design_system/lib/src/widgets/ui_icon_button.dart @@ -0,0 +1,89 @@ +import 'dart:ui'; +import 'package:flutter/material.dart'; +import '../ui_colors.dart'; +import '../ui_constants.dart'; + +/// A custom icon button with blur effect and different variants. +class UiIconButton extends StatelessWidget { + /// The icon to display. + final IconData icon; + + /// The size of the icon button. + final double size; + + /// The size of the icon. + final double iconSize; + + /// The background color of the button. + final Color backgroundColor; + + /// The color of the icon. + final Color iconColor; + + /// Whether to apply blur effect. + final bool useBlur; + + /// Callback when the button is tapped. + final VoidCallback? onTap; + + /// Creates a [UiIconButton] with custom properties. + const UiIconButton({ + super.key, + required this.icon, + this.size = 40, + this.iconSize = 20, + required this.backgroundColor, + required this.iconColor, + this.useBlur = false, + this.onTap, + }); + + /// Creates a primary variant icon button with solid background. + const UiIconButton.primary({ + super.key, + required this.icon, + this.size = 40, + this.iconSize = 20, + this.onTap, + }) : backgroundColor = UiColors.primary, + iconColor = UiColors.white, + useBlur = false; + + /// Creates a secondary variant icon button with blur effect. + UiIconButton.secondary({ + super.key, + required this.icon, + this.size = 40, + this.iconSize = 20, + this.onTap, + }) : backgroundColor = UiColors.primary.withAlpha(96), + iconColor = UiColors.primary, + useBlur = true; + + @override + /// Builds the icon button UI. + Widget build(BuildContext context) { + final Widget button = Container( + width: size, + height: size, + decoration: BoxDecoration(color: backgroundColor, shape: BoxShape.circle), + child: Icon(icon, color: iconColor, size: iconSize), + ); + + final Widget content = useBlur + ? ClipRRect( + borderRadius: UiConstants.radiusFull, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: button, + ), + ) + : button; + + if (onTap != null) { + return GestureDetector(onTap: onTap, child: content); + } + + return content; + } +} diff --git a/apps/mobile/packages/design_system/lib/src/widgets/ui_step_indicator.dart b/apps/mobile/packages/design_system/lib/src/widgets/ui_step_indicator.dart new file mode 100644 index 00000000..3388098d --- /dev/null +++ b/apps/mobile/packages/design_system/lib/src/widgets/ui_step_indicator.dart @@ -0,0 +1,87 @@ +import 'package:flutter/material.dart'; +import '../ui_colors.dart'; +import '../ui_constants.dart'; +import '../ui_icons.dart'; + +/// A widget that displays a horizontal step indicator with icons. +/// +/// This widget shows a series of circular step indicators connected by lines, +/// with different visual states for completed, active, and inactive steps. +class UiStepIndicator extends StatelessWidget { + /// The list of icons to display for each step. + final List stepIcons; + + /// The index of the currently active step (0-based). + final int currentStep; + + /// Creates a [UiStepIndicator]. + const UiStepIndicator({ + super.key, + required this.stepIcons, + required this.currentStep, + }); + + @override + /// Builds the step indicator UI. + Widget build(BuildContext context) { + // active step color + const Color activeColor = UiColors.primary; + // completed step color + const Color completedColor = UiColors.textSuccess; + // inactive step color + const Color inactiveColor = UiColors.iconSecondary; + + return Padding( + padding: const EdgeInsets.symmetric(vertical: UiConstants.space2), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: List.generate(stepIcons.length, (int index) { + final bool isActive = index == currentStep; + final bool isCompleted = index < currentStep; + + Color bgColor; + Color iconColor; + if (isCompleted) { + bgColor = completedColor.withAlpha(24); + iconColor = completedColor; + } else if (isActive) { + bgColor = activeColor.withAlpha(24); + iconColor = activeColor; + } else { + bgColor = inactiveColor.withAlpha(24); + iconColor = inactiveColor.withAlpha(128); + } + + return Row( + children: [ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: bgColor, + shape: BoxShape.circle, + ), + child: Icon( + isCompleted ? UiIcons.check : stepIcons[index], + size: 20, + color: iconColor, + ), + ), + if (index < stepIcons.length - 1) + Container( + width: 30, + height: 2, + margin: const EdgeInsets.symmetric( + horizontal: UiConstants.space1, + ), + color: isCompleted + ? completedColor.withAlpha(96) + : inactiveColor.withAlpha(96), + ), + ], + ); + }), + ), + ); + } +} diff --git a/apps/mobile/packages/design_system/lib/src/widgets/ui_text_field.dart b/apps/mobile/packages/design_system/lib/src/widgets/ui_text_field.dart new file mode 100644 index 00000000..868df5c8 --- /dev/null +++ b/apps/mobile/packages/design_system/lib/src/widgets/ui_text_field.dart @@ -0,0 +1,115 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import '../ui_typography.dart'; +import '../ui_constants.dart'; +import '../ui_colors.dart'; + +/// A custom TextField for the Krow UI design system. +/// +/// This widget combines a label and a [TextField] with consistent styling. +class UiTextField extends StatelessWidget { + /// The label text to display above the text field. + final String? label; + + /// The hint text to display inside the text field when empty. + final String? hintText; + + /// Signature for the callback that is called when the text in the field changes. + final ValueChanged? onChanged; + + /// The controller for the text field. + final TextEditingController? controller; + + /// The type of keyboard to use for editing the text. + final TextInputType? keyboardType; + + /// The maximum number of lines for the text field. Defaults to 1. + final int? maxLines; + + /// Whether to hide the text being edited (e.g., for passwords). Defaults to false. + final bool obscureText; + + /// The type of action button to use for the keyboard. + final TextInputAction? textInputAction; + + /// Signature for the callback that is called when the user submits the text field. + final ValueChanged? onSubmitted; + + /// Whether the text field should be focused automatically. Defaults to false. + final bool autofocus; + + /// Optional input formatters to validate or format the text as it is typed. + final List? inputFormatters; + + /// Optional prefix icon to display at the start of the text field. + final IconData? prefixIcon; + + /// Optional suffix icon to display at the end of the text field. + final IconData? suffixIcon; + + /// Optional custom suffix widget to display at the end (e.g., password toggle). + final Widget? suffix; + + /// Whether the text field should be read-only. + final bool readOnly; + + /// Callback when the text field is tapped. + final VoidCallback? onTap; + + const UiTextField({ + super.key, + this.label, + this.hintText, + this.onChanged, + this.controller, + this.keyboardType, + this.maxLines = 1, + this.obscureText = false, + this.textInputAction, + this.onSubmitted, + this.autofocus = false, + this.inputFormatters, + this.prefixIcon, + this.suffixIcon, + this.suffix, + this.readOnly = false, + this.onTap, + }); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (label != null) ...[ + Text(label!, style: UiTypography.body4m.textSecondary), + const SizedBox(height: UiConstants.space1), + ], + TextField( + controller: controller, + onChanged: onChanged, + keyboardType: keyboardType, + maxLines: maxLines, + obscureText: obscureText, + textInputAction: textInputAction, + onSubmitted: onSubmitted, + autofocus: autofocus, + inputFormatters: inputFormatters, + readOnly: readOnly, + onTap: onTap, + style: UiTypography.body1r.textPrimary, + decoration: InputDecoration( + hintText: hintText, + prefixIcon: prefixIcon != null + ? Icon(prefixIcon, size: 20, color: UiColors.iconSecondary) + : null, + suffixIcon: suffixIcon != null + ? Icon(suffixIcon, size: 20, color: UiColors.iconSecondary) + : suffix, + ), + ), + ], + ); + } +} diff --git a/apps/mobile/packages/design_system/pubspec.yaml b/apps/mobile/packages/design_system/pubspec.yaml new file mode 100644 index 00000000..fb4e10c9 --- /dev/null +++ b/apps/mobile/packages/design_system/pubspec.yaml @@ -0,0 +1,31 @@ +name: design_system +description: "A new Flutter package project." +version: 0.0.1 +homepage: +resolution: workspace + +environment: + sdk: ^3.10.7 + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + google_fonts: ^7.0.2 + lucide_icons: ^0.257.0 + font_awesome_flutter: ^10.7.0 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # To add assets to your package, add an assets section, like this: + assets: + - assets/ diff --git a/apps/mobile/packages/design_system/test/design_system_test.dart b/apps/mobile/packages/design_system/test/design_system_test.dart new file mode 100644 index 00000000..c2beb8de --- /dev/null +++ b/apps/mobile/packages/design_system/test/design_system_test.dart @@ -0,0 +1,12 @@ +import 'package:flutter_test/flutter_test.dart'; + +import 'package:design_system/design_system.dart'; + +void main() { + test('adds one to input values', () { + final calculator = Calculator(); + expect(calculator.addOne(2), 3); + expect(calculator.addOne(-7), -6); + expect(calculator.addOne(0), 1); + }); +} diff --git a/apps/mobile/packages/domain/lib/krow_domain.dart b/apps/mobile/packages/domain/lib/krow_domain.dart new file mode 100644 index 00000000..607e10e1 --- /dev/null +++ b/apps/mobile/packages/domain/lib/krow_domain.dart @@ -0,0 +1,74 @@ +/// The Shared Domain Layer. +/// +/// This package contains the core business entities and rules. +/// It is pure Dart and has no dependencies on Flutter or Firebase. +/// +/// Note: Repository Interfaces are now located in their respective Feature packages. +library; + +// Users & Membership +export 'src/entities/users/user.dart'; +export 'src/entities/users/staff.dart'; +export 'src/entities/users/membership.dart'; +export 'src/entities/users/biz_member.dart'; +export 'src/entities/users/hub_member.dart'; + +// Business & Organization +export 'src/entities/business/business.dart'; +export 'src/entities/business/business_setting.dart'; +export 'src/entities/business/hub.dart'; +export 'src/entities/business/hub_department.dart'; + +// Events & Assignments +export 'src/entities/events/event.dart'; +export 'src/entities/events/event_shift.dart'; +export 'src/entities/events/event_shift_position.dart'; +export 'src/entities/events/assignment.dart'; +export 'src/entities/events/work_session.dart'; + +// Shifts +export 'src/entities/shifts/shift.dart'; + +// Orders & Requests +export 'src/entities/orders/order_type.dart'; +export 'src/entities/orders/one_time_order.dart'; +export 'src/entities/orders/one_time_order_position.dart'; +export 'src/entities/orders/order_item.dart'; + +// Skills & Certs +export 'src/entities/skills/skill.dart'; +export 'src/entities/skills/skill_category.dart'; +export 'src/entities/skills/staff_skill.dart'; +export 'src/entities/skills/certificate.dart'; +export 'src/entities/skills/skill_kit.dart'; + +// Financial & Payroll +export 'src/entities/financial/invoice.dart'; +export 'src/entities/financial/invoice_item.dart'; +export 'src/entities/financial/invoice_decline.dart'; +export 'src/entities/financial/staff_payment.dart'; + +// Profile +export 'src/entities/profile/staff_document.dart'; +export 'src/entities/profile/attire_item.dart'; + +// Ratings & Penalties +export 'src/entities/ratings/staff_rating.dart'; +export 'src/entities/ratings/penalty_log.dart'; +export 'src/entities/ratings/business_staff_preference.dart'; + +// Staff Profile +export 'src/entities/profile/emergency_contact.dart'; +export 'src/entities/profile/bank_account.dart'; +export 'src/entities/profile/accessibility.dart'; +export 'src/entities/profile/schedule.dart'; + +// Support & Config +export 'src/entities/support/addon.dart'; +export 'src/entities/support/tag.dart'; +export 'src/entities/support/media.dart'; +export 'src/entities/support/working_area.dart'; + +// Home +export 'src/entities/home/home_dashboard_data.dart'; +export 'src/entities/home/reorder_item.dart'; diff --git a/apps/mobile/packages/domain/lib/src/entities/business/biz_contract.dart b/apps/mobile/packages/domain/lib/src/entities/business/biz_contract.dart new file mode 100644 index 00000000..196c9eb8 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/business/biz_contract.dart @@ -0,0 +1,36 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a legal or service contract. +/// +/// Can be between a business and the platform, or a business and staff. +class BizContract extends Equatable { + + const BizContract({ + required this.id, + required this.businessId, + required this.name, + required this.startDate, + this.endDate, + required this.contentUrl, + }); + /// Unique identifier. + final String id; + + /// The [Business] party to the contract. + final String businessId; + + /// Descriptive name of the contract. + final String name; + + /// Valid from date. + final DateTime startDate; + + /// Valid until date (null if indefinite). + final DateTime? endDate; + + /// URL to the document content (PDF/HTML). + final String contentUrl; + + @override + List get props => [id, businessId, name, startDate, endDate, contentUrl]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/business/business.dart b/apps/mobile/packages/domain/lib/src/entities/business/business.dart new file mode 100644 index 00000000..c03e75c9 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/business/business.dart @@ -0,0 +1,47 @@ +import 'package:equatable/equatable.dart'; + +/// The operating status of a [Business]. +enum BusinessStatus { + /// Business created but not yet approved. + pending, + + /// Fully active and operational. + active, + + /// Temporarily suspended (e.g. for non-payment). + suspended, + + /// Permanently inactive. + inactive, +} + +/// Represents a Client Company / Business. +/// +/// This is the top-level organizational entity in the system. +class Business extends Equatable { + + const Business({ + required this.id, + required this.name, + required this.registrationNumber, + required this.status, + this.avatar, + }); + /// Unique identifier for the business. + final String id; + + /// Display name of the business. + final String name; + + /// Legal registration or tax number. + final String registrationNumber; + + /// Current operating status. + final BusinessStatus status; + + /// URL to the business logo. + final String? avatar; + + @override + List get props => [id, name, registrationNumber, status, avatar]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/business/business_setting.dart b/apps/mobile/packages/domain/lib/src/entities/business/business_setting.dart new file mode 100644 index 00000000..328cb39c --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/business/business_setting.dart @@ -0,0 +1,41 @@ +import 'package:equatable/equatable.dart'; + +/// Represents payroll and operational configuration for a [Business]. +class BusinessSetting extends Equatable { + + const BusinessSetting({ + required this.id, + required this.businessId, + required this.prefix, + required this.overtimeEnabled, + this.clockInRequirement, + this.clockOutRequirement, + }); + /// Unique identifier for the settings record. + final String id; + + /// The [Business] these settings apply to. + final String businessId; + + /// Prefix for generated invoices (e.g., "INV-"). + final String prefix; + + /// Whether overtime calculations are applied. + final bool overtimeEnabled; + + /// Requirement method for clocking in (e.g. "qr_code", "geo_fence"). + final String? clockInRequirement; + + /// Requirement method for clocking out. + final String? clockOutRequirement; + + @override + List get props => [ + id, + businessId, + prefix, + overtimeEnabled, + clockInRequirement, + clockOutRequirement, + ]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/business/hub.dart b/apps/mobile/packages/domain/lib/src/entities/business/hub.dart new file mode 100644 index 00000000..4070a28a --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/business/hub.dart @@ -0,0 +1,46 @@ +import 'package:equatable/equatable.dart'; + +/// The status of a [Hub]. +enum HubStatus { + /// Fully operational. + active, + + /// Closed or inactive. + inactive, + + /// Not yet ready for operations. + underConstruction, +} + +/// Represents a branch location or operational unit within a [Business]. +class Hub extends Equatable { + + const Hub({ + required this.id, + required this.businessId, + required this.name, + required this.address, + this.nfcTagId, + required this.status, + }); + /// Unique identifier. + final String id; + + /// The parent [Business]. + final String businessId; + + /// Display name of the hub (e.g. "Downtown Branch"). + final String name; + + /// Physical address of this hub. + final String address; + + /// Unique identifier of the NFC tag assigned to this hub. + final String? nfcTagId; + + /// Operational status. + final HubStatus status; + + @override + List get props => [id, businessId, name, address, nfcTagId, status]; +} diff --git a/apps/mobile/packages/domain/lib/src/entities/business/hub_department.dart b/apps/mobile/packages/domain/lib/src/entities/business/hub_department.dart new file mode 100644 index 00000000..3c6891bc --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/business/hub_department.dart @@ -0,0 +1,24 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a department within a [Hub]. +/// +/// Used for more granular organization of staff and events (e.g. "Kitchen", "Service"). +class HubDepartment extends Equatable { + + const HubDepartment({ + required this.id, + required this.hubId, + required this.name, + }); + /// Unique identifier. + final String id; + + /// The [Hub] this department belongs to. + final String hubId; + + /// Name of the department. + final String name; + + @override + List get props => [id, hubId, name]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/business/vendor.dart b/apps/mobile/packages/domain/lib/src/entities/business/vendor.dart new file mode 100644 index 00000000..19d8bf98 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/business/vendor.dart @@ -0,0 +1,15 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a staffing vendor. +class Vendor extends Equatable { + const Vendor({required this.id, required this.name, required this.rates}); + + final String id; + final String name; + + /// A map of role names to hourly rates. + final Map rates; + + @override + List get props => [id, name, rates]; +} diff --git a/apps/mobile/packages/domain/lib/src/entities/events/assignment.dart b/apps/mobile/packages/domain/lib/src/entities/events/assignment.dart new file mode 100644 index 00000000..197281a5 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/events/assignment.dart @@ -0,0 +1,58 @@ +import 'package:equatable/equatable.dart'; + +/// The status of a staff [Assignment]. +enum AssignmentStatus { + /// Staff member has been assigned but hasn't confirmed. + assigned, + + /// Staff member has accepted the assignment. + confirmed, + + /// Work is currently in progress (Clocked In). + ongoing, + + /// Work completed successfully (Clocked Out). + completed, + + /// Staff rejected the assignment offer. + declinedByStaff, + + /// Staff canceled after accepting. + canceledByStaff, + + /// Staff did not show up. + noShowed, +} + +/// Represents the link between a [Staff] member and an [EventShiftPosition]. +class Assignment extends Equatable { + + const Assignment({ + required this.id, + required this.positionId, + required this.staffId, + required this.status, + this.clockIn, + this.clockOut, + }); + /// Unique identifier. + final String id; + + /// The job position being filled. + final String positionId; + + /// The staff member filling the position. + final String staffId; + + /// Current status of the assignment. + final AssignmentStatus status; + + /// Actual timestamp when staff clocked in. + final DateTime? clockIn; + + /// Actual timestamp when staff clocked out. + final DateTime? clockOut; + + @override + List get props => [id, positionId, staffId, status, clockIn, clockOut]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/events/event.dart b/apps/mobile/packages/domain/lib/src/entities/events/event.dart new file mode 100644 index 00000000..d7def36f --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/events/event.dart @@ -0,0 +1,70 @@ +import 'package:equatable/equatable.dart'; + +/// The workflow status of an [Event]. +enum EventStatus { + /// Created but incomplete. + draft, + + /// Waiting for approval or publication. + pending, + + /// Published and staff have been assigned. + assigned, + + /// Fully confirmed and ready to start. + confirmed, + + /// Currently in progress. + active, + + /// Work has finished. + finished, + + /// All post-event processes (invoicing) complete. + completed, + + /// Archived. + closed, + + /// Flagged for administrative review. + underReview, +} + +/// Represents a Job Posting or Event. +/// +/// This is the central entity for scheduling work. An Event contains [EventShift]s. +class Event extends Equatable { + + const Event({ + required this.id, + required this.businessId, + required this.hubId, + required this.name, + required this.date, + required this.status, + required this.contractType, + }); + /// Unique identifier. + final String id; + + /// The [Business] hosting the event. + final String businessId; + + /// The [Hub] location. + final String hubId; + + /// Title of the event. + final String name; + + /// Date of the event. + final DateTime date; + + /// Current workflow status. + final EventStatus status; + + /// Type of employment contract (e.g., 'freelance', 'permanent'). + final String contractType; + + @override + List get props => [id, businessId, hubId, name, date, status, contractType]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/events/event_shift.dart b/apps/mobile/packages/domain/lib/src/entities/events/event_shift.dart new file mode 100644 index 00000000..32a025e3 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/events/event_shift.dart @@ -0,0 +1,28 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a specific time block or "shift" within an [Event]. +/// +/// An Event can have multiple shifts (e.g. "Morning Shift", "Evening Shift"). +class EventShift extends Equatable { + + const EventShift({ + required this.id, + required this.eventId, + required this.name, + required this.address, + }); + /// Unique identifier. + final String id; + + /// The [Event] this shift belongs to. + final String eventId; + + /// Descriptive name (e.g. "Setup Crew"). + final String name; + + /// Specific address for this shift (if different from Hub). + final String address; + + @override + List get props => [id, eventId, name, address]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/events/event_shift_position.dart b/apps/mobile/packages/domain/lib/src/entities/events/event_shift_position.dart new file mode 100644 index 00000000..8eb226f0 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/events/event_shift_position.dart @@ -0,0 +1,53 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a specific job opening within a [EventShift]. +/// +/// Defines the requirement for a specific [Skill], the quantity needed, and the pay. +class EventShiftPosition extends Equatable { + + const EventShiftPosition({ + required this.id, + required this.shiftId, + required this.skillId, + required this.count, + required this.rate, + required this.startTime, + required this.endTime, + required this.breakDurationMinutes, + }); + /// Unique identifier. + final String id; + + /// The [EventShift] this position is part of. + final String shiftId; + + /// The [Skill] required for this position. + final String skillId; + + /// Number of staff needed. + final int count; + + /// Hourly pay rate. + final double rate; + + /// Start time of this specific position. + final DateTime startTime; + + /// End time of this specific position. + final DateTime endTime; + + /// Deducted break duration in minutes. + final int breakDurationMinutes; + + @override + List get props => [ + id, + shiftId, + skillId, + count, + rate, + startTime, + endTime, + breakDurationMinutes, + ]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/events/work_session.dart b/apps/mobile/packages/domain/lib/src/entities/events/work_session.dart new file mode 100644 index 00000000..ef06a323 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/events/work_session.dart @@ -0,0 +1,32 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a verified record of time worked. +/// +/// Derived from [Assignment] clock-in/out times, used for payroll. +class WorkSession extends Equatable { + + const WorkSession({ + required this.id, + required this.assignmentId, + required this.startTime, + this.endTime, + required this.breakDurationMinutes, + }); + /// Unique identifier. + final String id; + + /// The [Assignment] this session belongs to. + final String assignmentId; + + /// Verified start time. + final DateTime startTime; + + /// Verified end time. + final DateTime? endTime; + + /// Verified break duration. + final int breakDurationMinutes; + + @override + List get props => [id, assignmentId, startTime, endTime, breakDurationMinutes]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/financial/invoice.dart b/apps/mobile/packages/domain/lib/src/entities/financial/invoice.dart new file mode 100644 index 00000000..2dc06f9c --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/financial/invoice.dart @@ -0,0 +1,70 @@ +import 'package:equatable/equatable.dart'; + +/// The workflow status of an [Invoice]. +enum InvoiceStatus { + /// Generated but not yet sent/finalized. + open, + + /// Client has disputed a line item. + disputed, + + /// Dispute has been handled. + resolved, + + /// Invoice accepted by client. + verified, + + /// Payment received. + paid, + + /// Payment reconciled in accounting. + reconciled, + + /// Payment not received by due date. + overdue, +} + +/// Represents a bill sent to a [Business] for services rendered. +class Invoice extends Equatable { + + const Invoice({ + required this.id, + required this.eventId, + required this.businessId, + required this.status, + required this.totalAmount, + required this.workAmount, + required this.addonsAmount, + }); + /// Unique identifier. + final String id; + + /// The [Event] this invoice covers. + final String eventId; + + /// The [Business] being billed. + final String businessId; + + /// Current payment/approval status. + final InvoiceStatus status; + + /// Grand total amount. + final double totalAmount; + + /// Total amount for labor costs. + final double workAmount; + + /// Total amount for addons/extras. + final double addonsAmount; + + @override + List get props => [ + id, + eventId, + businessId, + status, + totalAmount, + workAmount, + addonsAmount, + ]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/financial/invoice_decline.dart b/apps/mobile/packages/domain/lib/src/entities/financial/invoice_decline.dart new file mode 100644 index 00000000..1d0a8035 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/financial/invoice_decline.dart @@ -0,0 +1,26 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a reason or log for a declined [Invoice]. +class InvoiceDecline extends Equatable { + + const InvoiceDecline({ + required this.id, + required this.invoiceId, + required this.reason, + required this.declinedAt, + }); + /// Unique identifier. + final String id; + + /// The [Invoice] that was declined. + final String invoiceId; + + /// Reason provided by the client. + final String reason; + + /// When the decline happened. + final DateTime declinedAt; + + @override + List get props => [id, invoiceId, reason, declinedAt]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/financial/invoice_item.dart b/apps/mobile/packages/domain/lib/src/entities/financial/invoice_item.dart new file mode 100644 index 00000000..e661334a --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/financial/invoice_item.dart @@ -0,0 +1,36 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a line item in an [Invoice]. +/// +/// Corresponds to the work done by one [Staff] member. +class InvoiceItem extends Equatable { + + const InvoiceItem({ + required this.id, + required this.invoiceId, + required this.staffId, + required this.workHours, + required this.rate, + required this.amount, + }); + /// Unique identifier. + final String id; + + /// The [Invoice] this item belongs to. + final String invoiceId; + + /// The [Staff] member whose work is being billed. + final String staffId; + + /// Total billed hours. + final double workHours; + + /// Hourly rate applied. + final double rate; + + /// Total line item amount (workHours * rate). + final double amount; + + @override + List get props => [id, invoiceId, staffId, workHours, rate, amount]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/financial/staff_payment.dart b/apps/mobile/packages/domain/lib/src/entities/financial/staff_payment.dart new file mode 100644 index 00000000..bd890a77 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/financial/staff_payment.dart @@ -0,0 +1,49 @@ +import 'package:equatable/equatable.dart'; + +/// Status of a staff payout. +enum PaymentStatus { + /// Payout calculated but not processed. + pending, + + /// Submitted to banking provider. + processing, + + /// Successfully transferred to staff. + paid, + + /// Transfer failed. + failed, +} + +/// Represents a payout to a [Staff] member for a completed [Assignment]. +class StaffPayment extends Equatable { + + const StaffPayment({ + required this.id, + required this.staffId, + required this.assignmentId, + required this.amount, + required this.status, + this.paidAt, + }); + /// Unique identifier. + final String id; + + /// The recipient [Staff]. + final String staffId; + + /// The [Assignment] being paid for. + final String assignmentId; + + /// Amount to be paid. + final double amount; + + /// Processing status. + final PaymentStatus status; + + /// When the payment was successfully processed. + final DateTime? paidAt; + + @override + List get props => [id, staffId, assignmentId, amount, status, paidAt]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/home/home_dashboard_data.dart b/apps/mobile/packages/domain/lib/src/entities/home/home_dashboard_data.dart new file mode 100644 index 00000000..681e7a22 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/home/home_dashboard_data.dart @@ -0,0 +1,45 @@ +import 'package:equatable/equatable.dart'; + +/// Entity representing dashboard data for the home screen. +/// +/// This entity provides aggregated metrics such as spending and shift counts +/// for both the current week and the upcoming 7 days. +class HomeDashboardData extends Equatable { + + /// Creates a [HomeDashboardData] instance. + const HomeDashboardData({ + required this.weeklySpending, + required this.next7DaysSpending, + required this.weeklyShifts, + required this.next7DaysScheduled, + required this.totalNeeded, + required this.totalFilled, + }); + /// Total spending for the current week. + final double weeklySpending; + + /// Projected spending for the next 7 days. + final double next7DaysSpending; + + /// Total shifts scheduled for the current week. + final int weeklyShifts; + + /// Shifts scheduled for the next 7 days. + final int next7DaysScheduled; + + /// Total workers needed for today's shifts. + final int totalNeeded; + + /// Total workers filled for today's shifts. + final int totalFilled; + + @override + List get props => [ + weeklySpending, + next7DaysSpending, + weeklyShifts, + next7DaysScheduled, + totalNeeded, + totalFilled, + ]; +} diff --git a/apps/mobile/packages/domain/lib/src/entities/home/reorder_item.dart b/apps/mobile/packages/domain/lib/src/entities/home/reorder_item.dart new file mode 100644 index 00000000..7d9e22a3 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/home/reorder_item.dart @@ -0,0 +1,46 @@ +import 'package:equatable/equatable.dart'; + +/// Summary of a completed shift role used for reorder suggestions. +class ReorderItem extends Equatable { + const ReorderItem({ + required this.orderId, + required this.title, + required this.location, + required this.hourlyRate, + required this.hours, + required this.workers, + required this.type, + }); + + /// Parent order id for the completed shift. + final String orderId; + + /// Display title (role + shift title). + final String title; + + /// Location from the shift. + final String location; + + /// Hourly rate from the role. + final double hourlyRate; + + /// Total hours for the shift role. + final double hours; + + /// Worker count for the shift role. + final int workers; + + /// Order type (e.g., ONE_TIME). + final String type; + + @override + List get props => [ + orderId, + title, + location, + hourlyRate, + hours, + workers, + type, + ]; +} diff --git a/apps/mobile/packages/domain/lib/src/entities/orders/one_time_order.dart b/apps/mobile/packages/domain/lib/src/entities/orders/one_time_order.dart new file mode 100644 index 00000000..1e035a49 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/orders/one_time_order.dart @@ -0,0 +1,39 @@ +import 'package:equatable/equatable.dart'; +import 'one_time_order_position.dart'; + +/// Represents a customer's request for a single event or shift. +/// +/// Encapsulates the date, primary location, and a list of specific [OneTimeOrderPosition] requirements. +class OneTimeOrder extends Equatable { + + const OneTimeOrder({ + required this.date, + required this.location, + required this.positions, + this.vendorId, + this.roleRates = const {}, + }); + /// The specific date for the shift or event. + final DateTime date; + + /// The primary location where the work will take place. + final String location; + + /// The list of positions and headcounts required for this order. + final List positions; + + /// Selected vendor id for this order. + final String? vendorId; + + /// Role hourly rates keyed by role id. + final Map roleRates; + + @override + List get props => [ + date, + location, + positions, + vendorId, + roleRates, + ]; +} diff --git a/apps/mobile/packages/domain/lib/src/entities/orders/one_time_order_position.dart b/apps/mobile/packages/domain/lib/src/entities/orders/one_time_order_position.dart new file mode 100644 index 00000000..8e9776be --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/orders/one_time_order_position.dart @@ -0,0 +1,62 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a specific position requirement within a [OneTimeOrder]. +/// +/// Defines the role, headcount, and scheduling details for a single staffing requirement. +class OneTimeOrderPosition extends Equatable { + + const OneTimeOrderPosition({ + required this.role, + required this.count, + required this.startTime, + required this.endTime, + this.lunchBreak = 'NO_BREAK', + this.location, + }); + /// The job role or title required. + final String role; + + /// The number of workers required for this position. + final int count; + + /// The scheduled start time (e.g., "09:00 AM"). + final String startTime; + + /// The scheduled end time (e.g., "05:00 PM"). + final String endTime; + + /// The break duration enum value (e.g., NO_BREAK, MIN_15, MIN_30). + final String lunchBreak; + + /// Optional specific location for this position, if different from the order's main location. + final String? location; + + @override + List get props => [ + role, + count, + startTime, + endTime, + lunchBreak, + location, + ]; + + /// Creates a copy of this position with the given fields replaced. + OneTimeOrderPosition copyWith({ + String? role, + int? count, + String? startTime, + String? endTime, + String? lunchBreak, + String? location, + }) { + return OneTimeOrderPosition( + role: role ?? this.role, + count: count ?? this.count, + startTime: startTime ?? this.startTime, + endTime: endTime ?? this.endTime, + lunchBreak: lunchBreak ?? this.lunchBreak, + location: location ?? this.location, + ); + } +} diff --git a/apps/mobile/packages/domain/lib/src/entities/orders/order_item.dart b/apps/mobile/packages/domain/lib/src/entities/orders/order_item.dart new file mode 100644 index 00000000..8dea0ee5 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/orders/order_item.dart @@ -0,0 +1,95 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a customer's view of an order or shift. +/// +/// This entity captures the details necessary for the dashboard/view orders screen, +/// including status and worker assignments. +class OrderItem extends Equatable { + /// Creates an [OrderItem]. + const OrderItem({ + required this.id, + required this.orderId, + required this.title, + required this.clientName, + required this.status, + required this.date, + required this.startTime, + required this.endTime, + required this.location, + required this.locationAddress, + required this.filled, + required this.workersNeeded, + required this.hourlyRate, + this.hours = 0, + this.totalValue = 0, + this.confirmedApps = const >[], + }); + + /// Unique identifier of the order. + final String id; + + /// Parent order identifier. + final String orderId; + + /// Title or name of the role. + final String title; + + /// Name of the client company. + final String clientName; + + /// status of the order (e.g., 'open', 'filled', 'completed'). + final String status; + + /// Date of the shift (ISO format). + final String date; + + /// Start time of the shift. + final String startTime; + + /// End time of the shift. + final String endTime; + + /// Location name. + final String location; + + /// Full address of the location. + final String locationAddress; + + /// Number of workers currently filled. + final int filled; + + /// Total number of workers required. + final int workersNeeded; + + /// Hourly pay rate. + final double hourlyRate; + + /// Total hours for the shift role. + final double hours; + + /// Total value for the shift role. + final double totalValue; + + /// List of confirmed worker applications. + final List> confirmedApps; + + @override + List get props => [ + id, + orderId, + title, + clientName, + status, + date, + startTime, + endTime, + location, + locationAddress, + filled, + workersNeeded, + hourlyRate, + hours, + totalValue, + confirmedApps, + ]; +} diff --git a/apps/mobile/packages/domain/lib/src/entities/orders/order_type.dart b/apps/mobile/packages/domain/lib/src/entities/orders/order_type.dart new file mode 100644 index 00000000..e1448be7 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/orders/order_type.dart @@ -0,0 +1,25 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a type of order that can be created (e.g., Rapid, One-Time). +/// +/// This entity defines the identity and display metadata (keys) for the order type. +/// UI-specific properties like colors and icons are handled by the presentation layer. +class OrderType extends Equatable { + + const OrderType({ + required this.id, + required this.titleKey, + required this.descriptionKey, + }); + /// Unique identifier for the order type. + final String id; + + /// Translation key for the title. + final String titleKey; + + /// Translation key for the description. + final String descriptionKey; + + @override + List get props => [id, titleKey, descriptionKey]; +} diff --git a/apps/mobile/packages/domain/lib/src/entities/profile/accessibility.dart b/apps/mobile/packages/domain/lib/src/entities/profile/accessibility.dart new file mode 100644 index 00000000..263b5550 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/profile/accessibility.dart @@ -0,0 +1,20 @@ +import 'package:equatable/equatable.dart'; + +/// Represents accessibility requirements or features. +/// +/// Can apply to Staff (needs) or Events (provision). +class Accessibility extends Equatable { + + const Accessibility({ + required this.id, + required this.name, + }); + /// Unique identifier. + final String id; + + /// Description (e.g. "Wheelchair Access"). + final String name; + + @override + List get props => [id, name]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/profile/attire_item.dart b/apps/mobile/packages/domain/lib/src/entities/profile/attire_item.dart new file mode 100644 index 00000000..97cd9df6 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/profile/attire_item.dart @@ -0,0 +1,33 @@ +import 'package:equatable/equatable.dart'; + +/// Represents an attire item that a staff member might need or possess. +/// +/// Attire items are specific clothing or equipment required for jobs. +class AttireItem extends Equatable { + /// Unique identifier of the attire item. + final String id; + + /// Display name of the item. + final String label; + + /// Name of the icon to display (mapped in UI). + final String? iconName; + + /// URL of the reference image. + final String? imageUrl; + + /// Whether this item is mandatory for onboarding. + final bool isMandatory; + + /// Creates an [AttireItem]. + const AttireItem({ + required this.id, + required this.label, + this.iconName, + this.imageUrl, + this.isMandatory = false, + }); + + @override + List get props => [id, label, iconName, imageUrl, isMandatory]; +} diff --git a/apps/mobile/packages/domain/lib/src/entities/profile/bank_account.dart b/apps/mobile/packages/domain/lib/src/entities/profile/bank_account.dart new file mode 100644 index 00000000..deca9a28 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/profile/bank_account.dart @@ -0,0 +1,53 @@ +import 'package:equatable/equatable.dart'; + +/// Account type (Checking, Savings, etc). +enum BankAccountType { + checking, + savings, + other, +} + +/// Represents bank account details for payroll. +class BankAccount extends Equatable { + + const BankAccount({ + required this.id, + required this.userId, + required this.bankName, + required this.accountNumber, + required this.accountName, + this.sortCode, + this.type = BankAccountType.checking, + this.isPrimary = false, + this.last4, + }); + /// Unique identifier. + final String id; + + /// The [User] owning the account. + final String userId; + + /// Name of the bank. + final String bankName; + + /// Account number. + final String accountNumber; + + /// Name on the account. + final String accountName; + + /// Sort code (if applicable). + final String? sortCode; + + /// Type of account. + final BankAccountType type; + + /// Whether this is the primary account. + final bool isPrimary; + + /// Last 4 digits. + final String? last4; + + @override + List get props => [id, userId, bankName, accountNumber, accountName, sortCode, type, isPrimary, last4]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/profile/emergency_contact.dart b/apps/mobile/packages/domain/lib/src/entities/profile/emergency_contact.dart new file mode 100644 index 00000000..d9e8fcd2 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/profile/emergency_contact.dart @@ -0,0 +1,24 @@ +import 'package:equatable/equatable.dart'; + +/// Represents an emergency contact for a user. +/// +/// Critical for staff safety during shifts. +class EmergencyContact extends Equatable { + + const EmergencyContact({ + required this.name, + required this.relationship, + required this.phone, + }); + /// Full name of the contact. + final String name; + + /// Relationship to the user (e.g. "Spouse", "Parent"). + final String relationship; + + /// Phone number. + final String phone; + + @override + List get props => [name, relationship, phone]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/profile/schedule.dart b/apps/mobile/packages/domain/lib/src/entities/profile/schedule.dart new file mode 100644 index 00000000..5aeb8131 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/profile/schedule.dart @@ -0,0 +1,32 @@ +import 'package:equatable/equatable.dart'; + +/// Represents general availability schedule for a [Staff] member. +/// +/// Defines recurring availability (e.g., "Mondays 9-5"). +class Schedule extends Equatable { + + const Schedule({ + required this.id, + required this.staffId, + required this.dayOfWeek, + required this.startTime, + required this.endTime, + }); + /// Unique identifier. + final String id; + + /// The [Staff] member. + final String staffId; + + /// Day of the week (1 = Monday, 7 = Sunday). + final int dayOfWeek; + + /// Start time of availability. + final DateTime startTime; + + /// End time of availability. + final DateTime endTime; + + @override + List get props => [id, staffId, dayOfWeek, startTime, endTime]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/profile/staff_document.dart b/apps/mobile/packages/domain/lib/src/entities/profile/staff_document.dart new file mode 100644 index 00000000..7df6a2a3 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/profile/staff_document.dart @@ -0,0 +1,60 @@ +import 'package:equatable/equatable.dart'; + +/// Status of a compliance document. +enum DocumentStatus { + verified, + pending, + missing, + rejected, + expired +} + +/// Represents a staff compliance document. +class StaffDocument extends Equatable { + /// The unique identifier of the staff document record. + final String id; + + /// The ID of the staff member. + final String staffId; + + /// The ID of the document definition. + final String documentId; + + /// The name of the document. + final String name; + + /// A description of the document. + final String? description; + + /// The status of the document. + final DocumentStatus status; + + /// The URL of the uploaded document image/file. + final String? documentUrl; + + /// The expiry date of the document. + final DateTime? expiryDate; + + const StaffDocument({ + required this.id, + required this.staffId, + required this.documentId, + required this.name, + this.description, + required this.status, + this.documentUrl, + this.expiryDate, + }); + + @override + List get props => [ + id, + staffId, + documentId, + name, + description, + status, + documentUrl, + expiryDate, + ]; +} diff --git a/apps/mobile/packages/domain/lib/src/entities/ratings/business_staff_preference.dart b/apps/mobile/packages/domain/lib/src/entities/ratings/business_staff_preference.dart new file mode 100644 index 00000000..1f56eecb --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/ratings/business_staff_preference.dart @@ -0,0 +1,35 @@ +import 'package:equatable/equatable.dart'; + +/// The type of preference a business has for a staff member. +enum PreferenceType { + /// Business wants to prioritize this staff member. + favorite, + + /// Business does not want to work with this staff member. + blocked, +} + +/// Represents a business's specific preference for a staff member. +class BusinessStaffPreference extends Equatable { + + const BusinessStaffPreference({ + required this.id, + required this.businessId, + required this.staffId, + required this.type, + }); + /// Unique identifier. + final String id; + + /// The [Business] holding the preference. + final String businessId; + + /// The [Staff] member. + final String staffId; + + /// Whether they are a favorite or blocked. + final PreferenceType type; + + @override + List get props => [id, businessId, staffId, type]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/ratings/penalty_log.dart b/apps/mobile/packages/domain/lib/src/entities/ratings/penalty_log.dart new file mode 100644 index 00000000..d42e46f0 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/ratings/penalty_log.dart @@ -0,0 +1,36 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a penalty issued to a staff member. +/// +/// Penalties are issued for no-shows, cancellations, or poor conduct. +class PenaltyLog extends Equatable { + + const PenaltyLog({ + required this.id, + required this.staffId, + required this.assignmentId, + required this.reason, + required this.points, + required this.issuedAt, + }); + /// Unique identifier. + final String id; + + /// The [Staff] member penalized. + final String staffId; + + /// The [Assignment] context (if applicable). + final String assignmentId; + + /// Reason for the penalty. + final String reason; + + /// Score points deducted from staff profile. + final int points; + + /// When the penalty was issued. + final DateTime issuedAt; + + @override + List get props => [id, staffId, assignmentId, reason, points, issuedAt]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/ratings/staff_rating.dart b/apps/mobile/packages/domain/lib/src/entities/ratings/staff_rating.dart new file mode 100644 index 00000000..b51a44ae --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/ratings/staff_rating.dart @@ -0,0 +1,34 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a rating given to a staff member by a client. +class StaffRating extends Equatable { + + const StaffRating({ + required this.id, + required this.staffId, + required this.eventId, + required this.businessId, + required this.rating, + this.comment, + }); + /// Unique identifier. + final String id; + + /// The [Staff] being rated. + final String staffId; + + /// The [Event] context. + final String eventId; + + /// The [Business] leaving the rating. + final String businessId; + + /// Star rating (1-5). + final int rating; + + /// Optional feedback text. + final String? comment; + + @override + List get props => [id, staffId, eventId, businessId, rating, comment]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/shifts/shift.dart b/apps/mobile/packages/domain/lib/src/entities/shifts/shift.dart new file mode 100644 index 00000000..4998c45b --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/shifts/shift.dart @@ -0,0 +1,91 @@ +import 'package:equatable/equatable.dart'; + +class Shift extends Equatable { + final String id; + final String title; + final String clientName; + final String? logoUrl; + final double hourlyRate; + final String location; + final String locationAddress; + final String date; + final String startTime; + final String endTime; + final String createdDate; + final bool? tipsAvailable; + final bool? travelTime; + final bool? mealProvided; + final bool? parkingAvailable; + final bool? gasCompensation; + final String? description; + final String? instructions; + final List? managers; + final double? latitude; + final double? longitude; + final String? status; + final int? durationDays; // For multi-day shifts + + const Shift({ + required this.id, + required this.title, + required this.clientName, + this.logoUrl, + required this.hourlyRate, + required this.location, + required this.locationAddress, + required this.date, + required this.startTime, + required this.endTime, + required this.createdDate, + this.tipsAvailable, + this.travelTime, + this.mealProvided, + this.parkingAvailable, + this.gasCompensation, + this.description, + this.instructions, + this.managers, + this.latitude, + this.longitude, + this.status, + this.durationDays, + }); + + @override + List get props => [ + id, + title, + clientName, + logoUrl, + hourlyRate, + location, + locationAddress, + date, + startTime, + endTime, + createdDate, + tipsAvailable, + travelTime, + mealProvided, + parkingAvailable, + gasCompensation, + description, + instructions, + managers, + latitude, + longitude, + status, + durationDays, + ]; +} + +class ShiftManager extends Equatable { + final String name; + final String phone; + final String? avatar; + + const ShiftManager({required this.name, required this.phone, this.avatar}); + + @override + List get props => [name, phone, avatar]; +} diff --git a/apps/mobile/packages/domain/lib/src/entities/skills/certificate.dart b/apps/mobile/packages/domain/lib/src/entities/skills/certificate.dart new file mode 100644 index 00000000..fd6065f8 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/skills/certificate.dart @@ -0,0 +1,24 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a required certificate definition. +/// +/// Examples: "Food Hygiene Level 2", "SIA Badge". +class Certificate extends Equatable { + + const Certificate({ + required this.id, + required this.name, + required this.isRequired, + }); + /// Unique identifier. + final String id; + + /// Display name of the certificate. + final String name; + + /// Whether this certificate is mandatory for platform access or specific roles. + final bool isRequired; + + @override + List get props => [id, name, isRequired]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/skills/skill.dart b/apps/mobile/packages/domain/lib/src/entities/skills/skill.dart new file mode 100644 index 00000000..f61b68e7 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/skills/skill.dart @@ -0,0 +1,29 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a job category / skill type. +/// +/// Examples: "Waiter", "Security Guard", "Bartender". +/// Linked to a [SkillCategory]. +class Skill extends Equatable { + + const Skill({ + required this.id, + required this.categoryId, + required this.name, + required this.basePrice, + }); + /// Unique identifier. + final String id; + + /// The broader category (e.g. "Hospitality"). + final String categoryId; + + /// Display name of the skill. + final String name; + + /// Default hourly rate suggested for this skill. + final double basePrice; + + @override + List get props => [id, categoryId, name, basePrice]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/skills/skill_category.dart b/apps/mobile/packages/domain/lib/src/entities/skills/skill_category.dart new file mode 100644 index 00000000..091fce05 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/skills/skill_category.dart @@ -0,0 +1,18 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a broad category of skills (e.g. "Hospitality", "Logistics"). +class SkillCategory extends Equatable { + + const SkillCategory({ + required this.id, + required this.name, + }); + /// Unique identifier. + final String id; + + /// Display name. + final String name; + + @override + List get props => [id, name]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/skills/skill_kit.dart b/apps/mobile/packages/domain/lib/src/entities/skills/skill_kit.dart new file mode 100644 index 00000000..eca88467 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/skills/skill_kit.dart @@ -0,0 +1,32 @@ +import 'package:equatable/equatable.dart'; + +/// Represents required equipment or uniform for a specific [Skill]. +/// +/// Examples: "Black Shirt" (Uniform), "Safety Boots" (Equipment). +class SkillKit extends Equatable { + + const SkillKit({ + required this.id, + required this.skillId, + required this.name, + required this.isRequired, + required this.type, + }); + /// Unique identifier. + final String id; + + /// The [Skill] this kit applies to. + final String skillId; + + /// Description of the item. + final String name; + + /// Whether the staff member MUST possess this item. + final bool isRequired; + + /// Type of kit ('uniform' or 'equipment'). + final String type; + + @override + List get props => [id, skillId, name, isRequired, type]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/skills/staff_skill.dart b/apps/mobile/packages/domain/lib/src/entities/skills/staff_skill.dart new file mode 100644 index 00000000..b868c9d7 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/skills/staff_skill.dart @@ -0,0 +1,58 @@ +import 'package:equatable/equatable.dart'; + +/// The expertise level of a staff member in a specific skill. +enum SkillLevel { + /// Entry level. + beginner, + + /// Experienced. + skilled, + + /// Expert / Managerial level. + professional, +} + +/// The verification status of a claimed skill. +enum StaffSkillStatus { + /// Claimed by staff, waiting for admin approval. + pending, + + /// Verified by admin (documents checked). + verified, + + /// Rejected by admin. + rejected, +} + +/// Represents a staff member's qualification in a specific [Skill]. +class StaffSkill extends Equatable { + + const StaffSkill({ + required this.id, + required this.staffId, + required this.skillId, + required this.level, + required this.experienceYears, + required this.status, + }); + /// Unique identifier. + final String id; + + /// The [Staff] member. + final String staffId; + + /// The [Skill] they possess. + final String skillId; + + /// Their expertise level. + final SkillLevel level; + + /// Years of experience. + final int experienceYears; + + /// Verification status. + final StaffSkillStatus status; + + @override + List get props => [id, staffId, skillId, level, experienceYears, status]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/support/addon.dart b/apps/mobile/packages/domain/lib/src/entities/support/addon.dart new file mode 100644 index 00000000..fd85edba --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/support/addon.dart @@ -0,0 +1,26 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a financial addon/bonus/deduction applied to an Invoice or Payment. +class Addon extends Equatable { + + const Addon({ + required this.id, + required this.name, + required this.amount, + required this.type, + }); + /// Unique identifier. + final String id; + + /// Description (e.g. "Travel Expense"). + final String name; + + /// Monetary value. + final double amount; + + /// Type ('credit' or 'debit'). + final String type; + + @override + List get props => [id, name, amount, type]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/support/media.dart b/apps/mobile/packages/domain/lib/src/entities/support/media.dart new file mode 100644 index 00000000..329cdca6 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/support/media.dart @@ -0,0 +1,24 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a media file reference. +/// +/// Used for avatars, certificates, or event photos. +class Media extends Equatable { + + const Media({ + required this.id, + required this.url, + required this.type, + }); + /// Unique identifier. + final String id; + + /// External URL to the file. + final String url; + + /// MIME type or general type (image, pdf). + final String type; + + @override + List get props => [id, url, type]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/support/tag.dart b/apps/mobile/packages/domain/lib/src/entities/support/tag.dart new file mode 100644 index 00000000..44d4db9d --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/support/tag.dart @@ -0,0 +1,18 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a descriptive tag used for categorizing events or staff. +class Tag extends Equatable { + + const Tag({ + required this.id, + required this.label, + }); + /// Unique identifier. + final String id; + + /// Text label. + final String label; + + @override + List get props => [id, label]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/support/working_area.dart b/apps/mobile/packages/domain/lib/src/entities/support/working_area.dart new file mode 100644 index 00000000..aa5d8d56 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/support/working_area.dart @@ -0,0 +1,30 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a geographical area where a [Staff] member is willing to work. +class WorkingArea extends Equatable { + + const WorkingArea({ + required this.id, + required this.name, + required this.centerLat, + required this.centerLng, + required this.radiusKm, + }); + /// Unique identifier. + final String id; + + /// Name of the area (e.g. "London Zone 1"). + final String name; + + /// Latitude of the center point. + final double centerLat; + + /// Longitude of the center point. + final double centerLng; + + /// Radius in Kilometers. + final double radiusKm; + + @override + List get props => [id, name, centerLat, centerLng, radiusKm]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/users/biz_member.dart b/apps/mobile/packages/domain/lib/src/entities/users/biz_member.dart new file mode 100644 index 00000000..2f3bcf34 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/users/biz_member.dart @@ -0,0 +1,28 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a member of a Business. +/// +/// Grants a user access to business-level operations. +class BizMember extends Equatable { + + const BizMember({ + required this.id, + required this.businessId, + required this.userId, + required this.role, + }); + /// Unique identifier for this membership. + final String id; + + /// The [Business] the user belongs to. + final String businessId; + + /// The [User] who is a member. + final String userId; + + /// The role within the business. + final String role; + + @override + List get props => [id, businessId, userId, role]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/users/hub_member.dart b/apps/mobile/packages/domain/lib/src/entities/users/hub_member.dart new file mode 100644 index 00000000..a6bd7a7f --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/users/hub_member.dart @@ -0,0 +1,28 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a member of a Hub. +/// +/// Grants a user access to specific [Hub] operations, distinct from [BizMember]. +class HubMember extends Equatable { + + const HubMember({ + required this.id, + required this.hubId, + required this.userId, + required this.role, + }); + /// Unique identifier for this membership. + final String id; + + /// The [Hub] the user belongs to. + final String hubId; + + /// The [User] who is a member. + final String userId; + + /// The role within the hub. + final String role; + + @override + List get props => [id, hubId, userId, role]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/users/membership.dart b/apps/mobile/packages/domain/lib/src/entities/users/membership.dart new file mode 100644 index 00000000..c09ea2ae --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/users/membership.dart @@ -0,0 +1,32 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a polymorphic membership to an organization unit. +/// +/// Allows a [User] to be a member of either a [Business] or a [Hub]. +class Membership extends Equatable { + + const Membership({ + required this.id, + required this.userId, + required this.memberableId, + required this.memberableType, + required this.role, + }); + /// Unique identifier for the membership record. + final String id; + + /// The [User] holding this membership. + final String userId; + + /// The ID of the organization unit (Business or Hub). + final String memberableId; + + /// The type of the organization unit ('business' or 'hub'). + final String memberableType; + + /// The role within that organization (e.g., 'manager', 'viewer'). + final String role; + + @override + List get props => [id, userId, memberableId, memberableType, role]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/users/staff.dart b/apps/mobile/packages/domain/lib/src/entities/users/staff.dart new file mode 100644 index 00000000..f3bc2bf0 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/users/staff.dart @@ -0,0 +1,83 @@ +import 'package:equatable/equatable.dart'; + +/// The lifecycle status of a [Staff] account. +enum StaffStatus { + /// Account created but profile not started. + registered, + + /// Profile submitted and awaiting verification. + pending, + + /// Profile information filled but not submitted for verification. + completedProfile, + + /// Profile verified by admin. + verified, + + /// Staff is currently active and eligible for work. + active, + + /// Account is temporarily suspended. + blocked, + + /// Account is permanently inactive. + inactive, +} + +/// Represents a worker profile. +/// +/// Contains all personal and professional details of a staff member. +/// Linked to a [User] via [authProviderId]. +class Staff extends Equatable { + + const Staff({ + required this.id, + required this.authProviderId, + required this.name, + required this.email, + this.phone, + required this.status, + this.address, + this.avatar, + this.livePhoto, + }); + /// Unique identifier for the staff profile. + final String id; + + /// Link to the [User] authentication record. + final String authProviderId; + + /// Full display name. + final String name; + + /// Contact email. + final String email; + + /// Contact phone number. + final String? phone; + + /// Current workflow status of the staff member. + final StaffStatus status; + + /// Physical address string. + final String? address; + + /// URL to the avatar image. + final String? avatar; + + /// URL to a verified live photo for identity verification. + final String? livePhoto; + + @override + List get props => [ + id, + authProviderId, + name, + email, + phone, + status, + address, + avatar, + livePhoto, + ]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/lib/src/entities/users/user.dart b/apps/mobile/packages/domain/lib/src/entities/users/user.dart new file mode 100644 index 00000000..fc300f59 --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/entities/users/user.dart @@ -0,0 +1,30 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a base authenticated user in the KROW platform. +/// +/// This entity corresponds to the Firebase Auth user record and acts as the +/// linkage between the authentication system and the specific [Staff] or Client profiles. +class User extends Equatable { + + const User({ + required this.id, + required this.email, + this.phone, + required this.role, + }); + /// The unique identifier from the authentication provider (e.g., Firebase UID). + final String id; + + /// The user's email address. + final String email; + + /// The user's phone number, if available. + final String? phone; + + /// The primary role of the user (e.g., 'staff', 'client_admin'). + /// This determines the initial routing and permissions. + final String role; + + @override + List get props => [id, email, phone, role]; +} \ No newline at end of file diff --git a/apps/mobile/packages/domain/pubspec.yaml b/apps/mobile/packages/domain/pubspec.yaml new file mode 100644 index 00000000..8d6247e0 --- /dev/null +++ b/apps/mobile/packages/domain/pubspec.yaml @@ -0,0 +1,11 @@ +name: krow_domain +description: Domain entities and business logic. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + +dependencies: + equatable: ^2.0.8 diff --git a/apps/mobile/packages/features/.gitkeep b/apps/mobile/packages/features/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/apps/mobile/packages/features/client/authentication/lib/client_authentication.dart b/apps/mobile/packages/features/client/authentication/lib/client_authentication.dart new file mode 100644 index 00000000..f78c647f --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/client_authentication.dart @@ -0,0 +1,67 @@ +library client_authentication; + +import 'package:firebase_auth/firebase_auth.dart' as firebase; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'src/data/repositories_impl/auth_repository_impl.dart'; +import 'src/domain/repositories/auth_repository_interface.dart'; +import 'src/domain/usecases/sign_in_with_email_use_case.dart'; +import 'src/domain/usecases/sign_in_with_social_use_case.dart'; +import 'src/domain/usecases/sign_out_use_case.dart'; +import 'src/domain/usecases/sign_up_with_email_use_case.dart'; +import 'src/presentation/blocs/client_auth_bloc.dart'; +import 'src/presentation/pages/client_get_started_page.dart'; +import 'src/presentation/pages/client_sign_in_page.dart'; +import 'src/presentation/pages/client_sign_up_page.dart'; + +export 'src/presentation/pages/client_get_started_page.dart'; +export 'src/presentation/pages/client_sign_in_page.dart'; +export 'src/presentation/pages/client_sign_up_page.dart'; +export 'src/presentation/navigation/client_auth_navigator.dart'; +export 'package:core_localization/core_localization.dart'; + +/// A [Module] for the client authentication feature. +class ClientAuthenticationModule extends Module { + @override + List get imports => [DataConnectModule()]; + + @override + void binds(Injector i) { + // Repositories + i.addLazySingleton( + () => AuthRepositoryImpl( + firebaseAuth: firebase.FirebaseAuth.instance, + dataConnect: ExampleConnector.instance, + ), + ); + + // UseCases + i.addLazySingleton( + () => SignInWithEmailUseCase(i.get()), + ); + i.addLazySingleton( + () => SignUpWithEmailUseCase(i.get()), + ); + i.addLazySingleton( + () => SignInWithSocialUseCase(i.get()), + ); + i.addLazySingleton(() => SignOutUseCase(i.get())); + + // BLoCs + i.addLazySingleton( + () => ClientAuthBloc( + signInWithEmail: i.get(), + signUpWithEmail: i.get(), + signInWithSocial: i.get(), + signOut: i.get(), + ), + ); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (_) => const ClientGetStartedPage()); + r.child('/client-sign-in', child: (_) => const ClientSignInPage()); + r.child('/client-sign-up', child: (_) => const ClientSignUpPage()); + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/data/repositories_impl/auth_repository_impl.dart b/apps/mobile/packages/features/client/authentication/lib/src/data/repositories_impl/auth_repository_impl.dart new file mode 100644 index 00000000..3c7d387a --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/data/repositories_impl/auth_repository_impl.dart @@ -0,0 +1,185 @@ +import 'package:firebase_auth/firebase_auth.dart' as firebase; +import 'package:firebase_data_connect/firebase_data_connect.dart'; +import 'package:krow_data_connect/krow_data_connect.dart' as dc; +import 'package:krow_domain/krow_domain.dart' as domain; + +import '../../domain/repositories/auth_repository_interface.dart'; + +/// Production-ready implementation of the [AuthRepositoryInterface] for the client app. +/// +/// This implementation integrates with Firebase Authentication for user +/// identity management and Krow's Data Connect SDK for storing user profile data. +class AuthRepositoryImpl implements AuthRepositoryInterface { + final firebase.FirebaseAuth _firebaseAuth; + final dc.ExampleConnector _dataConnect; + + /// Creates an [AuthRepositoryImpl] with the real dependencies. + AuthRepositoryImpl({ + required firebase.FirebaseAuth firebaseAuth, + required dc.ExampleConnector dataConnect, + }) : _firebaseAuth = firebaseAuth, + _dataConnect = dataConnect; + + @override + Future signInWithEmail({ + required String email, + required String password, + }) async { + try { + final firebase.UserCredential credential = await _firebaseAuth.signInWithEmailAndPassword( + email: email, + password: password, + ); + + final firebase.User? firebaseUser = credential.user; + if (firebaseUser == null) { + throw Exception('Sign-in failed, no Firebase user received.'); + } + + return _getUserProfile( + firebaseUserId: firebaseUser.uid, + fallbackEmail: firebaseUser.email ?? email, + ); + + //TO-DO: validate that user is business role and has business account + + } on firebase.FirebaseAuthException catch (e) { + if (e.code == 'invalid-credential' || e.code == 'wrong-password') { + throw Exception('Incorrect email or password.'); + } else { + throw Exception('Authentication error: ${e.message}'); + } + } catch (e) { + throw Exception('Failed to sign in and fetch user data: ${e.toString()}'); + } + } + + @override + Future signUpWithEmail({ + required String companyName, + required String email, + required String password, + }) async { + try { + final firebase.UserCredential credential = await _firebaseAuth.createUserWithEmailAndPassword( + email: email, + password: password, + ); + + final firebase.User? firebaseUser = credential.user; + if (firebaseUser == null) { + throw Exception('Sign-up failed, Firebase user could not be created.'); + } + + // Client-specific business logic: + // 1. Create a `Business` entity. + // 2. Create a `User` entity associated with the business. + final OperationResult createBusinessResponse = await _dataConnect.createBusiness( + businessName: companyName, + userId: firebaseUser.uid, + rateGroup: dc.BusinessRateGroup.STANDARD, + status: dc.BusinessStatus.PENDING, + ).execute(); + + final dc.CreateBusinessBusinessInsert? businessData = createBusinessResponse.data?.business_insert; + if (businessData == null) { + await firebaseUser.delete(); // Rollback if business creation fails + throw Exception('Business creation failed after Firebase user registration.'); + } + + final OperationResult createUserResponse = await _dataConnect.createUser( + id: firebaseUser.uid, + role: dc.UserBaseRole.USER, + ) + .email(email) + .userRole('BUSINESS') + .execute(); + + final dc.CreateUserUserInsert? newUserData = createUserResponse.data?.user_insert; + if (newUserData == null) { + await firebaseUser.delete(); // Rollback if user profile creation fails + // TO-DO: Also delete the created Business if this fails + throw Exception('User profile creation failed after Firebase user registration.'); + } + + return _getUserProfile( + firebaseUserId: firebaseUser.uid, + fallbackEmail: firebaseUser.email ?? email, + ); + + } on firebase.FirebaseAuthException catch (e) { + if (e.code == 'weak-password') { + throw Exception('The password provided is too weak.'); + } else if (e.code == 'email-already-in-use') { + throw Exception('An account already exists for that email address.'); + } else { + throw Exception('Sign-up error: ${e.message}'); + } + } catch (e) { + throw Exception('Failed to sign up and create user data: ${e.toString()}'); + } + } + + @override + Future signOut() async { + try { + await _firebaseAuth.signOut(); + dc.ClientSessionStore.instance.clear(); + } catch (e) { + throw Exception('Error signing out: ${e.toString()}'); + } + } + + @override + Future signInWithSocial({required String provider}) { + throw UnimplementedError('Social authentication with $provider is not yet implemented.'); + } + + Future _getUserProfile({ + required String firebaseUserId, + required String? fallbackEmail, + }) async { + final QueryResult response = await _dataConnect.getUserById(id: firebaseUserId).execute(); + final dc.GetUserByIdUser? user = response.data?.user; + if (user == null) { + throw Exception('Authenticated user profile not found in database.'); + } + + final String? email = user.email ?? fallbackEmail; + if (email == null || email.isEmpty) { + throw Exception('User email is missing in profile data.'); + } + + final domain.User domainUser = domain.User( + id: user.id, + email: email, + role: user.role.stringValue, + ); + + final QueryResult businessResponse = await _dataConnect.getBusinessesByUserId( + userId: firebaseUserId, + ).execute(); + final dc.GetBusinessesByUserIdBusinesses? business = businessResponse.data.businesses.isNotEmpty + ? businessResponse.data.businesses.first + : null; + + dc.ClientSessionStore.instance.setSession( + dc.ClientSession( + user: domainUser, + userPhotoUrl: user.photoUrl, + business: business == null + ? null + : dc.ClientBusinessSession( + id: business.id, + businessName: business.businessName, + email: business.email, + city: business.city, + contactName: business.contactName, + companyLogoUrl: business.companyLogoUrl, + ), + ), + ); + + return domainUser; + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/domain/arguments/sign_in_with_email_arguments.dart b/apps/mobile/packages/features/client/authentication/lib/src/domain/arguments/sign_in_with_email_arguments.dart new file mode 100644 index 00000000..54904804 --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/domain/arguments/sign_in_with_email_arguments.dart @@ -0,0 +1,15 @@ +import 'package:krow_core/core.dart'; + +/// Arguments for the [SignInWithEmailUseCase]. +class SignInWithEmailArguments extends UseCaseArgument { + /// The user's email address. + final String email; + + /// The user's password. + final String password; + + const SignInWithEmailArguments({required this.email, required this.password}); + + @override + List get props => [email, password]; +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/domain/arguments/sign_in_with_social_arguments.dart b/apps/mobile/packages/features/client/authentication/lib/src/domain/arguments/sign_in_with_social_arguments.dart new file mode 100644 index 00000000..4ba83fc2 --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/domain/arguments/sign_in_with_social_arguments.dart @@ -0,0 +1,12 @@ +import 'package:krow_core/core.dart'; + +/// Arguments for the [SignInWithSocialUseCase]. +class SignInWithSocialArguments extends UseCaseArgument { + /// The social provider name (e.g. 'google' or 'apple'). + final String provider; + + const SignInWithSocialArguments({required this.provider}); + + @override + List get props => [provider]; +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/domain/arguments/sign_up_with_email_arguments.dart b/apps/mobile/packages/features/client/authentication/lib/src/domain/arguments/sign_up_with_email_arguments.dart new file mode 100644 index 00000000..7e0e127a --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/domain/arguments/sign_up_with_email_arguments.dart @@ -0,0 +1,22 @@ +import 'package:krow_core/core.dart'; + +/// Arguments for the [SignUpWithEmailUseCase]. +class SignUpWithEmailArguments extends UseCaseArgument { + /// The name of the company. + final String companyName; + + /// The user's email address. + final String email; + + /// The user's password. + final String password; + + const SignUpWithEmailArguments({ + required this.companyName, + required this.email, + required this.password, + }); + + @override + List get props => [companyName, email, password]; +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/domain/repositories/auth_repository_interface.dart b/apps/mobile/packages/features/client/authentication/lib/src/domain/repositories/auth_repository_interface.dart new file mode 100644 index 00000000..21a1830c --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/domain/repositories/auth_repository_interface.dart @@ -0,0 +1,37 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Interface for the Client Authentication Repository. +/// +/// This abstraction defines the core authentication operations required for +/// the client application, allowing the presentation layer to work with +/// different data sources (e.g., Supabase, Firebase, or Mock) without +/// depending on specific implementations. +abstract class AuthRepositoryInterface { + /// Signs in an existing client user using their email and password. + /// + /// Returns a [User] object upon successful authentication. + /// Throws an exception if authentication fails. + Future signInWithEmail({ + required String email, + required String password, + }); + + /// Registers a new client user with their business details. + /// + /// Takes [companyName], [email], and [password] to create a new account. + /// Returns the newly created [User]. + Future signUpWithEmail({ + required String companyName, + required String email, + required String password, + }); + + /// Authenticates using an OAuth provider. + /// + /// [provider] can be 'google' or 'apple'. + /// Returns a [User] upon successful social login. + Future signInWithSocial({required String provider}); + + /// Terminates the current user session and clears authentication tokens. + Future signOut(); +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/domain/usecases/sign_in_with_email_use_case.dart b/apps/mobile/packages/features/client/authentication/lib/src/domain/usecases/sign_in_with_email_use_case.dart new file mode 100644 index 00000000..a10358f7 --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/domain/usecases/sign_in_with_email_use_case.dart @@ -0,0 +1,24 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../arguments/sign_in_with_email_arguments.dart'; +import '../repositories/auth_repository_interface.dart'; + +/// Use case for signing in a client using email and password. +/// +/// This use case encapsulates the logic for authenticating an existing user +/// via email/password credentials. +class SignInWithEmailUseCase + implements UseCase { + final AuthRepositoryInterface _repository; + + const SignInWithEmailUseCase(this._repository); + + /// Executes the sign-in operation. + @override + Future call(SignInWithEmailArguments params) { + return _repository.signInWithEmail( + email: params.email, + password: params.password, + ); + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/domain/usecases/sign_in_with_social_use_case.dart b/apps/mobile/packages/features/client/authentication/lib/src/domain/usecases/sign_in_with_social_use_case.dart new file mode 100644 index 00000000..dcbeab4a --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/domain/usecases/sign_in_with_social_use_case.dart @@ -0,0 +1,18 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../arguments/sign_in_with_social_arguments.dart'; +import '../repositories/auth_repository_interface.dart'; + +/// Use case for signing in a client via social providers (Google/Apple). +class SignInWithSocialUseCase + implements UseCase { + final AuthRepositoryInterface _repository; + + const SignInWithSocialUseCase(this._repository); + + /// Executes the social sign-in operation. + @override + Future call(SignInWithSocialArguments params) { + return _repository.signInWithSocial(provider: params.provider); + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/domain/usecases/sign_out_use_case.dart b/apps/mobile/packages/features/client/authentication/lib/src/domain/usecases/sign_out_use_case.dart new file mode 100644 index 00000000..707cf75c --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/domain/usecases/sign_out_use_case.dart @@ -0,0 +1,18 @@ +import 'package:krow_core/core.dart'; +import '../repositories/auth_repository_interface.dart'; + +/// Use case for signing out the current client user. +/// +/// This use case handles the termination of the user's session and +/// clearing of any local authentication tokens. +class SignOutUseCase implements NoInputUseCase { + final AuthRepositoryInterface _repository; + + const SignOutUseCase(this._repository); + + /// Executes the sign-out operation. + @override + Future call() { + return _repository.signOut(); + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/domain/usecases/sign_up_with_email_use_case.dart b/apps/mobile/packages/features/client/authentication/lib/src/domain/usecases/sign_up_with_email_use_case.dart new file mode 100644 index 00000000..60c53fde --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/domain/usecases/sign_up_with_email_use_case.dart @@ -0,0 +1,25 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../arguments/sign_up_with_email_arguments.dart'; +import '../repositories/auth_repository_interface.dart'; + +/// Use case for registering a new client user. +/// +/// This use case handles the creation of a new client account using +/// email, password, and company details. +class SignUpWithEmailUseCase + implements UseCase { + final AuthRepositoryInterface _repository; + + const SignUpWithEmailUseCase(this._repository); + + /// Executes the sign-up operation. + @override + Future call(SignUpWithEmailArguments params) { + return _repository.signUpWithEmail( + companyName: params.companyName, + email: params.email, + password: params.password, + ); + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/presentation/blocs/client_auth_bloc.dart b/apps/mobile/packages/features/client/authentication/lib/src/presentation/blocs/client_auth_bloc.dart new file mode 100644 index 00000000..e1c39429 --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/presentation/blocs/client_auth_bloc.dart @@ -0,0 +1,133 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:krow_domain/krow_domain.dart'; + +import '../../domain/arguments/sign_in_with_email_arguments.dart'; +import '../../domain/arguments/sign_in_with_social_arguments.dart'; +import '../../domain/arguments/sign_up_with_email_arguments.dart'; +import '../../domain/usecases/sign_in_with_email_use_case.dart'; +import '../../domain/usecases/sign_in_with_social_use_case.dart'; +import '../../domain/usecases/sign_out_use_case.dart'; +import '../../domain/usecases/sign_up_with_email_use_case.dart'; +import 'client_auth_event.dart'; +import 'client_auth_state.dart'; + +/// Business Logic Component for Client Authentication. +/// +/// This BLoC manages the state transitions for the authentication flow in +/// the client application. It handles user inputs (events), interacts with +/// domain use cases, and emits corresponding [ClientAuthState]s. +/// +/// Use this BLoC to handle: +/// * Email/Password Sign In +/// * Business Account Registration +/// * Social Authentication +/// * Session Termination +class ClientAuthBloc extends Bloc { + final SignInWithEmailUseCase _signInWithEmail; + final SignUpWithEmailUseCase _signUpWithEmail; + final SignInWithSocialUseCase _signInWithSocial; + final SignOutUseCase _signOut; + + /// Initializes the BLoC with the required use cases and initial state. + ClientAuthBloc({ + required SignInWithEmailUseCase signInWithEmail, + required SignUpWithEmailUseCase signUpWithEmail, + required SignInWithSocialUseCase signInWithSocial, + required SignOutUseCase signOut, + }) : _signInWithEmail = signInWithEmail, + _signUpWithEmail = signUpWithEmail, + _signInWithSocial = signInWithSocial, + _signOut = signOut, + super(const ClientAuthState()) { + on(_onSignInRequested); + on(_onSignUpRequested); + on(_onSocialSignInRequested); + on(_onSignOutRequested); + } + + /// Handles the [ClientSignInRequested] event. + Future _onSignInRequested( + ClientSignInRequested event, + Emitter emit, + ) async { + emit(state.copyWith(status: ClientAuthStatus.loading)); + try { + final User user = await _signInWithEmail( + SignInWithEmailArguments(email: event.email, password: event.password), + ); + emit(state.copyWith(status: ClientAuthStatus.authenticated, user: user)); + } catch (e) { + emit( + state.copyWith( + status: ClientAuthStatus.error, + errorMessage: e.toString(), + ), + ); + } + } + + /// Handles the [ClientSignUpRequested] event. + Future _onSignUpRequested( + ClientSignUpRequested event, + Emitter emit, + ) async { + emit(state.copyWith(status: ClientAuthStatus.loading)); + try { + final User user = await _signUpWithEmail( + SignUpWithEmailArguments( + companyName: event.companyName, + email: event.email, + password: event.password, + ), + ); + emit(state.copyWith(status: ClientAuthStatus.authenticated, user: user)); + } catch (e) { + emit( + state.copyWith( + status: ClientAuthStatus.error, + errorMessage: e.toString(), + ), + ); + } + } + + /// Handles the [ClientSocialSignInRequested] event. + Future _onSocialSignInRequested( + ClientSocialSignInRequested event, + Emitter emit, + ) async { + emit(state.copyWith(status: ClientAuthStatus.loading)); + try { + final User user = await _signInWithSocial( + SignInWithSocialArguments(provider: event.provider), + ); + emit(state.copyWith(status: ClientAuthStatus.authenticated, user: user)); + } catch (e) { + emit( + state.copyWith( + status: ClientAuthStatus.error, + errorMessage: e.toString(), + ), + ); + } + } + + /// Handles the [ClientSignOutRequested] event. + Future _onSignOutRequested( + ClientSignOutRequested event, + Emitter emit, + ) async { + emit(state.copyWith(status: ClientAuthStatus.loading)); + try { + await _signOut(); + emit(state.copyWith(status: ClientAuthStatus.signedOut, user: null)); + } catch (e) { + emit( + state.copyWith( + status: ClientAuthStatus.error, + errorMessage: e.toString(), + ), + ); + } + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/presentation/blocs/client_auth_event.dart b/apps/mobile/packages/features/client/authentication/lib/src/presentation/blocs/client_auth_event.dart new file mode 100644 index 00000000..5eb35db1 --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/presentation/blocs/client_auth_event.dart @@ -0,0 +1,51 @@ +import 'package:equatable/equatable.dart'; + +/// Base class for all authentication events in the client feature. +abstract class ClientAuthEvent extends Equatable { + const ClientAuthEvent(); + + @override + List get props => []; +} + +/// Event dispatched when a user attempts to sign in with email and password. +class ClientSignInRequested extends ClientAuthEvent { + final String email; + final String password; + + const ClientSignInRequested({required this.email, required this.password}); + + @override + List get props => [email, password]; +} + +/// Event dispatched when a user attempts to create a new business account. +class ClientSignUpRequested extends ClientAuthEvent { + final String companyName; + final String email; + final String password; + + const ClientSignUpRequested({ + required this.companyName, + required this.email, + required this.password, + }); + + @override + List get props => [companyName, email, password]; +} + +/// Event dispatched for third-party authentication (Google/Apple). +class ClientSocialSignInRequested extends ClientAuthEvent { + final String provider; + + const ClientSocialSignInRequested({required this.provider}); + + @override + List get props => [provider]; +} + +/// Event dispatched when the user requests to terminate their session. +class ClientSignOutRequested extends ClientAuthEvent { + const ClientSignOutRequested(); +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/presentation/blocs/client_auth_state.dart b/apps/mobile/packages/features/client/authentication/lib/src/presentation/blocs/client_auth_state.dart new file mode 100644 index 00000000..47573991 --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/presentation/blocs/client_auth_state.dart @@ -0,0 +1,54 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; + +/// Enum representing the various states of the authentication process. +enum ClientAuthStatus { + /// Initial state before any action is taken. + initial, + + /// An authentication operation is in progress. + loading, + + /// The user has successfully authenticated. + authenticated, + + /// The user has successfully signed out. + signedOut, + + /// An error occurred during authentication. + error, +} + +/// Represents the state of the client authentication flow. +class ClientAuthState extends Equatable { + /// Current status of the authentication process. + final ClientAuthStatus status; + + /// The authenticated user (if status is [ClientAuthStatus.authenticated]). + final User? user; + + /// Optional error message when status is [ClientAuthStatus.error]. + final String? errorMessage; + + const ClientAuthState({ + this.status = ClientAuthStatus.initial, + this.user, + this.errorMessage, + }); + + /// Creates a copy of this state with the given fields replaced by the new values. + ClientAuthState copyWith({ + ClientAuthStatus? status, + User? user, + String? errorMessage, + }) { + return ClientAuthState( + status: status ?? this.status, + user: user ?? this.user, + errorMessage: errorMessage ?? this.errorMessage, + ); + } + + @override + List get props => [status, user, errorMessage]; +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/presentation/navigation/client_auth_navigator.dart b/apps/mobile/packages/features/client/authentication/lib/src/presentation/navigation/client_auth_navigator.dart new file mode 100644 index 00000000..472d4707 --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/presentation/navigation/client_auth_navigator.dart @@ -0,0 +1,26 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +/// Typed navigation for the Client Authentication feature. +/// +/// This extension on [IModularNavigator] provides named methods for +/// navigating between authentication pages, reducing magic strings and +/// improving maintainability. +extension ClientAuthNavigator on IModularNavigator { + /// Navigates to the sign in page using a push named route. + void pushClientSignIn() { + pushNamed('/client-sign-in'); + } + + /// Navigates to the sign up page using a push named route. + void pushClientSignUp() { + pushNamed('/client-sign-up'); + } + + /// Navigates to the main client home dashboard. + /// + /// Uses absolute path navigation to the client main shell, + /// which will display the home tab by default. + void navigateClientHome() { + navigate('/client-main/home'); + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/presentation/pages/client_get_started_page.dart b/apps/mobile/packages/features/client/authentication/lib/src/presentation/pages/client_get_started_page.dart new file mode 100644 index 00000000..0c9f9f3c --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/presentation/pages/client_get_started_page.dart @@ -0,0 +1,254 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import '../navigation/client_auth_navigator.dart'; + +class ClientGetStartedPage extends StatelessWidget { + const ClientGetStartedPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Stack( + children: [ + // Background Illustration/Visuals from prototype + Positioned( + top: -100, + right: -100, + child: Container( + width: 400, + height: 400, + decoration: BoxDecoration( + color: UiColors.secondary.withAlpha(50), + shape: BoxShape.circle, + ), + ), + ), + + SafeArea( + child: Column( + children: [ + const SizedBox(height: UiConstants.space10), + // Logo + Center( + child: Image.asset( + UiImageAssets.logoBlue, + height: 40, + fit: BoxFit.contain, + ), + ), + + const Spacer(), + + // Content Cards Area (Keeping prototype layout) + Container( + height: 300, + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space6, + ), + child: Stack( + children: [ + // Representative cards from prototype + Positioned( + top: 20, + left: 0, + right: 20, + child: _ShiftOrderCard(), + ), + Positioned( + bottom: 40, + right: 0, + left: 40, + child: _WorkerProfileCard(), + ), + Positioned(top: 60, right: 10, child: _CalendarCard()), + ], + ), + ), + + const Spacer(), + + // Bottom Content + Padding( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space6, + vertical: UiConstants.space10, + ), + child: Column( + children: [ + Text( + t.client_authentication.get_started_page.title, + textAlign: TextAlign.center, + style: UiTypography.displayM, + ), + const SizedBox(height: UiConstants.space3), + Text( + t.client_authentication.get_started_page.subtitle, + textAlign: TextAlign.center, + style: UiTypography.body2r.textSecondary, + ), + const SizedBox(height: UiConstants.space8), + + // Sign In Button + UiButton.primary( + text: t + .client_authentication + .get_started_page + .sign_in_button, + onPressed: () => Modular.to.pushClientSignIn(), + fullWidth: true, + ), + + const SizedBox(height: UiConstants.space3), + + // Create Account Button + UiButton.secondary( + text: t + .client_authentication + .get_started_page + .create_account_button, + onPressed: () => Modular.to.pushClientSignUp(), + fullWidth: true, + ), + ], + ), + ), + ], + ), + ), + ], + ), + ); + } +} + +// Internal Prototype Widgets Updated with Design System Primitives +class _ShiftOrderCard extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space3), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg, + boxShadow: [ + BoxShadow( + color: UiColors.black.withOpacity(0.1), + blurRadius: 10, + offset: const Offset(0, 4), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Row( + children: [ + Container( + padding: const EdgeInsets.all(UiConstants.space1), + decoration: BoxDecoration( + color: UiColors.primary.withOpacity(0.1), + shape: BoxShape.circle, + ), + child: const Icon( + UiIcons.briefcase, + size: 14, + color: UiColors.primary, + ), + ), + const SizedBox(width: UiConstants.space2), + Text('Shift Order #824', style: UiTypography.footnote1b), + const Spacer(), + Container( + padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2), + decoration: BoxDecoration( + color: UiColors.tagPending, + borderRadius: UiConstants.radiusFull, + ), + child: Text( + 'Pending', + style: UiTypography.footnote2m.copyWith( + color: UiColors.textWarning, + ), + ), + ), + ], + ), + const SizedBox(height: UiConstants.space2), + Text( + 'Event Staffing - Hilton Hotel', + style: UiTypography.footnote2r.textSecondary, + ), + ], + ), + ); + } +} + +class _WorkerProfileCard extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space3), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg, + boxShadow: [ + BoxShadow( + color: UiColors.black.withOpacity(0.1), + blurRadius: 10, + offset: const Offset(0, 4), + ), + ], + ), + child: Row( + children: [ + CircleAvatar( + radius: 16, + backgroundColor: UiColors.primary.withOpacity(0.1), + child: const Icon(UiIcons.user, size: 16, color: UiColors.primary), + ), + const SizedBox(width: UiConstants.space2), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text('Alex Thompson', style: UiTypography.footnote1b), + Text( + 'Professional Waiter β€’ 4.9β˜…', + style: UiTypography.footnote2r.textSecondary, + ), + ], + ), + ], + ), + ); + } +} + +class _CalendarCard extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space2), + decoration: BoxDecoration( + color: UiColors.accent, + borderRadius: UiConstants.radiusMd, + boxShadow: [ + BoxShadow( + color: UiColors.black.withOpacity(0.1), + blurRadius: 10, + offset: const Offset(4, 4), + ), + ], + ), + child: const Icon( + UiIcons.calendar, + size: 20, + color: UiColors.accentForeground, + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/presentation/pages/client_sign_in_page.dart b/apps/mobile/packages/features/client/authentication/lib/src/presentation/pages/client_sign_in_page.dart new file mode 100644 index 00000000..6bde0059 --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/presentation/pages/client_sign_in_page.dart @@ -0,0 +1,128 @@ +import 'package:client_authentication/src/presentation/widgets/common/section_titles.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; + +import '../blocs/client_auth_bloc.dart'; +import '../blocs/client_auth_event.dart'; +import '../blocs/client_auth_state.dart'; +import '../navigation/client_auth_navigator.dart'; +import '../widgets/client_sign_in_page/client_sign_in_form.dart'; +import '../widgets/common/auth_divider.dart'; +import '../widgets/common/auth_social_button.dart'; + +/// Page for client users to sign in to their account. +/// +/// This page provides email/password authentication as well as social sign-in +/// options via Apple and Google. It matches the design system standards +/// for client-facing authentication flows. +class ClientSignInPage extends StatelessWidget { + /// Creates a [ClientSignInPage]. + const ClientSignInPage({super.key}); + + /// Dispatches the sign in event to the BLoC. + void _handleSignIn( + BuildContext context, { + required String email, + required String password, + }) { + BlocProvider.of( + context, + ).add(ClientSignInRequested(email: email, password: password)); + } + + @override + Widget build(BuildContext context) { + final TranslationsClientAuthenticationSignInPageEn i18n = t.client_authentication.sign_in_page; + final ClientAuthBloc authBloc = Modular.get(); + + return BlocProvider.value( + value: authBloc, + child: BlocConsumer( + listener: (BuildContext context, ClientAuthState state) { + if (state.status == ClientAuthStatus.authenticated) { + Modular.to.navigateClientHome(); + } else if (state.status == ClientAuthStatus.error) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text(state.errorMessage ?? 'Authentication Error'), + ), + ); + } + }, + builder: (BuildContext context, ClientAuthState state) { + final bool isLoading = state.status == ClientAuthStatus.loading; + + return Scaffold( + appBar: const UiAppBar(showBackButton: true), + body: SafeArea( + bottom: false, + child: Padding( + padding: const EdgeInsets.fromLTRB( + UiConstants.space6, + UiConstants.space8, + UiConstants.space6, + 0, + ), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + SectionTitle(title: i18n.title, subtitle: i18n.subtitle), + const SizedBox(height: UiConstants.space8), + + // Sign In Form + ClientSignInForm( + isLoading: isLoading, + onSignIn: ({required String email, required String password}) => + _handleSignIn( + context, + email: email, + password: password, + ), + ), + + const SizedBox(height: UiConstants.space6), + + // Divider + AuthDivider(text: i18n.or_divider), + + const SizedBox(height: UiConstants.space6), + + /// TODO: FEATURE_NOT_YET_IMPLEMENTED + // Social Sign-In Buttons + + const SizedBox(height: UiConstants.space8), + + // Sign Up Link + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + i18n.no_account, + style: UiTypography.body2r.textSecondary, + ), + const SizedBox(width: UiConstants.space1), + GestureDetector( + onTap: () => Modular.to.pushClientSignUp(), + child: Text( + i18n.sign_up_link, + style: UiTypography.body2m.textLink, + ), + ), + ], + ), + const SizedBox(height: UiConstants.space10), + ], + ), + ), + ), + ), + ); + }, + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/presentation/pages/client_sign_up_page.dart b/apps/mobile/packages/features/client/authentication/lib/src/presentation/pages/client_sign_up_page.dart new file mode 100644 index 00000000..0df74969 --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/presentation/pages/client_sign_up_page.dart @@ -0,0 +1,137 @@ +import 'package:client_authentication/src/presentation/widgets/common/section_titles.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; + +import '../blocs/client_auth_bloc.dart'; +import '../blocs/client_auth_event.dart'; +import '../blocs/client_auth_state.dart'; +import '../navigation/client_auth_navigator.dart'; +import '../widgets/client_sign_up_page/client_sign_up_form.dart'; +import '../widgets/common/auth_divider.dart'; +import '../widgets/common/auth_social_button.dart'; + +/// Page for client users to sign up for a new account. +/// +/// This page collects company details, email, and password, and offers +/// social sign-up options. It adheres to the design system standards. +class ClientSignUpPage extends StatelessWidget { + /// Creates a [ClientSignUpPage]. + const ClientSignUpPage({super.key}); + + /// Validates inputs and dispatches the sign up event. + void _handleSignUp( + BuildContext context, { + required String companyName, + required String email, + required String password, + }) { + BlocProvider.of(context).add( + ClientSignUpRequested( + companyName: companyName, + email: email, + password: password, + ), + ); + } + + @override + Widget build(BuildContext context) { + final TranslationsClientAuthenticationSignUpPageEn i18n = t.client_authentication.sign_up_page; + final ClientAuthBloc authBloc = Modular.get(); + + return BlocProvider.value( + value: authBloc, + child: BlocConsumer( + listener: (BuildContext context, ClientAuthState state) { + if (state.status == ClientAuthStatus.authenticated) { + Modular.to.navigateClientHome(); + } else if (state.status == ClientAuthStatus.error) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text(state.errorMessage ?? 'Authentication Error'), + ), + ); + } + }, + builder: (BuildContext context, ClientAuthState state) { + final bool isLoading = state.status == ClientAuthStatus.loading; + + return Scaffold( + appBar: const UiAppBar(showBackButton: true), + body: SafeArea( + bottom: false, + child: Padding( + padding: const EdgeInsets.fromLTRB( + UiConstants.space6, + UiConstants.space8, + UiConstants.space6, + 0, + ), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + SectionTitle(title: i18n.title, subtitle: i18n.subtitle), + const SizedBox(height: UiConstants.space8), + + // Sign Up Form + ClientSignUpForm( + isLoading: isLoading, + onSignUp: + ({ + required String companyName, + required String email, + required String password, + }) => _handleSignUp( + context, + companyName: companyName, + email: email, + password: password, + ), + ), + + const SizedBox(height: UiConstants.space6), + + // Divider + AuthDivider(text: i18n.or_divider), + + const SizedBox(height: UiConstants.space6), + + /// TODO: FEATURE_NOT_YET_IMPLEMENTED + // Social Sign-In Buttons in register page + + const SizedBox(height: UiConstants.space8), + + // Sign In Link + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + i18n.has_account, + style: UiTypography.body2r.textSecondary, + ), + const SizedBox(width: UiConstants.space1), + GestureDetector( + onTap: () => Modular.to.pushClientSignIn(), + child: Text( + i18n.sign_in_link, + style: UiTypography.body2m.textLink, + ), + ), + ], + ), + const SizedBox(height: UiConstants.space10), + ], + ), + ), + ), + ), + ); + }, + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/client_sign_in_page/client_sign_in_form.dart b/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/client_sign_in_page/client_sign_in_form.dart new file mode 100644 index 00000000..bfa0a737 --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/client_sign_in_page/client_sign_in_form.dart @@ -0,0 +1,114 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A form widget for client sign-in. +/// +/// This widget handles user input for email and password and delegates +/// authentication events to the parent via callbacks. +class ClientSignInForm extends StatefulWidget { + /// Callback when the sign-in button is pressed. + final void Function({required String email, required String password}) + onSignIn; + + /// Whether the authentication is currently loading. + final bool isLoading; + + /// Creates a [ClientSignInForm]. + const ClientSignInForm({ + super.key, + required this.onSignIn, + this.isLoading = false, + }); + + @override + State createState() => _ClientSignInFormState(); +} + +class _ClientSignInFormState extends State { + final TextEditingController _emailController = TextEditingController(); + final TextEditingController _passwordController = TextEditingController(); + bool _obscurePassword = true; + + @override + void dispose() { + _emailController.dispose(); + _passwordController.dispose(); + super.dispose(); + } + + void _handleSubmit() { + widget.onSignIn( + email: _emailController.text, + password: _passwordController.text, + ); + } + + @override + Widget build(BuildContext context) { + final TranslationsClientAuthenticationSignInPageEn i18n = t.client_authentication.sign_in_page; + + return Column( + children: [ + // Email Field + UiTextField( + label: i18n.email_label, + hintText: i18n.email_hint, + controller: _emailController, + keyboardType: TextInputType.emailAddress, + ), + const SizedBox(height: UiConstants.space5), + + // Password Field + UiTextField( + label: i18n.password_label, + hintText: i18n.password_hint, + controller: _passwordController, + obscureText: _obscurePassword, + suffix: IconButton( + icon: Icon( + _obscurePassword ? UiIcons.eyeOff : UiIcons.eye, + color: UiColors.iconSecondary, + size: 20, + ), + onPressed: () => + setState(() => _obscurePassword = !_obscurePassword), + ), + ), + + const SizedBox(height: UiConstants.space2), + + // Forgot Password + Align( + alignment: Alignment.centerLeft, + child: GestureDetector( + onTap: () {}, + child: Text( + i18n.forgot_password, + style: UiTypography.body2r.textLink, + ), + ), + ), + + const SizedBox(height: UiConstants.space8), + + // Sign In Button + UiButton.primary( + text: widget.isLoading ? null : i18n.sign_in_button, + onPressed: widget.isLoading ? null : _handleSubmit, + fullWidth: true, + child: widget.isLoading + ? const SizedBox( + height: 24, + width: 24, + child: CircularProgressIndicator( + color: UiColors.white, + strokeWidth: 2, + ), + ) + : null, + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/client_sign_up_page/client_sign_up_form.dart b/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/client_sign_up_page/client_sign_up_form.dart new file mode 100644 index 00000000..504d2db8 --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/client_sign_up_page/client_sign_up_form.dart @@ -0,0 +1,138 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A form widget for client sign-up. +/// +/// This widget handles user input for company name, email, and password, +/// and delegates registration events to the parent via callbacks. +class ClientSignUpForm extends StatefulWidget { + /// Callback when the sign-up button is pressed. + final void Function({ + required String companyName, + required String email, + required String password, + }) + onSignUp; + + /// Whether the authentication is currently loading. + final bool isLoading; + + /// Creates a [ClientSignUpForm]. + const ClientSignUpForm({ + super.key, + required this.onSignUp, + this.isLoading = false, + }); + + @override + State createState() => _ClientSignUpFormState(); +} + +class _ClientSignUpFormState extends State { + final TextEditingController _companyController = TextEditingController(); + final TextEditingController _emailController = TextEditingController(); + final TextEditingController _passwordController = TextEditingController(); + final TextEditingController _confirmPasswordController = TextEditingController(); + bool _obscurePassword = true; + + @override + void dispose() { + _companyController.dispose(); + _emailController.dispose(); + _passwordController.dispose(); + _confirmPasswordController.dispose(); + super.dispose(); + } + + void _handleSubmit() { + if (_passwordController.text != _confirmPasswordController.text) { + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('Passwords do not match'))); + return; + } + + widget.onSignUp( + companyName: _companyController.text, + email: _emailController.text, + password: _passwordController.text, + ); + } + + @override + Widget build(BuildContext context) { + final TranslationsClientAuthenticationSignUpPageEn i18n = t.client_authentication.sign_up_page; + + return Column( + children: [ + // Company Name Field + UiTextField( + label: i18n.company_label, + hintText: i18n.company_hint, + controller: _companyController, + textInputAction: TextInputAction.next, + ), + const SizedBox(height: UiConstants.space4), + + // Email Field + UiTextField( + label: i18n.email_label, + hintText: i18n.email_hint, + controller: _emailController, + keyboardType: TextInputType.emailAddress, + textInputAction: TextInputAction.next, + ), + const SizedBox(height: UiConstants.space4), + + // Password Field + UiTextField( + label: i18n.password_label, + hintText: i18n.password_hint, + controller: _passwordController, + obscureText: _obscurePassword, + textInputAction: TextInputAction.next, + suffix: IconButton( + icon: Icon( + _obscurePassword ? UiIcons.eyeOff : UiIcons.eye, + color: UiColors.iconSecondary, + size: 20, + ), + onPressed: () => + setState(() => _obscurePassword = !_obscurePassword), + ), + ), + const SizedBox(height: UiConstants.space4), + + // Confirm Password Field + UiTextField( + label: i18n.confirm_password_label, + hintText: i18n.confirm_password_hint, + controller: _confirmPasswordController, + obscureText: _obscurePassword, + textInputAction: TextInputAction.done, + onSubmitted: (_) => _handleSubmit(), + ), + + const SizedBox(height: UiConstants.space8), + + // Create Account Button + UiButton.primary( + text: widget.isLoading ? null : i18n.create_account_button, + onPressed: widget.isLoading ? null : _handleSubmit, + fullWidth: true, + child: widget.isLoading + ? const SizedBox( + height: 24, + width: 24, + child: CircularProgressIndicator( + color: UiColors.white, + strokeWidth: 2, + ), + ) + : null, + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/common/auth_divider.dart b/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/common/auth_divider.dart new file mode 100644 index 00000000..66148a8e --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/common/auth_divider.dart @@ -0,0 +1,28 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A divider widget with centered text, typically used to separate +/// email/password auth from social auth headers. +/// +/// Displays a horizontal line with text in the middle (e.g., "Or continue with"). +class AuthDivider extends StatelessWidget { + /// The text to display in the center of the divider. + final String text; + + /// Creates an [AuthDivider]. + const AuthDivider({super.key, required this.text}); + + @override + Widget build(BuildContext context) { + return Row( + children: [ + const Expanded(child: Divider()), + Padding( + padding: const EdgeInsets.symmetric(horizontal: UiConstants.space4), + child: Text(text, style: UiTypography.footnote1r.textSecondary), + ), + const Expanded(child: Divider()), + ], + ); + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/common/auth_social_button.dart b/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/common/auth_social_button.dart new file mode 100644 index 00000000..35b8a4cc --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/common/auth_social_button.dart @@ -0,0 +1,38 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A specialized button for social authentication integration. +/// +/// This widget wraps [UiButton.secondary] to provide a consistent look and feel +/// for social sign-in/sign-up buttons (e.g., Google, Apple). +class AuthSocialButton extends StatelessWidget { + /// The localizable text to display on the button (e.g., "Continue with Google"). + final String text; + + /// The icon representing the social provider. + final IconData icon; + + /// Callback to execute when the button is tapped. + final VoidCallback onPressed; + + /// Creates an [AuthSocialButton]. + /// + /// The [text], [icon], and [onPressed] arguments must not be null. + const AuthSocialButton({ + super.key, + required this.text, + required this.icon, + required this.onPressed, + }); + + @override + Widget build(BuildContext context) { + return UiButton.secondary( + onPressed: onPressed, + leadingIcon: icon, + text: text, + // Ensure the button spans the full width available + size: UiButtonSize.large, + ); + } +} diff --git a/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/common/section_titles.dart b/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/common/section_titles.dart new file mode 100644 index 00000000..67243de8 --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/lib/src/presentation/widgets/common/section_titles.dart @@ -0,0 +1,24 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A widget that displays a section title with a leading icon. +class SectionTitle extends StatelessWidget { + /// The title of the section. + final String title; + + /// The subtitle of the section. + final String subtitle; + + const SectionTitle({super.key, required this.title, required this.subtitle}); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(title, style: UiTypography.headline1m), + Text(subtitle, style: UiTypography.body2r.textSecondary), + ], + ); + } +} diff --git a/apps/mobile/packages/features/client/authentication/pubspec.yaml b/apps/mobile/packages/features/client/authentication/pubspec.yaml new file mode 100644 index 00000000..a70cf83a --- /dev/null +++ b/apps/mobile/packages/features/client/authentication/pubspec.yaml @@ -0,0 +1,39 @@ +name: client_authentication +description: Client Authentication and Registration feature. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + flutter_modular: ^6.3.0 + equatable: ^2.0.5 + firebase_core: ^4.2.1 + firebase_auth: ^6.1.2 # Updated for compatibility + firebase_data_connect: ^0.2.2+1 + + # Architecture Packages + design_system: + path: ../../../design_system + core_localization: + path: ../../../core_localization + krow_data_connect: + path: ../../../data_connect + krow_domain: + path: ../../../domain + +dev_dependencies: + flutter_test: + sdk: flutter + bloc_test: ^9.1.0 + mocktail: ^1.0.0 + build_runner: ^2.4.15 + +flutter: + uses-material-design: true diff --git a/apps/mobile/packages/features/client/billing/lib/billing.dart b/apps/mobile/packages/features/client/billing/lib/billing.dart new file mode 100644 index 00000000..a4a659c9 --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/billing.dart @@ -0,0 +1,4 @@ +library; + +export 'src/presentation/navigation/billing_navigator.dart'; +export 'src/billing_module.dart'; diff --git a/apps/mobile/packages/features/client/billing/lib/src/billing_module.dart b/apps/mobile/packages/features/client/billing/lib/src/billing_module.dart new file mode 100644 index 00000000..a5debe5a --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/billing_module.dart @@ -0,0 +1,56 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; + +import 'data/repositories_impl/billing_repository_impl.dart'; +import 'domain/repositories/billing_repository.dart'; +import 'domain/usecases/get_current_bill_amount.dart'; +import 'domain/usecases/get_invoice_history.dart'; +import 'domain/usecases/get_pending_invoices.dart'; +import 'domain/usecases/get_savings_amount.dart'; +import 'domain/usecases/get_spending_breakdown.dart'; +import 'presentation/blocs/billing_bloc.dart'; + +/// Modular module for the billing feature. +class BillingModule extends Module { + @override + void binds(Injector i) { + // External Dependencies (Mocks from data_connect) + // In a real app, these would likely be provided by a Core module or similar. + i.addSingleton(FinancialRepositoryMock.new); + + // Repositories + i.addSingleton( + () => BillingRepositoryImpl( + financialRepository: i.get(), + ), + ); + + // Use Cases + i.addSingleton(GetCurrentBillAmountUseCase.new); + i.addSingleton(GetSavingsAmountUseCase.new); + i.addSingleton(GetPendingInvoicesUseCase.new); + i.addSingleton(GetInvoiceHistoryUseCase.new); + i.addSingleton(GetSpendingBreakdownUseCase.new); + + // BLoCs + i.addSingleton( + () => BillingBloc( + getCurrentBillAmount: i.get(), + getSavingsAmount: i.get(), + getPendingInvoices: i.get(), + getInvoiceHistory: i.get(), + getSpendingBreakdown: i.get(), + ), + ); + } + + @override + void routes(RouteManager r) { + r.child("/", child: (_) => const SizedBox( + child: Center(child: Text('Feature not yet implemented')), + )); + /// TODO: FEATURE_NOT_YET_IMPLEMENTED + // r.child('/', child: (_) => const BillingPage()); + } +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/data/repositories_impl/billing_repository_impl.dart b/apps/mobile/packages/features/client/billing/lib/src/data/repositories_impl/billing_repository_impl.dart new file mode 100644 index 00000000..ad600730 --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/data/repositories_impl/billing_repository_impl.dart @@ -0,0 +1,80 @@ +import 'package:krow_data_connect/krow_data_connect.dart' as data_connect; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/repositories/billing_repository.dart'; + +/// Implementation of [BillingRepository] in the Data layer. +/// +/// This class is responsible for retrieving billing data from the [FinancialRepositoryMock] +/// (which represents the Data Connect layer) and mapping it to Domain entities. +/// +/// It strictly adheres to the Clean Architecture data layer responsibilities: +/// - No business logic (except necessary data transformation/filtering). +/// - Delegates to data sources. +class BillingRepositoryImpl implements BillingRepository { + /// Creates a [BillingRepositoryImpl]. + /// + /// Requires the [financialRepository] to fetch financial data. + BillingRepositoryImpl({ + required data_connect.FinancialRepositoryMock financialRepository, + }) : _financialRepository = financialRepository; + + final data_connect.FinancialRepositoryMock _financialRepository; + + /// Fetches the current bill amount by aggregating open invoices. + @override + Future getCurrentBillAmount() async { + // In a real app, this might be an aggregate query. + // Simulating fetching invoices and summing up. + final List invoices = await _financialRepository.getInvoices( + 'current_business', + ); + return invoices + .where((Invoice i) => i.status == InvoiceStatus.open) + .fold( + 0.0, + (double sum, Invoice item) => sum + item.totalAmount, + ); + } + + /// Fetches the history of paid invoices. + @override + Future> getInvoiceHistory() async { + final List invoices = await _financialRepository.getInvoices( + 'current_business', + ); + return invoices + .where((Invoice i) => i.status == InvoiceStatus.paid) + .toList(); + } + + /// Fetches pending invoices (Open or Disputed). + @override + Future> getPendingInvoices() async { + final List invoices = await _financialRepository.getInvoices( + 'current_business', + ); + return invoices + .where( + (Invoice i) => + i.status == InvoiceStatus.open || + i.status == InvoiceStatus.disputed, + ) + .toList(); + } + + /// Fetches the estimated savings amount. + @override + Future getSavingsAmount() async { + // Simulating savings calculation (e.g., comparing to market rates). + await Future.delayed(const Duration(milliseconds: 500)); + return 320.00; + } + + /// Fetches the breakdown of spending. + @override + Future> getSpendingBreakdown() async { + // Assuming breakdown is based on the current period's invoice items. + // We fetch items for a dummy invoice ID representing the current period. + return _financialRepository.getInvoiceItems('current_period_invoice'); + } +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/domain/repositories/billing_repository.dart b/apps/mobile/packages/features/client/billing/lib/src/domain/repositories/billing_repository.dart new file mode 100644 index 00000000..298f3967 --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/domain/repositories/billing_repository.dart @@ -0,0 +1,23 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Repository interface for billing related operations. +/// +/// This interface defines the contract for accessing billing-related data, +/// acting as a boundary between the Domain and Data layers. +/// It allows the Domain layer to remain independent of specific data sources. +abstract class BillingRepository { + /// Fetches invoices that are pending approval or payment. + Future> getPendingInvoices(); + + /// Fetches historically paid invoices. + Future> getInvoiceHistory(); + + /// Fetches the current bill amount for the period. + Future getCurrentBillAmount(); + + /// Fetches the savings amount. + Future getSavingsAmount(); + + /// Fetches invoice items for spending breakdown analysis. + Future> getSpendingBreakdown(); +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_current_bill_amount.dart b/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_current_bill_amount.dart new file mode 100644 index 00000000..ed684bcc --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_current_bill_amount.dart @@ -0,0 +1,16 @@ +import 'package:krow_core/core.dart'; +import '../repositories/billing_repository.dart'; + +/// Use case for fetching the current bill amount. +/// +/// This use case encapsulates the logic for retrieving the total amount due for the current billing period. +/// It delegates the data retrieval to the [BillingRepository]. +class GetCurrentBillAmountUseCase extends NoInputUseCase { + /// Creates a [GetCurrentBillAmountUseCase]. + GetCurrentBillAmountUseCase(this._repository); + + final BillingRepository _repository; + + @override + Future call() => _repository.getCurrentBillAmount(); +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_invoice_history.dart b/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_invoice_history.dart new file mode 100644 index 00000000..a14fd7d3 --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_invoice_history.dart @@ -0,0 +1,17 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/billing_repository.dart'; + +/// Use case for fetching the invoice history. +/// +/// This use case encapsulates the logic for retrieving the list of past paid invoices. +/// It delegates the data retrieval to the [BillingRepository]. +class GetInvoiceHistoryUseCase extends NoInputUseCase> { + /// Creates a [GetInvoiceHistoryUseCase]. + GetInvoiceHistoryUseCase(this._repository); + + final BillingRepository _repository; + + @override + Future> call() => _repository.getInvoiceHistory(); +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_pending_invoices.dart b/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_pending_invoices.dart new file mode 100644 index 00000000..5d8b1f0a --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_pending_invoices.dart @@ -0,0 +1,17 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/billing_repository.dart'; + +/// Use case for fetching the pending invoices. +/// +/// This use case encapsulates the logic for retrieving invoices that are currently open or disputed. +/// It delegates the data retrieval to the [BillingRepository]. +class GetPendingInvoicesUseCase extends NoInputUseCase> { + /// Creates a [GetPendingInvoicesUseCase]. + GetPendingInvoicesUseCase(this._repository); + + final BillingRepository _repository; + + @override + Future> call() => _repository.getPendingInvoices(); +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_savings_amount.dart b/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_savings_amount.dart new file mode 100644 index 00000000..9f6b038f --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_savings_amount.dart @@ -0,0 +1,16 @@ +import 'package:krow_core/core.dart'; +import '../repositories/billing_repository.dart'; + +/// Use case for fetching the savings amount. +/// +/// This use case encapsulates the logic for retrieving the estimated savings for the client. +/// It delegates the data retrieval to the [BillingRepository]. +class GetSavingsAmountUseCase extends NoInputUseCase { + /// Creates a [GetSavingsAmountUseCase]. + GetSavingsAmountUseCase(this._repository); + + final BillingRepository _repository; + + @override + Future call() => _repository.getSavingsAmount(); +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_spending_breakdown.dart b/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_spending_breakdown.dart new file mode 100644 index 00000000..5c2240ac --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/domain/usecases/get_spending_breakdown.dart @@ -0,0 +1,17 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/billing_repository.dart'; + +/// Use case for fetching the spending breakdown items. +/// +/// This use case encapsulates the logic for retrieving the spending breakdown by category or item. +/// It delegates the data retrieval to the [BillingRepository]. +class GetSpendingBreakdownUseCase extends NoInputUseCase> { + /// Creates a [GetSpendingBreakdownUseCase]. + GetSpendingBreakdownUseCase(this._repository); + + final BillingRepository _repository; + + @override + Future> call() => _repository.getSpendingBreakdown(); +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/presentation/blocs/billing_bloc.dart b/apps/mobile/packages/features/client/billing/lib/src/presentation/blocs/billing_bloc.dart new file mode 100644 index 00000000..e9553796 --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/presentation/blocs/billing_bloc.dart @@ -0,0 +1,135 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/usecases/get_current_bill_amount.dart'; +import '../../domain/usecases/get_invoice_history.dart'; +import '../../domain/usecases/get_pending_invoices.dart'; +import '../../domain/usecases/get_savings_amount.dart'; +import '../../domain/usecases/get_spending_breakdown.dart'; +import '../models/billing_invoice_model.dart'; +import '../models/spending_breakdown_model.dart'; +import 'billing_event.dart'; +import 'billing_state.dart'; + +/// BLoC for managing billing state and data loading. +class BillingBloc extends Bloc { + /// Creates a [BillingBloc] with the given use cases. + BillingBloc({ + required GetCurrentBillAmountUseCase getCurrentBillAmount, + required GetSavingsAmountUseCase getSavingsAmount, + required GetPendingInvoicesUseCase getPendingInvoices, + required GetInvoiceHistoryUseCase getInvoiceHistory, + required GetSpendingBreakdownUseCase getSpendingBreakdown, + }) : _getCurrentBillAmount = getCurrentBillAmount, + _getSavingsAmount = getSavingsAmount, + _getPendingInvoices = getPendingInvoices, + _getInvoiceHistory = getInvoiceHistory, + _getSpendingBreakdown = getSpendingBreakdown, + super(const BillingState()) { + on(_onLoadStarted); + } + + final GetCurrentBillAmountUseCase _getCurrentBillAmount; + final GetSavingsAmountUseCase _getSavingsAmount; + final GetPendingInvoicesUseCase _getPendingInvoices; + final GetInvoiceHistoryUseCase _getInvoiceHistory; + final GetSpendingBreakdownUseCase _getSpendingBreakdown; + + Future _onLoadStarted( + BillingLoadStarted event, + Emitter emit, + ) async { + emit(state.copyWith(status: BillingStatus.loading)); + try { + final List results = await Future.wait(>[ + _getCurrentBillAmount.call(), + _getSavingsAmount.call(), + _getPendingInvoices.call(), + _getInvoiceHistory.call(), + _getSpendingBreakdown.call(), + ]); + + final double currentBill = results[0] as double; + final double savings = results[1] as double; + final List pendingInvoices = results[2] as List; + final List invoiceHistory = results[3] as List; + final List spendingItems = results[4] as List; + + // Map Domain Entities to Presentation Models + final List uiPendingInvoices = pendingInvoices + .map(_mapInvoiceToUiModel) + .toList(); + final List uiInvoiceHistory = invoiceHistory + .map(_mapInvoiceToUiModel) + .toList(); + final List uiSpendingBreakdown = _mapSpendingItemsToUiModel(spendingItems); + + emit( + state.copyWith( + status: BillingStatus.success, + currentBill: currentBill, + savings: savings, + pendingInvoices: uiPendingInvoices, + invoiceHistory: uiInvoiceHistory, + spendingBreakdown: uiSpendingBreakdown, + ), + ); + } catch (e) { + emit( + state.copyWith( + status: BillingStatus.failure, + errorMessage: e.toString(), + ), + ); + } + } + + BillingInvoice _mapInvoiceToUiModel(Invoice invoice) { + // In a real app, fetches related Event/Business names via ID. + // For now, mapping available fields and hardcoding missing UI placeholders. + // Preserving "Existing Behavior" means we show something. + return BillingInvoice( + id: invoice.id, + title: 'Invoice #${invoice.id}', // Placeholder as Invoice lacks title + locationAddress: + 'Location for ${invoice.eventId}', // Placeholder for address + clientName: 'Client ${invoice.businessId}', // Placeholder for client name + date: '2024-01-24', // Placeholder date + totalAmount: invoice.totalAmount, + workersCount: 5, // Placeholder count + totalHours: invoice.workAmount / 25.0, // Estimating hours from amount + status: invoice.status.name, + ); + } + + List _mapSpendingItemsToUiModel( + List items, + ) { + // Aggregating items by some logic. + // Since InvoiceItem doesn't have category, we mock it based on staffId or similar. + final Map aggregation = {}; + + for (final InvoiceItem item in items) { + // Mocking category derivation + final String category = item.staffId.hashCode % 2 == 0 + ? 'Server Staff' + : 'Bar Staff'; + + final SpendingBreakdownItem? existing = aggregation[category]; + if (existing != null) { + aggregation[category] = SpendingBreakdownItem( + category: category, + hours: existing.hours + item.workHours.round(), + amount: existing.amount + item.amount, + ); + } else { + aggregation[category] = SpendingBreakdownItem( + category: category, + hours: item.workHours.round(), + amount: item.amount, + ); + } + } + + return aggregation.values.toList(); + } +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/presentation/blocs/billing_event.dart b/apps/mobile/packages/features/client/billing/lib/src/presentation/blocs/billing_event.dart new file mode 100644 index 00000000..661ecd9e --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/presentation/blocs/billing_event.dart @@ -0,0 +1,16 @@ +import 'package:equatable/equatable.dart'; + +/// Base class for all billing events. +abstract class BillingEvent extends Equatable { + /// Creates a [BillingEvent]. + const BillingEvent(); + + @override + List get props => []; +} + +/// Event triggered when billing data needs to be loaded. +class BillingLoadStarted extends BillingEvent { + /// Creates a [BillingLoadStarted] event. + const BillingLoadStarted(); +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/presentation/blocs/billing_state.dart b/apps/mobile/packages/features/client/billing/lib/src/presentation/blocs/billing_state.dart new file mode 100644 index 00000000..c2da7008 --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/presentation/blocs/billing_state.dart @@ -0,0 +1,85 @@ +import 'package:equatable/equatable.dart'; +import '../models/billing_invoice_model.dart'; +import '../models/spending_breakdown_model.dart'; + +/// The loading status of the billing feature. +enum BillingStatus { + /// Page hasn't started loading. + initial, + + /// Data is currently being fetched. + loading, + + /// Data loaded successfully. + success, + + /// Loading failed. + failure, +} + +/// Represents the state of the billing feature. +class BillingState extends Equatable { + /// Creates a [BillingState]. + const BillingState({ + this.status = BillingStatus.initial, + this.currentBill = 0.0, + this.savings = 0.0, + this.pendingInvoices = const [], + this.invoiceHistory = const [], + this.spendingBreakdown = const [], + this.errorMessage, + }); + + /// The current feature status. + final BillingStatus status; + + /// The total amount for the current billing period. + final double currentBill; + + /// Total savings achieved compared to traditional agencies. + final double savings; + + /// Invoices awaiting client approval. + final List pendingInvoices; + + /// History of paid invoices. + final List invoiceHistory; + + /// Breakdown of spending by category. + final List spendingBreakdown; + + /// Error message if loading failed. + final String? errorMessage; + + /// Creates a copy of this state with updated fields. + BillingState copyWith({ + BillingStatus? status, + double? currentBill, + double? savings, + List? pendingInvoices, + List? invoiceHistory, + List? spendingBreakdown, + String? errorMessage, + }) { + return BillingState( + status: status ?? this.status, + currentBill: currentBill ?? this.currentBill, + savings: savings ?? this.savings, + pendingInvoices: pendingInvoices ?? this.pendingInvoices, + invoiceHistory: invoiceHistory ?? this.invoiceHistory, + spendingBreakdown: spendingBreakdown ?? this.spendingBreakdown, + errorMessage: errorMessage ?? this.errorMessage, + ); + } + + @override + List get props => [ + status, + currentBill, + savings, + pendingInvoices, + invoiceHistory, + spendingBreakdown, + errorMessage, + ]; +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/presentation/models/billing_invoice_model.dart b/apps/mobile/packages/features/client/billing/lib/src/presentation/models/billing_invoice_model.dart new file mode 100644 index 00000000..b44c7367 --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/presentation/models/billing_invoice_model.dart @@ -0,0 +1,38 @@ +import 'package:equatable/equatable.dart'; + +class BillingInvoice extends Equatable { + const BillingInvoice({ + required this.id, + required this.title, + required this.locationAddress, + required this.clientName, + required this.date, + required this.totalAmount, + required this.workersCount, + required this.totalHours, + required this.status, + }); + + final String id; + final String title; + final String locationAddress; + final String clientName; + final String date; + final double totalAmount; + final int workersCount; + final double totalHours; + final String status; + + @override + List get props => [ + id, + title, + locationAddress, + clientName, + date, + totalAmount, + workersCount, + totalHours, + status, + ]; +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/presentation/models/spending_breakdown_model.dart b/apps/mobile/packages/features/client/billing/lib/src/presentation/models/spending_breakdown_model.dart new file mode 100644 index 00000000..4fc32313 --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/presentation/models/spending_breakdown_model.dart @@ -0,0 +1,23 @@ +import 'package:equatable/equatable.dart'; + +/// Represents a single item in the spending breakdown. +class SpendingBreakdownItem extends Equatable { + /// Creates a [SpendingBreakdownItem]. + const SpendingBreakdownItem({ + required this.category, + required this.hours, + required this.amount, + }); + + /// The category name (e.g., "Server Staff"). + final String category; + + /// The total hours worked in this category. + final int hours; + + /// The total amount spent in this category. + final double amount; + + @override + List get props => [category, hours, amount]; +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/presentation/navigation/billing_navigator.dart b/apps/mobile/packages/features/client/billing/lib/src/presentation/navigation/billing_navigator.dart new file mode 100644 index 00000000..a0fee8aa --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/presentation/navigation/billing_navigator.dart @@ -0,0 +1,7 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +/// Extension on [IModularNavigator] to provide typed navigation for the billing feature. +extension BillingNavigator on IModularNavigator { + /// Navigates to the billing page. + void pushBilling() => pushNamed('/billing/'); +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/presentation/pages/billing_page.dart b/apps/mobile/packages/features/client/billing/lib/src/presentation/pages/billing_page.dart new file mode 100644 index 00000000..8fb39115 --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/presentation/pages/billing_page.dart @@ -0,0 +1,99 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import '../blocs/billing_bloc.dart'; +import '../blocs/billing_event.dart'; +import '../blocs/billing_state.dart'; +import '../widgets/billing_header.dart'; +import '../widgets/pending_invoices_section.dart'; +import '../widgets/payment_method_card.dart'; +import '../widgets/spending_breakdown_card.dart'; +import '../widgets/savings_card.dart'; +import '../widgets/invoice_history_section.dart'; +import '../widgets/export_invoices_button.dart'; + +/// The entry point page for the client billing feature. +/// +/// This page initializes the [BillingBloc] and provides it to the [BillingView]. +class BillingPage extends StatelessWidget { + /// Creates a [BillingPage]. + const BillingPage({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (BuildContext context) => + Modular.get()..add(const BillingLoadStarted()), + child: const BillingView(), + ); + } +} + +/// The main view for the client billing feature. +/// +/// This widget displays the billing dashboard content based on the current +/// state of the [BillingBloc]. +class BillingView extends StatelessWidget { + /// Creates a [BillingView]. + const BillingView({super.key}); + + @override + Widget build(BuildContext context) { + return BlocBuilder( + builder: (BuildContext context, BillingState state) { + return Scaffold( + backgroundColor: UiColors.bgPrimary, + body: Column( + children: [ + BillingHeader( + currentBill: state.currentBill, + savings: state.savings, + onBack: () => Modular.to.pop(), + ), + Expanded(child: _buildContent(context, state)), + ], + ), + ); + }, + ); + } + + Widget _buildContent(BuildContext context, BillingState state) { + if (state.status == BillingStatus.loading) { + return const Center(child: CircularProgressIndicator()); + } + + if (state.status == BillingStatus.failure) { + return Center( + child: Text( + state.errorMessage ?? 'An error occurred', + style: UiTypography.body1r.textError, + ), + ); + } + + return SingleChildScrollView( + padding: const EdgeInsets.all(UiConstants.space5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (state.pendingInvoices.isNotEmpty) ...[ + PendingInvoicesSection(invoices: state.pendingInvoices), + const SizedBox(height: UiConstants.space4), + ], + const PaymentMethodCard(), + const SizedBox(height: UiConstants.space4), + const SpendingBreakdownCard(), + const SizedBox(height: UiConstants.space4), + SavingsCard(savings: state.savings), + const SizedBox(height: UiConstants.space6), + InvoiceHistorySection(invoices: state.invoiceHistory), + const SizedBox(height: UiConstants.space6), + const ExportInvoicesButton(), + const SizedBox(height: UiConstants.space6), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/billing_header.dart b/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/billing_header.dart new file mode 100644 index 00000000..0ae3bc32 --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/billing_header.dart @@ -0,0 +1,97 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// Header for the billing page showing current period total and savings. +class BillingHeader extends StatelessWidget { + /// Creates a [BillingHeader]. + const BillingHeader({ + required this.currentBill, + required this.savings, + required this.onBack, + super.key, + }); + + /// The amount of the current bill. + final double currentBill; + + /// The amount saved in the current period. + final double savings; + + /// Callback when the back button is pressed. + final VoidCallback onBack; + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.fromLTRB( + UiConstants.space5, + MediaQuery.of(context).padding.top + UiConstants.space4, + UiConstants.space5, + UiConstants.space5, + ), + color: UiColors.primary, + child: Column( + children: [ + Row( + children: [ + UiIconButton.secondary(icon: UiIcons.arrowLeft, onTap: onBack), + const SizedBox(width: UiConstants.space3), + Text( + t.client_billing.title, + style: UiTypography.headline4m.copyWith(color: UiColors.white), + ), + ], + ), + const SizedBox(height: UiConstants.space5), + Column( + children: [ + Text( + t.client_billing.current_period, + style: UiTypography.footnote2r.copyWith( + color: UiColors.white.withValues(alpha: 0.7), + ), + ), + const SizedBox(height: UiConstants.space1), + Text( + '\$${currentBill.toStringAsFixed(2)}', + style: UiTypography.display1b.copyWith(color: UiColors.white), + ), + + const SizedBox(height: UiConstants.space2), + Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space2, + vertical: UiConstants.space1, + ), + decoration: BoxDecoration( + color: UiColors.accent, + borderRadius: BorderRadius.circular(100), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Icon( + UiIcons.trendingDown, + size: 12, + color: UiColors.foreground, + ), + const SizedBox(width: UiConstants.space1), + Text( + t.client_billing.saved_amount( + amount: savings.toStringAsFixed(0), + ), + style: UiTypography.footnote2b.copyWith( + color: UiColors.foreground, + ), + ), + ], + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/export_invoices_button.dart b/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/export_invoices_button.dart new file mode 100644 index 00000000..4019ff02 --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/export_invoices_button.dart @@ -0,0 +1,22 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// Button to export all invoices. +class ExportInvoicesButton extends StatelessWidget { + /// Creates an [ExportInvoicesButton]. + const ExportInvoicesButton({super.key}); + + @override + Widget build(BuildContext context) { + return SizedBox( + width: double.infinity, + child: UiButton.secondary( + text: t.client_billing.export_button, + onPressed: () {}, + leadingIcon: UiIcons.download, + size: UiButtonSize.large, + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/invoice_history_section.dart b/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/invoice_history_section.dart new file mode 100644 index 00000000..19f97c47 --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/invoice_history_section.dart @@ -0,0 +1,147 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import '../models/billing_invoice_model.dart'; + +/// Section showing the history of paid invoices. +class InvoiceHistorySection extends StatelessWidget { + /// Creates an [InvoiceHistorySection]. + const InvoiceHistorySection({required this.invoices, super.key}); + + /// The list of historical invoices. + final List invoices; + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + t.client_billing.invoice_history, + style: UiTypography.title2b.textPrimary, + ), + GestureDetector( + onTap: () {}, + child: Row( + children: [ + Text( + t.client_billing.view_all, + style: UiTypography.footnote2b.textPrimary, + ), + const Icon( + UiIcons.chevronRight, + size: 16, + color: UiColors.primary, + ), + ], + ), + ), + ], + ), + const SizedBox(height: UiConstants.space2), + Container( + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: UiColors.black.withValues(alpha: 0.04), + blurRadius: 8, + offset: const Offset(0, 2), + ), + ], + ), + child: Column( + children: invoices.asMap().entries.map(( + MapEntry entry, + ) { + final int index = entry.key; + final BillingInvoice invoice = entry.value; + return Column( + children: [ + if (index > 0) + const Divider(height: 1, color: UiColors.border), + _InvoiceItem(invoice: invoice), + ], + ); + }).toList(), + ), + ), + ], + ); + } +} + +class _InvoiceItem extends StatelessWidget { + const _InvoiceItem({required this.invoice}); + + final BillingInvoice invoice; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(UiConstants.space4), + child: Row( + children: [ + Container( + padding: const EdgeInsets.all(UiConstants.space2), + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: UiConstants.radiusMd, + ), + child: const Icon(UiIcons.file, color: UiColors.primary, size: 20), + ), + const SizedBox(width: UiConstants.space3), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(invoice.id, style: UiTypography.body2b.textPrimary), + Text( + invoice.date, + style: UiTypography.footnote2r.textSecondary, + ), + ], + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + '\$${invoice.totalAmount.toStringAsFixed(2)}', + style: UiTypography.body2b.textPrimary, + ), + const _PaidBadge(), + ], + ), + const SizedBox(width: UiConstants.space2), + const Icon(UiIcons.download, size: 16, color: UiColors.iconSecondary), + ], + ), + ); + } +} + +class _PaidBadge extends StatelessWidget { + const _PaidBadge(); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2), + decoration: BoxDecoration( + color: UiColors.tagSuccess, + borderRadius: BorderRadius.circular(4), + ), + child: Text( + t.client_billing.paid_badge, + style: UiTypography.titleUppercase4b.copyWith( + color: UiColors.iconSuccess, + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/payment_method_card.dart b/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/payment_method_card.dart new file mode 100644 index 00000000..531dc4cf --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/payment_method_card.dart @@ -0,0 +1,111 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// Card showing the current payment method. +class PaymentMethodCard extends StatelessWidget { + /// Creates a [PaymentMethodCard]. + const PaymentMethodCard({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: UiColors.black.withValues(alpha: 0.04), + blurRadius: 8, + offset: const Offset(0, 2), + ), + ], + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + t.client_billing.payment_method, + style: UiTypography.title2b.textPrimary, + ), + GestureDetector( + onTap: () {}, + child: Row( + children: [ + const Icon(UiIcons.add, size: 14, color: UiColors.primary), + const SizedBox(width: 4), + Text( + t.client_billing.add_payment, + style: UiTypography.footnote2b.textPrimary, + ), + ], + ), + ), + ], + ), + const SizedBox(height: UiConstants.space3), + Container( + padding: const EdgeInsets.all(UiConstants.space3), + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: UiConstants.radiusMd, + ), + child: Row( + children: [ + Container( + width: 40, + height: 28, + decoration: BoxDecoration( + color: UiColors.primary, + borderRadius: BorderRadius.circular(4), + ), + child: const Center( + child: Text( + 'VISA', + style: TextStyle( + color: UiColors.white, + fontSize: 10, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + const SizedBox(width: UiConstants.space3), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('β€’β€’β€’β€’ 4242', style: UiTypography.body2b.textPrimary), + Text( + t.client_billing.expires(date: '12/25'), + style: UiTypography.footnote2r.textSecondary, + ), + ], + ), + ), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 6, + vertical: 2, + ), + decoration: BoxDecoration( + color: UiColors.accent, + borderRadius: BorderRadius.circular(4), + ), + child: Text( + t.client_billing.default_badge, + style: UiTypography.titleUppercase4b.textPrimary, + ), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/pending_invoices_section.dart b/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/pending_invoices_section.dart new file mode 100644 index 00000000..5580589f --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/pending_invoices_section.dart @@ -0,0 +1,208 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import '../models/billing_invoice_model.dart'; + +/// Section showing invoices awaiting approval. +class PendingInvoicesSection extends StatelessWidget { + /// Creates a [PendingInvoicesSection]. + const PendingInvoicesSection({required this.invoices, super.key}); + + /// The list of pending invoices. + final List invoices; + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: 8, + height: 8, + decoration: const BoxDecoration( + color: UiColors.textWarning, + shape: BoxShape.circle, + ), + ), + const SizedBox(width: UiConstants.space2), + Text( + t.client_billing.awaiting_approval, + style: UiTypography.title2b.textPrimary, + ), + const SizedBox(width: UiConstants.space2), + Container( + width: 24, + height: 24, + decoration: const BoxDecoration( + color: UiColors.accent, + shape: BoxShape.circle, + ), + child: Center( + child: Text( + '${invoices.length}', + style: UiTypography.footnote2b.textPrimary, + ), + ), + ), + ], + ), + const SizedBox(height: UiConstants.space3), + ...invoices.map( + (BillingInvoice invoice) => Padding( + padding: const EdgeInsets.only(bottom: UiConstants.space2), + child: _PendingInvoiceCard(invoice: invoice), + ), + ), + ], + ); + } +} + +class _PendingInvoiceCard extends StatelessWidget { + const _PendingInvoiceCard({required this.invoice}); + + final BillingInvoice invoice; + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: UiColors.black.withValues(alpha: 0.04), + blurRadius: 8, + offset: const Offset(0, 2), + ), + ], + ), + child: Padding( + padding: const EdgeInsets.all(UiConstants.space4), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + const Icon( + UiIcons.mapPin, + size: 14, + color: UiColors.iconSecondary, + ), + const SizedBox(width: UiConstants.space1), + Expanded( + child: Text( + invoice.locationAddress, + style: UiTypography.footnote2r.textSecondary, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + const SizedBox(height: UiConstants.space1), + Text(invoice.title, style: UiTypography.body2b.textPrimary), + const SizedBox(height: UiConstants.space1), + Row( + children: [ + Text( + invoice.clientName, + style: UiTypography.footnote2r.textSecondary, + ), + const SizedBox(width: UiConstants.space2), + Text('β€’', style: UiTypography.footnote2r.textInactive), + const SizedBox(width: UiConstants.space2), + Text( + invoice.date, + style: UiTypography.footnote2r.textSecondary, + ), + ], + ), + const SizedBox(height: UiConstants.space3), + Row( + children: [ + Container( + width: 6, + height: 6, + decoration: const BoxDecoration( + color: UiColors.textWarning, + shape: BoxShape.circle, + ), + ), + const SizedBox(width: UiConstants.space2), + Text( + t.client_billing.pending_badge, + style: UiTypography.titleUppercase4b.copyWith( + color: UiColors.textWarning, + ), + ), + ], + ), + const SizedBox(height: UiConstants.space4), + Container( + padding: const EdgeInsets.symmetric(vertical: UiConstants.space3), + decoration: const BoxDecoration( + border: Border.symmetric( + horizontal: BorderSide(color: UiColors.border), + ), + ), + child: Row( + children: [ + Expanded( + child: _buildStatItem( + UiIcons.dollar, + '\$${invoice.totalAmount.toStringAsFixed(2)}', + 'Total', + ), + ), + Container(width: 1, height: 30, color: UiColors.border), + Expanded( + child: _buildStatItem( + UiIcons.users, + '${invoice.workersCount}', + 'Workers', + ), + ), + Container(width: 1, height: 30, color: UiColors.border), + Expanded( + child: _buildStatItem( + UiIcons.clock, + invoice.totalHours.toStringAsFixed(1), + 'HRS', + ), + ), + ], + ), + ), + const SizedBox(height: UiConstants.space4), + SizedBox( + width: double.infinity, + child: UiButton.primary( + text: 'Review & Approve', + onPressed: () {}, + size: UiButtonSize.small, + ), + ), + ], + ), + ), + ); + } + + Widget _buildStatItem(IconData icon, String value, String label) { + return Column( + children: [ + Icon(icon, size: 14, color: UiColors.iconSecondary), + const SizedBox(height: 2), + Text(value, style: UiTypography.body2b.textPrimary), + Text( + label.toUpperCase(), + style: UiTypography.titleUppercase4m.textSecondary, + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/savings_card.dart b/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/savings_card.dart new file mode 100644 index 00000000..18ea1dfd --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/savings_card.dart @@ -0,0 +1,79 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// Card showing savings information and rate optimization suggestions. +class SavingsCard extends StatelessWidget { + /// Creates a [SavingsCard]. + const SavingsCard({required this.savings, super.key}); + + /// The estimated savings amount. + final double savings; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space3), + decoration: BoxDecoration( + color: UiColors.accent.withValues(alpha: 0.2), + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.accent), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.all(UiConstants.space2), + decoration: BoxDecoration( + color: UiColors.accent, + borderRadius: UiConstants.radiusMd, + ), + child: const Icon( + UiIcons.trendingDown, + size: 16, + color: UiColors.textPrimary, + ), + ), + const SizedBox(width: UiConstants.space3), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + t.client_billing.rate_optimization_title, + style: UiTypography.body2b.textPrimary, + ), + const SizedBox(height: UiConstants.space1), + Text( + // Using a hardcoded 180 here to match prototype mock or derived value + t.client_billing.rate_optimization_body(amount: 180), + style: UiTypography.footnote2r.textSecondary, + ), + const SizedBox(height: UiConstants.space2), + SizedBox( + height: 28, + child: ElevatedButton( + onPressed: () {}, + style: ElevatedButton.styleFrom( + backgroundColor: UiColors.primary, + foregroundColor: UiColors.white, + elevation: 0, + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space3, + ), + shape: RoundedRectangleBorder( + borderRadius: UiConstants.radiusMd, + ), + textStyle: UiTypography.footnote2b, + ), + child: Text(t.client_billing.view_details), + ), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/spending_breakdown_card.dart b/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/spending_breakdown_card.dart new file mode 100644 index 00000000..8e7e268d --- /dev/null +++ b/apps/mobile/packages/features/client/billing/lib/src/presentation/widgets/spending_breakdown_card.dart @@ -0,0 +1,157 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../blocs/billing_bloc.dart'; +import '../blocs/billing_state.dart'; +import '../models/spending_breakdown_model.dart'; + +/// Card showing the spending breakdown for the current period. +class SpendingBreakdownCard extends StatefulWidget { + /// Creates a [SpendingBreakdownCard]. + const SpendingBreakdownCard({super.key}); + + @override + State createState() => _SpendingBreakdownCardState(); +} + +class _SpendingBreakdownCardState extends State + with SingleTickerProviderStateMixin { + late TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BlocBuilder( + builder: (BuildContext context, BillingState state) { + final double total = state.spendingBreakdown.fold( + 0.0, + (double sum, SpendingBreakdownItem item) => sum + item.amount, + ); + + return Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: UiColors.black.withValues(alpha: 0.04), + blurRadius: 8, + offset: const Offset(0, 2), + ), + ], + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + t.client_billing.period_breakdown, + style: UiTypography.title2b.textPrimary, + ), + ), + const SizedBox(width: UiConstants.space2), + Container( + height: 32, + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: BorderRadius.circular(6), + ), + child: TabBar( + controller: _tabController, + isScrollable: true, + indicator: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: BorderRadius.circular(4), + boxShadow: [ + BoxShadow( + color: UiColors.black.withValues(alpha: 0.05), + blurRadius: 1, + ), + ], + ), + labelColor: UiColors.textPrimary, + unselectedLabelColor: UiColors.textSecondary, + labelStyle: UiTypography.titleUppercase4b, + padding: const EdgeInsets.all(2), + indicatorSize: TabBarIndicatorSize.tab, + labelPadding: const EdgeInsets.symmetric(horizontal: 12), + dividerColor: Colors.transparent, + tabs: [ + Tab(text: t.client_billing.week), + Tab(text: t.client_billing.month), + ], + ), + ), + ], + ), + const SizedBox(height: UiConstants.space4), + ...state.spendingBreakdown.map( + (SpendingBreakdownItem item) => _buildBreakdownRow(item), + ), + const Padding( + padding: EdgeInsets.symmetric(vertical: UiConstants.space2), + child: Divider(height: 1, color: UiColors.border), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + t.client_billing.total, + style: UiTypography.body2b.textPrimary, + ), + Text( + '\$${total.toStringAsFixed(2)}', + style: UiTypography.body2b.textPrimary, + ), + ], + ), + ], + ), + ); + }, + ); + } + + Widget _buildBreakdownRow(SpendingBreakdownItem item) { + return Padding( + padding: const EdgeInsets.only(bottom: UiConstants.space2), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(item.category, style: UiTypography.body2r.textPrimary), + Text( + t.client_billing.hours(count: item.hours), + style: UiTypography.footnote2r.textSecondary, + ), + ], + ), + ), + Text( + '\$${item.amount.toStringAsFixed(2)}', + style: UiTypography.body2m.textPrimary, + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/billing/pubspec.yaml b/apps/mobile/packages/features/client/billing/pubspec.yaml new file mode 100644 index 00000000..7b8ad3dc --- /dev/null +++ b/apps/mobile/packages/features/client/billing/pubspec.yaml @@ -0,0 +1,42 @@ +name: billing +description: Client Billing feature package +publish_to: 'none' +version: 1.0.0+1 +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + +dependencies: + flutter: + sdk: flutter + + # Architecture + flutter_modular: ^6.3.2 + flutter_bloc: ^8.1.3 + equatable: ^2.0.5 + + # Shared packages + design_system: + path: ../../../design_system + core_localization: + path: ../../../core_localization + krow_domain: + path: ../../../domain + krow_core: + path: ../../../core + + # UI + lucide_icons: ^0.257.0 + intl: ^0.20.1 + + krow_data_connect: any +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + bloc_test: ^9.1.5 + mocktail: ^1.0.1 + +flutter: + uses-material-design: true diff --git a/apps/mobile/packages/features/client/client_coverage/lib/client_coverage.dart b/apps/mobile/packages/features/client/client_coverage/lib/client_coverage.dart new file mode 100644 index 00000000..65b8ce5a --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/client_coverage.dart @@ -0,0 +1,2 @@ +export 'src/coverage_module.dart'; +export 'src/presentation/pages/coverage_page.dart'; diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/coverage_module.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/coverage_module.dart new file mode 100644 index 00000000..4c2f1397 --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/coverage_module.dart @@ -0,0 +1,37 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'data/repositories_impl/coverage_repository_impl.dart'; +import 'domain/repositories/coverage_repository.dart'; +import 'domain/usecases/get_coverage_stats_usecase.dart'; +import 'domain/usecases/get_shifts_for_date_usecase.dart'; +import 'presentation/blocs/coverage_bloc.dart'; + +/// Modular module for the coverage feature. +class CoverageModule extends Module { + @override + void binds(Injector i) { + // Repositories + i.addSingleton(CoverageRepositoryImpl.new); + + // Use Cases + i.addSingleton(GetShiftsForDateUseCase.new); + i.addSingleton(GetCoverageStatsUseCase.new); + + // BLoCs + i.addSingleton( + () => CoverageBloc( + getShiftsForDate: i.get(), + getCoverageStats: i.get(), + ), + ); + } + + @override + void routes(RouteManager r) { + r.child("/", child: (_) => const SizedBox( + child: Center(child: Text('Feature not yet implemented')), + )); + /// TODO: FEATURE_NOT_YET_IMPLEMENTED + // r.child('/', child: (_) => const CoveragePage()); + } +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/data/repositories_impl/coverage_repository_impl.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/data/repositories_impl/coverage_repository_impl.dart new file mode 100644 index 00000000..fdee9b3f --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/data/repositories_impl/coverage_repository_impl.dart @@ -0,0 +1,123 @@ +import '../../domain/repositories/coverage_repository.dart'; +import '../../domain/ui_entities/coverage_entities.dart'; + +/// Implementation of [CoverageRepository] in the Data layer. +/// +/// This class provides mock data for the coverage feature. +/// In a production environment, this would delegate to `packages/data_connect` +/// for real data access (e.g., Firebase Data Connect, REST API). +/// +/// It strictly adheres to the Clean Architecture data layer responsibilities: +/// - No business logic (except necessary data transformation). +/// - Delegates to data sources (currently mock data, will be `data_connect`). +/// - Returns domain entities from `domain/ui_entities`. +class CoverageRepositoryImpl implements CoverageRepository { + /// Creates a [CoverageRepositoryImpl]. + CoverageRepositoryImpl(); + + /// Fetches shifts for a specific date. + @override + Future> getShiftsForDate({required DateTime date}) async { + // Simulate network delay + await Future.delayed(const Duration(milliseconds: 500)); + + // Mock data - in production, this would come from data_connect + final DateTime today = DateTime.now(); + final bool isToday = date.year == today.year && + date.month == today.month && + date.day == today.day; + + if (!isToday) { + // Return empty list for non-today dates + return []; + } + + return [ + CoverageShift( + id: '1', + title: 'Banquet Server', + location: 'Grand Ballroom', + startTime: '16:00', + workersNeeded: 10, + date: date, + workers: const [ + CoverageWorker( + name: 'Sarah Wilson', + status: 'confirmed', + checkInTime: '15:55', + ), + CoverageWorker( + name: 'Mike Ross', + status: 'confirmed', + checkInTime: '16:00', + ), + CoverageWorker( + name: 'Jane Doe', + status: 'confirmed', + checkInTime: null, + ), + CoverageWorker( + name: 'John Smith', + status: 'late', + checkInTime: null, + ), + ], + ), + CoverageShift( + id: '2', + title: 'Bartender', + location: 'Lobby Bar', + startTime: '17:00', + workersNeeded: 4, + date: date, + workers: const [ + CoverageWorker( + name: 'Emily Blunt', + status: 'confirmed', + checkInTime: '16:45', + ), + CoverageWorker( + name: 'Chris Evans', + status: 'confirmed', + checkInTime: '16:50', + ), + CoverageWorker( + name: 'Tom Holland', + status: 'confirmed', + checkInTime: null, + ), + ], + ), + ]; + } + + /// Fetches coverage statistics for a specific date. + @override + Future getCoverageStats({required DateTime date}) async { + // Get shifts for the date + final List shifts = await getShiftsForDate(date: date); + + // Calculate statistics + final int totalNeeded = shifts.fold( + 0, + (int sum, CoverageShift shift) => sum + shift.workersNeeded, + ); + + final List allWorkers = + shifts.expand((CoverageShift shift) => shift.workers).toList(); + final int totalConfirmed = allWorkers.length; + final int checkedIn = + allWorkers.where((CoverageWorker w) => w.isCheckedIn).length; + final int enRoute = + allWorkers.where((CoverageWorker w) => w.isEnRoute).length; + final int late = allWorkers.where((CoverageWorker w) => w.isLate).length; + + return CoverageStats( + totalNeeded: totalNeeded, + totalConfirmed: totalConfirmed, + checkedIn: checkedIn, + enRoute: enRoute, + late: late, + ); + } +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/domain/arguments/get_coverage_stats_arguments.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/domain/arguments/get_coverage_stats_arguments.dart new file mode 100644 index 00000000..105733c3 --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/domain/arguments/get_coverage_stats_arguments.dart @@ -0,0 +1,16 @@ +import 'package:krow_core/core.dart'; + +/// Arguments for fetching coverage statistics for a specific date. +/// +/// This argument class encapsulates the date parameter required by +/// the [GetCoverageStatsUseCase]. +class GetCoverageStatsArguments extends UseCaseArgument { + /// Creates [GetCoverageStatsArguments]. + const GetCoverageStatsArguments({required this.date}); + + /// The date to fetch coverage statistics for. + final DateTime date; + + @override + List get props => [date]; +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/domain/arguments/get_shifts_for_date_arguments.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/domain/arguments/get_shifts_for_date_arguments.dart new file mode 100644 index 00000000..ad71b56e --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/domain/arguments/get_shifts_for_date_arguments.dart @@ -0,0 +1,16 @@ +import 'package:krow_core/core.dart'; + +/// Arguments for fetching shifts for a specific date. +/// +/// This argument class encapsulates the date parameter required by +/// the [GetShiftsForDateUseCase]. +class GetShiftsForDateArguments extends UseCaseArgument { + /// Creates [GetShiftsForDateArguments]. + const GetShiftsForDateArguments({required this.date}); + + /// The date to fetch shifts for. + final DateTime date; + + @override + List get props => [date]; +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/domain/repositories/coverage_repository.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/domain/repositories/coverage_repository.dart new file mode 100644 index 00000000..6d7de8ba --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/domain/repositories/coverage_repository.dart @@ -0,0 +1,23 @@ +import '../ui_entities/coverage_entities.dart'; + +/// Repository interface for coverage-related operations. +/// +/// This interface defines the contract for accessing coverage data, +/// acting as a boundary between the Domain and Data layers. +/// It allows the Domain layer to remain independent of specific data sources. +/// +/// Implementation of this interface must delegate all data access through +/// the `packages/data_connect` layer, ensuring compliance with Clean Architecture. +abstract interface class CoverageRepository { + /// Fetches shifts for a specific date. + /// + /// Returns a list of [CoverageShift] entities representing all shifts + /// scheduled for the given [date]. + Future> getShiftsForDate({required DateTime date}); + + /// Fetches coverage statistics for a specific date. + /// + /// Returns [CoverageStats] containing aggregated metrics including + /// total workers needed, confirmed, checked in, en route, and late. + Future getCoverageStats({required DateTime date}); +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/domain/ui_entities/coverage_entities.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/domain/ui_entities/coverage_entities.dart new file mode 100644 index 00000000..50758e8c --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/domain/ui_entities/coverage_entities.dart @@ -0,0 +1,133 @@ +import 'package:equatable/equatable.dart'; + +/// Domain entity representing a shift in the coverage view. +/// +/// This is a feature-specific domain entity that encapsulates shift information +/// including scheduling details and assigned workers. +class CoverageShift extends Equatable { + /// Creates a [CoverageShift]. + const CoverageShift({ + required this.id, + required this.title, + required this.location, + required this.startTime, + required this.workersNeeded, + required this.date, + required this.workers, + }); + + /// The unique identifier for the shift. + final String id; + + /// The title or role of the shift. + final String title; + + /// The location where the shift takes place. + final String location; + + /// The start time of the shift (e.g., "16:00"). + final String startTime; + + /// The number of workers needed for this shift. + final int workersNeeded; + + /// The date of the shift. + final DateTime date; + + /// The list of workers assigned to this shift. + final List workers; + + /// Calculates the coverage percentage for this shift. + int get coveragePercent { + if (workersNeeded == 0) return 100; + return ((workers.length / workersNeeded) * 100).round(); + } + + @override + List get props => [ + id, + title, + location, + startTime, + workersNeeded, + date, + workers, + ]; +} + +/// Domain entity representing a worker in the coverage view. +/// +/// This entity tracks worker status including check-in information. +class CoverageWorker extends Equatable { + /// Creates a [CoverageWorker]. + const CoverageWorker({ + required this.name, + required this.status, + this.checkInTime, + }); + + /// The name of the worker. + final String name; + + /// The status of the worker ('confirmed', 'late', etc.). + final String status; + + /// The time the worker checked in, if applicable. + final String? checkInTime; + + /// Returns true if the worker is checked in. + bool get isCheckedIn => status == 'confirmed' && checkInTime != null; + + /// Returns true if the worker is en route. + bool get isEnRoute => status == 'confirmed' && checkInTime == null; + + /// Returns true if the worker is late. + bool get isLate => status == 'late'; + + @override + List get props => [name, status, checkInTime]; +} + +/// Domain entity representing coverage statistics. +/// +/// Aggregates coverage metrics for a specific date. +class CoverageStats extends Equatable { + /// Creates a [CoverageStats]. + const CoverageStats({ + required this.totalNeeded, + required this.totalConfirmed, + required this.checkedIn, + required this.enRoute, + required this.late, + }); + + /// The total number of workers needed. + final int totalNeeded; + + /// The total number of confirmed workers. + final int totalConfirmed; + + /// The number of workers who have checked in. + final int checkedIn; + + /// The number of workers en route. + final int enRoute; + + /// The number of late workers. + final int late; + + /// Calculates the overall coverage percentage. + int get coveragePercent { + if (totalNeeded == 0) return 100; + return ((totalConfirmed / totalNeeded) * 100).round(); + } + + @override + List get props => [ + totalNeeded, + totalConfirmed, + checkedIn, + enRoute, + late, + ]; +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/domain/usecases/get_coverage_stats_usecase.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/domain/usecases/get_coverage_stats_usecase.dart new file mode 100644 index 00000000..00cb7c1d --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/domain/usecases/get_coverage_stats_usecase.dart @@ -0,0 +1,28 @@ +import 'package:krow_core/core.dart'; +import '../arguments/get_coverage_stats_arguments.dart'; +import '../repositories/coverage_repository.dart'; +import '../ui_entities/coverage_entities.dart'; + +/// Use case for fetching coverage statistics for a specific date. +/// +/// This use case encapsulates the logic for retrieving coverage metrics including +/// total workers needed, confirmed, checked in, en route, and late. +/// It delegates the data retrieval to the [CoverageRepository]. +/// +/// Follows the KROW Clean Architecture pattern by: +/// - Extending from [UseCase] base class +/// - Using [GetCoverageStatsArguments] for input +/// - Returning domain entities ([CoverageStats]) +/// - Delegating to repository abstraction +class GetCoverageStatsUseCase + implements UseCase { + /// Creates a [GetCoverageStatsUseCase]. + GetCoverageStatsUseCase(this._repository); + + final CoverageRepository _repository; + + @override + Future call(GetCoverageStatsArguments arguments) { + return _repository.getCoverageStats(date: arguments.date); + } +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/domain/usecases/get_shifts_for_date_usecase.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/domain/usecases/get_shifts_for_date_usecase.dart new file mode 100644 index 00000000..da84506b --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/domain/usecases/get_shifts_for_date_usecase.dart @@ -0,0 +1,27 @@ +import 'package:krow_core/core.dart'; +import '../arguments/get_shifts_for_date_arguments.dart'; +import '../repositories/coverage_repository.dart'; +import '../ui_entities/coverage_entities.dart'; + +/// Use case for fetching shifts for a specific date. +/// +/// This use case encapsulates the logic for retrieving all shifts scheduled for a given date. +/// It delegates the data retrieval to the [CoverageRepository]. +/// +/// Follows the KROW Clean Architecture pattern by: +/// - Extending from [UseCase] base class +/// - Using [GetShiftsForDateArguments] for input +/// - Returning domain entities ([CoverageShift]) +/// - Delegating to repository abstraction +class GetShiftsForDateUseCase + implements UseCase> { + /// Creates a [GetShiftsForDateUseCase]. + GetShiftsForDateUseCase(this._repository); + + final CoverageRepository _repository; + + @override + Future> call(GetShiftsForDateArguments arguments) { + return _repository.getShiftsForDate(date: arguments.date); + } +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/blocs/coverage_bloc.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/blocs/coverage_bloc.dart new file mode 100644 index 00000000..d8a0a8c3 --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/blocs/coverage_bloc.dart @@ -0,0 +1,80 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../../domain/arguments/get_coverage_stats_arguments.dart'; +import '../../domain/arguments/get_shifts_for_date_arguments.dart'; +import '../../domain/ui_entities/coverage_entities.dart'; +import '../../domain/usecases/get_coverage_stats_usecase.dart'; +import '../../domain/usecases/get_shifts_for_date_usecase.dart'; +import 'coverage_event.dart'; +import 'coverage_state.dart'; + +/// BLoC for managing coverage feature state. +/// +/// This BLoC handles: +/// - Loading shifts for a specific date +/// - Loading coverage statistics +/// - Refreshing coverage data +class CoverageBloc extends Bloc { + /// Creates a [CoverageBloc]. + CoverageBloc({ + required GetShiftsForDateUseCase getShiftsForDate, + required GetCoverageStatsUseCase getCoverageStats, + }) : _getShiftsForDate = getShiftsForDate, + _getCoverageStats = getCoverageStats, + super(const CoverageState()) { + on(_onLoadRequested); + on(_onRefreshRequested); + } + + final GetShiftsForDateUseCase _getShiftsForDate; + final GetCoverageStatsUseCase _getCoverageStats; + + /// Handles the load requested event. + Future _onLoadRequested( + CoverageLoadRequested event, + Emitter emit, + ) async { + emit( + state.copyWith( + status: CoverageStatus.loading, + selectedDate: event.date, + ), + ); + + try { + // Fetch shifts and stats concurrently + final List results = await Future.wait(>[ + _getShiftsForDate(GetShiftsForDateArguments(date: event.date)), + _getCoverageStats(GetCoverageStatsArguments(date: event.date)), + ]); + + final List shifts = results[0] as List; + final CoverageStats stats = results[1] as CoverageStats; + + emit( + state.copyWith( + status: CoverageStatus.success, + shifts: shifts, + stats: stats, + ), + ); + } catch (error) { + emit( + state.copyWith( + status: CoverageStatus.failure, + errorMessage: error.toString(), + ), + ); + } + } + + /// Handles the refresh requested event. + Future _onRefreshRequested( + CoverageRefreshRequested event, + Emitter emit, + ) async { + if (state.selectedDate == null) return; + + // Reload data for the current selected date + add(CoverageLoadRequested(date: state.selectedDate!)); + } +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/blocs/coverage_event.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/blocs/coverage_event.dart new file mode 100644 index 00000000..8df53eed --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/blocs/coverage_event.dart @@ -0,0 +1,28 @@ +import 'package:equatable/equatable.dart'; + +/// Base class for all coverage events. +sealed class CoverageEvent extends Equatable { + /// Creates a [CoverageEvent]. + const CoverageEvent(); + + @override + List get props => []; +} + +/// Event to load coverage data for a specific date. +final class CoverageLoadRequested extends CoverageEvent { + /// Creates a [CoverageLoadRequested] event. + const CoverageLoadRequested({required this.date}); + + /// The date to load coverage data for. + final DateTime date; + + @override + List get props => [date]; +} + +/// Event to refresh coverage data. +final class CoverageRefreshRequested extends CoverageEvent { + /// Creates a [CoverageRefreshRequested] event. + const CoverageRefreshRequested(); +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/blocs/coverage_state.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/blocs/coverage_state.dart new file mode 100644 index 00000000..9ca35dad --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/blocs/coverage_state.dart @@ -0,0 +1,70 @@ +import 'package:equatable/equatable.dart'; +import '../../domain/ui_entities/coverage_entities.dart'; + +/// Enum representing the status of coverage data loading. +enum CoverageStatus { + /// Initial state before any data is loaded. + initial, + + /// Data is currently being loaded. + loading, + + /// Data has been successfully loaded. + success, + + /// An error occurred while loading data. + failure, +} + +/// State for the coverage feature. +final class CoverageState extends Equatable { + /// Creates a [CoverageState]. + const CoverageState({ + this.status = CoverageStatus.initial, + this.selectedDate, + this.shifts = const [], + this.stats, + this.errorMessage, + }); + + /// The current status of data loading. + final CoverageStatus status; + + /// The currently selected date. + final DateTime? selectedDate; + + /// The list of shifts for the selected date. + final List shifts; + + /// Coverage statistics for the selected date. + final CoverageStats? stats; + + /// Error message if status is failure. + final String? errorMessage; + + /// Creates a copy of this state with the given fields replaced. + CoverageState copyWith({ + CoverageStatus? status, + DateTime? selectedDate, + List? shifts, + CoverageStats? stats, + String? errorMessage, + }) { + return CoverageState( + status: status ?? this.status, + selectedDate: selectedDate ?? this.selectedDate, + shifts: shifts ?? this.shifts, + stats: stats ?? this.stats, + errorMessage: errorMessage ?? this.errorMessage, + ); + } + + @override + List get props => [ + status, + selectedDate, + shifts, + stats, + errorMessage, + ]; +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/pages/coverage_page.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/pages/coverage_page.dart new file mode 100644 index 00000000..441c6040 --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/pages/coverage_page.dart @@ -0,0 +1,128 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import '../blocs/coverage_bloc.dart'; +import '../blocs/coverage_event.dart'; +import '../blocs/coverage_state.dart'; + +import '../widgets/coverage_header.dart'; +import '../widgets/coverage_quick_stats.dart'; +import '../widgets/coverage_shift_list.dart'; +import '../widgets/late_workers_alert.dart'; + +/// Page for displaying daily coverage information. +/// +/// Shows shifts, worker statuses, and coverage statistics for a selected date. +class CoveragePage extends StatelessWidget { + /// Creates a [CoveragePage]. + const CoveragePage({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (BuildContext context) => Modular.get() + ..add(CoverageLoadRequested(date: DateTime.now())), + child: Scaffold( + backgroundColor: UiColors.background, + body: BlocBuilder( + builder: (BuildContext context, CoverageState state) { + return Column( + children: [ + CoverageHeader( + selectedDate: state.selectedDate ?? DateTime.now(), + coveragePercent: state.stats?.coveragePercent ?? 0, + totalConfirmed: state.stats?.totalConfirmed ?? 0, + totalNeeded: state.stats?.totalNeeded ?? 0, + onDateSelected: (DateTime date) { + BlocProvider.of(context).add( + CoverageLoadRequested(date: date), + ); + }, + onRefresh: () { + BlocProvider.of(context).add( + const CoverageRefreshRequested(), + ); + }, + ), + Expanded( + child: _buildBody(context: context, state: state), + ), + ], + ); + }, + ), + ), + ); + } + + /// Builds the main body content based on the current state. + Widget _buildBody({ + required BuildContext context, + required CoverageState state, + }) { + if (state.status == CoverageStatus.loading) { + return const Center( + child: CircularProgressIndicator(), + ); + } + + if (state.status == CoverageStatus.failure) { + return Center( + child: Padding( + padding: const EdgeInsets.all(UiConstants.space6), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon( + UiIcons.warning, + size: UiConstants.space12, + color: UiColors.destructive, + ), + const SizedBox(height: UiConstants.space4), + Text( + 'Failed to load coverage data', + style: UiTypography.title2m.copyWith( + color: UiColors.textPrimary, + ), + ), + const SizedBox(height: UiConstants.space2), + Text( + state.errorMessage ?? 'An unknown error occurred', + style: UiTypography.body2r.copyWith( + color: UiColors.mutedForeground, + ), + textAlign: TextAlign.center, + ), + ], + ), + ), + ); + } + + return SingleChildScrollView( + padding: const EdgeInsets.all(UiConstants.space5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (state.stats != null) ...[ + CoverageQuickStats(stats: state.stats!), + const SizedBox(height: UiConstants.space5), + ], + if (state.stats != null && state.stats!.late > 0) ...[ + LateWorkersAlert(lateCount: state.stats!.late), + const SizedBox(height: UiConstants.space5), + ], + Text( + 'Shifts', + style: UiTypography.title2b.copyWith( + color: UiColors.textPrimary, + ), + ), + const SizedBox(height: UiConstants.space3), + CoverageShiftList(shifts: state.shifts), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/coverage_calendar_selector.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/coverage_calendar_selector.dart new file mode 100644 index 00000000..a5e7787e --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/coverage_calendar_selector.dart @@ -0,0 +1,185 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +/// Calendar selector widget for choosing dates. +/// +/// Displays a week view with navigation buttons and date selection. +class CoverageCalendarSelector extends StatefulWidget { + /// Creates a [CoverageCalendarSelector]. + const CoverageCalendarSelector({ + required this.selectedDate, + required this.onDateSelected, + super.key, + }); + + /// The currently selected date. + final DateTime selectedDate; + + /// Callback when a date is selected. + final ValueChanged onDateSelected; + + @override + State createState() => + _CoverageCalendarSelectorState(); +} + +class _CoverageCalendarSelectorState extends State { + late DateTime _today; + + @override + void initState() { + super.initState(); + _today = DateTime.now(); + _today = DateTime(_today.year, _today.month, _today.day); + } + + /// Gets the list of calendar days to display (7 days centered on selected date). + List _getCalendarDays() { + final List days = []; + final DateTime startDate = + widget.selectedDate.subtract(const Duration(days: 3)); + for (int i = 0; i < 7; i++) { + days.add(startDate.add(Duration(days: i))); + } + return days; + } + + /// Navigates to the previous week. + void _navigatePrevWeek() { + widget.onDateSelected( + widget.selectedDate.subtract(const Duration(days: 7)), + ); + } + + /// Navigates to today's date. + void _navigateToday() { + final DateTime now = DateTime.now(); + widget.onDateSelected(DateTime(now.year, now.month, now.day)); + } + + /// Navigates to the next week. + void _navigateNextWeek() { + widget.onDateSelected( + widget.selectedDate.add(const Duration(days: 7)), + ); + } + + @override + Widget build(BuildContext context) { + final List calendarDays = _getCalendarDays(); + + return Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + _NavButton( + text: '← Prev Week', + onTap: _navigatePrevWeek, + ), + _NavButton( + text: 'Today', + onTap: _navigateToday, + ), + _NavButton( + text: 'Next Week β†’', + onTap: _navigateNextWeek, + ), + ], + ), + const SizedBox(height: UiConstants.space2), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: calendarDays.map((DateTime date) { + final bool isSelected = date.year == widget.selectedDate.year && + date.month == widget.selectedDate.month && + date.day == widget.selectedDate.day; + final bool isToday = date.year == _today.year && + date.month == _today.month && + date.day == _today.day; + + return GestureDetector( + onTap: () => widget.onDateSelected(date), + child: Container( + width: UiConstants.space10 + UiConstants.space1, + height: UiConstants.space14, + decoration: BoxDecoration( + color: isSelected + ? UiColors.primaryForeground + : UiColors.primaryForeground.withOpacity(0.1), + borderRadius: UiConstants.radiusLg, + border: isToday && !isSelected + ? Border.all( + color: UiColors.primaryForeground, + width: 2, + ) + : null, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + date.day.toString().padLeft(2, '0'), + style: UiTypography.body1b.copyWith( + color: isSelected + ? UiColors.primary + : UiColors.primaryForeground, + ), + ), + Text( + DateFormat('E').format(date), + style: UiTypography.body4m.copyWith( + color: isSelected + ? UiColors.mutedForeground + : UiColors.primaryForeground.withOpacity(0.7), + ), + ), + ], + ), + ), + ); + }).toList(), + ), + ], + ); + } +} + +/// Navigation button for calendar navigation. +class _NavButton extends StatelessWidget { + /// Creates a [_NavButton]. + const _NavButton({ + required this.text, + required this.onTap, + }); + + /// The button text. + final String text; + + /// Callback when tapped. + final VoidCallback onTap; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space3, + vertical: UiConstants.space1, + ), + decoration: BoxDecoration( + color: UiColors.primaryForeground.withOpacity(0.2), + borderRadius: UiConstants.radiusMd, + ), + child: Text( + text, + style: UiTypography.body3r.copyWith( + color: UiColors.primaryForeground, + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/coverage_header.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/coverage_header.dart new file mode 100644 index 00000000..f1f1f5cb --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/coverage_header.dart @@ -0,0 +1,176 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'coverage_calendar_selector.dart'; + +/// Header widget for the coverage page. +/// +/// Displays: +/// - Back button and title +/// - Refresh button +/// - Calendar date selector +/// - Coverage summary statistics +class CoverageHeader extends StatelessWidget { + /// Creates a [CoverageHeader]. + const CoverageHeader({ + required this.selectedDate, + required this.coveragePercent, + required this.totalConfirmed, + required this.totalNeeded, + required this.onDateSelected, + required this.onRefresh, + super.key, + }); + + /// The currently selected date. + final DateTime selectedDate; + + /// The coverage percentage. + final int coveragePercent; + + /// The total number of confirmed workers. + final int totalConfirmed; + + /// The total number of workers needed. + final int totalNeeded; + + /// Callback when a date is selected. + final ValueChanged onDateSelected; + + /// Callback when refresh is requested. + final VoidCallback onRefresh; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.only( + top: UiConstants.space14, + left: UiConstants.space5, + right: UiConstants.space5, + bottom: UiConstants.space6, + ), + decoration: const BoxDecoration( + gradient: LinearGradient( + colors: [ + UiColors.primary, + UiColors.accent, + ], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + GestureDetector( + onTap: () => Modular.to.pop(), + child: Container( + width: UiConstants.space10, + height: UiConstants.space10, + decoration: BoxDecoration( + color: UiColors.primaryForeground.withOpacity(0.2), + shape: BoxShape.circle, + ), + child: const Icon( + UiIcons.arrowLeft, + color: UiColors.primaryForeground, + size: UiConstants.space5, + ), + ), + ), + const SizedBox(width: UiConstants.space3), + Text( + 'Daily Coverage', + style: UiTypography.title1m.copyWith( + color: UiColors.primaryForeground, + ), + ), + ], + ), + Container( + width: UiConstants.space8, + height: UiConstants.space8, + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: UiConstants.radiusMd, + ), + child: IconButton( + onPressed: onRefresh, + icon: const Icon( + UiIcons.rotateCcw, + color: UiColors.primaryForeground, + size: UiConstants.space4, + ), + padding: EdgeInsets.zero, + constraints: const BoxConstraints(), + style: IconButton.styleFrom( + hoverColor: UiColors.primaryForeground.withOpacity(0.2), + shape: RoundedRectangleBorder( + borderRadius: UiConstants.radiusMd, + ), + ), + ), + ), + ], + ), + const SizedBox(height: UiConstants.space4), + CoverageCalendarSelector( + selectedDate: selectedDate, + onDateSelected: onDateSelected, + ), + const SizedBox(height: UiConstants.space4), + Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.primaryForeground.withOpacity(0.1), + borderRadius: UiConstants.radiusLg, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Coverage Status', + style: UiTypography.body2r.copyWith( + color: UiColors.primaryForeground.withOpacity(0.7), + ), + ), + Text( + '$coveragePercent%', + style: UiTypography.display1b.copyWith( + color: UiColors.primaryForeground, + ), + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + 'Workers', + style: UiTypography.body2r.copyWith( + color: UiColors.primaryForeground.withOpacity(0.7), + ), + ), + Text( + '$totalConfirmed/$totalNeeded', + style: UiTypography.title2m.copyWith( + color: UiColors.primaryForeground, + ), + ), + ], + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/coverage_quick_stats.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/coverage_quick_stats.dart new file mode 100644 index 00000000..56f87c69 --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/coverage_quick_stats.dart @@ -0,0 +1,112 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import '../../domain/ui_entities/coverage_entities.dart'; + +/// Quick statistics cards showing coverage metrics. +/// +/// Displays checked-in, en-route, and late worker counts. +class CoverageQuickStats extends StatelessWidget { + /// Creates a [CoverageQuickStats]. + const CoverageQuickStats({ + required this.stats, + super.key, + }); + + /// The coverage statistics to display. + final CoverageStats stats; + + @override + Widget build(BuildContext context) { + return Row( + children: [ + Expanded( + child: _StatCard( + icon: UiIcons.success, + label: 'Checked In', + value: stats.checkedIn.toString(), + color: UiColors.iconSuccess, + ), + ), + const SizedBox(width: UiConstants.space3), + Expanded( + child: _StatCard( + icon: UiIcons.clock, + label: 'En Route', + value: stats.enRoute.toString(), + color: UiColors.textWarning, + ), + ), + const SizedBox(width: UiConstants.space3), + Expanded( + child: _StatCard( + icon: UiIcons.warning, + label: 'Late', + value: stats.late.toString(), + color: UiColors.destructive, + ), + ), + ], + ); + } +} + +/// Individual stat card widget. +class _StatCard extends StatelessWidget { + /// Creates a [_StatCard]. + const _StatCard({ + required this.icon, + required this.label, + required this.value, + required this.color, + }); + + /// The icon to display. + final IconData icon; + + /// The label text. + final String label; + + /// The value to display. + final String value; + + /// The accent color for the card. + final Color color; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space3), + decoration: BoxDecoration( + color: UiColors.bgMenu, + borderRadius: UiConstants.radiusLg, + border: Border.all( + color: UiColors.border, + ), + ), + child: Column( + children: [ + Icon( + icon, + color: color, + size: UiConstants.space6, + ), + const SizedBox(height: UiConstants.space2), + Text( + value, + style: UiTypography.title1m.copyWith( + color: UiColors.textPrimary, + ), + ), + const SizedBox(height: UiConstants.space1), + Text( + label, + style: UiTypography.body3r.copyWith( + color: UiColors.mutedForeground, + ), + textAlign: TextAlign.center, + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/coverage_shift_list.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/coverage_shift_list.dart new file mode 100644 index 00000000..0732c389 --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/coverage_shift_list.dart @@ -0,0 +1,433 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import '../../domain/ui_entities/coverage_entities.dart'; + +/// List of shifts with their workers. +/// +/// Displays all shifts for the selected date, or an empty state if none exist. +class CoverageShiftList extends StatelessWidget { + /// Creates a [CoverageShiftList]. + const CoverageShiftList({ + required this.shifts, + super.key, + }); + + /// The list of shifts to display. + final List shifts; + + /// Formats a time string (HH:mm) to a readable format (h:mm a). + String _formatTime(String? time) { + if (time == null) return ''; + final List parts = time.split(':'); + final DateTime dt = DateTime( + 2022, + 1, + 1, + int.parse(parts[0]), + int.parse(parts[1]), + ); + return DateFormat('h:mm a').format(dt); + } + + @override + Widget build(BuildContext context) { + if (shifts.isEmpty) { + return Container( + padding: const EdgeInsets.all(UiConstants.space8), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + ), + child: Column( + children: [ + const Icon( + UiIcons.users, + size: UiConstants.space12, + color: UiColors.mutedForeground, + ), + const SizedBox(height: UiConstants.space3), + Text( + 'No shifts scheduled for this day', + style: UiTypography.body2r.copyWith( + color: UiColors.mutedForeground, + ), + ), + ], + ), + ); + } + + return Column( + children: shifts.map((CoverageShift shift) { + return Container( + margin: const EdgeInsets.only(bottom: UiConstants.space3), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + ), + clipBehavior: Clip.antiAlias, + child: Column( + children: [ + _ShiftHeader( + title: shift.title, + location: shift.location, + startTime: _formatTime(shift.startTime), + current: shift.workers.length, + total: shift.workersNeeded, + coveragePercent: shift.coveragePercent, + ), + if (shift.workers.isNotEmpty) + Padding( + padding: const EdgeInsets.all(UiConstants.space3), + child: Column( + children: + shift.workers.map((CoverageWorker worker) { + final bool isLast = worker == shift.workers.last; + return Padding( + padding: EdgeInsets.only( + bottom: isLast ? 0 : UiConstants.space2, + ), + child: _WorkerRow( + worker: worker, + shiftStartTime: _formatTime(shift.startTime), + formatTime: _formatTime, + ), + ); + }).toList(), + ), + ) + else + Padding( + padding: const EdgeInsets.all(UiConstants.space4), + child: Text( + 'No workers assigned yet', + style: UiTypography.body3r.copyWith( + color: UiColors.mutedForeground, + ), + ), + ), + ], + ), + ); + }).toList(), + ); + } +} + +/// Header for a shift card. +class _ShiftHeader extends StatelessWidget { + /// Creates a [_ShiftHeader]. + const _ShiftHeader({ + required this.title, + required this.location, + required this.startTime, + required this.current, + required this.total, + required this.coveragePercent, + }); + + /// The shift title. + final String title; + + /// The shift location. + final String location; + + /// The shift start time. + final String startTime; + + /// Current number of workers. + final int current; + + /// Total workers needed. + final int total; + + /// Coverage percentage. + final int coveragePercent; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: const BoxDecoration( + color: UiColors.muted, + border: Border( + bottom: BorderSide( + color: UiColors.border, + ), + ), + ), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: UiConstants.space2, + height: UiConstants.space2, + decoration: const BoxDecoration( + color: UiColors.primary, + shape: BoxShape.circle, + ), + ), + const SizedBox(width: UiConstants.space2), + Text( + title, + style: UiTypography.body1b.copyWith( + color: UiColors.textPrimary, + ), + ), + ], + ), + const SizedBox(height: UiConstants.space2), + Row( + children: [ + const Icon( + UiIcons.mapPin, + size: UiConstants.space3, + color: UiColors.mutedForeground, + ), + const SizedBox(width: UiConstants.space1), + Text( + location, + style: UiTypography.body3r.copyWith( + color: UiColors.mutedForeground, + ), + ), + const SizedBox(width: UiConstants.space3), + const Icon( + UiIcons.clock, + size: UiConstants.space3, + color: UiColors.mutedForeground, + ), + const SizedBox(width: UiConstants.space1), + Text( + startTime, + style: UiTypography.body3r.copyWith( + color: UiColors.mutedForeground, + ), + ), + ], + ), + ], + ), + ), + _CoverageBadge( + current: current, + total: total, + coveragePercent: coveragePercent, + ), + ], + ), + ); + } +} + +/// Coverage badge showing worker count and status. +class _CoverageBadge extends StatelessWidget { + /// Creates a [_CoverageBadge]. + const _CoverageBadge({ + required this.current, + required this.total, + required this.coveragePercent, + }); + + /// Current number of workers. + final int current; + + /// Total workers needed. + final int total; + + /// Coverage percentage. + final int coveragePercent; + + @override + Widget build(BuildContext context) { + Color bg; + Color text; + + if (coveragePercent >= 100) { + bg = UiColors.textSuccess; + text = UiColors.primaryForeground; + } else if (coveragePercent >= 80) { + bg = UiColors.textWarning; + text = UiColors.primaryForeground; + } else { + bg = UiColors.destructive; + text = UiColors.destructiveForeground; + } + + return Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space2 + UiConstants.space1, + vertical: UiConstants.space1 / 2, + ), + decoration: BoxDecoration( + color: bg, + borderRadius: UiConstants.radiusFull, + ), + child: Text( + '$current/$total', + style: UiTypography.body3m.copyWith( + color: text, + ), + ), + ); + } +} + +/// Row displaying a single worker's status. +class _WorkerRow extends StatelessWidget { + /// Creates a [_WorkerRow]. + const _WorkerRow({ + required this.worker, + required this.shiftStartTime, + required this.formatTime, + }); + + /// The worker to display. + final CoverageWorker worker; + + /// The shift start time. + final String shiftStartTime; + + /// Function to format time strings. + final String Function(String?) formatTime; + + @override + Widget build(BuildContext context) { + Color bg; + Color border; + Color textBg; + Color textColor; + IconData icon; + String statusText; + Color badgeBg; + Color badgeText; + String badgeLabel; + + if (worker.isCheckedIn) { + bg = UiColors.textSuccess.withOpacity(0.1); + border = UiColors.textSuccess; + textBg = UiColors.textSuccess.withOpacity(0.2); + textColor = UiColors.textSuccess; + icon = UiIcons.success; + statusText = 'βœ“ Checked In at ${formatTime(worker.checkInTime)}'; + badgeBg = UiColors.textSuccess; + badgeText = UiColors.primaryForeground; + badgeLabel = 'On Site'; + } else if (worker.isEnRoute) { + bg = UiColors.textWarning.withOpacity(0.1); + border = UiColors.textWarning; + textBg = UiColors.textWarning.withOpacity(0.2); + textColor = UiColors.textWarning; + icon = UiIcons.clock; + statusText = 'En Route - Expected $shiftStartTime'; + badgeBg = UiColors.textWarning; + badgeText = UiColors.primaryForeground; + badgeLabel = 'En Route'; + } else { + bg = UiColors.destructive.withOpacity(0.1); + border = UiColors.destructive; + textBg = UiColors.destructive.withOpacity(0.2); + textColor = UiColors.destructive; + icon = UiIcons.warning; + statusText = '⚠ Running Late'; + badgeBg = UiColors.destructive; + badgeText = UiColors.destructiveForeground; + badgeLabel = 'Late'; + } + + return Container( + padding: const EdgeInsets.all(UiConstants.space2), + decoration: BoxDecoration( + color: bg, + borderRadius: UiConstants.radiusMd, + ), + child: Row( + children: [ + Stack( + clipBehavior: Clip.none, + children: [ + Container( + width: UiConstants.space10, + height: UiConstants.space10, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(color: border, width: 2), + ), + child: CircleAvatar( + backgroundColor: textBg, + child: Text( + worker.name.isNotEmpty ? worker.name[0] : 'W', + style: UiTypography.body1b.copyWith( + color: textColor, + ), + ), + ), + ), + Positioned( + bottom: -2, + right: -2, + child: Container( + width: UiConstants.space4, + height: UiConstants.space4, + decoration: BoxDecoration( + color: border, + shape: BoxShape.circle, + ), + child: Icon( + icon, + size: UiConstants.space2 + UiConstants.space1, + color: UiColors.primaryForeground, + ), + ), + ), + ], + ), + const SizedBox(width: UiConstants.space3), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + worker.name, + style: UiTypography.body2b.copyWith( + color: UiColors.textPrimary, + ), + ), + Text( + statusText, + style: UiTypography.body3m.copyWith( + color: textColor, + ), + ), + ], + ), + ), + Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space2, + vertical: UiConstants.space1 / 2, + ), + decoration: BoxDecoration( + color: badgeBg, + borderRadius: UiConstants.radiusFull, + ), + child: Text( + badgeLabel, + style: UiTypography.footnote2b.copyWith( + color: badgeText, + ), + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/late_workers_alert.dart b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/late_workers_alert.dart new file mode 100644 index 00000000..8d5f8c0a --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/lib/src/presentation/widgets/late_workers_alert.dart @@ -0,0 +1,60 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// Alert widget for displaying late workers warning. +/// +/// Shows a warning banner when there are late workers. +class LateWorkersAlert extends StatelessWidget { + /// Creates a [LateWorkersAlert]. + const LateWorkersAlert({ + required this.lateCount, + super.key, + }); + + /// The number of late workers. + final int lateCount; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space3), + decoration: BoxDecoration( + color: UiColors.destructive.withOpacity(0.1), + borderRadius: UiConstants.radiusLg, + border: Border.all( + color: UiColors.destructive.withOpacity(0.3), + ), + ), + child: Row( + children: [ + const Icon( + UiIcons.warning, + color: UiColors.destructive, + size: UiConstants.space5, + ), + const SizedBox(width: UiConstants.space3), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Late Workers Alert', + style: UiTypography.body1b.copyWith( + color: UiColors.destructive, + ), + ), + const SizedBox(height: UiConstants.space1), + Text( + '$lateCount ${lateCount == 1 ? 'worker is' : 'workers are'} running late', + style: UiTypography.body3r.copyWith( + color: UiColors.destructiveForeground, + ), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/client_coverage/pubspec.lock b/apps/mobile/packages/features/client/client_coverage/pubspec.lock new file mode 100644 index 00000000..6dd6fbaf --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/pubspec.lock @@ -0,0 +1,650 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" + source: hosted + version: "2.13.0" + auto_injector: + dependency: transitive + description: + name: auto_injector + sha256: "1fc2624898e92485122eb2b1698dd42511d7ff6574f84a3a8606fc4549a1e8f8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + bloc: + dependency: transitive + description: + name: bloc + sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e" + url: "https://pub.dev" + source: hosted + version: "8.1.4" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + core_localization: + dependency: "direct main" + description: + path: "../../../core_localization" + relative: true + source: path + version: "0.0.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" + source: hosted + version: "3.0.7" + csv: + dependency: transitive + description: + name: csv + sha256: c6aa2679b2a18cb57652920f674488d89712efaf4d3fdf2e537215b35fc19d6c + url: "https://pub.dev" + source: hosted + version: "6.0.0" + design_system: + dependency: "direct main" + description: + path: "../../../design_system" + relative: true + source: path + version: "0.0.1" + equatable: + dependency: "direct main" + description: + name: equatable + sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b" + url: "https://pub.dev" + source: hosted + version: "2.0.8" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c + url: "https://pub.dev" + source: hosted + version: "2.1.5" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: "direct main" + description: + name: flutter_bloc + sha256: b594505eac31a0518bdcb4b5b79573b8d9117b193cc80cc12e17d639b10aa27a + url: "https://pub.dev" + source: hosted + version: "8.1.6" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + url: "https://pub.dev" + source: hosted + version: "5.0.0" + flutter_localizations: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_modular: + dependency: "direct main" + description: + name: flutter_modular + sha256: "33a63d9fe61429d12b3dfa04795ed890f17d179d3d38e988ba7969651fcd5586" + url: "https://pub.dev" + source: hosted + version: "6.4.1" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + font_awesome_flutter: + dependency: transitive + description: + name: font_awesome_flutter + sha256: b9011df3a1fa02993630b8fb83526368cf2206a711259830325bab2f1d2a4eb0 + url: "https://pub.dev" + source: hosted + version: "10.12.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + google_fonts: + dependency: transitive + description: + name: google_fonts + sha256: "6996212014b996eaa17074e02b1b925b212f5e053832d9048970dc27255a8fb3" + url: "https://pub.dev" + source: hosted + version: "7.1.0" + hooks: + dependency: transitive + description: + name: hooks + sha256: "5d309c86e7ce34cd8e37aa71cb30cb652d3829b900ab145e4d9da564b31d59f7" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + http: + dependency: transitive + description: + name: http + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" + url: "https://pub.dev" + source: hosted + version: "1.6.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + intl: + dependency: "direct main" + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + krow_core: + dependency: "direct main" + description: + path: "../../../core" + relative: true + source: path + version: "0.0.1" + krow_data_connect: + dependency: "direct main" + description: + path: "../../../data_connect" + relative: true + source: path + version: "0.0.1" + krow_domain: + dependency: "direct main" + description: + path: "../../../domain" + relative: true + source: path + version: "0.0.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.dev" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + lints: + dependency: transitive + description: + name: lints + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + url: "https://pub.dev" + source: hosted + version: "5.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + lucide_icons: + dependency: transitive + description: + name: lucide_icons + sha256: ad24d0fd65707e48add30bebada7d90bff2a1bba0a72d6e9b19d44246b0e83c4 + url: "https://pub.dev" + source: hosted + version: "0.257.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + url: "https://pub.dev" + source: hosted + version: "1.17.0" + modular_core: + dependency: transitive + description: + name: modular_core + sha256: "1db0420a0dfb8a2c6dca846e7cbaa4ffeb778e247916dbcb27fb25aa566e5436" + url: "https://pub.dev" + source: hosted + version: "3.4.1" + native_toolchain_c: + dependency: transitive + description: + name: native_toolchain_c + sha256: "89e83885ba09da5fdf2cdacc8002a712ca238c28b7f717910b34bcd27b0d03ac" + url: "https://pub.dev" + source: hosted + version: "0.17.4" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "7fd0c4d8ac8980011753b9bdaed2bf15111365924cdeeeaeb596214ea2b03537" + url: "https://pub.dev" + source: hosted + version: "9.2.4" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: f2c65e21139ce2c3dad46922be8272bb5963516045659e71bb16e151c93b580e + url: "https://pub.dev" + source: hosted + version: "2.2.22" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + provider: + dependency: transitive + description: + name: provider + sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272" + url: "https://pub.dev" + source: hosted + version: "6.1.5+1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + result_dart: + dependency: transitive + description: + name: result_dart + sha256: "0666b21fbdf697b3bdd9986348a380aa204b3ebe7c146d8e4cdaa7ce735e6054" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + shared_preferences: + dependency: transitive + description: + name: shared_preferences + sha256: "2939ae520c9024cb197fc20dee269cd8cdbf564c8b5746374ec6cacdc5169e64" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "83af5c682796c0f7719c2bbf74792d113e40ae97981b8f266fa84574573556bc" + url: "https://pub.dev" + source: hosted + version: "2.4.18" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" + url: "https://pub.dev" + source: hosted + version: "2.5.6" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + slang: + dependency: transitive + description: + name: slang + sha256: "13e3b6f07adc51ab751e7889647774d294cbce7a3382f81d9e5029acfe9c37b2" + url: "https://pub.dev" + source: hosted + version: "4.12.0" + slang_flutter: + dependency: transitive + description: + name: slang_flutter + sha256: "0a4545cca5404d6b7487cf61cf1fe56c52daeb08de56a7574ee8381fbad035a0" + url: "https://pub.dev" + source: hosted + version: "4.12.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + url: "https://pub.dev" + source: hosted + version: "0.7.7" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8 + url: "https://pub.dev" + source: hosted + version: "4.5.2" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" + source: hosted + version: "15.0.2" + watcher: + dependency: transitive + description: + name: watcher + sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.10.7 <4.0.0" + flutter: ">=3.38.4" diff --git a/apps/mobile/packages/features/client/client_coverage/pubspec.yaml b/apps/mobile/packages/features/client/client_coverage/pubspec.yaml new file mode 100644 index 00000000..35422870 --- /dev/null +++ b/apps/mobile/packages/features/client/client_coverage/pubspec.yaml @@ -0,0 +1,34 @@ +name: client_coverage +description: Client coverage feature for tracking daily shift coverage and worker status +version: 1.0.0 +publish_to: none + +environment: + sdk: ^3.6.0 + +dependencies: + flutter: + sdk: flutter + + # Internal packages + design_system: + path: ../../../design_system + krow_domain: + path: ../../../domain + krow_core: + path: ../../../core + krow_data_connect: + path: ../../../data_connect + core_localization: + path: ../../../core_localization + + # External packages + flutter_modular: ^6.3.4 + flutter_bloc: ^8.1.6 + equatable: ^2.0.7 + intl: ^0.20.1 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 diff --git a/apps/mobile/packages/features/client/client_main/lib/client_main.dart b/apps/mobile/packages/features/client/client_main/lib/client_main.dart new file mode 100644 index 00000000..3cf2c937 --- /dev/null +++ b/apps/mobile/packages/features/client/client_main/lib/client_main.dart @@ -0,0 +1,4 @@ +library; + +export 'src/client_main_module.dart'; +export 'src/presentation/navigation/client_main_navigator.dart'; diff --git a/apps/mobile/packages/features/client/client_main/lib/src/client_main_module.dart b/apps/mobile/packages/features/client/client_main/lib/src/client_main_module.dart new file mode 100644 index 00000000..9b4d7a67 --- /dev/null +++ b/apps/mobile/packages/features/client/client_main/lib/src/client_main_module.dart @@ -0,0 +1,36 @@ +import 'package:billing/billing.dart'; +import 'package:client_home/client_home.dart'; +import 'package:client_coverage/client_coverage.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:view_orders/view_orders.dart'; + +import 'presentation/blocs/client_main_cubit.dart'; +import 'presentation/pages/client_main_page.dart'; +import 'presentation/pages/placeholder_page.dart'; + +class ClientMainModule extends Module { + @override + void binds(Injector i) { + i.addSingleton(ClientMainCubit.new); + } + + @override + void routes(RouteManager r) { + r.child( + '/', + child: (BuildContext context) => const ClientMainPage(), + children: >[ + ModuleRoute('/home', module: ClientHomeModule()), + ModuleRoute('/coverage', module: CoverageModule()), + ModuleRoute('/billing', module: BillingModule()), + ModuleRoute('/orders', module: ViewOrdersModule()), + ChildRoute( + '/reports', + child: (BuildContext context) => + const PlaceholderPage(title: 'Reports'), + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/client/client_main/lib/src/presentation/blocs/client_main_cubit.dart b/apps/mobile/packages/features/client/client_main/lib/src/presentation/blocs/client_main_cubit.dart new file mode 100644 index 00000000..1d68e240 --- /dev/null +++ b/apps/mobile/packages/features/client/client_main/lib/src/presentation/blocs/client_main_cubit.dart @@ -0,0 +1,62 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'client_main_state.dart'; + +class ClientMainCubit extends Cubit implements Disposable { + ClientMainCubit() : super(const ClientMainState()) { + Modular.to.addListener(_onRouteChanged); + _onRouteChanged(); + } + + void _onRouteChanged() { + final String path = Modular.to.path; + int newIndex = state.currentIndex; + + // Detect which tab is active based on the route path + // Using contains() to handle child routes and trailing slashes + if (path.contains('/client-main/coverage')) { + newIndex = 0; + } else if (path.contains('/client-main/billing')) { + newIndex = 1; + } else if (path.contains('/client-main/home')) { + newIndex = 2; + } else if (path.contains('/client-main/orders')) { + newIndex = 3; + } else if (path.contains('/client-main/reports')) { + newIndex = 4; + } + + if (newIndex != state.currentIndex) { + emit(state.copyWith(currentIndex: newIndex)); + } + } + + void navigateToTab(int index) { + if (index == state.currentIndex) return; + + switch (index) { + case 0: + Modular.to.navigate('/client-main/coverage'); + break; + case 1: + Modular.to.navigate('/client-main/billing'); + break; + case 2: + Modular.to.navigate('/client-main/home'); + break; + case 3: + Modular.to.navigate('/client-main/orders'); + break; + case 4: + Modular.to.navigate('/client-main/reports'); + break; + } + // State update will happen via _onRouteChanged + } + + @override + void dispose() { + Modular.to.removeListener(_onRouteChanged); + close(); + } +} diff --git a/apps/mobile/packages/features/client/client_main/lib/src/presentation/blocs/client_main_state.dart b/apps/mobile/packages/features/client/client_main/lib/src/presentation/blocs/client_main_state.dart new file mode 100644 index 00000000..f2573616 --- /dev/null +++ b/apps/mobile/packages/features/client/client_main/lib/src/presentation/blocs/client_main_state.dart @@ -0,0 +1,16 @@ +import 'package:equatable/equatable.dart'; + +class ClientMainState extends Equatable { + const ClientMainState({ + this.currentIndex = 2, // Default to Home + }); + + final int currentIndex; + + ClientMainState copyWith({int? currentIndex}) { + return ClientMainState(currentIndex: currentIndex ?? this.currentIndex); + } + + @override + List get props => [currentIndex]; +} diff --git a/apps/mobile/packages/features/client/client_main/lib/src/presentation/navigation/client_main_navigator.dart b/apps/mobile/packages/features/client/client_main/lib/src/presentation/navigation/client_main_navigator.dart new file mode 100644 index 00000000..a0102f90 --- /dev/null +++ b/apps/mobile/packages/features/client/client_main/lib/src/presentation/navigation/client_main_navigator.dart @@ -0,0 +1,10 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +/// Extension to provide typed navigation for the Client Main feature. +extension ClientMainNavigator on IModularNavigator { + /// Navigates to the Client Main Shell (Home). + /// This replaces the current navigation stack. + void navigateClientMain() { + navigate('/client-main/'); + } +} diff --git a/apps/mobile/packages/features/client/client_main/lib/src/presentation/pages/client_main_page.dart b/apps/mobile/packages/features/client/client_main/lib/src/presentation/pages/client_main_page.dart new file mode 100644 index 00000000..1429a78f --- /dev/null +++ b/apps/mobile/packages/features/client/client_main/lib/src/presentation/pages/client_main_page.dart @@ -0,0 +1,38 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; + +import '../blocs/client_main_cubit.dart'; +import '../blocs/client_main_state.dart'; +import '../widgets/client_main_bottom_bar.dart'; + +/// The main page for the Client app, acting as a shell for the bottom navigation. +/// +/// It follows KROW Clean Architecture by: +/// - Being a [StatelessWidget]. +/// - Delegating state management to [ClientMainCubit]. +/// - Using [RouterOutlet] for nested navigation. +class ClientMainPage extends StatelessWidget { + const ClientMainPage({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (BuildContext context) => Modular.get(), + child: Scaffold( + extendBody: true, + body: const RouterOutlet(), + bottomNavigationBar: BlocBuilder( + builder: (BuildContext context, ClientMainState state) { + return ClientMainBottomBar( + currentIndex: state.currentIndex, + onTap: (int index) { + BlocProvider.of(context).navigateToTab(index); + }, + ); + }, + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/client_main/lib/src/presentation/pages/placeholder_page.dart b/apps/mobile/packages/features/client/client_main/lib/src/presentation/pages/placeholder_page.dart new file mode 100644 index 00000000..18b9795d --- /dev/null +++ b/apps/mobile/packages/features/client/client_main/lib/src/presentation/pages/placeholder_page.dart @@ -0,0 +1,33 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A placeholder page for features that are not yet implemented. +/// +/// This page displays a simple message indicating that the feature +/// is coming soon. It follows the KROW Design System guidelines by: +/// - Using [UiAppBar] for the app bar +/// - Using [UiTypography] for text styling +/// - Using [UiColors] via typography extensions +class PlaceholderPage extends StatelessWidget { + /// Creates a [PlaceholderPage]. + /// + /// The [title] is displayed in the app bar and used in the + /// "coming soon" message. + const PlaceholderPage({required this.title, super.key}); + + /// The title of the feature being displayed. + final String title; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: UiAppBar(title: title), + body: Center( + child: Text( + '$title Feature Coming Soon', + style: UiTypography.body1r.textPrimary, + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/client_main/lib/src/presentation/widgets/client_main_bottom_bar.dart b/apps/mobile/packages/features/client/client_main/lib/src/presentation/widgets/client_main_bottom_bar.dart new file mode 100644 index 00000000..e59987cf --- /dev/null +++ b/apps/mobile/packages/features/client/client_main/lib/src/presentation/widgets/client_main_bottom_bar.dart @@ -0,0 +1,156 @@ +import 'dart:ui'; + +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A custom bottom navigation bar for the Client app. +/// +/// This widget provides a glassmorphic bottom navigation bar with blur effect +/// and follows the KROW Design System guidelines. It displays five tabs: +/// Coverage, Billing, Home, Orders, and Reports. +/// +/// The widget uses: +/// - [UiColors] for all color values +/// - [UiTypography] for text styling +/// - [UiIcons] for icon assets +/// - [UiConstants] for spacing and sizing +class ClientMainBottomBar extends StatelessWidget { + /// Creates a [ClientMainBottomBar]. + /// + /// The [currentIndex] indicates which tab is currently selected. + /// The [onTap] callback is invoked when a tab is tapped. + const ClientMainBottomBar({ + required this.currentIndex, + required this.onTap, + super.key, + }); + + /// The index of the currently selected tab. + final int currentIndex; + + /// Callback invoked when a tab is tapped. + /// + /// The callback receives the index of the tapped tab. + final ValueChanged onTap; + + @override + Widget build(BuildContext context) { + // Client App colors from design system + const Color activeColor = UiColors.textPrimary; + const Color inactiveColor = UiColors.textInactive; + + return Stack( + clipBehavior: Clip.none, + children: [ + // Glassmorphic background with blur effect + Positioned.fill( + child: ClipRect( + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + decoration: BoxDecoration( + color: UiColors.white.withValues(alpha: 0.85), + border: Border( + top: BorderSide( + color: UiColors.black.withValues(alpha: 0.1), + ), + ), + ), + ), + ), + ), + ), + // Navigation items + Container( + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).padding.bottom + UiConstants.space2, + top: UiConstants.space4, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + _buildNavItem( + index: 0, + icon: UiIcons.calendar, + label: t.client_main.tabs.coverage, + activeColor: activeColor, + inactiveColor: inactiveColor, + ), + _buildNavItem( + index: 1, + icon: UiIcons.dollar, + label: t.client_main.tabs.billing, + activeColor: activeColor, + inactiveColor: inactiveColor, + ), + _buildNavItem( + index: 2, + icon: UiIcons.building, + label: t.client_main.tabs.home, + activeColor: activeColor, + inactiveColor: inactiveColor, + ), + _buildNavItem( + index: 3, + icon: UiIcons.file, + label: t.client_main.tabs.orders, + activeColor: activeColor, + inactiveColor: inactiveColor, + ), + _buildNavItem( + index: 4, + icon: UiIcons.chart, + label: t.client_main.tabs.reports, + activeColor: activeColor, + inactiveColor: inactiveColor, + ), + ], + ), + ), + ], + ); + } + + /// Builds a single navigation item. + /// + /// Uses design system tokens for all styling: + /// - Icon size uses a standard value (24px is acceptable for navigation icons) + /// - Spacing uses [UiConstants.space1] + /// - Typography uses [UiTypography.footnote2m] + /// - Colors are passed as parameters from design system + Widget _buildNavItem({ + required int index, + required IconData icon, + required String label, + required Color activeColor, + required Color inactiveColor, + }) { + final bool isSelected = currentIndex == index; + return Expanded( + child: GestureDetector( + onTap: () => onTap(index), + behavior: HitTestBehavior.opaque, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Icon( + icon, + color: isSelected ? activeColor : inactiveColor, + size: 24, // Standard navigation icon size + ), + const SizedBox(height: UiConstants.space1), + Text( + label, + style: UiTypography.footnote2m.copyWith( + color: isSelected ? activeColor : inactiveColor, + ), + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/client_main/pubspec.yaml b/apps/mobile/packages/features/client/client_main/pubspec.yaml new file mode 100644 index 00000000..7e1545f1 --- /dev/null +++ b/apps/mobile/packages/features/client/client_main/pubspec.yaml @@ -0,0 +1,45 @@ +name: client_main +description: Main shell and navigation for the client application. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + flutter_modular: ^6.3.0 + equatable: ^2.0.5 + lucide_icons: ^0.257.0 + + # Architecture Packages + design_system: + path: ../../../design_system + core_localization: + path: ../../../core_localization + client_home: + path: ../home + client_coverage: + path: ../client_coverage + view_orders: + path: ../view_orders + billing: + path: ../billing + + # Intentionally commenting these out as they might not exist yet + # client_settings: + # path: ../settings + +dev_dependencies: + flutter_test: + sdk: flutter + bloc_test: ^9.1.0 + mocktail: ^1.0.0 + flutter_lints: ^6.0.0 + +flutter: + uses-material-design: true diff --git a/apps/mobile/packages/features/client/client_main/test/presentation/blocs/client_main_cubit_test.dart b/apps/mobile/packages/features/client/client_main/test/presentation/blocs/client_main_cubit_test.dart new file mode 100644 index 00000000..1ef6ab40 --- /dev/null +++ b/apps/mobile/packages/features/client/client_main/test/presentation/blocs/client_main_cubit_test.dart @@ -0,0 +1,37 @@ +import 'package:client_main/src/presentation/blocs/client_main_cubit.dart'; +import 'package:client_main/src/presentation/blocs/client_main_state.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mocktail/mocktail.dart'; + +class MockIModularNavigator extends Mock implements IModularNavigator {} + +void main() { + group('ClientMainCubit', () { + late MockIModularNavigator navigator; + + setUp(() { + navigator = MockIModularNavigator(); + when(() => navigator.path).thenReturn('/home'); + when(() => navigator.addListener(any())).thenReturn(null); + // Stub addListener to avoid errors when Cubit adds listener + // Note: addListener might be on Modular directly or via some other mechanic, + // but for this unit test we just want to suppress errors if possible or let the Cubit work. + // Actually Modular.to.addListener calls Modular.navigatorDelegate.addListener if it exists? + // Modular.to.addListener uses the internal RouterDelegate. + // Mocking Modular internals is hard. + + // Let's rely on the fact that we mocked navigatorDelegate. + Modular.navigatorDelegate = navigator; + }); + + test('initial state is correct', () { + final ClientMainCubit cubit = ClientMainCubit(); + expect(cubit.state, const ClientMainState(currentIndex: 2)); + cubit.close(); + }); + + // Note: Testing actual route changes requires more complex Modular mocking + // or integration tests, but the structure allows it. + }); +} diff --git a/apps/mobile/packages/features/client/create_order/lib/client_create_order.dart b/apps/mobile/packages/features/client/create_order/lib/client_create_order.dart new file mode 100644 index 00000000..777d3b29 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/client_create_order.dart @@ -0,0 +1,4 @@ +/// Library for the Client Create Order feature. +library; + +export 'src/create_order_module.dart'; diff --git a/apps/mobile/packages/features/client/create_order/lib/src/create_order_module.dart b/apps/mobile/packages/features/client/create_order/lib/src/create_order_module.dart new file mode 100644 index 00000000..f539b1bf --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/create_order_module.dart @@ -0,0 +1,74 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:firebase_auth/firebase_auth.dart' as firebase; +import 'data/repositories_impl/client_create_order_repository_impl.dart'; +import 'domain/repositories/client_create_order_repository_interface.dart'; +import 'domain/usecases/create_one_time_order_usecase.dart'; +import 'domain/usecases/create_rapid_order_usecase.dart'; +import 'domain/usecases/get_order_types_usecase.dart'; +import 'presentation/blocs/client_create_order_bloc.dart'; +import 'presentation/blocs/one_time_order_bloc.dart'; +import 'presentation/blocs/rapid_order_bloc.dart'; +import 'presentation/pages/create_order_page.dart'; +import 'presentation/pages/one_time_order_page.dart'; +import 'presentation/pages/permanent_order_page.dart'; +import 'presentation/pages/rapid_order_page.dart'; +import 'presentation/pages/recurring_order_page.dart'; + +/// Module for the Client Create Order feature. +/// +/// This module orchestrates the dependency injection for the create order feature, +/// connecting the domain use cases with their data layer implementations and +/// presentation layer BLoCs. +class ClientCreateOrderModule extends Module { + @override + List get imports => [DataConnectModule()]; + + @override + void binds(Injector i) { + // Repositories + i.addLazySingleton( + () => ClientCreateOrderRepositoryImpl( + firebaseAuth: firebase.FirebaseAuth.instance, + dataConnect: ExampleConnector.instance, + ), + ); + + // UseCases + i.addLazySingleton(GetOrderTypesUseCase.new); + i.addLazySingleton(CreateOneTimeOrderUseCase.new); + i.addLazySingleton(CreateRapidOrderUseCase.new); + + // BLoCs + i.addSingleton(ClientCreateOrderBloc.new); + i.add(RapidOrderBloc.new); + i.add( + () => OneTimeOrderBloc( + i.get(), + ExampleConnector.instance, + ), + ); + } + + @override + void routes(RouteManager r) { + r.child( + '/', + child: (BuildContext context) => const ClientCreateOrderPage(), + ); + r.child('/rapid', child: (BuildContext context) => const RapidOrderPage()); + r.child( + '/one-time', + child: (BuildContext context) => const OneTimeOrderPage(), + ); + r.child( + '/recurring', + child: (BuildContext context) => const RecurringOrderPage(), + ); + r.child( + '/permanent', + child: (BuildContext context) => const PermanentOrderPage(), + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/data/repositories_impl/client_create_order_repository_impl.dart b/apps/mobile/packages/features/client/create_order/lib/src/data/repositories_impl/client_create_order_repository_impl.dart new file mode 100644 index 00000000..0318b8b7 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/data/repositories_impl/client_create_order_repository_impl.dart @@ -0,0 +1,197 @@ +import 'package:firebase_auth/firebase_auth.dart' as firebase; +import 'package:firebase_data_connect/firebase_data_connect.dart' as fdc; +import 'package:intl/intl.dart'; +import 'package:krow_data_connect/krow_data_connect.dart' as dc; +import 'package:krow_domain/krow_domain.dart' as domain; +import '../../domain/repositories/client_create_order_repository_interface.dart'; + +/// Implementation of [ClientCreateOrderRepositoryInterface]. +/// +/// This implementation coordinates data access for order creation by delegating +/// to the [OrderRepositoryMock] and [ExampleConnector] from the shared +/// Data Connect package. +/// +/// It follows the KROW Clean Architecture by keeping the data layer focused +/// on delegation and data mapping, without business logic. +class ClientCreateOrderRepositoryImpl + implements ClientCreateOrderRepositoryInterface { + ClientCreateOrderRepositoryImpl({ + required firebase.FirebaseAuth firebaseAuth, + required dc.ExampleConnector dataConnect, + }) : _firebaseAuth = firebaseAuth, + _dataConnect = dataConnect; + + final firebase.FirebaseAuth _firebaseAuth; + final dc.ExampleConnector _dataConnect; + + @override + Future> getOrderTypes() { + return Future.value(const [ + domain.OrderType( + id: 'rapid', + titleKey: 'client_create_order.types.rapid', + descriptionKey: 'client_create_order.types.rapid_desc', + ), + domain.OrderType( + id: 'one-time', + titleKey: 'client_create_order.types.one_time', + descriptionKey: 'client_create_order.types.one_time_desc', + ), + domain.OrderType( + id: 'recurring', + titleKey: 'client_create_order.types.recurring', + descriptionKey: 'client_create_order.types.recurring_desc', + ), + domain.OrderType( + id: 'permanent', + titleKey: 'client_create_order.types.permanent', + descriptionKey: 'client_create_order.types.permanent_desc', + ), + ]); + } + + @override + Future createOneTimeOrder(domain.OneTimeOrder order) async { + final String? businessId = dc.ClientSessionStore.instance.session?.business?.id; + if (businessId == null || businessId.isEmpty) { + await _firebaseAuth.signOut(); + throw Exception('Business is missing. Please sign in again.'); + } + final String? vendorId = order.vendorId; + if (vendorId == null || vendorId.isEmpty) { + throw Exception('Vendor is missing.'); + } + + final fdc.Timestamp orderTimestamp = _toTimestamp(order.date); + final fdc.OperationResult orderResult = await _dataConnect + .createOrder(businessId: businessId, orderType: dc.OrderType.ONE_TIME) + .vendorId(vendorId) + .location(order.location) + .status(dc.OrderStatus.POSTED) + .date(orderTimestamp) + .execute(); + + final String? orderId = orderResult.data?.order_insert.id; + if (orderId == null) { + throw Exception('Order creation failed.'); + } + + final int workersNeeded = order.positions.fold( + 0, + (int sum, domain.OneTimeOrderPosition position) => sum + position.count, + ); + final String shiftTitle = 'Shift 1 ${_formatDate(order.date)}'; + final double shiftCost = _calculateShiftCost(order); + + final fdc.OperationResult shiftResult = await _dataConnect + .createShift(title: shiftTitle, orderId: orderId) + .date(orderTimestamp) + .location(order.location) + .locationAddress(order.location) + .status(dc.ShiftStatus.PENDING) + .workersNeeded(workersNeeded) + .filled(0) + .durationDays(1) + .cost(shiftCost) + .execute(); + + final String? shiftId = shiftResult.data?.shift_insert.id; + if (shiftId == null) { + throw Exception('Shift creation failed.'); + } + + for (final domain.OneTimeOrderPosition position in order.positions) { + final DateTime start = _parseTime(order.date, position.startTime); + final DateTime end = _parseTime(order.date, position.endTime); + final DateTime normalizedEnd = + end.isBefore(start) ? end.add(const Duration(days: 1)) : end; + final double hours = normalizedEnd.difference(start).inMinutes / 60.0; + final double rate = order.roleRates[position.role] ?? 0; + final double totalValue = rate * hours * position.count; + + await _dataConnect + .createShiftRole( + shiftId: shiftId, + roleId: position.role, + count: position.count, + ) + .startTime(_toTimestamp(start)) + .endTime(_toTimestamp(normalizedEnd)) + .hours(hours) + .breakType(_breakDurationFromValue(position.lunchBreak)) + .totalValue(totalValue) + .execute(); + } + + await _dataConnect + .updateOrder(id: orderId) + .shifts(fdc.AnyValue([shiftId])) + .execute(); + } + + @override + Future createRapidOrder(String description) async { + // TO-DO: connect IA and return array with the information. + throw UnimplementedError('Rapid order IA is not connected yet.'); + } + + double _calculateShiftCost(domain.OneTimeOrder order) { + double total = 0; + for (final domain.OneTimeOrderPosition position in order.positions) { + final DateTime start = _parseTime(order.date, position.startTime); + final DateTime end = _parseTime(order.date, position.endTime); + final DateTime normalizedEnd = + end.isBefore(start) ? end.add(const Duration(days: 1)) : end; + final double hours = normalizedEnd.difference(start).inMinutes / 60.0; + final double rate = order.roleRates[position.role] ?? 0; + total += rate * hours * position.count; + } + return total; + } + + dc.BreakDuration _breakDurationFromValue(String value) { + switch (value) { + case 'MIN_15': + return dc.BreakDuration.MIN_15; + case 'MIN_30': + return dc.BreakDuration.MIN_30; + default: + return dc.BreakDuration.NO_BREAK; + } + } + + DateTime _parseTime(DateTime date, String time) { + if (time.trim().isEmpty) { + throw Exception('Shift time is missing.'); + } + + DateTime parsed; + try { + parsed = DateFormat.jm().parse(time); + } catch (_) { + parsed = DateFormat.Hm().parse(time); + } + + return DateTime( + date.year, + date.month, + date.day, + parsed.hour, + parsed.minute, + ); + } + + fdc.Timestamp _toTimestamp(DateTime dateTime) { + final DateTime utc = dateTime.toUtc(); + final int seconds = utc.millisecondsSinceEpoch ~/ 1000; + final int nanoseconds = (utc.microsecondsSinceEpoch % 1000000) * 1000; + return fdc.Timestamp(nanoseconds, seconds); + } + + String _formatDate(DateTime dateTime) { + final String year = dateTime.year.toString().padLeft(4, '0'); + final String month = dateTime.month.toString().padLeft(2, '0'); + final String day = dateTime.day.toString().padLeft(2, '0'); + return '$year-$month-$day'; + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/domain/arguments/one_time_order_arguments.dart b/apps/mobile/packages/features/client/create_order/lib/src/domain/arguments/one_time_order_arguments.dart new file mode 100644 index 00000000..e2f03f83 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/domain/arguments/one_time_order_arguments.dart @@ -0,0 +1,19 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; + +/// Represents the arguments required for the [CreateOneTimeOrderUseCase]. +/// +/// Encapsulates the [OneTimeOrder] details required to create a new +/// one-time staffing request. +class OneTimeOrderArguments extends UseCaseArgument { + /// Creates a [OneTimeOrderArguments] instance. + /// + /// Requires the [order] details. + const OneTimeOrderArguments({required this.order}); + + /// The order details to be created. + final OneTimeOrder order; + + @override + List get props => [order]; +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/domain/arguments/rapid_order_arguments.dart b/apps/mobile/packages/features/client/create_order/lib/src/domain/arguments/rapid_order_arguments.dart new file mode 100644 index 00000000..e6c4d95b --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/domain/arguments/rapid_order_arguments.dart @@ -0,0 +1,18 @@ +import 'package:krow_core/core.dart'; + +/// Represents the arguments required for the [CreateRapidOrderUseCase]. +/// +/// Encapsulates the text description of the urgent staffing need +/// for rapid order creation. +class RapidOrderArguments extends UseCaseArgument { + /// Creates a [RapidOrderArguments] instance. + /// + /// Requires the [description] of the staffing need. + const RapidOrderArguments({required this.description}); + + /// The text description of the urgent staffing need. + final String description; + + @override + List get props => [description]; +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/domain/repositories/client_create_order_repository_interface.dart b/apps/mobile/packages/features/client/create_order/lib/src/domain/repositories/client_create_order_repository_interface.dart new file mode 100644 index 00000000..9f2fd567 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/domain/repositories/client_create_order_repository_interface.dart @@ -0,0 +1,24 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Interface for the Client Create Order repository. +/// +/// This repository is responsible for: +/// 1. Retrieving available order types for the client. +/// 2. Submitting different types of staffing orders (Rapid, One-Time). +/// +/// It follows the KROW Clean Architecture by defining the contract in the +/// domain layer, to be implemented in the data layer. +abstract interface class ClientCreateOrderRepositoryInterface { + /// Retrieves the list of available order types (e.g., Rapid, One-Time, Recurring). + Future> getOrderTypes(); + + /// Submits a one-time staffing order with specific details. + /// + /// [order] contains the date, location, and required positions. + Future createOneTimeOrder(OneTimeOrder order); + + /// Submits a rapid (urgent) staffing order via a text description. + /// + /// [description] is the text message (or transcribed voice) describing the need. + Future createRapidOrder(String description); +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/domain/usecases/create_one_time_order_usecase.dart b/apps/mobile/packages/features/client/create_order/lib/src/domain/usecases/create_one_time_order_usecase.dart new file mode 100644 index 00000000..4f320a65 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/domain/usecases/create_one_time_order_usecase.dart @@ -0,0 +1,22 @@ +import 'package:krow_core/core.dart'; +import '../arguments/one_time_order_arguments.dart'; +import '../repositories/client_create_order_repository_interface.dart'; + +/// Use case for creating a one-time staffing order. +/// +/// This use case encapsulates the logic for submitting a structured +/// staffing request and delegates the data operation to the +/// [ClientCreateOrderRepositoryInterface]. +class CreateOneTimeOrderUseCase + implements UseCase { + /// Creates a [CreateOneTimeOrderUseCase]. + /// + /// Requires a [ClientCreateOrderRepositoryInterface] to interact with the data layer. + const CreateOneTimeOrderUseCase(this._repository); + final ClientCreateOrderRepositoryInterface _repository; + + @override + Future call(OneTimeOrderArguments input) { + return _repository.createOneTimeOrder(input.order); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/domain/usecases/create_rapid_order_usecase.dart b/apps/mobile/packages/features/client/create_order/lib/src/domain/usecases/create_rapid_order_usecase.dart new file mode 100644 index 00000000..cf7a1459 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/domain/usecases/create_rapid_order_usecase.dart @@ -0,0 +1,20 @@ +import 'package:krow_core/core.dart'; +import '../arguments/rapid_order_arguments.dart'; +import '../repositories/client_create_order_repository_interface.dart'; + +/// Use case for creating a rapid (urgent) staffing order. +/// +/// This use case handles urgent, text-based staffing requests and +/// delegates the submission to the [ClientCreateOrderRepositoryInterface]. +class CreateRapidOrderUseCase implements UseCase { + /// Creates a [CreateRapidOrderUseCase]. + /// + /// Requires a [ClientCreateOrderRepositoryInterface] to interact with the data layer. + const CreateRapidOrderUseCase(this._repository); + final ClientCreateOrderRepositoryInterface _repository; + + @override + Future call(RapidOrderArguments input) { + return _repository.createRapidOrder(input.description); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/domain/usecases/get_order_types_usecase.dart b/apps/mobile/packages/features/client/create_order/lib/src/domain/usecases/get_order_types_usecase.dart new file mode 100644 index 00000000..7fb0cc5a --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/domain/usecases/get_order_types_usecase.dart @@ -0,0 +1,20 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/client_create_order_repository_interface.dart'; + +/// Use case for retrieving the available order types for a client. +/// +/// This use case fetches the list of supported staffing order types +/// from the [ClientCreateOrderRepositoryInterface]. +class GetOrderTypesUseCase implements NoInputUseCase> { + /// Creates a [GetOrderTypesUseCase]. + /// + /// Requires a [ClientCreateOrderRepositoryInterface] to interact with the data layer. + const GetOrderTypesUseCase(this._repository); + final ClientCreateOrderRepositoryInterface _repository; + + @override + Future> call() { + return _repository.getOrderTypes(); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/client_create_order_bloc.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/client_create_order_bloc.dart new file mode 100644 index 00000000..4ce8b483 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/client_create_order_bloc.dart @@ -0,0 +1,23 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/usecases/get_order_types_usecase.dart'; +import 'client_create_order_event.dart'; +import 'client_create_order_state.dart'; + +/// BLoC for managing the list of available order types. +class ClientCreateOrderBloc + extends Bloc { + ClientCreateOrderBloc(this._getOrderTypesUseCase) + : super(const ClientCreateOrderInitial()) { + on(_onTypesRequested); + } + final GetOrderTypesUseCase _getOrderTypesUseCase; + + Future _onTypesRequested( + ClientCreateOrderTypesRequested event, + Emitter emit, + ) async { + final List types = await _getOrderTypesUseCase(); + emit(ClientCreateOrderLoadSuccess(types)); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/client_create_order_event.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/client_create_order_event.dart new file mode 100644 index 00000000..a3328da4 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/client_create_order_event.dart @@ -0,0 +1,20 @@ +import 'package:equatable/equatable.dart'; + +abstract class ClientCreateOrderEvent extends Equatable { + const ClientCreateOrderEvent(); + + @override + List get props => []; +} + +class ClientCreateOrderTypesRequested extends ClientCreateOrderEvent { + const ClientCreateOrderTypesRequested(); +} + +class ClientCreateOrderTypeSelected extends ClientCreateOrderEvent { + const ClientCreateOrderTypeSelected(this.typeId); + final String typeId; + + @override + List get props => [typeId]; +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/client_create_order_state.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/client_create_order_state.dart new file mode 100644 index 00000000..5ef17693 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/client_create_order_state.dart @@ -0,0 +1,26 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; + +/// Base state for the [ClientCreateOrderBloc]. +abstract class ClientCreateOrderState extends Equatable { + const ClientCreateOrderState(); + + @override + List get props => []; +} + +/// Initial state when order types haven't been loaded yet. +class ClientCreateOrderInitial extends ClientCreateOrderState { + const ClientCreateOrderInitial(); +} + +/// State representing successfully loaded order types from the repository. +class ClientCreateOrderLoadSuccess extends ClientCreateOrderState { + const ClientCreateOrderLoadSuccess(this.orderTypes); + + /// The list of available order types retrieved from the domain. + final List orderTypes; + + @override + List get props => [orderTypes]; +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/one_time_order_bloc.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/one_time_order_bloc.dart new file mode 100644 index 00000000..20d7fea4 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/one_time_order_bloc.dart @@ -0,0 +1,170 @@ +import 'package:firebase_data_connect/firebase_data_connect.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:krow_data_connect/krow_data_connect.dart' as dc; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/arguments/one_time_order_arguments.dart'; +import '../../domain/usecases/create_one_time_order_usecase.dart'; +import 'one_time_order_event.dart'; +import 'one_time_order_state.dart'; + +/// BLoC for managing the multi-step one-time order creation form. +class OneTimeOrderBloc extends Bloc { + OneTimeOrderBloc(this._createOneTimeOrderUseCase, this._dataConnect) + : super(OneTimeOrderState.initial()) { + on(_onVendorsLoaded); + on(_onVendorChanged); + on(_onDateChanged); + on(_onLocationChanged); + on(_onPositionAdded); + on(_onPositionRemoved); + on(_onPositionUpdated); + on(_onSubmitted); + + _loadVendors(); + } + final CreateOneTimeOrderUseCase _createOneTimeOrderUseCase; + final dc.ExampleConnector _dataConnect; + + Future _loadVendors() async { + try { + final QueryResult result = await _dataConnect.listVendors().execute(); + final List vendors = result.data.vendors + .map( + (dc.ListVendorsVendors vendor) => Vendor( + id: vendor.id, + name: vendor.companyName, + rates: const {}, + ), + ) + .toList(); + add(OneTimeOrderVendorsLoaded(vendors)); + } catch (_) { + add(const OneTimeOrderVendorsLoaded([])); + } + } + + Future _loadRolesForVendor(String vendorId) async { + try { + final QueryResult result = await _dataConnect.listRolesByVendorId( + vendorId: vendorId, + ).execute(); + final List roles = result.data.roles + .map( + (dc.ListRolesByVendorIdRoles role) => OneTimeOrderRoleOption( + id: role.id, + name: role.name, + costPerHour: role.costPerHour, + ), + ) + .toList(); + emit(state.copyWith(roles: roles)); + } catch (_) { + emit(state.copyWith(roles: const [])); + } + } + + void _onVendorsLoaded( + OneTimeOrderVendorsLoaded event, + Emitter emit, + ) { + final Vendor? selectedVendor = + event.vendors.isNotEmpty ? event.vendors.first : null; + emit( + state.copyWith( + vendors: event.vendors, + selectedVendor: selectedVendor, + ), + ); + if (selectedVendor != null) { + _loadRolesForVendor(selectedVendor.id); + } + } + + void _onVendorChanged( + OneTimeOrderVendorChanged event, + Emitter emit, + ) { + emit(state.copyWith(selectedVendor: event.vendor)); + _loadRolesForVendor(event.vendor.id); + } + + void _onDateChanged( + OneTimeOrderDateChanged event, + Emitter emit, + ) { + emit(state.copyWith(date: event.date)); + } + + void _onLocationChanged( + OneTimeOrderLocationChanged event, + Emitter emit, + ) { + emit(state.copyWith(location: event.location)); + } + + void _onPositionAdded( + OneTimeOrderPositionAdded event, + Emitter emit, + ) { + final List newPositions = + List.from(state.positions)..add( + const OneTimeOrderPosition( + role: '', + count: 1, + startTime: '09:00', + endTime: '17:00', + ), + ); + emit(state.copyWith(positions: newPositions)); + } + + void _onPositionRemoved( + OneTimeOrderPositionRemoved event, + Emitter emit, + ) { + if (state.positions.length > 1) { + final List newPositions = + List.from(state.positions) + ..removeAt(event.index); + emit(state.copyWith(positions: newPositions)); + } + } + + void _onPositionUpdated( + OneTimeOrderPositionUpdated event, + Emitter emit, + ) { + final List newPositions = + List.from(state.positions); + newPositions[event.index] = event.position; + emit(state.copyWith(positions: newPositions)); + } + + Future _onSubmitted( + OneTimeOrderSubmitted event, + Emitter emit, + ) async { + emit(state.copyWith(status: OneTimeOrderStatus.loading)); + try { + final Map roleRates = { + for (final OneTimeOrderRoleOption role in state.roles) role.id: role.costPerHour, + }; + final OneTimeOrder order = OneTimeOrder( + date: state.date, + location: state.location, + positions: state.positions, + vendorId: state.selectedVendor?.id, + roleRates: roleRates, + ); + await _createOneTimeOrderUseCase(OneTimeOrderArguments(order: order)); + emit(state.copyWith(status: OneTimeOrderStatus.success)); + } catch (e) { + emit( + state.copyWith( + status: OneTimeOrderStatus.failure, + errorMessage: e.toString(), + ), + ); + } + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/one_time_order_event.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/one_time_order_event.dart new file mode 100644 index 00000000..ec9d4fcd --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/one_time_order_event.dart @@ -0,0 +1,66 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; + +abstract class OneTimeOrderEvent extends Equatable { + const OneTimeOrderEvent(); + + @override + List get props => []; +} + +class OneTimeOrderVendorsLoaded extends OneTimeOrderEvent { + const OneTimeOrderVendorsLoaded(this.vendors); + final List vendors; + + @override + List get props => [vendors]; +} + +class OneTimeOrderVendorChanged extends OneTimeOrderEvent { + const OneTimeOrderVendorChanged(this.vendor); + final Vendor vendor; + + @override + List get props => [vendor]; +} + +class OneTimeOrderDateChanged extends OneTimeOrderEvent { + const OneTimeOrderDateChanged(this.date); + final DateTime date; + + @override + List get props => [date]; +} + +class OneTimeOrderLocationChanged extends OneTimeOrderEvent { + const OneTimeOrderLocationChanged(this.location); + final String location; + + @override + List get props => [location]; +} + +class OneTimeOrderPositionAdded extends OneTimeOrderEvent { + const OneTimeOrderPositionAdded(); +} + +class OneTimeOrderPositionRemoved extends OneTimeOrderEvent { + const OneTimeOrderPositionRemoved(this.index); + final int index; + + @override + List get props => [index]; +} + +class OneTimeOrderPositionUpdated extends OneTimeOrderEvent { + const OneTimeOrderPositionUpdated(this.index, this.position); + final int index; + final OneTimeOrderPosition position; + + @override + List get props => [index, position]; +} + +class OneTimeOrderSubmitted extends OneTimeOrderEvent { + const OneTimeOrderSubmitted(); +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/one_time_order_state.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/one_time_order_state.dart new file mode 100644 index 00000000..a6d7a06d --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/one_time_order_state.dart @@ -0,0 +1,86 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; + +enum OneTimeOrderStatus { initial, loading, success, failure } + +class OneTimeOrderState extends Equatable { + const OneTimeOrderState({ + required this.date, + required this.location, + required this.positions, + this.status = OneTimeOrderStatus.initial, + this.errorMessage, + this.vendors = const [], + this.selectedVendor, + this.roles = const [], + }); + + factory OneTimeOrderState.initial() { + return OneTimeOrderState( + date: DateTime.now(), + location: '', + positions: const [ + OneTimeOrderPosition(role: '', count: 1, startTime: '', endTime: ''), + ], + vendors: const [], + roles: const [], + ); + } + final DateTime date; + final String location; + final List positions; + final OneTimeOrderStatus status; + final String? errorMessage; + final List vendors; + final Vendor? selectedVendor; + final List roles; + + OneTimeOrderState copyWith({ + DateTime? date, + String? location, + List? positions, + OneTimeOrderStatus? status, + String? errorMessage, + List? vendors, + Vendor? selectedVendor, + List? roles, + }) { + return OneTimeOrderState( + date: date ?? this.date, + location: location ?? this.location, + positions: positions ?? this.positions, + status: status ?? this.status, + errorMessage: errorMessage ?? this.errorMessage, + vendors: vendors ?? this.vendors, + selectedVendor: selectedVendor ?? this.selectedVendor, + roles: roles ?? this.roles, + ); + } + + @override + List get props => [ + date, + location, + positions, + status, + errorMessage, + vendors, + selectedVendor, + roles, + ]; +} + +class OneTimeOrderRoleOption extends Equatable { + const OneTimeOrderRoleOption({ + required this.id, + required this.name, + required this.costPerHour, + }); + + final String id; + final String name; + final double costPerHour; + + @override + List get props => [id, name, costPerHour]; +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/rapid_order_bloc.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/rapid_order_bloc.dart new file mode 100644 index 00000000..4f3e6874 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/rapid_order_bloc.dart @@ -0,0 +1,92 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../../domain/arguments/rapid_order_arguments.dart'; +import '../../domain/usecases/create_rapid_order_usecase.dart'; +import 'rapid_order_event.dart'; +import 'rapid_order_state.dart'; + +/// BLoC for managing the rapid (urgent) order creation flow. +class RapidOrderBloc extends Bloc { + RapidOrderBloc(this._createRapidOrderUseCase) + : super( + const RapidOrderInitial( + examples: [ + '"We had a call out. Need 2 cooks ASAP"', + '"Need 5 bartenders ASAP until 5am"', + '"Emergency! Need 3 servers right now till midnight"', + ], + ), + ) { + on(_onMessageChanged); + on(_onVoiceToggled); + on(_onSubmitted); + on(_onExampleSelected); + } + final CreateRapidOrderUseCase _createRapidOrderUseCase; + + void _onMessageChanged( + RapidOrderMessageChanged event, + Emitter emit, + ) { + if (state is RapidOrderInitial) { + emit((state as RapidOrderInitial).copyWith(message: event.message)); + } + } + + Future _onVoiceToggled( + RapidOrderVoiceToggled event, + Emitter emit, + ) async { + if (state is RapidOrderInitial) { + final RapidOrderInitial currentState = state as RapidOrderInitial; + final bool newListeningState = !currentState.isListening; + + emit(currentState.copyWith(isListening: newListeningState)); + + // Simulate voice recognition + if (newListeningState) { + await Future.delayed(const Duration(seconds: 2)); + if (state is RapidOrderInitial) { + emit( + (state as RapidOrderInitial).copyWith( + message: 'Need 2 servers for a banquet right now.', + isListening: false, + ), + ); + } + } + } + } + + Future _onSubmitted( + RapidOrderSubmitted event, + Emitter emit, + ) async { + final RapidOrderState currentState = state; + if (currentState is RapidOrderInitial) { + final String message = currentState.message; + print('RapidOrder submit: message="$message"'); + emit(const RapidOrderSubmitting()); + + try { + await _createRapidOrderUseCase( + RapidOrderArguments(description: message), + ); + print('RapidOrder submit: success'); + emit(const RapidOrderSuccess()); + } catch (e) { + print('RapidOrder submit: error=$e'); + emit(RapidOrderFailure(e.toString())); + } + } + } + + void _onExampleSelected( + RapidOrderExampleSelected event, + Emitter emit, + ) { + if (state is RapidOrderInitial) { + final String cleanedExample = event.example.replaceAll('"', ''); + emit((state as RapidOrderInitial).copyWith(message: cleanedExample)); + } + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/rapid_order_event.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/rapid_order_event.dart new file mode 100644 index 00000000..1c81d06f --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/rapid_order_event.dart @@ -0,0 +1,32 @@ +import 'package:equatable/equatable.dart'; + +abstract class RapidOrderEvent extends Equatable { + const RapidOrderEvent(); + + @override + List get props => []; +} + +class RapidOrderMessageChanged extends RapidOrderEvent { + const RapidOrderMessageChanged(this.message); + final String message; + + @override + List get props => [message]; +} + +class RapidOrderVoiceToggled extends RapidOrderEvent { + const RapidOrderVoiceToggled(); +} + +class RapidOrderSubmitted extends RapidOrderEvent { + const RapidOrderSubmitted(); +} + +class RapidOrderExampleSelected extends RapidOrderEvent { + const RapidOrderExampleSelected(this.example); + final String example; + + @override + List get props => [example]; +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/rapid_order_state.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/rapid_order_state.dart new file mode 100644 index 00000000..6c752b92 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/blocs/rapid_order_state.dart @@ -0,0 +1,50 @@ +import 'package:equatable/equatable.dart'; + +abstract class RapidOrderState extends Equatable { + const RapidOrderState(); + + @override + List get props => []; +} + +class RapidOrderInitial extends RapidOrderState { + const RapidOrderInitial({ + this.message = '', + this.isListening = false, + required this.examples, + }); + final String message; + final bool isListening; + final List examples; + + @override + List get props => [message, isListening, examples]; + + RapidOrderInitial copyWith({ + String? message, + bool? isListening, + List? examples, + }) { + return RapidOrderInitial( + message: message ?? this.message, + isListening: isListening ?? this.isListening, + examples: examples ?? this.examples, + ); + } +} + +class RapidOrderSubmitting extends RapidOrderState { + const RapidOrderSubmitting(); +} + +class RapidOrderSuccess extends RapidOrderState { + const RapidOrderSuccess(); +} + +class RapidOrderFailure extends RapidOrderState { + const RapidOrderFailure(this.error); + final String error; + + @override + List get props => [error]; +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/navigation/client_create_order_navigator.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/navigation/client_create_order_navigator.dart new file mode 100644 index 00000000..4125d94b --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/navigation/client_create_order_navigator.dart @@ -0,0 +1,23 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +extension ClientCreateOrderNavigator on IModularNavigator { + void pushCreateOrder() { + pushNamed('/client/create-order/'); + } + + void pushRapidOrder() { + pushNamed('/client/create-order/rapid'); + } + + void pushOneTimeOrder() { + pushNamed('/client/create-order/one-time'); + } + + void pushRecurringOrder() { + pushNamed('/client/create-order/recurring'); + } + + void pushPermanentOrder() { + pushNamed('/client/create-order/permanent'); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/create_order_page.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/create_order_page.dart new file mode 100644 index 00000000..641363e2 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/create_order_page.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import '../blocs/client_create_order_bloc.dart'; +import '../blocs/client_create_order_event.dart'; +import '../widgets/create_order/create_order_view.dart'; + +/// Main entry page for the client create order flow. +/// +/// This page initializes the [ClientCreateOrderBloc] and displays the [CreateOrderView]. +/// It follows the Krow Clean Architecture by being a [StatelessWidget] and +/// delegating its state and UI to other components. +class ClientCreateOrderPage extends StatelessWidget { + /// Creates a [ClientCreateOrderPage]. + const ClientCreateOrderPage({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (BuildContext context) => + Modular.get() + ..add(const ClientCreateOrderTypesRequested()), + child: const CreateOrderView(), + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/one_time_order_page.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/one_time_order_page.dart new file mode 100644 index 00000000..a5c6202f --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/one_time_order_page.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import '../blocs/one_time_order_bloc.dart'; +import '../widgets/one_time_order/one_time_order_view.dart'; + +/// Page for creating a one-time staffing order. +/// Users can specify the date, location, and multiple staff positions required. +/// +/// This page initializes the [OneTimeOrderBloc] and displays the [OneTimeOrderView]. +/// It follows the Krow Clean Architecture by being a [StatelessWidget] and +/// delegating its state and UI to other components. +class OneTimeOrderPage extends StatelessWidget { + /// Creates a [OneTimeOrderPage]. + const OneTimeOrderPage({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (BuildContext context) => Modular.get(), + child: const OneTimeOrderView(), + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/permanent_order_page.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/permanent_order_page.dart new file mode 100644 index 00000000..fd38a142 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/permanent_order_page.dart @@ -0,0 +1,40 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; + +/// Permanent Order Page - Long-term staffing placement. +/// Placeholder for future implementation. +class PermanentOrderPage extends StatelessWidget { + /// Creates a [PermanentOrderPage]. + const PermanentOrderPage({super.key}); + + @override + Widget build(BuildContext context) { + final TranslationsClientCreateOrderPermanentEn labels = + t.client_create_order.permanent; + + return Scaffold( + backgroundColor: UiColors.bgPrimary, + appBar: UiAppBar( + title: labels.title, + onLeadingPressed: () => Modular.to.pop(), + ), + body: Center( + child: Padding( + padding: const EdgeInsets.all(UiConstants.space6), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + labels.subtitle, + style: UiTypography.body1r.textSecondary, + textAlign: TextAlign.center, + ), + ], + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/rapid_order_page.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/rapid_order_page.dart new file mode 100644 index 00000000..2bb444cf --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/rapid_order_page.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import '../blocs/rapid_order_bloc.dart'; +import '../widgets/rapid_order/rapid_order_view.dart'; + +/// Rapid Order Flow Page - Emergency staffing requests. +/// Features voice recognition simulation and quick example selection. +/// +/// This page initializes the [RapidOrderBloc] and displays the [RapidOrderView]. +/// It follows the Krow Clean Architecture by being a [StatelessWidget] and +/// delegating its state and UI to other components. +class RapidOrderPage extends StatelessWidget { + /// Creates a [RapidOrderPage]. + const RapidOrderPage({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (BuildContext context) => Modular.get(), + child: const RapidOrderView(), + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/recurring_order_page.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/recurring_order_page.dart new file mode 100644 index 00000000..64324b46 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/pages/recurring_order_page.dart @@ -0,0 +1,40 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; + +/// Recurring Order Page - Ongoing weekly/monthly coverage. +/// Placeholder for future implementation. +class RecurringOrderPage extends StatelessWidget { + /// Creates a [RecurringOrderPage]. + const RecurringOrderPage({super.key}); + + @override + Widget build(BuildContext context) { + final TranslationsClientCreateOrderRecurringEn labels = + t.client_create_order.recurring; + + return Scaffold( + backgroundColor: UiColors.bgPrimary, + appBar: UiAppBar( + title: labels.title, + onLeadingPressed: () => Modular.to.pop(), + ), + body: Center( + child: Padding( + padding: const EdgeInsets.all(UiConstants.space6), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + labels.subtitle, + style: UiTypography.body1r.textSecondary, + textAlign: TextAlign.center, + ), + ], + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/ui_entities/order_type_ui_metadata.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/ui_entities/order_type_ui_metadata.dart new file mode 100644 index 00000000..0729f4a1 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/ui_entities/order_type_ui_metadata.dart @@ -0,0 +1,93 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/widgets.dart'; + +/// Metadata for styling order type cards based on their ID. +class OrderTypeUiMetadata { + /// Creates an [OrderTypeUiMetadata]. + const OrderTypeUiMetadata({ + required this.icon, + required this.backgroundColor, + required this.borderColor, + required this.iconBackgroundColor, + required this.iconColor, + required this.textColor, + required this.descriptionColor, + }); + + /// Factory to get metadata based on order type ID. + factory OrderTypeUiMetadata.fromId({required String id}) { + switch (id) { + case 'rapid': + return const OrderTypeUiMetadata( + icon: UiIcons.zap, + backgroundColor: UiColors.tagPending, + borderColor: UiColors.separatorSpecial, + iconBackgroundColor: UiColors.textWarning, + iconColor: UiColors.white, + textColor: UiColors.textWarning, + descriptionColor: UiColors.textWarning, + ); + case 'one-time': + return const OrderTypeUiMetadata( + icon: UiIcons.calendar, + backgroundColor: UiColors.tagInProgress, + borderColor: UiColors.primaryInverse, + iconBackgroundColor: UiColors.primary, + iconColor: UiColors.white, + textColor: UiColors.textLink, + descriptionColor: UiColors.textLink, + ); + case 'recurring': + return const OrderTypeUiMetadata( + icon: UiIcons.rotateCcw, + backgroundColor: UiColors.tagSuccess, + borderColor: UiColors.switchActive, + iconBackgroundColor: UiColors.textSuccess, + iconColor: UiColors.white, + textColor: UiColors.textSuccess, + descriptionColor: UiColors.textSuccess, + ); + case 'permanent': + return const OrderTypeUiMetadata( + icon: UiIcons.briefcase, + backgroundColor: UiColors.tagRefunded, + borderColor: UiColors.primaryInverse, + iconBackgroundColor: UiColors.primary, + iconColor: UiColors.white, + textColor: UiColors.textLink, + descriptionColor: UiColors.textLink, + ); + default: + return const OrderTypeUiMetadata( + icon: UiIcons.help, + backgroundColor: UiColors.bgSecondary, + borderColor: UiColors.border, + iconBackgroundColor: UiColors.iconSecondary, + iconColor: UiColors.white, + textColor: UiColors.textPrimary, + descriptionColor: UiColors.textSecondary, + ); + } + } + + /// Icon for the order type. + final IconData icon; + + /// Background color for the card. + final Color backgroundColor; + + /// Border color for the card. + final Color borderColor; + + /// Background color for the icon. + final Color iconBackgroundColor; + + /// Color for the icon. + final Color iconColor; + + /// Color for the title text. + final Color textColor; + + /// Color for the description text. + final Color descriptionColor; +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/create_order/create_order_view.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/create_order/create_order_view.dart new file mode 100644 index 00000000..eb1775fb --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/create_order/create_order_view.dart @@ -0,0 +1,128 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../blocs/client_create_order_bloc.dart'; +import '../../blocs/client_create_order_state.dart'; +import '../../navigation/client_create_order_navigator.dart'; +import '../../ui_entities/order_type_ui_metadata.dart'; +import '../order_type_card.dart'; + +/// Helper to map keys to localized strings. +String _getTranslation({required String key}) { + if (key == 'client_create_order.types.rapid') { + return t.client_create_order.types.rapid; + } else if (key == 'client_create_order.types.rapid_desc') { + return t.client_create_order.types.rapid_desc; + } else if (key == 'client_create_order.types.one_time') { + return t.client_create_order.types.one_time; + } else if (key == 'client_create_order.types.one_time_desc') { + return t.client_create_order.types.one_time_desc; + } else if (key == 'client_create_order.types.recurring') { + return t.client_create_order.types.recurring; + } else if (key == 'client_create_order.types.recurring_desc') { + return t.client_create_order.types.recurring_desc; + } else if (key == 'client_create_order.types.permanent') { + return t.client_create_order.types.permanent; + } else if (key == 'client_create_order.types.permanent_desc') { + return t.client_create_order.types.permanent_desc; + } + return key; +} + +/// The main content of the Create Order page. +class CreateOrderView extends StatelessWidget { + /// Creates a [CreateOrderView]. + const CreateOrderView({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: UiColors.bgPrimary, + appBar: UiAppBar( + title: t.client_create_order.title, + onLeadingPressed: () => Modular.to.pop(), + ), + body: SafeArea( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space5, + vertical: UiConstants.space6, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(bottom: UiConstants.space6), + child: Text( + t.client_create_order.section_title, + style: UiTypography.footnote1m.copyWith( + color: UiColors.textDescription, + letterSpacing: 0.5, + ), + ), + ), + Expanded( + child: BlocBuilder( + builder: + (BuildContext context, ClientCreateOrderState state) { + if (state is ClientCreateOrderLoadSuccess) { + return GridView.builder( + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + mainAxisSpacing: UiConstants.space4, + crossAxisSpacing: UiConstants.space4, + childAspectRatio: 1, + ), + itemCount: state.orderTypes.length, + itemBuilder: (BuildContext context, int index) { + final OrderType type = state.orderTypes[index]; + final OrderTypeUiMetadata ui = + OrderTypeUiMetadata.fromId(id: type.id); + + return OrderTypeCard( + icon: ui.icon, + title: _getTranslation(key: type.titleKey), + description: _getTranslation( + key: type.descriptionKey, + ), + backgroundColor: ui.backgroundColor, + borderColor: ui.borderColor, + iconBackgroundColor: ui.iconBackgroundColor, + iconColor: ui.iconColor, + textColor: ui.textColor, + descriptionColor: ui.descriptionColor, + onTap: () { + switch (type.id) { + case 'rapid': + Modular.to.pushRapidOrder(); + break; + case 'one-time': + Modular.to.pushOneTimeOrder(); + break; + case 'recurring': + Modular.to.pushRecurringOrder(); + break; + case 'permanent': + Modular.to.pushPermanentOrder(); + break; + } + }, + ); + }, + ); + } + return const Center(child: CircularProgressIndicator()); + }, + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_date_picker.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_date_picker.dart new file mode 100644 index 00000000..5a0eb751 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_date_picker.dart @@ -0,0 +1,74 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +/// A date picker field for the one-time order form. +/// Matches the prototype input field style. +class OneTimeOrderDatePicker extends StatefulWidget { + /// Creates a [OneTimeOrderDatePicker]. + const OneTimeOrderDatePicker({ + required this.label, + required this.value, + required this.onChanged, + super.key, + }); + + /// The label text to display above the field. + final String label; + + /// The currently selected date. + final DateTime value; + + /// Callback when a new date is selected. + final ValueChanged onChanged; + + @override + State createState() => _OneTimeOrderDatePickerState(); +} + +class _OneTimeOrderDatePickerState extends State { + late final TextEditingController _controller; + + @override + void initState() { + super.initState(); + _controller = TextEditingController( + text: DateFormat('yyyy-MM-dd').format(widget.value), + ); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + void didUpdateWidget(OneTimeOrderDatePicker oldWidget) { + super.didUpdateWidget(oldWidget); + if (widget.value != oldWidget.value) { + _controller.text = DateFormat('yyyy-MM-dd').format(widget.value); + } + } + + @override + Widget build(BuildContext context) { + return UiTextField( + label: widget.label, + controller: _controller, + readOnly: true, + prefixIcon: UiIcons.calendar, + onTap: () async { + final DateTime? picked = await showDatePicker( + context: context, + initialDate: widget.value, + firstDate: DateTime.now(), + lastDate: DateTime.now().add(const Duration(days: 365)), + ); + if (picked != null) { + widget.onChanged(picked); + } + }, + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_header.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_header.dart new file mode 100644 index 00000000..d39f6c8b --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_header.dart @@ -0,0 +1,71 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A header widget for the one-time order flow with a colored background. +class OneTimeOrderHeader extends StatelessWidget { + /// Creates a [OneTimeOrderHeader]. + const OneTimeOrderHeader({ + required this.title, + required this.subtitle, + required this.onBack, + super.key, + }); + + /// The title of the page. + final String title; + + /// The subtitle or description. + final String subtitle; + + /// Callback when the back button is pressed. + final VoidCallback onBack; + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.only( + top: MediaQuery.of(context).padding.top + UiConstants.space5, + bottom: UiConstants.space5, + left: UiConstants.space5, + right: UiConstants.space5, + ), + color: UiColors.primary, + child: Row( + children: [ + GestureDetector( + onTap: onBack, + child: Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: UiColors.white.withValues(alpha: 0.2), + borderRadius: UiConstants.radiusMd, + ), + child: const Icon( + UiIcons.chevronLeft, + color: UiColors.white, + size: 24, + ), + ), + ), + const SizedBox(width: UiConstants.space3), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: UiTypography.headline3m.copyWith(color: UiColors.white), + ), + Text( + subtitle, + style: UiTypography.footnote2r.copyWith( + color: UiColors.white.withValues(alpha: 0.8), + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_location_input.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_location_input.dart new file mode 100644 index 00000000..7eb8baf1 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_location_input.dart @@ -0,0 +1,62 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A location input field for the one-time order form. +/// Matches the prototype input field style. +class OneTimeOrderLocationInput extends StatefulWidget { + /// Creates a [OneTimeOrderLocationInput]. + const OneTimeOrderLocationInput({ + required this.label, + required this.value, + required this.onChanged, + super.key, + }); + + /// The label text to display above the field. + final String label; + + /// The current location value. + final String value; + + /// Callback when the location value changes. + final ValueChanged onChanged; + + @override + State createState() => + _OneTimeOrderLocationInputState(); +} + +class _OneTimeOrderLocationInputState extends State { + late final TextEditingController _controller; + + @override + void initState() { + super.initState(); + _controller = TextEditingController(text: widget.value); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + void didUpdateWidget(OneTimeOrderLocationInput oldWidget) { + super.didUpdateWidget(oldWidget); + if (widget.value != _controller.text) { + _controller.text = widget.value; + } + } + + @override + Widget build(BuildContext context) { + return UiTextField( + label: widget.label, + controller: _controller, + onChanged: widget.onChanged, + hintText: 'Enter address', + prefixIcon: UiIcons.mapPin, + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_position_card.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_position_card.dart new file mode 100644 index 00000000..113f95f9 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_position_card.dart @@ -0,0 +1,338 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../blocs/one_time_order_state.dart'; + +/// A card widget for editing a specific position in a one-time order. +/// Matches the prototype layout while using design system tokens. +class OneTimeOrderPositionCard extends StatelessWidget { + /// Creates a [OneTimeOrderPositionCard]. + const OneTimeOrderPositionCard({ + required this.index, + required this.position, + required this.isRemovable, + required this.onUpdated, + required this.onRemoved, + required this.positionLabel, + required this.roleLabel, + required this.workersLabel, + required this.startLabel, + required this.endLabel, + required this.lunchLabel, + required this.roles, + super.key, + }); + + /// The index of the position in the list. + final int index; + + /// The position entity data. + final OneTimeOrderPosition position; + + /// Whether this position can be removed (usually if there's more than one). + final bool isRemovable; + + /// Callback when the position data is updated. + final ValueChanged onUpdated; + + /// Callback when the position is removed. + final VoidCallback onRemoved; + + /// Label for positions (e.g., "Position"). + final String positionLabel; + + /// Label for the role selection. + final String roleLabel; + + /// Label for the worker count. + final String workersLabel; + + /// Label for the start time. + final String startLabel; + + /// Label for the end time. + final String endLabel; + + /// Label for the lunch break. + final String lunchLabel; + + /// Available roles for the selected vendor. + final List roles; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '$positionLabel #${index + 1}', + style: UiTypography.footnote1m.textSecondary, + ), + if (isRemovable) + GestureDetector( + onTap: onRemoved, + child: Text( + t.client_create_order.one_time.remove, + style: UiTypography.footnote1m.copyWith( + color: UiColors.destructive, + ), + ), + ), + ], + ), + const SizedBox(height: UiConstants.space3), + + // Role (Dropdown) + Container( + padding: const EdgeInsets.symmetric(horizontal: UiConstants.space3), + height: 44, + decoration: BoxDecoration( + borderRadius: UiConstants.radiusMd, + border: Border.all(color: UiColors.border), + ), + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + hint: Text( + roleLabel, + style: UiTypography.body2r.textPlaceholder, + ), + value: position.role.isEmpty ? null : position.role, + icon: const Icon( + UiIcons.chevronDown, + size: 18, + color: UiColors.iconSecondary, + ), + onChanged: (String? val) { + if (val != null) { + onUpdated(position.copyWith(role: val)); + } + }, + items: _buildRoleItems(), + ), + ), + ), + const SizedBox(height: UiConstants.space3), + + // Start/End/Workers Row + Row( + children: [ + // Start Time + Expanded( + child: _buildTimeInput( + context: context, + label: startLabel, + value: position.startTime, + onTap: () async { + final TimeOfDay? picked = await showTimePicker( + context: context, + initialTime: TimeOfDay.now(), + ); + if (picked != null && context.mounted) { + onUpdated( + position.copyWith(startTime: picked.format(context)), + ); + } + }, + ), + ), + const SizedBox(width: UiConstants.space2), + // End Time + Expanded( + child: _buildTimeInput( + context: context, + label: endLabel, + value: position.endTime, + onTap: () async { + final TimeOfDay? picked = await showTimePicker( + context: context, + initialTime: TimeOfDay.now(), + ); + if (picked != null && context.mounted) { + onUpdated( + position.copyWith(endTime: picked.format(context)), + ); + } + }, + ), + ), + const SizedBox(width: UiConstants.space2), + // Workers Count + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + workersLabel, + style: UiTypography.footnote2r.textSecondary, + ), + const SizedBox(height: UiConstants.space1), + Container( + height: 40, + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: UiConstants.radiusSm, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + if (position.count > 1) { + onUpdated( + position.copyWith(count: position.count - 1), + ); + } + }, + child: const Icon(UiIcons.minus, size: 12), + ), + Text( + '${position.count}', + style: UiTypography.body2b.textPrimary, + ), + GestureDetector( + onTap: () { + onUpdated( + position.copyWith(count: position.count + 1), + ); + }, + child: const Icon(UiIcons.add, size: 12), + ), + ], + ), + ), + ], + ), + ), + ], + ), + const SizedBox(height: UiConstants.space4), + + // Lunch Break + Text(lunchLabel, style: UiTypography.footnote2r.textSecondary), + const SizedBox(height: UiConstants.space1), + Container( + padding: const EdgeInsets.symmetric(horizontal: UiConstants.space3), + height: 44, + decoration: BoxDecoration( + borderRadius: UiConstants.radiusMd, + border: Border.all(color: UiColors.border), + ), + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: position.lunchBreak, + icon: const Icon( + UiIcons.chevronDown, + size: 18, + color: UiColors.iconSecondary, + ), + onChanged: (String? val) { + if (val != null) { + onUpdated(position.copyWith(lunchBreak: val)); + } + }, + items: ['NO_BREAK', 'MIN_15', 'MIN_30'].map(( + String value, + ) { + final String label = switch (value) { + 'NO_BREAK' => 'No Break', + 'MIN_15' => '15 min', + _ => '30 min', + }; + return DropdownMenuItem( + value: value, + child: Text( + label, + style: UiTypography.body2r.textPrimary, + ), + ); + }).toList(), + ), + ), + ), + ], + ), + ); + } + + Widget _buildTimeInput({ + required BuildContext context, + required String label, + required String value, + required VoidCallback onTap, + }) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(label, style: UiTypography.footnote2r.textSecondary), + const SizedBox(height: UiConstants.space1), + GestureDetector( + onTap: onTap, + child: Container( + height: 40, + padding: const EdgeInsets.symmetric(horizontal: UiConstants.space3), + decoration: BoxDecoration( + borderRadius: UiConstants.radiusSm, + border: Border.all(color: UiColors.border), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + value.isEmpty ? '--:--' : value, + style: UiTypography.body2r.textPrimary, + ), + const Icon( + UiIcons.clock, + size: 14, + color: UiColors.iconSecondary, + ), + ], + ), + ), + ), + ], + ); + } + + List> _buildRoleItems() { + final List> items = roles + .map( + (OneTimeOrderRoleOption role) => DropdownMenuItem( + value: role.id, + child: Text( + '${role.name} - \$${role.costPerHour.toStringAsFixed(0)}', + style: UiTypography.body2r.textPrimary, + ), + ), + ) + .toList(); + + final bool hasSelected = roles.any((OneTimeOrderRoleOption role) => role.id == position.role); + if (position.role.isNotEmpty && !hasSelected) { + items.add( + DropdownMenuItem( + value: position.role, + child: Text( + position.role, + style: UiTypography.body2r.textPrimary, + ), + ), + ); + } + + return items; + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_section_header.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_section_header.dart new file mode 100644 index 00000000..a7bf2b1a --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_section_header.dart @@ -0,0 +1,57 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A header widget for sections in the one-time order form. +class OneTimeOrderSectionHeader extends StatelessWidget { + /// Creates a [OneTimeOrderSectionHeader]. + const OneTimeOrderSectionHeader({ + required this.title, + this.actionLabel, + this.onAction, + super.key, + }); + + /// The title text for the section. + final String title; + + /// Optional label for an action button on the right. + final String? actionLabel; + + /// Callback when the action button is tapped. + final VoidCallback? onAction; + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(title, style: UiTypography.headline4m.textPrimary), + if (actionLabel != null && onAction != null) + TextButton( + onPressed: onAction, + style: TextButton.styleFrom( + padding: EdgeInsets.zero, + minimumSize: Size.zero, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Icon(UiIcons.add, size: 16, color: Color(0xFF0032A0)), + const SizedBox(width: UiConstants.space2), + Text( + actionLabel!, + style: const TextStyle( + color: Color(0xFF0032A0), + fontSize: 14, + fontWeight: + FontWeight.w500, // Added to match typical button text + ), + ), + ], + ), + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_success_view.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_success_view.dart new file mode 100644 index 00000000..3a660a86 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_success_view.dart @@ -0,0 +1,105 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A view to display when a one-time order has been successfully created. +/// Matches the prototype success view layout with a gradient background and centered card. +class OneTimeOrderSuccessView extends StatelessWidget { + /// Creates a [OneTimeOrderSuccessView]. + const OneTimeOrderSuccessView({ + required this.title, + required this.message, + required this.buttonLabel, + required this.onDone, + super.key, + }); + + /// The title of the success message. + final String title; + + /// The body of the success message. + final String message; + + /// Label for the completion button. + final String buttonLabel; + + /// Callback when the completion button is tapped. + final VoidCallback onDone; + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Container( + width: double.infinity, + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [UiColors.primary, UiColors.buttonPrimaryHover], + ), + ), + child: SafeArea( + child: Center( + child: Container( + margin: const EdgeInsets.symmetric(horizontal: 40), + padding: const EdgeInsets.all(UiConstants.space8), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg * 1.5, + boxShadow: [ + BoxShadow( + color: Colors.black.withValues(alpha: 0.2), + blurRadius: 20, + offset: const Offset(0, 10), + ), + ], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: 64, + height: 64, + decoration: const BoxDecoration( + color: UiColors.accent, + shape: BoxShape.circle, + ), + child: const Center( + child: Icon( + UiIcons.check, + color: UiColors.black, + size: 32, + ), + ), + ), + const SizedBox(height: UiConstants.space6), + Text( + title, + style: UiTypography.headline2m.textPrimary, + textAlign: TextAlign.center, + ), + const SizedBox(height: UiConstants.space3), + Text( + message, + textAlign: TextAlign.center, + style: UiTypography.body2r.textSecondary.copyWith( + height: 1.5, + ), + ), + const SizedBox(height: UiConstants.space8), + SizedBox( + width: double.infinity, + child: UiButton.primary( + text: buttonLabel, + onPressed: onDone, + size: UiButtonSize.large, + ), + ), + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_view.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_view.dart new file mode 100644 index 00000000..f2fba146 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/one_time_order/one_time_order_view.dart @@ -0,0 +1,270 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../blocs/one_time_order_bloc.dart'; +import '../../blocs/one_time_order_event.dart'; +import '../../blocs/one_time_order_state.dart'; +import 'one_time_order_date_picker.dart'; +import 'one_time_order_header.dart'; +import 'one_time_order_location_input.dart'; +import 'one_time_order_position_card.dart'; +import 'one_time_order_section_header.dart'; +import 'one_time_order_success_view.dart'; + +/// The main content of the One-Time Order page. +class OneTimeOrderView extends StatelessWidget { + /// Creates a [OneTimeOrderView]. + const OneTimeOrderView({super.key}); + + @override + Widget build(BuildContext context) { + final TranslationsClientCreateOrderOneTimeEn labels = + t.client_create_order.one_time; + + return BlocBuilder( + builder: (BuildContext context, OneTimeOrderState state) { + if (state.status == OneTimeOrderStatus.success) { + return OneTimeOrderSuccessView( + title: labels.success_title, + message: labels.success_message, + buttonLabel: labels.back_to_orders, + onDone: () => Modular.to.pop(), + ); + } + + if (state.vendors.isEmpty && + state.status != OneTimeOrderStatus.loading) { + return Scaffold( + backgroundColor: UiColors.bgPrimary, + body: Column( + children: [ + OneTimeOrderHeader( + title: labels.title, + subtitle: labels.subtitle, + onBack: () => Modular.to.pop(), + ), + Expanded( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon( + UiIcons.search, + size: 64, + color: UiColors.iconInactive, + ), + const SizedBox(height: UiConstants.space4), + Text( + 'No Vendors Available', + style: UiTypography.headline3m.textPrimary, + ), + const SizedBox(height: UiConstants.space2), + Text( + 'There are no staffing vendors associated with your account.', + style: UiTypography.body2r.textSecondary, + textAlign: TextAlign.center, + ), + ], + ), + ), + ), + ], + ), + ); + } + + return Scaffold( + backgroundColor: UiColors.bgPrimary, + body: Column( + children: [ + OneTimeOrderHeader( + title: labels.title, + subtitle: labels.subtitle, + onBack: () => Modular.to.pop(), + ), + Expanded( + child: Stack( + children: [ + _OneTimeOrderForm(state: state), + if (state.status == OneTimeOrderStatus.loading) + const Center(child: CircularProgressIndicator()), + ], + ), + ), + _BottomActionButton( + label: state.status == OneTimeOrderStatus.loading + ? labels.creating + : labels.create_order, + isLoading: state.status == OneTimeOrderStatus.loading, + onPressed: () => BlocProvider.of( + context, + ).add(const OneTimeOrderSubmitted()), + ), + ], + ), + ); + }, + ); + } +} + +class _OneTimeOrderForm extends StatelessWidget { + const _OneTimeOrderForm({required this.state}); + final OneTimeOrderState state; + + @override + Widget build(BuildContext context) { + final TranslationsClientCreateOrderOneTimeEn labels = + t.client_create_order.one_time; + + return ListView( + padding: const EdgeInsets.all(UiConstants.space5), + children: [ + Text( + labels.create_your_order, + style: UiTypography.headline3m.textPrimary, + ), + const SizedBox(height: UiConstants.space4), + + // Vendor Selection + Text('SELECT VENDOR', style: UiTypography.footnote2r.textSecondary), + const SizedBox(height: 8), + Container( + padding: const EdgeInsets.symmetric(horizontal: UiConstants.space3), + height: 48, + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusMd, + border: Border.all(color: UiColors.border), + ), + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: state.selectedVendor, + icon: const Icon( + UiIcons.chevronDown, + size: 18, + color: UiColors.iconSecondary, + ), + onChanged: (Vendor? vendor) { + if (vendor != null) { + BlocProvider.of( + context, + ).add(OneTimeOrderVendorChanged(vendor)); + } + }, + items: state.vendors.map((Vendor vendor) { + return DropdownMenuItem( + value: vendor, + child: Text( + vendor.name, + style: UiTypography.body2m.textPrimary, + ), + ); + }).toList(), + ), + ), + ), + const SizedBox(height: UiConstants.space4), + + OneTimeOrderDatePicker( + label: labels.date_label, + value: state.date, + onChanged: (DateTime date) => BlocProvider.of( + context, + ).add(OneTimeOrderDateChanged(date)), + ), + const SizedBox(height: UiConstants.space4), + + OneTimeOrderLocationInput( + label: labels.location_label, + value: state.location, + onChanged: (String location) => BlocProvider.of( + context, + ).add(OneTimeOrderLocationChanged(location)), + ), + const SizedBox(height: UiConstants.space6), + + OneTimeOrderSectionHeader( + title: labels.positions_title, + actionLabel: labels.add_position, + onAction: () => BlocProvider.of( + context, + ).add(const OneTimeOrderPositionAdded()), + ), + const SizedBox(height: UiConstants.space3), + + // Positions List + ...state.positions.asMap().entries.map(( + MapEntry entry, + ) { + final int index = entry.key; + final OneTimeOrderPosition position = entry.value; + return Padding( + padding: const EdgeInsets.only(bottom: UiConstants.space3), + child: OneTimeOrderPositionCard( + index: index, + position: position, + isRemovable: state.positions.length > 1, + positionLabel: labels.positions_title, + roleLabel: labels.select_role, + workersLabel: labels.workers_label, + startLabel: labels.start_label, + endLabel: labels.end_label, + lunchLabel: labels.lunch_break_label, + roles: state.roles, + onUpdated: (OneTimeOrderPosition updated) { + BlocProvider.of( + context, + ).add(OneTimeOrderPositionUpdated(index, updated)); + }, + onRemoved: () { + BlocProvider.of( + context, + ).add(OneTimeOrderPositionRemoved(index)); + }, + ), + ); + }), + ], + ); + } +} + +class _BottomActionButton extends StatelessWidget { + const _BottomActionButton({ + required this.label, + required this.onPressed, + this.isLoading = false, + }); + final String label; + final VoidCallback onPressed; + final bool isLoading; + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.only( + left: UiConstants.space5, + right: UiConstants.space5, + top: UiConstants.space5, + bottom: MediaQuery.of(context).padding.bottom + UiConstants.space5, + ), + decoration: const BoxDecoration( + color: UiColors.white, + border: Border(top: BorderSide(color: UiColors.border)), + ), + child: SizedBox( + width: double.infinity, + child: UiButton.primary( + text: label, + onPressed: isLoading ? null : onPressed, + size: UiButtonSize.large, + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/order_type_card.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/order_type_card.dart new file mode 100644 index 00000000..f9c92f43 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/order_type_card.dart @@ -0,0 +1,93 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A card widget representing an order type in the creation flow. +class OrderTypeCard extends StatelessWidget { + /// Creates an [OrderTypeCard]. + const OrderTypeCard({ + required this.icon, + required this.title, + required this.description, + required this.backgroundColor, + required this.borderColor, + required this.iconBackgroundColor, + required this.iconColor, + required this.textColor, + required this.descriptionColor, + required this.onTap, + super.key, + }); + + /// Icon to display at the top of the card. + final IconData icon; + + /// Main title of the order type. + final String title; + + /// Brief description of what this order type entails. + final String description; + + /// Background color of the card. + final Color backgroundColor; + + /// Color of the card's border. + final Color borderColor; + + /// Background color for the icon container. + final Color iconBackgroundColor; + + /// Color of the icon itself. + final Color iconColor; + + /// Color of the title text. + final Color textColor; + + /// Color of the description text. + final Color descriptionColor; + + /// Callback when the card is tapped. + final VoidCallback onTap; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + padding: const EdgeInsets.all(UiConstants.space5), + decoration: BoxDecoration( + color: backgroundColor, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + border: Border.all(color: borderColor, width: 2), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 48, + height: 48, + margin: const EdgeInsets.only(bottom: UiConstants.space3), + decoration: BoxDecoration( + color: iconBackgroundColor, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + ), + child: Icon(icon, color: iconColor, size: 24), + ), + Text(title, style: UiTypography.body2b.copyWith(color: textColor)), + const SizedBox(height: UiConstants.space1), + Expanded( + child: Text( + description, + style: UiTypography.footnote1r.copyWith( + color: descriptionColor, + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/rapid_order/rapid_order_example_card.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/rapid_order/rapid_order_example_card.dart new file mode 100644 index 00000000..7ffac143 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/rapid_order/rapid_order_example_card.dart @@ -0,0 +1,58 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A card displaying an example message for a rapid order. +class RapidOrderExampleCard extends StatelessWidget { + /// Creates a [RapidOrderExampleCard]. + const RapidOrderExampleCard({ + required this.example, + required this.isHighlighted, + required this.label, + required this.onTap, + super.key, + }); + + /// The example text. + final String example; + + /// Whether this is the first (highlighted) example. + final bool isHighlighted; + + /// The label for the example prefix (e.g., "Example:"). + final String label; + + /// Callback when the card is tapped. + final VoidCallback onTap; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + width: double.infinity, + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space4, + vertical: UiConstants.space3, + ), + decoration: BoxDecoration( + color: isHighlighted + ? UiColors.accent.withValues(alpha: 0.15) + : UiColors.white, + borderRadius: UiConstants.radiusMd, + border: Border.all( + color: isHighlighted ? UiColors.accent : UiColors.border, + ), + ), + child: RichText( + text: TextSpan( + style: UiTypography.body2r.textPrimary, + children: [ + TextSpan(text: label, style: UiTypography.body2b.textPrimary), + TextSpan(text: ' $example'), + ], + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/rapid_order/rapid_order_header.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/rapid_order/rapid_order_header.dart new file mode 100644 index 00000000..bcb4680e --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/rapid_order/rapid_order_header.dart @@ -0,0 +1,118 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A header widget for the rapid order flow with a gradient background. +class RapidOrderHeader extends StatelessWidget { + /// Creates a [RapidOrderHeader]. + const RapidOrderHeader({ + required this.title, + required this.subtitle, + required this.date, + required this.time, + required this.onBack, + super.key, + }); + + /// The title of the page. + final String title; + + /// The subtitle or description. + final String subtitle; + + /// The formatted current date. + final String date; + + /// The formatted current time. + final String time; + + /// Callback when the back button is pressed. + final VoidCallback onBack; + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.only( + top: MediaQuery.of(context).padding.top + UiConstants.space5, + bottom: UiConstants.space5, + left: UiConstants.space5, + right: UiConstants.space5, + ), + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + UiColors.destructive, + UiColors.destructive.withValues(alpha: 0.85), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + GestureDetector( + onTap: onBack, + child: Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: UiColors.white.withValues(alpha: 0.2), + borderRadius: UiConstants.radiusMd, + ), + child: const Icon( + UiIcons.chevronLeft, + color: UiColors.white, + size: 24, + ), + ), + ), + const SizedBox(width: UiConstants.space3), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + const Icon(UiIcons.zap, color: UiColors.accent, size: 18), + const SizedBox(width: UiConstants.space2), + Text( + title, + style: UiTypography.headline3m.copyWith( + color: UiColors.white, + ), + ), + ], + ), + Text( + subtitle, + style: UiTypography.footnote2r.copyWith( + color: UiColors.white.withValues(alpha: 0.8), + ), + ), + ], + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + date, + style: UiTypography.footnote2r.copyWith( + color: UiColors.white.withValues(alpha: 0.9), + ), + ), + Text( + time, + style: UiTypography.footnote2r.copyWith( + color: UiColors.white.withValues(alpha: 0.9), + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/rapid_order/rapid_order_success_view.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/rapid_order/rapid_order_success_view.dart new file mode 100644 index 00000000..1ad01b09 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/rapid_order/rapid_order_success_view.dart @@ -0,0 +1,106 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A view to display when a rapid order has been successfully created. +class RapidOrderSuccessView extends StatelessWidget { + /// Creates a [RapidOrderSuccessView]. + const RapidOrderSuccessView({ + required this.title, + required this.message, + required this.buttonLabel, + required this.onDone, + super.key, + }); + + /// The title of the success message. + final String title; + + /// The body of the success message. + final String message; + + /// Label for the completion button. + final String buttonLabel; + + /// Callback when the completion button is tapped. + final VoidCallback onDone; + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Container( + width: double.infinity, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + UiColors.primary, + UiColors.primary.withValues(alpha: 0.85), + ], + ), + ), + child: SafeArea( + child: Center( + child: Container( + margin: const EdgeInsets.symmetric( + horizontal: UiConstants.space10, + ), + padding: const EdgeInsets.all(UiConstants.space8), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg, + boxShadow: [ + BoxShadow( + color: UiColors.black.withValues(alpha: 0.2), + blurRadius: 20, + offset: const Offset(0, 10), + ), + ], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: 64, + height: 64, + decoration: const BoxDecoration( + color: UiColors.accent, + shape: BoxShape.circle, + ), + child: const Center( + child: Icon( + UiIcons.zap, + color: UiColors.textPrimary, + size: 32, + ), + ), + ), + const SizedBox(height: UiConstants.space6), + Text(title, style: UiTypography.headline1m.textPrimary), + const SizedBox(height: UiConstants.space3), + Text( + message, + textAlign: TextAlign.center, + style: UiTypography.body2r.copyWith( + color: UiColors.textSecondary, + height: 1.5, + ), + ), + const SizedBox(height: UiConstants.space8), + SizedBox( + width: double.infinity, + child: UiButton.primary( + text: buttonLabel, + onPressed: onDone, + size: UiButtonSize.large, + ), + ), + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/rapid_order/rapid_order_view.dart b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/rapid_order/rapid_order_view.dart new file mode 100644 index 00000000..093ec39d --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/lib/src/presentation/widgets/rapid_order/rapid_order_view.dart @@ -0,0 +1,302 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:intl/intl.dart'; +import '../../blocs/rapid_order_bloc.dart'; +import '../../blocs/rapid_order_event.dart'; +import '../../blocs/rapid_order_state.dart'; +import 'rapid_order_example_card.dart'; +import 'rapid_order_header.dart'; +import 'rapid_order_success_view.dart'; + +/// The main content of the Rapid Order page. +class RapidOrderView extends StatelessWidget { + /// Creates a [RapidOrderView]. + const RapidOrderView({super.key}); + + @override + Widget build(BuildContext context) { + final TranslationsClientCreateOrderRapidEn labels = + t.client_create_order.rapid; + + return BlocBuilder( + builder: (BuildContext context, RapidOrderState state) { + if (state is RapidOrderSuccess) { + return RapidOrderSuccessView( + title: labels.success_title, + message: labels.success_message, + buttonLabel: labels.back_to_orders, + onDone: () => Modular.to.pop(), + ); + } + + return const _RapidOrderForm(); + }, + ); + } +} + +class _RapidOrderForm extends StatefulWidget { + const _RapidOrderForm(); + + @override + State<_RapidOrderForm> createState() => _RapidOrderFormState(); +} + +class _RapidOrderFormState extends State<_RapidOrderForm> { + final TextEditingController _messageController = TextEditingController(); + + @override + void dispose() { + _messageController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final TranslationsClientCreateOrderRapidEn labels = + t.client_create_order.rapid; + final DateTime now = DateTime.now(); + final String dateStr = DateFormat('EEE, MMM dd, yyyy').format(now); + final String timeStr = DateFormat('h:mm a').format(now); + + return BlocListener( + listener: (BuildContext context, RapidOrderState state) { + if (state is RapidOrderInitial) { + if (_messageController.text != state.message) { + _messageController.text = state.message; + _messageController.selection = TextSelection.fromPosition( + TextPosition(offset: _messageController.text.length), + ); + } + } + }, + child: Scaffold( + backgroundColor: UiColors.bgPrimary, + body: Column( + children: [ + RapidOrderHeader( + title: labels.title, + subtitle: labels.subtitle, + date: dateStr, + time: timeStr, + onBack: () => Modular.to.pop(), + ), + + // Content + Expanded( + child: SingleChildScrollView( + padding: const EdgeInsets.all(UiConstants.space5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + labels.tell_us, + style: UiTypography.headline3m.textPrimary, + ), + Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space2, + vertical: UiConstants.space1, + ), + decoration: BoxDecoration( + color: UiColors.destructive, + borderRadius: UiConstants.radiusSm, + ), + child: Text( + labels.urgent_badge, + style: UiTypography.footnote2b.copyWith( + color: UiColors.white, + ), + ), + ), + ], + ), + const SizedBox(height: UiConstants.space4), + + // Main Card + Container( + padding: const EdgeInsets.all(UiConstants.space6), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + ), + child: BlocBuilder( + builder: (BuildContext context, RapidOrderState state) { + final RapidOrderInitial? initialState = + state is RapidOrderInitial ? state : null; + final bool isSubmitting = + state is RapidOrderSubmitting; + + return Column( + children: [ + // Icon + const _AnimatedZapIcon(), + const SizedBox(height: UiConstants.space4), + Text( + labels.need_staff, + style: UiTypography.headline2m.textPrimary, + ), + const SizedBox(height: UiConstants.space2), + Text( + labels.type_or_speak, + textAlign: TextAlign.center, + style: UiTypography.body2r.textSecondary, + ), + const SizedBox(height: UiConstants.space6), + + // Examples + if (initialState != null) + ...initialState.examples.asMap().entries.map(( + MapEntry entry, + ) { + final int index = entry.key; + final String example = entry.value; + final bool isHighlighted = index == 0; + + return Padding( + padding: const EdgeInsets.only( + bottom: UiConstants.space2, + ), + child: RapidOrderExampleCard( + example: example, + isHighlighted: isHighlighted, + label: labels.example, + onTap: () => + BlocProvider.of( + context, + ).add( + RapidOrderExampleSelected(example), + ), + ), + ); + }), + const SizedBox(height: UiConstants.space4), + + // Input + UiTextField( + controller: _messageController, + maxLines: 4, + onChanged: (String value) { + BlocProvider.of( + context, + ).add(RapidOrderMessageChanged(value)); + }, + hintText: labels.hint, + ), + const SizedBox(height: UiConstants.space4), + + // Actions + _RapidOrderActions( + labels: labels, + isSubmitting: isSubmitting, + isListening: initialState?.isListening ?? false, + isMessageEmpty: + initialState != null && + initialState.message.trim().isEmpty, + ), + ], + ); + }, + ), + ), + ], + ), + ), + ), + ], + ), + ), + ); + } +} + +class _AnimatedZapIcon extends StatelessWidget { + const _AnimatedZapIcon(); + + @override + Widget build(BuildContext context) { + return Container( + width: 64, + height: 64, + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + UiColors.destructive, + UiColors.destructive.withValues(alpha: 0.85), + ], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + borderRadius: UiConstants.radiusLg, + boxShadow: [ + BoxShadow( + color: UiColors.destructive.withValues(alpha: 0.3), + blurRadius: 10, + offset: const Offset(0, 4), + ), + ], + ), + child: const Icon(UiIcons.zap, color: UiColors.white, size: 32), + ); + } +} + +class _RapidOrderActions extends StatelessWidget { + const _RapidOrderActions({ + required this.labels, + required this.isSubmitting, + required this.isListening, + required this.isMessageEmpty, + }); + final TranslationsClientCreateOrderRapidEn labels; + final bool isSubmitting; + final bool isListening; + final bool isMessageEmpty; + + @override + Widget build(BuildContext context) { + return Row( + children: [ + Expanded( + child: UiButton.secondary( + text: isListening ? labels.listening : labels.speak, + leadingIcon: UiIcons.bell, // Placeholder for mic + onPressed: () => BlocProvider.of( + context, + ).add(const RapidOrderVoiceToggled()), + style: OutlinedButton.styleFrom( + backgroundColor: isListening + ? UiColors.destructive.withValues(alpha: 0.05) + : null, + side: isListening + ? const BorderSide(color: UiColors.destructive) + : null, + ), + ), + ), + const SizedBox(width: UiConstants.space3), + Expanded( + child: UiButton.primary( + text: isSubmitting ? labels.sending : labels.send, + trailingIcon: UiIcons.arrowRight, + onPressed: isSubmitting || isMessageEmpty + ? null + : () { + print('RapidOrder send pressed'); + BlocProvider.of( + context, + ).add(const RapidOrderSubmitted()); + }, + ), + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/client/create_order/pubspec.yaml b/apps/mobile/packages/features/client/create_order/pubspec.yaml new file mode 100644 index 00000000..bf4c9bc4 --- /dev/null +++ b/apps/mobile/packages/features/client/create_order/pubspec.yaml @@ -0,0 +1,32 @@ +name: client_create_order +description: Client create order feature +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: ">=3.10.0 <4.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.3 + flutter_modular: ^6.3.2 + equatable: ^2.0.5 + intl: 0.20.2 + design_system: + path: ../../../design_system + core_localization: + path: ../../../core_localization + krow_domain: + path: ../../../domain + krow_core: + path: ../../../core + krow_data_connect: + path: ../../../data_connect + firebase_data_connect: ^0.2.2+2 + +dev_dependencies: + flutter_test: + sdk: flutter + bloc_test: ^9.1.5 diff --git a/apps/mobile/packages/features/client/home/lib/client_home.dart b/apps/mobile/packages/features/client/home/lib/client_home.dart new file mode 100644 index 00000000..5f75c860 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/client_home.dart @@ -0,0 +1,53 @@ +library client_home; + +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'src/data/repositories_impl/home_repository_impl.dart'; +import 'src/domain/repositories/home_repository_interface.dart'; +import 'src/domain/usecases/get_dashboard_data_usecase.dart'; +import 'src/domain/usecases/get_recent_reorders_usecase.dart'; +import 'src/domain/usecases/get_user_session_data_usecase.dart'; +import 'src/presentation/blocs/client_home_bloc.dart'; +import 'src/presentation/pages/client_home_page.dart'; + +export 'src/presentation/pages/client_home_page.dart'; +export 'src/presentation/navigation/client_home_navigator.dart'; + +/// A [Module] for the client home feature. +/// +/// This module configures the dependencies for the client home feature, +/// including repositories, use cases, and BLoCs. +class ClientHomeModule extends Module { + @override + List get imports => [DataConnectModule()]; + + @override + void binds(Injector i) { + // Repositories + i.addLazySingleton( + () => HomeRepositoryImpl( + i.get(), + ExampleConnector.instance, + ), + ); + + // UseCases + i.addLazySingleton(GetDashboardDataUseCase.new); + i.addLazySingleton(GetRecentReordersUseCase.new); + i.addLazySingleton(GetUserSessionDataUseCase.new); + + // BLoCs + i.add( + () => ClientHomeBloc( + getDashboardDataUseCase: i.get(), + getRecentReordersUseCase: i.get(), + getUserSessionDataUseCase: i.get(), + ), + ); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (_) => const ClientHomePage()); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/data/repositories_impl/home_repository_impl.dart b/apps/mobile/packages/features/client/home/lib/src/data/repositories_impl/home_repository_impl.dart new file mode 100644 index 00000000..0239e73a --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/data/repositories_impl/home_repository_impl.dart @@ -0,0 +1,90 @@ +import 'package:firebase_data_connect/firebase_data_connect.dart' as fdc; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/repositories/home_repository_interface.dart'; + +/// Implementation of [HomeRepositoryInterface] that delegates to [HomeRepositoryMock]. +/// +/// This implementation resides in the data layer and acts as a bridge between the +/// domain layer and the data source (in this case, a mock from data_connect). +class HomeRepositoryImpl implements HomeRepositoryInterface { + final HomeRepositoryMock _mock; + final ExampleConnector _dataConnect; + + /// Creates a [HomeRepositoryImpl]. + /// + /// Requires a [HomeRepositoryMock] to perform data operations. + HomeRepositoryImpl(this._mock, this._dataConnect); + + @override + Future getDashboardData() { + return _mock.getDashboardData(); + } + + @override + UserSessionData getUserSessionData() { + final (String businessName, String? photoUrl) = _mock.getUserSession(); + return UserSessionData( + businessName: businessName, + photoUrl: photoUrl, + ); + } + + @override + Future> getRecentReorders() async { + final String? businessId = ClientSessionStore.instance.session?.business?.id; + if (businessId == null || businessId.isEmpty) { + return const []; + } + + final DateTime now = DateTime.now(); + final DateTime start = now.subtract(const Duration(days: 30)); + final fdc.Timestamp startTimestamp = _toTimestamp(start); + final fdc.Timestamp endTimestamp = _toTimestamp(now); + + final fdc.QueryResult< + ListShiftRolesByBusinessDateRangeCompletedOrdersData, + ListShiftRolesByBusinessDateRangeCompletedOrdersVariables> result = + await _dataConnect.listShiftRolesByBusinessDateRangeCompletedOrders( + businessId: businessId, + start: startTimestamp, + end: endTimestamp, + ).execute(); + + print( + 'Home reorder: completed shiftRoles=${result.data.shiftRoles.length}', + ); + + return result.data.shiftRoles.map(( + ListShiftRolesByBusinessDateRangeCompletedOrdersShiftRoles shiftRole, + ) { + print( + 'Home reorder item: orderId=${shiftRole.shift.order.id} ' + 'shiftId=${shiftRole.shiftId} roleId=${shiftRole.roleId} ' + 'orderType=${shiftRole.shift.order.orderType.stringValue} ' + 'hours=${shiftRole.hours} count=${shiftRole.count}', + ); + final String location = + shiftRole.shift.location ?? + shiftRole.shift.locationAddress ?? + ''; + final String type = shiftRole.shift.order.orderType.stringValue; + return ReorderItem( + orderId: shiftRole.shift.order.id, + title: '${shiftRole.role.name} - ${shiftRole.shift.title}', + location: location, + hourlyRate: shiftRole.role.costPerHour, + hours: shiftRole.hours ?? 0, + workers: shiftRole.count, + type: type, + ); + }).toList(); + } + + fdc.Timestamp _toTimestamp(DateTime date) { + final int millis = date.millisecondsSinceEpoch; + final int seconds = millis ~/ 1000; + final int nanos = (millis % 1000) * 1000000; + return fdc.Timestamp(nanos, seconds); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/domain/repositories/home_repository_interface.dart b/apps/mobile/packages/features/client/home/lib/src/domain/repositories/home_repository_interface.dart new file mode 100644 index 00000000..e0a5eef4 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/domain/repositories/home_repository_interface.dart @@ -0,0 +1,31 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// User session data for the home page. +class UserSessionData { + /// The business name of the logged-in user. + final String businessName; + + /// The photo URL of the logged-in user (optional). + final String? photoUrl; + + /// Creates a [UserSessionData]. + const UserSessionData({ + required this.businessName, + this.photoUrl, + }); +} + +/// Interface for the Client Home repository. +/// +/// This repository is responsible for providing data required for the +/// client home screen dashboard. +abstract interface class HomeRepositoryInterface { + /// Fetches the [HomeDashboardData] containing aggregated dashboard metrics. + Future getDashboardData(); + + /// Fetches the user's session data (business name and photo). + UserSessionData getUserSessionData(); + + /// Fetches recently completed shift roles for reorder suggestions. + Future> getRecentReorders(); +} diff --git a/apps/mobile/packages/features/client/home/lib/src/domain/usecases/get_dashboard_data_usecase.dart b/apps/mobile/packages/features/client/home/lib/src/domain/usecases/get_dashboard_data_usecase.dart new file mode 100644 index 00000000..142e4703 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/domain/usecases/get_dashboard_data_usecase.dart @@ -0,0 +1,19 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/home_repository_interface.dart'; + +/// Use case to fetch dashboard data for the client home screen. +/// +/// This use case coordinates with the [HomeRepositoryInterface] to retrieve +/// the [HomeDashboardData] required for the dashboard display. +class GetDashboardDataUseCase implements NoInputUseCase { + final HomeRepositoryInterface _repository; + + /// Creates a [GetDashboardDataUseCase]. + GetDashboardDataUseCase(this._repository); + + @override + Future call() { + return _repository.getDashboardData(); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/domain/usecases/get_recent_reorders_usecase.dart b/apps/mobile/packages/features/client/home/lib/src/domain/usecases/get_recent_reorders_usecase.dart new file mode 100644 index 00000000..170d485e --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/domain/usecases/get_recent_reorders_usecase.dart @@ -0,0 +1,16 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/home_repository_interface.dart'; + +/// Use case to fetch recent completed shift roles for reorder suggestions. +class GetRecentReordersUseCase implements NoInputUseCase> { + final HomeRepositoryInterface _repository; + + /// Creates a [GetRecentReordersUseCase]. + GetRecentReordersUseCase(this._repository); + + @override + Future> call() { + return _repository.getRecentReorders(); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/domain/usecases/get_user_session_data_usecase.dart b/apps/mobile/packages/features/client/home/lib/src/domain/usecases/get_user_session_data_usecase.dart new file mode 100644 index 00000000..9710b727 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/domain/usecases/get_user_session_data_usecase.dart @@ -0,0 +1,16 @@ +import '../repositories/home_repository_interface.dart'; + +/// Use case for retrieving user session data. +/// +/// Returns the user's business name and photo URL for display in the header. +class GetUserSessionDataUseCase { + final HomeRepositoryInterface _repository; + + /// Creates a [GetUserSessionDataUseCase]. + GetUserSessionDataUseCase(this._repository); + + /// Executes the use case to get session data. + UserSessionData call() { + return _repository.getUserSessionData(); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/blocs/client_home_bloc.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/blocs/client_home_bloc.dart new file mode 100644 index 00000000..23ff6846 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/blocs/client_home_bloc.dart @@ -0,0 +1,119 @@ +import 'package:client_home/src/domain/repositories/home_repository_interface.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/usecases/get_dashboard_data_usecase.dart'; +import '../../domain/usecases/get_recent_reorders_usecase.dart'; +import '../../domain/usecases/get_user_session_data_usecase.dart'; +import 'client_home_event.dart'; +import 'client_home_state.dart'; + +/// BLoC responsible for managing the state and business logic of the client home dashboard. +class ClientHomeBloc extends Bloc { + final GetDashboardDataUseCase _getDashboardDataUseCase; + final GetRecentReordersUseCase _getRecentReordersUseCase; + final GetUserSessionDataUseCase _getUserSessionDataUseCase; + + ClientHomeBloc({ + required GetDashboardDataUseCase getDashboardDataUseCase, + required GetRecentReordersUseCase getRecentReordersUseCase, + required GetUserSessionDataUseCase getUserSessionDataUseCase, + }) : _getDashboardDataUseCase = getDashboardDataUseCase, + _getRecentReordersUseCase = getRecentReordersUseCase, + _getUserSessionDataUseCase = getUserSessionDataUseCase, + super(const ClientHomeState()) { + on(_onStarted); + on(_onEditModeToggled); + on(_onWidgetVisibilityToggled); + on(_onWidgetReordered); + on(_onLayoutReset); + } + + Future _onStarted( + ClientHomeStarted event, + Emitter emit, + ) async { + emit(state.copyWith(status: ClientHomeStatus.loading)); + try { + // Get session data + final UserSessionData sessionData = _getUserSessionDataUseCase(); + + // Get dashboard data + final HomeDashboardData data = await _getDashboardDataUseCase(); + final List reorderItems = await _getRecentReordersUseCase(); + + emit( + state.copyWith( + status: ClientHomeStatus.success, + dashboardData: data, + reorderItems: reorderItems, + businessName: sessionData.businessName, + photoUrl: sessionData.photoUrl, + ), + ); + } catch (e) { + emit( + state.copyWith( + status: ClientHomeStatus.error, + errorMessage: e.toString(), + ), + ); + } + } + + void _onEditModeToggled( + ClientHomeEditModeToggled event, + Emitter emit, + ) { + emit(state.copyWith(isEditMode: !state.isEditMode)); + } + + void _onWidgetVisibilityToggled( + ClientHomeWidgetVisibilityToggled event, + Emitter emit, + ) { + final Map newVisibility = Map.from(state.widgetVisibility); + newVisibility[event.widgetId] = !(newVisibility[event.widgetId] ?? true); + emit(state.copyWith(widgetVisibility: newVisibility)); + } + + void _onWidgetReordered( + ClientHomeWidgetReordered event, + Emitter emit, + ) { + final List newList = List.from(state.widgetOrder); + int oldIndex = event.oldIndex; + int newIndex = event.newIndex; + + if (oldIndex < newIndex) { + newIndex -= 1; + } + final String item = newList.removeAt(oldIndex); + newList.insert(newIndex, item); + + emit(state.copyWith(widgetOrder: newList)); + } + + void _onLayoutReset( + ClientHomeLayoutReset event, + Emitter emit, + ) { + emit( + state.copyWith( + widgetOrder: const [ + 'actions', + 'reorder', + 'coverage', + 'spending', + 'liveActivity', + ], + widgetVisibility: const { + 'actions': true, + 'reorder': true, + 'coverage': true, + 'spending': true, + 'liveActivity': true, + }, + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/blocs/client_home_event.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/blocs/client_home_event.dart new file mode 100644 index 00000000..10eecaad --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/blocs/client_home_event.dart @@ -0,0 +1,31 @@ +import 'package:equatable/equatable.dart'; + +abstract class ClientHomeEvent extends Equatable { + const ClientHomeEvent(); + + @override + List get props => []; +} + +class ClientHomeStarted extends ClientHomeEvent {} + +class ClientHomeEditModeToggled extends ClientHomeEvent {} + +class ClientHomeWidgetVisibilityToggled extends ClientHomeEvent { + final String widgetId; + const ClientHomeWidgetVisibilityToggled(this.widgetId); + + @override + List get props => [widgetId]; +} + +class ClientHomeWidgetReordered extends ClientHomeEvent { + final int oldIndex; + final int newIndex; + const ClientHomeWidgetReordered(this.oldIndex, this.newIndex); + + @override + List get props => [oldIndex, newIndex]; +} + +class ClientHomeLayoutReset extends ClientHomeEvent {} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/blocs/client_home_state.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/blocs/client_home_state.dart new file mode 100644 index 00000000..cee3337e --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/blocs/client_home_state.dart @@ -0,0 +1,80 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; + +/// Status of the client home dashboard. +enum ClientHomeStatus { initial, loading, success, error } + +/// Represents the state of the client home dashboard. +class ClientHomeState extends Equatable { + final ClientHomeStatus status; + final List widgetOrder; + final Map widgetVisibility; + final bool isEditMode; + final String? errorMessage; + final HomeDashboardData dashboardData; + final List reorderItems; + final String businessName; + final String? photoUrl; + + const ClientHomeState({ + this.status = ClientHomeStatus.initial, + this.widgetOrder = const [ + 'actions', + 'reorder', + ], + this.widgetVisibility = const { + 'actions': true, + 'reorder': true, + }, + this.isEditMode = false, + this.errorMessage, + this.dashboardData = const HomeDashboardData( + weeklySpending: 4250.0, + next7DaysSpending: 6100.0, + weeklyShifts: 12, + next7DaysScheduled: 18, + totalNeeded: 10, + totalFilled: 8, + ), + this.reorderItems = const [], + this.businessName = 'Your Company', + this.photoUrl, + }); + + ClientHomeState copyWith({ + ClientHomeStatus? status, + List? widgetOrder, + Map? widgetVisibility, + bool? isEditMode, + String? errorMessage, + HomeDashboardData? dashboardData, + List? reorderItems, + String? businessName, + String? photoUrl, + }) { + return ClientHomeState( + status: status ?? this.status, + widgetOrder: widgetOrder ?? this.widgetOrder, + widgetVisibility: widgetVisibility ?? this.widgetVisibility, + isEditMode: isEditMode ?? this.isEditMode, + errorMessage: errorMessage ?? this.errorMessage, + dashboardData: dashboardData ?? this.dashboardData, + reorderItems: reorderItems ?? this.reorderItems, + businessName: businessName ?? this.businessName, + photoUrl: photoUrl ?? this.photoUrl, + ); + } + + @override + List get props => [ + status, + widgetOrder, + widgetVisibility, + isEditMode, + errorMessage, + dashboardData, + reorderItems, + businessName, + photoUrl, + ]; +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/navigation/client_home_navigator.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/navigation/client_home_navigator.dart new file mode 100644 index 00000000..1c421a36 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/navigation/client_home_navigator.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import '../widgets/shift_order_form_sheet.dart'; + +extension ClientHomeNavigator on IModularNavigator { + void pushSettings() { + pushNamed('/client-settings/'); + } + + void pushCreateOrder() { + pushNamed('/client/create-order/'); + } + + void pushRapidOrder() { + pushNamed('/client/create-order/rapid'); + } +} + +/// Helper class for showing modal sheets in the client home feature. +class ClientHomeSheets { + /// Shows the shift order form bottom sheet. + /// + /// Optionally accepts [initialData] to pre-populate the form for reordering. + /// Calls [onSubmit] when the user submits the form successfully. + static void showOrderFormSheet( + BuildContext context, + Map? initialData, { + required void Function(Map) onSubmit, + }) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (BuildContext context) { + return ShiftOrderFormSheet( + initialData: initialData, + onSubmit: (Map data) { + Navigator.pop(context); + onSubmit(data); + }, + ); + }, + ); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/pages/client_home_page.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/pages/client_home_page.dart new file mode 100644 index 00000000..e4e30728 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/pages/client_home_page.dart @@ -0,0 +1,101 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; + +import '../blocs/client_home_bloc.dart'; +import '../blocs/client_home_event.dart'; +import '../blocs/client_home_state.dart'; +import '../widgets/client_home_edit_banner.dart'; +import '../widgets/client_home_header.dart'; +import '../widgets/dashboard_widget_builder.dart'; + +/// The main Home page for client users. +/// +/// This page displays a customizable dashboard with various widgets that can be +/// reordered and toggled on/off through edit mode. +class ClientHomePage extends StatelessWidget { + /// Creates a [ClientHomePage]. + const ClientHomePage({super.key}); + + @override + Widget build(BuildContext context) { + final TranslationsClientHomeEn i18n = t.client_home; + + return BlocProvider( + create: (BuildContext context) => + Modular.get()..add(ClientHomeStarted()), + child: Scaffold( + body: SafeArea( + child: Column( + children: [ + ClientHomeHeader(i18n: i18n), + ClientHomeEditBanner(i18n: i18n), + Flexible( + child: BlocBuilder( + builder: (BuildContext context, ClientHomeState state) { + if (state.isEditMode) { + return _buildEditModeList(context, state); + } + return _buildNormalModeList(state); + }, + ), + ), + ], + ), + ), + ), + ); + } + + /// Builds the widget list in edit mode with drag-and-drop support. + Widget _buildEditModeList(BuildContext context, ClientHomeState state) { + return ReorderableListView( + padding: const EdgeInsets.fromLTRB( + UiConstants.space4, + 0, + UiConstants.space4, + 100, + ), + onReorder: (int oldIndex, int newIndex) { + BlocProvider.of(context).add( + ClientHomeWidgetReordered(oldIndex, newIndex), + ); + }, + children: state.widgetOrder.map((String id) { + return Container( + key: ValueKey(id), + margin: const EdgeInsets.only(bottom: UiConstants.space4), + child: DashboardWidgetBuilder( + id: id, + state: state, + isEditMode: true, + ), + ); + }).toList(), + ); + } + + /// Builds the widget list in normal mode with visibility filters. + Widget _buildNormalModeList(ClientHomeState state) { + return ListView( + padding: const EdgeInsets.fromLTRB( + UiConstants.space4, + 0, + UiConstants.space4, + 100, + ), + children: state.widgetOrder.map((String id) { + return Padding( + padding: const EdgeInsets.only(bottom: UiConstants.space4), + child: DashboardWidgetBuilder( + id: id, + state: state, + isEditMode: false, + ), + ); + }).toList(), + ); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/actions_widget.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/actions_widget.dart new file mode 100644 index 00000000..eeebff38 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/actions_widget.dart @@ -0,0 +1,123 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A widget that displays quick actions for the client. +class ActionsWidget extends StatelessWidget { + /// Callback when RAPID is pressed. + final VoidCallback onRapidPressed; + + /// Callback when Create Order is pressed. + final VoidCallback onCreateOrderPressed; + + /// Creates an [ActionsWidget]. + const ActionsWidget({ + super.key, + required this.onRapidPressed, + required this.onCreateOrderPressed, + }); + + @override + Widget build(BuildContext context) { + // Check if client_home exists in t + final TranslationsClientHomeActionsEn i18n = t.client_home.actions; + + return Row( + children: [ + Expanded( + child: _ActionCard( + title: i18n.rapid, + subtitle: i18n.rapid_subtitle, + icon: UiIcons.zap, + color: const Color(0xFFFEF2F2), + borderColor: const Color(0xFFFECACA), + iconBgColor: const Color(0xFFFEE2E2), + iconColor: const Color(0xFFDC2626), + textColor: const Color(0xFF7F1D1D), + subtitleColor: const Color(0xFFB91C1C), + onTap: onRapidPressed, + ), + ), + const SizedBox(width: UiConstants.space2), + Expanded( + child: _ActionCard( + title: i18n.create_order, + subtitle: i18n.create_order_subtitle, + icon: UiIcons.add, + color: UiColors.white, + borderColor: UiColors.border, + iconBgColor: UiColors.primaryForeground, + iconColor: UiColors.primary, + textColor: UiColors.textPrimary, + subtitleColor: UiColors.textSecondary, + onTap: onCreateOrderPressed, + ), + ), + ], + ); + } +} + +class _ActionCard extends StatelessWidget { + final String title; + final String subtitle; + final IconData icon; + final Color color; + final Color borderColor; + final Color iconBgColor; + final Color iconColor; + final Color textColor; + final Color subtitleColor; + final VoidCallback onTap; + + const _ActionCard({ + required this.title, + required this.subtitle, + required this.icon, + required this.color, + required this.borderColor, + required this.iconBgColor, + required this.iconColor, + required this.textColor, + required this.subtitleColor, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: color, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: borderColor), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 36, + height: 36, + decoration: BoxDecoration( + color: iconBgColor, + borderRadius: UiConstants.radiusLg, + ), + child: Icon(icon, color: iconColor, size: 16), + ), + const SizedBox(height: UiConstants.space2), + Text( + title, + style: UiTypography.footnote1b.copyWith(color: textColor), + ), + Text( + subtitle, + style: UiTypography.footnote2r.copyWith(color: subtitleColor), + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/client_home_edit_banner.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/client_home_edit_banner.dart new file mode 100644 index 00000000..7db658d7 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/client_home_edit_banner.dart @@ -0,0 +1,79 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../blocs/client_home_bloc.dart'; +import '../blocs/client_home_event.dart'; +import '../blocs/client_home_state.dart'; + +/// A banner displayed when edit mode is active. +/// +/// Shows instructions for reordering widgets and provides a reset button +/// to restore the default layout. +class ClientHomeEditBanner extends StatelessWidget { + /// The internationalization object for localized strings. + final dynamic i18n; + + /// Creates a [ClientHomeEditBanner]. + const ClientHomeEditBanner({ + required this.i18n, + super.key, + }); + + @override + Widget build(BuildContext context) { + return BlocBuilder( + buildWhen: (ClientHomeState prev, ClientHomeState curr) => prev.isEditMode != curr.isEditMode, + builder: (BuildContext context, ClientHomeState state) { + return AnimatedContainer( + duration: const Duration(milliseconds: 300), + height: state.isEditMode ? 76 : 0, + clipBehavior: Clip.antiAlias, + margin: const EdgeInsets.symmetric( + horizontal: UiConstants.space4, + vertical: UiConstants.space2, + ), + padding: const EdgeInsets.all(UiConstants.space3), + decoration: BoxDecoration( + color: UiColors.primary.withValues(alpha: 0.1), + border: Border.all(color: UiColors.primary.withValues(alpha: 0.3)), + borderRadius: UiConstants.radiusLg, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Icon(UiIcons.edit, size: 16, color: UiColors.primary), + const SizedBox(width: UiConstants.space2), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + i18n.dashboard.edit_mode_active, + style: UiTypography.footnote1b.copyWith( + color: UiColors.primary, + ), + ), + Text( + i18n.dashboard.drag_instruction, + style: UiTypography.footnote2r.textSecondary, + ), + ], + ), + UiButton.secondary( + text: i18n.dashboard.reset, + onPressed: () => BlocProvider.of( + context, + ).add(ClientHomeLayoutReset()), + size: UiButtonSize.small, + style: OutlinedButton.styleFrom( + minimumSize: const Size(0, 48), + maximumSize: const Size(double.infinity, 48), + ), + ), + ], + ), + ); + }, + ); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/client_home_header.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/client_home_header.dart new file mode 100644 index 00000000..12b6a222 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/client_home_header.dart @@ -0,0 +1,108 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import '../blocs/client_home_bloc.dart'; +import '../blocs/client_home_event.dart'; +import '../blocs/client_home_state.dart'; +import '../navigation/client_home_navigator.dart'; +import 'header_icon_button.dart'; + +/// The header section of the client home page. +/// +/// Displays the user's business name, avatar, and action buttons +/// (edit mode, notifications, settings). +class ClientHomeHeader extends StatelessWidget { + /// The internationalization object for localized strings. + final dynamic i18n; + + /// Creates a [ClientHomeHeader]. + const ClientHomeHeader({ + required this.i18n, + super.key, + }); + + @override + Widget build(BuildContext context) { + return BlocBuilder( + builder: (BuildContext context, ClientHomeState state) { + final String businessName = state.businessName; + final String? photoUrl = state.photoUrl; + final String avatarLetter = businessName.trim().isNotEmpty + ? businessName.trim()[0].toUpperCase() + : 'C'; + + return Padding( + padding: const EdgeInsets.fromLTRB( + UiConstants.space4, + UiConstants.space4, + UiConstants.space4, + UiConstants.space3, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all( + color: UiColors.primary.withValues(alpha: 0.2), + width: 2, + ), + ), + child: CircleAvatar( + backgroundColor: UiColors.primary.withValues(alpha: 0.1), + backgroundImage: + photoUrl != null && photoUrl.isNotEmpty + ? NetworkImage(photoUrl) + : null, + child: photoUrl != null && photoUrl.isNotEmpty + ? null + : Text( + avatarLetter, + style: UiTypography.body2b.copyWith( + color: UiColors.primary, + ), + ), + ), + ), + const SizedBox(width: UiConstants.space3), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + i18n.dashboard.welcome_back, + style: UiTypography.footnote2r.textSecondary, + ), + Text(businessName, style: UiTypography.body1b), + ], + ), + ], + ), + Row( + spacing: UiConstants.space2, + children: [ + HeaderIconButton( + icon: UiIcons.edit, + isActive: state.isEditMode, + onTap: () => BlocProvider.of( + context, + ).add(ClientHomeEditModeToggled()), + ), + HeaderIconButton( + icon: UiIcons.settings, + onTap: () => Modular.to.pushSettings(), + ), + ], + ), + ], + ), + ); + }, + ); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/coverage_dashboard.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/coverage_dashboard.dart new file mode 100644 index 00000000..c40f0202 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/coverage_dashboard.dart @@ -0,0 +1,222 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A dashboard widget that displays today's coverage status. +class CoverageDashboard extends StatelessWidget { + /// The list of shifts for today. + final List shifts; + + /// The list of applications for today's shifts. + final List applications; + + /// Creates a [CoverageDashboard]. + const CoverageDashboard({ + super.key, + required this.shifts, + required this.applications, + }); + + @override + Widget build(BuildContext context) { + int totalNeeded = 0; + int totalConfirmed = 0; + double todayCost = 0; + + for (final s in shifts) { + final int needed = s['workersNeeded'] as int? ?? 0; + final int confirmed = s['filled'] as int? ?? 0; + final double rate = s['hourlyRate'] as double? ?? 20.0; + + totalNeeded += needed; + totalConfirmed += confirmed; + todayCost += rate * 8 * confirmed; + } + + final int coveragePercent = totalNeeded > 0 + ? ((totalConfirmed / totalNeeded) * 100).round() + : 100; + final int unfilledPositions = totalNeeded - totalConfirmed; + + final int checkedInCount = applications + .where((a) => (a as Map)['checkInTime'] != null) + .length; + final int lateWorkersCount = applications + .where((a) => (a as Map)['status'] == 'LATE') + .length; + + final bool isCoverageGood = coveragePercent >= 90; + final Color coverageBadgeColor = isCoverageGood + ? const Color(0xFFD1FAE5) // TODO: Use design system color if available + : const Color(0xFFFEF3C7); + final Color coverageTextColor = isCoverageGood + ? const Color(0xFF047857) + : const Color(0xFFB45309); + + return Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: UiColors.black.withValues(alpha: 0.02), + blurRadius: 4, + offset: const Offset(0, 1), + ), + ], + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text("Today's Status", style: UiTypography.body1m.textSecondary), + Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space2, + vertical: 2.0, + ), + decoration: BoxDecoration( + color: coverageBadgeColor, + borderRadius: UiConstants.radiusMd, + ), + child: Text( + '$coveragePercent% Covered', + style: UiTypography.footnote1b.copyWith( + color: coverageTextColor, + ), + ), + ), + ], + ), + const SizedBox(height: UiConstants.space4), + + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + children: [ + _StatusCard( + label: 'Unfilled Today', + value: '$unfilledPositions', + icon: UiIcons.warning, + isWarning: unfilledPositions > 0, + ), + if (lateWorkersCount > 0) ...[ + const SizedBox(height: UiConstants.space2), + _StatusCard( + label: 'Running Late', + value: '$lateWorkersCount', + icon: UiIcons.error, + isError: true, + ), + ], + ], + ), + ), + const SizedBox(width: UiConstants.space2), + Expanded( + child: Column( + children: [ + _StatusCard( + label: 'Checked In', + value: '$checkedInCount/$totalConfirmed', + icon: UiIcons.success, + isInfo: true, + ), + const SizedBox(height: UiConstants.space2), + _StatusCard( + label: "Today's Cost", + value: '\$${todayCost.round()}', + icon: UiIcons.dollar, + isInfo: true, + ), + ], + ), + ), + ], + ), + ], + ), + ); + } +} + +class _StatusCard extends StatelessWidget { + final String label; + final String value; + final IconData icon; + final bool isWarning; + final bool isError; + final bool isInfo; + + const _StatusCard({ + required this.label, + required this.value, + required this.icon, + this.isWarning = false, + this.isError = false, + this.isInfo = false, + }); + + @override + Widget build(BuildContext context) { + Color bg = const Color(0xFFF1F5F9); + Color border = const Color(0xFFE2E8F0); + Color iconColor = UiColors.iconSecondary; + Color textColor = UiColors.textPrimary; + + if (isWarning) { + bg = const Color(0xFFFFFBEB); + border = const Color(0xFFFDE68A); + iconColor = const Color(0xFFD97706); + textColor = const Color(0xFFB45309); + } else if (isError) { + bg = const Color(0xFFFEF2F2); + border = const Color(0xFFFECACA); + iconColor = const Color(0xFFDC2626); + textColor = const Color(0xFFB91C1C); + } else if (isInfo) { + bg = const Color(0xFFEFF6FF); + border = const Color(0xFFBFDBFE); + iconColor = const Color(0xFF2563EB); + textColor = const Color(0xFF1D4ED8); + } + + return Container( + padding: const EdgeInsets.all(UiConstants.space3), + decoration: BoxDecoration( + color: bg, + border: Border.all(color: border), + borderRadius: UiConstants.radiusMd, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon(icon, size: 16, color: iconColor), + const SizedBox(width: UiConstants.space2), + Expanded( + child: Text( + label, + style: UiTypography.footnote1m.copyWith( + color: textColor.withValues(alpha: 0.8), + ), + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + const SizedBox(height: UiConstants.space1), + Text( + value, + style: UiTypography.headline3m.copyWith(color: textColor), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/coverage_widget.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/coverage_widget.dart new file mode 100644 index 00000000..9e812804 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/coverage_widget.dart @@ -0,0 +1,152 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A widget that displays the daily coverage metrics. +class CoverageWidget extends StatelessWidget { + /// The total number of shifts needed. + final int totalNeeded; + + /// The number of confirmed shifts. + final int totalConfirmed; + + /// The percentage of coverage (0-100). + final int coveragePercent; + + /// Creates a [CoverageWidget]. + const CoverageWidget({ + super.key, + this.totalNeeded = 10, + this.totalConfirmed = 8, + this.coveragePercent = 80, + }); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "TODAY'S COVERAGE", + style: UiTypography.footnote1b.copyWith( + color: UiColors.textPrimary, + letterSpacing: 0.5, + ), + ), + Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space2, + vertical: + 2, // 2px is not in metrics, using hardcoded for small tweaks or space0/space1 + ), + decoration: BoxDecoration( + color: UiColors.tagActive, + borderRadius: UiConstants.radiusLg, + ), + child: Text( + '$coveragePercent% Covered', + style: UiTypography.footnote2b.copyWith( + color: UiColors.textSuccess, + ), + ), + ), + ], + ), + const SizedBox(height: UiConstants.space2), + Row( + children: [ + Expanded( + child: _MetricCard( + icon: UiIcons.target, + iconColor: UiColors.primary, + label: 'Needed', + value: '$totalNeeded', + ), + ), + const SizedBox(width: UiConstants.space2), + Expanded( + child: _MetricCard( + icon: UiIcons.success, + iconColor: UiColors.iconSuccess, + label: 'Filled', + value: '$totalConfirmed', + valueColor: UiColors.textSuccess, + ), + ), + const SizedBox(width: UiConstants.space2), + Expanded( + child: _MetricCard( + icon: UiIcons.error, + iconColor: UiColors.iconError, + label: 'Open', + value: '${totalNeeded - totalConfirmed}', + valueColor: UiColors.textError, + ), + ), + ], + ), + ], + ); + } +} + +class _MetricCard extends StatelessWidget { + final IconData icon; + final Color iconColor; + final String label; + final String value; + final Color? valueColor; + + const _MetricCard({ + required this.icon, + required this.iconColor, + required this.label, + required this.value, + this.valueColor, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space2 + 2), // 10px + decoration: BoxDecoration( + color: UiColors.cardViewBackground, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: UiColors.black.withValues(alpha: 0.02), + blurRadius: 2, + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon(icon, size: 14, color: iconColor), + const SizedBox(width: 6), // 6px + Text( + label, + style: UiTypography.footnote2m.copyWith( + color: UiColors.textSecondary, + ), + ), + ], + ), + const SizedBox(width: 6), // 6px + Text( + value, + style: UiTypography.headline3m.copyWith( + color: valueColor ?? UiColors.textPrimary, + fontWeight: + FontWeight.bold, // header3 is usually bold, but ensuring + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/dashboard_widget_builder.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/dashboard_widget_builder.dart new file mode 100644 index 00000000..d5d13ec8 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/dashboard_widget_builder.dart @@ -0,0 +1,120 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import '../blocs/client_home_state.dart'; +import '../navigation/client_home_navigator.dart'; +import '../widgets/actions_widget.dart'; +import '../widgets/coverage_widget.dart'; +import '../widgets/draggable_widget_wrapper.dart'; +import '../widgets/live_activity_widget.dart'; +import '../widgets/reorder_widget.dart'; +import '../widgets/spending_widget.dart'; + +/// A widget that builds dashboard content based on widget ID. +/// +/// This widget encapsulates the logic for rendering different dashboard +/// widgets based on their unique identifiers and current state. +class DashboardWidgetBuilder extends StatelessWidget { + /// The unique identifier for the widget to build. + final String id; + + /// The current dashboard state. + final ClientHomeState state; + + /// Whether the widget is in edit mode. + final bool isEditMode; + + /// Creates a [DashboardWidgetBuilder]. + const DashboardWidgetBuilder({ + required this.id, + required this.state, + required this.isEditMode, + super.key, + }); + + @override + Widget build(BuildContext context) { + final TranslationsClientHomeWidgetsEn i18n = t.client_home.widgets; + final Widget widgetContent = _buildWidgetContent(context); + + if (isEditMode) { + return DraggableWidgetWrapper( + id: id, + title: _getWidgetTitle(i18n), + isVisible: state.widgetVisibility[id] ?? true, + child: widgetContent, + ); + } + + // Hide widget if not visible in normal mode + if (!(state.widgetVisibility[id] ?? true)) { + return const SizedBox.shrink(); + } + + return widgetContent; + } + + /// Builds the actual widget content based on the widget ID. + Widget _buildWidgetContent(BuildContext context) { + switch (id) { + case 'actions': + return ActionsWidget( + onRapidPressed: () => Modular.to.pushRapidOrder(), + onCreateOrderPressed: () => Modular.to.pushCreateOrder(), + ); + case 'reorder': + return ReorderWidget( + orders: state.reorderItems, + onReorderPressed: (Map data) { + ClientHomeSheets.showOrderFormSheet( + context, + data, + onSubmit: (Map submittedData) { + // Handle form submission if needed + }, + ); + }, + ); + case 'spending': + return SpendingWidget( + weeklySpending: state.dashboardData.weeklySpending, + next7DaysSpending: state.dashboardData.next7DaysSpending, + weeklyShifts: state.dashboardData.weeklyShifts, + next7DaysScheduled: state.dashboardData.next7DaysScheduled, + ); + case 'coverage': + return CoverageWidget( + totalNeeded: state.dashboardData.totalNeeded, + totalConfirmed: state.dashboardData.totalFilled, + coveragePercent: state.dashboardData.totalNeeded > 0 + ? ((state.dashboardData.totalFilled / + state.dashboardData.totalNeeded) * + 100) + .toInt() + : 0, + ); + case 'liveActivity': + return LiveActivityWidget(onViewAllPressed: () {}); + default: + return const SizedBox.shrink(); + } + } + + /// Returns the display title for the widget based on its ID. + String _getWidgetTitle(dynamic i18n) { + switch (id) { + case 'actions': + return i18n.actions; + case 'reorder': + return i18n.reorder; + case 'coverage': + return i18n.coverage; + case 'spending': + return i18n.spending; + case 'liveActivity': + return i18n.live_activity; + default: + return ''; + } + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/draggable_widget_wrapper.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/draggable_widget_wrapper.dart new file mode 100644 index 00000000..3f82a79e --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/draggable_widget_wrapper.dart @@ -0,0 +1,95 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../blocs/client_home_bloc.dart'; +import '../blocs/client_home_event.dart'; + +/// A wrapper for dashboard widgets in edit mode. +/// +/// Displays drag handles, visibility toggles, and wraps the actual widget +/// content with appropriate styling for the edit state. +class DraggableWidgetWrapper extends StatelessWidget { + /// The unique identifier for this widget. + final String id; + + /// The display title for this widget. + final String title; + + /// The actual widget content to wrap. + final Widget child; + + /// Whether this widget is currently visible. + final bool isVisible; + + /// Creates a [DraggableWidgetWrapper]. + const DraggableWidgetWrapper({ + required this.id, + required this.title, + required this.child, + required this.isVisible, + super.key, + }); + + @override + Widget build(BuildContext context) { + return Column( + spacing: UiConstants.space2, + children: [ + Row( + children: [ + Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space2, + vertical: UiConstants.space1, + ), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusMd, + border: Border.all(color: UiColors.border), + ), + child: Row( + children: [ + const Icon( + UiIcons.gripVertical, + size: 14, + color: UiColors.iconSecondary, + ), + const SizedBox(width: UiConstants.space2), + Text(title, style: UiTypography.footnote1m), + ], + ), + ), + const SizedBox(width: UiConstants.space2), + GestureDetector( + onTap: () => BlocProvider.of( + context, + ).add(ClientHomeWidgetVisibilityToggled(id)), + child: Container( + padding: const EdgeInsets.all(UiConstants.space1), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusMd, + border: Border.all(color: UiColors.border), + ), + child: Icon( + isVisible ? UiIcons.success : UiIcons.error, + size: 14, + color: isVisible ? UiColors.primary : UiColors.iconSecondary, + ), + ), + ), + ], + ), + + // Widget content + Opacity( + opacity: isVisible ? 1.0 : 0.4, + child: IgnorePointer( + ignoring: !isVisible, + child: child, + ), + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/header_icon_button.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/header_icon_button.dart new file mode 100644 index 00000000..b093130d --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/header_icon_button.dart @@ -0,0 +1,82 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A circular icon button used in the header section. +/// +/// Supports an optional badge for notification counts and an active state +/// for toggled actions. +class HeaderIconButton extends StatelessWidget { + /// The icon to display. + final IconData icon; + + /// Optional badge text (e.g., notification count). + final String? badgeText; + + /// Whether this button is in an active/selected state. + final bool isActive; + + /// Callback invoked when the button is tapped. + final VoidCallback onTap; + + /// Creates a [HeaderIconButton]. + const HeaderIconButton({ + required this.icon, + this.badgeText, + this.isActive = false, + required this.onTap, + super.key, + }); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Stack( + clipBehavior: Clip.none, + children: [ + Container( + width: 32, + height: 32, + decoration: BoxDecoration( + color: isActive ? UiColors.primary : UiColors.white, + borderRadius: UiConstants.radiusMd, + boxShadow: [ + BoxShadow( + color: Colors.black.withValues(alpha: 0.05), + blurRadius: 2, + ), + ], + ), + child: Icon( + icon, + color: isActive ? UiColors.white : UiColors.iconSecondary, + size: 16, + ), + ), + if (badgeText != null) + Positioned( + top: -4, + right: -4, + child: Container( + padding: const EdgeInsets.all(4), + decoration: const BoxDecoration( + color: UiColors.iconError, + shape: BoxShape.circle, + ), + constraints: const BoxConstraints(minWidth: 16, minHeight: 16), + child: Center( + child: Text( + badgeText!, + style: UiTypography.footnote2b.copyWith( + color: UiColors.white, + fontSize: 8, + ), + ), + ), + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/live_activity_widget.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/live_activity_widget.dart new file mode 100644 index 00000000..47bbcfb9 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/live_activity_widget.dart @@ -0,0 +1,69 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'coverage_dashboard.dart'; + +/// A widget that displays live activity information. +class LiveActivityWidget extends StatelessWidget { + /// Callback when "View all" is pressed. + final VoidCallback onViewAllPressed; + + /// Creates a [LiveActivityWidget]. + const LiveActivityWidget({super.key, required this.onViewAllPressed}); + + @override + Widget build(BuildContext context) { + final TranslationsClientHomeEn i18n = t.client_home; + + // Mock data + final List> shifts = >[ + { + 'workersNeeded': 5, + 'filled': 4, + 'hourlyRate': 20.0, + 'status': 'OPEN', + 'date': DateTime.now().toIso8601String().split('T')[0], + }, + { + 'workersNeeded': 5, + 'filled': 5, + 'hourlyRate': 22.0, + 'status': 'FILLED', + 'date': DateTime.now().toIso8601String().split('T')[0], + }, + ]; + final List> applications = >[ + {'status': 'CONFIRMED', 'checkInTime': '09:00'}, + {'status': 'CONFIRMED', 'checkInTime': '09:05'}, + {'status': 'CONFIRMED'}, + {'status': 'LATE'}, + ]; + + return Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + i18n.widgets.live_activity.toUpperCase(), + style: UiTypography.footnote1b.textSecondary.copyWith( + letterSpacing: 0.5, + ), + ), + GestureDetector( + onTap: onViewAllPressed, + child: Text( + i18n.dashboard.view_all, + style: UiTypography.footnote1m.copyWith( + color: UiColors.primary, + ), + ), + ), + ], + ), + const SizedBox(height: UiConstants.space2), + CoverageDashboard(shifts: shifts, applications: applications), + ], + ); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/reorder_widget.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/reorder_widget.dart new file mode 100644 index 00000000..b0147414 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/reorder_widget.dart @@ -0,0 +1,221 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:krow_domain/krow_domain.dart'; + +/// A widget that allows clients to reorder recent shifts. +class ReorderWidget extends StatelessWidget { + /// Recent completed orders for reorder. + final List orders; + + /// Callback when a reorder button is pressed. + final Function(Map shiftData) onReorderPressed; + + /// Creates a [ReorderWidget]. + const ReorderWidget({ + super.key, + required this.orders, + required this.onReorderPressed, + }); + + @override + Widget build(BuildContext context) { + final TranslationsClientHomeReorderEn i18n = t.client_home.reorder; + + final List recentOrders = orders; + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + i18n.title, + style: UiTypography.footnote1b.textSecondary.copyWith( + letterSpacing: 0.5, + ), + ), + const SizedBox(height: UiConstants.space2), + SizedBox( + height: 140, + child: ListView.separated( + scrollDirection: Axis.horizontal, + itemCount: recentOrders.length, + separatorBuilder: (BuildContext context, int index) => + const SizedBox(width: UiConstants.space3), + itemBuilder: (BuildContext context, int index) { + final ReorderItem order = recentOrders[index]; + final double totalCost = + order.hourlyRate * order.hours * order.workers; + + return Container( + width: 260, + padding: const EdgeInsets.all(UiConstants.space3), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: UiColors.black.withValues(alpha: 0.02), + blurRadius: 4, + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( + children: [ + Container( + width: 36, + height: 36, + decoration: BoxDecoration( + color: UiColors.primary.withValues( + alpha: 0.1, + ), + borderRadius: UiConstants.radiusLg, + ), + child: const Icon( + UiIcons.building, + size: 16, + color: UiColors.primary, + ), + ), + const SizedBox(width: UiConstants.space2), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + order.title, + style: UiTypography.body2b, + overflow: TextOverflow.ellipsis, + ), + Text( + order.location, + style: + UiTypography.footnote1r.textSecondary, + overflow: TextOverflow.ellipsis, + ), + ], + ), + ), + ], + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + '\$${totalCost.toStringAsFixed(0)}', + style: UiTypography.body1b, + ), + Text( + i18n.per_hr( + amount: order.hourlyRate.toString(), + ) + + ' Β· ${order.hours}h', + style: UiTypography.footnote2r.textSecondary, + ), + ], + ), + ], + ), + const SizedBox(height: UiConstants.space3), + Row( + children: [ + _Badge( + icon: UiIcons.success, + text: order.type, + color: const Color(0xFF2563EB), + bg: const Color(0xFF2563EB), + textColor: UiColors.white, + ), + const SizedBox(width: UiConstants.space2), + _Badge( + icon: UiIcons.building, + text: '${order.workers}', + color: const Color(0xFF334155), + bg: const Color(0xFFF1F5F9), + textColor: const Color(0xFF334155), + ), + ], + ), + const Spacer(), + SizedBox( + height: 28, + width: double.infinity, + child: ElevatedButton.icon( + onPressed: () => onReorderPressed({ + 'orderId': order.orderId, + 'title': order.title, + 'location': order.location, + 'hourlyRate': order.hourlyRate, + 'hours': order.hours, + 'workers': order.workers, + 'type': order.type, + }), + style: ElevatedButton.styleFrom( + backgroundColor: UiColors.primary, + foregroundColor: UiColors.white, + padding: EdgeInsets.zero, + shape: RoundedRectangleBorder( + borderRadius: UiConstants.radiusMd, + ), + elevation: 0, + ), + icon: const Icon(UiIcons.zap, size: 12), + label: Text( + i18n.reorder_button, + style: UiTypography.footnote1m, + ), + ), + ), + ], + ), + ); + }, + ), + ), + ], + ); + } +} + +class _Badge extends StatelessWidget { + final IconData icon; + final String text; + final Color color; + final Color bg; + final Color textColor; + + const _Badge({ + required this.icon, + required this.text, + required this.color, + required this.bg, + required this.textColor, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space2, + vertical: UiConstants.space1, + ), + decoration: BoxDecoration(color: bg, borderRadius: UiConstants.radiusSm), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(icon, size: 10, color: bg == textColor ? UiColors.white : color), + const SizedBox(width: UiConstants.space1), + Text(text, style: UiTypography.footnote2b.copyWith(color: textColor)), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/shift_order_form_sheet.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/shift_order_form_sheet.dart new file mode 100644 index 00000000..7df94dfd --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/shift_order_form_sheet.dart @@ -0,0 +1,1148 @@ +import 'package:design_system/design_system.dart'; +import 'package:firebase_data_connect/firebase_data_connect.dart' as fdc; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:krow_data_connect/krow_data_connect.dart' as dc; + +class _RoleOption { + const _RoleOption({ + required this.id, + required this.name, + required this.costPerHour, + }); + + final String id; + final String name; + final double costPerHour; +} + +class _VendorOption { + const _VendorOption({required this.id, required this.name}); + + final String id; + final String name; +} + +/// A bottom sheet form for creating or reordering shifts. +/// +/// This widget provides a comprehensive form matching the design patterns +/// used in view_order_card.dart for consistency across the app. +class ShiftOrderFormSheet extends StatefulWidget { + /// Initial data for the form (e.g. from a reorder action). + final Map? initialData; + + /// Callback when the form is submitted. + final Function(Map data) onSubmit; + + /// Whether the submission is loading. + final bool isLoading; + + /// Creates a [ShiftOrderFormSheet]. + const ShiftOrderFormSheet({ + super.key, + this.initialData, + required this.onSubmit, + this.isLoading = false, + }); + + @override + State createState() => _ShiftOrderFormSheetState(); +} + +class _ShiftOrderFormSheetState extends State { + late TextEditingController _dateController; + late TextEditingController _globalLocationController; + + late List> _positions; + + final dc.ExampleConnector _dataConnect = dc.ExampleConnector.instance; + List<_VendorOption> _vendors = const <_VendorOption>[]; + List<_RoleOption> _roles = const <_RoleOption>[]; + String? _selectedVendorId; + + @override + void initState() { + super.initState(); + + // Initialize date controller (always today for reorder sheet) + final DateTime today = DateTime.now(); + final String initialDate = today.toIso8601String().split('T')[0]; + _dateController = TextEditingController(text: initialDate); + + // Initialize location controller + _globalLocationController = TextEditingController( + text: widget.initialData?['location'] ?? + widget.initialData?['locationAddress'] ?? + '', + ); + + // Initialize positions + _positions = >[ + { + 'roleId': widget.initialData?['roleId'] ?? '', + 'roleName': widget.initialData?['title'] ?? widget.initialData?['role'] ?? '', + 'count': widget.initialData?['workersNeeded'] ?? + widget.initialData?['workers_needed'] ?? + 1, + 'start_time': widget.initialData?['startTime'] ?? + widget.initialData?['start_time'] ?? + '09:00', + 'end_time': widget.initialData?['endTime'] ?? + widget.initialData?['end_time'] ?? + '17:00', + 'lunch_break': 'NO_BREAK', + 'location': null, + }, + ]; + + _loadVendors(); + _loadOrderDetails(); + } + + @override + void dispose() { + _dateController.dispose(); + _globalLocationController.dispose(); + super.dispose(); + } + + void _addPosition() { + setState(() { + _positions.add({ + 'roleId': '', + 'roleName': '', + 'count': 1, + 'start_time': '09:00', + 'end_time': '17:00', + 'lunch_break': 'NO_BREAK', + 'location': null, + }); + }); + } + + void _removePosition(int index) { + if (_positions.length > 1) { + setState(() => _positions.removeAt(index)); + } + } + + void _updatePosition(int index, String key, dynamic value) { + setState(() => _positions[index][key] = value); + } + + double _calculateTotalCost() { + double total = 0; + for (final Map pos in _positions) { + double hours = 8.0; + try { + final List startParts = pos['start_time'].toString().split(':'); + final List endParts = pos['end_time'].toString().split(':'); + final double startH = + int.parse(startParts[0]) + int.parse(startParts[1]) / 60; + final double endH = + int.parse(endParts[0]) + int.parse(endParts[1]) / 60; + hours = endH - startH; + if (hours < 0) hours += 24; + } catch (_) {} + final String roleId = pos['roleId']?.toString() ?? ''; + final double rate = _rateForRole(roleId); + total += hours * rate * (pos['count'] as int); + } + return total; + } + + String _getShiftType() { + final String? type = widget.initialData?['type']?.toString(); + if (type != null && type.isNotEmpty) { + switch (type) { + case 'PERMANENT': + return 'Long Term'; + case 'RECURRING': + return 'Multi-Day'; + case 'RAPID': + return 'Rapid'; + case 'ONE_TIME': + return 'One-Time Order'; + } + } + // Determine shift type based on initial data + final dynamic initialData = widget.initialData; + if (initialData != null) { + if (initialData['permanent'] == true || initialData['duration_months'] != null) { + return 'Long Term'; + } + if (initialData['recurring'] == true || initialData['duration_days'] != null) { + return 'Multi-Day'; + } + } + return 'One-Time Order'; + } + + Future _handleSubmit() async { + await _submitNewOrder(); + } + + Future _submitNewOrder() async { + final String? businessId = dc.ClientSessionStore.instance.session?.business?.id; + if (businessId == null || businessId.isEmpty) { + return; + } + + final DateTime date = DateTime.parse(_dateController.text); + final fdc.Timestamp orderTimestamp = _toTimestamp(date); + final dc.OrderType orderType = + _orderTypeFromValue(widget.initialData?['type']?.toString()); + + final fdc.OperationResult + orderResult = await _dataConnect + .createOrder( + businessId: businessId, + orderType: orderType, + ) + .vendorId(_selectedVendorId) + .location(_globalLocationController.text) + .status(dc.OrderStatus.POSTED) + .date(orderTimestamp) + .execute(); + + final String? orderId = orderResult.data?.order_insert.id; + if (orderId == null) { + return; + } + + final int workersNeeded = _positions.fold( + 0, + (int sum, Map pos) => sum + (pos['count'] as int), + ); + final String shiftTitle = + 'Shift 1 ${DateFormat('yyyy-MM-dd').format(date)}'; + final double shiftCost = _calculateTotalCost(); + + final fdc.OperationResult + shiftResult = await _dataConnect + .createShift(title: shiftTitle, orderId: orderId) + .date(orderTimestamp) + .location(_globalLocationController.text) + .locationAddress(_globalLocationController.text) + .status(dc.ShiftStatus.PENDING) + .workersNeeded(workersNeeded) + .filled(0) + .durationDays(1) + .cost(shiftCost) + .execute(); + + final String? shiftId = shiftResult.data?.shift_insert.id; + if (shiftId == null) { + return; + } + + for (final Map pos in _positions) { + final String roleId = pos['roleId']?.toString() ?? ''; + if (roleId.isEmpty) { + continue; + } + final DateTime start = _parseTime(date, pos['start_time'].toString()); + final DateTime end = _parseTime(date, pos['end_time'].toString()); + final DateTime normalizedEnd = + end.isBefore(start) ? end.add(const Duration(days: 1)) : end; + final double hours = normalizedEnd.difference(start).inMinutes / 60.0; + final int count = pos['count'] as int; + final double rate = _rateForRole(roleId); + final double totalValue = rate * hours * count; + final String lunchBreak = pos['lunch_break'] as String; + + await _dataConnect + .createShiftRole( + shiftId: shiftId, + roleId: roleId, + count: count, + ) + .startTime(_toTimestamp(start)) + .endTime(_toTimestamp(normalizedEnd)) + .hours(hours) + .breakType(_breakDurationFromValue(lunchBreak)) + .totalValue(totalValue) + .execute(); + } + + await _dataConnect + .updateOrder(id: orderId) + .shifts(fdc.AnyValue([shiftId])) + .execute(); + + widget.onSubmit({ + 'orderId': orderId, + }); + } + + Future _loadVendors() async { + try { + final fdc.QueryResult result = + await _dataConnect.listVendors().execute(); + final List<_VendorOption> vendors = result.data.vendors + .map( + (dc.ListVendorsVendors vendor) => + _VendorOption(id: vendor.id, name: vendor.companyName), + ) + .toList(); + if (!mounted) return; + setState(() { + _vendors = vendors; + final String? current = _selectedVendorId; + if (current == null || + !vendors.any((_VendorOption v) => v.id == current)) { + _selectedVendorId = vendors.isNotEmpty ? vendors.first.id : null; + } + }); + if (_selectedVendorId != null) { + await _loadRolesForVendor(_selectedVendorId!); + } + } catch (_) { + if (!mounted) return; + setState(() { + _vendors = const <_VendorOption>[]; + _roles = const <_RoleOption>[]; + }); + } + } + + Future _loadRolesForVendor(String vendorId) async { + try { + final fdc.QueryResult + result = + await _dataConnect.listRolesByVendorId(vendorId: vendorId).execute(); + final List<_RoleOption> roles = result.data.roles + .map( + (dc.ListRolesByVendorIdRoles role) => _RoleOption( + id: role.id, + name: role.name, + costPerHour: role.costPerHour, + ), + ) + .toList(); + if (!mounted) return; + setState(() => _roles = roles); + } catch (_) { + if (!mounted) return; + setState(() => _roles = const <_RoleOption>[]); + } + } + + Future _loadOrderDetails() async { + final String? orderId = widget.initialData?['orderId']?.toString(); + if (orderId == null || orderId.isEmpty) { + return; + } + + final String? businessId = dc.ClientSessionStore.instance.session?.business?.id; + if (businessId == null || businessId.isEmpty) { + return; + } + + try { + final fdc.QueryResult< + dc.ListShiftRolesByBusinessAndOrderData, + dc.ListShiftRolesByBusinessAndOrderVariables> result = await _dataConnect + .listShiftRolesByBusinessAndOrder( + businessId: businessId, + orderId: orderId, + ) + .execute(); + + final List shiftRoles = + result.data.shiftRoles; + if (shiftRoles.isEmpty) { + return; + } + + final dc.ListShiftRolesByBusinessAndOrderShiftRolesShift firstShift = + shiftRoles.first.shift; + _globalLocationController.text = firstShift.order.location ?? + firstShift.locationAddress ?? + firstShift.location ?? + _globalLocationController.text; + + final String? vendorId = firstShift.order.vendorId; + if (mounted) { + setState(() { + _selectedVendorId = vendorId; + }); + } + if (vendorId != null && vendorId.isNotEmpty) { + await _loadRolesForVendor(vendorId); + } + + final List> positions = + shiftRoles.map((dc.ListShiftRolesByBusinessAndOrderShiftRoles role) { + return { + 'roleId': role.roleId, + 'roleName': role.role.name, + 'count': role.count, + 'start_time': _formatTimeForField(role.startTime), + 'end_time': _formatTimeForField(role.endTime), + 'lunch_break': _breakValueFromDuration(role.breakType), + 'location': null, + }; + }).toList(); + + if (!mounted) return; + setState(() { + _positions = positions; + }); + } catch (_) { + // Keep defaults on failure. + } + } + + String _formatTimeForField(fdc.Timestamp? value) { + if (value == null) return ''; + try { + return DateFormat('HH:mm').format(value.toDateTime()); + } catch (_) { + return ''; + } + } + + String _breakValueFromDuration(dc.EnumValue? breakType) { + final dc.BreakDuration? value = + breakType is dc.Known ? breakType.value : null; + switch (value) { + case dc.BreakDuration.MIN_15: + return 'MIN_15'; + case dc.BreakDuration.MIN_30: + return 'MIN_30'; + case dc.BreakDuration.NO_BREAK: + case null: + return 'NO_BREAK'; + } + } + + dc.BreakDuration _breakDurationFromValue(String value) { + switch (value) { + case 'MIN_15': + return dc.BreakDuration.MIN_15; + case 'MIN_30': + return dc.BreakDuration.MIN_30; + default: + return dc.BreakDuration.NO_BREAK; + } + } + + dc.OrderType _orderTypeFromValue(String? value) { + switch (value) { + case 'PERMANENT': + return dc.OrderType.PERMANENT; + case 'RECURRING': + return dc.OrderType.RECURRING; + case 'RAPID': + return dc.OrderType.RAPID; + case 'ONE_TIME': + default: + return dc.OrderType.ONE_TIME; + } + } + + _RoleOption? _roleById(String roleId) { + for (final _RoleOption role in _roles) { + if (role.id == roleId) { + return role; + } + } + return null; + } + + double _rateForRole(String roleId) { + return _roleById(roleId)?.costPerHour ?? 0; + } + + DateTime _parseTime(DateTime date, String time) { + DateTime parsed; + try { + parsed = DateFormat.Hm().parse(time); + } catch (_) { + parsed = DateFormat.jm().parse(time); + } + return DateTime( + date.year, + date.month, + date.day, + parsed.hour, + parsed.minute, + ); + } + + fdc.Timestamp _toTimestamp(DateTime date) { + final int millis = date.millisecondsSinceEpoch; + final int seconds = millis ~/ 1000; + final int nanos = (millis % 1000) * 1000000; + return fdc.Timestamp(nanos, seconds); + } + + @override + Widget build(BuildContext context) { + return Container( + height: MediaQuery.of(context).size.height * 0.95, + decoration: const BoxDecoration( + color: UiColors.bgPrimary, + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: Column( + children: [ + _buildHeader(), + Expanded( + child: ListView( + padding: const EdgeInsets.all(UiConstants.space5), + children: [ + Text( + widget.initialData != null ? 'Edit Your Order' : 'Create New Order', + style: UiTypography.headline3m.textPrimary, + ), + const SizedBox(height: UiConstants.space2), + Text( + widget.initialData != null + ? 'Review and adjust the details below' + : 'Fill in the details for your staffing needs', + style: UiTypography.body2r.textSecondary, + ), + const SizedBox(height: UiConstants.space5), + + // Shift Type Badge + Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space3, + vertical: UiConstants.space2, + ), + decoration: BoxDecoration( + color: UiColors.primary.withValues(alpha: 0.1), + borderRadius: UiConstants.radiusFull, + border: Border.all( + color: UiColors.primary.withValues(alpha: 0.3), + ), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: 8, + height: 8, + decoration: const BoxDecoration( + shape: BoxShape.circle, + color: UiColors.primary, + ), + ), + const SizedBox(width: UiConstants.space2), + Text( + _getShiftType(), + style: UiTypography.footnote1b.copyWith( + color: UiColors.primary, + ), + ), + ], + ), + ), + const SizedBox(height: UiConstants.space5), + + _buildSectionHeader('VENDOR'), + _buildVendorDropdown(), + const SizedBox(height: UiConstants.space4), + + _buildSectionHeader('DATE'), + _buildDateField(), + const SizedBox(height: UiConstants.space4), + + _buildSectionHeader('LOCATION'), + _buildLocationField(), + const SizedBox(height: UiConstants.space5), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'POSITIONS', + style: UiTypography.footnote2r.textSecondary, + ), + GestureDetector( + onTap: _addPosition, + child: Row( + children: [ + const Icon( + UiIcons.add, + size: 16, + color: UiColors.primary, + ), + const SizedBox(width: UiConstants.space1), + Text( + 'Add Position', + style: UiTypography.footnote1m.copyWith( + color: UiColors.primary, + ), + ), + ], + ), + ), + ], + ), + const SizedBox(height: UiConstants.space3), + + ..._positions.asMap().entries.map((MapEntry> entry) { + return _buildPositionCard(entry.key, entry.value); + }), + + const SizedBox(height: UiConstants.space5), + + // Total Cost Display + Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Estimated Total', + style: UiTypography.body1b.textPrimary, + ), + Text( + '\$${_calculateTotalCost().toStringAsFixed(2)}', + style: UiTypography.headline3m.copyWith( + color: UiColors.primary, + ), + ), + ], + ), + ), + const SizedBox(height: UiConstants.space5), + + UiButton.primary( + text: widget.initialData != null ? 'Update Order' : 'Post Order', + onPressed: widget.isLoading ? null : _handleSubmit, + ), + SizedBox(height: MediaQuery.of(context).padding.bottom + UiConstants.space5), + ], + ), + ), + ], + ), + ); + } + + Widget _buildHeader() { + return Container( + padding: const EdgeInsets.all(UiConstants.space5), + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + UiColors.primary, + Color(0xFF1E3A8A), + ], + ), + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: Row( + children: [ + GestureDetector( + onTap: () => Navigator.pop(context), + child: Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: UiColors.white.withValues(alpha: 0.2), + borderRadius: UiConstants.radiusMd, + ), + child: const Icon( + UiIcons.chevronLeft, + color: UiColors.white, + size: 24, + ), + ), + ), + const SizedBox(width: UiConstants.space3), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _getShiftType(), + style: UiTypography.headline3m.copyWith(color: UiColors.white), + ), + Text( + 'Configure your staffing needs', + style: UiTypography.footnote2r.copyWith( + color: UiColors.white.withValues(alpha: 0.8), + ), + ), + ], + ), + ], + ), + ); + } + + Widget _buildSectionHeader(String title) { + return Padding( + padding: const EdgeInsets.only(bottom: 8), + child: Text(title, style: UiTypography.footnote2r.textSecondary), + ); + } + + Widget _buildVendorDropdown() { + return Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space3, + ), + height: 48, + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusMd, + border: Border.all(color: UiColors.border), + ), + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: _selectedVendorId, + icon: const Icon( + UiIcons.chevronDown, + size: 18, + color: UiColors.iconSecondary, + ), + style: UiTypography.body2r.textPrimary, + items: _vendors.map((_VendorOption vendor) { + return DropdownMenuItem( + value: vendor.id, + child: Text(vendor.name), + ); + }).toList(), + onChanged: (String? newValue) { + if (newValue != null) { + setState(() { + _selectedVendorId = newValue; + }); + _loadRolesForVendor(newValue); + } + }, + ), + ), + ); + } + + Widget _buildDateField() { + return GestureDetector( + onTap: () async { + final DateTime? selectedDate = await showDatePicker( + context: context, + initialDate: _dateController.text.isNotEmpty + ? DateTime.parse(_dateController.text) + : DateTime.now().add(const Duration(days: 1)), + firstDate: DateTime.now(), + lastDate: DateTime.now().add(const Duration(days: 365 * 2)), + ); + if (selectedDate != null) { + setState(() { + _dateController.text = + selectedDate.toIso8601String().split('T')[0]; + }); + } + }, + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space3, + vertical: UiConstants.space3, + ), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusMd, + border: Border.all(color: UiColors.border), + ), + child: Row( + children: [ + const Icon(UiIcons.calendar, size: 20, color: UiColors.iconSecondary), + const SizedBox(width: UiConstants.space2), + Expanded( + child: Text( + _dateController.text.isNotEmpty + ? DateFormat('EEEE, MMM d, y') + .format(DateTime.parse(_dateController.text)) + : 'Select date', + style: _dateController.text.isNotEmpty + ? UiTypography.body2r.textPrimary + : UiTypography.body2r.textSecondary, + ), + ), + const Icon( + UiIcons.chevronDown, + size: 18, + color: UiColors.iconSecondary, + ), + ], + ), + ), + ); + } + + Widget _buildLocationField() { + return Container( + padding: const EdgeInsets.symmetric(horizontal: UiConstants.space3), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusMd, + border: Border.all(color: UiColors.border), + ), + child: Row( + children: [ + const Icon(UiIcons.mapPin, size: 20, color: UiColors.iconSecondary), + const SizedBox(width: UiConstants.space2), + Expanded( + child: TextField( + controller: _globalLocationController, + decoration: const InputDecoration( + hintText: 'Enter location address', + border: InputBorder.none, + ), + style: UiTypography.body2r.textPrimary, + ), + ), + ], + ), + ); + } + + Widget _buildPositionCard(int index, Map pos) { + return Container( + margin: const EdgeInsets.only(bottom: UiConstants.space3), + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'POSITION #${index + 1}', + style: UiTypography.footnote1m.textSecondary, + ), + if (_positions.length > 1) + GestureDetector( + onTap: () => _removePosition(index), + child: Text( + 'Remove', + style: UiTypography.footnote1m.copyWith( + color: UiColors.destructive, + ), + ), + ), + ], + ), + const SizedBox(height: UiConstants.space3), + + _buildDropdownField( + hint: 'Select role', + value: pos['roleId'], + items: [ + ..._roles.map((_RoleOption role) => role.id), + if (pos['roleId'] != null && + pos['roleId'].toString().isNotEmpty && + !_roles.any( + (_RoleOption role) => role.id == pos['roleId'].toString(), + )) + pos['roleId'].toString(), + ], + itemBuilder: (dynamic roleId) { + final _RoleOption? role = _roleById(roleId.toString()); + if (role == null) { + final String fallback = pos['roleName']?.toString() ?? ''; + return fallback.isEmpty ? roleId.toString() : fallback; + } + return '${role.name} - \$${role.costPerHour.toStringAsFixed(0)}/hr'; + }, + onChanged: (dynamic val) { + final String roleId = val?.toString() ?? ''; + final _RoleOption? role = _roleById(roleId); + setState(() { + _positions[index]['roleId'] = roleId; + _positions[index]['roleName'] = role?.name ?? ''; + }); + }, + ), + + const SizedBox(height: UiConstants.space3), + + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Lunch Break', + style: UiTypography.footnote2r.textSecondary, + ), + const SizedBox(height: UiConstants.space1), + _buildDropdownField( + hint: 'None', + value: pos['lunch_break'], + items: ['NO_BREAK', 'MIN_15', 'MIN_30'], + itemBuilder: (dynamic value) { + switch (value.toString()) { + case 'MIN_15': + return '15 min'; + case 'MIN_30': + return '30 min'; + default: + return 'No Break'; + } + }, + onChanged: (dynamic val) => _updatePosition(index, 'lunch_break', val), + ), + ], + ), + ), + ], + ), + + const SizedBox(height: UiConstants.space3), + + Row( + children: [ + Expanded( + child: _buildInlineTimeInput( + label: 'Start', + value: pos['start_time'], + onTap: () async { + final TimeOfDay? time = await showTimePicker( + context: context, + initialTime: TimeOfDay.now(), + ); + if (time != null) { + _updatePosition( + index, + 'start_time', + '${time.hour.toString().padLeft(2, '0')}:${time.minute.toString().padLeft(2, '0')}', + ); + } + }, + ), + ), + const SizedBox(width: UiConstants.space2), + Expanded( + child: _buildInlineTimeInput( + label: 'End', + value: pos['end_time'], + onTap: () async { + final TimeOfDay? time = await showTimePicker( + context: context, + initialTime: TimeOfDay.now(), + ); + if (time != null) { + _updatePosition( + index, + 'end_time', + '${time.hour.toString().padLeft(2, '0')}:${time.minute.toString().padLeft(2, '0')}', + ); + } + }, + ), + ), + const SizedBox(width: UiConstants.space2), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Workers', + style: UiTypography.footnote2r.textSecondary, + ), + const SizedBox(height: UiConstants.space1), + Container( + height: 40, + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: UiConstants.radiusSm, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + if ((pos['count'] as int) > 1) { + _updatePosition( + index, + 'count', + (pos['count'] as int) - 1, + ); + } + }, + child: const Icon(UiIcons.minus, size: 12), + ), + Text( + '${pos['count']}', + style: UiTypography.body2b.textPrimary, + ), + GestureDetector( + onTap: () => _updatePosition( + index, + 'count', + (pos['count'] as int) + 1, + ), + child: const Icon(UiIcons.add, size: 12), + ), + ], + ), + ), + ], + ), + ), + ], + ), + const SizedBox(height: UiConstants.space4), + + if (pos['location'] == null) + GestureDetector( + onTap: () => _updatePosition(index, 'location', ''), + child: Row( + children: [ + const Icon(UiIcons.mapPin, size: 14, color: UiColors.primary), + const SizedBox(width: UiConstants.space1), + Text( + 'Use different location for this position', + style: UiTypography.footnote1m.copyWith( + color: UiColors.primary, + ), + ), + ], + ), + ) + else + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Custom Location', + style: UiTypography.footnote2r.textSecondary, + ), + GestureDetector( + onTap: () => _updatePosition(index, 'location', null), + child: Text( + 'Remove', + style: UiTypography.footnote1m.copyWith( + color: UiColors.destructive, + ), + ), + ), + ], + ), + const SizedBox(height: UiConstants.space2), + Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space3, + vertical: UiConstants.space2, + ), + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: UiConstants.radiusSm, + border: Border.all(color: UiColors.border), + ), + child: TextField( + controller: TextEditingController(text: pos['location']), + decoration: const InputDecoration( + hintText: 'Enter custom location', + border: InputBorder.none, + isDense: true, + contentPadding: EdgeInsets.zero, + ), + style: UiTypography.body2r.textPrimary, + onChanged: (String value) => + _updatePosition(index, 'location', value), + ), + ), + ], + ), + ], + ), + ); + } + + Widget _buildDropdownField({ + required String hint, + required dynamic value, + required List items, + required String Function(T) itemBuilder, + required void Function(T?) onChanged, + }) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: UiConstants.space3), + height: 48, + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: UiConstants.radiusMd, + border: Border.all(color: UiColors.border), + ), + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: value.toString().isEmpty ? null : value as T?, + hint: Text(hint, style: UiTypography.body2r.textSecondary), + icon: const Icon(UiIcons.chevronDown, size: 18), + style: UiTypography.body2r.textPrimary, + items: items + .map( + (T item) => DropdownMenuItem( + value: item, + child: Text(itemBuilder(item)), + ), + ) + .toList(), + onChanged: onChanged, + ), + ), + ); + } + + Widget _buildInlineTimeInput({ + required String label, + required String value, + required VoidCallback onTap, + }) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(label, style: UiTypography.footnote2r.textSecondary), + const SizedBox(height: UiConstants.space1), + GestureDetector( + onTap: onTap, + child: Container( + height: 40, + padding: const EdgeInsets.symmetric(horizontal: UiConstants.space2), + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: UiConstants.radiusSm, + border: Border.all(color: UiColors.border), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon(UiIcons.clock, size: 14, color: UiColors.iconSecondary), + const SizedBox(width: UiConstants.space1), + Text( + value.isEmpty ? '--:--' : value, + style: UiTypography.body2r.textPrimary, + ), + ], + ), + ), + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/spending_widget.dart b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/spending_widget.dart new file mode 100644 index 00000000..18ee5cd7 --- /dev/null +++ b/apps/mobile/packages/features/client/home/lib/src/presentation/widgets/spending_widget.dart @@ -0,0 +1,175 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A widget that displays spending insights for the client. +class SpendingWidget extends StatelessWidget { + /// The spending this week. + final double weeklySpending; + + /// The spending for the next 7 days. + final double next7DaysSpending; + + /// The number of shifts this week. + final int weeklyShifts; + + /// The number of scheduled shifts for next 7 days. + final int next7DaysScheduled; + + /// Creates a [SpendingWidget]. + const SpendingWidget({ + super.key, + required this.weeklySpending, + required this.next7DaysSpending, + required this.weeklyShifts, + required this.next7DaysScheduled, + }); + + @override + Widget build(BuildContext context) { + final TranslationsClientHomeEn i18n = t.client_home; + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + i18n.widgets.spending.toUpperCase(), + style: UiTypography.footnote1b.textSecondary.copyWith( + letterSpacing: 0.5, + ), + ), + const SizedBox(height: UiConstants.space2), + Container( + padding: const EdgeInsets.all(UiConstants.space3), + decoration: BoxDecoration( + gradient: const LinearGradient( + colors: [UiColors.primary, Color(0xFF0830B8)], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + borderRadius: UiConstants.radiusLg, + boxShadow: [ + BoxShadow( + color: UiColors.primary.withValues(alpha: 0.3), + blurRadius: 4, + offset: const Offset(0, 4), + ), + ], + ), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'This Week', + style: TextStyle(color: Colors.white70, fontSize: 9), + ), + const SizedBox(height: UiConstants.space1), + Text( + '\$${weeklySpending.toStringAsFixed(0)}', + style: UiTypography.headline3m.copyWith( + color: UiColors.white, + fontWeight: FontWeight.bold, + ), + ), + Text( + '$weeklyShifts shifts', + style: TextStyle( + color: Colors.white.withValues(alpha: 0.6), + fontSize: 9, + ), + ), + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + const Text( + 'Next 7 Days', + style: TextStyle(color: Colors.white70, fontSize: 9), + ), + const SizedBox(height: UiConstants.space1), + Text( + '\$${next7DaysSpending.toStringAsFixed(0)}', + style: UiTypography.headline4m.copyWith( + color: UiColors.white, + fontWeight: FontWeight.bold, + ), + ), + Text( + '$next7DaysScheduled scheduled', + style: TextStyle( + color: Colors.white.withValues(alpha: 0.6), + fontSize: 9, + ), + ), + ], + ), + ), + ], + ), + const SizedBox(height: UiConstants.space3), + Container( + padding: const EdgeInsets.only(top: UiConstants.space3), + decoration: const BoxDecoration( + border: Border(top: BorderSide(color: Colors.white24)), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 24, + height: 24, + decoration: BoxDecoration( + color: Colors.white.withValues(alpha: 0.2), + shape: BoxShape.circle, + ), + child: const Center( + child: Icon( + UiIcons.sparkles, + color: UiColors.white, + size: 14, + ), + ), + ), + const SizedBox(width: UiConstants.space2), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'πŸ’‘ ' + + i18n.dashboard.insight_lightbulb(amount: '180'), + style: const TextStyle( + color: Colors.white, + fontSize: 10, + fontWeight: FontWeight.w600, + ), + ), + const SizedBox(height: 1), + Text( + i18n.dashboard.insight_tip, + style: TextStyle( + color: Colors.white.withValues(alpha: 0.8), + fontSize: 9, + ), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/client/home/pubspec.yaml b/apps/mobile/packages/features/client/home/pubspec.yaml new file mode 100644 index 00000000..7566f837 --- /dev/null +++ b/apps/mobile/packages/features/client/home/pubspec.yaml @@ -0,0 +1,33 @@ +name: client_home +description: Home screen and dashboard for the client application. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + flutter_modular: ^6.3.0 + equatable: ^2.0.5 + lucide_icons: ^0.257.0 + + # Architecture Packages + design_system: + path: ../../../design_system + core_localization: + path: ../../../core_localization + krow_domain: ^0.0.1 + +dev_dependencies: + flutter_test: + sdk: flutter + bloc_test: ^9.1.0 + mocktail: ^1.0.0 + +flutter: + uses-material-design: true diff --git a/apps/mobile/packages/features/client/hubs/lib/client_hubs.dart b/apps/mobile/packages/features/client/hubs/lib/client_hubs.dart new file mode 100644 index 00000000..6a427c37 --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/client_hubs.dart @@ -0,0 +1,53 @@ +library client_hubs; + +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:firebase_auth/firebase_auth.dart' as firebase; +import 'src/data/repositories_impl/hub_repository_impl.dart'; +import 'src/domain/repositories/hub_repository_interface.dart'; +import 'src/domain/usecases/assign_nfc_tag_usecase.dart'; +import 'src/domain/usecases/create_hub_usecase.dart'; +import 'src/domain/usecases/delete_hub_usecase.dart'; +import 'src/domain/usecases/get_hubs_usecase.dart'; +import 'src/presentation/blocs/client_hubs_bloc.dart'; +import 'src/presentation/pages/client_hubs_page.dart'; + +export 'src/presentation/pages/client_hubs_page.dart'; + +/// A [Module] for the client hubs feature. +class ClientHubsModule extends Module { + @override + List get imports => [DataConnectModule()]; + + @override + void binds(Injector i) { + // Repositories + i.addLazySingleton( + () => HubRepositoryImpl( + firebaseAuth: firebase.FirebaseAuth.instance, + dataConnect: ExampleConnector.instance, + ), + ); + + // UseCases + i.addLazySingleton(GetHubsUseCase.new); + i.addLazySingleton(CreateHubUseCase.new); + i.addLazySingleton(DeleteHubUseCase.new); + i.addLazySingleton(AssignNfcTagUseCase.new); + + // BLoCs + i.add( + () => ClientHubsBloc( + getHubsUseCase: i.get(), + createHubUseCase: i.get(), + deleteHubUseCase: i.get(), + assignNfcTagUseCase: i.get(), + ), + ); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (_) => const ClientHubsPage()); + } +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/data/repositories_impl/hub_repository_impl.dart b/apps/mobile/packages/features/client/hubs/lib/src/data/repositories_impl/hub_repository_impl.dart new file mode 100644 index 00000000..190bc0ad --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/data/repositories_impl/hub_repository_impl.dart @@ -0,0 +1,195 @@ +import 'package:firebase_auth/firebase_auth.dart' as firebase; +import 'package:firebase_data_connect/firebase_data_connect.dart'; +import 'package:krow_data_connect/krow_data_connect.dart' as dc; +import 'package:krow_domain/krow_domain.dart' as domain; + +import '../../domain/repositories/hub_repository_interface.dart'; + +/// Implementation of [HubRepositoryInterface] backed by Data Connect. +class HubRepositoryImpl implements HubRepositoryInterface { + HubRepositoryImpl({ + required firebase.FirebaseAuth firebaseAuth, + required dc.ExampleConnector dataConnect, + }) : _firebaseAuth = firebaseAuth, + _dataConnect = dataConnect; + + final firebase.FirebaseAuth _firebaseAuth; + final dc.ExampleConnector _dataConnect; + + @override + Future> getHubs() async { + final dc.GetBusinessesByUserIdBusinesses business = await _getBusinessForCurrentUser(); + final String teamId = await _getOrCreateTeamId(business); + return _fetchHubsForTeam(teamId: teamId, businessId: business.id); + } + + @override + Future createHub({ + required String name, + required String address, + }) async { + final dc.GetBusinessesByUserIdBusinesses business = await _getBusinessForCurrentUser(); + final String teamId = await _getOrCreateTeamId(business); + final String? city = business.city; + + final OperationResult result = await _dataConnect + .createTeamHub( + teamId: teamId, + hubName: name, + address: address, + ) + .city(city?.isNotEmpty == true ? city : '') + .execute(); + final String? createdId = result.data?.teamHub_insert.id; + if (createdId == null) { + throw Exception('Hub creation failed.'); + } + + final List hubs = await _fetchHubsForTeam( + teamId: teamId, + businessId: business.id, + ); + domain.Hub? createdHub; + for (final domain.Hub hub in hubs) { + if (hub.id == createdId) { + createdHub = hub; + break; + } + } + return createdHub ?? + domain.Hub( + id: createdId, + businessId: business.id, + name: name, + address: address, + nfcTagId: null, + status: domain.HubStatus.active, + ); + } + + @override + Future deleteHub(String id) async { + await _dataConnect.deleteTeamHub(id: id).execute(); + } + + @override + Future assignNfcTag({ + required String hubId, + required String nfcTagId, + }) { + throw UnimplementedError('NFC tag assignment is not supported for team hubs.'); + } + + Future _getBusinessForCurrentUser() async { + final dc.ClientSession? session = dc.ClientSessionStore.instance.session; + final dc.ClientBusinessSession? cachedBusiness = session?.business; + if (cachedBusiness != null) { + return dc.GetBusinessesByUserIdBusinesses( + id: cachedBusiness.id, + businessName: cachedBusiness.businessName, + userId: _firebaseAuth.currentUser?.uid ?? '', + rateGroup: const dc.Known(dc.BusinessRateGroup.STANDARD), + status: const dc.Known(dc.BusinessStatus.ACTIVE), + contactName: cachedBusiness.contactName, + companyLogoUrl: cachedBusiness.companyLogoUrl, + phone: null, + email: cachedBusiness.email, + hubBuilding: null, + address: null, + city: cachedBusiness.city, + area: null, + sector: null, + notes: null, + createdAt: null, + updatedAt: null, + ); + } + + final firebase.User? user = _firebaseAuth.currentUser; + if (user == null) { + throw Exception('User is not authenticated.'); + } + + final QueryResult result = await _dataConnect.getBusinessesByUserId( + userId: user.uid, + ).execute(); + if (result.data.businesses.isEmpty) { + await _firebaseAuth.signOut(); + throw Exception('No business found for this user. Please sign in again.'); + } + + final dc.GetBusinessesByUserIdBusinesses business = result.data.businesses.first; + if (session != null) { + dc.ClientSessionStore.instance.setSession( + dc.ClientSession( + user: session.user, + userPhotoUrl: session.userPhotoUrl, + business: dc.ClientBusinessSession( + id: business.id, + businessName: business.businessName, + email: business.email, + city: business.city, + contactName: business.contactName, + companyLogoUrl: business.companyLogoUrl, + ), + ), + ); + } + + return business; + } + + Future _getOrCreateTeamId( + dc.GetBusinessesByUserIdBusinesses business, + ) async { + final QueryResult teamsResult = await _dataConnect.getTeamsByOwnerId( + ownerId: business.id, + ).execute(); + if (teamsResult.data.teams.isNotEmpty) { + return teamsResult.data.teams.first.id; + } + + final dc.CreateTeamVariablesBuilder createTeamBuilder = _dataConnect.createTeam( + teamName: '${business.businessName} Team', + ownerId: business.id, + ownerName: business.contactName ?? '', + ownerRole: 'OWNER', + ); + if (business.email != null) { + createTeamBuilder.email(business.email); + } + + final OperationResult createTeamResult = await createTeamBuilder.execute(); + final String? teamId = createTeamResult.data?.team_insert.id; + if (teamId == null) { + throw Exception('Team creation failed.'); + } + + return teamId; + } + + Future> _fetchHubsForTeam({ + required String teamId, + required String businessId, + }) async { + final QueryResult hubsResult = await _dataConnect.getTeamHubsByTeamId( + teamId: teamId, + ).execute(); + + return hubsResult.data.teamHubs + .map( + (dc.GetTeamHubsByTeamIdTeamHubs hub) => domain.Hub( + id: hub.id, + businessId: businessId, + name: hub.hubName, + address: hub.address, + nfcTagId: null, + status: + hub.isActive + ? domain.HubStatus.active + : domain.HubStatus.inactive, + ), + ) + .toList(); + } +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/domain/arguments/assign_nfc_tag_arguments.dart b/apps/mobile/packages/features/client/hubs/lib/src/domain/arguments/assign_nfc_tag_arguments.dart new file mode 100644 index 00000000..ded2d2fb --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/domain/arguments/assign_nfc_tag_arguments.dart @@ -0,0 +1,20 @@ +import 'package:krow_core/core.dart'; + +/// Represents the arguments required for the AssignNfcTagUseCase. +/// +/// Encapsulates the hub ID and the NFC tag ID to be assigned. +class AssignNfcTagArguments extends UseCaseArgument { + /// The unique identifier of the hub. + final String hubId; + + /// The unique identifier of the NFC tag. + final String nfcTagId; + + /// Creates an [AssignNfcTagArguments] instance. + /// + /// Both [hubId] and [nfcTagId] are required. + const AssignNfcTagArguments({required this.hubId, required this.nfcTagId}); + + @override + List get props => [hubId, nfcTagId]; +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/domain/arguments/create_hub_arguments.dart b/apps/mobile/packages/features/client/hubs/lib/src/domain/arguments/create_hub_arguments.dart new file mode 100644 index 00000000..a978f3a2 --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/domain/arguments/create_hub_arguments.dart @@ -0,0 +1,20 @@ +import 'package:krow_core/core.dart'; + +/// Represents the arguments required for the CreateHubUseCase. +/// +/// Encapsulates the name and address of the hub to be created. +class CreateHubArguments extends UseCaseArgument { + /// The name of the hub. + final String name; + + /// The physical address of the hub. + final String address; + + /// Creates a [CreateHubArguments] instance. + /// + /// Both [name] and [address] are required. + const CreateHubArguments({required this.name, required this.address}); + + @override + List get props => [name, address]; +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/domain/arguments/delete_hub_arguments.dart b/apps/mobile/packages/features/client/hubs/lib/src/domain/arguments/delete_hub_arguments.dart new file mode 100644 index 00000000..6a08630d --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/domain/arguments/delete_hub_arguments.dart @@ -0,0 +1,17 @@ +import 'package:krow_core/core.dart'; + +/// Represents the arguments required for the DeleteHubUseCase. +/// +/// Encapsulates the hub ID of the hub to be deleted. +class DeleteHubArguments extends UseCaseArgument { + /// The unique identifier of the hub to delete. + final String hubId; + + /// Creates a [DeleteHubArguments] instance. + /// + /// The [hubId] is required. + const DeleteHubArguments({required this.hubId}); + + @override + List get props => [hubId]; +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/domain/repositories/hub_repository_interface.dart b/apps/mobile/packages/features/client/hubs/lib/src/domain/repositories/hub_repository_interface.dart new file mode 100644 index 00000000..5b03fced --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/domain/repositories/hub_repository_interface.dart @@ -0,0 +1,27 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Interface for the Hub repository. +/// +/// This repository defines the contract for hub-related operations in the +/// domain layer. It handles fetching, creating, deleting hubs and assigning +/// NFC tags. The implementation will be provided in the data layer. +abstract interface class HubRepositoryInterface { + /// Fetches the list of hubs for the current client. + /// + /// Returns a list of [Hub] entities. + Future> getHubs(); + + /// Creates a new hub. + /// + /// Takes the [name] and [address] of the new hub. + /// Returns the created [Hub] entity. + Future createHub({required String name, required String address}); + + /// Deletes a hub by its [id]. + Future deleteHub(String id); + + /// Assigns an NFC tag to a hub. + /// + /// Takes the [hubId] and the [nfcTagId] to be associated. + Future assignNfcTag({required String hubId, required String nfcTagId}); +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/domain/usecases/assign_nfc_tag_usecase.dart b/apps/mobile/packages/features/client/hubs/lib/src/domain/usecases/assign_nfc_tag_usecase.dart new file mode 100644 index 00000000..ed627c9c --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/domain/usecases/assign_nfc_tag_usecase.dart @@ -0,0 +1,24 @@ +import 'package:krow_core/core.dart'; +import '../arguments/assign_nfc_tag_arguments.dart'; +import '../repositories/hub_repository_interface.dart'; + +/// Use case for assigning an NFC tag to a hub. +/// +/// This use case handles the association of a physical NFC tag with a specific +/// hub by calling the [HubRepositoryInterface]. +class AssignNfcTagUseCase implements UseCase { + final HubRepositoryInterface _repository; + + /// Creates an [AssignNfcTagUseCase]. + /// + /// Requires a [HubRepositoryInterface] to interact with the backend. + AssignNfcTagUseCase(this._repository); + + @override + Future call(AssignNfcTagArguments arguments) { + return _repository.assignNfcTag( + hubId: arguments.hubId, + nfcTagId: arguments.nfcTagId, + ); + } +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/domain/usecases/create_hub_usecase.dart b/apps/mobile/packages/features/client/hubs/lib/src/domain/usecases/create_hub_usecase.dart new file mode 100644 index 00000000..bbfc1403 --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/domain/usecases/create_hub_usecase.dart @@ -0,0 +1,26 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../arguments/create_hub_arguments.dart'; +import '../repositories/hub_repository_interface.dart'; + +/// Use case for creating a new hub. +/// +/// This use case orchestrates the creation of a hub by interacting with the +/// [HubRepositoryInterface]. It requires [CreateHubArguments] which includes +/// the name and address of the hub. +class CreateHubUseCase implements UseCase { + final HubRepositoryInterface _repository; + + /// Creates a [CreateHubUseCase]. + /// + /// Requires a [HubRepositoryInterface] to perform the actual creation. + CreateHubUseCase(this._repository); + + @override + Future call(CreateHubArguments arguments) { + return _repository.createHub( + name: arguments.name, + address: arguments.address, + ); + } +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/domain/usecases/delete_hub_usecase.dart b/apps/mobile/packages/features/client/hubs/lib/src/domain/usecases/delete_hub_usecase.dart new file mode 100644 index 00000000..ee8d14df --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/domain/usecases/delete_hub_usecase.dart @@ -0,0 +1,20 @@ +import 'package:krow_core/core.dart'; +import '../arguments/delete_hub_arguments.dart'; +import '../repositories/hub_repository_interface.dart'; + +/// Use case for deleting a hub. +/// +/// This use case removes a hub from the system via the [HubRepositoryInterface]. +class DeleteHubUseCase implements UseCase { + final HubRepositoryInterface _repository; + + /// Creates a [DeleteHubUseCase]. + /// + /// Requires a [HubRepositoryInterface] to perform the deletion. + DeleteHubUseCase(this._repository); + + @override + Future call(DeleteHubArguments arguments) { + return _repository.deleteHub(arguments.hubId); + } +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/domain/usecases/get_hubs_usecase.dart b/apps/mobile/packages/features/client/hubs/lib/src/domain/usecases/get_hubs_usecase.dart new file mode 100644 index 00000000..7db32de4 --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/domain/usecases/get_hubs_usecase.dart @@ -0,0 +1,21 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/hub_repository_interface.dart'; + +/// Use case for fetching the list of hubs. +/// +/// This use case retrieves all hubs associated with the current client +/// by interacting with the [HubRepositoryInterface]. +class GetHubsUseCase implements NoInputUseCase> { + final HubRepositoryInterface _repository; + + /// Creates a [GetHubsUseCase]. + /// + /// Requires a [HubRepositoryInterface] to fetch the data. + GetHubsUseCase(this._repository); + + @override + Future> call() { + return _repository.getHubs(); + } +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/presentation/blocs/client_hubs_bloc.dart b/apps/mobile/packages/features/client/hubs/lib/src/presentation/blocs/client_hubs_bloc.dart new file mode 100644 index 00000000..be1ecc42 --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/presentation/blocs/client_hubs_bloc.dart @@ -0,0 +1,182 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/arguments/assign_nfc_tag_arguments.dart'; +import '../../domain/arguments/create_hub_arguments.dart'; +import '../../domain/arguments/delete_hub_arguments.dart'; +import '../../domain/usecases/assign_nfc_tag_usecase.dart'; +import '../../domain/usecases/create_hub_usecase.dart'; +import '../../domain/usecases/delete_hub_usecase.dart'; +import '../../domain/usecases/get_hubs_usecase.dart'; +import 'client_hubs_event.dart'; +import 'client_hubs_state.dart'; + +/// BLoC responsible for managing the state of the Client Hubs feature. +/// +/// It orchestrates the flow between the UI and the domain layer by invoking +/// specific use cases for fetching, creating, deleting, and assigning tags to hubs. +class ClientHubsBloc extends Bloc + implements Disposable { + final GetHubsUseCase _getHubsUseCase; + final CreateHubUseCase _createHubUseCase; + final DeleteHubUseCase _deleteHubUseCase; + final AssignNfcTagUseCase _assignNfcTagUseCase; + + ClientHubsBloc({ + required GetHubsUseCase getHubsUseCase, + required CreateHubUseCase createHubUseCase, + required DeleteHubUseCase deleteHubUseCase, + required AssignNfcTagUseCase assignNfcTagUseCase, + }) : _getHubsUseCase = getHubsUseCase, + _createHubUseCase = createHubUseCase, + _deleteHubUseCase = deleteHubUseCase, + _assignNfcTagUseCase = assignNfcTagUseCase, + super(const ClientHubsState()) { + on(_onFetched); + on(_onAddRequested); + on(_onDeleteRequested); + on(_onNfcTagAssignRequested); + on(_onMessageCleared); + on(_onAddDialogToggled); + on(_onIdentifyDialogToggled); + } + + void _onAddDialogToggled( + ClientHubsAddDialogToggled event, + Emitter emit, + ) { + emit(state.copyWith(showAddHubDialog: event.visible)); + } + + void _onIdentifyDialogToggled( + ClientHubsIdentifyDialogToggled event, + Emitter emit, + ) { + if (event.hub == null) { + emit(state.copyWith(clearHubToIdentify: true)); + } else { + emit(state.copyWith(hubToIdentify: event.hub)); + } + } + + Future _onFetched( + ClientHubsFetched event, + Emitter emit, + ) async { + emit(state.copyWith(status: ClientHubsStatus.loading)); + try { + final List hubs = await _getHubsUseCase(); + emit(state.copyWith(status: ClientHubsStatus.success, hubs: hubs)); + } catch (e) { + emit( + state.copyWith( + status: ClientHubsStatus.failure, + errorMessage: e.toString(), + ), + ); + } + } + + Future _onAddRequested( + ClientHubsAddRequested event, + Emitter emit, + ) async { + emit(state.copyWith(status: ClientHubsStatus.actionInProgress)); + try { + await _createHubUseCase( + CreateHubArguments(name: event.name, address: event.address), + ); + final List hubs = await _getHubsUseCase(); + emit( + state.copyWith( + status: ClientHubsStatus.actionSuccess, + hubs: hubs, + successMessage: 'Hub created successfully', + showAddHubDialog: false, + ), + ); + } catch (e) { + emit( + state.copyWith( + status: ClientHubsStatus.actionFailure, + errorMessage: e.toString(), + ), + ); + } + } + + Future _onDeleteRequested( + ClientHubsDeleteRequested event, + Emitter emit, + ) async { + emit(state.copyWith(status: ClientHubsStatus.actionInProgress)); + try { + await _deleteHubUseCase(DeleteHubArguments(hubId: event.hubId)); + final List hubs = await _getHubsUseCase(); + emit( + state.copyWith( + status: ClientHubsStatus.actionSuccess, + hubs: hubs, + successMessage: 'Hub deleted successfully', + ), + ); + } catch (e) { + emit( + state.copyWith( + status: ClientHubsStatus.actionFailure, + errorMessage: e.toString(), + ), + ); + } + } + + Future _onNfcTagAssignRequested( + ClientHubsNfcTagAssignRequested event, + Emitter emit, + ) async { + emit(state.copyWith(status: ClientHubsStatus.actionInProgress)); + try { + await _assignNfcTagUseCase( + AssignNfcTagArguments(hubId: event.hubId, nfcTagId: event.nfcTagId), + ); + final List hubs = await _getHubsUseCase(); + emit( + state.copyWith( + status: ClientHubsStatus.actionSuccess, + hubs: hubs, + successMessage: 'NFC tag assigned successfully', + clearHubToIdentify: true, + ), + ); + } catch (e) { + emit( + state.copyWith( + status: ClientHubsStatus.actionFailure, + errorMessage: e.toString(), + ), + ); + } + } + + void _onMessageCleared( + ClientHubsMessageCleared event, + Emitter emit, + ) { + emit( + state.copyWith( + errorMessage: null, + successMessage: null, + status: + state.status == ClientHubsStatus.actionSuccess || + state.status == ClientHubsStatus.actionFailure + ? ClientHubsStatus.success + : state.status, + ), + ); + } + + @override + void dispose() { + close(); + } +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/presentation/blocs/client_hubs_event.dart b/apps/mobile/packages/features/client/hubs/lib/src/presentation/blocs/client_hubs_event.dart new file mode 100644 index 00000000..a42a4843 --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/presentation/blocs/client_hubs_event.dart @@ -0,0 +1,75 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; + +/// Base class for all client hubs events. +abstract class ClientHubsEvent extends Equatable { + const ClientHubsEvent(); + + @override + List get props => []; +} + +/// Event triggered to fetch the list of hubs. +class ClientHubsFetched extends ClientHubsEvent { + const ClientHubsFetched(); +} + +/// Event triggered to add a new hub. +class ClientHubsAddRequested extends ClientHubsEvent { + final String name; + final String address; + + const ClientHubsAddRequested({required this.name, required this.address}); + + @override + List get props => [name, address]; +} + +/// Event triggered to delete a hub. +class ClientHubsDeleteRequested extends ClientHubsEvent { + final String hubId; + + const ClientHubsDeleteRequested(this.hubId); + + @override + List get props => [hubId]; +} + +/// Event triggered to assign an NFC tag to a hub. +class ClientHubsNfcTagAssignRequested extends ClientHubsEvent { + final String hubId; + final String nfcTagId; + + const ClientHubsNfcTagAssignRequested({ + required this.hubId, + required this.nfcTagId, + }); + + @override + List get props => [hubId, nfcTagId]; +} + +/// Event triggered to clear any error or success messages. +class ClientHubsMessageCleared extends ClientHubsEvent { + const ClientHubsMessageCleared(); +} + +/// Event triggered to toggle the visibility of the "Add Hub" dialog. +class ClientHubsAddDialogToggled extends ClientHubsEvent { + final bool visible; + + const ClientHubsAddDialogToggled({required this.visible}); + + @override + List get props => [visible]; +} + +/// Event triggered to toggle the visibility of the "Identify NFC" dialog. +class ClientHubsIdentifyDialogToggled extends ClientHubsEvent { + final Hub? hub; + + const ClientHubsIdentifyDialogToggled({this.hub}); + + @override + List get props => [hub]; +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/presentation/blocs/client_hubs_state.dart b/apps/mobile/packages/features/client/hubs/lib/src/presentation/blocs/client_hubs_state.dart new file mode 100644 index 00000000..efccca99 --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/presentation/blocs/client_hubs_state.dart @@ -0,0 +1,68 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; + +/// Enum representing the status of the client hubs state. +enum ClientHubsStatus { + initial, + loading, + success, + failure, + actionInProgress, + actionSuccess, + actionFailure, +} + +/// State class for the ClientHubs BLoC. +class ClientHubsState extends Equatable { + final ClientHubsStatus status; + final List hubs; + final String? errorMessage; + final String? successMessage; + + /// Whether the "Add Hub" dialog should be visible. + final bool showAddHubDialog; + + /// The hub currently being identified/assigned an NFC tag. + /// If null, the identification dialog is closed. + final Hub? hubToIdentify; + + const ClientHubsState({ + this.status = ClientHubsStatus.initial, + this.hubs = const [], + this.errorMessage, + this.successMessage, + this.showAddHubDialog = false, + this.hubToIdentify, + }); + + ClientHubsState copyWith({ + ClientHubsStatus? status, + List? hubs, + String? errorMessage, + String? successMessage, + bool? showAddHubDialog, + Hub? hubToIdentify, + bool clearHubToIdentify = false, + }) { + return ClientHubsState( + status: status ?? this.status, + hubs: hubs ?? this.hubs, + errorMessage: errorMessage ?? this.errorMessage, + successMessage: successMessage ?? this.successMessage, + showAddHubDialog: showAddHubDialog ?? this.showAddHubDialog, + hubToIdentify: clearHubToIdentify + ? null + : (hubToIdentify ?? this.hubToIdentify), + ); + } + + @override + List get props => [ + status, + hubs, + errorMessage, + successMessage, + showAddHubDialog, + hubToIdentify, + ]; +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/presentation/navigation/client_hubs_navigator.dart b/apps/mobile/packages/features/client/hubs/lib/src/presentation/navigation/client_hubs_navigator.dart new file mode 100644 index 00000000..0527cdcb --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/presentation/navigation/client_hubs_navigator.dart @@ -0,0 +1,9 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +/// Extension on [IModularNavigator] to provide typed navigation for client hubs. +extension ClientHubsNavigator on IModularNavigator { + /// Navigates to the client hubs page. + Future pushClientHubs() async { + await pushNamed('/client-hubs/'); + } +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/presentation/pages/client_hubs_page.dart b/apps/mobile/packages/features/client/hubs/lib/src/presentation/pages/client_hubs_page.dart new file mode 100644 index 00000000..67e84b41 --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/presentation/pages/client_hubs_page.dart @@ -0,0 +1,207 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../blocs/client_hubs_bloc.dart'; +import '../blocs/client_hubs_event.dart'; +import '../blocs/client_hubs_state.dart'; +import '../widgets/add_hub_dialog.dart'; +import '../widgets/hub_card.dart'; +import '../widgets/hub_empty_state.dart'; +import '../widgets/hub_info_card.dart'; +import '../widgets/identify_nfc_dialog.dart'; + +/// The main page for the client hubs feature. +/// +/// This page follows the KROW Clean Architecture by being a [StatelessWidget] +/// and delegating all state management to the [ClientHubsBloc]. +class ClientHubsPage extends StatelessWidget { + /// Creates a [ClientHubsPage]. + const ClientHubsPage({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (BuildContext context) => + Modular.get()..add(const ClientHubsFetched()), + child: BlocConsumer( + listener: (BuildContext context, ClientHubsState state) { + if (state.errorMessage != null) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(state.errorMessage!))); + BlocProvider.of( + context, + ).add(const ClientHubsMessageCleared()); + } + if (state.successMessage != null) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(state.successMessage!))); + BlocProvider.of( + context, + ).add(const ClientHubsMessageCleared()); + } + }, + builder: (BuildContext context, ClientHubsState state) { + return Scaffold( + backgroundColor: UiColors.bgMenu, + floatingActionButton: FloatingActionButton( + onPressed: () => BlocProvider.of( + context, + ).add(const ClientHubsAddDialogToggled(visible: true)), + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(8)), + ), + child: const Icon(UiIcons.add), + ), + body: Stack( + children: [ + CustomScrollView( + slivers: [ + _buildAppBar(context), + SliverPadding( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space5, + vertical: UiConstants.space5, + ).copyWith(bottom: 100), + sliver: SliverList( + delegate: SliverChildListDelegate([ + if (state.status == ClientHubsStatus.loading) + const Center(child: CircularProgressIndicator()) + else if (state.hubs.isEmpty) + HubEmptyState( + onAddPressed: () => + BlocProvider.of(context).add( + const ClientHubsAddDialogToggled( + visible: true, + ), + ), + ) + else ...[ + ...state.hubs.map( + (Hub hub) => HubCard( + hub: hub, + onNfcPressed: () => + BlocProvider.of( + context, + ).add( + ClientHubsIdentifyDialogToggled(hub: hub), + ), + onDeletePressed: () => + BlocProvider.of( + context, + ).add(ClientHubsDeleteRequested(hub.id)), + ), + ), + ], + const SizedBox(height: UiConstants.space5), + const HubInfoCard(), + ]), + ), + ), + ], + ), + if (state.showAddHubDialog) + AddHubDialog( + onCreate: (String name, String address) { + BlocProvider.of(context).add( + ClientHubsAddRequested(name: name, address: address), + ); + }, + onCancel: () => BlocProvider.of( + context, + ).add(const ClientHubsAddDialogToggled(visible: false)), + ), + if (state.hubToIdentify != null) + IdentifyNfcDialog( + hub: state.hubToIdentify!, + onAssign: (String tagId) { + BlocProvider.of(context).add( + ClientHubsNfcTagAssignRequested( + hubId: state.hubToIdentify!.id, + nfcTagId: tagId, + ), + ); + }, + onCancel: () => BlocProvider.of( + context, + ).add(const ClientHubsIdentifyDialogToggled()), + ), + if (state.status == ClientHubsStatus.actionInProgress) + Container( + color: UiColors.black.withValues(alpha: 0.1), + child: const Center(child: CircularProgressIndicator()), + ), + ], + ), + ); + }, + ), + ); + } + + Widget _buildAppBar(BuildContext context) { + return SliverAppBar( + backgroundColor: UiColors.foreground, // Dark Slate equivalent + automaticallyImplyLeading: false, + expandedHeight: 140, + pinned: true, + flexibleSpace: FlexibleSpaceBar( + background: Container( + color: UiColors.foreground, + padding: const EdgeInsets.fromLTRB( + UiConstants.space5, + UiConstants.space12, + UiConstants.space5, + 0, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + onTap: () => Modular.to.pop(), + child: Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: UiColors.white.withValues(alpha: 0.2), + shape: BoxShape.circle, + ), + child: const Icon( + UiIcons.arrowLeft, + color: UiColors.white, + size: 20, + ), + ), + ), + const SizedBox(height: UiConstants.space4), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + t.client_hubs.title, + style: UiTypography.headline1m.white, + ), + Text( + t.client_hubs.subtitle, + style: UiTypography.body2r.copyWith( + color: UiColors.switchInactive, + ), + ), + ], + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/add_hub_dialog.dart b/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/add_hub_dialog.dart new file mode 100644 index 00000000..2a4dd8e9 --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/add_hub_dialog.dart @@ -0,0 +1,148 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:core_localization/core_localization.dart'; + +/// A dialog for adding a new hub. +class AddHubDialog extends StatefulWidget { + /// Callback when the "Create Hub" button is pressed. + final Function(String name, String address) onCreate; + + /// Callback when the dialog is cancelled. + final VoidCallback onCancel; + + /// Creates an [AddHubDialog]. + const AddHubDialog({ + required this.onCreate, + required this.onCancel, + super.key, + }); + + @override + State createState() => _AddHubDialogState(); +} + +class _AddHubDialogState extends State { + late final TextEditingController _nameController; + late final TextEditingController _addressController; + + @override + void initState() { + super.initState(); + _nameController = TextEditingController(); + _addressController = TextEditingController(); + } + + @override + void dispose() { + _nameController.dispose(); + _addressController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Container( + color: UiColors.bgOverlay, + child: Center( + child: SingleChildScrollView( + child: Container( + width: MediaQuery.of(context).size.width * 0.9, + padding: const EdgeInsets.all(UiConstants.space5), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + boxShadow: const [ + BoxShadow(color: UiColors.popupShadow, blurRadius: 20), + ], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + t.client_hubs.add_hub_dialog.title, + style: UiTypography.headline3m.textPrimary, + ), + const SizedBox(height: UiConstants.space5), + _buildFieldLabel(t.client_hubs.add_hub_dialog.name_label), + TextField( + controller: _nameController, + style: UiTypography.body1r.textPrimary, + decoration: _buildInputDecoration( + t.client_hubs.add_hub_dialog.name_hint, + ), + ), + const SizedBox(height: UiConstants.space4), + _buildFieldLabel(t.client_hubs.add_hub_dialog.address_label), + TextField( + controller: _addressController, + style: UiTypography.body1r.textPrimary, + decoration: _buildInputDecoration( + t.client_hubs.add_hub_dialog.address_hint, + ), + ), + const SizedBox(height: UiConstants.space8), + Row( + children: [ + Expanded( + child: UiButton.secondary( + onPressed: widget.onCancel, + text: t.common.cancel, + ), + ), + const SizedBox(width: UiConstants.space3), + Expanded( + child: UiButton.primary( + onPressed: () { + if (_nameController.text.isNotEmpty) { + widget.onCreate( + _nameController.text, + _addressController.text, + ); + } + }, + text: t.client_hubs.add_hub_dialog.create_button, + ), + ), + ], + ), + ], + ), + ), + ), + ), + ); + } + + Widget _buildFieldLabel(String label) { + return Padding( + padding: const EdgeInsets.only(bottom: UiConstants.space2), + child: Text(label, style: UiTypography.body2m.textPrimary), + ); + } + + InputDecoration _buildInputDecoration(String hint) { + return InputDecoration( + hintText: hint, + hintStyle: UiTypography.body2r.textPlaceholder, + filled: true, + fillColor: UiColors.input, + contentPadding: const EdgeInsets.symmetric( + horizontal: UiConstants.space4, + vertical: 14, + ), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + borderSide: const BorderSide(color: UiColors.border), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + borderSide: const BorderSide(color: UiColors.border), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + borderSide: const BorderSide(color: UiColors.ring, width: 2), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/hub_card.dart b/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/hub_card.dart new file mode 100644 index 00000000..446620e6 --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/hub_card.dart @@ -0,0 +1,121 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:krow_domain/krow_domain.dart'; +import 'package:core_localization/core_localization.dart'; + +/// A card displaying information about a single hub. +class HubCard extends StatelessWidget { + /// The hub to display. + final Hub hub; + + /// Callback when the NFC button is pressed. + final VoidCallback onNfcPressed; + + /// Callback when the delete button is pressed. + final VoidCallback onDeletePressed; + + /// Creates a [HubCard]. + const HubCard({ + required this.hub, + required this.onNfcPressed, + required this.onDeletePressed, + super.key, + }); + + @override + Widget build(BuildContext context) { + final bool hasNfc = hub.nfcTagId != null; + + return Container( + margin: const EdgeInsets.only(bottom: UiConstants.space3), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + boxShadow: const [ + BoxShadow( + color: UiColors.popupShadow, + blurRadius: 10, + offset: Offset(0, 4), + ), + ], + ), + child: Padding( + padding: const EdgeInsets.all(UiConstants.space4), + child: Row( + children: [ + Container( + width: 52, + height: 52, + decoration: BoxDecoration( + color: UiColors.tagInProgress, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + ), + child: Icon( + hasNfc ? UiIcons.success : UiIcons.nfc, + color: hasNfc ? UiColors.iconSuccess : UiColors.iconThird, + size: 24, + ), + ), + const SizedBox(width: UiConstants.space4), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(hub.name, style: UiTypography.body1b.textPrimary), + if (hub.address.isNotEmpty) + Padding( + padding: const EdgeInsets.only(top: UiConstants.space1), + child: Row( + children: [ + const Icon( + UiIcons.mapPin, + size: 12, + color: UiColors.iconThird, + ), + const SizedBox(width: UiConstants.space1), + Expanded( + child: Text( + hub.address, + style: UiTypography.footnote1r.textSecondary, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ), + if (hasNfc) + Padding( + padding: const EdgeInsets.only(top: UiConstants.space1), + child: Text( + t.client_hubs.hub_card.tag_label(id: hub.nfcTagId!), + style: UiTypography.footnote1b.copyWith( + color: UiColors.textSuccess, + fontFamily: 'monospace', + ), + ), + ), + ], + ), + ), + Row( + children: [ + IconButton( + onPressed: onDeletePressed, + icon: const Icon( + UiIcons.delete, + color: UiColors.destructive, + size: 20, + ), + padding: EdgeInsets.zero, + constraints: const BoxConstraints(), + splashRadius: 20, + ), + ], + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/hub_empty_state.dart b/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/hub_empty_state.dart new file mode 100644 index 00000000..e9b7f8c3 --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/hub_empty_state.dart @@ -0,0 +1,60 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:core_localization/core_localization.dart'; + +/// Widget displayed when there are no hubs. +class HubEmptyState extends StatelessWidget { + /// Callback when the add button is pressed. + final VoidCallback onAddPressed; + + /// Creates a [HubEmptyState]. + const HubEmptyState({required this.onAddPressed, super.key}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space8), + decoration: BoxDecoration( + color: UiColors.bgBanner, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + boxShadow: const [ + BoxShadow( + color: UiColors.popupShadow, + blurRadius: 10, + offset: Offset(0, 4), + ), + ], + ), + child: Column( + children: [ + Container( + width: 64, + height: 64, + decoration: const BoxDecoration( + color: UiColors.secondary, + shape: BoxShape.circle, + ), + child: const Icon(UiIcons.nfc, size: 32, color: UiColors.iconThird), + ), + const SizedBox(height: UiConstants.space4), + Text( + t.client_hubs.empty_state.title, + style: UiTypography.title1m.textPrimary, + ), + const SizedBox(height: UiConstants.space2), + Text( + t.client_hubs.empty_state.description, + textAlign: TextAlign.center, + style: UiTypography.body2r.textSecondary, + ), + const SizedBox(height: UiConstants.space5), + UiButton.primary( + onPressed: onAddPressed, + text: t.client_hubs.empty_state.button, + leadingIcon: UiIcons.add, + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/hub_info_card.dart b/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/hub_info_card.dart new file mode 100644 index 00000000..013e533c --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/hub_info_card.dart @@ -0,0 +1,46 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:core_localization/core_localization.dart'; + +/// A card with information about how hubs work. +class HubInfoCard extends StatelessWidget { + /// Creates a [HubInfoCard]. + const HubInfoCard({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.tagInProgress, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Icon(UiIcons.nfc, size: 20, color: UiColors.primary), + const SizedBox(width: UiConstants.space3), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + t.client_hubs.about_hubs.title, + style: UiTypography.body2b.textPrimary, + ), + const SizedBox(height: UiConstants.space1), + Text( + t.client_hubs.about_hubs.description, + style: UiTypography.footnote1r.copyWith( + color: UiColors.textSecondary, + height: 1.4, + ), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/identify_nfc_dialog.dart b/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/identify_nfc_dialog.dart new file mode 100644 index 00000000..df815a6c --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/lib/src/presentation/widgets/identify_nfc_dialog.dart @@ -0,0 +1,169 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:krow_domain/krow_domain.dart'; +import 'package:core_localization/core_localization.dart'; + +/// A dialog for identifying and assigning an NFC tag to a hub. +class IdentifyNfcDialog extends StatefulWidget { + /// The hub to assign the tag to. + final Hub hub; + + /// Callback when a tag is assigned. + final Function(String nfcTagId) onAssign; + + /// Callback when the dialog is cancelled. + final VoidCallback onCancel; + + /// Creates an [IdentifyNfcDialog]. + const IdentifyNfcDialog({ + required this.hub, + required this.onAssign, + required this.onCancel, + super.key, + }); + + @override + State createState() => _IdentifyNfcDialogState(); +} + +class _IdentifyNfcDialogState extends State { + String? _nfcTagId; + + void _simulateNFCScan() { + setState(() { + _nfcTagId = + 'NFC-${DateTime.now().millisecondsSinceEpoch.toString().substring(8).toUpperCase()}'; + }); + } + + @override + Widget build(BuildContext context) { + return Container( + color: UiColors.bgOverlay, + child: Center( + child: SingleChildScrollView( + child: Container( + width: MediaQuery.of(context).size.width * 0.9, + padding: const EdgeInsets.all(UiConstants.space5), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + boxShadow: const [ + BoxShadow(color: UiColors.popupShadow, blurRadius: 20), + ], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + t.client_hubs.nfc_dialog.title, + style: UiTypography.headline3m.textPrimary, + ), + const SizedBox(height: UiConstants.space8), + Container( + width: 80, + height: 80, + decoration: const BoxDecoration( + color: UiColors.tagInProgress, + shape: BoxShape.circle, + ), + child: const Icon( + UiIcons.nfc, + size: 40, + color: UiColors.primary, + ), + ), + const SizedBox(height: UiConstants.space4), + Text(widget.hub.name, style: UiTypography.body1b.textPrimary), + const SizedBox(height: UiConstants.space2), + Text( + t.client_hubs.nfc_dialog.instruction, + textAlign: TextAlign.center, + style: UiTypography.body2m.textSecondary, + ), + const SizedBox(height: UiConstants.space5), + UiButton.secondary( + onPressed: _simulateNFCScan, + text: t.client_hubs.nfc_dialog.scan_button, + leadingIcon: UiIcons.nfc, + ), + if (_nfcTagId != null) ...[ + const SizedBox(height: UiConstants.space6), + Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.tagSuccess, + borderRadius: BorderRadius.circular( + UiConstants.radiusBase, + ), + ), + child: Column( + children: [ + Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Icon( + UiIcons.success, + size: 20, + color: UiColors.textSuccess, + ), + const SizedBox(width: UiConstants.space2), + Text( + t.client_hubs.nfc_dialog.tag_identified, + style: UiTypography.body2b.textPrimary, + ), + ], + ), + const SizedBox(height: UiConstants.space2), + Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space3, + vertical: UiConstants.space2, + ), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: BorderRadius.circular( + UiConstants.radiusMdValue + 2, + ), + border: Border.all(color: UiColors.border), + ), + child: Text( + _nfcTagId!, + style: UiTypography.footnote1b.copyWith( + fontFamily: 'monospace', + color: UiColors.textPrimary, + ), + ), + ), + ], + ), + ), + ], + const SizedBox(height: UiConstants.space8), + Row( + children: [ + Expanded( + child: UiButton.secondary( + onPressed: widget.onCancel, + text: t.common.cancel, + ), + ), + const SizedBox(width: UiConstants.space3), + Expanded( + child: UiButton.primary( + onPressed: _nfcTagId != null + ? () => widget.onAssign(_nfcTagId!) + : null, + text: t.client_hubs.nfc_dialog.assign_button, + ), + ), + ], + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/hubs/pubspec.yaml b/apps/mobile/packages/features/client/hubs/pubspec.yaml new file mode 100644 index 00000000..3c578989 --- /dev/null +++ b/apps/mobile/packages/features/client/hubs/pubspec.yaml @@ -0,0 +1,39 @@ +name: client_hubs +description: "Client hubs management feature for the KROW platform." +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + flutter_modular: ^6.3.2 + equatable: ^2.0.5 + lucide_icons: ^0.257.0 + + # Architecture Packages + krow_core: + path: ../../../core + krow_domain: + path: ../../../domain + krow_data_connect: + path: ../../../data_connect + design_system: + path: ../../../design_system + core_localization: + path: ../../../core_localization + firebase_auth: ^6.1.4 + firebase_data_connect: ^0.2.2+2 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + +flutter: + uses-material-design: true diff --git a/apps/mobile/packages/features/client/settings/lib/client_settings.dart b/apps/mobile/packages/features/client/settings/lib/client_settings.dart new file mode 100644 index 00000000..d5506dc9 --- /dev/null +++ b/apps/mobile/packages/features/client/settings/lib/client_settings.dart @@ -0,0 +1,31 @@ +import 'package:firebase_auth/firebase_auth.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'src/data/repositories_impl/settings_repository_impl.dart'; +import 'src/domain/repositories/settings_repository_interface.dart'; +import 'src/domain/usecases/sign_out_usecase.dart'; +import 'src/presentation/blocs/client_settings_bloc.dart'; +import 'src/presentation/pages/client_settings_page.dart'; + +/// A [Module] for the client settings feature. +class ClientSettingsModule extends Module { + @override + void binds(Injector i) { + // Repositories + i.addLazySingleton( + () => SettingsRepositoryImpl(firebaseAuth: FirebaseAuth.instance), + ); + + // UseCases + i.addLazySingleton(SignOutUseCase.new); + + // BLoCs + i.add( + () => ClientSettingsBloc(signOutUseCase: i.get()), + ); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (_) => const ClientSettingsPage()); + } +} diff --git a/apps/mobile/packages/features/client/settings/lib/src/data/repositories_impl/settings_repository_impl.dart b/apps/mobile/packages/features/client/settings/lib/src/data/repositories_impl/settings_repository_impl.dart new file mode 100644 index 00000000..948af68c --- /dev/null +++ b/apps/mobile/packages/features/client/settings/lib/src/data/repositories_impl/settings_repository_impl.dart @@ -0,0 +1,23 @@ +import 'package:firebase_auth/firebase_auth.dart'; + +import '../../domain/repositories/settings_repository_interface.dart'; + +/// Implementation of [SettingsRepositoryInterface]. +/// +/// This implementation delegates authentication operations to [FirebaseAuth]. +class SettingsRepositoryImpl implements SettingsRepositoryInterface { +/// Creates a [SettingsRepositoryImpl] with the required [_firebaseAuth]. + const SettingsRepositoryImpl({required this.firebaseAuth}); + + /// The Firebase Auth instance. + final FirebaseAuth firebaseAuth; + + @override + Future signOut() async { + try { + await firebaseAuth.signOut(); + } catch (e) { + throw Exception('Error signing out: ${e.toString()}'); + } + } +} diff --git a/apps/mobile/packages/features/client/settings/lib/src/domain/repositories/settings_repository_interface.dart b/apps/mobile/packages/features/client/settings/lib/src/domain/repositories/settings_repository_interface.dart new file mode 100644 index 00000000..4c936d68 --- /dev/null +++ b/apps/mobile/packages/features/client/settings/lib/src/domain/repositories/settings_repository_interface.dart @@ -0,0 +1,7 @@ +/// Interface for the Client Settings repository. +/// +/// This repository handles settings-related operations such as user sign out. +abstract interface class SettingsRepositoryInterface { + /// Signs out the current user from the application. + Future signOut(); +} diff --git a/apps/mobile/packages/features/client/settings/lib/src/domain/usecases/sign_out_usecase.dart b/apps/mobile/packages/features/client/settings/lib/src/domain/usecases/sign_out_usecase.dart new file mode 100644 index 00000000..3f050dfc --- /dev/null +++ b/apps/mobile/packages/features/client/settings/lib/src/domain/usecases/sign_out_usecase.dart @@ -0,0 +1,19 @@ +import 'package:krow_core/core.dart'; +import '../repositories/settings_repository_interface.dart'; + +/// Use case handles the user sign out process. +/// +/// This use case delegates the sign out logic to the [SettingsRepositoryInterface]. +class SignOutUseCase implements NoInputUseCase { + final SettingsRepositoryInterface _repository; + + /// Creates a [SignOutUseCase]. + /// + /// Requires a [SettingsRepositoryInterface] to perform the sign out operation. + SignOutUseCase(this._repository); + + @override + Future call() { + return _repository.signOut(); + } +} diff --git a/apps/mobile/packages/features/client/settings/lib/src/presentation/blocs/client_settings_bloc.dart b/apps/mobile/packages/features/client/settings/lib/src/presentation/blocs/client_settings_bloc.dart new file mode 100644 index 00000000..25298faa --- /dev/null +++ b/apps/mobile/packages/features/client/settings/lib/src/presentation/blocs/client_settings_bloc.dart @@ -0,0 +1,31 @@ +import 'package:equatable/equatable.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../../domain/usecases/sign_out_usecase.dart'; + +part 'client_settings_event.dart'; +part 'client_settings_state.dart'; + +/// BLoC to manage client settings and profile state. +class ClientSettingsBloc + extends Bloc { + final SignOutUseCase _signOutUseCase; + + ClientSettingsBloc({required SignOutUseCase signOutUseCase}) + : _signOutUseCase = signOutUseCase, + super(const ClientSettingsInitial()) { + on(_onSignOutRequested); + } + + Future _onSignOutRequested( + ClientSettingsSignOutRequested event, + Emitter emit, + ) async { + emit(const ClientSettingsLoading()); + try { + await _signOutUseCase(); + emit(const ClientSettingsSignOutSuccess()); + } catch (e) { + emit(ClientSettingsError(e.toString())); + } + } +} diff --git a/apps/mobile/packages/features/client/settings/lib/src/presentation/blocs/client_settings_event.dart b/apps/mobile/packages/features/client/settings/lib/src/presentation/blocs/client_settings_event.dart new file mode 100644 index 00000000..8eb6c424 --- /dev/null +++ b/apps/mobile/packages/features/client/settings/lib/src/presentation/blocs/client_settings_event.dart @@ -0,0 +1,12 @@ +part of 'client_settings_bloc.dart'; + +abstract class ClientSettingsEvent extends Equatable { + const ClientSettingsEvent(); + + @override + List get props => []; +} + +class ClientSettingsSignOutRequested extends ClientSettingsEvent { + const ClientSettingsSignOutRequested(); +} diff --git a/apps/mobile/packages/features/client/settings/lib/src/presentation/blocs/client_settings_state.dart b/apps/mobile/packages/features/client/settings/lib/src/presentation/blocs/client_settings_state.dart new file mode 100644 index 00000000..c83bb91f --- /dev/null +++ b/apps/mobile/packages/features/client/settings/lib/src/presentation/blocs/client_settings_state.dart @@ -0,0 +1,29 @@ +part of 'client_settings_bloc.dart'; + +abstract class ClientSettingsState extends Equatable { + const ClientSettingsState(); + + @override + List get props => []; +} + +class ClientSettingsInitial extends ClientSettingsState { + const ClientSettingsInitial(); +} + +class ClientSettingsLoading extends ClientSettingsState { + const ClientSettingsLoading(); +} + +class ClientSettingsSignOutSuccess extends ClientSettingsState { + const ClientSettingsSignOutSuccess(); +} + +class ClientSettingsError extends ClientSettingsState { + final String message; + + const ClientSettingsError(this.message); + + @override + List get props => [message]; +} diff --git a/apps/mobile/packages/features/client/settings/lib/src/presentation/navigation/client_settings_navigator.dart b/apps/mobile/packages/features/client/settings/lib/src/presentation/navigation/client_settings_navigator.dart new file mode 100644 index 00000000..fbb7f0da --- /dev/null +++ b/apps/mobile/packages/features/client/settings/lib/src/presentation/navigation/client_settings_navigator.dart @@ -0,0 +1,15 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +/// Extension on [IModularNavigator] to provide strongly-typed navigation +/// for the client settings feature. +extension ClientSettingsNavigator on IModularNavigator { + /// Navigates to the client settings page. + void pushClientSettings() { + pushNamed('/client/settings/'); + } + + /// Navigates to the hubs page. + void pushHubs() { + pushNamed('/client-hubs/'); + } +} diff --git a/apps/mobile/packages/features/client/settings/lib/src/presentation/pages/client_settings_page.dart b/apps/mobile/packages/features/client/settings/lib/src/presentation/pages/client_settings_page.dart new file mode 100644 index 00000000..f480c8d7 --- /dev/null +++ b/apps/mobile/packages/features/client/settings/lib/src/presentation/pages/client_settings_page.dart @@ -0,0 +1,48 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; + +import '../blocs/client_settings_bloc.dart'; +import '../widgets/client_settings_page/settings_actions.dart'; +import '../widgets/client_settings_page/settings_profile_header.dart'; + +/// Page for client settings and profile management. +/// +/// This page follows the KROW architecture by being a [StatelessWidget] +/// and delegating its state management to [ClientSettingsBloc] and its +/// UI sections to specialized sub-widgets. +class ClientSettingsPage extends StatelessWidget { + /// Creates a [ClientSettingsPage]. + const ClientSettingsPage({super.key}); + + @override + /// Builds the client settings page UI. + Widget build(BuildContext context) { + return BlocProvider( + create: (BuildContext context) => Modular.get(), + child: BlocListener( + listener: (BuildContext context, ClientSettingsState state) { + if (state is ClientSettingsSignOutSuccess) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Signed out successfully')), + ); + Modular.to.navigate('/'); + } + if (state is ClientSettingsError) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(state.message))); + } + }, + child: const Scaffold( + body: CustomScrollView( + slivers: [ + SettingsProfileHeader(), + SettingsActions(), + ], + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_actions.dart b/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_actions.dart new file mode 100644 index 00000000..99c77655 --- /dev/null +++ b/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_actions.dart @@ -0,0 +1,90 @@ +import 'package:client_settings/src/presentation/navigation/client_settings_navigator.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import '../../blocs/client_settings_bloc.dart'; + +/// A widget that displays the primary actions for the settings page. +class SettingsActions extends StatelessWidget { + /// Creates a [SettingsActions]. + const SettingsActions({super.key}); + + @override + /// Builds the settings actions UI. + Widget build(BuildContext context) { + // Get the translations for the client settings profile. + final TranslationsClientSettingsProfileEn labels = + t.client_settings.profile; + + return SliverPadding( + padding: const EdgeInsets.symmetric(horizontal: UiConstants.space5), + sliver: SliverList( + delegate: SliverChildListDelegate([ + const SizedBox(height: UiConstants.space5), + + /// TODO: FEATURE_NOT_YET_IMPLEMENTED + // Edit profile is not yet implemented + + // Hubs button + UiButton.primary( + text: labels.hubs, + onPressed: () => Modular.to.pushHubs(), + ), + const SizedBox(height: UiConstants.space4), + + // Log out button + BlocBuilder( + builder: (BuildContext context, ClientSettingsState state) { + return UiButton.secondary( + text: labels.log_out, + onPressed: state is ClientSettingsLoading + ? null + : () => _showSignOutDialog(context), + ); + }, + ), + ]), + ), + ); + } + + /// Shows a confirmation dialog for signing out. + Future _showSignOutDialog(BuildContext context) { + return showDialog( + context: context, + builder: (BuildContext context) => AlertDialog( + backgroundColor: UiColors.bgPopup, + elevation: 0, + shape: RoundedRectangleBorder(borderRadius: UiConstants.radiusLg), + title: Text( + t.client_settings.profile.log_out, + style: UiTypography.headline3m.textPrimary, + ), + content: Text( + 'Are you sure you want to log out?', + style: UiTypography.body2r.textSecondary, + ), + actions: [ + // Log out button + UiButton.secondary( + text: t.client_settings.profile.log_out, + onPressed: () { + Modular.to.pop(); + BlocProvider.of( + context, + ).add(const ClientSettingsSignOutRequested()); + }, + ), + + // Cancel button + UiButton.secondary( + text: t.common.cancel, + onPressed: () => Modular.to.pop(), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_profile_header.dart b/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_profile_header.dart new file mode 100644 index 00000000..fc05ccf6 --- /dev/null +++ b/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_profile_header.dart @@ -0,0 +1,99 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart' as dc; + +/// A widget that displays the profile header with avatar and company info. +class SettingsProfileHeader extends StatelessWidget { + /// Creates a [SettingsProfileHeader]. + const SettingsProfileHeader({super.key}); + + @override + /// Builds the profile header UI. + Widget build(BuildContext context) { + final TranslationsClientSettingsProfileEn labels = t.client_settings.profile; + final dc.ClientSession? session = dc.ClientSessionStore.instance.session; + final String businessName = + session?.business?.businessName ?? 'Your Company'; + final String email = session?.user.email ?? 'client@example.com'; + final String? photoUrl = session?.userPhotoUrl; + final String avatarLetter = businessName.trim().isNotEmpty + ? businessName.trim()[0].toUpperCase() + : 'C'; + + return SliverAppBar( + backgroundColor: UiColors.bgSecondary, + expandedHeight: 140, + pinned: true, + elevation: 0, + shape: const Border(bottom: BorderSide(color: UiColors.border, width: 1)), + leading: IconButton( + icon: const Icon(UiIcons.chevronLeft, color: UiColors.textSecondary), + onPressed: () => Modular.to.pop(), + ), + flexibleSpace: FlexibleSpaceBar( + background: Container( + padding: const EdgeInsets.symmetric(horizontal: UiConstants.space8), + margin: const EdgeInsets.only(top: UiConstants.space16), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + spacing: UiConstants.space4, + children: [ + Container( + width: 64, + height: 64, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(color: UiColors.border, width: 2), + color: UiColors.white, + ), + child: CircleAvatar( + backgroundColor: UiColors.primary.withValues(alpha: 0.1), + backgroundImage: + photoUrl != null && photoUrl.isNotEmpty + ? NetworkImage(photoUrl) + : null, + child: + photoUrl != null && photoUrl.isNotEmpty + ? null + : Text( + avatarLetter, + style: UiTypography.headline1m.copyWith( + color: UiColors.primary, + ), + ), + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(businessName, style: UiTypography.body1b.textPrimary), + const SizedBox(height: UiConstants.space1), + Row( + mainAxisAlignment: MainAxisAlignment.start, + spacing: UiConstants.space1, + children: [ + Icon( + UiIcons.mail, + size: 14, + color: UiColors.textSecondary, + ), + Text( + email, + style: UiTypography.footnote1r.textSecondary, + ), + ], + ), + ], + ), + ], + ), + ), + ), + title: Text(labels.title, style: UiTypography.body1b.textPrimary), + ); + } +} diff --git a/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_quick_links.dart b/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_quick_links.dart new file mode 100644 index 00000000..ea0bf9cc --- /dev/null +++ b/apps/mobile/packages/features/client/settings/lib/src/presentation/widgets/client_settings_page/settings_quick_links.dart @@ -0,0 +1,106 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import '../../navigation/client_settings_navigator.dart'; + +/// A widget that displays a list of quick links in a card. +class SettingsQuickLinks extends StatelessWidget { + /// Creates a [SettingsQuickLinks]. + const SettingsQuickLinks({super.key}); + + @override + /// Builds the quick links UI. + Widget build(BuildContext context) { + final TranslationsClientSettingsProfileEn labels = t.client_settings.profile; + + return SliverPadding( + padding: const EdgeInsets.all(UiConstants.space5), + sliver: SliverToBoxAdapter( + child: Card( + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: UiConstants.radiusLg, + side: const BorderSide(color: UiColors.border), + ), + color: UiColors.white, + child: Padding( + padding: const EdgeInsets.all(UiConstants.space4), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + labels.quick_links, + style: UiTypography.footnote1b.textPrimary, + ), + const SizedBox(height: UiConstants.space3), + _QuickLinkItem( + icon: UiIcons.nfc, + title: labels.clock_in_hubs, + onTap: () => Modular.to.pushHubs(), + ), + + _QuickLinkItem( + icon: UiIcons.building, + title: labels.billing_payments, + onTap: () {}, + ), + ], + ), + ), + ), + ), + ); + } +} + +/// Internal widget for a single quick link item. +class _QuickLinkItem extends StatelessWidget { + /// The icon to display. + final IconData icon; + + /// The title of the link. + final String title; + + /// Callback when the link is tapped. + final VoidCallback onTap; + + /// Creates a [_QuickLinkItem]. + const _QuickLinkItem({ + required this.icon, + required this.title, + required this.onTap, + }); + + @override + /// Builds the quick link item UI. + Widget build(BuildContext context) { + return InkWell( + onTap: onTap, + borderRadius: UiConstants.radiusMd, + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: UiConstants.space3, + horizontal: UiConstants.space2, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Icon(icon, size: 20, color: UiColors.iconSecondary), + const SizedBox(width: UiConstants.space3), + Text(title, style: UiTypography.footnote1m.textPrimary), + ], + ), + const Icon( + UiIcons.chevronRight, + size: 20, + color: UiColors.iconThird, + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/settings/pubspec.yaml b/apps/mobile/packages/features/client/settings/pubspec.yaml new file mode 100644 index 00000000..28814baa --- /dev/null +++ b/apps/mobile/packages/features/client/settings/pubspec.yaml @@ -0,0 +1,39 @@ +name: client_settings +description: Settings and profile screen for the client application. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + flutter_modular: ^6.3.0 + equatable: ^2.0.5 + lucide_icons: ^0.257.0 + firebase_auth: ^6.1.2 + + # Architecture Packages + design_system: + path: ../../../design_system + core_localization: + path: ../../../core_localization + krow_core: + path: ../../../core + krow_domain: + path: ../../../domain + krow_data_connect: + path: ../../../data_connect + +dev_dependencies: + flutter_test: + sdk: flutter + bloc_test: ^9.1.0 + mocktail: ^1.0.0 + +flutter: + uses-material-design: true diff --git a/apps/mobile/packages/features/client/view_orders/lib/src/data/repositories/view_orders_repository_impl.dart b/apps/mobile/packages/features/client/view_orders/lib/src/data/repositories/view_orders_repository_impl.dart new file mode 100644 index 00000000..3a9e9fe2 --- /dev/null +++ b/apps/mobile/packages/features/client/view_orders/lib/src/data/repositories/view_orders_repository_impl.dart @@ -0,0 +1,158 @@ +import 'package:firebase_auth/firebase_auth.dart' as firebase; +import 'package:firebase_data_connect/firebase_data_connect.dart' as fdc; +import 'package:intl/intl.dart'; +import 'package:krow_data_connect/krow_data_connect.dart' as dc; +import 'package:krow_domain/krow_domain.dart' as domain; +import '../../domain/repositories/i_view_orders_repository.dart'; + +/// Implementation of [IViewOrdersRepository] using Data Connect. +class ViewOrdersRepositoryImpl implements IViewOrdersRepository { + final firebase.FirebaseAuth _firebaseAuth; + final dc.ExampleConnector _dataConnect; + + ViewOrdersRepositoryImpl({ + required firebase.FirebaseAuth firebaseAuth, + required dc.ExampleConnector dataConnect, + }) : _firebaseAuth = firebaseAuth, + _dataConnect = dataConnect; + + @override + Future> getOrdersForRange({ + required DateTime start, + required DateTime end, + }) async { + final String? businessId = dc.ClientSessionStore.instance.session?.business?.id; + if (businessId == null || businessId.isEmpty) { + await _firebaseAuth.signOut(); + throw Exception('Business is missing. Please sign in again.'); + } + + final fdc.Timestamp startTimestamp = _toTimestamp(_startOfDay(start)); + final fdc.Timestamp endTimestamp = _toTimestamp(_endOfDay(end)); + final fdc.QueryResult result = await _dataConnect + .listShiftRolesByBusinessAndDateRange( + businessId: businessId, + start: startTimestamp, + end: endTimestamp, + ) + .execute(); + + final String businessName = + dc.ClientSessionStore.instance.session?.business?.businessName ?? + 'Your Company'; + + return result.data.shiftRoles.map((dc.ListShiftRolesByBusinessAndDateRangeShiftRoles shiftRole) { + final DateTime? shiftDate = shiftRole.shift.date?.toDateTime(); + final String dateStr = shiftDate == null + ? '' + : DateFormat('yyyy-MM-dd').format(shiftDate); + final String startTime = _formatTime(shiftRole.startTime); + final String endTime = _formatTime(shiftRole.endTime); + final int filled = shiftRole.assigned ?? 0; + final int workersNeeded = shiftRole.count; + final double hours = shiftRole.hours ?? 0; + final double totalValue = shiftRole.totalValue ?? 0; + final double hourlyRate = _hourlyRate(shiftRole.totalValue, shiftRole.hours); + // final String status = filled >= workersNeeded ? 'filled' : 'open'; + final String status = shiftRole.shift.status?.stringValue ?? 'OPEN'; + + print( + 'ViewOrders item: date=$dateStr status=$status shiftId=${shiftRole.shiftId} ' + 'roleId=${shiftRole.roleId} start=${shiftRole.startTime?.toJson()} ' + 'end=${shiftRole.endTime?.toJson()} hours=$hours totalValue=$totalValue', + ); + + return domain.OrderItem( + id: _shiftRoleKey(shiftRole.shiftId, shiftRole.roleId), + orderId: shiftRole.shift.order.id, + title: '${shiftRole.role.name} - ${shiftRole.shift.title}', + clientName: businessName, + status: status, + date: dateStr, + startTime: startTime, + endTime: endTime, + location: shiftRole.shift.location ?? '', + locationAddress: shiftRole.shift.locationAddress ?? '', + filled: filled, + workersNeeded: workersNeeded, + hourlyRate: hourlyRate, + hours: hours, + totalValue: totalValue, + confirmedApps: const >[], + ); + }).toList(); + } + + @override + Future>>> getAcceptedApplicationsForDay( + DateTime day, + ) async { + final String? businessId = dc.ClientSessionStore.instance.session?.business?.id; + if (businessId == null || businessId.isEmpty) { + await _firebaseAuth.signOut(); + throw Exception('Business is missing. Please sign in again.'); + } + + final fdc.Timestamp dayStart = _toTimestamp(_startOfDay(day)); + final fdc.Timestamp dayEnd = _toTimestamp(_endOfDay(day)); + final fdc.QueryResult result = await _dataConnect + .listAcceptedApplicationsByBusinessForDay( + businessId: businessId, + dayStart: dayStart, + dayEnd: dayEnd, + ) + .execute(); + + final Map>> grouped = >>{}; + for (final dc.ListAcceptedApplicationsByBusinessForDayApplications application in result.data.applications) { + print( + 'ViewOrders app: shiftId=${application.shiftId} roleId=${application.roleId} ' + 'checkIn=${application.checkInTime?.toJson()} checkOut=${application.checkOutTime?.toJson()}', + ); + final String key = _shiftRoleKey(application.shiftId, application.roleId); + grouped.putIfAbsent(key, () => >[]); + grouped[key]!.add({ + 'id': application.id, + 'worker_id': application.staff.id, + 'worker_name': application.staff.fullName, + 'status': 'confirmed', + 'photo_url': application.staff.photoUrl, + }); + } + return grouped; + } + + String _shiftRoleKey(String shiftId, String roleId) { + return '$shiftId:$roleId'; + } + + fdc.Timestamp _toTimestamp(DateTime dateTime) { + final DateTime utc = dateTime.toUtc(); + final int seconds = utc.millisecondsSinceEpoch ~/ 1000; + final int nanoseconds = (utc.microsecondsSinceEpoch % 1000000) * 1000; + return fdc.Timestamp(nanoseconds, seconds); + } + + DateTime _startOfDay(DateTime dateTime) { + return DateTime(dateTime.year, dateTime.month, dateTime.day); + } + + DateTime _endOfDay(DateTime dateTime) { + return DateTime(dateTime.year, dateTime.month, dateTime.day, 23, 59, 59); + } + + String _formatTime(fdc.Timestamp? timestamp) { + if (timestamp == null) { + return ''; + } + final DateTime dateTime = timestamp.toDateTime(); + return DateFormat('HH:mm').format(dateTime); + } + + double _hourlyRate(double? totalValue, double? hours) { + if (totalValue == null || hours == null || hours == 0) { + return 0; + } + return totalValue / hours; + } +} diff --git a/apps/mobile/packages/features/client/view_orders/lib/src/domain/arguments/orders_day_arguments.dart b/apps/mobile/packages/features/client/view_orders/lib/src/domain/arguments/orders_day_arguments.dart new file mode 100644 index 00000000..6c74b6d7 --- /dev/null +++ b/apps/mobile/packages/features/client/view_orders/lib/src/domain/arguments/orders_day_arguments.dart @@ -0,0 +1,10 @@ +import 'package:krow_core/core.dart'; + +class OrdersDayArguments extends UseCaseArgument { + const OrdersDayArguments({required this.day}); + + final DateTime day; + + @override + List get props => [day]; +} diff --git a/apps/mobile/packages/features/client/view_orders/lib/src/domain/arguments/orders_range_arguments.dart b/apps/mobile/packages/features/client/view_orders/lib/src/domain/arguments/orders_range_arguments.dart new file mode 100644 index 00000000..4c64fbb0 --- /dev/null +++ b/apps/mobile/packages/features/client/view_orders/lib/src/domain/arguments/orders_range_arguments.dart @@ -0,0 +1,14 @@ +import 'package:krow_core/core.dart'; + +class OrdersRangeArguments extends UseCaseArgument { + const OrdersRangeArguments({ + required this.start, + required this.end, + }); + + final DateTime start; + final DateTime end; + + @override + List get props => [start, end]; +} diff --git a/apps/mobile/packages/features/client/view_orders/lib/src/domain/repositories/i_view_orders_repository.dart b/apps/mobile/packages/features/client/view_orders/lib/src/domain/repositories/i_view_orders_repository.dart new file mode 100644 index 00000000..f2cdfae0 --- /dev/null +++ b/apps/mobile/packages/features/client/view_orders/lib/src/domain/repositories/i_view_orders_repository.dart @@ -0,0 +1,15 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Repository interface for fetching and managing client orders. +abstract class IViewOrdersRepository { + /// Fetches a list of [OrderItem] for the client. + Future> getOrdersForRange({ + required DateTime start, + required DateTime end, + }); + + /// Fetches accepted staff applications for the given day, grouped by shift+role. + Future>>> getAcceptedApplicationsForDay( + DateTime day, + ); +} diff --git a/apps/mobile/packages/features/client/view_orders/lib/src/domain/usecases/get_accepted_applications_for_day_use_case.dart b/apps/mobile/packages/features/client/view_orders/lib/src/domain/usecases/get_accepted_applications_for_day_use_case.dart new file mode 100644 index 00000000..0afe115b --- /dev/null +++ b/apps/mobile/packages/features/client/view_orders/lib/src/domain/usecases/get_accepted_applications_for_day_use_case.dart @@ -0,0 +1,17 @@ +import 'package:krow_core/core.dart'; +import '../repositories/i_view_orders_repository.dart'; +import '../arguments/orders_day_arguments.dart'; + +class GetAcceptedApplicationsForDayUseCase + implements UseCase>>> { + const GetAcceptedApplicationsForDayUseCase(this._repository); + + final IViewOrdersRepository _repository; + + @override + Future>>> call( + OrdersDayArguments input, + ) { + return _repository.getAcceptedApplicationsForDay(input.day); + } +} diff --git a/apps/mobile/packages/features/client/view_orders/lib/src/domain/usecases/get_orders_use_case.dart b/apps/mobile/packages/features/client/view_orders/lib/src/domain/usecases/get_orders_use_case.dart new file mode 100644 index 00000000..8eb17cca --- /dev/null +++ b/apps/mobile/packages/features/client/view_orders/lib/src/domain/usecases/get_orders_use_case.dart @@ -0,0 +1,24 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/i_view_orders_repository.dart'; +import '../arguments/orders_range_arguments.dart'; + +/// Use case for retrieving the list of client orders. +/// +/// This use case encapsulates the business rule of fetching orders +/// and delegates the data retrieval to the [IViewOrdersRepository]. +class GetOrdersUseCase + implements UseCase> { + final IViewOrdersRepository _repository; + + /// Creates a [GetOrdersUseCase] with the required [IViewOrdersRepository]. + GetOrdersUseCase(this._repository); + + @override + Future> call(OrdersRangeArguments input) { + return _repository.getOrdersForRange( + start: input.start, + end: input.end, + ); + } +} diff --git a/apps/mobile/packages/features/client/view_orders/lib/src/presentation/blocs/view_orders_cubit.dart b/apps/mobile/packages/features/client/view_orders/lib/src/presentation/blocs/view_orders_cubit.dart new file mode 100644 index 00000000..727268af --- /dev/null +++ b/apps/mobile/packages/features/client/view_orders/lib/src/presentation/blocs/view_orders_cubit.dart @@ -0,0 +1,250 @@ +import 'package:intl/intl.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/arguments/orders_day_arguments.dart'; +import '../../domain/arguments/orders_range_arguments.dart'; +import '../../domain/usecases/get_accepted_applications_for_day_use_case.dart'; +import '../../domain/usecases/get_orders_use_case.dart'; +import 'view_orders_state.dart'; + +/// Cubit for managing the state of the View Orders feature. +/// +/// This Cubit handles loading orders, date selection, and tab filtering. +class ViewOrdersCubit extends Cubit { + ViewOrdersCubit({ + required GetOrdersUseCase getOrdersUseCase, + required GetAcceptedApplicationsForDayUseCase getAcceptedAppsUseCase, + }) + : _getOrdersUseCase = getOrdersUseCase, + _getAcceptedAppsUseCase = getAcceptedAppsUseCase, + super(ViewOrdersState(selectedDate: DateTime.now())) { + _init(); + } + + final GetOrdersUseCase _getOrdersUseCase; + final GetAcceptedApplicationsForDayUseCase _getAcceptedAppsUseCase; + + void _init() { + updateWeekOffset(0); // Initialize calendar days + } + + Future _loadOrdersForRange({ + required DateTime rangeStart, + required DateTime rangeEnd, + required DateTime dayForApps, + }) async { + emit(state.copyWith(status: ViewOrdersStatus.loading)); + try { + final List orders = await _getOrdersUseCase( + OrdersRangeArguments(start: rangeStart, end: rangeEnd), + ); + final Map>> apps = await _getAcceptedAppsUseCase( + OrdersDayArguments(day: dayForApps), + ); + final List updatedOrders = _applyApplications(orders, apps); + emit( + state.copyWith( + status: ViewOrdersStatus.success, + orders: updatedOrders, + ), + ); + _updateDerivedState(); + } catch (_) { + emit(state.copyWith(status: ViewOrdersStatus.failure)); + } + } + + void selectDate(DateTime date) { + emit(state.copyWith(selectedDate: date)); + _refreshAcceptedApplications(date); + } + + void selectFilterTab(String tabId) { + emit(state.copyWith(filterTab: tabId)); + _updateDerivedState(); + } + + void updateWeekOffset(int offset) { + final int newWeekOffset = state.weekOffset + offset; + final List calendarDays = _calculateCalendarDays(newWeekOffset); + final DateTime? selectedDate = state.selectedDate; + final DateTime updatedSelectedDate = + selectedDate != null && + calendarDays.any((DateTime day) => _isSameDay(day, selectedDate)) + ? selectedDate + : calendarDays.first; + emit( + state.copyWith( + weekOffset: newWeekOffset, + calendarDays: calendarDays, + selectedDate: updatedSelectedDate, + ), + ); + + _loadOrdersForRange( + rangeStart: calendarDays.first, + rangeEnd: calendarDays.last, + dayForApps: updatedSelectedDate, + ); + } + + void _updateDerivedState() { + final List filteredOrders = _calculateFilteredOrders(state); + final int activeCount = _calculateCategoryCount('active'); + final int completedCount = _calculateCategoryCount('completed'); + final int upNextCount = _calculateUpNextCount(); + + emit( + state.copyWith( + filteredOrders: filteredOrders, + activeCount: activeCount, + completedCount: completedCount, + upNextCount: upNextCount, + ), + ); + } + + Future _refreshAcceptedApplications(DateTime day) async { + try { + final Map>> apps = await _getAcceptedAppsUseCase( + OrdersDayArguments(day: day), + ); + final List updatedOrders = + _applyApplications(state.orders, apps); + emit(state.copyWith(orders: updatedOrders)); + _updateDerivedState(); + } catch (_) { + // Keep existing data on failure. + } + } + + List _applyApplications( + List orders, + Map>> apps, + ) { + return orders.map((OrderItem order) { + final List> confirmed = apps[order.id] ?? const >[]; + if (confirmed.isEmpty) { + return order; + } + + final int filled = confirmed.length; + final String status = + filled >= order.workersNeeded ? 'filled' : order.status; + return OrderItem( + id: order.id, + orderId: order.orderId, + title: order.title, + clientName: order.clientName, + status: status, + date: order.date, + startTime: order.startTime, + endTime: order.endTime, + location: order.location, + locationAddress: order.locationAddress, + filled: filled, + workersNeeded: order.workersNeeded, + hourlyRate: order.hourlyRate, + hours: order.hours, + totalValue: order.totalValue, + confirmedApps: confirmed, + ); + }).toList(); + } + + bool _isSameDay(DateTime a, DateTime b) { + return a.year == b.year && a.month == b.month && a.day == b.day; + } + + List _calculateCalendarDays(int weekOffset) { + final DateTime now = DateTime.now(); + final int jsDay = now.weekday == 7 ? 0 : now.weekday; + final int daysSinceFriday = (jsDay + 2) % 7; + + final DateTime startDate = DateTime(now.year, now.month, now.day) + .subtract(Duration(days: daysSinceFriday)) + .add(Duration(days: weekOffset * 7)); + + return List.generate( + 7, + (int index) => startDate.add(Duration(days: index)), + ); + } + + List _calculateFilteredOrders(ViewOrdersState state) { + if (state.selectedDate == null) return []; + + final String selectedDateStr = DateFormat( + 'yyyy-MM-dd', + ).format(state.selectedDate!); + + // Filter by date + final List ordersOnDate = state.orders + .where((OrderItem s) => s.date == selectedDateStr) + .toList(); + + // Sort by start time + ordersOnDate.sort( + (OrderItem a, OrderItem b) => a.startTime.compareTo(b.startTime), + ); + + if (state.filterTab == 'all') { + return ordersOnDate + .where( + (OrderItem s) => + // TODO(orders): move PENDING to its own tab once available. + ['OPEN', 'FILLED', 'CONFIRMED', 'PENDING'] + .contains(s.status), + ) + .toList(); + } else if (state.filterTab == 'active') { + return ordersOnDate + .where((OrderItem s) => s.status == 'IN_PROGRESS') + .toList(); + } else if (state.filterTab == 'completed') { + return ordersOnDate + .where((OrderItem s) => s.status == 'COMPLETED') + .toList(); + } + return []; + } + + int _calculateCategoryCount(String category) { + if (state.selectedDate == null) return 0; + final String selectedDateStr = DateFormat( + 'yyyy-MM-dd', + ).format(state.selectedDate!); + final List ordersOnDate = state.orders + .where((OrderItem s) => s.date == selectedDateStr) + .toList(); + + if (category == 'active') { + return ordersOnDate + .where((OrderItem s) => s.status == 'IN_PROGRESS') + .length; + } else if (category == 'completed') { + return ordersOnDate + .where((OrderItem s) => s.status == 'COMPLETED') + .length; + } + return 0; + } + + int _calculateUpNextCount() { + if (state.selectedDate == null) return 0; + final String selectedDateStr = DateFormat( + 'yyyy-MM-dd', + ).format(state.selectedDate!); + final List ordersOnDate = state.orders + .where((OrderItem s) => s.date == selectedDateStr) + .toList(); + return ordersOnDate + .where( + (OrderItem s) => + // TODO(orders): move PENDING to its own tab once available. + ['OPEN', 'FILLED', 'CONFIRMED', 'PENDING'] + .contains(s.status), + ) + .length; + } +} diff --git a/apps/mobile/packages/features/client/view_orders/lib/src/presentation/blocs/view_orders_state.dart b/apps/mobile/packages/features/client/view_orders/lib/src/presentation/blocs/view_orders_state.dart new file mode 100644 index 00000000..af67fa19 --- /dev/null +++ b/apps/mobile/packages/features/client/view_orders/lib/src/presentation/blocs/view_orders_state.dart @@ -0,0 +1,70 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; + +enum ViewOrdersStatus { initial, loading, success, failure } + +class ViewOrdersState extends Equatable { + const ViewOrdersState({ + this.status = ViewOrdersStatus.initial, + this.orders = const [], + this.filteredOrders = const [], + this.calendarDays = const [], + this.selectedDate, + this.filterTab = 'all', + this.weekOffset = 0, + this.activeCount = 0, + this.completedCount = 0, + this.upNextCount = 0, + }); + + final ViewOrdersStatus status; + final List orders; + final List filteredOrders; + final List calendarDays; + final DateTime? selectedDate; + final String filterTab; + final int weekOffset; + final int activeCount; + final int completedCount; + final int upNextCount; + + ViewOrdersState copyWith({ + ViewOrdersStatus? status, + List? orders, + List? filteredOrders, + List? calendarDays, + DateTime? selectedDate, + String? filterTab, + int? weekOffset, + int? activeCount, + int? completedCount, + int? upNextCount, + }) { + return ViewOrdersState( + status: status ?? this.status, + orders: orders ?? this.orders, + filteredOrders: filteredOrders ?? this.filteredOrders, + calendarDays: calendarDays ?? this.calendarDays, + selectedDate: selectedDate ?? this.selectedDate, + filterTab: filterTab ?? this.filterTab, + weekOffset: weekOffset ?? this.weekOffset, + activeCount: activeCount ?? this.activeCount, + completedCount: completedCount ?? this.completedCount, + upNextCount: upNextCount ?? this.upNextCount, + ); + } + + @override + List get props => [ + status, + orders, + filteredOrders, + calendarDays, + selectedDate, + filterTab, + weekOffset, + activeCount, + completedCount, + upNextCount, + ]; +} diff --git a/apps/mobile/packages/features/client/view_orders/lib/src/presentation/navigation/view_orders_navigator.dart b/apps/mobile/packages/features/client/view_orders/lib/src/presentation/navigation/view_orders_navigator.dart new file mode 100644 index 00000000..7160bb59 --- /dev/null +++ b/apps/mobile/packages/features/client/view_orders/lib/src/presentation/navigation/view_orders_navigator.dart @@ -0,0 +1,14 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +/// Extension to provide typed navigation for the View Orders feature. +extension ViewOrdersNavigator on IModularNavigator { + /// Navigates to the Create Order feature. + void navigateToCreateOrder() { + pushNamed('/client/create-order/'); + } + + /// Navigates to the Order Details (placeholder for now). + void navigateToOrderDetails(String orderId) { + // pushNamed('/view-orders/$orderId'); + } +} diff --git a/apps/mobile/packages/features/client/view_orders/lib/src/presentation/pages/view_orders_page.dart b/apps/mobile/packages/features/client/view_orders/lib/src/presentation/pages/view_orders_page.dart new file mode 100644 index 00000000..c47b8518 --- /dev/null +++ b/apps/mobile/packages/features/client/view_orders/lib/src/presentation/pages/view_orders_page.dart @@ -0,0 +1,472 @@ +import 'dart:ui'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:intl/intl.dart'; + +import 'package:core_localization/core_localization.dart'; +import '../blocs/view_orders_cubit.dart'; +import '../blocs/view_orders_state.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../widgets/view_order_card.dart'; +import '../navigation/view_orders_navigator.dart'; + +/// The main page for viewing client orders. +/// +/// This page follows the KROW Clean Architecture by: +/// - Being a [StatelessWidget]. +/// - Using [ViewOrdersCubit] for state management. +/// - Adhering to the project's Design System. +class ViewOrdersPage extends StatelessWidget { + /// Creates a [ViewOrdersPage]. + const ViewOrdersPage({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (BuildContext context) => Modular.get(), + child: const ViewOrdersView(), + ); + } +} + +/// The internal view implementation for [ViewOrdersPage]. +class ViewOrdersView extends StatelessWidget { + /// Creates a [ViewOrdersView]. + const ViewOrdersView({super.key}); + + @override + Widget build(BuildContext context) { + return BlocBuilder( + builder: (BuildContext context, ViewOrdersState state) { + final List calendarDays = state.calendarDays; + final List filteredOrders = state.filteredOrders; + + // Header Colors logic from prototype + String sectionTitle = ''; + Color dotColor = UiColors.transparent; + + if (state.filterTab == 'all') { + sectionTitle = t.client_view_orders.tabs.up_next; + dotColor = UiColors.primary; + } else if (state.filterTab == 'active') { + sectionTitle = t.client_view_orders.tabs.active; + dotColor = UiColors.textWarning; + } else if (state.filterTab == 'completed') { + sectionTitle = t.client_view_orders.tabs.completed; + dotColor = + UiColors.primary; // Reverting to primary blue for consistency + } + + return Scaffold( + backgroundColor: UiColors.white, + body: Stack( + children: [ + // Background Gradient + Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [UiColors.bgSecondary, UiColors.white], + stops: [0.0, 0.3], + ), + ), + ), + + SafeArea( + child: Column( + children: [ + // Header + Filter + Calendar (Sticky behavior) + _buildHeader( + context: context, + state: state, + calendarDays: calendarDays, + ), + + // Content List + Expanded( + child: filteredOrders.isEmpty + ? _buildEmptyState(context: context, state: state) + : ListView( + padding: const EdgeInsets.fromLTRB( + UiConstants.space5, + UiConstants.space4, + UiConstants.space5, + 100, + ), + children: [ + if (filteredOrders.isNotEmpty) + Padding( + padding: const EdgeInsets.only( + bottom: UiConstants.space3, + ), + child: Row( + children: [ + Container( + width: 8, + height: 8, + decoration: BoxDecoration( + color: dotColor, + shape: BoxShape.circle, + ), + ), + const SizedBox( + width: UiConstants.space2, + ), + Text( + sectionTitle.toUpperCase(), + style: UiTypography.titleUppercase2m + .copyWith( + color: UiColors.textPrimary, + ), + ), + const SizedBox( + width: UiConstants.space1, + ), + Text( + '(${filteredOrders.length})', + style: UiTypography.footnote1r + .copyWith( + color: UiColors.textSecondary, + ), + ), + ], + ), + ), + ...filteredOrders.map( + (OrderItem order) => Padding( + padding: const EdgeInsets.only( + bottom: UiConstants.space3, + ), + child: ViewOrderCard(order: order), + ), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ); + }, + ); + } + + /// Builds the sticky header section. + Widget _buildHeader({ + required BuildContext context, + required ViewOrdersState state, + required List calendarDays, + }) { + return ClipRect( + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + decoration: const BoxDecoration( + color: Color(0xCCFFFFFF), // White with 0.8 alpha + border: Border( + bottom: BorderSide(color: UiColors.separatorSecondary), + ), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // Top Bar + Padding( + padding: const EdgeInsets.fromLTRB( + UiConstants.space5, + UiConstants.space5, + UiConstants.space5, + UiConstants.space3, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + t.client_view_orders.title, + style: UiTypography.headline3m.copyWith( + color: UiColors.textPrimary, + fontWeight: FontWeight.bold, + ), + ), + UiButton.primary( + text: t.client_view_orders.post_button, + leadingIcon: UiIcons.add, + onPressed: () => Modular.to.navigateToCreateOrder(), + size: UiButtonSize.small, + style: ElevatedButton.styleFrom( + minimumSize: const Size(0, 48), + maximumSize: const Size(0, 48), + ), + ), + ], + ), + ), + + // Filter Tabs + Padding( + padding: const EdgeInsets.only(bottom: UiConstants.space3), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _buildFilterTab( + context, + label: t.client_view_orders.tabs.up_next, + isSelected: state.filterTab == 'all', + tabId: 'all', + ), + const SizedBox(width: UiConstants.space6), + _buildFilterTab( + context, + label: t.client_view_orders.tabs.active, + isSelected: state.filterTab == 'active', + tabId: 'active', + count: state.activeCount + state.upNextCount, + ), + const SizedBox(width: UiConstants.space6), + _buildFilterTab( + context, + label: t.client_view_orders.tabs.completed, + isSelected: state.filterTab == 'completed', + tabId: 'completed', + count: state.completedCount, + ), + ], + ), + ), + + // Calendar Header controls + Padding( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space5, + vertical: UiConstants.space2, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + IconButton( + icon: const Icon( + UiIcons.chevronLeft, + size: 20, + color: UiColors.iconSecondary, + ), + onPressed: () => BlocProvider.of( + context, + ).updateWeekOffset(-1), + padding: EdgeInsets.zero, + constraints: const BoxConstraints(), + splashRadius: 20, + ), + Text( + DateFormat('MMMM yyyy').format(calendarDays.first), + style: UiTypography.body2m.copyWith( + color: UiColors.textSecondary, + ), + ), + IconButton( + icon: const Icon( + UiIcons.chevronRight, + size: 20, + color: UiColors.iconSecondary, + ), + onPressed: () => BlocProvider.of( + context, + ).updateWeekOffset(1), + padding: EdgeInsets.zero, + constraints: const BoxConstraints(), + splashRadius: 20, + ), + ], + ), + ), + + // Calendar Grid + SizedBox( + height: 72, + child: ListView.separated( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space5, + ), + scrollDirection: Axis.horizontal, + itemCount: 7, + separatorBuilder: (BuildContext context, int index) => + const SizedBox(width: UiConstants.space2), + itemBuilder: (BuildContext context, int index) { + final DateTime date = calendarDays[index]; + final bool isSelected = + state.selectedDate != null && + date.year == state.selectedDate!.year && + date.month == state.selectedDate!.month && + date.day == state.selectedDate!.day; + + // Check if this date has any shifts + final String dateStr = DateFormat( + 'yyyy-MM-dd', + ).format(date); + final bool hasShifts = state.orders.any( + (OrderItem s) => s.date == dateStr, + ); + + return GestureDetector( + onTap: () => BlocProvider.of( + context, + ).selectDate(date), + child: AnimatedContainer( + duration: const Duration(milliseconds: 200), + width: 48, + decoration: BoxDecoration( + color: isSelected ? UiColors.primary : UiColors.white, + borderRadius: BorderRadius.circular(16), + border: Border.all( + color: isSelected + ? UiColors.primary + : UiColors.separatorPrimary, + ), + boxShadow: isSelected + ? [ + BoxShadow( + color: UiColors.primary.withValues( + alpha: 0.25, + ), + blurRadius: 12, + offset: const Offset(0, 4), + ), + ] + : null, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + DateFormat('dd').format(date), + style: UiTypography.title2b.copyWith( + fontSize: 18, + color: isSelected + ? UiColors.white + : UiColors.textPrimary, + ), + ), + Text( + DateFormat('E').format(date), + style: UiTypography.footnote2m.copyWith( + color: isSelected + ? UiColors.white.withValues(alpha: 0.8) + : UiColors.textSecondary, + ), + ), + if (hasShifts) ...[ + const SizedBox(height: UiConstants.space1), + Container( + width: 6, + height: 6, + decoration: BoxDecoration( + color: isSelected + ? UiColors.white + : UiColors.primary, + shape: BoxShape.circle, + ), + ), + ], + ], + ), + ), + ); + }, + ), + ), + const SizedBox(height: UiConstants.space4), + ], + ), + ), + ), + ); + } + + /// Builds a single filter tab. + Widget _buildFilterTab( + BuildContext context, { + required String label, + required bool isSelected, + required String tabId, + int? count, + }) { + String text = label; + if (count != null) { + text = '$label ($count)'; + } + + return GestureDetector( + onTap: () => + BlocProvider.of(context).selectFilterTab(tabId), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.only(bottom: UiConstants.space2), + child: Text( + text, + style: UiTypography.body2m.copyWith( + color: isSelected ? UiColors.primary : UiColors.textSecondary, + fontWeight: FontWeight.w600, + ), + ), + ), + AnimatedContainer( + duration: const Duration(milliseconds: 200), + height: 2, + width: isSelected ? 40 : 0, + decoration: BoxDecoration( + color: UiColors.primary, + borderRadius: BorderRadius.circular(2), + ), + ), + if (!isSelected) const SizedBox(height: 2), + ], + ), + ); + } + + /// Builds the empty state view. + Widget _buildEmptyState({ + required BuildContext context, + required ViewOrdersState state, + }) { + final String dateStr = state.selectedDate != null + ? _formatDateHeader(state.selectedDate!) + : 'this date'; + + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon(UiIcons.calendar, size: 48, color: UiColors.iconInactive), + const SizedBox(height: UiConstants.space3), + Text( + t.client_view_orders.no_orders(date: dateStr), + style: UiTypography.body2r.copyWith(color: UiColors.textSecondary), + ), + const SizedBox(height: UiConstants.space4), + UiButton.primary( + text: t.client_view_orders.post_order, + leadingIcon: UiIcons.add, + onPressed: () => Modular.to.navigateToCreateOrder(), + ), + ], + ), + ); + } + + static String _formatDateHeader(DateTime date) { + final DateTime now = DateTime.now(); + final DateTime today = DateTime(now.year, now.month, now.day); + final DateTime tomorrow = today.add(const Duration(days: 1)); + final DateTime checkDate = DateTime(date.year, date.month, date.day); + + if (checkDate == today) return 'Today'; + if (checkDate == tomorrow) return 'Tomorrow'; + return DateFormat('EEE, MMM d').format(date); + } +} diff --git a/apps/mobile/packages/features/client/view_orders/lib/src/presentation/widgets/view_order_card.dart b/apps/mobile/packages/features/client/view_orders/lib/src/presentation/widgets/view_order_card.dart new file mode 100644 index 00000000..a5eee120 --- /dev/null +++ b/apps/mobile/packages/features/client/view_orders/lib/src/presentation/widgets/view_order_card.dart @@ -0,0 +1,1919 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:firebase_auth/firebase_auth.dart' as firebase; +import 'package:firebase_data_connect/firebase_data_connect.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:krow_data_connect/krow_data_connect.dart' as dc; +import 'package:krow_domain/krow_domain.dart'; + +/// A rich card displaying details of a client order/shift. +/// +/// This widget complies with the KROW Design System by using +/// tokens from `package:design_system`. +class ViewOrderCard extends StatefulWidget { + /// Creates a [ViewOrderCard] for the given [order]. + const ViewOrderCard({required this.order, super.key}); + + /// The order item to display. + final OrderItem order; + + @override + State createState() => _ViewOrderCardState(); +} + +class _ViewOrderCardState extends State { + bool _expanded = true; + + void _openEditSheet({required OrderItem order}) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (BuildContext context) => _OrderEditSheet(order: order), + ); + } + + /// Returns the semantic color for the given status. + Color _getStatusColor({required String status}) { + switch (status) { + case 'OPEN': + return UiColors.primary; + case 'FILLED': + case 'CONFIRMED': + return UiColors.textSuccess; + case 'IN_PROGRESS': + return UiColors.textWarning; + case 'COMPLETED': + return UiColors.primary; + case 'CANCELED': + return UiColors.destructive; + default: + return UiColors.textSecondary; + } + } + + /// Returns the localized label for the given status. + String _getStatusLabel({required String status}) { + switch (status) { + case 'OPEN': + return t.client_view_orders.card.open; + case 'FILLED': + return t.client_view_orders.card.filled; + case 'CONFIRMED': + return t.client_view_orders.card.confirmed; + case 'IN_PROGRESS': + return t.client_view_orders.card.in_progress; + case 'COMPLETED': + return t.client_view_orders.card.completed; + case 'CANCELED': + return t.client_view_orders.card.cancelled; + default: + return status.toUpperCase(); + } + } + + /// Formats the date string for display. + String _formatDate({required String dateStr}) { + try { + final DateTime date = DateTime.parse(dateStr); + final DateTime now = DateTime.now(); + final DateTime today = DateTime(now.year, now.month, now.day); + final DateTime tomorrow = today.add(const Duration(days: 1)); + final DateTime checkDate = DateTime(date.year, date.month, date.day); + + if (checkDate == today) return 'Today'; + if (checkDate == tomorrow) return 'Tomorrow'; + return DateFormat('EEE, MMM d').format(date); + } catch (_) { + return dateStr; + } + } + + /// Formats the time string for display. + String _formatTime({required String timeStr}) { + if (timeStr.isEmpty) return ''; + try { + final List parts = timeStr.split(':'); + int hour = int.parse(parts[0]); + final int minute = int.parse(parts[1]); + final String ampm = hour >= 12 ? 'PM' : 'AM'; + hour = hour % 12; + if (hour == 0) hour = 12; + return '$hour:${minute.toString().padLeft(2, '0')} $ampm'; + } catch (_) { + return timeStr; + } + } + + @override + Widget build(BuildContext context) { + final OrderItem order = widget.order; + final Color statusColor = _getStatusColor(status: order.status); + final String statusLabel = _getStatusLabel(status: order.status); + final int coveragePercent = order.workersNeeded > 0 + ? ((order.filled / order.workersNeeded) * 100).round() + : 0; + + final double hours = order.hours; + final double cost = order.totalValue; + + return Container( + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: UiColors.black.withValues(alpha: 0.04), + blurRadius: 8, + offset: const Offset(0, 2), + ), + ], + ), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(UiConstants.space5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Header Row + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Status Badge + Container( + padding: const EdgeInsets.symmetric( + horizontal: 8, + vertical: 2, + ), + decoration: BoxDecoration( + color: statusColor.withValues(alpha: 0.1), + borderRadius: BorderRadius.circular(4), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: 6, + height: 6, + decoration: BoxDecoration( + color: statusColor, + shape: BoxShape.circle, + ), + ), + const SizedBox(width: 6), + Text( + statusLabel.toUpperCase(), + style: UiTypography.footnote2b.copyWith( + color: statusColor, + letterSpacing: 0.5, + ), + ), + ], + ), + ), + const SizedBox(height: UiConstants.space3), + // Title + Text( + order.title, + style: UiTypography.headline4m.textPrimary, + ), + const SizedBox(height: UiConstants.space1), + // Client & Date + Row( + children: [ + Text( + order.clientName, + style: UiTypography.body3r.textSecondary, + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 6, + ), + child: Text( + 'β€’', + style: UiTypography.body3r.textInactive, + ), + ), + Text( + _formatDate(dateStr: order.date), + style: UiTypography.body3m.textSecondary, + ), + ], + ), + const SizedBox(height: UiConstants.space2), + // Address + Row( + children: [ + const Icon( + UiIcons.mapPin, + size: 14, + color: UiColors.iconSecondary, + ), + const SizedBox(width: 4), + Expanded( + child: Text( + order.locationAddress, + style: UiTypography.footnote2r.textSecondary, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ], + ), + ), + const SizedBox(width: UiConstants.space3), + // Actions + Row( + children: [ + _buildHeaderIconButton( + icon: UiIcons.edit, + color: UiColors.primary, + bgColor: UiColors.primary.withValues(alpha: 0.08), + onTap: () => _openEditSheet(order: order), + ), + const SizedBox(width: UiConstants.space2), + _buildHeaderIconButton( + icon: _expanded + ? UiIcons.chevronUp + : UiIcons.chevronDown, + color: UiColors.iconSecondary, + bgColor: UiColors.bgSecondary, + onTap: () => setState(() => _expanded = !_expanded), + ), + ], + ), + ], + ), + + const SizedBox(height: UiConstants.space4), + const Divider(height: 1, color: UiColors.border), + const SizedBox(height: UiConstants.space4), + + // Stats Row + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + _buildStatItem( + icon: UiIcons.dollar, + value: '\$${cost.round()}', + label: 'Total', + ), + _buildStatDivider(), + _buildStatItem( + icon: UiIcons.clock, + value: hours.toStringAsFixed(1), + label: 'Hrs', + ), + _buildStatDivider(), + _buildStatItem( + icon: UiIcons.users, + value: + '${order.filled > 0 ? order.filled : order.workersNeeded}', + label: 'Workers', + ), + ], + ), + + const SizedBox(height: UiConstants.space5), + + // Times Section + Row( + children: [ + Expanded( + child: _buildTimeDisplay( + label: 'Clock In', + time: _formatTime(timeStr: order.startTime), + ), + ), + const SizedBox(width: UiConstants.space3), + Expanded( + child: _buildTimeDisplay( + label: 'Clock Out', + time: _formatTime(timeStr: order.endTime), + ), + ), + ], + ), + + const SizedBox(height: UiConstants.space4), + + // Coverage Section + if (order.status != 'completed') ...[ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + const Icon( + UiIcons.success, + size: 16, + color: UiColors.textSuccess, + ), + const SizedBox(width: 8), + Text( + '${order.filled}/${order.workersNeeded} Workers Filled', + style: UiTypography.body2m.textPrimary, + ), + ], + ), + Text( + '$coveragePercent%', + style: UiTypography.body2b.copyWith( + color: UiColors.primary, + ), + ), + ], + ), + const SizedBox(height: 10), + ClipRRect( + borderRadius: BorderRadius.circular(100), + child: LinearProgressIndicator( + value: coveragePercent / 100, + backgroundColor: UiColors.bgSecondary, + valueColor: const AlwaysStoppedAnimation( + UiColors.primary, + ), + minHeight: 8, + ), + ), + + // Avatar Stack Preview (if not expanded) + if (!_expanded && order.confirmedApps.isNotEmpty) ...[ + const SizedBox(height: UiConstants.space4), + Row( + children: [ + _buildAvatarStack(order.confirmedApps), + if (order.confirmedApps.length > 3) + Padding( + padding: const EdgeInsets.only(left: 12), + child: Text( + '+${order.confirmedApps.length - 3} more', + style: UiTypography.footnote2r.textSecondary, + ), + ), + ], + ), + ], + ], + ], + ), + ), + + // Assigned Workers (Expanded section) + if (_expanded && order.confirmedApps.isNotEmpty) ...[ + Container( + decoration: const BoxDecoration( + color: UiColors.bgSecondary, + border: Border(top: BorderSide(color: UiColors.border)), + borderRadius: BorderRadius.vertical( + bottom: Radius.circular(12), + ), + ), + padding: const EdgeInsets.all(UiConstants.space5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'CONFIRMED WORKERS', + style: UiTypography.footnote2b.textSecondary, + ), + GestureDetector( + onTap: () {}, + child: Text( + 'Message All', + style: UiTypography.footnote2b.copyWith( + color: UiColors.primary, + ), + ), + ), + ], + ), + const SizedBox(height: UiConstants.space4), + ...order.confirmedApps + .take(5) + .map((Map app) => _buildWorkerRow(app)), + if (order.confirmedApps.length > 5) + Padding( + padding: const EdgeInsets.only(top: 8), + child: Center( + child: TextButton( + onPressed: () {}, + child: Text( + 'Show ${order.confirmedApps.length - 5} more workers', + style: UiTypography.body2m.copyWith( + color: UiColors.primary, + ), + ), + ), + ), + ), + ], + ), + ), + ], + ], + ), + ); + } + + Widget _buildStatDivider() { + return Container(width: 1, height: 24, color: UiColors.border); + } + + Widget _buildTimeDisplay({required String label, required String time}) { + return Container( + padding: const EdgeInsets.all(UiConstants.space3), + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: UiConstants.radiusMd, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label.toUpperCase(), + style: UiTypography.titleUppercase4m.textSecondary, + ), + const SizedBox(height: 4), + Text(time, style: UiTypography.body1b.textPrimary), + ], + ), + ); + } + + /// Builds a stacked avatar UI for a list of applications. + Widget _buildAvatarStack(List> apps) { + const double size = 32.0; + const double overlap = 22.0; + final int count = apps.length > 3 ? 3 : apps.length; + + return SizedBox( + height: size, + width: size + (count - 1) * overlap, + child: Stack( + children: [ + for (int i = 0; i < count; i++) + Positioned( + left: i * overlap, + child: Container( + width: size, + height: size, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(color: UiColors.white, width: 2), + color: UiColors.primary.withValues(alpha: 0.1), + ), + child: Center( + child: Text( + (apps[i]['worker_name'] as String)[0], + style: UiTypography.footnote2b.copyWith( + color: UiColors.primary, + ), + ), + ), + ), + ), + ], + ), + ); + } + + /// Builds a detailed row for a worker. + Widget _buildWorkerRow(Map app) { + return Container( + margin: const EdgeInsets.only(bottom: 12), + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusMd, + border: Border.all(color: UiColors.border), + ), + child: Row( + children: [ + CircleAvatar( + radius: 20, + backgroundColor: UiColors.primary.withValues(alpha: 0.1), + child: Text( + (app['worker_name'] as String)[0], + style: UiTypography.body1b.copyWith(color: UiColors.primary), + ), + ), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + app['worker_name'] as String, + style: UiTypography.body2m.textPrimary, + ), + const SizedBox(height: 2), + Row( + children: [ + const Icon(UiIcons.star, size: 10, color: UiColors.accent), + const SizedBox(width: 2), + Text('4.8', style: UiTypography.footnote2r.textSecondary), + if (app['check_in_time'] != null) ...[ + const SizedBox(width: 8), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 4, + vertical: 1, + ), + decoration: BoxDecoration( + color: UiColors.textSuccess.withValues(alpha: 0.1), + borderRadius: BorderRadius.circular(4), + ), + child: Text( + 'Checked In', + style: UiTypography.titleUppercase4m.copyWith( + color: UiColors.textSuccess, + ), + ), + ), + ], + ], + ), + ], + ), + ), + _buildActionIconButton(icon: UiIcons.phone, onTap: () {}), + const SizedBox(width: 8), + _buildActionIconButton(icon: UiIcons.messageCircle, onTap: () {}), + ], + ), + ); + } + + /// Specialized action button for worker rows. + Widget _buildActionIconButton({ + required IconData icon, + required VoidCallback onTap, + }) { + return GestureDetector( + onTap: onTap, + child: Container( + width: 36, + height: 36, + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: BorderRadius.circular(8), + ), + child: Icon(icon, size: 16, color: UiColors.primary), + ), + ); + } + + /// Builds a small icon button used in row headers. + Widget _buildHeaderIconButton({ + required IconData icon, + required Color color, + required Color bgColor, + required VoidCallback onTap, + }) { + return GestureDetector( + onTap: onTap, + child: Container( + padding: const EdgeInsets.all(10), + decoration: BoxDecoration( + color: bgColor, + borderRadius: UiConstants.radiusSm, + ), + child: Icon(icon, size: 16, color: color), + ), + ); + } + + /// Builds a single stat item (e.g., Cost, Hours, Workers). + Widget _buildStatItem({ + required IconData icon, + required String value, + required String label, + }) { + return Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(icon, size: 14, color: UiColors.iconSecondary), + const SizedBox(width: 6), + Text(value, style: UiTypography.body1b.textPrimary), + ], + ), + const SizedBox(height: 2), + Text( + label.toUpperCase(), + style: UiTypography.titleUppercase4m.textInactive, + ), + ], + ); + } +} + +class _RoleOption { + const _RoleOption({ + required this.id, + required this.name, + required this.costPerHour, + }); + + final String id; + final String name; + final double costPerHour; +} + +class _ShiftRoleKey { + const _ShiftRoleKey({required this.shiftId, required this.roleId}); + + final String shiftId; + final String roleId; +} + +/// A sophisticated bottom sheet for editing an existing order, +/// following the Unified Order Flow prototype and matching OneTimeOrderView. +class _OrderEditSheet extends StatefulWidget { + const _OrderEditSheet({required this.order}); + + final OrderItem order; + + @override + State<_OrderEditSheet> createState() => _OrderEditSheetState(); +} + +class _OrderEditSheetState extends State<_OrderEditSheet> { + bool _showReview = false; + bool _isLoading = false; + + late TextEditingController _dateController; + late TextEditingController _globalLocationController; + + late List> _positions; + + final dc.ExampleConnector _dataConnect = dc.ExampleConnector.instance; + final firebase.FirebaseAuth _firebaseAuth = firebase.FirebaseAuth.instance; + + List _vendors = const []; + Vendor? _selectedVendor; + List<_RoleOption> _roles = const <_RoleOption>[]; + + String? _shiftId; + List<_ShiftRoleKey> _originalShiftRoles = const <_ShiftRoleKey>[]; + + @override + void initState() { + super.initState(); + _dateController = TextEditingController(text: widget.order.date); + _globalLocationController = TextEditingController( + text: widget.order.locationAddress, + ); + + _positions = >[ + { + 'shiftId': null, + 'roleId': '', + 'roleName': '', + 'originalRoleId': null, + 'count': widget.order.workersNeeded, + 'start_time': widget.order.startTime, + 'end_time': widget.order.endTime, + 'lunch_break': 'NO_BREAK', + 'location': null, + }, + ]; + + _loadOrderDetails(); + } + + @override + void dispose() { + _dateController.dispose(); + _globalLocationController.dispose(); + super.dispose(); + } + + Future _loadOrderDetails() async { + final String? businessId = + dc.ClientSessionStore.instance.session?.business?.id; + if (businessId == null || businessId.isEmpty) { + await _firebaseAuth.signOut(); + return; + } + + if (widget.order.orderId.isEmpty) { + return; + } + + try { + final QueryResult< + dc.ListShiftRolesByBusinessAndOrderData, + dc.ListShiftRolesByBusinessAndOrderVariables> result = await _dataConnect + .listShiftRolesByBusinessAndOrder( + businessId: businessId, + orderId: widget.order.orderId, + ) + .execute(); + + final List shiftRoles = + result.data.shiftRoles; + if (shiftRoles.isEmpty) { + return; + } + + final dc.ListShiftRolesByBusinessAndOrderShiftRolesShift firstShift = + shiftRoles.first.shift; + final DateTime? orderDate = firstShift.order.date?.toDateTime(); + final String dateText = orderDate == null + ? widget.order.date + : DateFormat('yyyy-MM-dd').format(orderDate); + final String location = firstShift.order.location ?? + firstShift.locationAddress ?? + firstShift.location ?? + widget.order.locationAddress; + + _dateController.text = dateText; + _globalLocationController.text = location; + _shiftId = shiftRoles.first.shiftId; + + final List> positions = + shiftRoles.map((dc.ListShiftRolesByBusinessAndOrderShiftRoles role) { + return { + 'shiftId': role.shiftId, + 'roleId': role.roleId, + 'roleName': role.role.name, + 'originalRoleId': role.roleId, + 'count': role.count, + 'start_time': _formatTimeForField(role.startTime), + 'end_time': _formatTimeForField(role.endTime), + 'lunch_break': _breakValueFromDuration(role.breakType), + 'location': null, + }; + }).toList(); + + if (positions.isEmpty) { + positions.add(_emptyPosition()); + } + + final List<_ShiftRoleKey> originalShiftRoles = + shiftRoles + .map( + (dc.ListShiftRolesByBusinessAndOrderShiftRoles role) => + _ShiftRoleKey(shiftId: role.shiftId, roleId: role.roleId), + ) + .toList(); + + await _loadVendorsAndSelect(firstShift.order.vendorId); + + if (mounted) { + setState(() { + _positions = positions; + _originalShiftRoles = originalShiftRoles; + }); + } + } catch (_) { + // Keep current state on failure. + } + } + + Future _loadVendorsAndSelect(String? selectedVendorId) async { + try { + final QueryResult result = + await _dataConnect.listVendors().execute(); + final List vendors = result.data.vendors + .map( + (dc.ListVendorsVendors vendor) => Vendor( + id: vendor.id, + name: vendor.companyName, + rates: const {}, + ), + ) + .toList(); + + Vendor? selectedVendor; + if (selectedVendorId != null && selectedVendorId.isNotEmpty) { + for (final Vendor vendor in vendors) { + if (vendor.id == selectedVendorId) { + selectedVendor = vendor; + break; + } + } + } + selectedVendor ??= vendors.isNotEmpty ? vendors.first : null; + + if (mounted) { + setState(() { + _vendors = vendors; + _selectedVendor = selectedVendor; + }); + } + + if (selectedVendor != null) { + await _loadRolesForVendor(selectedVendor.id); + } + } catch (_) { + if (mounted) { + setState(() { + _vendors = const []; + _selectedVendor = null; + _roles = const <_RoleOption>[]; + }); + } + } + } + + Future _loadRolesForVendor(String vendorId) async { + try { + final QueryResult + result = await _dataConnect + .listRolesByVendorId(vendorId: vendorId) + .execute(); + final List<_RoleOption> roles = result.data.roles + .map( + (dc.ListRolesByVendorIdRoles role) => _RoleOption( + id: role.id, + name: role.name, + costPerHour: role.costPerHour, + ), + ) + .toList(); + if (mounted) { + setState(() => _roles = roles); + } + } catch (_) { + if (mounted) { + setState(() => _roles = const <_RoleOption>[]); + } + } + } + + Map _emptyPosition() { + return { + 'shiftId': _shiftId, + 'roleId': '', + 'roleName': '', + 'originalRoleId': null, + 'count': 1, + 'start_time': '09:00', + 'end_time': '17:00', + 'lunch_break': 'NO_BREAK', + 'location': null, + }; + } + + String _formatTimeForField(Timestamp? value) { + if (value == null) return ''; + try { + return DateFormat('HH:mm').format(value.toDateTime()); + } catch (_) { + return ''; + } + } + + String _breakValueFromDuration(dc.EnumValue? breakType) { + final dc.BreakDuration? value = + breakType is dc.Known ? breakType.value : null; + switch (value) { + case dc.BreakDuration.MIN_15: + return 'MIN_15'; + case dc.BreakDuration.MIN_30: + return 'MIN_30'; + case dc.BreakDuration.NO_BREAK: + case null: + return 'NO_BREAK'; + } + } + + dc.BreakDuration _breakDurationFromValue(String value) { + switch (value) { + case 'MIN_15': + return dc.BreakDuration.MIN_15; + case 'MIN_30': + return dc.BreakDuration.MIN_30; + default: + return dc.BreakDuration.NO_BREAK; + } + } + + _RoleOption? _roleById(String roleId) { + for (final _RoleOption role in _roles) { + if (role.id == roleId) { + return role; + } + } + return null; + } + + double _rateForRole(String roleId) { + return _roleById(roleId)?.costPerHour ?? 0; + } + + DateTime _parseDate(String value) { + try { + return DateFormat('yyyy-MM-dd').parse(value); + } catch (_) { + return DateTime.now(); + } + } + + DateTime _parseTime(DateTime date, String time) { + if (time.trim().isEmpty) { + throw Exception('Shift time is missing.'); + } + + DateTime parsed; + try { + parsed = DateFormat.Hm().parse(time); + } catch (_) { + parsed = DateFormat.jm().parse(time); + } + + return DateTime( + date.year, + date.month, + date.day, + parsed.hour, + parsed.minute, + ); + } + + Timestamp _toTimestamp(DateTime date) { + final int millis = date.millisecondsSinceEpoch; + final int seconds = millis ~/ 1000; + final int nanos = (millis % 1000) * 1000000; + return Timestamp(nanos, seconds); + } + + double _calculateTotalCost() { + double total = 0; + for (final Map pos in _positions) { + final String roleId = pos['roleId']?.toString() ?? ''; + if (roleId.isEmpty) { + continue; + } + final DateTime date = _parseDate(_dateController.text); + final DateTime start = _parseTime(date, pos['start_time'].toString()); + final DateTime end = _parseTime(date, pos['end_time'].toString()); + final DateTime normalizedEnd = + end.isBefore(start) ? end.add(const Duration(days: 1)) : end; + final double hours = normalizedEnd.difference(start).inMinutes / 60.0; + final double rate = _rateForRole(roleId); + final int count = pos['count'] as int; + total += rate * hours * count; + } + return total; + } + + Future _saveOrderChanges() async { + if (_shiftId == null || _shiftId!.isEmpty) { + return; + } + + final String? businessId = + dc.ClientSessionStore.instance.session?.business?.id; + if (businessId == null || businessId.isEmpty) { + await _firebaseAuth.signOut(); + return; + } + + final DateTime orderDate = _parseDate(_dateController.text); + final String location = _globalLocationController.text; + + int totalWorkers = 0; + double shiftCost = 0; + + final List<_ShiftRoleKey> remainingOriginal = + List<_ShiftRoleKey>.from(_originalShiftRoles); + + for (final Map pos in _positions) { + final String roleId = pos['roleId']?.toString() ?? ''; + if (roleId.isEmpty) { + continue; + } + + final String shiftId = pos['shiftId']?.toString() ?? _shiftId!; + final int count = pos['count'] as int; + final DateTime start = _parseTime(orderDate, pos['start_time'].toString()); + final DateTime end = _parseTime(orderDate, pos['end_time'].toString()); + final DateTime normalizedEnd = + end.isBefore(start) ? end.add(const Duration(days: 1)) : end; + final double hours = normalizedEnd.difference(start).inMinutes / 60.0; + final double rate = _rateForRole(roleId); + final double totalValue = rate * hours * count; + final String lunchBreak = pos['lunch_break'] as String; + + totalWorkers += count; + shiftCost += totalValue; + + final String? originalRoleId = pos['originalRoleId']?.toString(); + remainingOriginal.removeWhere( + (_ShiftRoleKey key) => + key.shiftId == shiftId && key.roleId == originalRoleId, + ); + + if (originalRoleId != null && originalRoleId.isNotEmpty) { + if (originalRoleId != roleId) { + await _dataConnect + .deleteShiftRole(shiftId: shiftId, roleId: originalRoleId) + .execute(); + await _dataConnect + .createShiftRole( + shiftId: shiftId, + roleId: roleId, + count: count, + ) + .startTime(_toTimestamp(start)) + .endTime(_toTimestamp(normalizedEnd)) + .hours(hours) + .breakType(_breakDurationFromValue(lunchBreak)) + .totalValue(totalValue) + .execute(); + } else { + await _dataConnect + .updateShiftRole(shiftId: shiftId, roleId: roleId) + .count(count) + .startTime(_toTimestamp(start)) + .endTime(_toTimestamp(normalizedEnd)) + .hours(hours) + .breakType(_breakDurationFromValue(lunchBreak)) + .totalValue(totalValue) + .execute(); + } + } else { + await _dataConnect + .createShiftRole( + shiftId: shiftId, + roleId: roleId, + count: count, + ) + .startTime(_toTimestamp(start)) + .endTime(_toTimestamp(normalizedEnd)) + .hours(hours) + .breakType(_breakDurationFromValue(lunchBreak)) + .totalValue(totalValue) + .execute(); + } + } + + for (final _ShiftRoleKey key in remainingOriginal) { + await _dataConnect + .deleteShiftRole(shiftId: key.shiftId, roleId: key.roleId) + .execute(); + } + + await _dataConnect + .updateOrder(id: widget.order.orderId) + .vendorId(_selectedVendor?.id) + .location(location) + .date(_toTimestamp(orderDate)) + .execute(); + + await _dataConnect + .updateShift(id: _shiftId!) + .title('shift 1 ${DateFormat('yyyy-MM-dd').format(orderDate)}') + .date(_toTimestamp(orderDate)) + .location(location) + .locationAddress(location) + .workersNeeded(totalWorkers) + .cost(shiftCost) + .durationDays(1) + .execute(); + } + + void _addPosition() { + setState(() { + _positions.add(_emptyPosition()); + }); + } + + void _removePosition(int index) { + if (_positions.length > 1) { + setState(() => _positions.removeAt(index)); + } + } + + void _updatePosition(int index, String key, dynamic value) { + setState(() => _positions[index][key] = value); + } + + @override + Widget build(BuildContext context) { + if (_isLoading && _showReview) { + return _buildSuccessView(); + } + + return _showReview ? _buildReviewView() : _buildFormView(); + } + + Widget _buildFormView() { + return Container( + height: MediaQuery.of(context).size.height * 0.95, + decoration: const BoxDecoration( + color: UiColors.bgPrimary, + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: Column( + children: [ + _buildHeader(), + Expanded( + child: ListView( + padding: const EdgeInsets.all(UiConstants.space5), + children: [ + Text( + 'Edit Your Order', + style: UiTypography.headline3m.textPrimary, + ), + const SizedBox(height: UiConstants.space4), + + _buildSectionHeader('VENDOR'), + Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space3, + ), + height: 48, + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusMd, + border: Border.all(color: UiColors.border), + ), + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: _selectedVendor, + icon: const Icon( + UiIcons.chevronDown, + size: 18, + color: UiColors.iconSecondary, + ), + onChanged: (Vendor? vendor) { + if (vendor != null) { + setState(() => _selectedVendor = vendor); + _loadRolesForVendor(vendor.id); + } + }, + items: _vendors.map((Vendor vendor) { + return DropdownMenuItem( + value: vendor, + child: Text( + vendor.name, + style: UiTypography.body2m.textPrimary, + ), + ); + }).toList(), + ), + ), + ), + const SizedBox(height: UiConstants.space4), + + _buildSectionHeader('DATE'), + UiTextField( + controller: _dateController, + hintText: 'mm/dd/yyyy', + prefixIcon: UiIcons.calendar, + readOnly: true, + onTap: () {}, + ), + const SizedBox(height: UiConstants.space4), + + _buildSectionHeader('LOCATION'), + UiTextField( + controller: _globalLocationController, + hintText: 'Business address', + prefixIcon: UiIcons.mapPin, + ), + const SizedBox(height: UiConstants.space6), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'POSITIONS', + style: UiTypography.headline4m.textPrimary, + ), + TextButton( + onPressed: _addPosition, + style: TextButton.styleFrom( + padding: EdgeInsets.zero, + minimumSize: Size.zero, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + ), + child: const Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(UiIcons.add, size: 16, color: UiColors.primary), + SizedBox(width: UiConstants.space2), + Text( + 'Add Position', + style: TextStyle( + color: UiColors.primary, + fontSize: 14, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ), + ], + ), + const SizedBox(height: UiConstants.space3), + + ..._positions.asMap().entries.map(( + MapEntry> entry, + ) { + return _buildPositionCard(entry.key, entry.value); + }), + + const SizedBox(height: 40), + ], + ), + ), + _buildBottomAction( + label: 'Review ${_positions.length} Positions', + onPressed: () => setState(() => _showReview = true), + ), + ], + ), + ); + } + + Widget _buildHeader() { + return Container( + padding: const EdgeInsets.fromLTRB(20, 24, 20, 20), + decoration: const BoxDecoration( + color: UiColors.primary, + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: Row( + children: [ + GestureDetector( + onTap: () => Navigator.pop(context), + child: Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: UiColors.white.withValues(alpha: 0.2), + borderRadius: UiConstants.radiusMd, + ), + child: const Icon( + UiIcons.chevronLeft, + color: UiColors.white, + size: 24, + ), + ), + ), + const SizedBox(width: UiConstants.space3), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'One-Time Order', + style: UiTypography.headline3m.copyWith(color: UiColors.white), + ), + Text( + 'Refine your staffing needs', + style: UiTypography.footnote2r.copyWith( + color: UiColors.white.withValues(alpha: 0.8), + ), + ), + ], + ), + ], + ), + ); + } + + Widget _buildSectionHeader(String title) { + return Padding( + padding: const EdgeInsets.only(bottom: 8), + child: Text(title, style: UiTypography.footnote2r.textSecondary), + ); + } + + Widget _buildPositionCard(int index, Map pos) { + return Container( + margin: const EdgeInsets.only(bottom: UiConstants.space3), + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'POSITION #${index + 1}', + style: UiTypography.footnote1m.textSecondary, + ), + if (_positions.length > 1) + GestureDetector( + onTap: () => _removePosition(index), + child: Text( + 'Remove', + style: UiTypography.footnote1m.copyWith( + color: UiColors.destructive, + ), + ), + ), + ], + ), + const SizedBox(height: UiConstants.space3), + + _buildDropdownField( + hint: 'Select role', + value: pos['roleId'], + items: [ + ..._roles.map((_RoleOption role) => role.id), + if (pos['roleId'] != null && + pos['roleId'].toString().isNotEmpty && + !_roles.any( + (_RoleOption role) => role.id == pos['roleId'].toString(), + )) + pos['roleId'].toString(), + ], + itemBuilder: (dynamic roleId) { + final _RoleOption? role = _roleById(roleId.toString()); + if (role == null) { + final String fallback = pos['roleName']?.toString() ?? ''; + return fallback.isEmpty ? roleId.toString() : fallback; + } + return '${role.name} - \$${role.costPerHour.toStringAsFixed(0)}/hr'; + }, + onChanged: (dynamic val) { + final String roleId = val?.toString() ?? ''; + final _RoleOption? role = _roleById(roleId); + setState(() { + _positions[index]['roleId'] = roleId; + _positions[index]['roleName'] = role?.name ?? ''; + }); + }, + ), + + const SizedBox(height: UiConstants.space3), + + Row( + children: [ + Expanded( + child: _buildInlineTimeInput( + label: 'Start', + value: pos['start_time'], + onTap: () {}, + ), + ), + const SizedBox(width: UiConstants.space2), + Expanded( + child: _buildInlineTimeInput( + label: 'End', + value: pos['end_time'], + onTap: () {}, + ), + ), + const SizedBox(width: UiConstants.space2), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Workers', + style: UiTypography.footnote2r.textSecondary, + ), + const SizedBox(height: UiConstants.space1), + Container( + height: 40, + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: UiConstants.radiusSm, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + if ((pos['count'] as int) > 1) { + _updatePosition( + index, + 'count', + (pos['count'] as int) - 1, + ); + } + }, + child: const Icon(UiIcons.minus, size: 12), + ), + Text( + '${pos['count']}', + style: UiTypography.body2b.textPrimary, + ), + GestureDetector( + onTap: () => _updatePosition( + index, + 'count', + (pos['count'] as int) + 1, + ), + child: const Icon(UiIcons.add, size: 12), + ), + ], + ), + ), + ], + ), + ), + ], + ), + const SizedBox(height: UiConstants.space4), + + if (pos['location'] == null) + GestureDetector( + onTap: () => _updatePosition(index, 'location', ''), + child: Row( + children: [ + const Icon(UiIcons.mapPin, size: 14, color: UiColors.primary), + const SizedBox(width: UiConstants.space1), + Text( + 'Use different location for this position', + style: UiTypography.footnote1m.copyWith( + color: UiColors.primary, + ), + ), + ], + ), + ) + else + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + const Icon( + UiIcons.mapPin, + size: 14, + color: UiColors.iconSecondary, + ), + const SizedBox(width: UiConstants.space1), + Text( + 'Different Location', + style: UiTypography.footnote1m.textSecondary, + ), + ], + ), + GestureDetector( + onTap: () => _updatePosition(index, 'location', null), + child: const Icon( + UiIcons.close, + size: 14, + color: UiColors.destructive, + ), + ), + ], + ), + const SizedBox(height: UiConstants.space2), + UiTextField( + controller: TextEditingController(text: pos['location']), + hintText: 'Enter different address', + onChanged: (String val) => + _updatePosition(index, 'location', val), + ), + ], + ), + + const SizedBox(height: UiConstants.space3), + + _buildSectionHeader('LUNCH BREAK'), + _buildDropdownField( + hint: 'No break', + value: pos['lunch_break'], + items: ['NO_BREAK', 'MIN_15', 'MIN_30'], + itemBuilder: (dynamic val) { + switch (val.toString()) { + case 'MIN_15': + return '15 min'; + case 'MIN_30': + return '30 min'; + default: + return 'No break'; + } + }, + onChanged: (dynamic val) => + _updatePosition(index, 'lunch_break', val), + ), + ], + ), + ); + } + + Widget _buildDropdownField({ + required String hint, + required dynamic value, + required List items, + String Function(dynamic)? itemBuilder, + required ValueChanged onChanged, + }) { + return Container( + height: 44, + padding: const EdgeInsets.symmetric(horizontal: UiConstants.space3), + decoration: BoxDecoration( + borderRadius: UiConstants.radiusMd, + border: Border.all(color: UiColors.border), + ), + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + hint: Text(hint, style: UiTypography.body2r.textPlaceholder), + value: value == '' || value == null ? null : value, + icon: const Icon( + UiIcons.chevronDown, + size: 18, + color: UiColors.iconSecondary, + ), + onChanged: onChanged, + items: items.toSet().map((dynamic item) { + String label = item.toString(); + if (itemBuilder != null) label = itemBuilder(item); + return DropdownMenuItem( + value: item, + child: Text(label, style: UiTypography.body2r.textPrimary), + ); + }).toList(), + ), + ), + ); + } + + Widget _buildInlineTimeInput({ + required String label, + required String value, + required VoidCallback onTap, + }) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(label, style: UiTypography.footnote2r.textSecondary), + const SizedBox(height: UiConstants.space1), + GestureDetector( + onTap: onTap, + child: Container( + height: 40, + padding: const EdgeInsets.symmetric(horizontal: UiConstants.space3), + decoration: BoxDecoration( + borderRadius: UiConstants.radiusSm, + border: Border.all(color: UiColors.border), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + value.isEmpty ? '--:--' : value, + style: UiTypography.body2r.textPrimary, + ), + const Icon( + UiIcons.clock, + size: 14, + color: UiColors.iconSecondary, + ), + ], + ), + ), + ), + ], + ); + } + + Widget _buildBottomAction({ + required String label, + required VoidCallback onPressed, + }) { + return Container( + padding: EdgeInsets.fromLTRB( + UiConstants.space5, + UiConstants.space5, + UiConstants.space5, + MediaQuery.of(context).padding.bottom + UiConstants.space5, + ), + decoration: const BoxDecoration( + color: UiColors.white, + border: Border(top: BorderSide(color: UiColors.border)), + ), + child: SizedBox( + width: double.infinity, + child: UiButton.primary( + text: label, + onPressed: onPressed, + size: UiButtonSize.large, + ), + ), + ); + } + + Widget _buildReviewView() { + final int totalWorkers = _positions.fold( + 0, + (int sum, Map p) => sum + (p['count'] as int), + ); + final double totalCost = _calculateTotalCost(); + + return Container( + height: MediaQuery.of(context).size.height * 0.95, + decoration: const BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: Column( + children: [ + _buildHeader(), + Expanded( + child: SingleChildScrollView( + padding: const EdgeInsets.all(20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Summary Card + Container( + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + UiColors.primary.withValues(alpha: 0.05), + UiColors.primary.withValues(alpha: 0.1), + ], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + borderRadius: BorderRadius.circular(16), + border: Border.all( + color: UiColors.primary.withValues(alpha: 0.2), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + _buildSummaryItem('${_positions.length}', 'Positions'), + _buildSummaryItem('$totalWorkers', 'Workers'), + _buildSummaryItem( + '\$${totalCost.round()}', + 'Est. Cost', + ), + ], + ), + ), + const SizedBox(height: 20), + + // Order Details + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: UiColors.separatorPrimary), + ), + child: Column( + children: [ + Row( + children: [ + const Icon( + UiIcons.calendar, + size: 16, + color: UiColors.primary, + ), + const SizedBox(width: 8), + Text( + _dateController.text, + style: UiTypography.body2m.textPrimary, + ), + ], + ), + if (_globalLocationController + .text + .isNotEmpty) ...[ + const SizedBox(height: 12), + Row( + children: [ + const Icon( + UiIcons.mapPin, + size: 16, + color: UiColors.primary, + ), + const SizedBox(width: 8), + Expanded( + child: Text( + _globalLocationController.text, + style: UiTypography.body2r.textPrimary, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ], + ], + ), + ), + const SizedBox(height: 24), + + Text( + 'Positions Breakdown', + style: UiTypography.body2b.textPrimary, + ), + const SizedBox(height: 12), + + ..._positions.map( + (Map pos) => _buildReviewPositionCard(pos), + ), + + const SizedBox(height: 40), + ], + ), + ), + ), + + // Footer + Container( + padding: EdgeInsets.fromLTRB( + UiConstants.space5, + UiConstants.space5, + UiConstants.space5, + MediaQuery.of(context).padding.bottom + UiConstants.space5, + ), + decoration: const BoxDecoration( + color: UiColors.white, + border: Border(top: BorderSide(color: UiColors.border)), + ), + child: Row( + children: [ + Expanded( + child: UiButton.secondary( + text: 'Edit', + onPressed: () => setState(() => _showReview = false), + ), + ), + const SizedBox(width: 12), + Expanded( + child: UiButton.primary( + text: 'Confirm & Save', + onPressed: () async { + setState(() => _isLoading = true); + await _saveOrderChanges(); + if (mounted) Navigator.pop(context); + }, + ), + ), + ], + ), + ), + ], + ), + ); + } + + Widget _buildSummaryItem(String value, String label) { + return Column( + children: [ + Text( + value, + style: UiTypography.headline2m.copyWith( + color: UiColors.primary, + fontWeight: FontWeight.bold, + ), + ), + Text( + label.toUpperCase(), + style: UiTypography.titleUppercase4m.copyWith( + color: UiColors.textSecondary, + ), + ), + ], + ); + } + + Widget _buildReviewPositionCard(Map pos) { + final String roleId = pos['roleId']?.toString() ?? ''; + final _RoleOption? role = _roleById(roleId); + final double rate = role?.costPerHour ?? 0; + + return Container( + margin: const EdgeInsets.only(bottom: 12), + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: UiColors.separatorSecondary), + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + (role?.name ?? pos['roleName']?.toString() ?? '').isEmpty + ? 'Position' + : (role?.name ?? pos['roleName']?.toString() ?? ''), + style: UiTypography.body2b.textPrimary, + ), + Text( + '${pos['count']} worker${pos['count'] > 1 ? 's' : ''}', + style: UiTypography.footnote2r.textSecondary, + ), + ], + ), + Text( + '\$${rate.round()}/hr', + style: UiTypography.body2b.copyWith(color: UiColors.primary), + ), + ], + ), + const SizedBox(height: 12), + Row( + children: [ + const Icon( + UiIcons.clock, + size: 14, + color: UiColors.iconSecondary, + ), + const SizedBox(width: 6), + Text( + '${pos['start_time']} - ${pos['end_time']}', + style: UiTypography.footnote2r.textSecondary, + ), + ], + ), + ], + ), + ); + } + + Widget _buildSuccessView() { + return Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.95, + decoration: const BoxDecoration( + color: UiColors.primary, + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 80, + height: 80, + decoration: const BoxDecoration( + color: UiColors.accent, + shape: BoxShape.circle, + ), + child: const Center( + child: Icon( + UiIcons.success, + size: 40, + color: UiColors.foreground, + ), + ), + ), + const SizedBox(height: 24), + Text( + 'Order Updated!', + style: UiTypography.headline1m.copyWith(color: UiColors.white), + ), + const SizedBox(height: 12), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 40), + child: Text( + 'Your shift has been updated successfully.', + textAlign: TextAlign.center, + style: UiTypography.body1r.copyWith( + color: UiColors.white.withValues(alpha: 0.7), + ), + ), + ), + const SizedBox(height: 40), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 40), + child: UiButton.secondary( + text: 'Back to Orders', + fullWidth: true, + style: OutlinedButton.styleFrom( + backgroundColor: UiColors.white, + foregroundColor: UiColors.primary, + ), + onPressed: () => Navigator.pop(context), + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/client/view_orders/lib/src/view_orders_module.dart b/apps/mobile/packages/features/client/view_orders/lib/src/view_orders_module.dart new file mode 100644 index 00000000..3579ca65 --- /dev/null +++ b/apps/mobile/packages/features/client/view_orders/lib/src/view_orders_module.dart @@ -0,0 +1,48 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:firebase_auth/firebase_auth.dart' as firebase; + +import 'data/repositories/view_orders_repository_impl.dart'; +import 'domain/repositories/i_view_orders_repository.dart'; +import 'domain/usecases/get_accepted_applications_for_day_use_case.dart'; +import 'domain/usecases/get_orders_use_case.dart'; +import 'presentation/blocs/view_orders_cubit.dart'; +import 'presentation/pages/view_orders_page.dart'; + +/// Module for the View Orders feature. +/// +/// This module sets up Dependency Injection for repositories, use cases, +/// and BLoCs, and defines the feature's navigation routes. +class ViewOrdersModule extends Module { + @override + List get imports => [DataConnectModule()]; + + @override + void binds(Injector i) { + // Repositories + i.addLazySingleton( + () => ViewOrdersRepositoryImpl( + firebaseAuth: firebase.FirebaseAuth.instance, + dataConnect: ExampleConnector.instance, + ), + ); + + // UseCases + i.addLazySingleton(GetOrdersUseCase.new); + i.addLazySingleton(GetAcceptedApplicationsForDayUseCase.new); + + // BLoCs + i.addSingleton( + () => ViewOrdersCubit( + getOrdersUseCase: i.get(), + getAcceptedAppsUseCase: i.get(), + ), + ); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (BuildContext context) => const ViewOrdersPage()); + } +} diff --git a/apps/mobile/packages/features/client/view_orders/lib/view_orders.dart b/apps/mobile/packages/features/client/view_orders/lib/view_orders.dart new file mode 100644 index 00000000..87ab3a35 --- /dev/null +++ b/apps/mobile/packages/features/client/view_orders/lib/view_orders.dart @@ -0,0 +1,3 @@ +library; + +export 'src/view_orders_module.dart'; diff --git a/apps/mobile/packages/features/client/view_orders/pubspec.yaml b/apps/mobile/packages/features/client/view_orders/pubspec.yaml new file mode 100644 index 00000000..dbf26cc2 --- /dev/null +++ b/apps/mobile/packages/features/client/view_orders/pubspec.yaml @@ -0,0 +1,41 @@ +name: view_orders +description: Client View Orders feature package +publish_to: 'none' +version: 1.0.0+1 +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + +dependencies: + flutter: + sdk: flutter + + # Architecture + flutter_modular: ^6.3.2 + flutter_bloc: ^8.1.3 + equatable: ^2.0.5 + + # Shared packages + design_system: + path: ../../../design_system + core_localization: + path: ../../../core_localization + krow_domain: + path: ../../../domain + krow_core: + path: ../../../core + # UI + lucide_icons: ^0.257.0 + intl: ^0.20.1 + url_launcher: ^6.3.1 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^6.0.0 + bloc_test: ^9.1.5 + mocktail: ^1.0.1 + +flutter: + uses-material-design: true diff --git a/apps/mobile/packages/features/staff/authentication/feature_manifest.md b/apps/mobile/packages/features/staff/authentication/feature_manifest.md new file mode 100644 index 00000000..cd530b30 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/feature_manifest.md @@ -0,0 +1,33 @@ +# Feature Manifest: Staff Authentication + +## Overview +**Feature Name:** Staff Authentication & Onboarding +**Package Path:** `packages/features/staff/authentication` + +## Responsibilities +* Handle user sign-up and log-in via Phone Auth. +* Verify OTP codes. +* Manage the Onboarding Wizard for new staff. +* Persist onboarding progress. + +## Architecture +* **Domain**: + * `AuthRepositoryInterface` + * `SignInWithPhoneUseCase` + * `VerifyOtpUseCase` +* **Data**: + * `AuthRepositoryImpl` (uses `AuthRepositoryMock` from `krow_data_connect`) +* **Presentation**: + * `AuthBloc`: Manages auth state (phone, otp, user status). + * `OnboardingBloc`: Manages wizard steps. + * Pages: `GetStartedPage`, `PhoneVerificationPage`, `ProfileSetupPage`. + +## Dependencies +* `krow_domain`: User entities. +* `krow_data_connect`: Auth mocks. +* `design_system`: UI components. + +## Routes +* `/`: Get Started (Welcome) +* `/phone-verification`: OTP Entry +* `/profile-setup`: Onboarding Wizard diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/data/repositories_impl/auth_repository_impl.dart b/apps/mobile/packages/features/staff/authentication/lib/src/data/repositories_impl/auth_repository_impl.dart new file mode 100644 index 00000000..97a9bc24 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/data/repositories_impl/auth_repository_impl.dart @@ -0,0 +1,118 @@ +import 'dart:async'; + +import 'package:firebase_auth/firebase_auth.dart'; +import 'package:firebase_data_connect/firebase_data_connect.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:krow_domain/krow_domain.dart' as domain; + +import '../../domain/repositories/auth_repository_interface.dart'; + +/// Implementation of [AuthRepositoryInterface]. +class AuthRepositoryImpl implements AuthRepositoryInterface { + AuthRepositoryImpl({ + required this.firebaseAuth, + required this.dataConnect, + }); + + final FirebaseAuth firebaseAuth; + final ExampleConnector dataConnect; + + @override + Stream get currentUser => firebaseAuth + .authStateChanges() + .map((User? firebaseUser) { + if (firebaseUser == null) { + return null; + } + + return domain.User( + id: firebaseUser.uid, + email: firebaseUser.email ?? '', + phone: firebaseUser.phoneNumber, + role: 'staff', + ); + }); + + /// Signs in with a phone number and returns a verification ID. + @override + Future signInWithPhone({required String phoneNumber}) async { + final Completer completer = Completer(); + + await firebaseAuth.verifyPhoneNumber( + phoneNumber: phoneNumber, + verificationCompleted: (_) { + }, + verificationFailed: (FirebaseAuthException e) { + if (!completer.isCompleted) { + completer.completeError( + Exception(e.message ?? 'Phone verification failed.'), + ); + } + }, + codeSent: (String verificationId, _) { + if (!completer.isCompleted) { + completer.complete(verificationId); + } + }, + codeAutoRetrievalTimeout: (String verificationId) { + if (!completer.isCompleted) { + completer.complete(verificationId); + } + }, + ); + + return completer.future; + } + + /// Signs out the current user. + @override + Future signOut() { + return firebaseAuth.signOut(); + } + + /// Verifies an OTP code and returns the authenticated user. + @override + Future verifyOtp({ + required String verificationId, + required String smsCode, + }) async { + final PhoneAuthCredential credential = PhoneAuthProvider.credential( + verificationId: verificationId, + smsCode: smsCode, + ); + final UserCredential userCredential = await firebaseAuth.signInWithCredential(credential); + final User? firebaseUser = userCredential.user; + if (firebaseUser == null) { + throw Exception('Phone verification failed, no Firebase user received.'); + } + + final QueryResult response = await dataConnect.getUserById( + id: firebaseUser.uid, + ).execute(); + final GetUserByIdUser? user = response.data.user; + if (user == null) { + await firebaseAuth.signOut(); + throw Exception('Authenticated user profile not found in database.'); + } + if (user.userRole != 'STAFF') { + await firebaseAuth.signOut(); + throw Exception('User is not authorized for this app.'); + } + + final String email = user.email ?? ''; + if (email.isEmpty) { + await firebaseAuth.signOut(); + throw Exception('User email is missing in profile data.'); + } + + //TO-DO: validate if user has staff account, else logout, throw message and login + //TO-DO: create(registration) user and staff account + //TO-DO: save user data locally + return domain.User( + id: user.id, + email: email, + phone: firebaseUser.phoneNumber, + role: user.role.stringValue, + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/domain/arguments/sign_in_with_phone_arguments.dart b/apps/mobile/packages/features/staff/authentication/lib/src/domain/arguments/sign_in_with_phone_arguments.dart new file mode 100644 index 00000000..2811adb5 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/domain/arguments/sign_in_with_phone_arguments.dart @@ -0,0 +1,17 @@ +import 'package:krow_core/core.dart'; + +/// Represents the arguments required for the [SignInWithPhoneUseCase]. +/// +/// Encapsulates the phone number needed to initiate the sign-in process. +class SignInWithPhoneArguments extends UseCaseArgument { + /// The phone number to be used for sign-in or sign-up. + final String phoneNumber; + + /// Creates a [SignInWithPhoneArguments] instance. + /// + /// The [phoneNumber] is required. + const SignInWithPhoneArguments({required this.phoneNumber}); + + @override + List get props => [phoneNumber]; +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/domain/arguments/verify_otp_arguments.dart b/apps/mobile/packages/features/staff/authentication/lib/src/domain/arguments/verify_otp_arguments.dart new file mode 100644 index 00000000..74053d31 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/domain/arguments/verify_otp_arguments.dart @@ -0,0 +1,24 @@ +import 'package:krow_core/core.dart'; + +/// Represents the arguments required for the [VerifyOtpUseCase]. +/// +/// Encapsulates the verification ID and the SMS code needed to verify +/// a phone number during the authentication process. +class VerifyOtpArguments extends UseCaseArgument { + /// The unique identifier received after requesting an OTP. + final String verificationId; + + /// The one-time password (OTP) sent to the user's phone. + final String smsCode; + + /// Creates a [VerifyOtpArguments] instance. + /// + /// Both [verificationId] and [smsCode] are required. + const VerifyOtpArguments({ + required this.verificationId, + required this.smsCode, + }); + + @override + List get props => [verificationId, smsCode]; +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/domain/repositories/auth_repository_interface.dart b/apps/mobile/packages/features/staff/authentication/lib/src/domain/repositories/auth_repository_interface.dart new file mode 100644 index 00000000..19cfcb2e --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/domain/repositories/auth_repository_interface.dart @@ -0,0 +1,19 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Interface for authentication repository. +abstract interface class AuthRepositoryInterface { + Stream get currentUser; + + /// Signs in with a phone number and returns a verification ID. + Future signInWithPhone({required String phoneNumber}); + + /// Verifies the OTP code and returns the authenticated user. + Future verifyOtp({ + required String verificationId, + required String smsCode, + }); + + /// Signs out the current user. + Future signOut(); + // Future getStaffProfile(String userId); // Could be moved to a separate repository if needed, but useful here for routing logic. +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/domain/ui_entities/auth_mode.dart b/apps/mobile/packages/features/staff/authentication/lib/src/domain/ui_entities/auth_mode.dart new file mode 100644 index 00000000..574d51e9 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/domain/ui_entities/auth_mode.dart @@ -0,0 +1,8 @@ +/// Represents the authentication mode: either signing up or logging in. +enum AuthMode { + /// User is creating a new account. + signup, + + /// User is logging into an existing account. + login, +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/domain/usecases/sign_in_with_phone_usecase.dart b/apps/mobile/packages/features/staff/authentication/lib/src/domain/usecases/sign_in_with_phone_usecase.dart new file mode 100644 index 00000000..061fd08e --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/domain/usecases/sign_in_with_phone_usecase.dart @@ -0,0 +1,21 @@ +import 'package:krow_core/core.dart'; +import '../arguments/sign_in_with_phone_arguments.dart'; +import '../repositories/auth_repository_interface.dart'; + +/// Use case for signing in with a phone number. +/// +/// This use case delegates the sign-in logic to the [AuthRepositoryInterface]. +class SignInWithPhoneUseCase + implements UseCase { + final AuthRepositoryInterface _repository; + + /// Creates a [SignInWithPhoneUseCase]. + /// + /// Requires an [AuthRepositoryInterface] to interact with the authentication data source. + SignInWithPhoneUseCase(this._repository); + + @override + Future call(SignInWithPhoneArguments arguments) { + return _repository.signInWithPhone(phoneNumber: arguments.phoneNumber); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/domain/usecases/verify_otp_usecase.dart b/apps/mobile/packages/features/staff/authentication/lib/src/domain/usecases/verify_otp_usecase.dart new file mode 100644 index 00000000..5e11a01d --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/domain/usecases/verify_otp_usecase.dart @@ -0,0 +1,24 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../arguments/verify_otp_arguments.dart'; +import '../repositories/auth_repository_interface.dart'; + +/// Use case for verifying an OTP code. +/// +/// This use case delegates the OTP verification logic to the [AuthRepositoryInterface]. +class VerifyOtpUseCase implements UseCase { + final AuthRepositoryInterface _repository; + + /// Creates a [VerifyOtpUseCase]. + /// + /// Requires an [AuthRepositoryInterface] to interact with the authentication data source. + VerifyOtpUseCase(this._repository); + + @override + Future call(VerifyOtpArguments arguments) { + return _repository.verifyOtp( + verificationId: arguments.verificationId, + smsCode: arguments.smsCode, + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/auth_bloc.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/auth_bloc.dart new file mode 100644 index 00000000..5044b5ce --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/auth_bloc.dart @@ -0,0 +1,111 @@ +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:bloc/bloc.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/arguments/sign_in_with_phone_arguments.dart'; +import '../../domain/arguments/verify_otp_arguments.dart'; +import '../../domain/usecases/sign_in_with_phone_usecase.dart'; +import '../../domain/usecases/verify_otp_usecase.dart'; +import 'auth_event.dart'; +import 'auth_state.dart'; + +/// BLoC responsible for handling authentication logic. +class AuthBloc extends Bloc implements Disposable { + /// The use case for signing in with a phone number. + final SignInWithPhoneUseCase _signInUseCase; + + /// The use case for verifying an OTP. + final VerifyOtpUseCase _verifyOtpUseCase; + + /// Creates an [AuthBloc]. + AuthBloc({ + required SignInWithPhoneUseCase signInUseCase, + required VerifyOtpUseCase verifyOtpUseCase, + }) : _signInUseCase = signInUseCase, + _verifyOtpUseCase = verifyOtpUseCase, + super(const AuthState()) { + on(_onSignInRequested); + on(_onOtpSubmitted); + on(_onErrorCleared); + on(_onOtpUpdated); + on(_onPhoneUpdated); + } + + /// Clears any authentication error from the state. + void _onErrorCleared(AuthErrorCleared event, Emitter emit) { + emit(state.copyWith(status: AuthStatus.codeSent, errorMessage: null)); + } + + /// Updates the internal OTP state without triggering a submission. + void _onOtpUpdated(AuthOtpUpdated event, Emitter emit) { + emit( + state.copyWith( + otp: event.otp, + status: AuthStatus.codeSent, + errorMessage: null, + ), + ); + } + + /// Updates the internal phone number state without triggering a submission. + void _onPhoneUpdated(AuthPhoneUpdated event, Emitter emit) { + emit(state.copyWith(phoneNumber: event.phoneNumber, errorMessage: null)); + } + + /// Handles the sign-in request, initiating the phone authentication process. + Future _onSignInRequested( + AuthSignInRequested event, + Emitter emit, + ) async { + emit( + state.copyWith( + status: AuthStatus.loading, + mode: event.mode, + phoneNumber: event.phoneNumber, + ), + ); + try { + final String? verificationId = await _signInUseCase( + SignInWithPhoneArguments( + phoneNumber: event.phoneNumber ?? state.phoneNumber, + ), + ); + emit( + state.copyWith( + status: AuthStatus.codeSent, + verificationId: verificationId, + ), + ); + } catch (e) { + emit( + state.copyWith(status: AuthStatus.error, errorMessage: e.toString()), + ); + } + } + + /// Handles OTP submission and verification. + Future _onOtpSubmitted( + AuthOtpSubmitted event, + Emitter emit, + ) async { + emit(state.copyWith(status: AuthStatus.loading)); + try { + final User? user = await _verifyOtpUseCase( + VerifyOtpArguments( + verificationId: event.verificationId, + smsCode: event.smsCode, + ), + ); + emit(state.copyWith(status: AuthStatus.authenticated, user: user)); + } catch (e) { + emit( + state.copyWith(status: AuthStatus.error, errorMessage: e.toString()), + ); + } + } + + /// Disposes the BLoC resources. + @override + void dispose() { + close(); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/auth_event.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/auth_event.dart new file mode 100644 index 00000000..2b0c3f65 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/auth_event.dart @@ -0,0 +1,65 @@ +import 'package:equatable/equatable.dart'; +import 'package:staff_authentication/src/domain/ui_entities/auth_mode.dart'; + +/// Abstract base class for all authentication events. +abstract class AuthEvent extends Equatable { + const AuthEvent(); + @override + List get props => []; +} + +/// Event for requesting a sign-in with a phone number. +class AuthSignInRequested extends AuthEvent { + /// The phone number provided by the user. + final String? phoneNumber; + + /// The authentication mode (login or signup). + final AuthMode mode; + + const AuthSignInRequested({this.phoneNumber, required this.mode}); + + @override + List get props => [mode]; +} + +/// Event for submitting an OTP (One-Time Password) for verification. +/// +/// This event is dispatched after the user has received an OTP and +/// submits it for verification. +class AuthOtpSubmitted extends AuthEvent { + /// The verification ID received after the phone number submission. + final String verificationId; + + /// The SMS code (OTP) entered by the user. + final String smsCode; + + const AuthOtpSubmitted({required this.verificationId, required this.smsCode}); + + @override + List get props => [verificationId, smsCode]; +} + +/// Event for clearing any authentication error in the state. +class AuthErrorCleared extends AuthEvent {} + +/// Event for updating the current draft OTP in the state. +class AuthOtpUpdated extends AuthEvent { + /// The current draft OTP. + final String otp; + + const AuthOtpUpdated(this.otp); + + @override + List get props => [otp]; +} + +/// Event for updating the current draft phone number in the state. +class AuthPhoneUpdated extends AuthEvent { + /// The current draft phone number. + final String phoneNumber; + + const AuthPhoneUpdated(this.phoneNumber); + + @override + List get props => [phoneNumber]; +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/auth_state.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/auth_state.dart new file mode 100644 index 00000000..edcbfe3a --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/auth_state.dart @@ -0,0 +1,93 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; +import 'package:staff_authentication/src/domain/ui_entities/auth_mode.dart'; + +/// Enum representing the current status of the authentication process. +enum AuthStatus { + /// Initial state, awaiting phone number entry. + initial, + + /// Authentication operation in progress. + loading, + + /// OTP has been sent, awaiting code verification. + codeSent, + + /// User has been successfully authenticated. + authenticated, + + /// An error occurred during the process. + error, +} + +/// A unified state class for the authentication process. +class AuthState extends Equatable { + /// The current status of the authentication flow. + final AuthStatus status; + + /// The ID received from the authentication service, used to verify the OTP. + final String? verificationId; + + /// The authentication mode (login or signup). + final AuthMode mode; + + /// The current draft OTP entered by the user. + final String otp; + + /// The phone number entered by the user. + final String phoneNumber; + + /// A descriptive message for any error that occurred. + final String? errorMessage; + + /// The authenticated user's data (available when status is [AuthStatus.authenticated]). + final User? user; + + const AuthState({ + this.status = AuthStatus.initial, + this.verificationId, + this.mode = AuthMode.login, + this.otp = '', + this.phoneNumber = '', + this.errorMessage, + this.user, + }); + + @override + List get props => [ + status, + verificationId, + mode, + otp, + phoneNumber, + errorMessage, + user, + ]; + + /// Convenient helper to check if the status is [AuthStatus.loading]. + bool get isLoading => status == AuthStatus.loading; + + /// Convenient helper to check if the status is [AuthStatus.error]. + bool get hasError => status == AuthStatus.error; + + /// Copies the state with optional new values. + AuthState copyWith({ + AuthStatus? status, + String? verificationId, + AuthMode? mode, + String? otp, + String? phoneNumber, + String? errorMessage, + User? user, + }) { + return AuthState( + status: status ?? this.status, + verificationId: verificationId ?? this.verificationId, + mode: mode ?? this.mode, + otp: otp ?? this.otp, + phoneNumber: phoneNumber ?? this.phoneNumber, + errorMessage: errorMessage ?? this.errorMessage, + user: user ?? this.user, + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/profile_setup/profile_setup_bloc.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/profile_setup/profile_setup_bloc.dart new file mode 100644 index 00000000..94ff1f20 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/profile_setup/profile_setup_bloc.dart @@ -0,0 +1,100 @@ +import 'package:flutter/foundation.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'profile_setup_event.dart'; +import 'profile_setup_state.dart'; + +export 'profile_setup_event.dart'; +export 'profile_setup_state.dart'; + +/// BLoC responsible for managing the profile setup state and logic. +class ProfileSetupBloc extends Bloc { + /// Creates a [ProfileSetupBloc] with an initial state. + ProfileSetupBloc() : super(const ProfileSetupState()) { + on(_onFullNameChanged); + on(_onBioChanged); + on(_onLocationsChanged); + on(_onDistanceChanged); + on(_onSkillsChanged); + on(_onIndustriesChanged); + on(_onSubmitted); + } + + /// Handles the [ProfileSetupFullNameChanged] event. + void _onFullNameChanged( + ProfileSetupFullNameChanged event, + Emitter emit, + ) { + emit(state.copyWith(fullName: event.fullName)); + } + + /// Handles the [ProfileSetupBioChanged] event. + void _onBioChanged( + ProfileSetupBioChanged event, + Emitter emit, + ) { + emit(state.copyWith(bio: event.bio)); + } + + /// Handles the [ProfileSetupLocationsChanged] event. + void _onLocationsChanged( + ProfileSetupLocationsChanged event, + Emitter emit, + ) { + emit(state.copyWith(preferredLocations: event.locations)); + } + + /// Handles the [ProfileSetupDistanceChanged] event. + void _onDistanceChanged( + ProfileSetupDistanceChanged event, + Emitter emit, + ) { + emit(state.copyWith(maxDistanceMiles: event.distance)); + } + + /// Handles the [ProfileSetupSkillsChanged] event. + void _onSkillsChanged( + ProfileSetupSkillsChanged event, + Emitter emit, + ) { + emit(state.copyWith(skills: event.skills)); + } + + /// Handles the [ProfileSetupIndustriesChanged] event. + void _onIndustriesChanged( + ProfileSetupIndustriesChanged event, + Emitter emit, + ) { + emit(state.copyWith(industries: event.industries)); + } + + /// Handles the [ProfileSetupSubmitted] event. + Future _onSubmitted( + ProfileSetupSubmitted event, + Emitter emit, + ) async { + emit(state.copyWith(status: ProfileSetupStatus.loading)); + + try { + // In a real app, we would send this data to a UseCase + debugPrint('Submitting Profile:'); + debugPrint('Name: ${state.fullName}'); + debugPrint('Bio: ${state.bio}'); + debugPrint('Locations: ${state.preferredLocations}'); + debugPrint('Distance: ${state.maxDistanceMiles}'); + debugPrint('Skills: ${state.skills}'); + debugPrint('Industries: ${state.industries}'); + + // Mocking profile creation delay + await Future.delayed(const Duration(milliseconds: 1500)); + + emit(state.copyWith(status: ProfileSetupStatus.success)); + } catch (e) { + emit( + state.copyWith( + status: ProfileSetupStatus.failure, + errorMessage: e.toString(), + ), + ); + } + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/profile_setup/profile_setup_event.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/profile_setup/profile_setup_event.dart new file mode 100644 index 00000000..39fac246 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/profile_setup/profile_setup_event.dart @@ -0,0 +1,87 @@ +import 'package:equatable/equatable.dart'; + +/// Base class for all profile setup events. +abstract class ProfileSetupEvent extends Equatable { + const ProfileSetupEvent(); + + @override + List get props => []; +} + +/// Event triggered when the full name changes. +class ProfileSetupFullNameChanged extends ProfileSetupEvent { + /// The new full name value. + final String fullName; + + /// Creates a [ProfileSetupFullNameChanged] event. + const ProfileSetupFullNameChanged(this.fullName); + + @override + List get props => [fullName]; +} + +/// Event triggered when the bio changes. +class ProfileSetupBioChanged extends ProfileSetupEvent { + /// The new bio value. + final String bio; + + /// Creates a [ProfileSetupBioChanged] event. + const ProfileSetupBioChanged(this.bio); + + @override + List get props => [bio]; +} + +/// Event triggered when the preferred locations change. +class ProfileSetupLocationsChanged extends ProfileSetupEvent { + /// The new list of locations. + final List locations; + + /// Creates a [ProfileSetupLocationsChanged] event. + const ProfileSetupLocationsChanged(this.locations); + + @override + List get props => [locations]; +} + +/// Event triggered when the max distance changes. +class ProfileSetupDistanceChanged extends ProfileSetupEvent { + /// The new max distance value in miles. + final double distance; + + /// Creates a [ProfileSetupDistanceChanged] event. + const ProfileSetupDistanceChanged(this.distance); + + @override + List get props => [distance]; +} + +/// Event triggered when the skills change. +class ProfileSetupSkillsChanged extends ProfileSetupEvent { + /// The new list of selected skills. + final List skills; + + /// Creates a [ProfileSetupSkillsChanged] event. + const ProfileSetupSkillsChanged(this.skills); + + @override + List get props => [skills]; +} + +/// Event triggered when the industries change. +class ProfileSetupIndustriesChanged extends ProfileSetupEvent { + /// The new list of selected industries. + final List industries; + + /// Creates a [ProfileSetupIndustriesChanged] event. + const ProfileSetupIndustriesChanged(this.industries); + + @override + List get props => [industries]; +} + +/// Event triggered when the profile submission is requested. +class ProfileSetupSubmitted extends ProfileSetupEvent { + /// Creates a [ProfileSetupSubmitted] event. + const ProfileSetupSubmitted(); +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/profile_setup/profile_setup_state.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/profile_setup/profile_setup_state.dart new file mode 100644 index 00000000..2406d5c8 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/blocs/profile_setup/profile_setup_state.dart @@ -0,0 +1,78 @@ +import 'package:equatable/equatable.dart'; + +/// Enum defining the status of the profile setup process. +enum ProfileSetupStatus { initial, loading, success, failure } + +/// State for the ProfileSetupBloc. +class ProfileSetupState extends Equatable { + /// The user's full name. + final String fullName; + + /// The user's bio or short description. + final String bio; + + /// List of preferred work locations (e.g., cities, zip codes). + final List preferredLocations; + + /// Maximum distance in miles the user is willing to travel. + final double maxDistanceMiles; + + /// List of skills selected by the user. + final List skills; + + /// List of industries selected by the user. + final List industries; + + /// The current status of the profile setup process. + final ProfileSetupStatus status; + + /// Error message if the status is [ProfileSetupStatus.failure]. + final String? errorMessage; + + /// Creates a [ProfileSetupState] instance. + const ProfileSetupState({ + this.fullName = '', + this.bio = '', + this.preferredLocations = const [], + this.maxDistanceMiles = 25, + this.skills = const [], + this.industries = const [], + this.status = ProfileSetupStatus.initial, + this.errorMessage, + }); + + /// Creates a copy of the current state with updated values. + ProfileSetupState copyWith({ + String? fullName, + String? bio, + List? preferredLocations, + double? maxDistanceMiles, + List? skills, + List? industries, + ProfileSetupStatus? status, + String? errorMessage, + }) { + return ProfileSetupState( + fullName: fullName ?? this.fullName, + bio: bio ?? this.bio, + preferredLocations: preferredLocations ?? this.preferredLocations, + maxDistanceMiles: maxDistanceMiles ?? this.maxDistanceMiles, + skills: skills ?? this.skills, + industries: industries ?? this.industries, + status: status ?? this.status, + errorMessage: errorMessage, + ); + } + + @override + List get props => [ + fullName, + bio, + preferredLocations, + maxDistanceMiles, + skills, + industries, + status, + errorMessage, + ]; +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/navigation/auth_navigator.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/navigation/auth_navigator.dart new file mode 100644 index 00000000..5c201e2c --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/navigation/auth_navigator.dart @@ -0,0 +1,21 @@ +import 'package:flutter_modular/flutter_modular.dart'; +import '../../domain/ui_entities/auth_mode.dart'; + +/// Extension on [IModularNavigator] to provide strongly-typed navigation +/// for the staff authentication feature. +extension AuthNavigator on IModularNavigator { + /// Navigates to the phone verification page. + void pushPhoneVerification(AuthMode mode) { + pushNamed('./phone-verification', arguments: {'mode': mode.name}); + } + + /// Navigates to the profile setup page, replacing the current route. + void pushReplacementProfileSetup() { + pushReplacementNamed('./profile-setup'); + } + + /// Navigates to the worker home (external to this module). + void pushWorkerHome() { + pushNamed('/worker-main/home/'); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/pages/get_started_page.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/pages/get_started_page.dart new file mode 100644 index 00000000..f1ef9619 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/pages/get_started_page.dart @@ -0,0 +1,64 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:staff_authentication/src/domain/ui_entities/auth_mode.dart'; +import '../navigation/auth_navigator.dart'; // Import the extension +import '../widgets/get_started_page/get_started_actions.dart'; +import '../widgets/get_started_page/get_started_background.dart'; +import '../widgets/get_started_page/get_started_header.dart'; + +/// The entry point page for staff authentication. +/// +/// This page provides the user with the initial options to either sign up +/// for a new account or log in to an existing one. It uses a series of +/// sub-widgets to maintain a clean and modular structure. +class GetStartedPage extends StatelessWidget { + /// Creates a [GetStartedPage]. + const GetStartedPage({super.key}); + + /// On sign up pressed callback. + void onSignUpPressed() { + Modular.to.pushPhoneVerification(AuthMode.signup); + } + + /// On login pressed callback. + void onLoginPressed() { + Modular.to.pushPhoneVerification(AuthMode.login); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: SafeArea( + child: Column( + children: [ + // Background + const Expanded(child: GetStartedBackground()), + + // Content Overlay + Padding( + padding: const EdgeInsets.all(24.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // Main text and actions + const GetStartedHeader(), + + const SizedBox(height: 48), + + // Actions + GetStartedActions( + onSignUpPressed: onSignUpPressed, + onLoginPressed: onLoginPressed, + ), + + const SizedBox(height: 32), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/pages/phone_verification_page.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/pages/phone_verification_page.dart new file mode 100644 index 00000000..8fcdc3fc --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/pages/phone_verification_page.dart @@ -0,0 +1,124 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:design_system/design_system.dart'; +import 'package:staff_authentication/src/domain/ui_entities/auth_mode.dart'; +import 'package:staff_authentication/src/presentation/blocs/auth_event.dart'; +import 'package:staff_authentication/src/presentation/blocs/auth_state.dart'; +import 'package:staff_authentication/src/presentation/blocs/auth_bloc.dart'; +import '../widgets/phone_verification_page/phone_input.dart'; +import '../widgets/phone_verification_page/otp_verification.dart'; +import 'package:staff_authentication/staff_authentication.dart'; +import '../navigation/auth_navigator.dart'; // Import the extension + +/// A combined page for phone number entry and OTP verification. +/// +/// This page coordinates the authentication flow by switching between +/// [PhoneInput] and [OtpVerification] based on the current [AuthState]. +class PhoneVerificationPage extends StatelessWidget { + /// The authentication mode (login or signup). + final AuthMode mode; + + /// Creates a [PhoneVerificationPage]. + const PhoneVerificationPage({super.key, required this.mode}); + + /// Handles the request to send a verification code to the provided phone number. + void _onSendCode({ + required BuildContext context, + required String phoneNumber, + }) { + if (phoneNumber.length == 10) { + BlocProvider.of( + context, + ).add(AuthSignInRequested(phoneNumber: '+1$phoneNumber', mode: mode)); + } else { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + t.staff_authentication.phone_verification_page.validation_error, + ), + ), + ); + } + } + + /// Handles the submission of the OTP code. + void _onOtpSubmitted({ + required BuildContext context, + required String otp, + required String verificationId, + }) { + BlocProvider.of( + context, + ).add(AuthOtpSubmitted(verificationId: verificationId, smsCode: otp)); + } + + /// Handles the request to resend the verification code using the phone number in the state. + void _onResend({required BuildContext context}) { + BlocProvider.of(context).add(AuthSignInRequested(mode: mode)); + } + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (BuildContext context) => Modular.get(), + child: Builder( + builder: (BuildContext context) { + return BlocListener( + listener: (BuildContext context, AuthState state) { + if (state.status == AuthStatus.authenticated) { + if (state.mode == AuthMode.signup) { + Modular.to.pushReplacementProfileSetup(); + } else { + Modular.to.pushWorkerHome(); + } + } + }, + child: BlocBuilder( + builder: (BuildContext context, AuthState state) { + // Check if we are in the OTP step + final bool isOtpStep = + state.status == AuthStatus.codeSent || + (state.status == AuthStatus.error && + state.verificationId != null) || + (state.status == AuthStatus.loading && + state.verificationId != null); + + return Scaffold( + appBar: const UiAppBar( + centerTitle: true, + showBackButton: true, + ), + body: SafeArea( + child: isOtpStep + ? OtpVerification( + state: state, + onOtpSubmitted: (String otp) => _onOtpSubmitted( + context: context, + otp: otp, + verificationId: state.verificationId ?? '', + ), + onResend: () => _onResend(context: context), + onContinue: () => _onOtpSubmitted( + context: context, + otp: state.otp, + verificationId: state.verificationId ?? '', + ), + ) + : PhoneInput( + state: state, + onSendCode: () => _onSendCode( + context: context, + phoneNumber: state.phoneNumber, + ), + ), + ), + ); + }, + ), + ); + }, + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/pages/profile_setup_page.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/pages/profile_setup_page.dart new file mode 100644 index 00000000..3a3cc342 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/pages/profile_setup_page.dart @@ -0,0 +1,236 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart' + hide ModularWatchExtension; +import '../blocs/profile_setup/profile_setup_bloc.dart'; +import '../widgets/profile_setup_page/profile_setup_basic_info.dart'; +import '../widgets/profile_setup_page/profile_setup_location.dart'; +import '../widgets/profile_setup_page/profile_setup_experience.dart'; +import '../widgets/profile_setup_page/profile_setup_header.dart'; +import 'package:staff_authentication/staff_authentication.dart'; +import '../navigation/auth_navigator.dart'; // Import the extension + +/// Page for setting up the user profile after authentication. +class ProfileSetupPage extends StatefulWidget { + const ProfileSetupPage({super.key}); + + @override + State createState() => _ProfileSetupPageState(); +} + +class _ProfileSetupPageState extends State { + /// Current step index. + int _currentStep = 0; + + /// List of steps in the profile setup process. + List> get _steps => >[ + { + 'id': 'basic', + 'title': t.staff_authentication.profile_setup_page.steps.basic, + 'icon': UiIcons.user, + }, + { + 'id': 'location', + 'title': t.staff_authentication.profile_setup_page.steps.location, + 'icon': UiIcons.mapPin, + }, + { + 'id': 'experience', + 'title': t.staff_authentication.profile_setup_page.steps.experience, + 'icon': UiIcons.briefcase, + }, + ]; + + /// Handles the "Next" button tap logic. + void _handleNext({ + required BuildContext context, + required ProfileSetupState state, + required int stepsCount, + }) { + if (_currStepValid(state: state)) { + if (_currentStep < stepsCount - 1) { + setState(() => _currentStep++); + } else { + BlocProvider.of( + context, + ).add(const ProfileSetupSubmitted()); + } + } + } + + /// Handles the "Back" button tap logic. + void _handleBack() { + if (_currentStep > 0) { + setState(() => _currentStep--); + } + } + + /// Checks if the current step is valid. + bool _currStepValid({required ProfileSetupState state}) { + switch (_currentStep) { + case 0: + return state.fullName.trim().length >= 2; + case 1: + return state.preferredLocations.isNotEmpty; + case 2: + return state.skills.isNotEmpty; + default: + return true; + } + } + + @override + /// Builds the profile setup page UI. + Widget build(BuildContext context) { + final List> steps = _steps; + + // Calculate progress + final double progress = (_currentStep + 1) / steps.length; + + return BlocProvider( + create: (BuildContext context) => Modular.get(), + child: BlocConsumer( + listener: (BuildContext context, ProfileSetupState state) { + if (state.status == ProfileSetupStatus.success) { + Modular.to.pushWorkerHome(); + } else if (state.status == ProfileSetupStatus.failure) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + state.errorMessage ?? + t.staff_authentication.profile_setup_page.error_occurred, + ), + ), + ); + } + }, + builder: (BuildContext context, ProfileSetupState state) { + final bool isCreatingProfile = state.status == ProfileSetupStatus.loading; + + return Scaffold( + body: SafeArea( + child: Column( + children: [ + // Progress Bar + LinearProgressIndicator(value: progress), + + // Header (Back + Step Count) + ProfileSetupHeader( + currentStep: _currentStep, + totalSteps: steps.length, + onBackTap: _handleBack, + ), + + // Step Indicators + UiStepIndicator( + stepIcons: steps + .map((Map step) => step['icon'] as IconData) + .toList(), + currentStep: _currentStep, + ), + + // Content Area + Expanded( + child: AnimatedSwitcher( + duration: const Duration(milliseconds: 300), + child: SingleChildScrollView( + key: ValueKey(_currentStep), + padding: const EdgeInsets.all(UiConstants.space6), + child: _buildStepContent( + context: context, + state: state, + ), + ), + ), + ), + + // Footer + Container( + padding: const EdgeInsets.all(UiConstants.space6), + decoration: const BoxDecoration( + border: Border( + top: BorderSide(color: UiColors.separatorSecondary), + ), + ), + child: isCreatingProfile + ? ElevatedButton( + onPressed: null, + child: const SizedBox( + width: 24, + height: 24, + child: CircularProgressIndicator(strokeWidth: 2), + ), + ) + : UiButton.primary( + text: _currentStep == steps.length - 1 + ? t + .staff_authentication + .profile_setup_page + .complete_setup_button + : t.common.continue_text, + trailingIcon: _currentStep < steps.length - 1 + ? UiIcons.arrowRight + : null, + onPressed: _currStepValid(state: state) + ? () => _handleNext( + context: context, + state: state, + stepsCount: steps.length, + ) + : null, + ), + ), + ], + ), + ), + ); + }, + ), + ); + } + + /// Builds the content for the current step. + Widget _buildStepContent({ + required BuildContext context, + required ProfileSetupState state, + }) { + switch (_currentStep) { + case 0: + return ProfileSetupBasicInfo( + fullName: state.fullName, + bio: state.bio, + onFullNameChanged: (String val) => BlocProvider.of( + context, + ).add(ProfileSetupFullNameChanged(val)), + onBioChanged: (String val) => BlocProvider.of( + context, + ).add(ProfileSetupBioChanged(val)), + ); + case 1: + return ProfileSetupLocation( + preferredLocations: state.preferredLocations, + maxDistanceMiles: state.maxDistanceMiles, + onLocationsChanged: (List val) => BlocProvider.of( + context, + ).add(ProfileSetupLocationsChanged(val)), + onDistanceChanged: (double val) => BlocProvider.of( + context, + ).add(ProfileSetupDistanceChanged(val)), + ); + case 2: + return ProfileSetupExperience( + skills: state.skills, + industries: state.industries, + onSkillsChanged: (List val) => BlocProvider.of( + context, + ).add(ProfileSetupSkillsChanged(val)), + onIndustriesChanged: (List val) => BlocProvider.of( + context, + ).add(ProfileSetupIndustriesChanged(val)), + ); + default: + return const SizedBox.shrink(); + } + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/common/auth_trouble_link.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/common/auth_trouble_link.dart new file mode 100644 index 00000000..95b6dff8 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/common/auth_trouble_link.dart @@ -0,0 +1,27 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:staff_authentication/staff_authentication.dart'; + +/// A common widget that displays a "Having trouble? Contact Support" link. +class AuthTroubleLink extends StatelessWidget { + /// Creates an [AuthTroubleLink]. + const AuthTroubleLink({super.key}); + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: UiConstants.space1, + children: [ + Text( + t.staff_authentication.common.trouble_question, + style: UiTypography.body2r.textSecondary, + ), + Text( + t.staff_authentication.common.contact_support, + style: UiTypography.body2b.textLink, + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/common/section_title_subtitle.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/common/section_title_subtitle.dart new file mode 100644 index 00000000..0b1beba1 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/common/section_title_subtitle.dart @@ -0,0 +1,32 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A widget for displaying a section title and subtitle +class SectionTitleSubtitle extends StatelessWidget { + /// The title of the section + final String title; + + /// The subtitle of the section + final String subtitle; + + const SectionTitleSubtitle({ + super.key, + required this.title, + required this.subtitle, + }); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: UiConstants.space1, + children: [ + // Title + Text(title, style: UiTypography.headline1m), + + // Subtitle + Text(subtitle, style: UiTypography.body2r.textSecondary), + ], + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/get_started_page/get_started_actions.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/get_started_page/get_started_actions.dart new file mode 100644 index 00000000..8d1ac228 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/get_started_page/get_started_actions.dart @@ -0,0 +1,42 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:staff_authentication/staff_authentication.dart'; + +/// A widget that displays the primary action buttons (Sign Up and Log In) +/// for the Get Started page. +class GetStartedActions extends StatelessWidget { + /// Void callback for when the Sign Up button is pressed. + final VoidCallback onSignUpPressed; + + /// Void callback for when the Log In button is pressed. + final VoidCallback onLoginPressed; + + /// Creates a [GetStartedActions]. + const GetStartedActions({ + super.key, + required this.onSignUpPressed, + required this.onLoginPressed, + }); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // Sign Up Button + UiButton.primary( + text: t.staff_authentication.get_started_page.sign_up_button, + onPressed: onSignUpPressed, + ), + + const SizedBox(height: 12), + + // Log In Button + UiButton.secondary( + text: t.staff_authentication.get_started_page.log_in_button, + onPressed: onLoginPressed, + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/get_started_page/get_started_background.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/get_started_page/get_started_background.dart new file mode 100644 index 00000000..18cc18c6 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/get_started_page/get_started_background.dart @@ -0,0 +1,51 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A widget that displays the background for the Get Started page. +class GetStartedBackground extends StatelessWidget { + /// Creates a [GetStartedBackground]. + const GetStartedBackground({super.key}); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(top: 24.0), + child: Column( + children: [ + // Logo + Image.asset(UiImageAssets.logoBlue, height: 40), + + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // Hero Image + Container( + width: 288, + height: 288, + margin: const EdgeInsets.only(bottom: 32), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: UiColors.secondaryForeground.withAlpha( + 64, + ), // 0.5 opacity + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: ClipOval( + child: Image.network( + 'https://images.unsplash.com/photo-1577219491135-ce391730fb2c?w=400&h=400&fit=crop&crop=faces', + fit: BoxFit.cover, + ), + ), + ), + ), + const SizedBox(height: 32), + ], + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/get_started_page/get_started_header.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/get_started_page/get_started_header.dart new file mode 100644 index 00000000..94528237 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/get_started_page/get_started_header.dart @@ -0,0 +1,39 @@ +import 'package:flutter/material.dart'; +import 'package:design_system/design_system.dart'; +import 'package:staff_authentication/staff_authentication.dart'; + +/// A widget that displays the welcome text and description on the Get Started page. +class GetStartedHeader extends StatelessWidget { + /// Creates a [GetStartedHeader]. + const GetStartedHeader({super.key}); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + RichText( + textAlign: TextAlign.center, + text: TextSpan( + style: UiTypography.displayM, + children: [ + TextSpan( + text: t.staff_authentication.get_started_page.title_part1, + ), + TextSpan( + text: t.staff_authentication.get_started_page.title_part2, + style: UiTypography.displayMb.textLink, + ), + ], + ), + ), + const SizedBox(height: 16), + Text( + t.staff_authentication.get_started_page.subtitle, + textAlign: TextAlign.center, + style: UiTypography.body1r.textSecondary, + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification.dart new file mode 100644 index 00000000..4df7987e --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification.dart @@ -0,0 +1,65 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:staff_authentication/src/presentation/blocs/auth_state.dart'; +import 'otp_verification/otp_input_field.dart'; +import 'otp_verification/otp_resend_section.dart'; +import 'otp_verification/otp_verification_actions.dart'; +import 'otp_verification/otp_verification_header.dart'; + +/// A widget that displays the OTP verification UI. +class OtpVerification extends StatelessWidget { + /// The current state of the authentication process. + final AuthState state; + + /// Callback for when the OTP is submitted. + final ValueChanged onOtpSubmitted; + + /// Callback for when a new code is requested. + final VoidCallback onResend; + + /// Callback for the "Continue" action. + final VoidCallback onContinue; + + /// Creates an [OtpVerification]. + const OtpVerification({ + super.key, + required this.state, + required this.onOtpSubmitted, + required this.onResend, + required this.onContinue, + }); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Expanded( + child: SingleChildScrollView( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space6, + vertical: UiConstants.space8, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + OtpVerificationHeader(phoneNumber: state.phoneNumber), + const SizedBox(height: UiConstants.space8), + OtpInputField( + error: state.errorMessage ?? '', + onCompleted: onOtpSubmitted, + ), + const SizedBox(height: UiConstants.space6), + OtpResendSection(onResend: onResend, hasError: state.hasError), + ], + ), + ), + ), + OtpVerificationActions( + isLoading: state.isLoading, + canSubmit: state.otp.length == 6, + onContinue: onContinue, + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification/otp_input_field.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification/otp_input_field.dart new file mode 100644 index 00000000..70b11165 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification/otp_input_field.dart @@ -0,0 +1,127 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../../../blocs/auth_event.dart'; +import '../../../blocs/auth_bloc.dart'; + +/// A widget that displays a 6-digit OTP input field. +/// +/// This widget handles its own internal [TextEditingController]s and focus nodes. +/// It dispatches [AuthOtpUpdated] to the [AuthBloc] on every change. +class OtpInputField extends StatefulWidget { + /// Callback for when the OTP code is fully entered (6 digits). + final ValueChanged onCompleted; + + /// The error message to display, if any. + final String error; + + /// Creates an [OtpInputField]. + const OtpInputField({ + super.key, + required this.onCompleted, + required this.error, + }); + + @override + State createState() => _OtpInputFieldState(); +} + +class _OtpInputFieldState extends State { + final List _controllers = List.generate( + 6, + (_) => TextEditingController(), + ); + final List _focusNodes = List.generate(6, (_) => FocusNode()); + + @override + void dispose() { + for (final TextEditingController controller in _controllers) { + controller.dispose(); + } + for (final FocusNode node in _focusNodes) { + node.dispose(); + } + super.dispose(); + } + + /// Helper getter to compute the current OTP code from all controllers. + String get _otpCode => _controllers.map((TextEditingController c) => c.text).join(); + + /// Handles changes to the OTP input fields. + void _onChanged({ + required BuildContext context, + required int index, + required String value, + }) { + if (value.length == 1 && index < 5) { + _focusNodes[index + 1].requestFocus(); + } + + // Notify the Bloc of the change + BlocProvider.of(context).add(AuthOtpUpdated(_otpCode)); + + if (_otpCode.length == 6) { + widget.onCompleted(_otpCode); + } + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: List.generate(6, (int index) { + return SizedBox( + width: 56, + height: 56, + child: TextField( + controller: _controllers[index], + focusNode: _focusNodes[index], + keyboardType: TextInputType.number, + inputFormatters: [FilteringTextInputFormatter.digitsOnly], + textAlign: TextAlign.center, + maxLength: 1, + style: UiTypography.headline3m, + decoration: InputDecoration( + counterText: '', + border: OutlineInputBorder( + borderSide: BorderSide( + color: widget.error.isNotEmpty + ? UiColors.textError + : (_controllers[index].text.isNotEmpty + ? UiColors.primary + : UiColors.border), + width: 2, + ), + ), + enabledBorder: OutlineInputBorder( + borderRadius: UiConstants.radiusMd, + borderSide: BorderSide( + color: widget.error.isNotEmpty + ? UiColors.textError + : (_controllers[index].text.isNotEmpty + ? UiColors.primary + : UiColors.border), + width: 2, + ), + ), + ), + onChanged: (String value) => + _onChanged(context: context, index: index, value: value), + ), + ); + }), + ), + if (widget.error.isNotEmpty) + Padding( + padding: const EdgeInsets.only(top: UiConstants.space4), + child: Center( + child: Text(widget.error, style: UiTypography.body2r.textError), + ), + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification/otp_resend_section.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification/otp_resend_section.dart new file mode 100644 index 00000000..12fadb8c --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification/otp_resend_section.dart @@ -0,0 +1,75 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:staff_authentication/staff_authentication.dart'; + +/// A widget that handles the OTP resend logic and countdown timer. +class OtpResendSection extends StatefulWidget { + /// Callback for when the resend link is pressed. + final VoidCallback onResend; + + /// Whether an error is currently displayed. (Used for layout tweaks in the original code) + final bool hasError; + + /// Creates an [OtpResendSection]. + const OtpResendSection({ + super.key, + required this.onResend, + this.hasError = false, + }); + + @override + State createState() => _OtpResendSectionState(); +} + +class _OtpResendSectionState extends State { + int _countdown = 30; + + @override + void initState() { + super.initState(); + _startCountdown(); + } + + /// Starts the countdown timer. + void _startCountdown() { + Future.delayed(const Duration(seconds: 1), () { + if (mounted && _countdown > 0) { + setState(() => _countdown--); + _startCountdown(); + } + }); + } + + @override + Widget build(BuildContext context) { + return Center( + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: widget.hasError + ? '' + : '${t.staff_authentication.otp_verification.did_not_get_code} ', + style: UiTypography.body2r.textSecondary, + ), + WidgetSpan( + child: GestureDetector( + onTap: _countdown > 0 ? null : widget.onResend, + child: Text( + _countdown > 0 + ? t.staff_authentication.otp_verification.resend_in( + seconds: _countdown.toString(), + ) + : t.staff_authentication.otp_verification.resend_code, + style: (_countdown > 0 + ? UiTypography.body2r.textSecondary + : UiTypography.body2b.textPrimary), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification/otp_verification_actions.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification/otp_verification_actions.dart new file mode 100644 index 00000000..a307b6df --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification/otp_verification_actions.dart @@ -0,0 +1,56 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:staff_authentication/staff_authentication.dart'; +import '../../common/auth_trouble_link.dart'; + +/// A widget that displays the primary action button and trouble link for OTP verification. +class OtpVerificationActions extends StatelessWidget { + /// Whether the verification process is currently loading. + final bool isLoading; + + /// Whether the submit button should be enabled. + final bool canSubmit; + + /// Callback for when the Continue button is pressed. + final VoidCallback? onContinue; + + /// Creates an [OtpVerificationActions]. + const OtpVerificationActions({ + super.key, + required this.isLoading, + required this.canSubmit, + this.onContinue, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space6), + decoration: const BoxDecoration( + border: Border( + top: BorderSide(color: UiColors.separatorSecondary, width: 1), + ), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + isLoading + ? ElevatedButton( + onPressed: null, + child: const SizedBox( + width: 20, + height: 20, + child: CircularProgressIndicator(strokeWidth: 2), + ), + ) + : UiButton.primary( + text: t.common.continue_text, + onPressed: canSubmit ? onContinue : null, + ), + const SizedBox(height: UiConstants.space4), + const AuthTroubleLink(), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification/otp_verification_header.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification/otp_verification_header.dart new file mode 100644 index 00000000..50837e68 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/otp_verification/otp_verification_header.dart @@ -0,0 +1,44 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:staff_authentication/staff_authentication.dart'; + +/// A widget that displays the title and subtitle for the OTP Verification page. +class OtpVerificationHeader extends StatelessWidget { + /// The phone number to which the code was sent. + final String phoneNumber; + + /// Creates an [OtpVerificationHeader]. + const OtpVerificationHeader({super.key, required this.phoneNumber}); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + t.staff_authentication.phone_verification_page.enter_code_title, + style: UiTypography.headline1m, + ), + const SizedBox(height: UiConstants.space2), + Text.rich( + TextSpan( + text: t + .staff_authentication + .phone_verification_page + .code_sent_message, + style: UiTypography.body2r.textSecondary, + children: [ + TextSpan(text: '+1 $phoneNumber', style: UiTypography.body2b), + TextSpan( + text: t + .staff_authentication + .phone_verification_page + .code_sent_instruction, + ), + ], + ), + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/phone_input.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/phone_input.dart new file mode 100644 index 00000000..01be5bf4 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/phone_input.dart @@ -0,0 +1,54 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:staff_authentication/src/presentation/blocs/auth_bloc.dart'; +import 'package:staff_authentication/src/presentation/blocs/auth_event.dart'; +import 'package:staff_authentication/src/presentation/blocs/auth_state.dart'; +import 'phone_input/phone_input_actions.dart'; +import 'phone_input/phone_input_form_field.dart'; +import 'phone_input/phone_input_header.dart'; + +/// A widget that displays the phone number entry UI. +class PhoneInput extends StatelessWidget { + /// The current state of the authentication process. + final AuthState state; + + /// Callback for when the "Send Code" action is triggered. + final VoidCallback onSendCode; + + /// Creates a [PhoneInput]. + const PhoneInput({super.key, required this.state, required this.onSendCode}); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Expanded( + child: SingleChildScrollView( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space6, + vertical: UiConstants.space8, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const PhoneInputHeader(), + const SizedBox(height: UiConstants.space8), + PhoneInputFormField( + initialValue: state.phoneNumber, + error: state.errorMessage ?? '', + onChanged: (String value) { + BlocProvider.of( + context, + ).add(AuthPhoneUpdated(value)); + }, + ), + ], + ), + ), + ), + PhoneInputActions(isLoading: state.isLoading, onSendCode: onSendCode), + ], + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/phone_input/phone_input_actions.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/phone_input/phone_input_actions.dart new file mode 100644 index 00000000..dcbe0d06 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/phone_input/phone_input_actions.dart @@ -0,0 +1,53 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:staff_authentication/src/presentation/widgets/common/auth_trouble_link.dart'; +import 'package:staff_authentication/staff_authentication.dart'; + +/// A widget that displays the primary action button and trouble link for Phone Input. +class PhoneInputActions extends StatelessWidget { + /// Whether the sign-in process is currently loading. + final bool isLoading; + + /// Callback for when the Send Code button is pressed. + final VoidCallback? onSendCode; + + /// Creates a [PhoneInputActions]. + const PhoneInputActions({ + super.key, + required this.isLoading, + this.onSendCode, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space6), + decoration: const BoxDecoration( + border: Border(top: BorderSide(color: UiColors.separatorSecondary)), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + isLoading + ? UiButton.secondary( + onPressed: null, + child: const SizedBox( + width: 20, + height: 20, + child: CircularProgressIndicator(strokeWidth: 2), + ), + ) + : UiButton.primary( + text: t + .staff_authentication + .phone_verification_page + .send_code_button, + onPressed: onSendCode, + ), + const SizedBox(height: UiConstants.space4), + const AuthTroubleLink(), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/phone_input/phone_input_form_field.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/phone_input/phone_input_form_field.dart new file mode 100644 index 00000000..4fa8104f --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/phone_input/phone_input_form_field.dart @@ -0,0 +1,96 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:staff_authentication/staff_authentication.dart'; + +/// A widget that displays the phone number input field with country code. +/// +/// This widget handles its own [TextEditingController] to manage input. +class PhoneInputFormField extends StatefulWidget { + /// The initial value for the phone number. + final String initialValue; + + /// The error message to display, if any. + final String error; + + /// Callback for when the text field value changes. + final ValueChanged onChanged; + + /// Creates a [PhoneInputFormField]. + const PhoneInputFormField({ + super.key, + this.initialValue = '', + required this.error, + required this.onChanged, + }); + + @override + State createState() => _PhoneInputFormFieldState(); +} + +class _PhoneInputFormFieldState extends State { + late final TextEditingController _controller; + + @override + void initState() { + super.initState(); + _controller = TextEditingController(text: widget.initialValue); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + t.staff_authentication.phone_input.label, + style: UiTypography.footnote1m.textSecondary, + ), + const SizedBox(height: UiConstants.space2), + Row( + children: [ + Container( + width: 100, + height: 48, + alignment: Alignment.center, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text('πŸ‡ΊπŸ‡Έ', style: UiTypography.headline2m), + const SizedBox(width: UiConstants.space1), + Text('+1', style: UiTypography.body1m), + ], + ), + ), + const SizedBox(width: UiConstants.space2), + Expanded( + child: TextField( + controller: _controller, + keyboardType: TextInputType.phone, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + LengthLimitingTextInputFormatter(10), + ], + decoration: InputDecoration( + hintText: t.staff_authentication.phone_input.hint, + ), + onChanged: widget.onChanged, + ), + ), + ], + ), + if (widget.error.isNotEmpty) + Padding( + padding: const EdgeInsets.only(top: UiConstants.space2), + child: Text(widget.error, style: UiTypography.body2r.textError), + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/phone_input/phone_input_header.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/phone_input/phone_input_header.dart new file mode 100644 index 00000000..5b86b6e3 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/phone_verification_page/phone_input/phone_input_header.dart @@ -0,0 +1,27 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:staff_authentication/staff_authentication.dart'; + +/// A widget that displays the title and subtitle for the Phone Input page. +class PhoneInputHeader extends StatelessWidget { + /// Creates a [PhoneInputHeader]. + const PhoneInputHeader({super.key}); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + t.staff_authentication.phone_input.title, + style: UiTypography.headline1m, + ), + const SizedBox(height: UiConstants.space1), + Text( + t.staff_authentication.phone_input.subtitle, + style: UiTypography.body2r.textSecondary, + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/profile_setup_page/profile_setup_basic_info.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/profile_setup_page/profile_setup_basic_info.dart new file mode 100644 index 00000000..4d9ad36c --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/profile_setup_page/profile_setup_basic_info.dart @@ -0,0 +1,100 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:staff_authentication/src/presentation/widgets/common/section_title_subtitle.dart'; +import 'package:staff_authentication/staff_authentication.dart'; + +/// A widget for setting up basic profile information (photo, name, bio). +class ProfileSetupBasicInfo extends StatelessWidget { + /// The user's full name. + final String fullName; + + /// The user's bio. + final String bio; + + /// Callback for when the full name changes. + final ValueChanged onFullNameChanged; + + /// Callback for when the bio changes. + final ValueChanged onBioChanged; + + /// Creates a [ProfileSetupBasicInfo] widget. + const ProfileSetupBasicInfo({ + super.key, + required this.fullName, + required this.bio, + required this.onFullNameChanged, + required this.onBioChanged, + }); + + @override + /// Builds the basic info step UI. + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SectionTitleSubtitle( + title: t.staff_authentication.profile_setup_page.basic_info.title, + subtitle: + t.staff_authentication.profile_setup_page.basic_info.subtitle, + ), + const SizedBox(height: UiConstants.space8), + + // Photo Upload + Center( + child: Stack( + children: [ + Container( + width: 120, + height: 120, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: UiColors.secondary, + border: Border.all( + color: UiColors.secondaryForeground.withAlpha(24), + width: 4, + ), + ), + child: const Icon( + UiIcons.user, + size: 48, + color: UiColors.iconSecondary, + ), + ), + Positioned( + bottom: 0, + right: 0, + child: UiIconButton.secondary(icon: UiIcons.camera), + ), + ], + ), + ), + const SizedBox(height: UiConstants.space8), + + // Full Name + UiTextField( + label: t + .staff_authentication + .profile_setup_page + .basic_info + .full_name_label, + hintText: t + .staff_authentication + .profile_setup_page + .basic_info + .full_name_hint, + onChanged: onFullNameChanged, + ), + const SizedBox(height: UiConstants.space6), + + // Bio + UiTextField( + label: t.staff_authentication.profile_setup_page.basic_info.bio_label, + hintText: + t.staff_authentication.profile_setup_page.basic_info.bio_hint, + maxLines: 3, + onChanged: onBioChanged, + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/profile_setup_page/profile_setup_experience.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/profile_setup_page/profile_setup_experience.dart new file mode 100644 index 00000000..73612bdc --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/profile_setup_page/profile_setup_experience.dart @@ -0,0 +1,265 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:staff_authentication/src/presentation/widgets/common/section_title_subtitle.dart'; +import 'package:staff_authentication/staff_authentication.dart'; + +/// A widget for setting up skills and preferred industries. +class ProfileSetupExperience extends StatelessWidget { + /// The list of selected skills. + final List skills; + + /// The list of selected industries. + final List industries; + + /// Callback for when skills change. + final ValueChanged> onSkillsChanged; + + /// Callback for when industries change. + final ValueChanged> onIndustriesChanged; + + static const List _allSkillKeys = [ + 'food_service', + 'bartending', + 'warehouse', + 'retail', + 'events', + 'customer_service', + 'cleaning', + 'security', + 'driving', + 'cooking', + ]; + + static const List _allIndustryKeys = [ + 'hospitality', + 'food_service', + 'warehouse', + 'events', + 'retail', + 'healthcare', + ]; + + /// Creates a [ProfileSetupExperience] widget. + const ProfileSetupExperience({ + super.key, + required this.skills, + required this.industries, + required this.onSkillsChanged, + required this.onIndustriesChanged, + }); + + /// Toggles a skill. + void _toggleSkill({required String skill}) { + final List updatedList = List.from(skills); + if (updatedList.contains(skill)) { + updatedList.remove(skill); + } else { + updatedList.add(skill); + } + onSkillsChanged(updatedList); + } + + /// Toggles an industry. + void _toggleIndustry({required String industry}) { + final List updatedList = List.from(industries); + if (updatedList.contains(industry)) { + updatedList.remove(industry); + } else { + updatedList.add(industry); + } + onIndustriesChanged(updatedList); + } + + @override + /// Builds the experience setup step UI. + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SectionTitleSubtitle( + title: t.staff_authentication.profile_setup_page.experience.title, + subtitle: + t.staff_authentication.profile_setup_page.experience.subtitle, + ), + const SizedBox(height: UiConstants.space8), + + // Skills + Text( + t.staff_authentication.profile_setup_page.experience.skills_label, + style: UiTypography.body2m, + ), + const SizedBox(height: UiConstants.space3), + Wrap( + spacing: UiConstants.space2, + runSpacing: UiConstants.space2, + children: _allSkillKeys.map((String key) { + final bool isSelected = skills.contains(key); + // Dynamic translation access + final String label = _getSkillLabel(key); + + return UiChip( + label: label, + isSelected: isSelected, + onTap: () => _toggleSkill(skill: key), + leadingIcon: isSelected ? UiIcons.check : null, + variant: UiChipVariant.primary, + ); + }).toList(), + ), + + const SizedBox(height: UiConstants.space8), + + // Industries + Text( + t.staff_authentication.profile_setup_page.experience.industries_label, + style: UiTypography.body2m, + ), + const SizedBox(height: UiConstants.space3), + Wrap( + spacing: UiConstants.space2, + runSpacing: UiConstants.space2, + children: _allIndustryKeys.map((String key) { + final bool isSelected = industries.contains(key); + final String label = _getIndustryLabel(key); + + return UiChip( + label: label, + isSelected: isSelected, + onTap: () => _toggleIndustry(industry: key), + leadingIcon: isSelected ? UiIcons.check : null, + variant: isSelected + ? UiChipVariant.accent + : UiChipVariant.primary, + ); + }).toList(), + ), + ], + ); + } + + String _getSkillLabel(String key) { + switch (key) { + case 'food_service': + return t + .staff_authentication + .profile_setup_page + .experience + .skills + .food_service; + case 'bartending': + return t + .staff_authentication + .profile_setup_page + .experience + .skills + .bartending; + case 'warehouse': + return t + .staff_authentication + .profile_setup_page + .experience + .skills + .warehouse; + case 'retail': + return t + .staff_authentication + .profile_setup_page + .experience + .skills + .retail; + case 'events': + return t + .staff_authentication + .profile_setup_page + .experience + .skills + .events; + case 'customer_service': + return t + .staff_authentication + .profile_setup_page + .experience + .skills + .customer_service; + case 'cleaning': + return t + .staff_authentication + .profile_setup_page + .experience + .skills + .cleaning; + case 'security': + return t + .staff_authentication + .profile_setup_page + .experience + .skills + .security; + case 'driving': + return t + .staff_authentication + .profile_setup_page + .experience + .skills + .driving; + case 'cooking': + return t + .staff_authentication + .profile_setup_page + .experience + .skills + .cooking; + default: + return key; + } + } + + String _getIndustryLabel(String key) { + switch (key) { + case 'hospitality': + return t + .staff_authentication + .profile_setup_page + .experience + .industries + .hospitality; + case 'food_service': + return t + .staff_authentication + .profile_setup_page + .experience + .industries + .food_service; + case 'warehouse': + return t + .staff_authentication + .profile_setup_page + .experience + .industries + .warehouse; + case 'events': + return t + .staff_authentication + .profile_setup_page + .experience + .industries + .events; + case 'retail': + return t + .staff_authentication + .profile_setup_page + .experience + .industries + .retail; + case 'healthcare': + return t + .staff_authentication + .profile_setup_page + .experience + .industries + .healthcare; + default: + return key; + } + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/profile_setup_page/profile_setup_header.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/profile_setup_page/profile_setup_header.dart new file mode 100644 index 00000000..5f727d48 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/profile_setup_page/profile_setup_header.dart @@ -0,0 +1,57 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:staff_authentication/staff_authentication.dart'; + +/// A header widget for the profile setup page showing back button and step count. +class ProfileSetupHeader extends StatelessWidget { + /// The current step index (0-based). + final int currentStep; + + /// The total number of steps. + final int totalSteps; + + /// Callback when the back button is tapped. + final VoidCallback? onBackTap; + + /// Creates a [ProfileSetupHeader]. + const ProfileSetupHeader({ + super.key, + required this.currentStep, + required this.totalSteps, + this.onBackTap, + }); + + @override + /// Builds the header UI. + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space5, + vertical: UiConstants.space4, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if (currentStep > 0 && onBackTap != null) + GestureDetector( + onTap: onBackTap, + child: const Icon( + UiIcons.chevronLeft, + size: 20, + color: UiColors.textSecondary, + ), + ) + else + const SizedBox(width: UiConstants.space6), + Text( + t.staff_authentication.profile_setup_page.step_indicator( + current: currentStep + 1, + total: totalSteps, + ), + style: UiTypography.footnote1r.textSecondary, + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/profile_setup_page/profile_setup_location.dart b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/profile_setup_page/profile_setup_location.dart new file mode 100644 index 00000000..b62b953a --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/src/presentation/widgets/profile_setup_page/profile_setup_location.dart @@ -0,0 +1,165 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:staff_authentication/src/presentation/widgets/common/section_title_subtitle.dart'; +import 'package:staff_authentication/staff_authentication.dart'; + +/// A widget for setting up preferred work locations and distance. +class ProfileSetupLocation extends StatefulWidget { + /// The list of preferred locations. + final List preferredLocations; + + /// The maximum distance in miles. + final double maxDistanceMiles; + + /// Callback for when the preferred locations list changes. + final ValueChanged> onLocationsChanged; + + /// Callback for when the max distance changes. + final ValueChanged onDistanceChanged; + + /// Creates a [ProfileSetupLocation] widget. + const ProfileSetupLocation({ + super.key, + required this.preferredLocations, + required this.maxDistanceMiles, + required this.onLocationsChanged, + required this.onDistanceChanged, + }); + + @override + State createState() => _ProfileSetupLocationState(); +} + +class _ProfileSetupLocationState extends State { + final TextEditingController _locationController = TextEditingController(); + + @override + void dispose() { + _locationController.dispose(); + super.dispose(); + } + + /// Adds the current text from the controller as a location. + void _addLocation() { + final String loc = _locationController.text.trim(); + if (loc.isNotEmpty && !widget.preferredLocations.contains(loc)) { + final List updatedList = List.from(widget.preferredLocations) + ..add(loc); + widget.onLocationsChanged(updatedList); + _locationController.clear(); + } + } + + @override + /// Builds the location setup step UI. + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SectionTitleSubtitle( + title: t.staff_authentication.profile_setup_page.location.title, + subtitle: t.staff_authentication.profile_setup_page.location.subtitle, + ), + const SizedBox(height: UiConstants.space8), + + // Add Location input + Row( + crossAxisAlignment: CrossAxisAlignment.end, + spacing: UiConstants.space2, + children: [ + Expanded( + child: UiTextField( + label: t + .staff_authentication + .profile_setup_page + .location + .add_location_label, + controller: _locationController, + hintText: t + .staff_authentication + .profile_setup_page + .location + .add_location_hint, + onSubmitted: (_) => _addLocation(), + ), + ), + UiButton.secondary( + text: + t.staff_authentication.profile_setup_page.location.add_button, + onPressed: _addLocation, + style: OutlinedButton.styleFrom( + minimumSize: const Size(0, 48), + maximumSize: const Size(double.infinity, 48), + ), + ), + ], + ), + + const SizedBox(height: UiConstants.space4), + + // Location Badges + if (widget.preferredLocations.isNotEmpty) + Wrap( + spacing: UiConstants.space2, + runSpacing: UiConstants.space2, + children: widget.preferredLocations.map((String loc) { + return UiChip( + label: loc, + leadingIcon: UiIcons.mapPin, + trailingIcon: UiIcons.close, + onTrailingIconTap: () => _removeLocation(location: loc), + variant: UiChipVariant.secondary, + ); + }).toList(), + ), + + const SizedBox(height: UiConstants.space8), + // Slider + Text( + t.staff_authentication.profile_setup_page.location.max_distance( + distance: widget.maxDistanceMiles.round().toString(), + ), + style: UiTypography.body2m, + ), + const SizedBox(height: UiConstants.space2), + Slider( + value: widget.maxDistanceMiles, + min: 5, + max: 50, + onChanged: widget.onDistanceChanged, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: UiConstants.space2), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + t + .staff_authentication + .profile_setup_page + .location + .min_dist_label, + style: UiTypography.footnote1r.textSecondary, + ), + Text( + t + .staff_authentication + .profile_setup_page + .location + .max_dist_label, + style: UiTypography.footnote1r.textSecondary, + ), + ], + ), + ), + ], + ); + } + + /// Removes the specified [location] from the list. + void _removeLocation({required String location}) { + final List updatedList = List.from(widget.preferredLocations) + ..remove(location); + widget.onLocationsChanged(updatedList); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/lib/staff_authentication.dart b/apps/mobile/packages/features/staff/authentication/lib/staff_authentication.dart new file mode 100644 index 00000000..9177a01c --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/lib/staff_authentication.dart @@ -0,0 +1,70 @@ +library staff_authentication; + +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:firebase_auth/firebase_auth.dart' as firebase; +import 'package:staff_authentication/src/data/repositories_impl/auth_repository_impl.dart'; +import 'package:staff_authentication/src/domain/repositories/auth_repository_interface.dart'; +import 'package:staff_authentication/src/domain/usecases/sign_in_with_phone_usecase.dart'; +import 'package:staff_authentication/src/domain/usecases/verify_otp_usecase.dart'; +import 'package:staff_authentication/src/presentation/blocs/auth_bloc.dart'; +import 'package:staff_authentication/src/presentation/blocs/profile_setup/profile_setup_bloc.dart'; +import 'package:staff_authentication/src/presentation/pages/get_started_page.dart'; +import 'package:staff_authentication/src/presentation/pages/phone_verification_page.dart'; +import 'package:staff_authentication/src/presentation/pages/profile_setup_page.dart'; +import 'package:staff_authentication/src/domain/ui_entities/auth_mode.dart'; + +export 'src/domain/ui_entities/auth_mode.dart'; +export 'src/presentation/pages/get_started_page.dart'; +export 'src/presentation/pages/phone_verification_page.dart'; +export 'src/presentation/pages/profile_setup_page.dart'; +export 'package:core_localization/core_localization.dart'; + +/// A [Module] for the staff authentication feature. +class StaffAuthenticationModule extends Module { + @override + List get imports => [DataConnectModule()]; + + @override + void binds(Injector i) { + // Repositories + i.addLazySingleton( + () => AuthRepositoryImpl( + firebaseAuth: firebase.FirebaseAuth.instance, + dataConnect: ExampleConnector.instance, + ), + ); + + // UseCases + i.addLazySingleton(SignInWithPhoneUseCase.new); + i.addLazySingleton(VerifyOtpUseCase.new); + + // BLoCs + i.addLazySingleton( + () => AuthBloc( + signInUseCase: i.get(), + verifyOtpUseCase: i.get(), + ), + ); + i.add(ProfileSetupBloc.new); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (_) => const GetStartedPage()); + r.child( + '/phone-verification', + child: (BuildContext context) { + final Map? data = r.args.data; + final String? modeName = data?['mode']; + final AuthMode mode = AuthMode.values.firstWhere( + (AuthMode e) => e.name == modeName, + orElse: () => AuthMode.login, + ); + return PhoneVerificationPage(mode: mode); + }, + ); + r.child('/profile-setup', child: (_) => const ProfileSetupPage()); + } +} diff --git a/apps/mobile/packages/features/staff/authentication/pubspec.yaml b/apps/mobile/packages/features/staff/authentication/pubspec.yaml new file mode 100644 index 00000000..87b79949 --- /dev/null +++ b/apps/mobile/packages/features/staff/authentication/pubspec.yaml @@ -0,0 +1,43 @@ +name: staff_authentication +description: Staff Authentication and Onboarding feature. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + flutter_modular: ^6.3.0 + equatable: ^2.0.5 + lucide_icons: ^0.257.0 + firebase_core: ^4.2.1 + firebase_auth: ^6.1.2 # Updated for compatibility + firebase_data_connect: ^0.2.2+1 + + # Architecture Packages + krow_domain: + path: ../../../domain + krow_data_connect: + path: ../../../data_connect + krow_core: + path: ../../../core + design_system: + path: ../../../design_system + core_localization: + path: ../../../core_localization + + +dev_dependencies: + flutter_test: + sdk: flutter + bloc_test: ^9.1.0 + mocktail: ^1.0.0 + build_runner: ^2.4.15 + +flutter: + uses-material-design: true diff --git a/apps/mobile/packages/features/staff/home/analysis_options.yaml b/apps/mobile/packages/features/staff/home/analysis_options.yaml new file mode 100644 index 00000000..03ea3cc1 --- /dev/null +++ b/apps/mobile/packages/features/staff/home/analysis_options.yaml @@ -0,0 +1,7 @@ +include: package:flutter_lints/flutter.yaml + +linter: + rules: + avoid_print: true + prefer_single_quotes: true + always_use_package_imports: true diff --git a/apps/mobile/packages/features/staff/home/lib/src/data/repositories/home_repository_impl.dart b/apps/mobile/packages/features/staff/home/lib/src/data/repositories/home_repository_impl.dart new file mode 100644 index 00000000..0ea0bd34 --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/data/repositories/home_repository_impl.dart @@ -0,0 +1,18 @@ +import 'package:staff_home/src/domain/entities/shift.dart'; +import 'package:staff_home/src/domain/repositories/home_repository.dart'; +import 'package:staff_home/src/data/services/mock_service.dart'; + +class HomeRepositoryImpl implements HomeRepository { + final MockService _service; + + HomeRepositoryImpl(this._service); + + @override + Future> getTodayShifts() => _service.getTodayShifts(); + + @override + Future> getTomorrowShifts() => _service.getTomorrowShifts(); + + @override + Future> getRecommendedShifts() => _service.getRecommendedShifts(); +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/data/services/mock_service.dart b/apps/mobile/packages/features/staff/home/lib/src/data/services/mock_service.dart new file mode 100644 index 00000000..89dca0f8 --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/data/services/mock_service.dart @@ -0,0 +1,76 @@ +import 'package:staff_home/src/domain/entities/shift.dart'; + +class MockService { + static final Shift _sampleShift1 = Shift( + id: '1', + title: 'Line Cook', + clientName: 'The Burger Joint', + hourlyRate: 22.50, + location: 'Downtown, NY', + locationAddress: '123 Main St, New York, NY 10001', + date: DateTime.now().toIso8601String(), + startTime: '16:00', + endTime: '22:00', + createdDate: DateTime.now() + .subtract(const Duration(hours: 2)) + .toIso8601String(), + tipsAvailable: true, + mealProvided: true, + managers: [ShiftManager(name: 'John Doe', phone: '+1 555 0101')], + description: 'Help with dinner service. Must be experienced with grill.', + ); + + static final Shift _sampleShift2 = Shift( + id: '2', + title: 'Dishwasher', + clientName: 'Pasta Place', + hourlyRate: 18.00, + location: 'Brooklyn, NY', + locationAddress: '456 Bedford Ave, Brooklyn, NY 11211', + date: DateTime.now().add(const Duration(days: 1)).toIso8601String(), + startTime: '18:00', + endTime: '23:00', + createdDate: DateTime.now() + .subtract(const Duration(hours: 5)) + .toIso8601String(), + tipsAvailable: false, + mealProvided: true, + ); + + static final Shift _sampleShift3 = Shift( + id: '3', + title: 'Bartender', + clientName: 'Rooftop Bar', + hourlyRate: 25.00, + location: 'Manhattan, NY', + locationAddress: '789 5th Ave, New York, NY 10022', + date: DateTime.now().add(const Duration(days: 2)).toIso8601String(), + startTime: '19:00', + endTime: '02:00', + createdDate: DateTime.now() + .subtract(const Duration(hours: 1)) + .toIso8601String(), + tipsAvailable: true, + parkingAvailable: true, + description: 'High volume bar. Mixology experience required.', + ); + + Future> getTodayShifts() async { + await Future.delayed(const Duration(milliseconds: 500)); + return [_sampleShift1]; + } + + Future> getTomorrowShifts() async { + await Future.delayed(const Duration(milliseconds: 500)); + return [_sampleShift2]; + } + + Future> getRecommendedShifts() async { + await Future.delayed(const Duration(milliseconds: 500)); + return [_sampleShift3, _sampleShift1, _sampleShift2]; + } + + Future createWorkerProfile(Map data) async { + await Future.delayed(const Duration(seconds: 1)); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/domain/entities/shift.dart b/apps/mobile/packages/features/staff/home/lib/src/domain/entities/shift.dart new file mode 100644 index 00000000..476281b9 --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/domain/entities/shift.dart @@ -0,0 +1,94 @@ +import 'package:equatable/equatable.dart'; + +/// Entity representing a shift for the staff home screen. +/// +/// This entity aggregates essential shift details needed for display cards. +class Shift extends Equatable { + const Shift({ + required this.id, + required this.title, + required this.clientName, + this.logoUrl, + required this.hourlyRate, + required this.location, + this.locationAddress, + required this.date, + required this.startTime, + required this.endTime, + required this.createdDate, + this.tipsAvailable, + this.travelTime, + this.mealProvided, + this.parkingAvailable, + this.gasCompensation, + this.description, + this.instructions, + this.managers, + this.latitude, + this.longitude, + this.status, + this.durationDays, + }); + + final String id; + final String title; + final String clientName; + final String? logoUrl; + final double hourlyRate; + final String location; + final String? locationAddress; + final String date; + final String startTime; + final String endTime; + final String createdDate; + final bool? tipsAvailable; + final bool? travelTime; + final bool? mealProvided; + final bool? parkingAvailable; + final bool? gasCompensation; + final String? description; + final String? instructions; + final List? managers; + final double? latitude; + final double? longitude; + final String? status; + final int? durationDays; + + @override + List get props => [ + id, + title, + clientName, + logoUrl, + hourlyRate, + location, + locationAddress, + date, + startTime, + endTime, + createdDate, + tipsAvailable, + travelTime, + mealProvided, + parkingAvailable, + gasCompensation, + description, + instructions, + managers, + latitude, + longitude, + status, + durationDays, + ]; +} + +class ShiftManager extends Equatable { + const ShiftManager({required this.name, required this.phone, this.avatar}); + + final String name; + final String phone; + final String? avatar; + + @override + List get props => [name, phone, avatar]; +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/domain/repositories/home_repository.dart b/apps/mobile/packages/features/staff/home/lib/src/domain/repositories/home_repository.dart new file mode 100644 index 00000000..a280f4cf --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/domain/repositories/home_repository.dart @@ -0,0 +1,17 @@ +import 'package:staff_home/src/domain/entities/shift.dart'; + +/// Repository interface for home screen data operations. +/// +/// This interface defines the contract for fetching shift data +/// displayed on the worker home screen. Implementations should +/// handle data retrieval from appropriate data sources. +abstract class HomeRepository { + /// Retrieves the list of shifts scheduled for today. + Future> getTodayShifts(); + + /// Retrieves the list of shifts scheduled for tomorrow. + Future> getTomorrowShifts(); + + /// Retrieves shifts recommended for the worker based on their profile. + Future> getRecommendedShifts(); +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/domain/usecases/get_home_shifts.dart b/apps/mobile/packages/features/staff/home/lib/src/domain/usecases/get_home_shifts.dart new file mode 100644 index 00000000..2e9ed17c --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/domain/usecases/get_home_shifts.dart @@ -0,0 +1,42 @@ +import 'package:staff_home/src/domain/entities/shift.dart'; +import 'package:staff_home/src/domain/repositories/home_repository.dart'; + +/// Use case for fetching all shifts displayed on the home screen. +/// +/// This use case aggregates shift data from multiple time periods +/// (today, tomorrow, and recommended) into a single response. +class GetHomeShifts { + final HomeRepository repository; + + GetHomeShifts(this.repository); + + /// Executes the use case to fetch all home screen shift data. + /// + /// Returns a [HomeShifts] object containing today's shifts, + /// tomorrow's shifts, and recommended shifts. + Future call() async { + final today = await repository.getTodayShifts(); + final tomorrow = await repository.getTomorrowShifts(); + final recommended = await repository.getRecommendedShifts(); + return HomeShifts( + today: today, + tomorrow: tomorrow, + recommended: recommended, + ); + } +} + +/// Data transfer object containing all shifts for the home screen. +/// +/// Groups shifts by time period for easy presentation layer consumption. +class HomeShifts { + final List today; + final List tomorrow; + final List recommended; + + HomeShifts({ + required this.today, + required this.tomorrow, + required this.recommended, + }); +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/blocs/home_cubit.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/blocs/home_cubit.dart new file mode 100644 index 00000000..7eed68f4 --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/blocs/home_cubit.dart @@ -0,0 +1,42 @@ +import 'package:bloc/bloc.dart'; +import 'package:equatable/equatable.dart'; + +import 'package:staff_home/src/domain/entities/shift.dart'; +import 'package:staff_home/src/domain/usecases/get_home_shifts.dart'; +import 'package:staff_home/src/domain/repositories/home_repository.dart'; + +part 'home_state.dart'; + +/// Simple Cubit to manage home page state (shifts + loading/error). +class HomeCubit extends Cubit { + final GetHomeShifts _getHomeShifts; + + HomeCubit(HomeRepository repository) + : _getHomeShifts = GetHomeShifts(repository), + super(const HomeState.initial()); + + Future loadShifts() async { + emit(state.copyWith(status: HomeStatus.loading)); + try { + final result = await _getHomeShifts.call(); + emit( + state.copyWith( + status: HomeStatus.loaded, + todayShifts: result.today, + tomorrowShifts: result.tomorrow, + recommendedShifts: result.recommended, + // Mock profile status for now, ideally fetched from a user repository + isProfileComplete: false, + ), + ); + } catch (e) { + emit( + state.copyWith(status: HomeStatus.error, errorMessage: e.toString()), + ); + } + } + + void toggleAutoMatch(bool enabled) { + emit(state.copyWith(autoMatchEnabled: enabled)); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/blocs/home_state.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/blocs/home_state.dart new file mode 100644 index 00000000..e67f454b --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/blocs/home_state.dart @@ -0,0 +1,56 @@ +part of 'home_cubit.dart'; + +enum HomeStatus { initial, loading, loaded, error } + +class HomeState extends Equatable { + final HomeStatus status; + final List todayShifts; + final List tomorrowShifts; + final List recommendedShifts; + final bool autoMatchEnabled; + final bool isProfileComplete; + final String? errorMessage; + + const HomeState({ + required this.status, + this.todayShifts = const [], + this.tomorrowShifts = const [], + this.recommendedShifts = const [], + this.autoMatchEnabled = false, + this.isProfileComplete = false, + this.errorMessage, + }); + + const HomeState.initial() : this(status: HomeStatus.initial); + + HomeState copyWith({ + HomeStatus? status, + List? todayShifts, + List? tomorrowShifts, + List? recommendedShifts, + bool? autoMatchEnabled, + bool? isProfileComplete, + String? errorMessage, + }) { + return HomeState( + status: status ?? this.status, + todayShifts: todayShifts ?? this.todayShifts, + tomorrowShifts: tomorrowShifts ?? this.tomorrowShifts, + recommendedShifts: recommendedShifts ?? this.recommendedShifts, + autoMatchEnabled: autoMatchEnabled ?? this.autoMatchEnabled, + isProfileComplete: isProfileComplete ?? this.isProfileComplete, + errorMessage: errorMessage ?? this.errorMessage, + ); + } + + @override + List get props => [ + status, + todayShifts, + tomorrowShifts, + recommendedShifts, + autoMatchEnabled, + isProfileComplete, + errorMessage, + ]; +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/navigation/home_navigator.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/navigation/home_navigator.dart new file mode 100644 index 00000000..e3671168 --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/navigation/home_navigator.dart @@ -0,0 +1,43 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +/// Extension on [IModularNavigator] providing typed navigation helpers +/// for the Staff Home feature (worker home screen). +/// +/// Keep routes as small wrappers around `pushNamed` / `navigate` so callers +/// don't need to rely on literal paths throughout the codebase. +extension HomeNavigator on IModularNavigator { + /// Navigates to the worker profile page. + void pushWorkerProfile() { + pushNamed('/worker-profile'); + } + + /// Navigates to the availability page. + void pushAvailability() { + pushNamed('/availability'); + } + + /// Navigates to the messages page. + void pushMessages() { + pushNamed('/messages'); + } + + /// Navigates to the payments page. + void navigateToPayments() { + navigate('/worker-main/payments'); + } + + /// Navigates to the shifts listing. + /// Optionally provide a [tab] query param (e.g. `find`). + void pushShifts({String? tab}) { + if (tab == null) { + pushNamed('/shifts'); + } else { + pushNamed('/shifts?tab=$tab'); + } + } + + /// Navigates to the settings page. + void pushSettings() { + pushNamed('/settings'); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/pages/worker_home_page.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/pages/worker_home_page.dart new file mode 100644 index 00000000..4b323dba --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/pages/worker_home_page.dart @@ -0,0 +1,267 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:lucide_icons/lucide_icons.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; + +import 'package:staff_home/src/presentation/blocs/home_cubit.dart'; +import 'package:staff_home/src/presentation/navigation/home_navigator.dart'; +import 'package:staff_home/src/presentation/widgets/home_page/empty_state_widget.dart'; +import 'package:staff_home/src/presentation/widgets/home_page/home_header.dart'; +import 'package:staff_home/src/presentation/widgets/home_page/pending_payment_card.dart'; +import 'package:staff_home/src/presentation/widgets/home_page/placeholder_banner.dart'; +import 'package:staff_home/src/presentation/widgets/home_page/quick_action_item.dart'; +import 'package:staff_home/src/presentation/widgets/home_page/recommended_shift_card.dart'; +import 'package:staff_home/src/presentation/widgets/home_page/section_header.dart'; +import 'package:staff_home/src/presentation/widgets/shift_card.dart'; +import 'package:staff_home/src/presentation/widgets/worker/auto_match_toggle.dart'; +import 'package:staff_home/src/presentation/widgets/worker/benefits_widget.dart'; +import 'package:staff_home/src/presentation/widgets/worker/improve_yourself_widget.dart'; +import 'package:staff_home/src/presentation/widgets/worker/more_ways_widget.dart'; + +/// The home page for the staff worker application. +/// +/// This page displays the worker's dashboard including today's shifts, +/// tomorrow's shifts, recommended shifts, benefits, and other relevant +/// information. It follows Clean Architecture principles with state +/// managed by [HomeCubit]. +/// The home page for the staff worker application. +/// +/// This page displays the worker's dashboard including today's shifts, +/// tomorrow's shifts, recommended shifts, benefits, and other relevant +/// information. It follows Clean Architecture principles with state +/// managed by [HomeCubit]. +class WorkerHomePage extends StatelessWidget { + /// Creates a [WorkerHomePage]. + const WorkerHomePage({super.key}); + + @override + Widget build(BuildContext context) { + final i18n = t.staff.home; + final bannersI18n = i18n.banners; + final quickI18n = i18n.quick_actions; + final sectionsI18n = i18n.sections; + final emptyI18n = i18n.empty_states; + + return BlocProvider( + create: (context) => Modular.get()..loadShifts(), + child: Scaffold( + body: SafeArea( + child: SingleChildScrollView( + padding: const EdgeInsets.only(bottom: UiConstants.space6), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const HomeHeader(), + Padding( + padding: const EdgeInsets.symmetric(horizontal: UiConstants.space4), + child: Column( + children: [ + BlocBuilder( + buildWhen: (previous, current) => + previous.isProfileComplete != + current.isProfileComplete, + builder: (context, state) { + if (state.isProfileComplete) return const SizedBox(); + return PlaceholderBanner( + title: bannersI18n.complete_profile_title, + subtitle: bannersI18n.complete_profile_subtitle, + bg: UiColors.bgHighlight, + accent: UiColors.primary, + onTap: () { + Modular.to.pushWorkerProfile(); + }, + ); + }, + ), + const SizedBox(height: UiConstants.space6), + PlaceholderBanner( + title: bannersI18n.availability_title, + subtitle: bannersI18n.availability_subtitle, + bg: UiColors.accent.withOpacity(0.1), + accent: UiColors.accent, + onTap: () => Modular.to.pushAvailability(), + ), + const SizedBox(height: UiConstants.space6), + + // Auto Match Toggle + BlocBuilder( + buildWhen: (previous, current) => + previous.autoMatchEnabled != + current.autoMatchEnabled, + builder: (context, state) { + return AutoMatchToggle( + enabled: state.autoMatchEnabled, + onToggle: (val) => BlocProvider.of( + context, + listen: false, + ).toggleAutoMatch(val), + ); + }, + ), + const SizedBox(height: UiConstants.space6), + + // Quick Actions + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: QuickActionItem( + icon: LucideIcons.search, + label: quickI18n.find_shifts, + onTap: () => Modular.to.pushShifts(), + ), + ), + Expanded( + child: QuickActionItem( + icon: LucideIcons.calendar, + label: quickI18n.availability, + onTap: () => Modular.to.pushAvailability(), + ), + ), + Expanded( + child: QuickActionItem( + icon: LucideIcons.messageSquare, + label: quickI18n.messages, + onTap: () => Modular.to.pushMessages(), + ), + ), + Expanded( + child: QuickActionItem( + icon: LucideIcons.dollarSign, + label: quickI18n.earnings, + onTap: () => Modular.to.navigateToPayments(), + ), + ), + ], + ), + const SizedBox(height: 24), + + // Today's Shifts + BlocBuilder( + builder: (context, state) { + final shifts = state.todayShifts; + return Column( + children: [ + SectionHeader( + title: sectionsI18n.todays_shift, + action: shifts.isNotEmpty + ? sectionsI18n.scheduled_count( + count: shifts.length, + ) + : null, + ), + if (state.status == HomeStatus.loading) + const Center( + child: SizedBox( + height: 40, + width: 40, + child: CircularProgressIndicator(), + ), + ) + else if (shifts.isEmpty) + EmptyStateWidget( + message: emptyI18n.no_shifts_today, + actionLink: emptyI18n.find_shifts_cta, + onAction: () => + Modular.to.pushShifts(tab: 'find'), + ) + else + Column( + children: shifts + .map( + (shift) => ShiftCard( + shift: shift, + compact: true, + ), + ) + .toList(), + ), + ], + ); + }, + ), + const SizedBox(height: 24), + + // Tomorrow's Shifts + BlocBuilder( + builder: (context, state) { + final shifts = state.tomorrowShifts; + return Column( + children: [ + SectionHeader(title: sectionsI18n.tomorrow), + if (shifts.isEmpty) + EmptyStateWidget( + message: emptyI18n.no_shifts_tomorrow, + ) + else + Column( + children: shifts + .map( + (shift) => ShiftCard( + shift: shift, + compact: true, + ), + ) + .toList(), + ), + ], + ); + }, + ), + const SizedBox(height: 24), + + // Pending Payment Card + const PendingPaymentCard(), + const SizedBox(height: 24), + + // Recommended Shifts + SectionHeader( + title: sectionsI18n.recommended_for_you, + action: sectionsI18n.view_all, + onAction: () => Modular.to.pushShifts(tab: 'find'), + ), + BlocBuilder( + builder: (context, state) { + if (state.recommendedShifts.isEmpty) { + return EmptyStateWidget( + message: emptyI18n.no_recommended_shifts, + ); + } + return SizedBox( + height: 160, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: state.recommendedShifts.length, + clipBehavior: Clip.none, + itemBuilder: (context, index) => Padding( + padding: const EdgeInsets.only(right: 12), + child: RecommendedShiftCard( + shift: state.recommendedShifts[index], + ), + ), + ), + ); + }, + ), + const SizedBox(height: 24), + + const BenefitsWidget(), + const SizedBox(height: 24), + + const ImproveYourselfWidget(), + const SizedBox(height: 24), + + const MoreWaysToUseKrowWidget(), + ], + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/empty_state_widget.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/empty_state_widget.dart new file mode 100644 index 00000000..bd52d67d --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/empty_state_widget.dart @@ -0,0 +1,49 @@ +import 'package:flutter/material.dart'; + +import 'package:design_system/design_system.dart'; + + +/// Widget for displaying an empty state message, using design system tokens. +class EmptyStateWidget extends StatelessWidget { + /// The message to display. + final String message; + /// Optional action link label. + final String? actionLink; + /// Optional action callback. + final VoidCallback? onAction; + + /// Creates an [EmptyStateWidget]. + const EmptyStateWidget({super.key, required this.message, this.actionLink, this.onAction}); + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + ), + alignment: Alignment.center, + child: Column( + children: [ + Text( + message, + style: UiTypography.body2r.copyWith(color: UiColors.mutedForeground), + ), + if (actionLink != null) + GestureDetector( + onTap: onAction, + child: Padding( + padding: const EdgeInsets.only(top: UiConstants.space2), + child: Text( + actionLink!, + style: UiTypography.body2m.copyWith(color: UiColors.primary), + ), + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/home_header.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/home_header.dart new file mode 100644 index 00000000..ea85d499 --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/home_header.dart @@ -0,0 +1,62 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + + +/// Header widget for the staff home page, using design system tokens. +class HomeHeader extends StatelessWidget { + /// Creates a [HomeHeader]. + const HomeHeader({super.key}); + + @override + Widget build(BuildContext context) { + final headerI18n = t.staff.home.header; + return Padding( + padding: EdgeInsets.fromLTRB( + UiConstants.space4, + UiConstants.space4, + UiConstants.space4, + UiConstants.space3, + ), + child:Row( + children: [ + Container( + width: 48, + height: 48, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all( + color: UiColors.primary.withOpacity(0.2), + width: 2, + ), + ), + child: CircleAvatar( + backgroundColor: UiColors.primary.withOpacity(0.1), + child: const Text( + 'K', + style: TextStyle( + color: UiColors.primary, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + const SizedBox(width: UiConstants.space3), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + headerI18n.welcome_back, + style: UiTypography.body3r.copyWith(color: UiColors.mutedForeground), + ), + Text( + headerI18n.user_name_placeholder, + style: UiTypography.headline4m, + ), + ], + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/pending_payment_card.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/pending_payment_card.dart new file mode 100644 index 00000000..36271577 --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/pending_payment_card.dart @@ -0,0 +1,90 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:lucide_icons/lucide_icons.dart'; + +import 'package:design_system/design_system.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:staff_home/src/presentation/navigation/home_navigator.dart'; + + +/// Card widget for displaying pending payment information, using design system tokens. +class PendingPaymentCard extends StatelessWidget { + /// Creates a [PendingPaymentCard]. + const PendingPaymentCard({super.key}); + + @override + Widget build(BuildContext context) { + final pendingI18n = t.staff.home.pending_payment; + return GestureDetector( + onTap: () => Modular.to.navigateToPayments(), + child: Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [UiColors.primary.withOpacity(0.08), UiColors.primary.withOpacity(0.04)], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + border: Border.all(color: UiColors.primary.withOpacity(0.12)), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( + children: [ + Container( + width: 40, + height: 40, + decoration: const BoxDecoration( + color: UiColors.bgHighlight, + shape: BoxShape.circle, + ), + child: const Icon( + LucideIcons.dollarSign, + color: UiColors.primary, + size: 20, + ), + ), + const SizedBox(width: UiConstants.space3), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + pendingI18n.title, + style: UiTypography.body1b, + overflow: TextOverflow.ellipsis, + ), + Text( + pendingI18n.subtitle, + style: UiTypography.body3r.copyWith(color: UiColors.mutedForeground), + overflow: TextOverflow.ellipsis, + ), + ], + ), + ), + ], + ), + ), + Row( + children: [ + Text( + '\$285.00', + style: UiTypography.headline4m, + ), + SizedBox(width: UiConstants.space2), + Icon( + LucideIcons.chevronRight, + color: UiColors.mutedForeground, + size: 20, + ), + ], + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/placeholder_banner.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/placeholder_banner.dart new file mode 100644 index 00000000..517eba67 --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/placeholder_banner.dart @@ -0,0 +1,68 @@ +import 'package:flutter/material.dart'; +import 'package:lucide_icons/lucide_icons.dart'; + +import 'package:design_system/design_system.dart'; + + +/// Banner widget for placeholder actions, using design system tokens. +class PlaceholderBanner extends StatelessWidget { + /// Banner title + final String title; + /// Banner subtitle + final String subtitle; + /// Banner background color + final Color bg; + /// Banner accent color + final Color accent; + /// Optional tap callback + final VoidCallback? onTap; + + /// Creates a [PlaceholderBanner]. + const PlaceholderBanner({super.key, required this.title, required this.subtitle, required this.bg, required this.accent, this.onTap}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: bg, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + border: Border.all(color: accent.withOpacity(0.3)), + ), + child: Row( + children: [ + Container( + width: 40, + height: 40, + padding: const EdgeInsets.all(UiConstants.space2), + decoration: const BoxDecoration( + color: UiColors.bgBanner, + shape: BoxShape.circle, + ), + child: Icon(LucideIcons.sparkles, color: accent, size: 20), + ), + const SizedBox(width: UiConstants.space3), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: UiTypography.body1b, + ), + Text( + subtitle, + style: UiTypography.body3r.copyWith(color: UiColors.mutedForeground), + ), + ], + ), + ), + Icon(LucideIcons.chevronRight, color: accent), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/quick_action_item.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/quick_action_item.dart new file mode 100644 index 00000000..02271b5b --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/quick_action_item.dart @@ -0,0 +1,51 @@ +import 'package:flutter/material.dart'; + +import 'package:design_system/design_system.dart'; + + +/// Widget for a quick action button on the home page, using design system tokens. +class QuickActionItem extends StatelessWidget { + /// The icon to display. + final IconData icon; + /// The label for the action. + final String label; + /// The callback when tapped. + final VoidCallback onTap; + + /// Creates a [QuickActionItem]. + const QuickActionItem({super.key, required this.icon, required this.label, required this.onTap}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Column( + children: [ + Container( + width: 64, + height: 64, + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.bgBanner, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + border: Border.all(color: UiColors.bgSecondary), + boxShadow: [ + BoxShadow( + color: UiColors.foreground.withOpacity(0.05), + blurRadius: 4, + offset: const Offset(0, 2), + ), + ], + ), + child: Icon(icon, color: UiColors.primary, size: 24), + ), + const SizedBox(height: UiConstants.space2), + Text( + label, + style: UiTypography.body3r.copyWith(color: UiColors.foreground), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/recommended_shift_card.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/recommended_shift_card.dart new file mode 100644 index 00000000..c3400340 --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/recommended_shift_card.dart @@ -0,0 +1,213 @@ +import 'package:flutter/material.dart'; +import 'package:lucide_icons/lucide_icons.dart'; + +import 'package:design_system/design_system.dart'; +import 'package:staff_home/src/domain/entities/shift.dart'; +import 'package:core_localization/core_localization.dart'; + +class RecommendedShiftCard extends StatelessWidget { + final Shift shift; + + const RecommendedShiftCard({super.key, required this.shift}); + + @override + Widget build(BuildContext context) { + final recI18n = t.staff.home.recommended_card; + final duration = 8; + final totalPay = duration * shift.hourlyRate; + + return GestureDetector( + onTap: () { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text(recI18n.applied_for(title: shift.title)), + backgroundColor: Colors.green, + duration: const Duration(seconds: 2), + ), + ); + }, + child: Container( + width: 300, + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16), + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: Colors.black.withValues(alpha: 0.02), + blurRadius: 4, + offset: const Offset(0, 2), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Row( + children: [ + Text( + recI18n.act_now, + style: const TextStyle( + fontSize: 10, + fontWeight: FontWeight.bold, + color: Color(0xFFDC2626), + ), + ), + const SizedBox(width: 8), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 8, + vertical: 2, + ), + decoration: BoxDecoration( + color: const Color(0xFFE8F0FF), + borderRadius: BorderRadius.circular(999), + ), + child: Text( + recI18n.one_day, + style: const TextStyle( + fontSize: 10, + fontWeight: FontWeight.w500, + color: Color(0xFF0047FF), + ), + ), + ), + ], + ), + const SizedBox(height: 12), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 44, + height: 44, + decoration: BoxDecoration( + color: const Color(0xFFE8F0FF), + borderRadius: BorderRadius.circular(12), + ), + child: const Icon( + LucideIcons.calendar, + color: Color(0xFF0047FF), + size: 20, + ), + ), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + shift.title, + style: const TextStyle( + fontWeight: FontWeight.w600, + fontSize: 16, + color: UiColors.foreground, + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + Text( + '\$${totalPay.round()}', + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: UiColors.foreground, + ), + ), + ], + ), + const SizedBox(height: 2), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + shift.clientName, + style: const TextStyle( + fontSize: 12, + color: UiColors.mutedForeground, + ), + ), + Text( + '\$${shift.hourlyRate.toStringAsFixed(0)}/hr β€’ ${duration}h', + style: const TextStyle( + fontSize: 10, + color: UiColors.mutedForeground, + ), + ), + ], + ), + ], + ), + ), + ], + ), + const SizedBox(height: 12), + Row( + children: [ + const Icon( + LucideIcons.calendar, + size: 14, + color: UiColors.mutedForeground, + ), + const SizedBox(width: 4), + Text( + recI18n.today, + style: const TextStyle( + fontSize: 12, + color: UiColors.mutedForeground, + ), + ), + const SizedBox(width: 12), + const Icon( + LucideIcons.clock, + size: 14, + color: UiColors.mutedForeground, + ), + const SizedBox(width: 4), + Text( + recI18n.time_range( + start: shift.startTime, + end: shift.endTime, + ), + style: const TextStyle( + fontSize: 12, + color: UiColors.mutedForeground, + ), + ), + ], + ), + const SizedBox(height: 4), + Row( + children: [ + const Icon( + LucideIcons.mapPin, + size: 14, + color: UiColors.mutedForeground, + ), + const SizedBox(width: 4), + Expanded( + child: Text( + shift.locationAddress ?? shift.location, + style: const TextStyle( + fontSize: 12, + color: UiColors.mutedForeground, + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/section_header.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/section_header.dart new file mode 100644 index 00000000..59754ec6 --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/home_page/section_header.dart @@ -0,0 +1,67 @@ +import 'package:flutter/material.dart'; +import 'package:lucide_icons/lucide_icons.dart'; + +import 'package:design_system/design_system.dart'; + + +/// Section header widget for home page sections, using design system tokens. +class SectionHeader extends StatelessWidget { + /// Section title + final String title; + /// Optional action label + final String? action; + /// Optional action callback + final VoidCallback? onAction; + + /// Creates a [SectionHeader]. + const SectionHeader({super.key, required this.title, this.action, this.onAction}); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(bottom: UiConstants.space3), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + title, + style: UiTypography.headline4m, + ), + if (action != null) + if (onAction != null) + GestureDetector( + onTap: onAction, + child: Row( + children: [ + Text( + action!, + style: UiTypography.body2m.copyWith(color: UiColors.primary), + ), + const Icon( + LucideIcons.chevronRight, + size: 16, + color: UiColors.primary, + ), + ], + ), + ) + else + Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2), + decoration: BoxDecoration( + color: UiColors.primary.withOpacity(0.08), + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: UiColors.primary.withOpacity(0.2), + ), + ), + child: Text( + action!, + style: UiTypography.body3r.copyWith(color: UiColors.primary), + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/shift_card.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/shift_card.dart new file mode 100644 index 00000000..3990fe9c --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/shift_card.dart @@ -0,0 +1,441 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:lucide_icons/lucide_icons.dart'; +import 'package:intl/intl.dart'; + +import 'package:design_system/design_system.dart'; +import 'package:staff_home/src/domain/entities/shift.dart'; + +class ShiftCard extends StatefulWidget { + final Shift shift; + final VoidCallback? onApply; + final VoidCallback? onDecline; + final bool compact; + final bool disableTapNavigation; // Added property + + const ShiftCard({ + super.key, + required this.shift, + this.onApply, + this.onDecline, + this.compact = false, + this.disableTapNavigation = false, + }); + + @override + State createState() => _ShiftCardState(); +} + +class _ShiftCardState extends State { + bool isExpanded = false; + + String _formatTime(String time) { + if (time.isEmpty) return ''; + try { + final parts = time.split(':'); + final hour = int.parse(parts[0]); + final minute = int.parse(parts[1]); + final dt = DateTime(2022, 1, 1, hour, minute); + return DateFormat('h:mma').format(dt).toLowerCase(); + } catch (e) { + return time; + } + } + + String _formatDate(String dateStr) { + if (dateStr.isEmpty) return ''; + try { + final date = DateTime.parse(dateStr); + return DateFormat('MMMM d').format(date); + } catch (e) { + return dateStr; + } + } + + String _getTimeAgo(String dateStr) { + if (dateStr.isEmpty) return ''; + try { + final date = DateTime.parse(dateStr); + final diff = DateTime.now().difference(date); + if (diff.inHours < 1) return 'Just now'; + if (diff.inHours < 24) return 'Pending ${diff.inHours}h ago'; + return 'Pending ${diff.inDays}d ago'; + } catch (e) { + return ''; + } + } + + @override + Widget build(BuildContext context) { + if (widget.compact) { + return GestureDetector( + onTap: widget.disableTapNavigation + ? null + : () { + setState(() => isExpanded = !isExpanded); + Modular.to.pushNamed( + '/shift-details/${widget.shift.id}', + arguments: widget.shift, + ); + }, + child: Container( + margin: const EdgeInsets.only(bottom: 12), + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16), + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: Colors.black.withValues(alpha: 0.05), + blurRadius: 2, + offset: const Offset(0, 1), + ), + ], + ), + child: Row( + children: [ + Container( + width: 48, + height: 48, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: UiColors.border), + ), + child: widget.shift.logoUrl != null + ? ClipRRect( + borderRadius: BorderRadius.circular(12), + child: Image.network( + widget.shift.logoUrl!, + fit: BoxFit.contain, + ), + ) + : const Icon( + LucideIcons.building2, + color: UiColors.mutedForeground, + ), + ), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + child: Text( + widget.shift.title, + style: const TextStyle( + fontWeight: FontWeight.w600, + color: UiColors.foreground, + ), + overflow: TextOverflow.ellipsis, + ), + ), + Text.rich( + TextSpan( + text: '\$${widget.shift.hourlyRate}', + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: UiColors.foreground, + ), + children: const [ + TextSpan( + text: '/h', + style: TextStyle( + fontWeight: FontWeight.normal, + fontSize: 12, + ), + ), + ], + ), + ), + ], + ), + Text( + widget.shift.clientName, + style: const TextStyle( + color: UiColors.mutedForeground, + fontSize: 13, + ), + overflow: TextOverflow.ellipsis, + ), + const SizedBox(height: 4), + Text( + '${_formatTime(widget.shift.startTime)} β€’ ${widget.shift.location}', + style: const TextStyle( + color: UiColors.mutedForeground, + fontSize: 12, + ), + ), + ], + ), + ), + ], + ), + ), + ); + } + + return Container( + margin: const EdgeInsets.only(bottom: 16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16), + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: Colors.black.withValues(alpha: 0.05), + blurRadius: 4, + offset: const Offset(0, 2), + ), + ], + ), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(20), + child: Column( + children: [ + // Header + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 56, + height: 56, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: UiColors.border), + ), + child: widget.shift.logoUrl != null + ? ClipRRect( + borderRadius: BorderRadius.circular(12), + child: Image.network( + widget.shift.logoUrl!, + fit: BoxFit.contain, + ), + ) + : const Icon( + LucideIcons.building2, + size: 28, + color: UiColors.primary, + ), + ), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 6, + ), + decoration: BoxDecoration( + color: UiColors.primary, + borderRadius: BorderRadius.circular(20), + ), + child: Text( + 'Assigned ${_getTimeAgo(widget.shift.createdDate).replaceAll('Pending ', '')}', + style: const TextStyle( + color: Colors.white, + fontSize: 12, + fontWeight: FontWeight.w600, + ), + ), + ), + ], + ), + const SizedBox(height: 16), + + // Title and Rate + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.shift.title, + style: const TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + color: UiColors.foreground, + ), + ), + Text( + widget.shift.clientName, + style: const TextStyle( + color: UiColors.mutedForeground, + fontSize: 14, + ), + ), + ], + ), + ), + Text.rich( + TextSpan( + text: '\$${widget.shift.hourlyRate}', + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20, + color: UiColors.foreground, + ), + children: const [ + TextSpan( + text: '/h', + style: TextStyle( + fontWeight: FontWeight.normal, + fontSize: 16, + ), + ), + ], + ), + ), + ], + ), + const SizedBox(height: 16), + + // Location and Date + Row( + children: [ + const Icon( + LucideIcons.mapPin, + size: 16, + color: UiColors.mutedForeground, + ), + const SizedBox(width: 6), + Expanded( + child: Text( + widget.shift.location, + style: const TextStyle( + color: UiColors.mutedForeground, + fontSize: 14, + ), + overflow: TextOverflow.ellipsis, + ), + ), + const SizedBox(width: 16), + const Icon( + LucideIcons.calendar, + size: 16, + color: UiColors.mutedForeground, + ), + const SizedBox(width: 6), + Text( + '${_formatDate(widget.shift.date)}, ${_formatTime(widget.shift.startTime)}', + style: const TextStyle( + color: UiColors.mutedForeground, + fontSize: 14, + ), + ), + ], + ), + const SizedBox(height: 16), + + // Tags + Wrap( + spacing: 8, + runSpacing: 8, + children: [ + _buildTag( + LucideIcons.zap, + 'Immediate start', + UiColors.accent.withValues(alpha: 0.3), + UiColors.foreground, + ), + _buildTag( + LucideIcons.timer, + 'No experience', + const Color(0xFFFEE2E2), + const Color(0xFFDC2626), + ), + ], + ), + + const SizedBox(height: 16), + ], + ), + ), + + // Actions + if (!widget.compact) + Padding( + padding: const EdgeInsets.fromLTRB(20, 0, 20, 0), + child: Column( + children: [ + SizedBox( + width: double.infinity, + height: 48, + child: ElevatedButton( + onPressed: widget.onApply, + style: ElevatedButton.styleFrom( + backgroundColor: UiColors.foreground, + foregroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text( + 'Accept shift', + style: TextStyle(fontWeight: FontWeight.w600), + ), + ), + ), + const SizedBox(height: 8), + SizedBox( + width: double.infinity, + height: 48, + child: OutlinedButton( + onPressed: widget.onDecline, + style: OutlinedButton.styleFrom( + foregroundColor: const Color(0xFFEF4444), + side: const BorderSide(color: Color(0xFFFCA5A5)), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text( + 'Decline shift', + style: TextStyle(fontWeight: FontWeight.w600), + ), + ), + ), + ], + ), + ), + ], + ), + ); + } + + Widget _buildTag(IconData icon, String label, Color bg, Color text) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), + decoration: BoxDecoration( + color: bg, + borderRadius: BorderRadius.circular(20), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(icon, size: 14, color: text), + const SizedBox(width: 4), + Flexible( + child: Text( + label, + style: TextStyle( + color: text, + fontSize: 12, + fontWeight: FontWeight.w600, + ), + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/worker/auto_match_toggle.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/worker/auto_match_toggle.dart new file mode 100644 index 00000000..0813dbfe --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/worker/auto_match_toggle.dart @@ -0,0 +1,163 @@ +import 'package:flutter/material.dart'; +import 'package:lucide_icons/lucide_icons.dart'; + +import 'package:core_localization/core_localization.dart'; + +/// Toggle widget for auto-match feature, using design system tokens. +class AutoMatchToggle extends StatefulWidget { + /// Whether auto-match is enabled. + final bool enabled; + /// Callback when toggled. + final ValueChanged onToggle; + + /// Creates an [AutoMatchToggle]. + const AutoMatchToggle({super.key, required this.enabled, required this.onToggle}); + + @override + State createState() => _AutoMatchToggleState(); +} + +class _AutoMatchToggleState extends State with SingleTickerProviderStateMixin { + @override + Widget build(BuildContext context) { + final i18n = t.staff.home.auto_match; + final Color primary = Theme.of(context).colorScheme.primary; + return AnimatedContainer( + duration: const Duration(milliseconds: 300), + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16), + gradient: widget.enabled + ? LinearGradient( + colors: [primary, primary.withOpacity(0.8)], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ) + : null, + color: widget.enabled ? null : Colors.white, + border: widget.enabled ? null : Border.all(color: Colors.grey.shade200), + boxShadow: widget.enabled + ? [ + BoxShadow( + color: primary.withOpacity(0.3), + blurRadius: 10, + offset: const Offset(0, 4), + ), + ] + : null, + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: widget.enabled + ? Colors.white.withOpacity(0.2) + : primary.withOpacity(0.1), + borderRadius: BorderRadius.circular(12), + ), + child: Icon( + LucideIcons.zap, + color: widget.enabled ? Colors.white : primary, + size: 20, + ), + ), + const SizedBox(width: 12), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + i18n.title, + style: TextStyle( + fontWeight: FontWeight.bold, + color: widget.enabled ? Colors.white : const Color(0xFF0F172A), + ), + ), + Text( + widget.enabled ? i18n.finding_shifts : i18n.get_matched, + style: TextStyle( + fontSize: 12, + color: widget.enabled ? const Color(0xFFF8E08E) : Colors.grey.shade500, + ), + ), + ], + ), + ], + ), + Switch( + value: widget.enabled, + onChanged: widget.onToggle, + activeThumbColor: Colors.white, + activeTrackColor: Colors.white.withValues(alpha: 0.3), + inactiveThumbColor: Colors.white, + inactiveTrackColor: Colors.grey.shade300, + ), + ], + ), + AnimatedSize( + duration: const Duration(milliseconds: 300), + child: widget.enabled + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 16), + Container( + height: 1, + color: Colors.white.withValues(alpha: 0.2), + ), + const SizedBox(height: 16), + Text( + i18n.matching_based_on, + style: const TextStyle( + color: Color(0xFFF8E08E), + fontSize: 12, + ), + ), + const SizedBox(height: 12), + Wrap( + spacing: 8, + children: [ + _buildChip(LucideIcons.mapPin, i18n.chips.location), + _buildChip( + LucideIcons.clock, + i18n.chips.availability, + ), + _buildChip(LucideIcons.briefcase, i18n.chips.skills), + ], + ), + ], + ) + : const SizedBox.shrink(), + ), + ], + ), + ); + } + + Widget _buildChip(IconData icon, String label) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + color: Colors.white.withValues(alpha: 0.2), + borderRadius: BorderRadius.circular(8), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(icon, size: 12, color: Colors.white), + const SizedBox(width: 4), + Text( + label, + style: const TextStyle(color: Colors.white, fontSize: 12), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/worker/benefits_widget.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/worker/benefits_widget.dart new file mode 100644 index 00000000..8826ea0c --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/worker/benefits_widget.dart @@ -0,0 +1,195 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:lucide_icons/lucide_icons.dart'; +import 'dart:math' as math; + +import 'package:core_localization/core_localization.dart'; + + +/// Widget for displaying staff benefits, using design system tokens. +class BenefitsWidget extends StatelessWidget { + /// Creates a [BenefitsWidget]. + const BenefitsWidget({super.key}); + + @override + Widget build(BuildContext context) { + final i18n = t.staff.home.benefits; + return Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.background, + borderRadius: BorderRadius.circular(16), + border: Border.all(color: Theme.of(context).dividerColor), + boxShadow: [ + BoxShadow( + color: Theme.of(context).colorScheme.onBackground.withOpacity(0.05), + blurRadius: 2, + offset: const Offset(0, 1), + ), + ], + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + i18n.title, + style: Theme.of(context).textTheme.titleMedium, + ), + GestureDetector( + onTap: () => Modular.to.pushNamed('/benefits'), + child: Row( + children: [ + Text( + i18n.view_all, + style: Theme.of(context).textTheme.labelLarge?.copyWith(color: Theme.of(context).colorScheme.primary), + ), + Icon( + LucideIcons.chevronRight, + size: 16, + color: Theme.of(context).colorScheme.primary, + ), + ], + ), + ), + ], + ), + const SizedBox(height: 16), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + _BenefitItem( + label: i18n.items.sick_days, + current: 10, + total: 40, + color: Theme.of(context).colorScheme.primary, + ), + _BenefitItem( + label: i18n.items.vacation, + current: 40, + total: 40, + color: Theme.of(context).colorScheme.primary, + ), + _BenefitItem( + label: i18n.items.holidays, + current: 24, + total: 24, + color: Theme.of(context).colorScheme.primary, + ), + ], + ), + ], + ), + ); + } +} + +class _BenefitItem extends StatelessWidget { + final String label; + final double current; + final double total; + final Color color; + + const _BenefitItem({ + required this.label, + required this.current, + required this.total, + required this.color, + }); + + @override + Widget build(BuildContext context) { + final i18n = t.staff.home.benefits; + return Column( + children: [ + SizedBox( + width: 56, + height: 56, + child: CustomPaint( + painter: _CircularProgressPainter( + progress: current / total, + color: color, + backgroundColor: const Color(0xFFE5E7EB), + strokeWidth: 4, + ), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '${current.toInt()}/${total.toInt()}', + style: const TextStyle( + fontSize: 12, + fontWeight: FontWeight.bold, + color: Color(0xFF1E293B), + ), + ), + Text( + i18n.hours_label, + style: const TextStyle( + fontSize: 8, + color: Color(0xFF94A3B8), + ), + ), + ], + ), + ), + ), + ), + const SizedBox(height: 8), + Text( + label, + style: const TextStyle( + fontSize: 12, + fontWeight: FontWeight.w500, + color: Color(0xFF475569), + ), + ), + ], + ); + } +} + +class _CircularProgressPainter extends CustomPainter { + final double progress; + final Color color; + final Color backgroundColor; + final double strokeWidth; + + _CircularProgressPainter({ + required this.progress, + required this.color, + required this.backgroundColor, + required this.strokeWidth, + }); + + @override + void paint(Canvas canvas, Size size) { + final center = Offset(size.width / 2, size.height / 2); + final radius = (size.width - strokeWidth) / 2; + + final backgroundPaint = Paint() + ..color = backgroundColor + ..style = PaintingStyle.stroke + ..strokeWidth = strokeWidth; + canvas.drawCircle(center, radius, backgroundPaint); + + final progressPaint = Paint() + ..color = color + ..style = PaintingStyle.stroke + ..strokeWidth = strokeWidth + ..strokeCap = StrokeCap.round; + final sweepAngle = 2 * math.pi * progress; + canvas.drawArc( + Rect.fromCircle(center: center, radius: radius), + -math.pi / 2, + sweepAngle, + false, + progressPaint, + ); + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) => true; +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/worker/improve_yourself_widget.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/worker/improve_yourself_widget.dart new file mode 100644 index 00000000..91d3d4af --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/worker/improve_yourself_widget.dart @@ -0,0 +1,113 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:core_localization/core_localization.dart'; + +/// Widget for displaying self-improvement resources, using design system tokens. +class ImproveYourselfWidget extends StatelessWidget { + /// Creates an [ImproveYourselfWidget]. + const ImproveYourselfWidget({super.key}); + + @override + Widget build(BuildContext context) { + final i18n = t.staff.home.improve; + final items = [ + { + 'id': 'training', + 'title': i18n.items.training.title, + 'description': i18n.items.training.description, + 'image': 'https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?w=400&h=300&fit=crop', + 'page': i18n.items.training.page, + }, + { + 'id': 'podcast', + 'title': i18n.items.podcast.title, + 'description': i18n.items.podcast.description, + 'image': 'https://images.unsplash.com/photo-1478737270239-2f02b77fc618?w=400&h=300&fit=crop', + 'page': i18n.items.podcast.page, + }, + ]; + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + i18n.title, + style: Theme.of(context).textTheme.titleMedium, + ), + const SizedBox(height: 12), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + clipBehavior: Clip.none, + child: Row( + children: items.map((item) => _buildCard(context, item)).toList(), + ), + ), + ], + ); + } + + Widget _buildCard(BuildContext context, Map item) { + return GestureDetector( + onTap: () => Modular.to.pushNamed(item['page']!), + child: Container( + width: 160, + margin: const EdgeInsets.only(right: 12), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.background, + borderRadius: BorderRadius.circular(16), + border: Border.all(color: Theme.of(context).dividerColor), + boxShadow: [ + BoxShadow( + color: Theme.of(context).colorScheme.onBackground.withOpacity(0.05), + blurRadius: 2, + offset: const Offset(0, 1), + ), + ], + ), + clipBehavior: Clip.antiAlias, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 96, + width: double.infinity, + child: Image.network( + item['image']!, + fit: BoxFit.cover, + errorBuilder: (context, error, stackTrace) => Container( + color: Theme.of(context).colorScheme.surfaceVariant, + child: const Icon( + Icons.image_not_supported, + color: Colors.grey, + ), + ), + ), + ), + Padding( + padding: const EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + item['title']!, + style: Theme.of(context).textTheme.titleSmall, + ), + const SizedBox(height: 2), + Text( + item['description']!, + style: const TextStyle( + fontSize: 12, + color: Color(0xFF64748B), + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/worker/more_ways_widget.dart b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/worker/more_ways_widget.dart new file mode 100644 index 00000000..947e2be9 --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/presentation/widgets/worker/more_ways_widget.dart @@ -0,0 +1,97 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:core_localization/core_localization.dart'; + + +/// Widget for displaying more ways to use Krow, using design system tokens. +class MoreWaysToUseKrowWidget extends StatelessWidget { + /// Creates a [MoreWaysToUseKrowWidget]. + const MoreWaysToUseKrowWidget({super.key}); + + @override + Widget build(BuildContext context) { + final i18n = t.staff.home.more_ways; + final items = [ + { + 'id': 'benefits', + 'title': i18n.items.benefits.title, + 'image': 'https://images.unsplash.com/photo-1481627834876-b7833e8f5570?w=400&h=300&fit=crop', + 'page': i18n.items.benefits.page, + }, + { + 'id': 'refer', + 'title': i18n.items.refer.title, + 'image': 'https://images.unsplash.com/photo-1529156069898-49953e39b3ac?w=400&h=300&fit=crop', + 'page': i18n.items.refer.page, + }, + ]; + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + i18n.title, + style: Theme.of(context).textTheme.titleMedium, + ), + const SizedBox(height: 12), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + clipBehavior: Clip.none, + child: Row( + children: items.map((item) => _buildCard(context, item)).toList(), + ), + ), + ], + ); + } + + Widget _buildCard(BuildContext context, Map item) { + return GestureDetector( + onTap: () => Modular.to.pushNamed(item['page']!), + child: Container( + width: 160, + margin: const EdgeInsets.only(right: 12), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.background, + borderRadius: BorderRadius.circular(16), + border: Border.all(color: Theme.of(context).dividerColor), + boxShadow: [ + BoxShadow( + color: Theme.of(context).colorScheme.onBackground.withOpacity(0.05), + blurRadius: 2, + offset: const Offset(0, 1), + ), + ], + ), + clipBehavior: Clip.antiAlias, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 96, + width: double.infinity, + child: Image.network( + item['image']!, + fit: BoxFit.cover, + errorBuilder: (context, error, stackTrace) => Container( + color: Theme.of(context).colorScheme.surfaceVariant, + child: const Icon( + Icons.image_not_supported, + color: Colors.grey, + ), + ), + ), + ), + Padding( + padding: const EdgeInsets.all(12), + child: Text( + item['title']!, + style: Theme.of(context).textTheme.titleSmall, + ), + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/src/staff_home_module.dart b/apps/mobile/packages/features/staff/home/lib/src/staff_home_module.dart new file mode 100644 index 00000000..f04002fd --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/src/staff_home_module.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:staff_home/src/data/repositories/home_repository_impl.dart'; +import 'package:staff_home/src/data/services/mock_service.dart'; +import 'package:staff_home/src/domain/repositories/home_repository.dart'; +import 'package:staff_home/src/presentation/blocs/home_cubit.dart'; +import 'package:staff_home/src/presentation/pages/worker_home_page.dart'; + +/// The module for the staff home feature. +/// +/// This module provides dependency injection bindings for the home feature +/// following Clean Architecture principles. It injects the repository +/// implementation and state management components. +class StaffHomeModule extends Module { + @override + void binds(Injector i) { + // Data layer - Mock service (will be replaced with real implementation) + i.addLazySingleton(MockService.new); + + // Repository + i.addLazySingleton( + () => HomeRepositoryImpl(i.get()), + ); + + // Presentation layer - Cubit + i.addSingleton(HomeCubit.new); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (BuildContext context) => const WorkerHomePage()); + } +} diff --git a/apps/mobile/packages/features/staff/home/lib/staff_home.dart b/apps/mobile/packages/features/staff/home/lib/staff_home.dart new file mode 100644 index 00000000..c2e7bb10 --- /dev/null +++ b/apps/mobile/packages/features/staff/home/lib/staff_home.dart @@ -0,0 +1,8 @@ +/// Staff Home Feature Library +/// +/// This library exports the public API for the staff home feature, +/// following Clean Architecture principles. Only the module is exported +/// as it contains all necessary bindings and routes for integration. +library; + +export 'src/staff_home_module.dart'; diff --git a/apps/mobile/packages/features/staff/home/pubspec.yaml b/apps/mobile/packages/features/staff/home/pubspec.yaml new file mode 100644 index 00000000..6bd6a880 --- /dev/null +++ b/apps/mobile/packages/features/staff/home/pubspec.yaml @@ -0,0 +1,40 @@ +name: staff_home +description: Home feature for the staff application. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + bloc: ^8.1.0 + flutter_modular: ^6.3.0 + equatable: ^2.0.5 + lucide_icons: ^0.257.0 + intl: ^0.20.0 + google_fonts: ^7.0.0 + + # Architecture Packages + design_system: + path: ../../../design_system + core_localization: + path: ../../../core_localization + krow_core: + path: ../../../core + krow_domain: + path: ../../../domain + +dev_dependencies: + flutter_test: + sdk: flutter + bloc_test: ^9.1.0 + mocktail: ^1.0.0 + flutter_lints: ^6.0.0 + +flutter: + uses-material-design: true diff --git a/apps/mobile/packages/features/staff/payments/lib/src/data/datasources/payments_mock_datasource.dart b/apps/mobile/packages/features/staff/payments/lib/src/data/datasources/payments_mock_datasource.dart new file mode 100644 index 00000000..2b084c46 --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/data/datasources/payments_mock_datasource.dart @@ -0,0 +1,67 @@ +// ignore: depend_on_referenced_packages +import 'package:flutter/foundation.dart'; +import '../../domain/entities/payment_summary.dart'; +import '../../domain/entities/payment_transaction.dart'; +import 'payments_remote_datasource.dart'; + +class PaymentsMockDataSource implements PaymentsRemoteDataSource { + @override + Future fetchPaymentSummary() async { + // Simulate network delay + await Future.delayed(const Duration(milliseconds: 800)); + + // Mock data matching the prototype + return const PaymentSummary( + weeklyEarnings: 847.50, + monthlyEarnings: 3240.0, + pendingEarnings: 285.0, + totalEarnings: 12450.0, + ); + } + + @override + Future> fetchPaymentHistory(String period) async { + await Future.delayed(const Duration(milliseconds: 1000)); + + // Mock data matching the prototype + // In a real scenario, this would filter by 'period' (week/month/year) + return [ + PaymentTransaction( + id: '1', + title: 'Cook', + location: 'LA Convention Center', + address: '1201 S Figueroa St, Los Angeles, CA 90015', + workedTime: '2:00 PM - 10:00 PM', + amount: 160.00, + status: 'PAID', + hours: 8, + rate: 20.0, + date: DateTime(2025, 12, 6), // "Sat, Dec 6" (Using future date to match context if needed, but keeping it simple) + ), + PaymentTransaction( + id: '2', + title: 'Server', + location: 'The Grand Hotel', + address: '456 Main St, Los Angeles, CA 90012', + workedTime: '5:00 PM - 11:00 PM', + amount: 176.00, + status: 'PAID', + hours: 8, + rate: 22.0, + date: DateTime(2025, 12, 5), // "Fri, Dec 5" + ), + PaymentTransaction( + id: '3', + title: 'Bartender', + location: 'Club Luxe', + address: '789 Sunset Blvd, Los Angeles, CA 90028', + workedTime: '6:00 PM - 2:00 AM', + amount: 225.00, + status: 'PAID', + hours: 9, + rate: 25.0, + date: DateTime(2025, 12, 4), // "Thu, Dec 4" + ), + ]; + } +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/data/datasources/payments_remote_datasource.dart b/apps/mobile/packages/features/staff/payments/lib/src/data/datasources/payments_remote_datasource.dart new file mode 100644 index 00000000..37f24a9e --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/data/datasources/payments_remote_datasource.dart @@ -0,0 +1,7 @@ +import '../../domain/entities/payment_summary.dart'; +import '../../domain/entities/payment_transaction.dart'; + +abstract class PaymentsRemoteDataSource { + Future fetchPaymentSummary(); + Future> fetchPaymentHistory(String period); +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/data/repositories/payments_repository_impl.dart b/apps/mobile/packages/features/staff/payments/lib/src/data/repositories/payments_repository_impl.dart new file mode 100644 index 00000000..303fca7f --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/data/repositories/payments_repository_impl.dart @@ -0,0 +1,22 @@ +// ignore: unused_import +// import 'package:data_connect/data_connect.dart'; +import '../../domain/entities/payment_summary.dart'; +import '../../domain/entities/payment_transaction.dart'; +import '../../domain/repositories/payments_repository.dart'; +import '../datasources/payments_remote_datasource.dart'; + +class PaymentsRepositoryImpl implements PaymentsRepository { + final PaymentsRemoteDataSource remoteDataSource; + + PaymentsRepositoryImpl({required this.remoteDataSource}); + + @override + Future getPaymentSummary() async { + return await remoteDataSource.fetchPaymentSummary(); + } + + @override + Future> getPaymentHistory(String period) async { + return await remoteDataSource.fetchPaymentHistory(period); + } +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/data/repositories_impl/payments_repository_impl.dart b/apps/mobile/packages/features/staff/payments/lib/src/data/repositories_impl/payments_repository_impl.dart new file mode 100644 index 00000000..c599dfe5 --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/data/repositories_impl/payments_repository_impl.dart @@ -0,0 +1,15 @@ +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/repositories/payments_repository.dart'; + +class PaymentsRepositoryImpl implements PaymentsRepository { + final FinancialRepositoryMock financialRepository; + + PaymentsRepositoryImpl({required this.financialRepository}); + + @override + Future> getPayments() async { + // TODO: Get actual logged in staff ID + return await financialRepository.getStaffPayments('staff_1'); + } +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/domain/entities/payment_summary.dart b/apps/mobile/packages/features/staff/payments/lib/src/domain/entities/payment_summary.dart new file mode 100644 index 00000000..ad575833 --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/domain/entities/payment_summary.dart @@ -0,0 +1,23 @@ +import 'package:equatable/equatable.dart'; + +class PaymentSummary extends Equatable { + final double weeklyEarnings; + final double monthlyEarnings; + final double pendingEarnings; + final double totalEarnings; + + const PaymentSummary({ + required this.weeklyEarnings, + required this.monthlyEarnings, + required this.pendingEarnings, + required this.totalEarnings, + }); + + @override + List get props => [ + weeklyEarnings, + monthlyEarnings, + pendingEarnings, + totalEarnings, + ]; +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/domain/entities/payment_transaction.dart b/apps/mobile/packages/features/staff/payments/lib/src/domain/entities/payment_transaction.dart new file mode 100644 index 00000000..0b0eb7b2 --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/domain/entities/payment_transaction.dart @@ -0,0 +1,41 @@ +import 'package:equatable/equatable.dart'; + +class PaymentTransaction extends Equatable { + final String id; + final String title; + final String location; + final String address; + final DateTime date; + final String workedTime; + final double amount; + final String status; + final int hours; + final double rate; + + const PaymentTransaction({ + required this.id, + required this.title, + required this.location, + required this.address, + required this.date, + required this.workedTime, + required this.amount, + required this.status, + required this.hours, + required this.rate, + }); + + @override + List get props => [ + id, + title, + location, + address, + date, + workedTime, + amount, + status, + hours, + rate, + ]; +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/domain/repositories/payments_repository.dart b/apps/mobile/packages/features/staff/payments/lib/src/domain/repositories/payments_repository.dart new file mode 100644 index 00000000..3ce9d8ee --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/domain/repositories/payments_repository.dart @@ -0,0 +1,6 @@ +import 'package:krow_domain/krow_domain.dart'; + +abstract class PaymentsRepository { + /// Fetches the list of payments. + Future> getPayments(); +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/domain/usecases/get_payment_history_usecase.dart b/apps/mobile/packages/features/staff/payments/lib/src/domain/usecases/get_payment_history_usecase.dart new file mode 100644 index 00000000..5686e3ef --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/domain/usecases/get_payment_history_usecase.dart @@ -0,0 +1,15 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/payments_repository.dart'; + +class GetPaymentHistoryUseCase extends UseCase> { + final PaymentsRepository repository; + + GetPaymentHistoryUseCase(this.repository); + + @override + Future> call(String period) async { + // TODO: Implement filtering by period + return await repository.getPayments(); + } +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/domain/usecases/get_payment_summary_usecase.dart b/apps/mobile/packages/features/staff/payments/lib/src/domain/usecases/get_payment_summary_usecase.dart new file mode 100644 index 00000000..3e9aff90 --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/domain/usecases/get_payment_summary_usecase.dart @@ -0,0 +1,14 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/payments_repository.dart'; + +class GetPaymentSummaryUseCase extends NoInputUseCase> { + final PaymentsRepository repository; + + GetPaymentSummaryUseCase(this.repository); + + @override + Future> call() async { + return await repository.getPayments(); + } +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/payments_module.dart b/apps/mobile/packages/features/staff/payments/lib/src/payments_module.dart new file mode 100644 index 00000000..3108e8c8 --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/payments_module.dart @@ -0,0 +1,31 @@ +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'domain/repositories/payments_repository.dart'; +import 'domain/usecases/get_payment_summary_usecase.dart'; +import 'domain/usecases/get_payment_history_usecase.dart'; +import 'data/repositories_impl/payments_repository_impl.dart'; +import 'presentation/blocs/payments/payments_bloc.dart'; +import 'presentation/pages/payments_page.dart'; + +class StaffPaymentsModule extends Module { + @override + void binds(Injector i) { + // Data Connect Mocks + i.add(FinancialRepositoryMock.new); + + // Repositories + i.add(PaymentsRepositoryImpl.new); + + // Use Cases + i.add(GetPaymentSummaryUseCase.new); + i.add(GetPaymentHistoryUseCase.new); + + // Blocs + i.add(PaymentsBloc.new); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (context) => const PaymentsPage()); + } +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/presentation/blocs/payments/payments_bloc.dart b/apps/mobile/packages/features/staff/payments/lib/src/presentation/blocs/payments/payments_bloc.dart new file mode 100644 index 00000000..fedaa862 --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/presentation/blocs/payments/payments_bloc.dart @@ -0,0 +1,94 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../../domain/usecases/get_payment_summary_usecase.dart'; +import '../../../domain/usecases/get_payment_history_usecase.dart'; +import '../../models/payment_stats.dart'; +import 'payments_event.dart'; +import 'payments_state.dart'; + +class PaymentsBloc extends Bloc { + final GetPaymentSummaryUseCase getPaymentSummary; + final GetPaymentHistoryUseCase getPaymentHistory; + + PaymentsBloc({ + required this.getPaymentSummary, + required this.getPaymentHistory, + }) : super(PaymentsInitial()) { + on(_onLoadPayments); + on(_onChangePeriod); + } + + Future _onLoadPayments( + LoadPaymentsEvent event, + Emitter emit, + ) async { + emit(PaymentsLoading()); + try { + final List allPayments = await getPaymentSummary(); + final PaymentStats stats = _calculateStats(allPayments); + + final List history = await getPaymentHistory('week'); + emit(PaymentsLoaded( + summary: stats, + history: history, + activePeriod: 'week', + )); + } catch (e) { + emit(PaymentsError(e.toString())); + } + } + + Future _onChangePeriod( + ChangePeriodEvent event, + Emitter emit, + ) async { + final PaymentsState currentState = state; + if (currentState is PaymentsLoaded) { + if (currentState.activePeriod == event.period) return; + + try { + final List newHistory = await getPaymentHistory(event.period); + emit(currentState.copyWith( + history: newHistory, + activePeriod: event.period, + )); + } catch (e) { + emit(PaymentsError(e.toString())); + } + } + } + + PaymentStats _calculateStats(List payments) { + double total = 0; + double pending = 0; + double weekly = 0; + double monthly = 0; + + final DateTime now = DateTime.now(); + + for (final StaffPayment p in payments) { + // Assuming all payments count towards total history + total += p.amount; + + if (p.status == PaymentStatus.pending) { + pending += p.amount; + } + + if (p.paidAt != null) { + if (now.difference(p.paidAt!).inDays < 7) { + weekly += p.amount; + } + if (now.month == p.paidAt!.month && now.year == p.paidAt!.year) { + monthly += p.amount; + } + } + } + + return PaymentStats( + totalEarnings: total, + pendingEarnings: pending, + weeklyEarnings: weekly, + monthlyEarnings: monthly, + ); + } +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/presentation/blocs/payments/payments_event.dart b/apps/mobile/packages/features/staff/payments/lib/src/presentation/blocs/payments/payments_event.dart new file mode 100644 index 00000000..86aceffd --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/presentation/blocs/payments/payments_event.dart @@ -0,0 +1,20 @@ +import 'package:bloc/bloc.dart'; +import 'package:equatable/equatable.dart'; + +abstract class PaymentsEvent extends Equatable { + const PaymentsEvent(); + + @override + List get props => []; +} + +class LoadPaymentsEvent extends PaymentsEvent {} + +class ChangePeriodEvent extends PaymentsEvent { + final String period; + + const ChangePeriodEvent(this.period); + + @override + List get props => [period]; +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/presentation/blocs/payments/payments_state.dart b/apps/mobile/packages/features/staff/payments/lib/src/presentation/blocs/payments/payments_state.dart new file mode 100644 index 00000000..14e3af61 --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/presentation/blocs/payments/payments_state.dart @@ -0,0 +1,50 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../models/payment_stats.dart'; + +abstract class PaymentsState extends Equatable { + const PaymentsState(); + + @override + List get props => []; +} + +class PaymentsInitial extends PaymentsState {} + +class PaymentsLoading extends PaymentsState {} + +class PaymentsLoaded extends PaymentsState { + final PaymentStats summary; + final List history; + final String activePeriod; + + const PaymentsLoaded({ + required this.summary, + required this.history, + this.activePeriod = 'week', + }); + + PaymentsLoaded copyWith({ + PaymentStats? summary, + List? history, + String? activePeriod, + }) { + return PaymentsLoaded( + summary: summary ?? this.summary, + history: history ?? this.history, + activePeriod: activePeriod ?? this.activePeriod, + ); + } + + @override + List get props => [summary, history, activePeriod]; +} + +class PaymentsError extends PaymentsState { + final String message; + + const PaymentsError(this.message); + + @override + List get props => [message]; +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/presentation/models/payment_stats.dart b/apps/mobile/packages/features/staff/payments/lib/src/presentation/models/payment_stats.dart new file mode 100644 index 00000000..41ddb91a --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/presentation/models/payment_stats.dart @@ -0,0 +1,23 @@ +import 'package:equatable/equatable.dart'; + +class PaymentStats extends Equatable { + final double weeklyEarnings; + final double monthlyEarnings; + final double pendingEarnings; + final double totalEarnings; + + const PaymentStats({ + this.weeklyEarnings = 0.0, + this.monthlyEarnings = 0.0, + this.pendingEarnings = 0.0, + this.totalEarnings = 0.0, + }); + + @override + List get props => [ + weeklyEarnings, + monthlyEarnings, + pendingEarnings, + totalEarnings, + ]; +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/presentation/pages/payments_page.dart b/apps/mobile/packages/features/staff/payments/lib/src/presentation/pages/payments_page.dart new file mode 100644 index 00000000..d82f3588 --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/presentation/pages/payments_page.dart @@ -0,0 +1,259 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:lucide_icons/lucide_icons.dart'; +import 'package:intl/intl.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../blocs/payments/payments_bloc.dart'; +import '../blocs/payments/payments_event.dart'; +import '../blocs/payments/payments_state.dart'; +import '../widgets/payment_stats_card.dart'; +import '../widgets/pending_pay_card.dart'; +import '../widgets/payment_history_item.dart'; + +class PaymentsPage extends StatefulWidget { + const PaymentsPage({super.key}); + + @override + State createState() => _PaymentsPageState(); +} + +class _PaymentsPageState extends State { + final PaymentsBloc _bloc = Modular.get(); + + @override + void initState() { + super.initState(); + _bloc.add(LoadPaymentsEvent()); + } + + @override + Widget build(BuildContext context) { + return BlocProvider.value( + value: _bloc, + child: Scaffold( + backgroundColor: const Color(0xFFF8FAFC), + body: BlocBuilder( + builder: (BuildContext context, PaymentsState state) { + if (state is PaymentsLoading) { + return const Center(child: CircularProgressIndicator()); + } else if (state is PaymentsError) { + return Center(child: Text('Error: ${state.message}')); + } else if (state is PaymentsLoaded) { + return _buildContent(context, state); + } + return const SizedBox.shrink(); + }, + ), + ), + ); + } + + Widget _buildContent(BuildContext context, PaymentsLoaded state) { + return SingleChildScrollView( + child: Column( + children: [ + // Header Section with Gradient + Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + colors: [Color(0xFF0032A0), Color(0xFF333F48)], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + ), + padding: EdgeInsets.fromLTRB( + 20, + MediaQuery.of(context).padding.top + 24, + 20, + 32, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Earnings", + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + const SizedBox(height: 24), + + // Main Balance + Center( + child: Column( + children: [ + const Text( + "Total Earnings", + style: TextStyle( + color: Color(0xFFF8E08E), + fontSize: 14, + ), + ), + const SizedBox(height: 4), + Text( + "\$${state.summary.totalEarnings.toStringAsFixed(0).replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},')}", + style: const TextStyle( + fontSize: 36, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ], + ), + ), + const SizedBox(height: 16), + + // Period Tabs + Container( + padding: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.2), + borderRadius: BorderRadius.circular(12), + ), + child: Row( + children: [ + _buildTab("Week", 'week', state.activePeriod), + _buildTab("Month", 'month', state.activePeriod), + _buildTab("Year", 'year', state.activePeriod), + ], + ), + ), + ], + ), + ), + + // Main Content - Offset upwards + Transform.translate( + offset: const Offset(0, -16), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Quick Stats + Row( + children: [ + Expanded( + child: PaymentStatsCard( + icon: LucideIcons.trendingUp, + iconColor: const Color(0xFF059669), + label: "This Week", + amount: "\$${state.summary.weeklyEarnings}", + ), + ), + const SizedBox(width: 12), + Expanded( + child: PaymentStatsCard( + icon: LucideIcons.calendar, + iconColor: const Color(0xFF2563EB), + label: "This Month", + amount: "\$${state.summary.monthlyEarnings.toStringAsFixed(0)}", + ), + ), + ], + ), + const SizedBox(height: 16), + + // Pending Pay + PendingPayCard( + amount: state.summary.pendingEarnings, + onCashOut: () { + Modular.to.pushNamed('/early-pay'); + }, + ), + const SizedBox(height: 24), + + // Recent Payments + const Text( + "Recent Payments", + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + color: Color(0xFF0F172A), + ), + ), + const SizedBox(height: 12), + Column( + children: state.history.map((StaffPayment payment) { + return Padding( + padding: const EdgeInsets.only(bottom: 8), + child: PaymentHistoryItem( + amount: payment.amount, + title: 'Assignment ${payment.assignmentId}', + location: 'Location', // TODO: Fetch from assignment + address: '', + date: payment.paidAt != null ? DateFormat('E, MMM d').format(payment.paidAt!) : 'Pending', + workedTime: '00:00 - 00:00', // TODO: Fetch from assignment + hours: 0, + rate: 0, + status: payment.status.toString().split('.').last, + ), + ); + }).toList(), + ), + const SizedBox(height: 16), + + // Export History Button + SizedBox( + width: double.infinity, + height: 48, + child: OutlinedButton.icon( + onPressed: () { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar( + content: Text('PDF Exported'), + duration: Duration(seconds: 2), + ), + ); + }, + icon: const Icon(LucideIcons.download, size: 16), + label: const Text("Export History"), + style: OutlinedButton.styleFrom( + foregroundColor: const Color(0xFF0F172A), + side: const BorderSide(color: Color(0xFFE2E8F0)), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + const SizedBox(height: 32), + ], + ), + ), + ), + ], + ), + ); + } + + Widget _buildTab(String label, String value, String activePeriod) { + final bool isSelected = activePeriod == value; + return Expanded( + child: GestureDetector( + onTap: () => _bloc.add(ChangePeriodEvent(value)), + child: Container( + padding: const EdgeInsets.symmetric(vertical: 8), + decoration: BoxDecoration( + color: isSelected ? Colors.white : Colors.transparent, + borderRadius: BorderRadius.circular(8), + ), + child: Center( + child: Text( + label, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: isSelected ? const Color(0xFF0032A0) : Colors.white, + ), + ), + ), + ), + ), + ); + } +} + diff --git a/apps/mobile/packages/features/staff/payments/lib/src/presentation/widgets/payment_history_item.dart b/apps/mobile/packages/features/staff/payments/lib/src/presentation/widgets/payment_history_item.dart new file mode 100644 index 00000000..9c49df1e --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/presentation/widgets/payment_history_item.dart @@ -0,0 +1,209 @@ +import 'package:flutter/material.dart'; +import 'package:lucide_icons/lucide_icons.dart'; + +class PaymentHistoryItem extends StatelessWidget { + final double amount; + final String title; + final String location; + final String address; + final String date; + final String workedTime; + final int hours; + final double rate; + final String status; + + const PaymentHistoryItem({ + super.key, + required this.amount, + required this.title, + required this.location, + required this.address, + required this.date, + required this.workedTime, + required this.hours, + required this.rate, + required this.status, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.05), + blurRadius: 2, + offset: const Offset(0, 1), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Status Badge + Row( + children: [ + Container( + width: 6, + height: 6, + decoration: const BoxDecoration( + color: Color(0xFF3B82F6), // blue-500 + shape: BoxShape.circle, + ), + ), + const SizedBox(width: 6), + const Text( + "PAID", + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.w700, + color: Color(0xFF2563EB), // blue-600 + letterSpacing: 0.5, + ), + ), + ], + ), + const SizedBox(height: 12), + + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Icon + Container( + width: 44, + height: 44, + decoration: BoxDecoration( + color: const Color(0xFFF1F5F9), // slate-100 + borderRadius: BorderRadius.circular(12), + ), + child: const Icon( + LucideIcons.dollarSign, + color: Color(0xFF334155), // slate-700 + size: 24, + ), + ), + const SizedBox(width: 12), + + // Content + Expanded( + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + color: Color(0xFF0F172A), // slate-900 + ), + ), + Text( + location, + style: const TextStyle( + fontSize: 12, + color: Color(0xFF475569), // slate-600 + ), + ), + ], + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + "\$${amount.toStringAsFixed(0)}", + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: Color(0xFF0F172A), // slate-900 + ), + ), + Text( + "\$${rate.toStringAsFixed(0)}/hr Β· ${hours}h", + style: const TextStyle( + fontSize: 10, + color: Color(0xFF64748B), // slate-500 + ), + ), + ], + ), + ], + ), + const SizedBox(height: 8), + + // Date and Time + Row( + children: [ + const Icon( + LucideIcons.calendar, + size: 12, + color: Color(0xFF64748B), + ), + const SizedBox(width: 8), + Text( + date, + style: const TextStyle( + fontSize: 12, + color: Color(0xFF64748B), + ), + ), + const SizedBox(width: 8), + const Icon( + LucideIcons.clock, + size: 12, + color: Color(0xFF64748B), + ), + const SizedBox(width: 8), + Text( + workedTime, + style: const TextStyle( + fontSize: 12, + color: Color(0xFF64748B), + ), + ), + ], + ), + const SizedBox(height: 4), + + // Address + Row( + children: [ + const Icon( + LucideIcons.mapPin, + size: 12, + color: Color(0xFF64748B), + ), + const SizedBox(width: 8), + Expanded( + child: Text( + address, + style: const TextStyle( + fontSize: 12, + color: Color(0xFF64748B), + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ], + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/presentation/widgets/payment_stats_card.dart b/apps/mobile/packages/features/staff/payments/lib/src/presentation/widgets/payment_stats_card.dart new file mode 100644 index 00000000..aad2cf9b --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/presentation/widgets/payment_stats_card.dart @@ -0,0 +1,62 @@ +import 'package:flutter/material.dart'; +import 'package:lucide_icons/lucide_icons.dart'; + +class PaymentStatsCard extends StatelessWidget { + final IconData icon; + final Color iconColor; + final String label; + final String amount; + + const PaymentStatsCard({ + super.key, + required this.icon, + required this.iconColor, + required this.label, + required this.amount, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.05), + blurRadius: 2, + offset: const Offset(0, 1), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon(icon, size: 16, color: iconColor), + const SizedBox(width: 8), + Text( + label, + style: const TextStyle( + fontSize: 12, + color: Color(0xFF64748B), // slate-500 + ), + ), + ], + ), + const SizedBox(height: 8), + Text( + amount, + style: const TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + color: Color(0xFF0F172A), // slate-900 + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/payments/lib/src/presentation/widgets/pending_pay_card.dart b/apps/mobile/packages/features/staff/payments/lib/src/presentation/widgets/pending_pay_card.dart new file mode 100644 index 00000000..3ca7c602 --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/src/presentation/widgets/pending_pay_card.dart @@ -0,0 +1,98 @@ +import 'package:flutter/material.dart'; +import 'package:lucide_icons/lucide_icons.dart'; + +class PendingPayCard extends StatelessWidget { + final double amount; + final VoidCallback onCashOut; + + const PendingPayCard({ + super.key, + required this.amount, + required this.onCashOut, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(14), + decoration: BoxDecoration( + gradient: const LinearGradient( + colors: [Color(0xFFEFF6FF), Color(0xFFEFF6FF)], // blue-50 to blue-50 + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + borderRadius: BorderRadius.circular(16), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.05), + blurRadius: 2, + offset: const Offset(0, 1), + ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: const Color(0xFFE8F0FF), + borderRadius: BorderRadius.circular(8), + ), + child: const Icon( + LucideIcons.dollarSign, + color: Color(0xFF0047FF), + size: 20, + ), + ), + const SizedBox(width: 10), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Pending", + style: TextStyle( + fontWeight: FontWeight.bold, + color: Color(0xFF0F172A), // slate-900 + fontSize: 14, + ), + ), + Text( + "\$${amount.toStringAsFixed(0)} available", + style: const TextStyle( + fontSize: 12, + color: Color(0xFF475569), // slate-600 + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ], + ), + ElevatedButton.icon( + onPressed: onCashOut, + icon: const Icon(LucideIcons.zap, size: 14), + label: const Text("Early Pay"), + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xFF0047FF), + foregroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8), + elevation: 4, + shadowColor: Colors.black.withOpacity(0.2), + textStyle: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/payments/lib/staff_payements.dart b/apps/mobile/packages/features/staff/payments/lib/staff_payements.dart new file mode 100644 index 00000000..e2e80b64 --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/lib/staff_payements.dart @@ -0,0 +1 @@ +export 'src/payments_module.dart'; diff --git a/apps/mobile/packages/features/staff/payments/pubspec.yaml b/apps/mobile/packages/features/staff/payments/pubspec.yaml new file mode 100644 index 00000000..5f3a2c18 --- /dev/null +++ b/apps/mobile/packages/features/staff/payments/pubspec.yaml @@ -0,0 +1,33 @@ +name: staff_payments +description: Staff Payments feature +version: 0.0.1 +publish_to: 'none' +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_modular: ^6.3.2 + lucide_icons: ^0.257.0 + intl: ^0.20.0 + + # Internal packages + design_system: + path: ../../../design_system + core_localization: + path: ../../../core_localization + krow_domain: + path: ../../../domain + krow_core: + path: ../../../core + krow_data_connect: + path: ../../../data_connect + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^3.0.0 diff --git a/apps/mobile/packages/features/staff/profile/lib/src/data/repositories/profile_repository_impl.dart b/apps/mobile/packages/features/staff/profile/lib/src/data/repositories/profile_repository_impl.dart new file mode 100644 index 00000000..9f38a448 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/data/repositories/profile_repository_impl.dart @@ -0,0 +1,35 @@ +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:krow_domain/krow_domain.dart'; + +import '../../domain/repositories/profile_repository.dart'; + +/// Implementation of [ProfileRepositoryInterface] that delegates to data_connect. +/// +/// This implementation follows Clean Architecture by: +/// - Implementing the domain layer's repository interface +/// - Delegating all data access to the data_connect package +/// - Not containing any business logic +/// - Only performing data transformation/mapping if needed +/// +/// Currently uses [ProfileRepositoryMock] from data_connect. +/// When Firebase Data Connect is ready, this will be swapped with a real implementation. +class ProfileRepositoryImpl implements ProfileRepositoryInterface { + final ProfileRepositoryMock _dataConnectRepository; + + /// Creates a [ProfileRepositoryImpl]. + /// + /// Requires a [ProfileRepositoryMock] from the data_connect package. + const ProfileRepositoryImpl(this._dataConnectRepository); + + @override + Future getStaffProfile(String userId) { + // Delegate directly to data_connect - no business logic here + return _dataConnectRepository.getStaffProfile(userId); + } + + @override + Future signOut() { + // Delegate directly to data_connect - no business logic here + return _dataConnectRepository.signOut(); + } +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/domain/repositories/profile_repository.dart b/apps/mobile/packages/features/staff/profile/lib/src/domain/repositories/profile_repository.dart new file mode 100644 index 00000000..878933d0 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/domain/repositories/profile_repository.dart @@ -0,0 +1,26 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Repository interface for staff profile operations. +/// +/// Defines the contract for accessing and managing staff profile data. +/// This interface lives in the domain layer and is implemented by the data layer. +/// +/// Following Clean Architecture principles, this interface: +/// - Returns domain entities (Staff from shared domain package) +/// - Defines business requirements without implementation details +/// - Allows the domain layer to be independent of data sources +abstract interface class ProfileRepositoryInterface { + /// Fetches the staff profile for the given user ID. + /// + /// Returns a [Staff] entity from the shared domain package containing + /// all profile information. + /// + /// Throws an exception if the profile cannot be retrieved. + Future getStaffProfile(String userId); + + /// Signs out the current user. + /// + /// Clears the user's session and authentication state. + /// Should be followed by navigation to the authentication flow. + Future signOut(); +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/domain/ui_entities/staff_profile_ui.dart b/apps/mobile/packages/features/staff/profile/lib/src/domain/ui_entities/staff_profile_ui.dart new file mode 100644 index 00000000..2f306905 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/domain/ui_entities/staff_profile_ui.dart @@ -0,0 +1,118 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; + +/// UI entity representing extended profile information for a staff member. +/// +/// This UI entity wraps the shared [Staff] domain entity and adds +/// presentation-layer specific data such as: +/// - Reliability statistics (shifts, ratings, etc.) +/// - Profile completion status +/// - Performance metrics +/// +/// Following Clean Architecture principles, this entity: +/// - Lives in the feature's domain/ui_entities layer +/// - Is used only by the presentation layer +/// - Extends the core [Staff] entity with UI-specific data +/// - Does NOT replace domain entities in repositories or use cases +class StaffProfileUI extends Equatable { + /// The underlying staff entity from the shared domain + final Staff staff; + + /// Total number of shifts worked + final int totalShifts; + + /// Average rating received from clients (0.0 - 5.0) + final double averageRating; + + /// Percentage of shifts where staff arrived on time + final int onTimeRate; + + /// Number of times the staff failed to show up for a shift + final int noShowCount; + + /// Number of shifts the staff has cancelled + final int cancellationCount; + + /// Overall reliability score (0-100) + final int reliabilityScore; + + /// Whether personal information section is complete + final bool hasPersonalInfo; + + /// Whether emergency contact section is complete + final bool hasEmergencyContact; + + /// Whether work experience section is complete + final bool hasExperience; + + /// Whether attire photo has been uploaded + final bool hasAttire; + + /// Whether required documents have been uploaded + final bool hasDocuments; + + /// Whether certificates have been uploaded + final bool hasCertificates; + + /// Whether tax forms have been submitted + final bool hasTaxForms; + + const StaffProfileUI({ + required this.staff, + required this.totalShifts, + required this.averageRating, + required this.onTimeRate, + required this.noShowCount, + required this.cancellationCount, + required this.reliabilityScore, + required this.hasPersonalInfo, + required this.hasEmergencyContact, + required this.hasExperience, + required this.hasAttire, + required this.hasDocuments, + required this.hasCertificates, + required this.hasTaxForms, + }); + + /// Convenience getters that delegate to the underlying Staff entity + String get fullName => staff.name; + String get email => staff.email; + String? get photoUrl => staff.avatar; + String get userId => staff.authProviderId; + String get staffId => staff.id; + + /// Maps staff status to a level string for display + /// TODO: Replace with actual level data when available in Staff entity + String get level => _mapStatusToLevel(staff.status); + + String _mapStatusToLevel(StaffStatus status) { + switch (status) { + case StaffStatus.active: + case StaffStatus.verified: + return 'Krower I'; + case StaffStatus.pending: + case StaffStatus.completedProfile: + return 'Pending'; + default: + return 'New'; + } + } + + @override + List get props => [ + staff, + totalShifts, + averageRating, + onTimeRate, + noShowCount, + cancellationCount, + reliabilityScore, + hasPersonalInfo, + hasEmergencyContact, + hasExperience, + hasAttire, + hasDocuments, + hasCertificates, + hasTaxForms, + ]; +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/domain/usecases/get_profile_usecase.dart b/apps/mobile/packages/features/staff/profile/lib/src/domain/usecases/get_profile_usecase.dart new file mode 100644 index 00000000..8834eda5 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/domain/usecases/get_profile_usecase.dart @@ -0,0 +1,52 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; + +import '../repositories/profile_repository.dart'; +import '../ui_entities/staff_profile_ui.dart'; + +/// Use case for fetching a staff member's extended profile information. +/// +/// This use case: +/// 1. Fetches the core [Staff] entity from the repository +/// 2. Maps it to a [StaffProfileUI] entity with additional UI-specific data +/// +/// Following Clean Architecture principles: +/// - Depends only on the repository interface (dependency inversion) +/// - Returns a UI entity suitable for the presentation layer +/// - Encapsulates the mapping logic from domain to UI entities +/// +/// TODO: When profile statistics API is available, fetch and map real data +/// Currently returns mock statistics data. +class GetProfileUseCase implements UseCase { + final ProfileRepositoryInterface _repository; + + /// Creates a [GetProfileUseCase]. + /// + /// Requires a [ProfileRepositoryInterface] to interact with the profile data source. + const GetProfileUseCase(this._repository); + + @override + Future call(String userId) async { + // Fetch core Staff entity from repository + final staff = await _repository.getStaffProfile(userId); + + // Map to UI entity with additional profile data + // TODO: Replace mock data with actual profile statistics from backend + return StaffProfileUI( + staff: staff, + totalShifts: 0, + averageRating: 5.0, + onTimeRate: 100, + noShowCount: 0, + cancellationCount: 0, + reliabilityScore: 100, + hasPersonalInfo: staff.phone != null && staff.phone!.isNotEmpty, + hasEmergencyContact: false, // TODO: Fetch from backend + hasExperience: false, // TODO: Fetch from backend + hasAttire: staff.avatar != null, + hasDocuments: false, // TODO: Fetch from backend + hasCertificates: false, // TODO: Fetch from backend + hasTaxForms: false, // TODO: Fetch from backend + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/domain/usecases/sign_out_usecase.dart b/apps/mobile/packages/features/staff/profile/lib/src/domain/usecases/sign_out_usecase.dart new file mode 100644 index 00000000..621d85a8 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/domain/usecases/sign_out_usecase.dart @@ -0,0 +1,25 @@ +import 'package:krow_core/core.dart'; + +import '../repositories/profile_repository.dart'; + +/// Use case for signing out the current user. +/// +/// This use case delegates the sign-out logic to the [ProfileRepositoryInterface]. +/// +/// Following Clean Architecture principles, this use case: +/// - Encapsulates the sign-out business rule +/// - Depends only on the repository interface +/// - Keeps the domain layer independent of external frameworks +class SignOutUseCase implements NoInputUseCase { + final ProfileRepositoryInterface _repository; + + /// Creates a [SignOutUseCase]. + /// + /// Requires a [ProfileRepositoryInterface] to perform the sign-out operation. + const SignOutUseCase(this._repository); + + @override + Future call() { + return _repository.signOut(); + } +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/presentation/blocs/profile_cubit.dart b/apps/mobile/packages/features/staff/profile/lib/src/presentation/blocs/profile_cubit.dart new file mode 100644 index 00000000..9eb307ff --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/presentation/blocs/profile_cubit.dart @@ -0,0 +1,55 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../../domain/usecases/get_profile_usecase.dart'; +import '../../domain/usecases/sign_out_usecase.dart'; +import 'profile_state.dart'; + +/// Cubit for managing the Profile feature state. +/// +/// Handles loading profile data and user sign-out actions. +class ProfileCubit extends Cubit { + final GetProfileUseCase _getProfileUseCase; + final SignOutUseCase _signOutUseCase; + + /// Creates a [ProfileCubit] with the required use cases. + ProfileCubit( + this._getProfileUseCase, + this._signOutUseCase, + ) : super(const ProfileState()); + + /// Loads the staff member's profile. + /// + /// Emits [ProfileStatus.loading] while fetching data, + /// then [ProfileStatus.loaded] with the profile data on success, + /// or [ProfileStatus.error] if an error occurs. + /// + /// Requires [userId] to identify which profile to load. + Future loadProfile(String userId) async { + emit(state.copyWith(status: ProfileStatus.loading)); + + try { + final profile = await _getProfileUseCase(userId); + emit(state.copyWith( + status: ProfileStatus.loaded, + profile: profile, + )); + } catch (e) { + emit(state.copyWith( + status: ProfileStatus.error, + errorMessage: e.toString(), + )); + } + } + + /// Signs out the current user. + /// + /// Delegates to the sign-out use case which handles session cleanup + /// and navigation. + Future signOut() async { + try { + await _signOutUseCase(); + } catch (e) { + // Error handling can be added here if needed + // For now, we let the navigation happen regardless + } + } +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/presentation/blocs/profile_state.dart b/apps/mobile/packages/features/staff/profile/lib/src/presentation/blocs/profile_state.dart new file mode 100644 index 00000000..645d241b --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/presentation/blocs/profile_state.dart @@ -0,0 +1,56 @@ +import 'package:equatable/equatable.dart'; + +import '../../domain/ui_entities/staff_profile_ui.dart'; + +/// Represents the various states of the profile feature. +enum ProfileStatus { + /// Initial state before any data is loaded + initial, + + /// Profile data is being loaded + loading, + + /// Profile data loaded successfully + loaded, + + /// An error occurred while loading profile data + error, +} + +/// State class for the Profile feature. +/// +/// Contains the current profile data and loading status. +/// Uses the [StaffProfileUI] entity which wraps the shared Staff entity +/// with presentation-layer specific data. +class ProfileState extends Equatable { + /// Current status of the profile feature + final ProfileStatus status; + + /// The staff member's profile UI entity (null if not loaded) + final StaffProfileUI? profile; + + /// Error message if status is error + final String? errorMessage; + + const ProfileState({ + this.status = ProfileStatus.initial, + this.profile, + this.errorMessage, + }); + + /// Creates a copy of this state with updated values. + ProfileState copyWith({ + ProfileStatus? status, + StaffProfileUI? profile, + String? errorMessage, + }) { + return ProfileState( + status: status ?? this.status, + profile: profile ?? this.profile, + errorMessage: errorMessage ?? this.errorMessage, + ); + } + + @override + List get props => [status, profile, errorMessage]; +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/presentation/navigation/profile_navigator.dart b/apps/mobile/packages/features/staff/profile/lib/src/presentation/navigation/profile_navigator.dart new file mode 100644 index 00000000..13285adc --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/presentation/navigation/profile_navigator.dart @@ -0,0 +1,88 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +/// Extension on [IModularNavigator] providing typed navigation helpers +/// for the Staff Profile feature. +/// +/// These methods provide a type-safe way to navigate to various profile-related +/// pages without relying on string literals throughout the codebase. +extension ProfileNavigator on IModularNavigator { + /// Navigates to the personal info page. + void pushPersonalInfo() { + pushNamed('../onboarding/personal-info'); + } + + /// Navigates to the emergency contact page. + void pushEmergencyContact() { + pushNamed('../emergency-contact'); + } + + /// Navigates to the experience page. + void pushExperience() { + pushNamed('../experience'); + } + + /// Navigates to the attire page. + void pushAttire() { + pushNamed('../attire'); + } + + /// Navigates to the documents page. + void pushDocuments() { + pushNamed('../documents'); + } + + /// Navigates to the certificates page. + void pushCertificates() { + pushNamed('/certificates'); + } + + /// Navigates to the tax forms page. + void pushTaxForms() { + pushNamed('../tax-forms/'); + } + + /// Navigates to Krow University. + void pushKrowUniversity() { + pushNamed('/krow-university'); + } + + /// Navigates to the trainings page. + void pushTrainings() { + pushNamed('/trainings'); + } + + /// Navigates to the leaderboard page. + void pushLeaderboard() { + pushNamed('/leaderboard'); + } + + /// Navigates to the bank account page. + void pushBankAccount() { + pushNamed('../bank-account/'); + } + + /// Navigates to the timecard page. + void pushTimecard() { + pushNamed('/time-card'); + } + + /// Navigates to the FAQs page. + void pushFaqs() { + pushNamed('/faqs'); + } + + /// Navigates to the privacy & security page. + void pushPrivacy() { + pushNamed('/privacy'); + } + + /// Navigates to the messages page. + void pushMessages() { + pushNamed('/messages'); + } + + /// Navigates to the get started/authentication screen. + void navigateToGetStarted() { + navigate('/get-started/'); + } +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/presentation/pages/staff_profile_page.dart b/apps/mobile/packages/features/staff/profile/lib/src/presentation/pages/staff_profile_page.dart new file mode 100644 index 00000000..c81dc81a --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/presentation/pages/staff_profile_page.dart @@ -0,0 +1,238 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart' hide ReadContext; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; + +import '../blocs/profile_cubit.dart'; +import '../blocs/profile_state.dart'; +import '../navigation/profile_navigator.dart'; +import '../widgets/logout_button.dart'; +import '../widgets/profile_menu_grid.dart'; +import '../widgets/profile_menu_item.dart'; +import '../widgets/profile_header.dart'; +import '../widgets/reliability_score_bar.dart'; +import '../widgets/reliability_stats_card.dart'; +import '../widgets/section_title.dart'; + +/// The main Staff Profile page. +/// +/// This page displays the staff member's profile including their stats, +/// reliability score, and various menu sections for onboarding, compliance, +/// learning, finance, and support. +/// +/// It follows Clean Architecture with BLoC for state management. +class StaffProfilePage extends StatelessWidget { + /// Creates a [StaffProfilePage]. + const StaffProfilePage({super.key}); + + @override + Widget build(BuildContext context) { + final i18n = t.staff.profile; + final cubit = Modular.get(); + + // Load profile data on first build + // TODO: Get actual userId from auth session + // For now, using mock userId that matches ProfileRepositoryMock data + const userId = 't8P3fYh4y1cPoZbbVPXUhfQCsDo3'; + if (cubit.state.status == ProfileStatus.initial) { + cubit.loadProfile(userId); + } + + return Scaffold( + backgroundColor: UiColors.background, + body: BlocBuilder( + bloc: cubit, + builder: (context, state) { + if (state.status == ProfileStatus.loading) { + return const Center(child: CircularProgressIndicator()); + } + + if (state.status == ProfileStatus.error) { + return Center( + child: Text( + state.errorMessage ?? 'An error occurred', + style: UiTypography.body1r.copyWith( + color: UiColors.destructive, + ), + ), + ); + } + + final profile = state.profile; + if (profile == null) { + return const Center(child: CircularProgressIndicator()); + } + + return SingleChildScrollView( + padding: const EdgeInsets.only(bottom: UiConstants.space16), + child: Column( + children: [ + ProfileHeader( + fullName: profile.fullName, + level: profile.level, + photoUrl: profile.photoUrl, + onSignOutTap: () { + context.read().signOut(); + Modular.to.navigateToGetStarted(); + }, + ), + Transform.translate( + offset: const Offset(0, -24), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space5, + ), + child: Column( + children: [ + ReliabilityStatsCard( + totalShifts: profile.totalShifts, + averageRating: profile.averageRating, + onTimeRate: profile.onTimeRate, + noShowCount: profile.noShowCount, + cancellationCount: profile.cancellationCount, + ), + const SizedBox(height: UiConstants.space6), + ReliabilityScoreBar( + reliabilityScore: profile.reliabilityScore, + ), + const SizedBox(height: UiConstants.space6), + SectionTitle(i18n.sections.onboarding), + ProfileMenuGrid( + children: [ + ProfileMenuItem( + icon: UiIcons.user, + label: i18n.menu_items.personal_info, + completed: profile.hasPersonalInfo, + onTap: () => Modular.to.pushPersonalInfo(), + ), + ProfileMenuItem( + icon: UiIcons.phone, + label: i18n.menu_items.emergency_contact, + completed: profile.hasEmergencyContact, + onTap: () => Modular.to.pushEmergencyContact(), + ), + ProfileMenuItem( + icon: UiIcons.briefcase, + label: i18n.menu_items.experience, + completed: profile.hasExperience, + onTap: () => Modular.to.pushExperience(), + ), + ProfileMenuItem( + icon: UiIcons.user, + label: i18n.menu_items.attire, + completed: profile.hasAttire, + onTap: () => Modular.to.pushAttire(), + ), + ], + ), + const SizedBox(height: UiConstants.space6), + SectionTitle(i18n.sections.compliance), + ProfileMenuGrid( + crossAxisCount: 3, + children: [ + ProfileMenuItem( + icon: UiIcons.file, + label: i18n.menu_items.documents, + completed: profile.hasDocuments, + onTap: () => Modular.to.pushDocuments(), + ), + ProfileMenuItem( + icon: UiIcons.shield, + label: i18n.menu_items.certificates, + completed: profile.hasCertificates, + onTap: () => Modular.to.pushCertificates(), + ), + ProfileMenuItem( + icon: UiIcons.file, + label: i18n.menu_items.tax_forms, + completed: profile.hasTaxForms, + onTap: () => Modular.to.pushTaxForms(), + ), + ], + ), + const SizedBox(height: UiConstants.space6), + SectionTitle(i18n.sections.level_up), + ProfileMenuGrid( + crossAxisCount: 3, + children: [ + ProfileMenuItem( + icon: UiIcons.sparkles, + label: i18n.menu_items.krow_university, + onTap: () => Modular.to.pushKrowUniversity(), + ), + ProfileMenuItem( + icon: UiIcons.briefcase, + label: i18n.menu_items.trainings, + onTap: () => Modular.to.pushTrainings(), + ), + ProfileMenuItem( + icon: UiIcons.target, + label: i18n.menu_items.leaderboard, + onTap: () => Modular.to.pushLeaderboard(), + ), + ], + ), + const SizedBox(height: UiConstants.space6), + SectionTitle(i18n.sections.finance), + ProfileMenuGrid( + crossAxisCount: 3, + children: [ + ProfileMenuItem( + icon: UiIcons.building, + label: i18n.menu_items.bank_account, + onTap: () => Modular.to.pushBankAccount(), + ), + ProfileMenuItem( + icon: UiIcons.creditCard, + label: i18n.menu_items.payments, + onTap: () => Modular.to.navigate('/worker-main/payments'), + ), + ProfileMenuItem( + icon: UiIcons.clock, + label: i18n.menu_items.timecard, + onTap: () => Modular.to.pushTimecard(), + ), + ], + ), + const SizedBox(height: UiConstants.space6), + SectionTitle(i18n.sections.support), + ProfileMenuGrid( + crossAxisCount: 3, + children: [ + ProfileMenuItem( + icon: UiIcons.help, + label: i18n.menu_items.faqs, + onTap: () => Modular.to.pushFaqs(), + ), + ProfileMenuItem( + icon: UiIcons.shield, + label: i18n.menu_items.privacy_security, + onTap: () => Modular.to.pushPrivacy(), + ), + ProfileMenuItem( + icon: UiIcons.messageCircle, + label: i18n.menu_items.messages, + onTap: () => Modular.to.pushMessages(), + ), + ], + ), + const SizedBox(height: UiConstants.space6), + LogoutButton( + onTap: () { + context.read().signOut(); + Modular.to.navigateToGetStarted(); + }, + ), + ], + ), + ), + ), + ], + ), + ); + }, + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/logout_button.dart b/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/logout_button.dart new file mode 100644 index 00000000..3e81c641 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/logout_button.dart @@ -0,0 +1,50 @@ +import 'package:flutter/material.dart'; +import 'package:lucide_icons/lucide_icons.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; + +/// The sign-out button widget. +/// +/// Uses design system tokens for all colors, typography, spacing, and icons. +class LogoutButton extends StatelessWidget { + final VoidCallback onTap; + + const LogoutButton({super.key, required this.onTap}); + + @override + Widget build(BuildContext context) { + final i18n = t.staff.profile.header; + + return Container( + width: double.infinity, + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + border: Border.all(color: UiColors.border), + ), + child: Material( + color: const Color(0x00000000), + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + child: Padding( + padding: EdgeInsets.symmetric(vertical: UiConstants.space4), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon(LucideIcons.logOut, color: UiColors.destructive, size: 20), + SizedBox(width: UiConstants.space2), + Text( + i18n.sign_out, + style: UiTypography.body1m.copyWith( + color: UiColors.destructive, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/profile_header.dart b/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/profile_header.dart new file mode 100644 index 00000000..9d15de3e --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/profile_header.dart @@ -0,0 +1,193 @@ +import 'package:flutter/material.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; + +/// The header section of the staff profile page, containing avatar, name, level, +/// and a sign-out button. +/// +/// Uses design system tokens for all colors, typography, and spacing. +class ProfileHeader extends StatelessWidget { + /// The staff member's full name + final String fullName; + + /// The staff member's level (e.g., "Krower I") + final String level; + + /// Optional photo URL for the avatar + final String? photoUrl; + + /// Callback when sign out is tapped + final VoidCallback onSignOutTap; + + /// Creates a [ProfileHeader]. + const ProfileHeader({ + super.key, + required this.fullName, + required this.level, + this.photoUrl, + required this.onSignOutTap, + }); + + @override + Widget build(BuildContext context) { + final i18n = t.staff.profile.header; + + return Container( + width: double.infinity, + padding: EdgeInsets.fromLTRB( + UiConstants.space5, + UiConstants.space5, + UiConstants.space5, + UiConstants.space16, + ), + decoration: BoxDecoration( + color: UiColors.primary, + borderRadius: BorderRadius.vertical( + bottom: Radius.circular(UiConstants.space6), + ), + ), + child: SafeArea( + bottom: false, + child: Column( + children: [ + // Top Bar + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + i18n.title, + style: UiTypography.headline4m.copyWith( + color: UiColors.primaryForeground, + ), + ), + GestureDetector( + onTap: onSignOutTap, + child: Text( + i18n.sign_out, + style: UiTypography.body2m.copyWith( + color: UiColors.primaryForeground.withOpacity(0.8), + ), + ), + ), + ], + ), + SizedBox(height: UiConstants.space8), + // Avatar Section + Stack( + alignment: Alignment.bottomRight, + children: [ + Container( + width: 112, + height: 112, + padding: EdgeInsets.all(UiConstants.space1), + decoration: BoxDecoration( + shape: BoxShape.circle, + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + UiColors.accent, + UiColors.accent.withOpacity(0.5), + UiColors.primaryForeground, + ], + ), + boxShadow: [ + BoxShadow( + color: UiColors.foreground.withOpacity(0.2), + blurRadius: 10, + offset: const Offset(0, 4), + ), + ], + ), + child: Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all( + color: UiColors.primaryForeground.withOpacity(0.2), + width: 4, + ), + ), + child: CircleAvatar( + backgroundColor: UiColors.background, + backgroundImage: photoUrl != null + ? NetworkImage(photoUrl!) + : null, + child: photoUrl == null + ? Container( + width: double.infinity, + height: double.infinity, + decoration: BoxDecoration( + shape: BoxShape.circle, + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + UiColors.accent, + UiColors.accent.withOpacity(0.7), + ], + ), + ), + alignment: Alignment.center, + child: Text( + fullName.isNotEmpty ? fullName[0].toUpperCase() : 'K', + style: UiTypography.displayM.copyWith( + color: UiColors.primary, + ), + ), + ) + : null, + ), + ), + ), + Container( + width: 36, + height: 36, + decoration: BoxDecoration( + color: UiColors.primaryForeground, + shape: BoxShape.circle, + border: Border.all(color: UiColors.primary, width: 2), + boxShadow: [ + BoxShadow( + color: UiColors.foreground.withOpacity(0.1), + blurRadius: 4, + ), + ], + ), + child: const Icon( + UiIcons.camera, + size: 16, + color: UiColors.primary, + ), + ), + ], + ), + SizedBox(height: UiConstants.space4), + Text( + fullName, + style: UiTypography.headline3m.copyWith( + color: UiColors.primaryForeground, + ), + ), + SizedBox(height: UiConstants.space1), + Container( + padding: EdgeInsets.symmetric( + horizontal: UiConstants.space3, + vertical: UiConstants.space1, + ), + decoration: BoxDecoration( + color: UiColors.accent.withOpacity(0.2), + borderRadius: BorderRadius.circular(UiConstants.space5), + ), + child: Text( + level, + style: UiTypography.footnote1b.copyWith( + color: UiColors.accent, + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/profile_menu_grid.dart b/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/profile_menu_grid.dart new file mode 100644 index 00000000..960eec89 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/profile_menu_grid.dart @@ -0,0 +1,40 @@ +import 'package:flutter/material.dart'; +import 'package:design_system/design_system.dart'; + +/// Lays out a list of widgets (intended for [ProfileMenuItem]s) in a responsive grid. +/// It uses [Wrap] and manually calculates item width based on the screen size. +class ProfileMenuGrid extends StatelessWidget { + final int crossAxisCount; + final List children; + + const ProfileMenuGrid({ + super.key, + required this.children, + this.crossAxisCount = 2, + }); + + @override + Widget build(BuildContext context) { + // Spacing between items + final double spacing = UiConstants.space3; + + return LayoutBuilder( + builder: (context, constraints) { + final totalWidth = constraints.maxWidth; + final totalSpacingWidth = spacing * (crossAxisCount - 1); + final itemWidth = (totalWidth - totalSpacingWidth) / crossAxisCount; + + return Wrap( + spacing: spacing, + runSpacing: spacing, + children: children.map((child) { + return SizedBox( + width: itemWidth, + child: child, + ); + }).toList(), + ); + }, + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/profile_menu_item.dart b/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/profile_menu_item.dart new file mode 100644 index 00000000..31e064b3 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/profile_menu_item.dart @@ -0,0 +1,98 @@ +import 'package:flutter/material.dart'; +import 'package:design_system/design_system.dart'; + +/// An individual item within the profile menu grid. +/// +/// Uses design system tokens for all colors, typography, spacing, and borders. +class ProfileMenuItem extends StatelessWidget { + final IconData icon; + final String label; + final bool? completed; + final VoidCallback? onTap; + + const ProfileMenuItem({ + super.key, + required this.icon, + required this.label, + this.completed, + this.onTap, + }); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + border: Border.all(color: UiColors.border), + ), + padding: EdgeInsets.all(UiConstants.space2), + child: AspectRatio( + aspectRatio: 1.0, + child: Stack( + children: [ + Align( + alignment: Alignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 48, + height: 48, + decoration: BoxDecoration( + color: UiColors.primary.withOpacity(0.08), + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + ), + alignment: Alignment.center, + child: Icon(icon, color: UiColors.primary, size: 24), + ), + SizedBox(height: UiConstants.space2), + Padding( + padding: EdgeInsets.symmetric(horizontal: UiConstants.space1), + child: Text( + label, + textAlign: TextAlign.center, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: UiTypography.footnote1m.copyWith( + color: UiColors.foreground, + height: 1.2, + ), + ), + ), + ], + ), + ), + if (completed != null) + Positioned( + top: UiConstants.space2, + right: UiConstants.space2, + child: Container( + width: 16, + height: 16, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: completed! + ? UiColors.primary + : UiColors.primary.withOpacity(0.1), + ), + alignment: Alignment.center, + child: completed! + ? const Icon(Icons.check, size: 10, color: UiColors.primaryForeground) + : Text( + "!", + style: UiTypography.footnote2b.copyWith( + color: UiColors.primary, + ), + ), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/reliability_score_bar.dart b/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/reliability_score_bar.dart new file mode 100644 index 00000000..ec32de87 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/reliability_score_bar.dart @@ -0,0 +1,70 @@ +import 'package:flutter/material.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; + +/// Displays the staff member's reliability score as a progress bar. +/// +/// Uses design system tokens for all colors, typography, and spacing. +class ReliabilityScoreBar extends StatelessWidget { + final int reliabilityScore; + + const ReliabilityScoreBar({ + super.key, + required this.reliabilityScore, + }); + + @override + Widget build(BuildContext context) { + final i18n = t.staff.profile.reliability_score; + final score = reliabilityScore / 100; + + return Container( + padding: EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.primary.withOpacity(0.1), + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + i18n.title, + style: UiTypography.body2m.copyWith( + color: UiColors.primary, + ), + ), + Text( + "$reliabilityScore%", + style: UiTypography.headline4m.copyWith( + color: UiColors.primary, + ), + ), + ], + ), + SizedBox(height: UiConstants.space2), + ClipRRect( + borderRadius: BorderRadius.circular(UiConstants.space1), + child: LinearProgressIndicator( + value: score, + backgroundColor: UiColors.background, + color: UiColors.primary, + minHeight: 8, + ), + ), + Padding( + padding: EdgeInsets.only(top: UiConstants.space2), + child: Text( + i18n.description, + style: UiTypography.footnote2r.copyWith( + color: UiColors.mutedForeground, + ), + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/reliability_stats_card.dart b/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/reliability_stats_card.dart new file mode 100644 index 00000000..be30bc22 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/reliability_stats_card.dart @@ -0,0 +1,117 @@ +import 'package:flutter/material.dart'; +import 'package:lucide_icons/lucide_icons.dart'; +import 'package:design_system/design_system.dart'; + +/// Displays the staff member's reliability statistics (Shifts, Rating, On Time, etc.). +/// +/// Uses design system tokens for all colors, typography, spacing, and icons. +class ReliabilityStatsCard extends StatelessWidget { + final int totalShifts; + final double averageRating; + final int onTimeRate; + final int noShowCount; + final int cancellationCount; + + const ReliabilityStatsCard({ + super.key, + required this.totalShifts, + required this.averageRating, + required this.onTimeRate, + required this.noShowCount, + required this.cancellationCount, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: UiColors.foreground.withOpacity(0.05), + blurRadius: 4, + offset: const Offset(0, 1), + ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + _buildStatItem( + context, + LucideIcons.briefcase, + "$totalShifts", + "Shifts", + ), + _buildStatItem( + context, + LucideIcons.star, + averageRating.toStringAsFixed(1), + "Rating", + ), + _buildStatItem( + context, + LucideIcons.clock, + "$onTimeRate%", + "On Time", + ), + _buildStatItem( + context, + LucideIcons.xCircle, + "$noShowCount", + "No Shows", + ), + _buildStatItem( + context, + LucideIcons.ban, + "$cancellationCount", + "Cancel.", + ), + ], + ), + ); + } + + Widget _buildStatItem( + BuildContext context, + IconData icon, + String value, + String label, + ) { + return Expanded( + child: Column( + children: [ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: UiColors.primary.withOpacity(0.1), + borderRadius: BorderRadius.circular(UiConstants.radiusMdValue), + ), + alignment: Alignment.center, + child: Icon(icon, size: 20, color: UiColors.primary), + ), + SizedBox(height: UiConstants.space1), + Text( + value, + style: UiTypography.body1b.copyWith( + color: UiColors.foreground, + ), + ), + FittedBox( + fit: BoxFit.scaleDown, + child: Text( + label, + style: UiTypography.footnote2r.copyWith( + color: UiColors.mutedForeground, + ), + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/section_title.dart b/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/section_title.dart new file mode 100644 index 00000000..89167c61 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/presentation/widgets/section_title.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; +import 'package:design_system/design_system.dart'; + +/// Displays a capitalized, muted section title. +/// +/// Uses design system tokens for typography, colors, and spacing. +class SectionTitle extends StatelessWidget { + final String title; + + const SectionTitle(this.title, {super.key}); + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + padding: EdgeInsets.only(left: UiConstants.space1), + margin: EdgeInsets.only(bottom: UiConstants.space3), + child: Text( + title.toUpperCase(), + style: UiTypography.footnote1b.copyWith( + color: UiColors.mutedForeground, + letterSpacing: 0.5, + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile/lib/src/staff_profile_module.dart b/apps/mobile/packages/features/staff/profile/lib/src/staff_profile_module.dart new file mode 100644 index 00000000..4ad1dcca --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/src/staff_profile_module.dart @@ -0,0 +1,55 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; + +import 'data/repositories/profile_repository_impl.dart'; +import 'domain/repositories/profile_repository.dart'; +import 'domain/usecases/get_profile_usecase.dart'; +import 'domain/usecases/sign_out_usecase.dart'; +import 'presentation/blocs/profile_cubit.dart'; +import 'presentation/pages/staff_profile_page.dart'; + +/// The entry module for the Staff Profile feature. +/// +/// This module provides dependency injection bindings for the profile feature +/// following Clean Architecture principles. +/// +/// Dependency flow: +/// - Data source (ProfileRepositoryMock) from data_connect package +/// - Repository implementation (ProfileRepositoryImpl) delegates to data_connect +/// - Use cases depend on repository interface +/// - Cubit depends on use cases +class StaffProfileModule extends Module { + @override + void binds(Injector i) { + // Data layer - Get mock from data_connect package + i.addLazySingleton(ProfileRepositoryMock.new); + + // Repository implementation - delegates to data_connect + i.addLazySingleton( + () => ProfileRepositoryImpl(i.get()), + ); + + // Use cases - depend on repository interface + i.addLazySingleton( + () => GetProfileUseCase(i.get()), + ); + i.addLazySingleton( + () => SignOutUseCase(i.get()), + ); + + // Presentation layer - Cubit depends on use cases + // Use addLazySingleton to create a new instance per module lifecycle + i.addLazySingleton( + () => ProfileCubit( + i.get(), + i.get(), + ), + ); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (BuildContext context) => const StaffProfilePage()); + } +} diff --git a/apps/mobile/packages/features/staff/profile/lib/staff_profile.dart b/apps/mobile/packages/features/staff/profile/lib/staff_profile.dart new file mode 100644 index 00000000..4ca64d73 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/lib/staff_profile.dart @@ -0,0 +1,2 @@ +/// Export the modular feature definition. +export 'src/staff_profile_module.dart'; diff --git a/apps/mobile/packages/features/staff/profile/pubspec.yaml b/apps/mobile/packages/features/staff/profile/pubspec.yaml new file mode 100644 index 00000000..76c872f6 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile/pubspec.yaml @@ -0,0 +1,48 @@ +name: staff_profile +description: Staff Profile feature package. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + bloc: ^8.1.0 + flutter_modular: ^6.3.0 + equatable: ^2.0.5 + lucide_icons: ^0.257.0 + + # Architecture Packages + design_system: + path: ../../../design_system + core_localization: + path: ../../../core_localization + krow_core: + path: ../../../core + krow_domain: + path: ../../../domain + krow_data_connect: + path: ../../../data_connect + + # Feature Packages + staff_profile_info: + path: ../profile_sections/onboarding/profile_info + staff_emergency_contact: + path: ../profile_sections/onboarding/emergency_contact + staff_profile_experience: + path: ../profile_sections/onboarding/experience + +dev_dependencies: + flutter_test: + sdk: flutter + bloc_test: ^9.1.0 + mocktail: ^1.0.0 + flutter_lints: ^6.0.0 + +flutter: + uses-material-design: true diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/analysis_options.yaml b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/analysis_options.yaml new file mode 100644 index 00000000..81e71ce5 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/analysis_options.yaml @@ -0,0 +1 @@ +include: ../../../../../../analysis_options.yaml diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/data/repositories/certificates_repository_mock.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/data/repositories/certificates_repository_mock.dart new file mode 100644 index 00000000..a5238a76 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/data/repositories/certificates_repository_mock.dart @@ -0,0 +1,43 @@ +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/repositories/certificates_repository.dart'; + +class CertificatesRepositoryMock implements CertificatesRepository { + @override + Future> getCertificates() async { + final DateTime now = DateTime.now(); + + // Create copies with dynamic dates + final List dynamicDocuments = [ + StaffDocument( + id: '1', + documentId: 'background', + staffId: 'current_user', + name: 'Background Check', + description: 'Required for all shifts', + status: DocumentStatus.verified, + expiryDate: now.add(const Duration(days: 365)), + ), + StaffDocument( + id: '2', + documentId: 'food_handler', + staffId: 'current_user', + name: 'Food Handler', + description: 'Required for food service', + status: DocumentStatus.verified, + expiryDate: now.add(const Duration(days: 15)), + ), + const StaffDocument( + id: '3', + documentId: 'rbs', + staffId: 'current_user', + name: 'RBS Alcohol', + description: 'Required for bar shifts', + status: DocumentStatus.missing, + expiryDate: null, + ), + ]; + + await Future.delayed(const Duration(seconds: 1)); // Simulate network delay + return dynamicDocuments; + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/data/repositories_impl/certificates_repository_impl.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/data/repositories_impl/certificates_repository_impl.dart new file mode 100644 index 00000000..18ce89df --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/data/repositories_impl/certificates_repository_impl.dart @@ -0,0 +1,91 @@ +import 'package:firebase_auth/firebase_auth.dart'; +import 'package:firebase_data_connect/firebase_data_connect.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:krow_domain/krow_domain.dart' as domain; + +import '../../domain/repositories/certificates_repository.dart'; + +/// Implementation of [CertificatesRepository] using Data Connect. +/// +/// This class handles the communication with the backend via [ExampleConnector]. +/// It maps raw generated data types to clean [domain.StaffDocument] entities. +class CertificatesRepositoryImpl implements CertificatesRepository { + /// The generated Data Connect SDK client. + final ExampleConnector _dataConnect; + + /// The Firebase Authentication instance. + final FirebaseAuth _firebaseAuth; + + /// Creates a [CertificatesRepositoryImpl]. + /// + /// Requires [ExampleConnector] for data access and [FirebaseAuth] for user context. + CertificatesRepositoryImpl({ + required ExampleConnector dataConnect, + required FirebaseAuth firebaseAuth, + }) : _dataConnect = dataConnect, + _firebaseAuth = firebaseAuth; + + @override + Future> getCertificates() async { + final User? currentUser = _firebaseAuth.currentUser; + if (currentUser == null) { + throw Exception('User not authenticated'); + } + + try { + // Execute the query via DataConnect generated SDK + final QueryResult result = + await _dataConnect + .listStaffDocumentsByStaffId(staffId: currentUser.uid) + .execute(); + + // Map the generated SDK types to pure Domain entities + return result.data.staffDocuments + .map((ListStaffDocumentsByStaffIdStaffDocuments doc) => + _mapToDomain(doc)) + .toList(); + } catch (e) { + // In a real app, we would map specific exceptions to domain Failures here. + throw Exception('Failed to fetch certificates: $e'); + } + } + + /// Maps the Data Connect [ListStaffDocumentsByStaffIdStaffDocuments] to a domain [domain.StaffDocument]. + domain.StaffDocument _mapToDomain( + ListStaffDocumentsByStaffIdStaffDocuments doc, + ) { + return domain.StaffDocument( + id: doc.id, + staffId: doc.staffId, + documentId: doc.documentId, + name: doc.document.name, + description: null, // Description not available in this query response + status: _mapStatus(doc.status), + documentUrl: doc.documentUrl, + expiryDate: doc.expiryDate?.toDateTime(), + ); + } + + /// Maps the Data Connect [DocumentStatus] enum to the domain [domain.DocumentStatus]. + domain.DocumentStatus _mapStatus(EnumValue status) { + if (status is Known) { + switch (status.value) { + case DocumentStatus.VERIFIED: + return domain.DocumentStatus.verified; + case DocumentStatus.PENDING: + return domain.DocumentStatus.pending; + case DocumentStatus.MISSING: + return domain.DocumentStatus.missing; + case DocumentStatus.UPLOADED: + return domain.DocumentStatus.pending; + case DocumentStatus.EXPIRING: + // 'EXPIRING' in backend is treated as 'verified' in domain, + // as the document is strictly valid until the expiry date. + return domain.DocumentStatus.verified; + } + } + // Fallback for unknown status + return domain.DocumentStatus.pending; + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/domain/repositories/certificates_repository.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/domain/repositories/certificates_repository.dart new file mode 100644 index 00000000..b87081df --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/domain/repositories/certificates_repository.dart @@ -0,0 +1,12 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Interface for the certificates repository. +/// +/// Responsible for fetching staff compliance certificates. +/// Implementations must reside in the data layer. +abstract interface class CertificatesRepository { + /// Fetches the list of compliance certificates for the current staff member. + /// + /// Returns a list of [StaffDocument] entities. + Future> getCertificates(); +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/domain/usecases/get_certificates_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/domain/usecases/get_certificates_usecase.dart new file mode 100644 index 00000000..e7f8f206 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/domain/usecases/get_certificates_usecase.dart @@ -0,0 +1,21 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/certificates_repository.dart'; + +/// Use case for fetching staff compliance certificates. +/// +/// Delegates the data retrieval to the [CertificatesRepository]. +/// Follows the strict one-to-one mapping between action and use case. +class GetCertificatesUseCase extends NoInputUseCase> { + final CertificatesRepository _repository; + + /// Creates a [GetCertificatesUseCase]. + /// + /// Requires a [CertificatesRepository] to access the certificates data source. + GetCertificatesUseCase(this._repository); + + @override + Future> call() { + return _repository.getCertificates(); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/blocs/certificates/certificates_cubit.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/blocs/certificates/certificates_cubit.dart new file mode 100644 index 00000000..717d2886 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/blocs/certificates/certificates_cubit.dart @@ -0,0 +1,28 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../../domain/usecases/get_certificates_usecase.dart'; +import 'certificates_state.dart'; + +class CertificatesCubit extends Cubit { + final GetCertificatesUseCase _getCertificatesUseCase; + + CertificatesCubit(this._getCertificatesUseCase) : super(const CertificatesState()) { + loadCertificates(); + } + + Future loadCertificates() async { + emit(state.copyWith(status: CertificatesStatus.loading)); + try { + final List certificates = await _getCertificatesUseCase(); + emit(state.copyWith( + status: CertificatesStatus.success, + certificates: certificates, + )); + } catch (e) { + emit(state.copyWith( + status: CertificatesStatus.failure, + errorMessage: e.toString(), + )); + } + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/blocs/certificates/certificates_state.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/blocs/certificates/certificates_state.dart new file mode 100644 index 00000000..912b6ae9 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/blocs/certificates/certificates_state.dart @@ -0,0 +1,39 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; + +enum CertificatesStatus { initial, loading, success, failure } + +class CertificatesState extends Equatable { + final CertificatesStatus status; + final List certificates; + final String? errorMessage; + + const CertificatesState({ + this.status = CertificatesStatus.initial, + List? certificates, + this.errorMessage, + }) : certificates = certificates ?? const []; + + CertificatesState copyWith({ + CertificatesStatus? status, + List? certificates, + String? errorMessage, + }) { + return CertificatesState( + status: status ?? this.status, + certificates: certificates ?? this.certificates, + errorMessage: errorMessage ?? this.errorMessage, + ); + } + + @override + List get props => [status, certificates, errorMessage]; + + /// The number of verified certificates. + int get completedCount => certificates + .where((doc) => doc.status == DocumentStatus.verified) + .length; + + /// The total number of certificates. + int get totalCount => certificates.length; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/navigation/certificates_navigator.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/navigation/certificates_navigator.dart new file mode 100644 index 00000000..afdab051 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/navigation/certificates_navigator.dart @@ -0,0 +1,10 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +/// Extension on [IModularNavigator] to provide strongly-typed navigation +/// for the staff certificates feature. +extension CertificatesNavigator on IModularNavigator { + /// Navigates back. + void popCertificates() { + pop(); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/pages/certificates_page.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/pages/certificates_page.dart new file mode 100644 index 00000000..f9ac8f85 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/pages/certificates_page.dart @@ -0,0 +1,135 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_domain/krow_domain.dart'; +import 'package:core_localization/core_localization.dart'; + +import '../blocs/certificates/certificates_cubit.dart'; +import '../blocs/certificates/certificates_state.dart'; +import '../widgets/add_certificate_card.dart'; +import '../widgets/certificate_card.dart'; +import '../widgets/certificate_upload_modal.dart'; +import '../widgets/certificates_header.dart'; + +/// Page for viewing and managing staff certificates. +/// +/// Refactored to be stateless and follow clean architecture. +class CertificatesPage extends StatelessWidget { + const CertificatesPage({super.key}); + + @override + Widget build(BuildContext context) { + // Dependency Injection: Retrieve the Cubit + final CertificatesCubit cubit = Modular.get(); + + return BlocBuilder( + bloc: cubit, + builder: (BuildContext context, CertificatesState state) { + if (state.status == CertificatesStatus.loading || + state.status == CertificatesStatus.initial) { + return const Scaffold( + body: Center(child: CircularProgressIndicator()), + ); + } + + if (state.status == CertificatesStatus.failure) { + return Scaffold( + body: Center(child: Text('Error: ${state.errorMessage}')), + ); + } + + final List documents = state.certificates; + + return Scaffold( + backgroundColor: UiColors.background, // Matches 0xFFF8FAFC + body: SingleChildScrollView( + child: Column( + children: [ + CertificatesHeader( + completedCount: state.completedCount, + totalCount: state.totalCount, + ), + Transform.translate( + offset: const Offset(0, -48), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Column( + children: [ + ...documents.map((StaffDocument doc) => CertificateCard( + document: doc, + onUpload: () => _showUploadModal(context, doc), + onEditExpiry: () => _showEditExpiryDialog(context, doc), + onRemove: () => _showRemoveConfirmation(context, doc), + onView: () { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text(t.staff_certificates.card.opened_snackbar), + duration: const Duration(seconds: 2), + ), + ); + }, + )), + const SizedBox(height: 16), + AddCertificateCard( + onTap: () => _showUploadModal(context, null), + ), + const SizedBox(height: 32), + ], + ), + ), + ), + ], + ), + ), + ); + }, + ); + } + + void _showUploadModal(BuildContext context, StaffDocument? document) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (BuildContext context) => CertificateUploadModal( + document: document, + onSave: () { + // TODO: Implement upload via Cubit + // Modular.get().uploadCertificate(...); + Navigator.pop(context); + }, + onCancel: () => Navigator.pop(context), + ), + ); + } + + void _showEditExpiryDialog(BuildContext context, StaffDocument document) { + _showUploadModal(context, document); + } + + void _showRemoveConfirmation(BuildContext context, StaffDocument document) { + showDialog( + context: context, + builder: (BuildContext context) => AlertDialog( + title: Text(t.staff_certificates.delete_modal.title), + content: Text(t.staff_certificates.delete_modal.message), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context), + child: Text(t.staff_certificates.delete_modal.cancel), + ), + TextButton( + onPressed: () { + // TODO: Implement delete via Cubit + // Modular.get().deleteCertificate(document.id); + Navigator.pop(context); + }, + style: TextButton.styleFrom(foregroundColor: UiColors.destructive), + child: Text(t.staff_certificates.delete_modal.confirm), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/widgets/add_certificate_card.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/widgets/add_certificate_card.dart new file mode 100644 index 00000000..315e91ec --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/widgets/add_certificate_card.dart @@ -0,0 +1,54 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:core_localization/core_localization.dart'; + +class AddCertificateCard extends StatelessWidget { + final VoidCallback onTap; + + const AddCertificateCard({super.key, required this.onTap}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [Colors.grey[50]!, Colors.grey[100]!], // Keep prototype style + ), + borderRadius: BorderRadius.circular(16), + border: Border.all( + color: Colors.grey[300]!, + style: BorderStyle.solid, + ), + ), + child: Row( + children: [ + const Icon(UiIcons.add, color: UiColors.primary, size: 24), + const SizedBox(width: 16), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + t.staff_certificates.add_more.title, + style: UiTypography.body1b.copyWith( // 16px Bold + color: UiColors.textPrimary, + ), + ), + Text( + t.staff_certificates.add_more.subtitle, + style: UiTypography.body3r.copyWith( // 12px Regular + color: UiColors.textSecondary, + ), + ), + ], + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/widgets/certificate_card.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/widgets/certificate_card.dart new file mode 100644 index 00000000..c1cca227 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/widgets/certificate_card.dart @@ -0,0 +1,417 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:krow_domain/krow_domain.dart'; +import 'package:core_localization/core_localization.dart'; + +class CertificateCard extends StatelessWidget { + final StaffDocument document; + final VoidCallback? onUpload; + final VoidCallback? onEditExpiry; + final VoidCallback? onRemove; + final VoidCallback? onView; + + const CertificateCard({ + super.key, + required this.document, + this.onUpload, + this.onEditExpiry, + this.onRemove, + this.onView, + }); + + @override + Widget build(BuildContext context) { + // Determine UI state from document + final bool isComplete = document.status == DocumentStatus.verified; + // Todo: Better logic for expring. Assuming if expiryDate is close. + // Prototype used 'EXPIRING' status. We map this logic: + final bool isExpiring = _isExpiring(document.expiryDate); + final bool isExpired = _isExpired(document.expiryDate); + + // Override isComplete if expiring or expired + final bool showComplete = isComplete && !isExpired && !isExpiring; + + final bool isPending = document.status == DocumentStatus.pending; + final bool isNotStarted = document.status == DocumentStatus.missing || document.status == DocumentStatus.rejected; + + // UI Properties helper + final _CertificateUiProps uiProps = _getUiProps(document.documentId); + + return Container( + margin: const EdgeInsets.only(bottom: 16), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: BorderRadius.circular(UiConstants.space4), + boxShadow: [ + BoxShadow( + color: UiColors.black.withOpacity(0.05), + blurRadius: 4, + offset: const Offset(0, 2), + ), + ], + border: Border.all(color: UiColors.border), + ), + clipBehavior: Clip.hardEdge, + child: Column( + children: [ + if (isExpiring || isExpired) + Container( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + decoration: BoxDecoration( + color: const Color(0xFFF9E547).withOpacity(0.2), // Yellow tint + border: const Border( + bottom: BorderSide(color: Color(0x66F9E547)), + ), + ), + child: Row( + children: [ + const Icon( + UiIcons.warning, + size: 16, + color: UiColors.textPrimary, + ), + const SizedBox(width: 8), + Text( + isExpired + ? t.staff_certificates.card.expired + : t.staff_certificates.card.expires_in_days(days: _daysUntilExpiry(document.expiryDate)), + style: UiTypography.body3m.copyWith( // 12px Medium + color: UiColors.textPrimary, + ), + ), + ], + ), + ), + + Padding( + padding: const EdgeInsets.all(20), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + clipBehavior: Clip.none, + children: [ + Container( + width: 64, + height: 64, + decoration: BoxDecoration( + color: uiProps.color.withOpacity(0.1), + borderRadius: BorderRadius.circular(16), + ), + child: Center( + child: Icon( + uiProps.icon, + color: uiProps.color, + size: 28, + ), + ), + ), + if (showComplete) + const Positioned( + bottom: -4, + right: -4, + child: CircleAvatar( + radius: 12, + backgroundColor: UiColors.primary, + child: Icon( + UiIcons.success, + color: UiColors.white, + size: 16, + ), + ), + ), + if (isPending) + const Positioned( + bottom: -4, + right: -4, + child: CircleAvatar( + radius: 12, + backgroundColor: UiColors.textPrimary, + child: Icon( + UiIcons.clock, + color: UiColors.white, + size: 16, + ), + ), + ), + ], + ), + const SizedBox(width: 16), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + document.name, + style: UiTypography.body1m.copyWith( // 16px Medium + color: UiColors.textPrimary, + ), + ), + const SizedBox(height: 2), + Text( + document.description ?? '', // Optional description + style: UiTypography.body3r.copyWith( // 12px Regular + color: UiColors.textSecondary, + ), + ), + ], + ), + ), + const Icon( + UiIcons.chevronRight, + color: UiColors.textSecondary, + size: 20, + ), + ], + ), + const SizedBox(height: 16), + + if (showComplete) _buildCompleteStatus(document.expiryDate), + + if (isExpiring || isExpired) _buildExpiringStatus(context, document.expiryDate), + + if (isNotStarted) + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: onUpload, + style: ElevatedButton.styleFrom( + backgroundColor: UiColors.primary, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + padding: const EdgeInsets.symmetric(vertical: 12), + elevation: 0, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon( + UiIcons.upload, + size: 16, + color: UiColors.white, + ), + const SizedBox(width: 8), + Text( + t.staff_certificates.card.upload_button, + style: UiTypography.body2m.copyWith( // 14px Medium + color: UiColors.white, + ), + ), + ], + ), + ), + ), + + if (showComplete || isExpiring || isExpired) ...[ + const SizedBox(height: 12), + SizedBox( + width: double.infinity, + child: OutlinedButton.icon( + onPressed: onEditExpiry, + icon: const Icon(UiIcons.edit, size: 16), + label: Text(t.staff_certificates.card.edit_expiry), + style: OutlinedButton.styleFrom( + foregroundColor: UiColors.textPrimary, + side: const BorderSide(color: UiColors.border), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + padding: const EdgeInsets.symmetric(vertical: 12), + ), + ), + ), + const SizedBox(height: 8), + SizedBox( + width: double.infinity, + child: TextButton.icon( + onPressed: onRemove, + icon: const Icon(UiIcons.delete, size: 16), + label: Text(t.staff_certificates.card.remove), + style: TextButton.styleFrom( + foregroundColor: UiColors.destructive, + padding: const EdgeInsets.symmetric(vertical: 12), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ], + ], + ), + ), + ], + ), + ), + ], + ), + ); + } + + Widget _buildCompleteStatus(DateTime? expiryDate) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Container( + width: 8, + height: 8, + decoration: const BoxDecoration( + color: UiColors.primary, + shape: BoxShape.circle, + ), + ), + const SizedBox(width: 8), + Text( + t.staff_certificates.card.verified, + style: UiTypography.body2m.copyWith( + color: UiColors.primary, + ), + ), + ], + ), + if (expiryDate != null) + Text( + t.staff_certificates.card.exp(date: DateFormat('MMM d, yyyy').format(expiryDate)), + style: UiTypography.body3r.copyWith(color: UiColors.textSecondary), + ), + ], + ); + } + + Widget _buildExpiringStatus(BuildContext context, DateTime? expiryDate) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: 8, + height: 8, + decoration: const BoxDecoration( + color: UiColors.primary, + shape: BoxShape.circle, + ), + ), + const SizedBox(width: 8), + Text( + t.staff_certificates.card.expiring_soon, + style: UiTypography.body2m.copyWith( + color: UiColors.primary, + ), + ), + ], + ), + if (expiryDate != null) + Padding( + padding: const EdgeInsets.only(top: 4), + child: Text( + t.staff_certificates.card.exp(date: DateFormat('MMM d, yyyy').format(expiryDate)), + style: UiTypography.body3r.copyWith( + color: UiColors.textSecondary, + ), + ), + ), + ], + ), + Row( + children: [ + _buildIconButton(UiIcons.eye, onView), + const SizedBox(width: 8), + _buildSmallOutlineButton( + t.staff_certificates.card.renew, + onUpload, + ), + ], + ), + ], + ); + } + + Widget _buildIconButton(IconData icon, VoidCallback? onTap) { + return InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(16), + child: Container( + width: 32, + height: 32, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.transparent, + border: Border.all( + color: Colors.transparent, + ), + ), + child: Center( + child: Icon(icon, size: 16, color: UiColors.textSecondary), + ), + ), + ); + } + + Widget _buildSmallOutlineButton(String label, VoidCallback? onTap) { + return OutlinedButton( + onPressed: onTap, + style: OutlinedButton.styleFrom( + side: const BorderSide(color: Color(0x660A39DF)), // Primary with opacity + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 0), + minimumSize: const Size(0, 32), + ), + child: Text( + label, + style: UiTypography.body3m.copyWith(color: UiColors.primary), + ), + ); + } + + bool _isExpiring(DateTime? expiry) { + if (expiry == null) return false; + final int days = expiry.difference(DateTime.now()).inDays; + return days >= 0 && days <= 30; // Close to expiry but not expired + } + + bool _isExpired(DateTime? expiry) { + if (expiry == null) return false; + return expiry.difference(DateTime.now()).inDays < 0; + } + + int _daysUntilExpiry(DateTime? expiry) { + if (expiry == null) return 0; + return expiry.difference(DateTime.now()).inDays; + } + + // Mock mapping for UI props based on ID + _CertificateUiProps _getUiProps(String id) { + switch (id) { + case 'background': + return _CertificateUiProps(UiIcons.fileCheck, const Color(0xFF0A39DF)); + case 'food_handler': + return _CertificateUiProps(UiIcons.utensils, const Color(0xFF0A39DF)); + case 'rbs': + return _CertificateUiProps(UiIcons.wine, const Color(0xFF121826)); + default: + // Default generic icon + return _CertificateUiProps(UiIcons.award, UiColors.primary); + } + } +} + +class _CertificateUiProps { + final IconData icon; + final Color color; + _CertificateUiProps(this.icon, this.color); +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/widgets/certificate_upload_modal.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/widgets/certificate_upload_modal.dart new file mode 100644 index 00000000..852038a2 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/widgets/certificate_upload_modal.dart @@ -0,0 +1,158 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// Modal for uploading or editing a certificate expiry. +class CertificateUploadModal extends StatelessWidget { + /// The document being edited, or null for a new upload. + // ignore: unused_field + final dynamic document; // Using dynamic for now as we don't import domain here to avoid direct coupling if possible, but actually we should import domain. + // Ideally, widgets should be dumb. Let's import domain. + + final VoidCallback onSave; + final VoidCallback onCancel; + + const CertificateUploadModal({ + super.key, + this.document, + required this.onSave, + required this.onCancel, + }); + + @override + Widget build(BuildContext context) { + return Container( + height: MediaQuery.of(context).size.height * 0.75, + decoration: const BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(24), + topRight: Radius.circular(24), + ), + ), + padding: const EdgeInsets.all(24), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + t.staff_certificates.upload_modal.title, + style: UiTypography.headline3m.copyWith(color: UiColors.textPrimary), + ), + IconButton( + onPressed: onCancel, + icon: const Icon(UiIcons.close, size: 24), + ), + ], + ), + const SizedBox(height: 32), + Text( + t.staff_certificates.upload_modal.expiry_label, + style: UiTypography.body1m, + ), + const SizedBox(height: 8), + Container( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + decoration: BoxDecoration( + border: Border.all(color: UiColors.border), + borderRadius: BorderRadius.circular(12), + ), + child: Row( + children: [ + const Icon(UiIcons.calendar, size: 20, color: UiColors.textSecondary), + const SizedBox(width: 12), + Text( + t.staff_certificates.upload_modal.select_date, + style: UiTypography.body1m.copyWith(color: UiColors.textSecondary), + ), + ], + ), + ), + const SizedBox(height: 24), + Text( + t.staff_certificates.upload_modal.upload_file, + style: UiTypography.body1m, + ), + const SizedBox(height: 8), + Expanded( + child: Container( + width: double.infinity, + decoration: BoxDecoration( + border: Border.all( + color: UiColors.border, + style: BorderStyle.solid, + ), + borderRadius: BorderRadius.circular(16), + color: UiColors.background, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: const EdgeInsets.all(16), + decoration: const BoxDecoration( + color: Color(0xFFEFF6FF), // Light blue + shape: BoxShape.circle, + ), + child: const Icon( + UiIcons.uploadCloud, + size: 32, + color: UiColors.primary, + ), + ), + const SizedBox(height: 16), + Text( + t.staff_certificates.upload_modal.drag_drop, + style: UiTypography.body1m, + ), + const SizedBox(height: 4), + Text( + t.staff_certificates.upload_modal.supported_formats, + style: UiTypography.body3r.copyWith(color: UiColors.textSecondary), + ), + ], + ), + ), + ), + const SizedBox(height: 24), + Row( + children: [ + Expanded( + child: OutlinedButton( + onPressed: onCancel, + style: OutlinedButton.styleFrom( + padding: const EdgeInsets.symmetric(vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + side: const BorderSide(color: UiColors.border), + ), + child: Text(t.staff_certificates.upload_modal.cancel, + style: UiTypography.body1m.copyWith(color: UiColors.textPrimary)), + ), + ), + const SizedBox(width: 16), + Expanded( + child: ElevatedButton( + onPressed: onSave, + style: ElevatedButton.styleFrom( + backgroundColor: UiColors.primary, + padding: const EdgeInsets.symmetric(vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + elevation: 0, + ), + child: Text(t.staff_certificates.upload_modal.save, + style: UiTypography.body1m.copyWith(color: Colors.white)), + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/widgets/certificates_header.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/widgets/certificates_header.dart new file mode 100644 index 00000000..0d07100f --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/presentation/widgets/certificates_header.dart @@ -0,0 +1,131 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:core_localization/core_localization.dart'; + +class CertificatesHeader extends StatelessWidget { + final int completedCount; + final int totalCount; + + const CertificatesHeader({ + super.key, + required this.completedCount, + required this.totalCount, + }); + + @override + Widget build(BuildContext context) { + // Prevent division by zero + final double progressValue = totalCount == 0 ? 0 : completedCount / totalCount; + final int progressPercent = totalCount == 0 ? 0 : (progressValue * 100).round(); + + return Container( + padding: const EdgeInsets.fromLTRB(20, 60, 20, 80), + // Keeping gradient as per prototype layout requirement + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [UiColors.primary, Color(0xFF1E40AF)], // Using Primary and a darker shade + ), + ), + child: Column( + children: [ + Row( + children: [ + GestureDetector( + onTap: () => Modular.to.pop(), + child: Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: UiColors.white.withOpacity(0.1), + shape: BoxShape.circle, + ), + child: const Icon( + UiIcons.chevronLeft, // Swapped LucideIcons + color: UiColors.white, + size: 20, + ), + ), + ), + const SizedBox(width: 12), + Text( + t.staff_certificates.title, + style: UiTypography.headline3m.copyWith( // 18px Bold + color: UiColors.white, + ), + ), + ], + ), + const SizedBox(height: 32), + Row( + children: [ + SizedBox( + width: 96, + height: 96, + child: Stack( + fit: StackFit.expand, + children: [ + CircularProgressIndicator( + value: progressValue, + strokeWidth: 8, + backgroundColor: UiColors.white.withOpacity(0.2), + valueColor: const AlwaysStoppedAnimation( + Color(0xFFF9E547), // Yellow from prototype + ), + ), + Center( + child: Text( + '$progressPercent%', + style: UiTypography.display1b.copyWith( // 26px Bold + color: UiColors.white, + ), + ), + ), + ], + ), + ), + const SizedBox(width: 24), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + t.staff_certificates.progress.title, + style: UiTypography.body1b.copyWith( // 16px Bold + color: UiColors.white, + ), + ), + const SizedBox(height: 4), + Text( + t.staff_certificates.progress.verified_count(completed: completedCount, total: totalCount), + style: UiTypography.body3r.copyWith( // 12px Regular + color: UiColors.white.withOpacity(0.7), + ), + ), + const SizedBox(height: 8), + Row( + children: [ + const Icon( + UiIcons.shield, + color: Color(0xFFF9E547), + size: 16, + ), + const SizedBox(width: 8), + Text( + t.staff_certificates.progress.active, + style: UiTypography.body3m.copyWith( // 12px Medium + color: const Color(0xFFF9E547), + ), + ), + ], + ), + ], + ), + ], + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/staff_certificates_module.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/staff_certificates_module.dart new file mode 100644 index 00000000..a084e798 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/src/staff_certificates_module.dart @@ -0,0 +1,28 @@ +import 'package:firebase_auth/firebase_auth.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; + +import 'data/repositories_impl/certificates_repository_impl.dart'; +import 'domain/repositories/certificates_repository.dart'; +import 'domain/usecases/get_certificates_usecase.dart'; +import 'presentation/blocs/certificates/certificates_cubit.dart'; +import 'presentation/pages/certificates_page.dart'; + +class StaffCertificatesModule extends Module { + @override + void binds(Injector i) { + i.addLazySingleton( + () => CertificatesRepositoryImpl( + dataConnect: i.get(), // Assuming ExampleConnector is provided by parent module + firebaseAuth: FirebaseAuth.instance, + ), + ); + i.addLazySingleton(GetCertificatesUseCase.new); + i.addLazySingleton(CertificatesCubit.new); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (_) => const CertificatesPage()); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/staff_certificates.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/staff_certificates.dart new file mode 100644 index 00000000..7db77246 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/lib/staff_certificates.dart @@ -0,0 +1,4 @@ +library staff_certificates; + +export 'src/staff_certificates_module.dart'; +export 'src/presentation/navigation/certificates_navigator.dart'; // Export navigator extension diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/pubspec.lock b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/pubspec.lock new file mode 100644 index 00000000..7f71a701 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/pubspec.lock @@ -0,0 +1,1002 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: c209688d9f5a5f26b2fb47a188131a6fb9e876ae9e47af3737c0b4f58a93470d + url: "https://pub.dev" + source: hosted + version: "91.0.0" + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: ff0a84a2734d9e1089f8aedd5c0af0061b82fb94e95260d943404e0ef2134b11 + url: "https://pub.dev" + source: hosted + version: "1.3.59" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: f51c8499b35f9b26820cfe914828a6a98a94efd5cc78b37bb7d03debae3a1d08 + url: "https://pub.dev" + source: hosted + version: "8.4.1" + archive: + dependency: transitive + description: + name: archive + sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d + url: "https://pub.dev" + source: hosted + version: "3.6.1" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" + source: hosted + version: "2.13.0" + auto_injector: + dependency: transitive + description: + name: auto_injector + sha256: "1fc2624898e92485122eb2b1698dd42511d7ff6574f84a3a8606fc4549a1e8f8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + bloc: + dependency: transitive + description: + name: bloc + sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e" + url: "https://pub.dev" + source: hosted + version: "8.1.4" + bloc_test: + dependency: "direct dev" + description: + name: bloc_test + sha256: "165a6ec950d9252ebe36dc5335f2e6eb13055f33d56db0eeb7642768849b43d2" + url: "https://pub.dev" + source: hosted + version: "9.1.7" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + cli_config: + dependency: transitive + description: + name: cli_config + sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec + url: "https://pub.dev" + source: hosted + version: "0.2.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + core_localization: + dependency: "direct main" + description: + path: "../../../../../core_localization" + relative: true + source: path + version: "0.0.1" + coverage: + dependency: transitive + description: + name: coverage + sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d" + url: "https://pub.dev" + source: hosted + version: "1.15.0" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" + source: hosted + version: "3.0.7" + csv: + dependency: transitive + description: + name: csv + sha256: c6aa2679b2a18cb57652920f674488d89712efaf4d3fdf2e537215b35fc19d6c + url: "https://pub.dev" + source: hosted + version: "6.0.0" + design_system: + dependency: "direct main" + description: + path: "../../../../../design_system" + relative: true + source: path + version: "0.0.1" + diff_match_patch: + dependency: transitive + description: + name: diff_match_patch + sha256: "2efc9e6e8f449d0abe15be240e2c2a3bcd977c8d126cfd70598aee60af35c0a4" + url: "https://pub.dev" + source: hosted + version: "0.4.1" + equatable: + dependency: "direct main" + description: + name: equatable + sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b" + url: "https://pub.dev" + source: hosted + version: "2.0.8" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c + url: "https://pub.dev" + source: hosted + version: "2.1.5" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + firebase_app_check: + dependency: transitive + description: + name: firebase_app_check + sha256: c4124632094a4062d7a1ff0a9f9c657ff54bece5d8393af4626cb191351a2aac + url: "https://pub.dev" + source: hosted + version: "0.3.2+10" + firebase_app_check_platform_interface: + dependency: transitive + description: + name: firebase_app_check_platform_interface + sha256: "4ca80bcc6c5c55289514d85e7c8ba8bc354342d23ab807b01c3f82e2fc7158e4" + url: "https://pub.dev" + source: hosted + version: "0.1.1+10" + firebase_app_check_web: + dependency: transitive + description: + name: firebase_app_check_web + sha256: b3150a78fe18c27525af05b149724ee33bd8592a5959e484fdfa5c98e25edb5f + url: "https://pub.dev" + source: hosted + version: "0.2.0+14" + firebase_auth: + dependency: "direct main" + description: + name: firebase_auth + sha256: "0fed2133bee1369ee1118c1fef27b2ce0d84c54b7819a2b17dada5cfec3b03ff" + url: "https://pub.dev" + source: hosted + version: "5.7.0" + firebase_auth_platform_interface: + dependency: transitive + description: + name: firebase_auth_platform_interface + sha256: "871c9df4ec9a754d1a793f7eb42fa3b94249d464cfb19152ba93e14a5966b386" + url: "https://pub.dev" + source: hosted + version: "7.7.3" + firebase_auth_web: + dependency: transitive + description: + name: firebase_auth_web + sha256: d9ada769c43261fd1b18decf113186e915c921a811bd5014f5ea08f4cf4bc57e + url: "https://pub.dev" + source: hosted + version: "5.15.3" + firebase_core: + dependency: transitive + description: + name: firebase_core + sha256: "7be63a3f841fc9663342f7f3a011a42aef6a61066943c90b1c434d79d5c995c5" + url: "https://pub.dev" + source: hosted + version: "3.15.2" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: cccb4f572325dc14904c02fcc7db6323ad62ba02536833dddb5c02cac7341c64 + url: "https://pub.dev" + source: hosted + version: "6.0.2" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0ed0dc292e8f9ac50992e2394e9d336a0275b6ae400d64163fdf0a8a8b556c37" + url: "https://pub.dev" + source: hosted + version: "2.24.1" + firebase_data_connect: + dependency: "direct main" + description: + name: firebase_data_connect + sha256: decc24f2ce21a305aa38f4840302aa893ad5cafd7ee4e05c2eb8a2808cb21c97 + url: "https://pub.dev" + source: hosted + version: "0.1.5+4" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: "direct main" + description: + name: flutter_bloc + sha256: b594505eac31a0518bdcb4b5b79573b8d9117b193cc80cc12e17d639b10aa27a + url: "https://pub.dev" + source: hosted + version: "8.1.6" + flutter_localizations: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_modular: + dependency: "direct main" + description: + name: flutter_modular + sha256: "33a63d9fe61429d12b3dfa04795ed890f17d179d3d38e988ba7969651fcd5586" + url: "https://pub.dev" + source: hosted + version: "6.4.1" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + font_awesome_flutter: + dependency: transitive + description: + name: font_awesome_flutter + sha256: b9011df3a1fa02993630b8fb83526368cf2206a711259830325bab2f1d2a4eb0 + url: "https://pub.dev" + source: hosted + version: "10.12.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + get_it: + dependency: "direct main" + description: + name: get_it + sha256: d85128a5dae4ea777324730dc65edd9c9f43155c109d5cc0a69cab74139fbac1 + url: "https://pub.dev" + source: hosted + version: "7.7.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + google_fonts: + dependency: transitive + description: + name: google_fonts + sha256: "6996212014b996eaa17074e02b1b925b212f5e053832d9048970dc27255a8fb3" + url: "https://pub.dev" + source: hosted + version: "7.1.0" + google_identity_services_web: + dependency: transitive + description: + name: google_identity_services_web + sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454" + url: "https://pub.dev" + source: hosted + version: "0.3.3+1" + googleapis_auth: + dependency: transitive + description: + name: googleapis_auth + sha256: befd71383a955535060acde8792e7efc11d2fccd03dd1d3ec434e85b68775938 + url: "https://pub.dev" + source: hosted + version: "1.6.0" + grpc: + dependency: transitive + description: + name: grpc + sha256: e93ee3bce45c134bf44e9728119102358c7cd69de7832d9a874e2e74eb8cab40 + url: "https://pub.dev" + source: hosted + version: "3.2.4" + hooks: + dependency: transitive + description: + name: hooks + sha256: "5d309c86e7ce34cd8e37aa71cb30cb652d3829b900ab145e4d9da564b31d59f7" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + http: + dependency: transitive + description: + name: http + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" + url: "https://pub.dev" + source: hosted + version: "1.6.0" + http2: + dependency: transitive + description: + name: http2 + sha256: "382d3aefc5bd6dc68c6b892d7664f29b5beb3251611ae946a98d35158a82bbfa" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + intl: + dependency: transitive + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + js: + dependency: transitive + description: + name: js + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + url: "https://pub.dev" + source: hosted + version: "0.7.2" + krow_core: + dependency: "direct main" + description: + path: "../../../../../core" + relative: true + source: path + version: "0.0.1" + krow_data_connect: + dependency: "direct main" + description: + path: "../../../../../data_connect" + relative: true + source: path + version: "0.0.1" + krow_domain: + dependency: "direct main" + description: + path: "../../../../../domain" + relative: true + source: path + version: "0.0.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.dev" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + lucide_icons: + dependency: transitive + description: + name: lucide_icons + sha256: ad24d0fd65707e48add30bebada7d90bff2a1bba0a72d6e9b19d44246b0e83c4 + url: "https://pub.dev" + source: hosted + version: "0.257.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + url: "https://pub.dev" + source: hosted + version: "1.17.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mocktail: + dependency: "direct dev" + description: + name: mocktail + sha256: "890df3f9688106f25755f26b1c60589a92b3ab91a22b8b224947ad041bf172d8" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + modular_core: + dependency: transitive + description: + name: modular_core + sha256: "1db0420a0dfb8a2c6dca846e7cbaa4ffeb778e247916dbcb27fb25aa566e5436" + url: "https://pub.dev" + source: hosted + version: "3.4.1" + native_toolchain_c: + dependency: transitive + description: + name: native_toolchain_c + sha256: "89e83885ba09da5fdf2cdacc8002a712ca238c28b7f717910b34bcd27b0d03ac" + url: "https://pub.dev" + source: hosted + version: "0.17.4" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "7fd0c4d8ac8980011753b9bdaed2bf15111365924cdeeeaeb596214ea2b03537" + url: "https://pub.dev" + source: hosted + version: "9.2.4" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: f2c65e21139ce2c3dad46922be8272bb5963516045659e71bb16e151c93b580e + url: "https://pub.dev" + source: hosted + version: "2.2.22" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + pool: + dependency: transitive + description: + name: pool + sha256: "978783255c543aa3586a1b3c21f6e9d720eb315376a915872c61ef8b5c20177d" + url: "https://pub.dev" + source: hosted + version: "1.5.2" + protobuf: + dependency: transitive + description: + name: protobuf + sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + provider: + dependency: transitive + description: + name: provider + sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272" + url: "https://pub.dev" + source: hosted + version: "6.1.5+1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + result_dart: + dependency: transitive + description: + name: result_dart + sha256: "0666b21fbdf697b3bdd9986348a380aa204b3ebe7c146d8e4cdaa7ce735e6054" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + shared_preferences: + dependency: transitive + description: + name: shared_preferences + sha256: "2939ae520c9024cb197fc20dee269cd8cdbf564c8b5746374ec6cacdc5169e64" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "83af5c682796c0f7719c2bbf74792d113e40ae97981b8f266fa84574573556bc" + url: "https://pub.dev" + source: hosted + version: "2.4.18" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" + url: "https://pub.dev" + source: hosted + version: "2.5.6" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 + url: "https://pub.dev" + source: hosted + version: "1.1.3" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + slang: + dependency: transitive + description: + name: slang + sha256: "13e3b6f07adc51ab751e7889647774d294cbce7a3382f81d9e5029acfe9c37b2" + url: "https://pub.dev" + source: hosted + version: "4.12.0" + slang_flutter: + dependency: transitive + description: + name: slang_flutter + sha256: "0a4545cca5404d6b7487cf61cf1fe56c52daeb08de56a7574ee8381fbad035a0" + url: "https://pub.dev" + source: hosted + version: "4.12.0" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b + url: "https://pub.dev" + source: hosted + version: "2.1.2" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" + url: "https://pub.dev" + source: hosted + version: "0.10.13" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test: + dependency: transitive + description: + name: test + sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7" + url: "https://pub.dev" + source: hosted + version: "1.26.3" + test_api: + dependency: transitive + description: + name: test_api + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + url: "https://pub.dev" + source: hosted + version: "0.7.7" + test_core: + dependency: transitive + description: + name: test_core + sha256: "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0" + url: "https://pub.dev" + source: hosted + version: "0.6.12" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8 + url: "https://pub.dev" + source: hosted + version: "4.5.2" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" + source: hosted + version: "15.0.2" + watcher: + dependency: transitive + description: + name: watcher + sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.10.7 <4.0.0" + flutter: ">=3.38.4" diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/pubspec.yaml b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/pubspec.yaml new file mode 100644 index 00000000..b5cb42c3 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/certificates/pubspec.yaml @@ -0,0 +1,35 @@ +name: staff_certificates +description: Staff certificates feature +version: 0.0.1 +publish_to: none + +environment: + sdk: '>=3.0.0 <4.0.0' + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + equatable: ^2.0.5 + get_it: ^7.6.0 + flutter_modular: ^6.3.0 + + # KROW Dependencies + design_system: + path: ../../../../../design_system + core_localization: + path: ../../../../../core_localization + krow_domain: + path: ../../../../../domain + krow_core: + path: ../../../../../core + krow_data_connect: + path: ../../../../../data_connect + firebase_auth: ^6.1.2 + firebase_data_connect: ^0.2.2 + +dev_dependencies: + flutter_test: + sdk: flutter + bloc_test: ^9.1.0 + mocktail: ^1.0.0 diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/data/repositories_impl/documents_repository_impl.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/data/repositories_impl/documents_repository_impl.dart new file mode 100644 index 00000000..e6b06150 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/data/repositories_impl/documents_repository_impl.dart @@ -0,0 +1,99 @@ +import 'package:firebase_auth/firebase_auth.dart'; +import 'package:firebase_data_connect/firebase_data_connect.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:krow_domain/krow_domain.dart' as domain; + +import '../../domain/repositories/documents_repository.dart'; + +/// Implementation of [DocumentsRepository] using Data Connect. +class DocumentsRepositoryImpl implements DocumentsRepository { + final ExampleConnector _dataConnect; + final FirebaseAuth _firebaseAuth; + + DocumentsRepositoryImpl({ + required ExampleConnector dataConnect, + required FirebaseAuth firebaseAuth, + }) : _dataConnect = dataConnect, + _firebaseAuth = firebaseAuth; + + @override + Future> getDocuments() async { + final User? currentUser = _firebaseAuth.currentUser; + if (currentUser == null) { + throw Exception('User not authenticated'); + } + + /// MOCK IMPLEMENTATION + /// To be replaced with real data connect query when available + return [ + domain.StaffDocument( + id: 'doc1', + staffId: currentUser.uid, + documentId: 'd1', + name: 'Work Permit', + description: 'Valid work permit document', + status: domain.DocumentStatus.verified, + documentUrl: 'https://example.com/documents/work_permit.pdf', + expiryDate: DateTime.now().add(const Duration(days: 365)), + ), + domain.StaffDocument( + id: 'doc2', + staffId: currentUser.uid, + documentId: 'd2', + name: 'Health and Safety Training', + description: 'Certificate of completion for health and safety training', + status: domain.DocumentStatus.pending, + documentUrl: 'https://example.com/documents/health_safety.pdf', + expiryDate: DateTime.now().add(const Duration(days: 180)), + ), + ]; + + try { + final QueryResult result = + await _dataConnect + .listStaffDocumentsByStaffId(staffId: currentUser.uid) + .execute(); + + return result.data.staffDocuments + .map((ListStaffDocumentsByStaffIdStaffDocuments doc) => + _mapToDomain(doc)) + .toList(); + } catch (e) { + throw Exception('Failed to fetch documents: $e'); + } + } + + domain.StaffDocument _mapToDomain( + ListStaffDocumentsByStaffIdStaffDocuments doc, + ) { + return domain.StaffDocument( + id: doc.id, + staffId: doc.staffId, + documentId: doc.documentId, + name: doc.document.name, + description: null, // Description not available in data source + status: _mapStatus(doc.status), + documentUrl: doc.documentUrl, + expiryDate: doc.expiryDate?.toDateTime(), + ); + } + + domain.DocumentStatus _mapStatus(EnumValue status) { + if (status is Known) { + switch (status.value) { + case DocumentStatus.VERIFIED: + return domain.DocumentStatus.verified; + case DocumentStatus.PENDING: + return domain.DocumentStatus.pending; + case DocumentStatus.MISSING: + return domain.DocumentStatus.missing; + case DocumentStatus.UPLOADED: + case DocumentStatus.EXPIRING: + return domain.DocumentStatus.pending; + } + } + // Default to pending for Unknown or unhandled cases + return domain.DocumentStatus.pending; + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/domain/repositories/documents_repository.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/domain/repositories/documents_repository.dart new file mode 100644 index 00000000..26f6a7db --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/domain/repositories/documents_repository.dart @@ -0,0 +1,9 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Interface for the documents repository. +/// +/// Responsible for fetching staff compliance documents. +abstract interface class DocumentsRepository { + /// Fetches the list of compliance documents for the current staff member. + Future> getDocuments(); +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/domain/usecases/get_documents_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/domain/usecases/get_documents_usecase.dart new file mode 100644 index 00000000..0ee6c731 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/domain/usecases/get_documents_usecase.dart @@ -0,0 +1,17 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/documents_repository.dart'; + +/// Use case for fetching staff compliance documents. +/// +/// Delegates to [DocumentsRepository]. +class GetDocumentsUseCase implements NoInputUseCase> { + final DocumentsRepository _repository; + + GetDocumentsUseCase(this._repository); + + @override + Future> call() { + return _repository.getDocuments(); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/blocs/documents/documents_cubit.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/blocs/documents/documents_cubit.dart new file mode 100644 index 00000000..518ff810 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/blocs/documents/documents_cubit.dart @@ -0,0 +1,26 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../../domain/usecases/get_documents_usecase.dart'; +import 'documents_state.dart'; + +class DocumentsCubit extends Cubit { + final GetDocumentsUseCase _getDocumentsUseCase; + + DocumentsCubit(this._getDocumentsUseCase) : super(const DocumentsState()); + + Future loadDocuments() async { + emit(state.copyWith(status: DocumentsStatus.loading)); + try { + final List documents = await _getDocumentsUseCase(); + emit(state.copyWith( + status: DocumentsStatus.success, + documents: documents, + )); + } catch (e) { + emit(state.copyWith( + status: DocumentsStatus.failure, + errorMessage: e.toString(), + )); + } + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/blocs/documents/documents_state.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/blocs/documents/documents_state.dart new file mode 100644 index 00000000..db7bcfe2 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/blocs/documents/documents_state.dart @@ -0,0 +1,39 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; + +enum DocumentsStatus { initial, loading, success, failure } + +class DocumentsState extends Equatable { + final DocumentsStatus status; + final List documents; + final String? errorMessage; + + const DocumentsState({ + this.status = DocumentsStatus.initial, + List? documents, + this.errorMessage, + }) : documents = documents ?? const []; + + DocumentsState copyWith({ + DocumentsStatus? status, + List? documents, + String? errorMessage, + }) { + return DocumentsState( + status: status ?? this.status, + documents: documents ?? this.documents, + errorMessage: errorMessage ?? this.errorMessage, + ); + } + + int get completedCount => + documents.where((StaffDocument d) => d.status == DocumentStatus.verified).length; + + int get totalCount => documents.length; + + double get progress => + totalCount > 0 ? completedCount / totalCount : 0.0; + + @override + List get props => [status, documents, errorMessage]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/navigation/documents_navigator.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/navigation/documents_navigator.dart new file mode 100644 index 00000000..48506c14 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/navigation/documents_navigator.dart @@ -0,0 +1,11 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +/// Extension on [IModularNavigator] to provide strongly-typed navigation +/// for the staff documents feature. +extension DocumentsNavigator on IModularNavigator { + /// Navigates to the document upload/view page. + /// [documentId] is the ID of the document to view or upload. + void pushDocumentDetails(String documentId) { + pushNamed('./details', arguments: documentId); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/pages/documents_page.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/pages/documents_page.dart new file mode 100644 index 00000000..23eba3d1 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/pages/documents_page.dart @@ -0,0 +1,93 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_domain/krow_domain.dart'; +// ignore: depend_on_referenced_packages +import 'package:core_localization/core_localization.dart'; + +import '../blocs/documents/documents_cubit.dart'; +import '../blocs/documents/documents_state.dart'; +import '../navigation/documents_navigator.dart'; +import '../widgets/document_card.dart'; +import '../widgets/documents_progress_card.dart'; + +class DocumentsPage extends StatelessWidget { + + @override + Widget build(BuildContext context) { + final DocumentsCubit cubit = Modular.get(); + + if (cubit.state.status == DocumentsStatus.initial) { + cubit.loadDocuments(); + } + + return Scaffold( + appBar: AppBar( + elevation: 0, + leading: IconButton( + icon: const Icon(UiIcons.arrowLeft, color: UiColors.iconSecondary), + onPressed: () => Modular.to.pop(), + ), + title: Text( + t.staff_documents.title, + style: UiTypography.headline3m.copyWith( + color: UiColors.textPrimary, + ), + ), + bottom: PreferredSize( + preferredSize: const Size.fromHeight(1.0), + child: Container(color: UiColors.border, height: 1.0), + ), + ), + body: BlocBuilder( + bloc: cubit, + builder: (BuildContext context, DocumentsState state) { + if (state.status == DocumentsStatus.loading) { + return const Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation(UiColors.primary), + ), + ); + } + if (state.status == DocumentsStatus.failure) { + return Center( + child: Text( + t.staff_documents.list.error( + message: state.errorMessage ?? 'Unknown', + ), + style: UiTypography.body1m.copyWith(color: UiColors.textError), + ), + ); + } + if (state.documents.isEmpty) { + return Center( + child: Text( + t.staff_documents.list.empty, + style: UiTypography.body1m.copyWith(color: UiColors.textSecondary), + ), + ); + } + + return ListView( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 24), + children: [ + DocumentsProgressCard( + completedCount: state.completedCount, + totalCount: state.totalCount, + progress: state.progress, + ), + const SizedBox(height: 16), + ...state.documents.map( + (StaffDocument doc) => DocumentCard( + document: doc, + onTap: () => Modular.to.pushDocumentDetails(doc.id), + ), + ), + ], + ); + }, + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/widgets/document_card.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/widgets/document_card.dart new file mode 100644 index 00000000..764caa18 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/widgets/document_card.dart @@ -0,0 +1,186 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:krow_domain/krow_domain.dart'; +import 'package:lucide_icons/lucide_icons.dart'; +// ignore: depend_on_referenced_packages +import 'package:core_localization/core_localization.dart'; + +class DocumentCard extends StatelessWidget { + final StaffDocument document; + final VoidCallback? onTap; + + const DocumentCard({ + super.key, + required this.document, + this.onTap, + }); + + @override + Widget build(BuildContext context) { + return Container( + margin: const EdgeInsets.only(bottom: 12), + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: UiColors.border), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: UiColors.primary.withOpacity(0.1), + borderRadius: BorderRadius.circular(8), + ), + child: const Center( + child: Icon( + UiIcons.file, + color: UiColors.primary, + size: 20, + ), + ), + ), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + document.name, + style: UiTypography.body1m.copyWith( + color: UiColors.textPrimary, + ), + ), + _getStatusIcon(document.status), + ], + ), + const SizedBox(height: 2), + if (document.description != null) + Text( + document.description!, + style: UiTypography.body2r.copyWith( + color: UiColors.textSecondary, + ), + ), + const SizedBox(height: 12), + Row( + children: [ + _buildStatusBadge(document.status), + const SizedBox(width: 8), + _buildActionButton(document.status), + ], + ), + ], + ), + ), + ], + ), + ); + } + + Widget _getStatusIcon(DocumentStatus status) { + switch (status) { + case DocumentStatus.verified: + return const Icon( + UiIcons.check, + color: UiColors.iconSuccess, + size: 20, + ); + case DocumentStatus.pending: + return const Icon( + UiIcons.clock, + color: UiColors.textWarning, + size: 20, + ); + default: + return const Icon( + UiIcons.warning, + color: UiColors.textError, + size: 20, + ); + } + } + + Widget _buildStatusBadge(DocumentStatus status) { + Color bg; + Color text; + String label; + + switch (status) { + case DocumentStatus.verified: + bg = UiColors.textSuccess.withOpacity(0.2); + text = UiColors.textSuccess; + label = t.staff_documents.card.verified; + break; + case DocumentStatus.pending: + bg = UiColors.textWarning.withOpacity(0.2); + text = UiColors.textWarning; + label = t.staff_documents.card.pending; + break; + case DocumentStatus.missing: + bg = UiColors.textError.withOpacity(0.2); + text = UiColors.textError; + label = t.staff_documents.card.missing; + break; + case DocumentStatus.rejected: + bg = UiColors.textError.withOpacity(0.2); + text = UiColors.textError; + label = t.staff_documents.card.rejected; + break; + case DocumentStatus.expired: + bg = UiColors.textError.withOpacity(0.2); + text = UiColors.textError; + label = t.staff_documents.card.rejected; // Or define "Expired" string + break; + } + + return Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2), + decoration: BoxDecoration( + color: bg, + borderRadius: BorderRadius.circular(12), + ), + child: Text( + label, + style: UiTypography.body3m.copyWith( + color: text, + ), + ), + ); + } + + Widget _buildActionButton(DocumentStatus status) { + final bool isVerified = status == DocumentStatus.verified; + return InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(4), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + child: Row( + children: [ + Icon( + isVerified ? UiIcons.eye : LucideIcons.upload, + size: 16, + color: UiColors.primary, + ), + const SizedBox(width: 4), + Text( + isVerified + ? t.staff_documents.card.view + : t.staff_documents.card.upload, + style: UiTypography.body3m.copyWith( + color: UiColors.primary, + ), + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/widgets/documents_progress_card.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/widgets/documents_progress_card.dart new file mode 100644 index 00000000..95395e08 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/presentation/widgets/documents_progress_card.dart @@ -0,0 +1,69 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +// ignore: depend_on_referenced_packages +import 'package:core_localization/core_localization.dart'; + +/// A card displaying the overall verification progress of documents. +class DocumentsProgressCard extends StatelessWidget { + /// The number of verified documents. + final int completedCount; + + /// The total number of required documents. + final int totalCount; + + /// The progress ratio (0.0 to 1.0). + final double progress; + + const DocumentsProgressCard({ + super.key, + required this.completedCount, + required this.totalCount, + required this.progress, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: UiColors.border), + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + t.staff_documents.verification_card.title, + style: UiTypography.body1m.copyWith( + color: UiColors.textPrimary, + ), + ), + Text( + t.staff_documents.verification_card.progress( + completed: completedCount, + total: totalCount, + ), + style: UiTypography.body2r.copyWith(color: UiColors.primary), + ), + ], + ), + const SizedBox(height: 8), + ClipRRect( + borderRadius: BorderRadius.circular(4), + child: LinearProgressIndicator( + value: progress, + minHeight: 8, + backgroundColor: UiColors.border, + valueColor: const AlwaysStoppedAnimation( + UiColors.primary, + ), + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/staff_documents_module.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/staff_documents_module.dart new file mode 100644 index 00000000..6bf03d0d --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/src/staff_documents_module.dart @@ -0,0 +1,27 @@ +import 'package:firebase_auth/firebase_auth.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'data/repositories_impl/documents_repository_impl.dart'; +import 'domain/repositories/documents_repository.dart'; +import 'domain/usecases/get_documents_usecase.dart'; +import 'presentation/blocs/documents/documents_cubit.dart'; +import 'presentation/pages/documents_page.dart'; + +class StaffDocumentsModule extends Module { + @override + void binds(Injector i) { + i.addLazySingleton( + () => DocumentsRepositoryImpl( + dataConnect: ExampleConnector.instance, + firebaseAuth: FirebaseAuth.instance, + ), + ); + i.addLazySingleton(GetDocumentsUseCase.new); + i.addLazySingleton(DocumentsCubit.new); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (_) => DocumentsPage()); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/staff_documents.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/staff_documents.dart new file mode 100644 index 00000000..e380e3b8 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/lib/staff_documents.dart @@ -0,0 +1,3 @@ +library staff_documents; + +export 'src/staff_documents_module.dart'; diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/documents/pubspec.lock b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/pubspec.lock new file mode 100644 index 00000000..9b3416a2 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/pubspec.lock @@ -0,0 +1,778 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: cd83f7d6bd4e4c0b0b4fef802e8796784032e1cc23d7b0e982cf5d05d9bbe182 + url: "https://pub.dev" + source: hosted + version: "1.3.66" + archive: + dependency: transitive + description: + name: archive + sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d + url: "https://pub.dev" + source: hosted + version: "3.6.1" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" + source: hosted + version: "2.13.0" + auto_injector: + dependency: transitive + description: + name: auto_injector + sha256: "1fc2624898e92485122eb2b1698dd42511d7ff6574f84a3a8606fc4549a1e8f8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + bloc: + dependency: "direct main" + description: + name: bloc + sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e" + url: "https://pub.dev" + source: hosted + version: "8.1.4" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + core_localization: + dependency: "direct main" + description: + path: "../../../../../core_localization" + relative: true + source: path + version: "0.0.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" + source: hosted + version: "3.0.7" + csv: + dependency: transitive + description: + name: csv + sha256: c6aa2679b2a18cb57652920f674488d89712efaf4d3fdf2e537215b35fc19d6c + url: "https://pub.dev" + source: hosted + version: "6.0.0" + design_system: + dependency: "direct main" + description: + path: "../../../../../design_system" + relative: true + source: path + version: "0.0.1" + equatable: + dependency: "direct main" + description: + name: equatable + sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b" + url: "https://pub.dev" + source: hosted + version: "2.0.8" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c + url: "https://pub.dev" + source: hosted + version: "2.1.5" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + firebase_app_check: + dependency: transitive + description: + name: firebase_app_check + sha256: "45f0d279ea7ae4eac1867a4c85aa225761e3ac0ccf646386a860b2bc16581f76" + url: "https://pub.dev" + source: hosted + version: "0.4.1+4" + firebase_app_check_platform_interface: + dependency: transitive + description: + name: firebase_app_check_platform_interface + sha256: e32b4e6adeaac207a6f7afe0906d97c0811de42fb200d9b6317a09155de65e2b + url: "https://pub.dev" + source: hosted + version: "0.2.1+4" + firebase_app_check_web: + dependency: transitive + description: + name: firebase_app_check_web + sha256: "2cbc8a18a34813a7e31d7b30f989973087421cd5d0e397b4dd88a90289aa2bed" + url: "https://pub.dev" + source: hosted + version: "0.2.2+2" + firebase_auth: + dependency: "direct main" + description: + name: firebase_auth + sha256: b20d1540460814c5984474c1e9dd833bdbcff6ecd8d6ad86cc9da8cfd581c172 + url: "https://pub.dev" + source: hosted + version: "6.1.4" + firebase_auth_platform_interface: + dependency: transitive + description: + name: firebase_auth_platform_interface + sha256: fd0225320b6bbc92460c86352d16b60aea15f9ef88292774cca97b0522ea9f72 + url: "https://pub.dev" + source: hosted + version: "8.1.6" + firebase_auth_web: + dependency: transitive + description: + name: firebase_auth_web + sha256: be7dccb263b89fbda2a564de9d8193118196e8481ffb937222a025cdfdf82c40 + url: "https://pub.dev" + source: hosted + version: "6.1.2" + firebase_core: + dependency: transitive + description: + name: firebase_core + sha256: "923085c881663ef685269b013e241b428e1fb03cdd0ebde265d9b40ff18abf80" + url: "https://pub.dev" + source: hosted + version: "4.4.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: cccb4f572325dc14904c02fcc7db6323ad62ba02536833dddb5c02cac7341c64 + url: "https://pub.dev" + source: hosted + version: "6.0.2" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "83e7356c704131ca4d8d8dd57e360d8acecbca38b1a3705c7ae46cc34c708084" + url: "https://pub.dev" + source: hosted + version: "3.4.0" + firebase_data_connect: + dependency: "direct main" + description: + name: firebase_data_connect + sha256: "01d0f8e33c520a6e6f59cf5ac6ff281d1927f7837f094fa8eb5fdb0b1b328ad8" + url: "https://pub.dev" + source: hosted + version: "0.2.2+2" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: "direct main" + description: + name: flutter_bloc + sha256: b594505eac31a0518bdcb4b5b79573b8d9117b193cc80cc12e17d639b10aa27a + url: "https://pub.dev" + source: hosted + version: "8.1.6" + flutter_localizations: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_modular: + dependency: "direct main" + description: + name: flutter_modular + sha256: "33a63d9fe61429d12b3dfa04795ed890f17d179d3d38e988ba7969651fcd5586" + url: "https://pub.dev" + source: hosted + version: "6.4.1" + flutter_test: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + font_awesome_flutter: + dependency: transitive + description: + name: font_awesome_flutter + sha256: b9011df3a1fa02993630b8fb83526368cf2206a711259830325bab2f1d2a4eb0 + url: "https://pub.dev" + source: hosted + version: "10.12.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + google_fonts: + dependency: transitive + description: + name: google_fonts + sha256: "6996212014b996eaa17074e02b1b925b212f5e053832d9048970dc27255a8fb3" + url: "https://pub.dev" + source: hosted + version: "7.1.0" + google_identity_services_web: + dependency: transitive + description: + name: google_identity_services_web + sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454" + url: "https://pub.dev" + source: hosted + version: "0.3.3+1" + googleapis_auth: + dependency: transitive + description: + name: googleapis_auth + sha256: befd71383a955535060acde8792e7efc11d2fccd03dd1d3ec434e85b68775938 + url: "https://pub.dev" + source: hosted + version: "1.6.0" + grpc: + dependency: transitive + description: + name: grpc + sha256: e93ee3bce45c134bf44e9728119102358c7cd69de7832d9a874e2e74eb8cab40 + url: "https://pub.dev" + source: hosted + version: "3.2.4" + hooks: + dependency: transitive + description: + name: hooks + sha256: "5d309c86e7ce34cd8e37aa71cb30cb652d3829b900ab145e4d9da564b31d59f7" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + http: + dependency: transitive + description: + name: http + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" + url: "https://pub.dev" + source: hosted + version: "1.6.0" + http2: + dependency: transitive + description: + name: http2 + sha256: "382d3aefc5bd6dc68c6b892d7664f29b5beb3251611ae946a98d35158a82bbfa" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + intl: + dependency: transitive + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + krow_core: + dependency: "direct main" + description: + path: "../../../../../core" + relative: true + source: path + version: "0.0.1" + krow_data_connect: + dependency: "direct main" + description: + path: "../../../../../data_connect" + relative: true + source: path + version: "0.0.1" + krow_domain: + dependency: "direct main" + description: + path: "../../../../../domain" + relative: true + source: path + version: "0.0.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.dev" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + lucide_icons: + dependency: "direct main" + description: + name: lucide_icons + sha256: ad24d0fd65707e48add30bebada7d90bff2a1bba0a72d6e9b19d44246b0e83c4 + url: "https://pub.dev" + source: hosted + version: "0.257.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + url: "https://pub.dev" + source: hosted + version: "1.17.0" + modular_core: + dependency: transitive + description: + name: modular_core + sha256: "1db0420a0dfb8a2c6dca846e7cbaa4ffeb778e247916dbcb27fb25aa566e5436" + url: "https://pub.dev" + source: hosted + version: "3.4.1" + native_toolchain_c: + dependency: transitive + description: + name: native_toolchain_c + sha256: "89e83885ba09da5fdf2cdacc8002a712ca238c28b7f717910b34bcd27b0d03ac" + url: "https://pub.dev" + source: hosted + version: "0.17.4" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "7fd0c4d8ac8980011753b9bdaed2bf15111365924cdeeeaeb596214ea2b03537" + url: "https://pub.dev" + source: hosted + version: "9.2.4" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: f2c65e21139ce2c3dad46922be8272bb5963516045659e71bb16e151c93b580e + url: "https://pub.dev" + source: hosted + version: "2.2.22" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + protobuf: + dependency: transitive + description: + name: protobuf + sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + provider: + dependency: transitive + description: + name: provider + sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272" + url: "https://pub.dev" + source: hosted + version: "6.1.5+1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + result_dart: + dependency: transitive + description: + name: result_dart + sha256: "0666b21fbdf697b3bdd9986348a380aa204b3ebe7c146d8e4cdaa7ce735e6054" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + shared_preferences: + dependency: transitive + description: + name: shared_preferences + sha256: "2939ae520c9024cb197fc20dee269cd8cdbf564c8b5746374ec6cacdc5169e64" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "83af5c682796c0f7719c2bbf74792d113e40ae97981b8f266fa84574573556bc" + url: "https://pub.dev" + source: hosted + version: "2.4.18" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" + url: "https://pub.dev" + source: hosted + version: "2.5.6" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + slang: + dependency: transitive + description: + name: slang + sha256: "13e3b6f07adc51ab751e7889647774d294cbce7a3382f81d9e5029acfe9c37b2" + url: "https://pub.dev" + source: hosted + version: "4.12.0" + slang_flutter: + dependency: transitive + description: + name: slang_flutter + sha256: "0a4545cca5404d6b7487cf61cf1fe56c52daeb08de56a7574ee8381fbad035a0" + url: "https://pub.dev" + source: hosted + version: "4.12.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + url: "https://pub.dev" + source: hosted + version: "0.7.7" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8 + url: "https://pub.dev" + source: hosted + version: "4.5.2" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" + source: hosted + version: "15.0.2" + watcher: + dependency: transitive + description: + name: watcher + sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.10.7 <4.0.0" + flutter: ">=3.38.4" diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/documents/pubspec.yaml b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/pubspec.yaml new file mode 100644 index 00000000..8db95533 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/documents/pubspec.yaml @@ -0,0 +1,31 @@ +name: staff_documents +description: Staff Documents feature. +version: 0.0.1 +publish_to: none + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + bloc: ^8.1.0 + flutter_modular: ^6.3.0 + equatable: ^2.0.5 + lucide_icons: ^0.257.0 + firebase_auth: ^6.1.4 + firebase_data_connect: ^0.2.2+2 + + # Architecture Packages + design_system: + path: ../../../../../design_system + krow_core: + path: ../../../../../core + core_localization: + path: ../../../../../core_localization + krow_domain: + path: ../../../../../domain + krow_data_connect: + path: ../../../../../data_connect diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/data/repositories/tax_forms_repository_impl.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/data/repositories/tax_forms_repository_impl.dart new file mode 100644 index 00000000..89eecc7a --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/data/repositories/tax_forms_repository_impl.dart @@ -0,0 +1,206 @@ +import 'dart:async'; + +import 'package:firebase_auth/firebase_auth.dart' hide User; +import 'package:firebase_data_connect/firebase_data_connect.dart'; +import 'package:krow_data_connect/krow_data_connect.dart' as dc; + +import '../../domain/entities/tax_form_entity.dart'; +import '../../domain/repositories/tax_forms_repository.dart'; + +class TaxFormsRepositoryImpl implements TaxFormsRepository { + TaxFormsRepositoryImpl({ + required this.firebaseAuth, + required this.dataConnect, + }); + + final FirebaseAuth firebaseAuth; + final dc.ExampleConnector dataConnect; + + String? _staffId; + + Future _getStaffId() async { + if (_staffId != null) return _staffId!; + + final user = firebaseAuth.currentUser; + if (user == null) { + throw Exception('User not logged in'); + } + + final result = + await dataConnect.getStaffByUserId(userId: user.uid).execute(); + final staffs = result.data.staffs; + if (staffs.isEmpty) { + // This might happen if the user is logged in but staff profile isn't created yet or not synced. + // For now, fail hard. Code can be improved to handle this case properly. + throw Exception('No staff profile found for user'); + } + + _staffId = staffs.first.id; + return _staffId!; + } + + @override + Future> getTaxForms() async { + final staffId = await _getStaffId(); + final result = + await dataConnect.getTaxFormsBystaffId(staffId: staffId).execute(); + + final forms = result.data.taxForms.map((e) => _mapToEntity(e)).toList(); + + // Check if required forms exist, create if not. + final typesPresent = forms.map((f) => f.type).toSet(); + bool createdNew = false; + + if (!typesPresent.contains(TaxFormType.i9)) { + await _createInitialForm(staffId, TaxFormType.i9); + createdNew = true; + } + if (!typesPresent.contains(TaxFormType.w4)) { + await _createInitialForm(staffId, TaxFormType.w4); + createdNew = true; + } + + if (createdNew) { + final result2 = + await dataConnect.getTaxFormsBystaffId(staffId: staffId).execute(); + return result2.data.taxForms.map((e) => _mapToEntity(e)).toList(); + } + + return forms; + } + + Future _createInitialForm(String staffId, TaxFormType type) async { + String title = ''; + String subtitle = ''; + String description = ''; + + if (type == TaxFormType.i9) { + title = 'Form I-9'; + subtitle = 'Employment Eligibility Verification'; + description = 'Required for all new hires to verify identity.'; + } else { + title = 'Form W-4'; + subtitle = 'Employee\'s Withholding Certificate'; + description = 'Determines federal income tax withholding.'; + } + + await dataConnect + .createTaxForm( + staffId: staffId, + formType: _mapTypeToGenerated(type), + title: title, + ) + .subtitle(subtitle) + .description(description) + .status(dc.TaxFormStatus.NOT_STARTED) + .execute(); + } + + @override + Future submitForm(TaxFormType type, Map data) async { + final staffId = await _getStaffId(); + final result = + await dataConnect.getTaxFormsBystaffId(staffId: staffId).execute(); + final targetTypeString = _mapTypeToGenerated(type).name; + + final form = result.data.taxForms.firstWhere( + (e) => e.formType.stringValue == targetTypeString, + orElse: () => throw Exception('Form not found for submission'), + ); + + // AnyValue expects a scalar, list, or map. + await dataConnect + .updateTaxForm( + id: form.id, + ) + .formData(AnyValue.fromJson(data)) + .status(dc.TaxFormStatus.SUBMITTED) + .execute(); + } + + @override + Future updateFormStatus(TaxFormType type, TaxFormStatus status) async { + final staffId = await _getStaffId(); + final result = + await dataConnect.getTaxFormsBystaffId(staffId: staffId).execute(); + final targetTypeString = _mapTypeToGenerated(type).name; + + final form = result.data.taxForms.firstWhere( + (e) => e.formType.stringValue == targetTypeString, + orElse: () => throw Exception('Form not found for update'), + ); + + await dataConnect + .updateTaxForm( + id: form.id, + ) + .status(_mapStatusToGenerated(status)) + .execute(); + } + + TaxFormEntity _mapToEntity(dc.GetTaxFormsBystaffIdTaxForms form) { + return TaxFormEntity( + type: _mapTypeFromString(form.formType.stringValue), + title: form.title, + subtitle: form.subtitle ?? '', + description: form.description ?? '', + status: _mapStatusFromString(form.status.stringValue), + lastUpdated: form.updatedAt?.toDateTime(), + ); + } + + TaxFormType _mapTypeFromString(String value) { + switch (value) { + case 'I9': + return TaxFormType.i9; + case 'W4': + return TaxFormType.w4; + default: + // Handle unexpected types gracefully if needed, or throw. + // Assuming database integrity for now. + if (value == 'I-9') return TaxFormType.i9; // Fallback just in case + throw Exception('Unknown TaxFormType string: $value'); + } + } + + TaxFormStatus _mapStatusFromString(String value) { + switch (value) { + case 'NOT_STARTED': + return TaxFormStatus.notStarted; + case 'DRAFT': + return TaxFormStatus.inProgress; + case 'SUBMITTED': + return TaxFormStatus.submitted; + case 'APPROVED': + return TaxFormStatus.approved; + case 'REJECTED': + return TaxFormStatus.rejected; + default: + return TaxFormStatus.notStarted; // Default fallback + } + } + + dc.TaxFormType _mapTypeToGenerated(TaxFormType type) { + switch (type) { + case TaxFormType.i9: + return dc.TaxFormType.I9; + case TaxFormType.w4: + return dc.TaxFormType.W4; + } + } + + dc.TaxFormStatus _mapStatusToGenerated(TaxFormStatus status) { + switch (status) { + case TaxFormStatus.notStarted: + return dc.TaxFormStatus.NOT_STARTED; + case TaxFormStatus.inProgress: + return dc.TaxFormStatus.DRAFT; + case TaxFormStatus.submitted: + return dc.TaxFormStatus.SUBMITTED; + case TaxFormStatus.approved: + return dc.TaxFormStatus.APPROVED; + case TaxFormStatus.rejected: + return dc.TaxFormStatus.REJECTED; + } + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/domain/entities/tax_form_entity.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/domain/entities/tax_form_entity.dart new file mode 100644 index 00000000..c2ee5088 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/domain/entities/tax_form_entity.dart @@ -0,0 +1,26 @@ +import 'package:equatable/equatable.dart'; + +enum TaxFormType { i9, w4 } + +enum TaxFormStatus { notStarted, inProgress, submitted, approved, rejected } + +class TaxFormEntity extends Equatable { + final TaxFormType type; + final String title; + final String subtitle; + final String description; + final TaxFormStatus status; + final DateTime? lastUpdated; + + const TaxFormEntity({ + required this.type, + required this.title, + required this.subtitle, + required this.description, + this.status = TaxFormStatus.notStarted, + this.lastUpdated, + }); + + @override + List get props => [type, title, subtitle, description, status, lastUpdated]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/domain/repositories/tax_forms_repository.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/domain/repositories/tax_forms_repository.dart new file mode 100644 index 00000000..4ae464b2 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/domain/repositories/tax_forms_repository.dart @@ -0,0 +1,7 @@ +import '../entities/tax_form_entity.dart'; + +abstract class TaxFormsRepository { + Future> getTaxForms(); + Future submitForm(TaxFormType type, Map data); + Future updateFormStatus(TaxFormType type, TaxFormStatus status); +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/domain/usecases/get_tax_forms_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/domain/usecases/get_tax_forms_usecase.dart new file mode 100644 index 00000000..f8f95b15 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/domain/usecases/get_tax_forms_usecase.dart @@ -0,0 +1,12 @@ +import '../entities/tax_form_entity.dart'; +import '../repositories/tax_forms_repository.dart'; + +class GetTaxFormsUseCase { + final TaxFormsRepository _repository; + + GetTaxFormsUseCase(this._repository); + + Future> call() async { + return _repository.getTaxForms(); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/domain/usecases/submit_tax_form_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/domain/usecases/submit_tax_form_usecase.dart new file mode 100644 index 00000000..431a99bc --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/domain/usecases/submit_tax_form_usecase.dart @@ -0,0 +1,12 @@ +import '../entities/tax_form_entity.dart'; +import '../repositories/tax_forms_repository.dart'; + +class SubmitTaxFormUseCase { + final TaxFormsRepository _repository; + + SubmitTaxFormUseCase(this._repository); + + Future call(TaxFormType type, Map data) async { + return _repository.submitForm(type, data); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/i9/form_i9_cubit.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/i9/form_i9_cubit.dart new file mode 100644 index 00000000..ac6f132e --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/i9/form_i9_cubit.dart @@ -0,0 +1,74 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../../../domain/entities/tax_form_entity.dart'; +import '../../../domain/usecases/submit_tax_form_usecase.dart'; +import 'form_i9_state.dart'; + +class FormI9Cubit extends Cubit { + final SubmitTaxFormUseCase _submitTaxFormUseCase; + + FormI9Cubit(this._submitTaxFormUseCase) : super(const FormI9State()); + + void nextStep(int totalSteps) { + if (state.currentStep < totalSteps - 1) { + emit(state.copyWith(currentStep: state.currentStep + 1)); + } + } + + void previousStep() { + if (state.currentStep > 0) { + emit(state.copyWith(currentStep: state.currentStep - 1)); + } + } + + // Personal Info + void firstNameChanged(String value) => emit(state.copyWith(firstName: value)); + void lastNameChanged(String value) => emit(state.copyWith(lastName: value)); + void middleInitialChanged(String value) => emit(state.copyWith(middleInitial: value)); + void otherLastNamesChanged(String value) => emit(state.copyWith(otherLastNames: value)); + void dobChanged(String value) => emit(state.copyWith(dob: value)); + void ssnChanged(String value) => emit(state.copyWith(ssn: value)); + void emailChanged(String value) => emit(state.copyWith(email: value)); + void phoneChanged(String value) => emit(state.copyWith(phone: value)); + + // Address + void addressChanged(String value) => emit(state.copyWith(address: value)); + void aptNumberChanged(String value) => emit(state.copyWith(aptNumber: value)); + void cityChanged(String value) => emit(state.copyWith(city: value)); + void stateChanged(String value) => emit(state.copyWith(state: value)); + void zipCodeChanged(String value) => emit(state.copyWith(zipCode: value)); + + // Citizenship + void citizenshipStatusChanged(String value) => emit(state.copyWith(citizenshipStatus: value)); + void uscisNumberChanged(String value) => emit(state.copyWith(uscisNumber: value)); + void admissionNumberChanged(String value) => emit(state.copyWith(admissionNumber: value)); + void passportNumberChanged(String value) => emit(state.copyWith(passportNumber: value)); + void countryIssuanceChanged(String value) => emit(state.copyWith(countryIssuance: value)); + + // Signature + void preparerUsedChanged(bool value) => emit(state.copyWith(preparerUsed: value)); + void signatureChanged(String value) => emit(state.copyWith(signature: value)); + + Future submit() async { + emit(state.copyWith(status: FormI9Status.submitting)); + try { + await _submitTaxFormUseCase( + TaxFormType.i9, + { + 'firstName': state.firstName, + 'lastName': state.lastName, + 'middleInitial': state.middleInitial, + 'citizenshipStatus': state.citizenshipStatus, + 'ssn': state.ssn, + 'signature': state.signature, + // ... add other fields as needed for backend + }, + ); + emit(state.copyWith(status: FormI9Status.success)); + } catch (e) { + emit(state.copyWith( + status: FormI9Status.failure, + errorMessage: e.toString(), + )); + } + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/i9/form_i9_state.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/i9/form_i9_state.dart new file mode 100644 index 00000000..9fd739aa --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/i9/form_i9_state.dart @@ -0,0 +1,142 @@ +import 'package:equatable/equatable.dart'; + +enum FormI9Status { initial, submitting, success, failure } + +class FormI9State extends Equatable { + final int currentStep; + // Personal Info + final String firstName; + final String lastName; + final String middleInitial; + final String otherLastNames; + final String dob; + final String ssn; + final String email; + final String phone; + + // Address + final String address; + final String aptNumber; + final String city; + final String state; + final String zipCode; + + // Citizenship + final String citizenshipStatus; // citizen, noncitizen_national, permanent_resident, alien_authorized + final String uscisNumber; + final String admissionNumber; + final String passportNumber; + final String countryIssuance; + + // Signature + final bool preparerUsed; + final String signature; + + final FormI9Status status; + final String? errorMessage; + + const FormI9State({ + this.currentStep = 0, + this.firstName = '', + this.lastName = '', + this.middleInitial = '', + this.otherLastNames = '', + this.dob = '', + this.ssn = '', + this.email = '', + this.phone = '', + this.address = '', + this.aptNumber = '', + this.city = '', + this.state = '', + this.zipCode = '', + this.citizenshipStatus = '', + this.uscisNumber = '', + this.admissionNumber = '', + this.passportNumber = '', + this.countryIssuance = '', + this.preparerUsed = false, + this.signature = '', + this.status = FormI9Status.initial, + this.errorMessage, + }); + + FormI9State copyWith({ + int? currentStep, + String? firstName, + String? lastName, + String? middleInitial, + String? otherLastNames, + String? dob, + String? ssn, + String? email, + String? phone, + String? address, + String? aptNumber, + String? city, + String? state, + String? zipCode, + String? citizenshipStatus, + String? uscisNumber, + String? admissionNumber, + String? passportNumber, + String? countryIssuance, + bool? preparerUsed, + String? signature, + FormI9Status? status, + String? errorMessage, + }) { + return FormI9State( + currentStep: currentStep ?? this.currentStep, + firstName: firstName ?? this.firstName, + lastName: lastName ?? this.lastName, + middleInitial: middleInitial ?? this.middleInitial, + otherLastNames: otherLastNames ?? this.otherLastNames, + dob: dob ?? this.dob, + ssn: ssn ?? this.ssn, + email: email ?? this.email, + phone: phone ?? this.phone, + address: address ?? this.address, + aptNumber: aptNumber ?? this.aptNumber, + city: city ?? this.city, + state: state ?? this.state, + zipCode: zipCode ?? this.zipCode, + citizenshipStatus: citizenshipStatus ?? this.citizenshipStatus, + uscisNumber: uscisNumber ?? this.uscisNumber, + admissionNumber: admissionNumber ?? this.admissionNumber, + passportNumber: passportNumber ?? this.passportNumber, + countryIssuance: countryIssuance ?? this.countryIssuance, + preparerUsed: preparerUsed ?? this.preparerUsed, + signature: signature ?? this.signature, + status: status ?? this.status, + errorMessage: errorMessage ?? this.errorMessage, + ); + } + + @override + List get props => [ + currentStep, + firstName, + lastName, + middleInitial, + otherLastNames, + dob, + ssn, + email, + phone, + address, + aptNumber, + city, + state, + zipCode, + citizenshipStatus, + uscisNumber, + admissionNumber, + passportNumber, + countryIssuance, + preparerUsed, + signature, + status, + errorMessage, + ]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/tax_forms/tax_forms_cubit.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/tax_forms/tax_forms_cubit.dart new file mode 100644 index 00000000..de06dd28 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/tax_forms/tax_forms_cubit.dart @@ -0,0 +1,26 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../../../domain/entities/tax_form_entity.dart'; +import '../../../domain/usecases/get_tax_forms_usecase.dart'; +import 'tax_forms_state.dart'; + +class TaxFormsCubit extends Cubit { + final GetTaxFormsUseCase _getTaxFormsUseCase; + + TaxFormsCubit(this._getTaxFormsUseCase) : super(const TaxFormsState()); + + Future loadTaxForms() async { + emit(state.copyWith(status: TaxFormsStatus.loading)); + try { + final List forms = await _getTaxFormsUseCase(); + emit(state.copyWith( + status: TaxFormsStatus.success, + forms: forms, + )); + } catch (e) { + emit(state.copyWith( + status: TaxFormsStatus.failure, + errorMessage: e.toString(), + )); + } + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/tax_forms/tax_forms_state.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/tax_forms/tax_forms_state.dart new file mode 100644 index 00000000..8cef372e --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/tax_forms/tax_forms_state.dart @@ -0,0 +1,31 @@ +import 'package:equatable/equatable.dart'; +import '../../../domain/entities/tax_form_entity.dart'; + +enum TaxFormsStatus { initial, loading, success, failure } + +class TaxFormsState extends Equatable { + final TaxFormsStatus status; + final List forms; + final String? errorMessage; + + const TaxFormsState({ + this.status = TaxFormsStatus.initial, + this.forms = const [], + this.errorMessage, + }); + + TaxFormsState copyWith({ + TaxFormsStatus? status, + List? forms, + String? errorMessage, + }) { + return TaxFormsState( + status: status ?? this.status, + forms: forms ?? this.forms, + errorMessage: errorMessage ?? this.errorMessage, + ); + } + + @override + List get props => [status, forms, errorMessage]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/w4/form_w4_cubit.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/w4/form_w4_cubit.dart new file mode 100644 index 00000000..47088736 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/w4/form_w4_cubit.dart @@ -0,0 +1,67 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../../../domain/entities/tax_form_entity.dart'; +import '../../../domain/usecases/submit_tax_form_usecase.dart'; +import 'form_w4_state.dart'; + +class FormW4Cubit extends Cubit { + final SubmitTaxFormUseCase _submitTaxFormUseCase; + + FormW4Cubit(this._submitTaxFormUseCase) : super(const FormW4State()); + + void nextStep(int totalSteps) { + if (state.currentStep < totalSteps - 1) { + emit(state.copyWith(currentStep: state.currentStep + 1)); + } else { + submit(); + } + } + + void previousStep() { + if (state.currentStep > 0) { + emit(state.copyWith(currentStep: state.currentStep - 1)); + } + } + + // Personal Info + void firstNameChanged(String value) => emit(state.copyWith(firstName: value)); + void lastNameChanged(String value) => emit(state.copyWith(lastName: value)); + void ssnChanged(String value) => emit(state.copyWith(ssn: value)); + void addressChanged(String value) => emit(state.copyWith(address: value)); + void cityStateZipChanged(String value) => emit(state.copyWith(cityStateZip: value)); + + // Form Data + void filingStatusChanged(String value) => emit(state.copyWith(filingStatus: value)); + void multipleJobsChanged(bool value) => emit(state.copyWith(multipleJobs: value)); + void qualifyingChildrenChanged(int value) => emit(state.copyWith(qualifyingChildren: value)); + void otherDependentsChanged(int value) => emit(state.copyWith(otherDependents: value)); + + // Adjustments + void otherIncomeChanged(String value) => emit(state.copyWith(otherIncome: value)); + void deductionsChanged(String value) => emit(state.copyWith(deductions: value)); + void extraWithholdingChanged(String value) => emit(state.copyWith(extraWithholding: value)); + void signatureChanged(String value) => emit(state.copyWith(signature: value)); + + Future submit() async { + emit(state.copyWith(status: FormW4Status.submitting)); + try { + await _submitTaxFormUseCase( + TaxFormType.w4, + { + 'firstName': state.firstName, + 'lastName': state.lastName, + 'ssn': state.ssn, + 'filingStatus': state.filingStatus, + 'multipleJobs': state.multipleJobs, + 'signature': state.signature, + // ... add other fields as needed + }, + ); + emit(state.copyWith(status: FormW4Status.success)); + } catch (e) { + emit(state.copyWith( + status: FormW4Status.failure, + errorMessage: e.toString(), + )); + } + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/w4/form_w4_state.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/w4/form_w4_state.dart new file mode 100644 index 00000000..6c819d7d --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/blocs/w4/form_w4_state.dart @@ -0,0 +1,110 @@ +import 'package:equatable/equatable.dart'; + +enum FormW4Status { initial, submitting, success, failure } + +class FormW4State extends Equatable { + final int currentStep; + + // Personal Info + final String firstName; + final String lastName; + final String ssn; + final String address; + final String cityStateZip; + + // Form Data + final String filingStatus; + final bool multipleJobs; + + // Dependents + final int qualifyingChildren; + final int otherDependents; + + // Adjustments + final String otherIncome; + final String deductions; + final String extraWithholding; + + final String signature; + final FormW4Status status; + final String? errorMessage; + + const FormW4State({ + this.currentStep = 0, + this.firstName = '', + this.lastName = '', + this.ssn = '', + this.address = '', + this.cityStateZip = '', + this.filingStatus = '', + this.multipleJobs = false, + this.qualifyingChildren = 0, + this.otherDependents = 0, + this.otherIncome = '', + this.deductions = '', + this.extraWithholding = '', + this.signature = '', + this.status = FormW4Status.initial, + this.errorMessage, + }); + + FormW4State copyWith({ + int? currentStep, + String? firstName, + String? lastName, + String? ssn, + String? address, + String? cityStateZip, + String? filingStatus, + bool? multipleJobs, + int? qualifyingChildren, + int? otherDependents, + String? otherIncome, + String? deductions, + String? extraWithholding, + String? signature, + FormW4Status? status, + String? errorMessage, + }) { + return FormW4State( + currentStep: currentStep ?? this.currentStep, + firstName: firstName ?? this.firstName, + lastName: lastName ?? this.lastName, + ssn: ssn ?? this.ssn, + address: address ?? this.address, + cityStateZip: cityStateZip ?? this.cityStateZip, + filingStatus: filingStatus ?? this.filingStatus, + multipleJobs: multipleJobs ?? this.multipleJobs, + qualifyingChildren: qualifyingChildren ?? this.qualifyingChildren, + otherDependents: otherDependents ?? this.otherDependents, + otherIncome: otherIncome ?? this.otherIncome, + deductions: deductions ?? this.deductions, + extraWithholding: extraWithholding ?? this.extraWithholding, + signature: signature ?? this.signature, + status: status ?? this.status, + errorMessage: errorMessage ?? this.errorMessage, + ); + } + + int get totalCredits => (qualifyingChildren * 2000) + (otherDependents * 500); + + @override + List get props => [ + currentStep, + firstName, + lastName, + ssn, + address, + cityStateZip, + filingStatus, + multipleJobs, + qualifyingChildren, + otherDependents, + otherIncome, + deductions, + extraWithholding, + signature, + status, + errorMessage, + ]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/form_i9_page.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/form_i9_page.dart new file mode 100644 index 00000000..b62dd855 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/form_i9_page.dart @@ -0,0 +1,852 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart' hide ModularWatchExtension; +import 'package:flutter_bloc/flutter_bloc.dart'; + +import '../blocs/i9/form_i9_cubit.dart'; +import '../blocs/i9/form_i9_state.dart'; + +class FormI9Page extends StatefulWidget { + const FormI9Page({super.key}); + + @override + State createState() => _FormI9PageState(); +} + +class _FormI9PageState extends State { + final List _usStates = [ + 'AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'FL', 'GA', + 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', + 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', + 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', + 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY' + ]; + + final List> _steps = >[ + {'title': 'Personal Information', 'subtitle': 'Name and contact details'}, + {'title': 'Address', 'subtitle': 'Your current address'}, + {'title': 'Citizenship Status', 'subtitle': 'Work authorization verification'}, + {'title': 'Review & Sign', 'subtitle': 'Confirm your information'}, + ]; + + bool _canProceed(FormI9State state) { + switch (state.currentStep) { + case 0: + return state.firstName.trim().isNotEmpty && + state.lastName.trim().isNotEmpty && + state.dob.isNotEmpty && + state.ssn.replaceAll(RegExp(r'\D'), '').length >= 9; + case 1: + return state.address.trim().isNotEmpty && + state.city.trim().isNotEmpty && + state.state.isNotEmpty && + state.zipCode.isNotEmpty; + case 2: + return state.citizenshipStatus.isNotEmpty; + case 3: + return state.signature.trim().isNotEmpty; + default: + return true; + } + } + + void _handleNext(BuildContext context, int currentStep) { + if (currentStep < _steps.length - 1) { + context.read().nextStep(_steps.length); + } else { + context.read().submit(); + } + } + + void _handleBack(BuildContext context) { + context.read().previousStep(); + } + + @override + Widget build(BuildContext context) { + return BlocProvider.value( + value: Modular.get(), + child: BlocConsumer( + listener: (BuildContext context, FormI9State state) { + if (state.status == FormI9Status.success) { + // Success view is handled by state check in build or we can navigate + } else if (state.status == FormI9Status.failure) { + final ScaffoldMessengerState messenger = ScaffoldMessenger.of(context); + messenger.hideCurrentSnackBar(); + messenger.showSnackBar( + SnackBar(content: Text(state.errorMessage ?? 'An error occurred')), + ); + } + }, + builder: (BuildContext context, FormI9State state) { + if (state.status == FormI9Status.success) return _buildSuccessView(); + + return Scaffold( + backgroundColor: UiColors.background, + body: Column( + children: [ + _buildHeader(context, state), + Expanded( + child: SingleChildScrollView( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 24), + child: _buildCurrentStep(context, state), + ), + ), + _buildFooter(context, state), + ], + ), + ); + }, + ), + ); + } + + Widget _buildSuccessView() { + return Scaffold( + backgroundColor: UiColors.background, + body: Center( + child: Padding( + padding: const EdgeInsets.all(24.0), + child: Container( + padding: const EdgeInsets.all(32), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(24), + border: Border.all(color: UiColors.border), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: 64, + height: 64, + decoration: const BoxDecoration( + color: Color(0xFFDCFCE7), + shape: BoxShape.circle, + ), + child: const Icon( + UiIcons.success, + color: Color(0xFF16A34A), + size: 32, + ), + ), + const SizedBox(height: 16), + Text( + 'Form I-9 Submitted!', + style: UiTypography.headline4m.copyWith( + color: UiColors.textPrimary, + ), + ), + const SizedBox(height: 8), + Text( + 'Your employment eligibility verification has been submitted.', + textAlign: TextAlign.center, + style: UiTypography.body2r.copyWith(color: UiColors.textSecondary), + ), + const SizedBox(height: 24), + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () => Modular.to.pop(), + style: ElevatedButton.styleFrom( + backgroundColor: UiColors.primary, + foregroundColor: UiColors.bgPopup, + padding: const EdgeInsets.symmetric(vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + elevation: 0, + ), + child: const Text('Back to Documents'), + ), + ), + ], + ), + ), + ), + ), + ); + } + + Widget _buildHeader(BuildContext context, FormI9State state) { + return Container( + color: UiColors.primary, + padding: const EdgeInsets.only(top: 60, bottom: 24, left: 20, right: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + GestureDetector( + onTap: () => Modular.to.pop(), + child: const Icon( + UiIcons.arrowLeft, + color: UiColors.bgPopup, + size: 24, + ), + ), + const SizedBox(width: 12), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Form I-9', + style: UiTypography.headline4m.copyWith( + color: UiColors.bgPopup, + ), + ), + Text( + 'Employment Eligibility Verification', + style: UiTypography.body3r.copyWith(color: UiColors.bgPopup.withOpacity(0.7)), + ), + ], + ), + ], + ), + const SizedBox(height: 24), + Row( + children: _steps.asMap().entries.map((MapEntry> entry) { + final int idx = entry.key; + final bool isLast = idx == _steps.length - 1; + return Expanded( + child: Row( + children: [ + Expanded( + child: Container( + height: 4, + decoration: BoxDecoration( + color: idx <= state.currentStep + ? UiColors.bgPopup + : UiColors.bgPopup.withOpacity(0.3), + borderRadius: BorderRadius.circular(2), + ), + ), + ), + if (!isLast) const SizedBox(width: 4), + ], + ), + ); + }).toList(), + ), + const SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Step ${state.currentStep + 1} of ${_steps.length}', + style: UiTypography.body3r.copyWith(color: UiColors.bgPopup.withOpacity(0.7)), + ), + Expanded( + child: Text( + _steps[state.currentStep]['title']!, + textAlign: TextAlign.end, + style: UiTypography.body3m.copyWith( + color: UiColors.bgPopup, + fontWeight: FontWeight.w500, + ), + ), + ), + ], + ), + ], + ), + ); + } + + Widget _buildCurrentStep(BuildContext context, FormI9State state) { + switch (state.currentStep) { + case 0: + return _buildStep1(context, state); + case 1: + return _buildStep2(context, state); + case 2: + return _buildStep3(context, state); + case 3: + return _buildStep4(context, state); + default: + return Container(); + } + } + + Widget _buildTextField( + String label, { + required String value, + required ValueChanged onChanged, + TextInputType? keyboardType, + String? placeholder, + }) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label, + style: UiTypography.body3m.copyWith( + color: UiColors.textSecondary, + fontWeight: FontWeight.w500, + ), + ), + const SizedBox(height: 6), + TextField( + controller: TextEditingController(text: value) + ..selection = TextSelection.fromPosition( + TextPosition(offset: value.length), + ), + onChanged: onChanged, + keyboardType: keyboardType, + style: UiTypography.body2r.copyWith(color: UiColors.textPrimary), + decoration: InputDecoration( + hintText: placeholder, + hintStyle: TextStyle(color: Colors.grey[400]), + filled: true, + fillColor: UiColors.bgPopup, + contentPadding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 16, + ), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: UiColors.border), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: UiColors.border), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: UiColors.primary), + ), + ), + ), + ], + ); + } + + Widget _buildStep1(BuildContext context, FormI9State state) { + return Column( + children: [ + Row( + children: [ + Expanded( + child: _buildTextField( + 'First Name *', + value: state.firstName, + onChanged: (String val) => context.read().firstNameChanged(val), + placeholder: 'John', + ), + ), + const SizedBox(width: 12), + Expanded( + child: _buildTextField( + 'Last Name *', + value: state.lastName, + onChanged: (String val) => context.read().lastNameChanged(val), + placeholder: 'Smith', + ), + ), + ], + ), + const SizedBox(height: 16), + Row( + children: [ + Expanded( + child: _buildTextField( + 'Middle Initial', + value: state.middleInitial, + onChanged: (String val) => context.read().middleInitialChanged(val), + placeholder: 'A', + ), + ), + const SizedBox(width: 12), + Expanded( + flex: 2, + child: _buildTextField( + 'Other Last Names', + value: state.otherLastNames, + onChanged: (String val) => context.read().otherLastNamesChanged(val), + placeholder: 'Maiden name (if any)', + ), + ), + ], + ), + const SizedBox(height: 16), + _buildTextField( + 'Date of Birth *', + value: state.dob, + onChanged: (String val) => context.read().dobChanged(val), + placeholder: 'MM/DD/YYYY', + keyboardType: TextInputType.datetime, + ), + const SizedBox(height: 16), + _buildTextField( + 'Social Security Number *', + value: state.ssn, + placeholder: 'XXX-XX-XXXX', + keyboardType: TextInputType.number, + onChanged: (String val) { + String text = val.replaceAll(RegExp(r'\D'), ''); + if (text.length > 9) text = text.substring(0, 9); + context.read().ssnChanged(text); + }, + ), + const SizedBox(height: 16), + _buildTextField( + 'Email Address', + value: state.email, + onChanged: (String val) => context.read().emailChanged(val), + keyboardType: TextInputType.emailAddress, + placeholder: 'john.smith@example.com', + ), + const SizedBox(height: 16), + _buildTextField( + 'Phone Number', + value: state.phone, + onChanged: (String val) => context.read().phoneChanged(val), + keyboardType: TextInputType.phone, + placeholder: '(555) 555-5555', + ), + ], + ); + } + + Widget _buildStep2(BuildContext context, FormI9State state) { + return Column( + children: [ + _buildTextField( + 'Address (Street Number and Name) *', + value: state.address, + onChanged: (String val) => context.read().addressChanged(val), + placeholder: '123 Main Street', + ), + const SizedBox(height: 16), + _buildTextField( + 'Apt. Number', + value: state.aptNumber, + onChanged: (String val) => context.read().aptNumberChanged(val), + placeholder: '4B', + ), + const SizedBox(height: 16), + Row( + children: [ + Expanded( + flex: 2, + child: _buildTextField( + 'City or Town *', + value: state.city, + onChanged: (String val) => context.read().cityChanged(val), + placeholder: 'San Francisco', + ), + ), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'State *', + style: UiTypography.body3m.copyWith( + color: UiColors.textSecondary, + fontWeight: FontWeight.w500, + ), + ), + const SizedBox(height: 6), + DropdownButtonFormField( + value: state.state.isEmpty ? null : state.state, + onChanged: (String? val) => context.read().stateChanged(val ?? ''), + items: _usStates.map((String stateAbbr) { + return DropdownMenuItem( + value: stateAbbr, + child: Text(stateAbbr), + ); + }).toList(), + decoration: InputDecoration( + filled: true, + fillColor: UiColors.bgPopup, + contentPadding: const EdgeInsets.symmetric(horizontal: 16), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: UiColors.border), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: UiColors.border), + ), + ), + ), + ], + ), + ), + ], + ), + const SizedBox(height: 16), + _buildTextField( + 'ZIP Code *', + value: state.zipCode, + onChanged: (String val) => context.read().zipCodeChanged(val), + placeholder: '94103', + keyboardType: TextInputType.number, + ), + ], + ); + } + + Widget _buildStep3(BuildContext context, FormI9State state) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'I attest, under penalty of perjury, that I am (check one of the following boxes):', + style: UiTypography.body2m.copyWith(color: UiColors.textPrimary), + ), + const SizedBox(height: 24), + _buildRadioOption( + context, + state, + 'citizen', + '1. A citizen of the United States', + ), + const SizedBox(height: 12), + _buildRadioOption( + context, + state, + 'noncitizen_national', + '2. A noncitizen national of the United States', + ), + const SizedBox(height: 12), + _buildRadioOption( + context, + state, + 'permanent_resident', + '3. A lawful permanent resident', + child: state.citizenshipStatus == 'permanent_resident' + ? Padding( + padding: const EdgeInsets.only(top: 12), + child: _buildTextField( + 'USCIS Number', + value: state.uscisNumber, + onChanged: (String val) => context.read().uscisNumberChanged(val), + placeholder: 'A-123456789', + ), + ) + : null, + ), + const SizedBox(height: 12), + _buildRadioOption( + context, + state, + 'alien_authorized', + '4. An alien authorized to work', + child: state.citizenshipStatus == 'alien_authorized' + ? Padding( + padding: const EdgeInsets.only(top: 12), + child: Column( + children: [ + _buildTextField( + 'USCIS/Admission Number', + value: state.admissionNumber, + onChanged: (String val) => context.read().admissionNumberChanged(val), + ), + const SizedBox(height: 12), + _buildTextField( + 'Foreign Passport Number', + value: state.passportNumber, + onChanged: (String val) => context.read().passportNumberChanged(val), + ), + const SizedBox(height: 12), + _buildTextField( + 'Country of Issuance', + value: state.countryIssuance, + onChanged: (String val) => context.read().countryIssuanceChanged(val), + ), + ], + ), + ) + : null, + ), + ], + ); + } + + Widget _buildRadioOption(BuildContext context, FormI9State state, String value, String label, {Widget? child}) { + final bool isSelected = state.citizenshipStatus == value; + return GestureDetector( + onTap: () => context.read().citizenshipStatusChanged(value), + child: Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: isSelected ? UiColors.primary : UiColors.border, + width: isSelected ? 2 : 1, + ), + ), + child: Column( + children: [ + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all( + color: isSelected ? UiColors.primary : Colors.grey, + width: isSelected ? 6 : 2, + ), + ), + ), + const SizedBox(width: 12), + Expanded( + child: Text( + label, + style: UiTypography.body2m.copyWith( + color: UiColors.textPrimary, + ), + ), + ), + ], + ), + if (child != null) child, + ], + ), + ), + ); + } + + Widget _buildStep4(BuildContext context, FormI9State state) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: UiColors.border), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Summary', + style: UiTypography.headline4m.copyWith(fontSize: 14), + ), + const SizedBox(height: 12), + _buildSummaryRow('Name', '${state.firstName} ${state.lastName}'), + _buildSummaryRow('Address', '${state.address}, ${state.city}'), + _buildSummaryRow('SSN', '***-**-${state.ssn.length >= 4 ? state.ssn.substring(state.ssn.length - 4) : '****'}'), + _buildSummaryRow('Citizenship', _getReadableCitizenship(state.citizenshipStatus)), + ], + ), + ), + const SizedBox(height: 24), + CheckboxListTile( + value: state.preparerUsed, + onChanged: (bool? val) { + context.read().preparerUsedChanged(val ?? false); + }, + contentPadding: EdgeInsets.zero, + title: Text( + 'I used a preparer or translator', + style: UiTypography.body2r.copyWith(color: UiColors.textPrimary), + ), + controlAffinity: ListTileControlAffinity.leading, + activeColor: UiColors.primary, + ), + const SizedBox(height: 24), + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.amber[50], + borderRadius: BorderRadius.circular(12), + ), + child: const Text( + 'I am aware that federal law provides for imprisonment and/or fines for false statements or use of false documents in connection with the completion of this form.', + style: TextStyle(fontSize: 12, color: Color(0xFFB45309)), + ), + ), + const SizedBox(height: 24), + Text( + 'Signature (type your full name) *', + style: UiTypography.body3m.copyWith( + color: UiColors.textSecondary, + ), + ), + const SizedBox(height: 6), + TextField( + controller: TextEditingController(text: state.signature) + ..selection = TextSelection.fromPosition( + TextPosition(offset: state.signature.length), + ), + onChanged: (String val) => context.read().signatureChanged(val), + decoration: InputDecoration( + hintText: 'Type your full name', + filled: true, + fillColor: UiColors.bgPopup, + contentPadding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 16, + ), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: UiColors.border), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: UiColors.border), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: UiColors.primary), + ), + ), + style: const TextStyle(fontFamily: 'Cursive', fontSize: 18), + ), + const SizedBox(height: 16), + Text( + 'Date', + style: UiTypography.body3m.copyWith( + color: UiColors.textSecondary, + ), + ), + const SizedBox(height: 6), + Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: const Color(0xFFF3F4F6), + borderRadius: BorderRadius.circular(12), + border: Border.all(color: UiColors.border), + ), + child: Text( + DateTime.now().toString().split(' ')[0], + style: const TextStyle(color: UiColors.textPrimary), + ), + ), + ], + ); + } + + Widget _buildSummaryRow(String label, String value) { + return Padding( + padding: const EdgeInsets.only(bottom: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + label, + style: UiTypography.body2r.copyWith(color: UiColors.textSecondary), + ), + Expanded( + child: Text( + value, + textAlign: TextAlign.end, + style: UiTypography.body2m.copyWith( + color: UiColors.textPrimary, + ), + ), + ), + ], + ), + ); + } + + String _getReadableCitizenship(String status) { + switch (status) { + case 'citizen': + return 'US Citizen'; + case 'noncitizen_national': + return 'Noncitizen National'; + case 'permanent_resident': + return 'Permanent Resident'; + case 'alien_authorized': + return 'Alien Authorized to Work'; + default: + return 'Unknown'; + } + } + + Widget _buildFooter(BuildContext context, FormI9State state) { + return Container( + padding: const EdgeInsets.all(16), + decoration: const BoxDecoration( + color: UiColors.bgPopup, + border: Border(top: BorderSide(color: UiColors.border)), + ), + child: SafeArea( + child: Row( + children: [ + if (state.currentStep > 0) + Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 12), + child: OutlinedButton( + onPressed: () => _handleBack(context), + style: OutlinedButton.styleFrom( + padding: const EdgeInsets.symmetric(vertical: 16), + side: const BorderSide(color: UiColors.border), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon(UiIcons.arrowLeft, size: 16, color: UiColors.textPrimary), + const SizedBox(width: 8), + Text( + 'Back', + style: UiTypography.body2r.copyWith(color: UiColors.textPrimary), + ), + ], + ), + ), + ), + ), + Expanded( + flex: 2, + child: ElevatedButton( + onPressed: (_canProceed(state) && state.status != FormI9Status.submitting) + ? () => _handleNext(context, state.currentStep) + : null, + style: ElevatedButton.styleFrom( + backgroundColor: UiColors.primary, + disabledBackgroundColor: Colors.grey[300], + foregroundColor: UiColors.bgPopup, + padding: const EdgeInsets.symmetric(vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + elevation: 0, + ), + child: state.status == FormI9Status.submitting + ? const SizedBox( + width: 20, + height: 20, + child: CircularProgressIndicator( + color: UiColors.bgPopup, + strokeWidth: 2, + ), + ) + : Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + state.currentStep == _steps.length - 1 + ? 'Sign & Submit' + : 'Continue', + ), + if (state.currentStep < _steps.length - 1) ...[ + const SizedBox(width: 8), + const Icon(UiIcons.arrowRight, size: 16, color: UiColors.bgPopup), + ], + ], + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/form_w4_page.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/form_w4_page.dart new file mode 100644 index 00000000..d7eec588 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/form_w4_page.dart @@ -0,0 +1,1056 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart' hide ModularWatchExtension; +import 'package:flutter_bloc/flutter_bloc.dart'; + +import '../blocs/w4/form_w4_cubit.dart'; +import '../blocs/w4/form_w4_state.dart'; + +class FormW4Page extends StatefulWidget { + const FormW4Page({super.key}); + + @override + State createState() => _FormW4PageState(); +} + +class _FormW4PageState extends State { + final List> _steps = >[ + {'title': 'Personal Information', 'subtitle': 'Step 1'}, + {'title': 'Filing Status', 'subtitle': 'Step 1c'}, + {'title': 'Multiple Jobs', 'subtitle': 'Step 2 (optional)'}, + {'title': 'Dependents', 'subtitle': 'Step 3'}, + {'title': 'Other Adjustments', 'subtitle': 'Step 4 (optional)'}, + {'title': 'Review & Sign', 'subtitle': 'Step 5'}, + ]; + + bool _canProceed(FormW4State state) { + switch (state.currentStep) { + case 0: + return state.firstName.trim().isNotEmpty && + state.lastName.trim().isNotEmpty && + state.ssn.replaceAll(RegExp(r'\D'), '').length >= 4 && + state.address.trim().isNotEmpty; + case 1: + return state.filingStatus.isNotEmpty; + case 5: + return state.signature.trim().isNotEmpty; + default: + return true; + } + } + + void _handleNext(BuildContext context, int currentStep) { + if (currentStep < _steps.length - 1) { + context.read().nextStep(_steps.length); + } else { + context.read().submit(); + } + } + + void _handleBack(BuildContext context) { + context.read().previousStep(); + } + + + int _totalCredits(FormW4State state) { + return (state.qualifyingChildren * 2000) + + (state.otherDependents * 500); + } + + @override + Widget build(BuildContext context) { + return BlocProvider.value( + value: Modular.get(), + child: BlocConsumer( + listener: (BuildContext context, FormW4State state) { + if (state.status == FormW4Status.success) { + // Handled in builder + } else if (state.status == FormW4Status.failure) { + final ScaffoldMessengerState messenger = ScaffoldMessenger.of(context); + messenger.hideCurrentSnackBar(); + messenger.showSnackBar( + SnackBar(content: Text(state.errorMessage ?? 'An error occurred')), + ); + } + }, + builder: (BuildContext context, FormW4State state) { + if (state.status == FormW4Status.success) return _buildSuccessView(); + + return Scaffold( + backgroundColor: UiColors.background, + body: Column( + children: [ + _buildHeader(context, state), + Expanded( + child: SingleChildScrollView( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 24), + child: _buildCurrentStep(context, state), + ), + ), + _buildFooter(context, state), + ], + ), + ); + }, + ), + ); + } + + Widget _buildSuccessView() { + return Scaffold( + backgroundColor: UiColors.background, + body: Center( + child: Padding( + padding: const EdgeInsets.all(24.0), + child: Container( + padding: const EdgeInsets.all(32), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(24), + border: Border.all(color: UiColors.border), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: 64, + height: 64, + decoration: const BoxDecoration( + color: Color(0xFFDCFCE7), + shape: BoxShape.circle, + ), + child: const Icon( + UiIcons.success, + color: Color(0xFF16A34A), + size: 32, + ), + ), + const SizedBox(height: 16), + Text( + 'Form W-4 Submitted!', + style: UiTypography.headline4m.copyWith( + color: UiColors.textPrimary, + ), + ), + const SizedBox(height: 8), + Text( + 'Your withholding certificate has been submitted to your employer.', + textAlign: TextAlign.center, + style: UiTypography.body2r.copyWith(color: UiColors.textSecondary), + ), + const SizedBox(height: 24), + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () => Modular.to.pop(), + style: ElevatedButton.styleFrom( + backgroundColor: UiColors.primary, + foregroundColor: UiColors.bgPopup, + padding: const EdgeInsets.symmetric(vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + elevation: 0, + ), + child: const Text('Back to Documents'), + ), + ), + ], + ), + ), + ), + ), + ); + } + + Widget _buildHeader(BuildContext context, FormW4State state) { + return Container( + color: UiColors.primary, + padding: const EdgeInsets.only(top: 60, bottom: 24, left: 20, right: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + GestureDetector( + onTap: () => Modular.to.pop(), + child: const Icon( + UiIcons.arrowLeft, + color: UiColors.bgPopup, + size: 24, + ), + ), + const SizedBox(width: 12), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Form W-4', + style: UiTypography.headline4m.copyWith( + color: UiColors.bgPopup, + ), + ), + Text( + 'Employee\'s Withholding Certificate', + style: UiTypography.body3r.copyWith(color: UiColors.bgPopup.withOpacity(0.7)), + ), + ], + ), + ], + ), + const SizedBox(height: 24), + Row( + children: _steps.asMap().entries.map((MapEntry> entry) { + final int idx = entry.key; + final bool isLast = idx == _steps.length - 1; + return Expanded( + child: Row( + children: [ + Expanded( + child: Container( + height: 4, + decoration: BoxDecoration( + color: idx <= state.currentStep + ? UiColors.bgPopup + : UiColors.bgPopup.withOpacity(0.3), + borderRadius: BorderRadius.circular(2), + ), + ), + ), + if (!isLast) const SizedBox(width: 4), + ], + ), + ); + }).toList(), + ), + const SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Step ${state.currentStep + 1} of ${_steps.length}', + style: UiTypography.body3r.copyWith(color: UiColors.bgPopup.withOpacity(0.7)), + ), + Text( + _steps[state.currentStep]['title']!, + style: UiTypography.body3m.copyWith( + color: UiColors.bgPopup, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ], + ), + ); + } + + Widget _buildCurrentStep(BuildContext context, FormW4State state) { + switch (state.currentStep) { + case 0: + return _buildStep1(context, state); + case 1: + return _buildStep2(context, state); + case 2: + return _buildStep3(context, state); + case 3: + return _buildStep4(context, state); + case 4: + return _buildStep5(context, state); + case 5: + return _buildStep6(context, state); + default: + return Container(); + } + } + + Widget _buildTextField( + String label, { + required String value, + required ValueChanged onChanged, + TextInputType? keyboardType, + String? placeholder, + }) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label, + style: UiTypography.body3m.copyWith( + color: UiColors.textSecondary, + fontWeight: FontWeight.w500, + ), + ), + const SizedBox(height: 6), + TextField( + controller: TextEditingController(text: value) + ..selection = TextSelection.fromPosition( + TextPosition(offset: value.length), + ), + onChanged: onChanged, + keyboardType: keyboardType, + style: UiTypography.body2r.copyWith(color: UiColors.textPrimary), + decoration: InputDecoration( + hintText: placeholder, + hintStyle: TextStyle(color: Colors.grey[400]), + filled: true, + fillColor: UiColors.bgPopup, + contentPadding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 16, + ), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: UiColors.border), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: UiColors.border), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: UiColors.primary), + ), + ), + ), + ], + ); + } + + Widget _buildStep1(BuildContext context, FormW4State state) { + return Column( + children: [ + Row( + children: [ + Expanded( + child: _buildTextField( + 'First Name *', + value: state.firstName, + onChanged: (String val) => context.read().firstNameChanged(val), + placeholder: 'John', + ), + ), + const SizedBox(width: 12), + Expanded( + child: _buildTextField( + 'Last Name *', + value: state.lastName, + onChanged: (String val) => context.read().lastNameChanged(val), + placeholder: 'Smith', + ), + ), + ], + ), + const SizedBox(height: 16), + _buildTextField( + 'Social Security Number *', + value: state.ssn, + placeholder: 'XXX-XX-XXXX', + keyboardType: TextInputType.number, + onChanged: (String val) { + String text = val.replaceAll(RegExp(r'\D'), ''); + if (text.length > 9) text = text.substring(0, 9); + context.read().ssnChanged(text); + }, + ), + const SizedBox(height: 16), + _buildTextField( + 'Address *', + value: state.address, + onChanged: (String val) => context.read().addressChanged(val), + placeholder: '123 Main Street', + ), + const SizedBox(height: 16), + _buildTextField( + 'City, State, ZIP', + value: state.cityStateZip, + onChanged: (String val) => context.read().cityStateZipChanged(val), + placeholder: 'San Francisco, CA 94102', + ), + ], + ); + } + + Widget _buildStep2(BuildContext context, FormW4State state) { + return Column( + children: [ + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.blue[50], + borderRadius: BorderRadius.circular(12), + ), + child: Row( + children: const [ + Icon(UiIcons.info, color: Color(0xFF2563EB), size: 20), + SizedBox(width: 12), + Expanded( + child: Text( + 'Your filing status determines your standard deduction and tax rates.', + style: TextStyle(fontSize: 14, color: Color(0xFF1D4ED8)), + ), + ), + ], + ), + ), + const SizedBox(height: 24), + _buildRadioOption( + context, + state, + 'single', + 'Single or Married filing separately', + null, + ), + const SizedBox(height: 12), + _buildRadioOption( + context, + state, + 'married', + 'Married filing jointly or Qualifying surviving spouse', + null, + ), + const SizedBox(height: 12), + _buildRadioOption( + context, + state, + 'head_of_household', + 'Head of household', + 'Check only if you\'re unmarried and pay more than half the costs of keeping up a home', + ), + ], + ); + } + + Widget _buildRadioOption(BuildContext context, FormW4State state, String value, String label, String? subLabel) { + final bool isSelected = state.filingStatus == value; + return GestureDetector( + onTap: () => context.read().filingStatusChanged(value), + child: Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: isSelected ? UiColors.primary : UiColors.border, + width: isSelected ? 2 : 1, + ), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: const EdgeInsets.only(top: 2), + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all( + color: isSelected ? UiColors.primary : Colors.grey, + width: isSelected ? 6 : 2, + ), + ), + ), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label, + style: UiTypography.body2m.copyWith( + color: UiColors.textPrimary, + ), + ), + if (subLabel != null) ...[ + const SizedBox(height: 4), + Text( + subLabel, + style: UiTypography.body3r.copyWith( + color: UiColors.textSecondary, + ), + ), + ], + ], + ), + ), + ], + ), + ), + ); + } + + Widget _buildStep3(BuildContext context, FormW4State state) { + return Column( + children: [ + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.amber[50], + borderRadius: BorderRadius.circular(12), + ), + child: const Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon( + UiIcons.help, + color: Color(0xFFD97706), + size: 20, + ), + SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'When to complete this step?', + style: TextStyle( + fontWeight: FontWeight.w600, + color: Color(0xFF92400E), + fontSize: 14, + ), + ), + SizedBox(height: 4), + Text( + 'Complete this step only if you hold more than one job at a time, or are married filing jointly and your spouse also works.', + style: TextStyle(fontSize: 12, color: Color(0xFFB45309)), + ), + ], + ), + ), + ], + ), + ), + const SizedBox(height: 24), + GestureDetector( + onTap: () => context.read().multipleJobsChanged(!state.multipleJobs), + child: Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: state.multipleJobs + ? UiColors.primary + : UiColors.border, + ), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 24, + height: 24, + decoration: BoxDecoration( + color: state.multipleJobs + ? UiColors.primary + : UiColors.bgPopup, + borderRadius: BorderRadius.circular(6), + border: Border.all( + color: state.multipleJobs + ? UiColors.primary + : Colors.grey, + ), + ), + child: state.multipleJobs + ? const Icon( + UiIcons.check, + color: UiColors.bgPopup, + size: 16, + ) + : null, + ), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'I have multiple jobs or my spouse works', + style: UiTypography.body2m.copyWith( + color: UiColors.textPrimary, + ), + ), + const SizedBox(height: 4), + Text( + 'Check this box if there are only two jobs total', + style: UiTypography.body3r.copyWith( + color: UiColors.textSecondary, + ), + ), + ], + ), + ), + ], + ), + ), + ), + const SizedBox(height: 16), + Text( + 'If this does not apply, you can continue to the next step', + textAlign: TextAlign.center, + style: UiTypography.body3r.copyWith(color: UiColors.textSecondary), + ), + ], + ); + } + + Widget _buildStep4(BuildContext context, FormW4State state) { + return Column( + children: [ + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.blue[50], // Same note about blue migration + borderRadius: BorderRadius.circular(12), + ), + child: const Row( + children: [ + Icon(UiIcons.info, color: Color(0xFF2563EB), size: 20), + SizedBox(width: 12), + Expanded( + child: Text( + 'If your total income will be \$200,000 or less (\$400,000 if married filing jointly), you may claim credits for dependents.', + style: TextStyle(fontSize: 14, color: Color(0xFF1D4ED8)), + ), + ), + ], + ), + ), + const SizedBox(height: 24), + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(16), + border: Border.all(color: UiColors.border), + ), + child: Column( + children: [ + _buildCounter( + context, + state, + 'Qualifying children under age 17', + '\$2,000 each', + (FormW4State s) => s.qualifyingChildren, + (int val) => context.read().qualifyingChildrenChanged(val), + ), + const Padding( + padding: EdgeInsets.symmetric(vertical: 16), + child: Divider(height: 1, color: UiColors.border), + ), + _buildCounter( + context, + state, + 'Other dependents', + '\$500 each', + (FormW4State s) => s.otherDependents, + (int val) => context.read().otherDependentsChanged(val), + ), + ], + ), + ), + if (_totalCredits(state) > 0) ...[ + const SizedBox(height: 16), + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: const Color(0xFFDCFCE7), + borderRadius: BorderRadius.circular(12), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + 'Total credits (Step 3)', + style: TextStyle( + fontWeight: FontWeight.w500, + color: Color(0xFF166534), + ), + ), + Text( + '\$${_totalCredits(state)}', + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18, + color: Color(0xFF15803D), + ), + ), + ], + ), + ), + ], + ], + ); + } + + Widget _buildCounter( + BuildContext context, + FormW4State state, + String label, + String badge, + int Function(FormW4State) getValue, + Function(int) onChanged, + ) { + final int value = getValue(state); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + label, + style: UiTypography.body2m, + ), + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + color: const Color(0xFFDCFCE7), + borderRadius: BorderRadius.circular(12), + ), + child: Text( + badge, + style: const TextStyle( + fontSize: 10, + color: Color(0xFF15803D), + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + const SizedBox(height: 12), + Row( + children: [ + _buildCircleBtn( + UiIcons.minus, + () => onChanged(value > 0 ? value - 1 : 0), + ), + SizedBox( + width: 48, + child: Text( + value.toString(), + textAlign: TextAlign.center, + style: const TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + _buildCircleBtn( + UiIcons.add, + () => onChanged(value + 1), + ), + ], + ), + ], + ); + } + + Widget _buildCircleBtn(IconData icon, VoidCallback onTap) { + return GestureDetector( + onTap: onTap, + child: Container( + width: 40, + height: 40, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(color: UiColors.border), + color: UiColors.bgPopup, + ), + child: Icon(icon, size: 20, color: UiColors.textPrimary), + ), + ); + } + + Widget _buildStep5(BuildContext context, FormW4State state) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'These adjustments are optional. You can skip them if they don\'t apply.', + style: UiTypography.body2r.copyWith(color: UiColors.textSecondary), + ), + const SizedBox(height: 24), + _buildTextField( + '4(a) Other income (not from jobs)', + value: state.otherIncome, + onChanged: (String val) => context.read().otherIncomeChanged(val), + placeholder: '\$0', + keyboardType: TextInputType.number, + ), + Padding( + padding: const EdgeInsets.only(top: 4, bottom: 16), + child: Text( + 'Include interest, dividends, retirement income', + style: UiTypography.body3r.copyWith(color: UiColors.textSecondary), + ), + ), + + _buildTextField( + '4(b) Deductions', + value: state.deductions, + onChanged: (String val) => context.read().deductionsChanged(val), + placeholder: '\$0', + keyboardType: TextInputType.number, + ), + Padding( + padding: const EdgeInsets.only(top: 4, bottom: 16), + child: Text( + 'If you expect to claim deductions other than the standard deduction', + style: UiTypography.body3r.copyWith(color: UiColors.textSecondary), + ), + ), + + _buildTextField( + '4(c) Extra withholding', + value: state.extraWithholding, + onChanged: (String val) => context.read().extraWithholdingChanged(val), + placeholder: '\$0', + keyboardType: TextInputType.number, + ), + Padding( + padding: const EdgeInsets.only(top: 4, bottom: 16), + child: Text( + 'Any additional tax you want withheld each pay period', + style: UiTypography.body3r.copyWith(color: UiColors.textSecondary), + ), + ), + ], + ); + } + + Widget _buildStep6(BuildContext context, FormW4State state) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: UiColors.border), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Your W-4 Summary', + style: UiTypography.headline4m.copyWith(fontSize: 14), + ), + const SizedBox(height: 12), + _buildSummaryRow( + 'Name', + '${state.firstName} ${state.lastName}', + ), + _buildSummaryRow( + 'SSN', + '***-**-${state.ssn.length >= 4 ? state.ssn.substring(state.ssn.length - 4) : '****'}', + ), + _buildSummaryRow( + 'Filing Status', + _getFilingStatusLabel(state.filingStatus), + ), + if (_totalCredits(state) > 0) + _buildSummaryRow( + 'Credits', + '\$${_totalCredits(state)}', + valueColor: Colors.green[700], + ), + ], + ), + ), + const SizedBox(height: 24), + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.amber[50], + borderRadius: BorderRadius.circular(12), + ), + child: const Text( + 'Under penalties of perjury, I declare that this certificate, to the best of my knowledge and belief, is true, correct, and complete.', + style: TextStyle(fontSize: 12, color: Color(0xFFB45309)), + ), + ), + const SizedBox(height: 24), + Text( + 'Signature (type your full name) *', + style: UiTypography.body3m.copyWith( + color: UiColors.textSecondary, + ), + ), + const SizedBox(height: 6), + TextField( + controller: TextEditingController(text: state.signature) + ..selection = TextSelection.fromPosition( + TextPosition(offset: state.signature.length), + ), + onChanged: (String val) => context.read().signatureChanged(val), + decoration: InputDecoration( + hintText: 'Type your full name', + filled: true, + fillColor: UiColors.bgPopup, + contentPadding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 16, + ), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: UiColors.border), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: UiColors.border), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide(color: UiColors.primary), + ), + ), + style: const TextStyle(fontFamily: 'Cursive', fontSize: 18), + ), + const SizedBox(height: 16), + Text( + 'Date', + style: UiTypography.body3m.copyWith( + color: UiColors.textSecondary, + ), + ), + const SizedBox(height: 6), + Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), + decoration: BoxDecoration( + color: const Color(0xFFF3F4F6), + borderRadius: BorderRadius.circular(12), + border: Border.all(color: UiColors.border), + ), + child: Text( + DateTime.now().toString().split(' ')[0], + style: const TextStyle(color: UiColors.textPrimary), + ), + ), + ], + ); + } + + Widget _buildSummaryRow(String label, String value, {Color? valueColor}) { + return Padding( + padding: const EdgeInsets.only(bottom: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + label, + style: UiTypography.body2r.copyWith(color: UiColors.textSecondary), + ), + Text( + value, + style: UiTypography.body2m.copyWith( + color: valueColor ?? UiColors.textPrimary, + ), + ), + ], + ), + ); + } + + String _getFilingStatusLabel(String status) { + switch (status) { + case 'single': + return 'Single'; + case 'married': + return 'Married'; + case 'head_of_household': + return 'Head of Household'; + default: + return status; + } + } + + Widget _buildFooter(BuildContext context, FormW4State state) { + return Container( + padding: const EdgeInsets.all(16), + decoration: const BoxDecoration( + color: UiColors.bgPopup, + border: Border(top: BorderSide(color: UiColors.border)), + ), + child: SafeArea( + child: Row( + children: [ + if (state.currentStep > 0) + Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 12), + child: OutlinedButton( + onPressed: () => _handleBack(context), + style: OutlinedButton.styleFrom( + padding: const EdgeInsets.symmetric(vertical: 16), + side: const BorderSide(color: UiColors.border), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon(UiIcons.arrowLeft, size: 16, color: UiColors.textPrimary), + const SizedBox(width: 8), + Text( + 'Back', + style: UiTypography.body2r.copyWith(color: UiColors.textPrimary), + ), + ], + ), + ), + ), + ), + Expanded( + flex: 2, + child: ElevatedButton( + onPressed: (_canProceed(state) && state.status != FormW4Status.submitting) + ? () => _handleNext(context, state.currentStep) + : null, + style: ElevatedButton.styleFrom( + backgroundColor: UiColors.primary, + disabledBackgroundColor: Colors.grey[300], + foregroundColor: UiColors.bgPopup, + padding: const EdgeInsets.symmetric(vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + elevation: 0, + ), + child: state.status == FormW4Status.submitting + ? const SizedBox( + width: 20, + height: 20, + child: CircularProgressIndicator( + color: UiColors.bgPopup, + strokeWidth: 2, + ), + ) + : Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + state.currentStep == _steps.length - 1 + ? 'Submit Form' + : 'Continue', + ), + if (state.currentStep < _steps.length - 1) ...[ + const SizedBox(width: 8), + const Icon(UiIcons.arrowRight, size: 16, color: UiColors.bgPopup), + ], + ], + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/tax_forms_page.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/tax_forms_page.dart new file mode 100644 index 00000000..c4acec93 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/presentation/pages/tax_forms_page.dart @@ -0,0 +1,323 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import '../../domain/entities/tax_form_entity.dart'; +import '../blocs/tax_forms/tax_forms_cubit.dart'; +import '../blocs/tax_forms/tax_forms_state.dart'; + +class TaxFormsPage extends StatelessWidget { + const TaxFormsPage({super.key}); + + @override + Widget build(BuildContext context) { + final TaxFormsCubit cubit = Modular.get(); + + if (cubit.state.status == TaxFormsStatus.initial) { + cubit.loadTaxForms(); + } + return Scaffold( + backgroundColor: UiColors.background, + appBar: AppBar( + backgroundColor: UiColors.primary, + elevation: 0, + leading: IconButton( + icon: const Icon(UiIcons.arrowLeft, color: UiColors.bgPopup), + onPressed: () => Modular.to.pop(), + ), + title: Text( + 'Tax Documents', + style: UiTypography.headline3m.copyWith( + color: UiColors.bgPopup, + ), + ), + bottom: PreferredSize( + preferredSize: const Size.fromHeight(24), + child: Padding( + padding: const EdgeInsets.only( + left: UiConstants.space5, + right: UiConstants.space5, + bottom: UiConstants.space5, + ), + child: Row( + children: [ + Expanded( + child: Text( + 'Complete required forms to start working', + style: UiTypography.body3r.copyWith( + color: UiColors.bgPopup.withOpacity(0.8), + ), + ), + ), + ], + ), + ), + ), + ), + body: BlocBuilder( + bloc: Modular.get(), + builder: (BuildContext context, TaxFormsState state) { + if (state.status == TaxFormsStatus.loading) { + return const Center(child: CircularProgressIndicator()); + } + + if (state.status == TaxFormsStatus.failure) { + return Center(child: Text(state.errorMessage ?? 'Error loading forms')); + } + + return SingleChildScrollView( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space5, + vertical: UiConstants.space6, + ), + child: Column( + children: [ + _buildProgressOverview(state.forms), + const SizedBox(height: UiConstants.space6), + ...state.forms.map(_buildFormCard), + const SizedBox(height: UiConstants.space6), + _buildInfoCard(), + ], + ), + ); + }, + ), + ); + } + + Widget _buildProgressOverview(List forms) { + final int completedCount = forms + .where((TaxFormEntity f) => f.status == TaxFormStatus.submitted || f.status == TaxFormStatus.approved) + .length; + final int totalCount = forms.length; + final double progress = totalCount > 0 ? completedCount / totalCount : 0.0; + + return Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Document Progress', + style: UiTypography.body2m.copyWith( + color: UiColors.textPrimary, + ), + ), + Text( + '$completedCount/$totalCount', + style: + UiTypography.body2m.copyWith(color: UiColors.textSecondary), + ), + ], + ), + const SizedBox(height: UiConstants.space3), + ClipRRect( + borderRadius: UiConstants.radiusSm, + child: LinearProgressIndicator( + value: progress, + minHeight: 8, + backgroundColor: UiColors.background, + valueColor: const AlwaysStoppedAnimation( + UiColors.primary, + ), + ), + ), + ], + ), + ); + } + + Widget _buildFormCard(TaxFormEntity form) { + // Helper to get icon based on type (could be in entity or a mapper) + final String icon = form.type == TaxFormType.i9 ? 'πŸ›‚' : 'πŸ“‹'; + + return GestureDetector( + onTap: () { + if (form.type == TaxFormType.i9) { + Modular.to.pushNamed('i9'); + } else if (form.type == TaxFormType.w4) { + Modular.to.pushNamed('w4'); + } + }, + child: Container( + margin: const EdgeInsets.only(bottom: UiConstants.space4), + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 48, + height: 48, + decoration: BoxDecoration( + color: UiColors.primary.withOpacity(0.1), + borderRadius: UiConstants.radiusLg, + ), + child: Center( + child: Text(icon, style: UiTypography.headline1m), + ), + ), + const SizedBox(width: UiConstants.space4), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + form.title, + style: UiTypography.headline4m.copyWith( + color: UiColors.textPrimary, + ), + ), + _buildStatusBadge(form.status), + ], + ), + const SizedBox(height: UiConstants.space1), + Text( + form.subtitle, + style: UiTypography.body2m.copyWith( + fontWeight: FontWeight.w500, + color: UiColors.textSecondary, + ), + ), + const SizedBox(height: UiConstants.space1), + Text( + form.description, + style: UiTypography.body3r.copyWith( + color: UiColors.textSecondary, + ), + ), + ], + ), + ), + const SizedBox(width: UiConstants.space2), + const Icon( + UiIcons.chevronRight, + color: UiColors.textSecondary, + size: 20, + ), + ], + ), + ), + ); + } + + Widget _buildStatusBadge(TaxFormStatus status) { + switch (status) { + case TaxFormStatus.submitted: + case TaxFormStatus.approved: + return Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space2, + vertical: UiConstants.space1, + ), + decoration: BoxDecoration( + color: UiColors.tagSuccess, + borderRadius: UiConstants.radiusLg, + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Icon(UiIcons.success, size: 12, color: UiColors.textSuccess), + const SizedBox(width: UiConstants.space1), + Text( + 'Completed', + style: UiTypography.footnote2b.copyWith( + color: UiColors.textSuccess, + ), + ), + ], + ), + ); + case TaxFormStatus.inProgress: + return Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space2, + vertical: UiConstants.space1, + ), + decoration: BoxDecoration( + color: UiColors.tagPending, + borderRadius: UiConstants.radiusLg, + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Icon(UiIcons.clock, size: 12, color: UiColors.textWarning), + const SizedBox(width: UiConstants.space1), + Text( + 'In Progress', + style: UiTypography.footnote2b.copyWith( + color: UiColors.textWarning, + ), + ), + ], + ), + ); + default: + return Container( + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space2, + vertical: UiConstants.space1, + ), + decoration: BoxDecoration( + color: UiColors.tagValue, + borderRadius: UiConstants.radiusLg, + ), + child: Text( + 'Not Started', + style: UiTypography.footnote2b.copyWith( + color: UiColors.textSecondary, + ), + ), + ); + } + } + + Widget _buildInfoCard() { + return Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: UiConstants.radiusLg, + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Icon(UiIcons.file, color: UiColors.primary, size: 20), + const SizedBox(width: UiConstants.space3), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Why are these needed?', + style: UiTypography.headline4m.copyWith( + color: UiColors.textPrimary, + ), + ), + const SizedBox(height: UiConstants.space1), + Text( + 'I-9 and W-4 forms are required by federal law to verify your employment eligibility and set up correct tax withholding.', + style: UiTypography.body3r.copyWith(color: UiColors.textSecondary), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/staff_tax_forms_module.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/staff_tax_forms_module.dart new file mode 100644 index 00000000..18f67e4b --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/src/staff_tax_forms_module.dart @@ -0,0 +1,41 @@ +import 'package:firebase_auth/firebase_auth.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'data/repositories/tax_forms_repository_impl.dart'; +import 'domain/repositories/tax_forms_repository.dart'; +import 'domain/usecases/get_tax_forms_usecase.dart'; +import 'domain/usecases/submit_tax_form_usecase.dart'; +import 'presentation/blocs/i9/form_i9_cubit.dart'; +import 'presentation/blocs/tax_forms/tax_forms_cubit.dart'; +import 'presentation/blocs/w4/form_w4_cubit.dart'; +import 'presentation/pages/form_i9_page.dart'; +import 'presentation/pages/form_w4_page.dart'; +import 'presentation/pages/tax_forms_page.dart'; + +class StaffTaxFormsModule extends Module { + @override + void binds(Injector i) { + i.addLazySingleton( + () => TaxFormsRepositoryImpl( + firebaseAuth: FirebaseAuth.instance, + dataConnect: ExampleConnector.instance, + ), + ); + + // Use Cases + i.addLazySingleton(GetTaxFormsUseCase.new); + i.addLazySingleton(SubmitTaxFormUseCase.new); + + // Blocs + i.addLazySingleton(TaxFormsCubit.new); + i.addLazySingleton(FormI9Cubit.new); + i.addLazySingleton(FormW4Cubit.new); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (_) => const TaxFormsPage()); + r.child('/i9', child: (_) => const FormI9Page()); + r.child('/w4', child: (_) => const FormW4Page()); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/staff_tax_forms.dart b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/staff_tax_forms.dart new file mode 100644 index 00000000..126a4e79 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/lib/staff_tax_forms.dart @@ -0,0 +1,3 @@ +library staff_tax_forms; + +export 'src/staff_tax_forms_module.dart'; diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/pubspec.lock b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/pubspec.lock new file mode 100644 index 00000000..9b3416a2 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/pubspec.lock @@ -0,0 +1,778 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: cd83f7d6bd4e4c0b0b4fef802e8796784032e1cc23d7b0e982cf5d05d9bbe182 + url: "https://pub.dev" + source: hosted + version: "1.3.66" + archive: + dependency: transitive + description: + name: archive + sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d + url: "https://pub.dev" + source: hosted + version: "3.6.1" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" + source: hosted + version: "2.13.0" + auto_injector: + dependency: transitive + description: + name: auto_injector + sha256: "1fc2624898e92485122eb2b1698dd42511d7ff6574f84a3a8606fc4549a1e8f8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + bloc: + dependency: "direct main" + description: + name: bloc + sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e" + url: "https://pub.dev" + source: hosted + version: "8.1.4" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + core_localization: + dependency: "direct main" + description: + path: "../../../../../core_localization" + relative: true + source: path + version: "0.0.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" + source: hosted + version: "3.0.7" + csv: + dependency: transitive + description: + name: csv + sha256: c6aa2679b2a18cb57652920f674488d89712efaf4d3fdf2e537215b35fc19d6c + url: "https://pub.dev" + source: hosted + version: "6.0.0" + design_system: + dependency: "direct main" + description: + path: "../../../../../design_system" + relative: true + source: path + version: "0.0.1" + equatable: + dependency: "direct main" + description: + name: equatable + sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b" + url: "https://pub.dev" + source: hosted + version: "2.0.8" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c + url: "https://pub.dev" + source: hosted + version: "2.1.5" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + firebase_app_check: + dependency: transitive + description: + name: firebase_app_check + sha256: "45f0d279ea7ae4eac1867a4c85aa225761e3ac0ccf646386a860b2bc16581f76" + url: "https://pub.dev" + source: hosted + version: "0.4.1+4" + firebase_app_check_platform_interface: + dependency: transitive + description: + name: firebase_app_check_platform_interface + sha256: e32b4e6adeaac207a6f7afe0906d97c0811de42fb200d9b6317a09155de65e2b + url: "https://pub.dev" + source: hosted + version: "0.2.1+4" + firebase_app_check_web: + dependency: transitive + description: + name: firebase_app_check_web + sha256: "2cbc8a18a34813a7e31d7b30f989973087421cd5d0e397b4dd88a90289aa2bed" + url: "https://pub.dev" + source: hosted + version: "0.2.2+2" + firebase_auth: + dependency: "direct main" + description: + name: firebase_auth + sha256: b20d1540460814c5984474c1e9dd833bdbcff6ecd8d6ad86cc9da8cfd581c172 + url: "https://pub.dev" + source: hosted + version: "6.1.4" + firebase_auth_platform_interface: + dependency: transitive + description: + name: firebase_auth_platform_interface + sha256: fd0225320b6bbc92460c86352d16b60aea15f9ef88292774cca97b0522ea9f72 + url: "https://pub.dev" + source: hosted + version: "8.1.6" + firebase_auth_web: + dependency: transitive + description: + name: firebase_auth_web + sha256: be7dccb263b89fbda2a564de9d8193118196e8481ffb937222a025cdfdf82c40 + url: "https://pub.dev" + source: hosted + version: "6.1.2" + firebase_core: + dependency: transitive + description: + name: firebase_core + sha256: "923085c881663ef685269b013e241b428e1fb03cdd0ebde265d9b40ff18abf80" + url: "https://pub.dev" + source: hosted + version: "4.4.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: cccb4f572325dc14904c02fcc7db6323ad62ba02536833dddb5c02cac7341c64 + url: "https://pub.dev" + source: hosted + version: "6.0.2" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "83e7356c704131ca4d8d8dd57e360d8acecbca38b1a3705c7ae46cc34c708084" + url: "https://pub.dev" + source: hosted + version: "3.4.0" + firebase_data_connect: + dependency: "direct main" + description: + name: firebase_data_connect + sha256: "01d0f8e33c520a6e6f59cf5ac6ff281d1927f7837f094fa8eb5fdb0b1b328ad8" + url: "https://pub.dev" + source: hosted + version: "0.2.2+2" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: "direct main" + description: + name: flutter_bloc + sha256: b594505eac31a0518bdcb4b5b79573b8d9117b193cc80cc12e17d639b10aa27a + url: "https://pub.dev" + source: hosted + version: "8.1.6" + flutter_localizations: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_modular: + dependency: "direct main" + description: + name: flutter_modular + sha256: "33a63d9fe61429d12b3dfa04795ed890f17d179d3d38e988ba7969651fcd5586" + url: "https://pub.dev" + source: hosted + version: "6.4.1" + flutter_test: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + font_awesome_flutter: + dependency: transitive + description: + name: font_awesome_flutter + sha256: b9011df3a1fa02993630b8fb83526368cf2206a711259830325bab2f1d2a4eb0 + url: "https://pub.dev" + source: hosted + version: "10.12.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + google_fonts: + dependency: transitive + description: + name: google_fonts + sha256: "6996212014b996eaa17074e02b1b925b212f5e053832d9048970dc27255a8fb3" + url: "https://pub.dev" + source: hosted + version: "7.1.0" + google_identity_services_web: + dependency: transitive + description: + name: google_identity_services_web + sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454" + url: "https://pub.dev" + source: hosted + version: "0.3.3+1" + googleapis_auth: + dependency: transitive + description: + name: googleapis_auth + sha256: befd71383a955535060acde8792e7efc11d2fccd03dd1d3ec434e85b68775938 + url: "https://pub.dev" + source: hosted + version: "1.6.0" + grpc: + dependency: transitive + description: + name: grpc + sha256: e93ee3bce45c134bf44e9728119102358c7cd69de7832d9a874e2e74eb8cab40 + url: "https://pub.dev" + source: hosted + version: "3.2.4" + hooks: + dependency: transitive + description: + name: hooks + sha256: "5d309c86e7ce34cd8e37aa71cb30cb652d3829b900ab145e4d9da564b31d59f7" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + http: + dependency: transitive + description: + name: http + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" + url: "https://pub.dev" + source: hosted + version: "1.6.0" + http2: + dependency: transitive + description: + name: http2 + sha256: "382d3aefc5bd6dc68c6b892d7664f29b5beb3251611ae946a98d35158a82bbfa" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + intl: + dependency: transitive + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + krow_core: + dependency: "direct main" + description: + path: "../../../../../core" + relative: true + source: path + version: "0.0.1" + krow_data_connect: + dependency: "direct main" + description: + path: "../../../../../data_connect" + relative: true + source: path + version: "0.0.1" + krow_domain: + dependency: "direct main" + description: + path: "../../../../../domain" + relative: true + source: path + version: "0.0.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.dev" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + lucide_icons: + dependency: "direct main" + description: + name: lucide_icons + sha256: ad24d0fd65707e48add30bebada7d90bff2a1bba0a72d6e9b19d44246b0e83c4 + url: "https://pub.dev" + source: hosted + version: "0.257.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + url: "https://pub.dev" + source: hosted + version: "1.17.0" + modular_core: + dependency: transitive + description: + name: modular_core + sha256: "1db0420a0dfb8a2c6dca846e7cbaa4ffeb778e247916dbcb27fb25aa566e5436" + url: "https://pub.dev" + source: hosted + version: "3.4.1" + native_toolchain_c: + dependency: transitive + description: + name: native_toolchain_c + sha256: "89e83885ba09da5fdf2cdacc8002a712ca238c28b7f717910b34bcd27b0d03ac" + url: "https://pub.dev" + source: hosted + version: "0.17.4" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "7fd0c4d8ac8980011753b9bdaed2bf15111365924cdeeeaeb596214ea2b03537" + url: "https://pub.dev" + source: hosted + version: "9.2.4" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: f2c65e21139ce2c3dad46922be8272bb5963516045659e71bb16e151c93b580e + url: "https://pub.dev" + source: hosted + version: "2.2.22" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + protobuf: + dependency: transitive + description: + name: protobuf + sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + provider: + dependency: transitive + description: + name: provider + sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272" + url: "https://pub.dev" + source: hosted + version: "6.1.5+1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + result_dart: + dependency: transitive + description: + name: result_dart + sha256: "0666b21fbdf697b3bdd9986348a380aa204b3ebe7c146d8e4cdaa7ce735e6054" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + shared_preferences: + dependency: transitive + description: + name: shared_preferences + sha256: "2939ae520c9024cb197fc20dee269cd8cdbf564c8b5746374ec6cacdc5169e64" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "83af5c682796c0f7719c2bbf74792d113e40ae97981b8f266fa84574573556bc" + url: "https://pub.dev" + source: hosted + version: "2.4.18" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" + url: "https://pub.dev" + source: hosted + version: "2.5.6" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + slang: + dependency: transitive + description: + name: slang + sha256: "13e3b6f07adc51ab751e7889647774d294cbce7a3382f81d9e5029acfe9c37b2" + url: "https://pub.dev" + source: hosted + version: "4.12.0" + slang_flutter: + dependency: transitive + description: + name: slang_flutter + sha256: "0a4545cca5404d6b7487cf61cf1fe56c52daeb08de56a7574ee8381fbad035a0" + url: "https://pub.dev" + source: hosted + version: "4.12.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + url: "https://pub.dev" + source: hosted + version: "0.7.7" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8 + url: "https://pub.dev" + source: hosted + version: "4.5.2" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" + source: hosted + version: "15.0.2" + watcher: + dependency: transitive + description: + name: watcher + sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.10.7 <4.0.0" + flutter: ">=3.38.4" diff --git a/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/pubspec.yaml b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/pubspec.yaml new file mode 100644 index 00000000..d0ae944d --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/compliance/tax_forms/pubspec.yaml @@ -0,0 +1,31 @@ +name: staff_tax_forms +description: Staff Tax Forms feature. +version: 0.0.1 +publish_to: none + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + bloc: ^8.1.0 + flutter_modular: ^6.3.0 + equatable: ^2.0.5 + lucide_icons: ^0.257.0 + firebase_auth: ^6.1.4 + firebase_data_connect: ^0.2.2+2 + + # Architecture Packages + design_system: + path: ../../../../../design_system + krow_core: + path: ../../../../../core + core_localization: + path: ../../../../../core_localization + krow_domain: + path: ../../../../../domain + krow_data_connect: + path: ../../../../../data_connect diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/data/repositories/bank_account_repository_impl.dart b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/data/repositories/bank_account_repository_impl.dart new file mode 100644 index 00000000..abe63ddc --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/data/repositories/bank_account_repository_impl.dart @@ -0,0 +1,138 @@ +import 'package:firebase_auth/firebase_auth.dart' as auth; +import 'package:firebase_data_connect/firebase_data_connect.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:krow_domain/krow_domain.dart'; + +import '../../domain/repositories/bank_account_repository.dart'; + +/// Implementation of [BankAccountRepository]. +class BankAccountRepositoryImpl implements BankAccountRepository { + const BankAccountRepositoryImpl({ + required this.dataConnect, + required this.firebaseAuth, + }); + + final ExampleConnector dataConnect; + final auth.FirebaseAuth firebaseAuth; + + @override + Future> getAccounts() async { + final auth.User? user = firebaseAuth.currentUser; + if (user == null) throw Exception('User not authenticated'); + + // return some mock data for now + return [ + BankAccount( + id: '1', + userId: user.uid, + bankName: 'Mock Bank', + accountNumber: '****1234', + accountName: 'My Checking Account', + type: BankAccountType.checking, + last4: '1234', + isPrimary: true, + ), + BankAccount( + id: '2', + userId: user.uid, + bankName: 'Mock Bank', + accountNumber: '****5678', + accountName: 'My Savings Account', + type: BankAccountType.savings, + last4: '5678', + isPrimary: false, + ), + BankAccount( + id: '3', + userId: user.uid, + bankName: 'Mock Bank', + accountNumber: '****1234', + accountName: 'My Checking Account', + type: BankAccountType.checking, + last4: '1234', + isPrimary: true, + ), + BankAccount( + id: '4', + userId: user.uid, + bankName: 'Mock Bank', + accountNumber: '****5678', + accountName: 'My Savings Account', + type: BankAccountType.savings, + last4: '5678', + isPrimary: false, + ), + BankAccount( + id: '5', + userId: user.uid, + bankName: 'Mock Bank', + accountNumber: '****1234', + accountName: 'My Checking Account', + type: BankAccountType.checking, + last4: '1234', + isPrimary: true, + ), + BankAccount( + id: '6', + userId: user.uid, + bankName: 'Mock Bank', + accountNumber: '****5678', + accountName: 'My Savings Account', + type: BankAccountType.savings, + last4: '5678', + isPrimary: false, + ), + ]; + + final QueryResult result = await dataConnect.getAccountsByOwnerId(ownerId: user.uid).execute(); + + return result.data.accounts.map((GetAccountsByOwnerIdAccounts account) { + return BankAccount( + id: account.id, + userId: account.ownerId, + bankName: account.bank, + accountNumber: account.last4, // Using last4 as account number representation for now + last4: account.last4, + accountName: '', // Not returned by API + type: _mapAccountType(account.type), + isPrimary: account.isPrimary ?? false, + ); + }).toList(); + } + + @override + Future addAccount(BankAccount account) async { + final auth.User? user = firebaseAuth.currentUser; + if (user == null) throw Exception('User not authenticated'); + + await dataConnect.createAccount( + bank: account.bankName, + type: _mapDomainType(account.type), + last4: account.last4 ?? account.accountNumber.substring(account.accountNumber.length - 4), + ownerId: user.uid, + ).isPrimary(account.isPrimary).execute(); + } + + BankAccountType _mapAccountType(EnumValue type) { + if (type is Known) { + switch (type.value) { + case AccountType.CHECKING: + return BankAccountType.checking; + case AccountType.SAVINGS: + return BankAccountType.savings; + } + } + return BankAccountType.other; + } + + AccountType _mapDomainType(BankAccountType type) { + switch (type) { + case BankAccountType.checking: + return AccountType.CHECKING; + case BankAccountType.savings: + return AccountType.SAVINGS; + default: + return AccountType.CHECKING; // Default fallback + } + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/domain/arguments/add_bank_account_params.dart b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/domain/arguments/add_bank_account_params.dart new file mode 100644 index 00000000..ead4135d --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/domain/arguments/add_bank_account_params.dart @@ -0,0 +1,16 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; + +/// Arguments for adding a bank account. +class AddBankAccountParams extends UseCaseArgument with EquatableMixin { + final BankAccount account; + + const AddBankAccountParams({required this.account}); + + @override + List get props => [account]; + + @override + bool? get stringify => true; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/domain/repositories/bank_account_repository.dart b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/domain/repositories/bank_account_repository.dart new file mode 100644 index 00000000..3e701aba --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/domain/repositories/bank_account_repository.dart @@ -0,0 +1,10 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Repository interface for managing bank accounts. +abstract class BankAccountRepository { + /// Fetches the list of bank accounts for the current user. + Future> getAccounts(); + + /// adds a new bank account. + Future addAccount(BankAccount account); +} diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/domain/usecases/add_bank_account_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/domain/usecases/add_bank_account_usecase.dart new file mode 100644 index 00000000..48d4a863 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/domain/usecases/add_bank_account_usecase.dart @@ -0,0 +1,15 @@ +import 'package:krow_core/core.dart'; +import '../repositories/bank_account_repository.dart'; +import '../arguments/add_bank_account_params.dart'; + +/// Use case to add a bank account. +class AddBankAccountUseCase implements UseCase { + final BankAccountRepository _repository; + + AddBankAccountUseCase(this._repository); + + @override + Future call(AddBankAccountParams params) { + return _repository.addAccount(params.account); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/domain/usecases/get_bank_accounts_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/domain/usecases/get_bank_accounts_usecase.dart new file mode 100644 index 00000000..2ee64df3 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/domain/usecases/get_bank_accounts_usecase.dart @@ -0,0 +1,15 @@ +import 'package:krow_core/core.dart'; // For UseCase +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/bank_account_repository.dart'; + +/// Use case to fetch bank accounts. +class GetBankAccountsUseCase implements NoInputUseCase> { + final BankAccountRepository _repository; + + GetBankAccountsUseCase(this._repository); + + @override + Future> call() { + return _repository.getAccounts(); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/blocs/bank_account_cubit.dart b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/blocs/bank_account_cubit.dart new file mode 100644 index 00000000..52e9a9b4 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/blocs/bank_account_cubit.dart @@ -0,0 +1,75 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/arguments/add_bank_account_params.dart'; +import '../../domain/usecases/add_bank_account_usecase.dart'; +import '../../domain/usecases/get_bank_accounts_usecase.dart'; +import 'bank_account_state.dart'; + +class BankAccountCubit extends Cubit { + final GetBankAccountsUseCase _getBankAccountsUseCase; + final AddBankAccountUseCase _addBankAccountUseCase; + + BankAccountCubit({ + required GetBankAccountsUseCase getBankAccountsUseCase, + required AddBankAccountUseCase addBankAccountUseCase, + }) : _getBankAccountsUseCase = getBankAccountsUseCase, + _addBankAccountUseCase = addBankAccountUseCase, + super(const BankAccountState()); + + Future loadAccounts() async { + emit(state.copyWith(status: BankAccountStatus.loading)); + try { + final accounts = await _getBankAccountsUseCase(); + emit(state.copyWith( + status: BankAccountStatus.loaded, + accounts: accounts, + )); + } catch (e) { + emit(state.copyWith( + status: BankAccountStatus.error, + errorMessage: e.toString(), + )); + } + } + + void toggleForm(bool show) { + emit(state.copyWith(showForm: show)); + } + + Future addAccount({ + required String routingNumber, + required String accountNumber, + required String type, + }) async { + emit(state.copyWith(status: BankAccountStatus.loading)); + + // Create domain entity + final newAccount = BankAccount( + id: '', // Generated by server usually + userId: '', // Handled by Repo/Auth + bankName: 'New Bank', // Mock + accountNumber: accountNumber, + accountName: '', + type: type == 'CHECKING' ? BankAccountType.checking : BankAccountType.savings, + last4: accountNumber.length > 4 ? accountNumber.substring(accountNumber.length - 4) : accountNumber, + isPrimary: false, + ); + + try { + await _addBankAccountUseCase(AddBankAccountParams(account: newAccount)); + + // Re-fetch to get latest state including server-generated IDs + await loadAccounts(); + + emit(state.copyWith( + showForm: false, // Close form on success + )); + } catch (e) { + emit(state.copyWith( + status: BankAccountStatus.error, + errorMessage: e.toString(), + )); + } + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/blocs/bank_account_state.dart b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/blocs/bank_account_state.dart new file mode 100644 index 00000000..30a5e8c0 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/blocs/bank_account_state.dart @@ -0,0 +1,35 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; + +enum BankAccountStatus { initial, loading, loaded, error } + +class BankAccountState extends Equatable { + final BankAccountStatus status; + final List accounts; + final String? errorMessage; + final bool showForm; + + const BankAccountState({ + this.status = BankAccountStatus.initial, + this.accounts = const [], + this.errorMessage, + this.showForm = false, + }); + + BankAccountState copyWith({ + BankAccountStatus? status, + List? accounts, + String? errorMessage, + bool? showForm, + }) { + return BankAccountState( + status: status ?? this.status, + accounts: accounts ?? this.accounts, + errorMessage: errorMessage, + showForm: showForm ?? this.showForm, + ); + } + + @override + List get props => [status, accounts, errorMessage, showForm]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/navigation/staff_bank_account_navigator.dart b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/navigation/staff_bank_account_navigator.dart new file mode 100644 index 00000000..ef1b11fb --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/navigation/staff_bank_account_navigator.dart @@ -0,0 +1,7 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +extension StaffBankAccountNavigator on IModularNavigator { + void popPage() { + pop(); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/pages/bank_account_page.dart b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/pages/bank_account_page.dart new file mode 100644 index 00000000..431355e7 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/pages/bank_account_page.dart @@ -0,0 +1,243 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:design_system/design_system.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:krow_domain/krow_domain.dart'; +// ignore: depend_on_referenced_packages + +import '../blocs/bank_account_cubit.dart'; +import '../blocs/bank_account_state.dart'; +import '../navigation/staff_bank_account_navigator.dart'; +import '../widgets/add_account_form.dart'; + +class BankAccountPage extends StatelessWidget { + const BankAccountPage({super.key}); + + @override + Widget build(BuildContext context) { + final BankAccountCubit cubit = Modular.get(); + // Load accounts initially + if (cubit.state.status == BankAccountStatus.initial) { + cubit.loadAccounts(); + } + + // final t = AppTranslation.current; // Replaced + final Translations t = Translations.of(context); + final dynamic strings = t.staff.profile.bank_account_page; + + return Scaffold( + backgroundColor: UiColors.background, + appBar: AppBar( + backgroundColor: UiColors.background, // Was surface + elevation: 0, + leading: IconButton( + icon: const Icon(UiIcons.arrowLeft, color: UiColors.textSecondary), + onPressed: () => Modular.to.popPage(), + ), + title: Text( + strings.title, + style: UiTypography.headline3m.copyWith(color: UiColors.textPrimary), + ), + bottom: PreferredSize( + preferredSize: const Size.fromHeight(1.0), + child: Container(color: UiColors.border, height: 1.0), + ), + ), + body: BlocBuilder( + bloc: cubit, + builder: (BuildContext context, BankAccountState state) { + if (state.status == BankAccountStatus.loading && state.accounts.isEmpty) { + return const Center(child: CircularProgressIndicator()); + } + + if (state.status == BankAccountStatus.error) { + return Center(child: Text(state.errorMessage ?? 'Error')); + } + + return Column( + children: [ + Expanded( + child: SingleChildScrollView( + padding: const EdgeInsets.all(UiConstants.space4), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildSecurityNotice(strings), + const SizedBox(height: UiConstants.space6), + Text( + strings.linked_accounts, + style: UiTypography.headline4m.copyWith(color: UiColors.textPrimary), + ), + const SizedBox(height: UiConstants.space3), + ...state.accounts.map((BankAccount a) => _buildAccountCard(a, strings)), // Added type + + // Add extra padding at bottom + const SizedBox(height: 80), + ], + ), + ), + ), + Container( + padding: const EdgeInsets.all(UiConstants.space5), + decoration: const BoxDecoration( + color: UiColors.background, // Was surface + border: Border(top: BorderSide(color: UiColors.border)), + ), + child: SafeArea( + child: UiButton.primary( + text: strings.add_account, + leadingIcon: UiIcons.add, + onPressed: () { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.transparent, + child: AddAccountForm( + strings: strings, + onSubmit: (String routing, String account, String type) { + cubit.addAccount( + routingNumber: routing, + accountNumber: account, + type: type, + ); + Modular.to.popPage(); + }, + onCancel: () { + Modular.to.popPage(); + }, + ), + ); + }, + ); + }, + fullWidth: true, + ), + ), + ), + ], + ); + }, + ), + ); + } + + Widget _buildSecurityNotice(dynamic strings) { + return Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.primary.withOpacity(0.08), + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Icon(UiIcons.shield, color: UiColors.primary, size: 20), + const SizedBox(width: UiConstants.space3), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + strings.secure_title, + style: UiTypography.body2r.copyWith( // Was body2 + fontWeight: FontWeight.w500, + color: UiColors.textPrimary, + ), + ), + const SizedBox(height: 2), + Text( + strings.secure_subtitle, + style: UiTypography.body3r.copyWith(color: UiColors.textSecondary), // Was bodySmall + ), + ], + ), + ), + ], + ), + ); + } + + Widget _buildAccountCard(BankAccount account, dynamic strings) { + final bool isPrimary = account.isPrimary; + const Color primaryColor = UiColors.primary; + + return Container( + margin: const EdgeInsets.only(bottom: UiConstants.space3), + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.bgPopup, // Was surface, using bgPopup (white) for card + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + border: Border.all( + color: isPrimary ? primaryColor : UiColors.border, + width: isPrimary ? 2 : 1, + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Container( + width: 48, + height: 48, + decoration: BoxDecoration( + color: primaryColor.withOpacity(0.1), + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + ), + child: const Center( + child: Icon( + UiIcons.building, + color: primaryColor, + size: 24, + ), + ), + ), + const SizedBox(width: UiConstants.space3), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + account.bankName, + style: UiTypography.body2r.copyWith( // Was body2 + fontWeight: FontWeight.w500, + color: UiColors.textPrimary, + ), + ), + Text( + strings.account_ending(last4: account.last4), + style: UiTypography.body2r.copyWith( // Was body2 + color: UiColors.textSecondary, + ), + ), + ], + ), + ], + ), + if (isPrimary) + Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + color: primaryColor.withOpacity(0.15), + borderRadius: BorderRadius.circular(20), + ), + child: Row( + children: [ + const Icon(UiIcons.check, size: 12, color: primaryColor), + const SizedBox(width: 4), + Text( + strings.primary, + style: UiTypography.body3r.copyWith( // Was bodySmall + fontWeight: FontWeight.w500, + color: primaryColor, + ), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/widgets/add_account_form.dart b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/widgets/add_account_form.dart new file mode 100644 index 00000000..6b07b661 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/presentation/widgets/add_account_form.dart @@ -0,0 +1,135 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:design_system/design_system.dart'; +import '../blocs/bank_account_cubit.dart'; + +class AddAccountForm extends StatefulWidget { + final dynamic strings; + final Function(String routing, String account, String type) onSubmit; + final VoidCallback onCancel; + + const AddAccountForm({super.key, required this.strings, required this.onSubmit, required this.onCancel}); + + @override + State createState() => _AddAccountFormState(); +} + +class _AddAccountFormState extends State { + final TextEditingController _routingController = TextEditingController(); + final TextEditingController _accountController = TextEditingController(); + String _selectedType = 'CHECKING'; + + @override + void dispose() { + _routingController.dispose(); + _accountController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.bgPopup, // Was surface + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + border: Border.all(color: UiColors.border), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + widget.strings.add_new_account, + style: UiTypography.headline4m.copyWith(color: UiColors.textPrimary), // Was header4 + ), + const SizedBox(height: UiConstants.space4), + UiTextField( + label: widget.strings.routing_number, + hintText: widget.strings.routing_hint, + controller: _routingController, + keyboardType: TextInputType.number, + ), + const SizedBox(height: UiConstants.space4), + UiTextField( + label: widget.strings.account_number, + hintText: widget.strings.account_hint, + controller: _accountController, + keyboardType: TextInputType.number, + ), + const SizedBox(height: UiConstants.space4), + Padding( + padding: const EdgeInsets.only(bottom: UiConstants.space2), + child: Text( + widget.strings.account_type, + style: UiTypography.body2r.copyWith( // Was body2 + color: UiColors.textSecondary, fontWeight: FontWeight.w500), + ), + ), + Row( + children: [ + Expanded( + child: _buildTypeButton('CHECKING', widget.strings.checking)), + const SizedBox(width: UiConstants.space2), + Expanded( + child: _buildTypeButton('SAVINGS', widget.strings.savings)), + ], + ), + const SizedBox(height: UiConstants.space6), + Row( + children: [ + Expanded( + child: UiButton.text( + text: widget.strings.cancel, + onPressed: () => widget.onCancel(), + ), + ), + const SizedBox(width: UiConstants.space2), + Expanded( + child: UiButton.primary( + text: widget.strings.save, + onPressed: () { + widget.onSubmit( + _routingController.text, + _accountController.text, + _selectedType, + ); + }, + ), + ), + ], + ), + ], + ), + ); + } + + Widget _buildTypeButton(String type, String label) { + final bool isSelected = _selectedType == type; + return GestureDetector( + onTap: () => setState(() => _selectedType = type), + child: Container( + padding: const EdgeInsets.symmetric(vertical: 12), + decoration: BoxDecoration( + color: isSelected + ? UiColors.primary.withOpacity(0.05) + : UiColors.bgPopup, // Was surface + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + border: Border.all( + color: isSelected ? UiColors.primary : UiColors.border, + width: isSelected ? 2 : 1, + ), + ), + child: Center( + child: Text( + label, + style: UiTypography.body2r.copyWith( // Was body2 + fontWeight: FontWeight.w600, + color: isSelected ? UiColors.primary : UiColors.textSecondary, + ), + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/staff_bank_account_module.dart b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/staff_bank_account_module.dart new file mode 100644 index 00000000..5b934782 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/src/staff_bank_account_module.dart @@ -0,0 +1,43 @@ +import 'package:firebase_auth/firebase_auth.dart' as auth; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:staff_bank_account/src/data/repositories/bank_account_repository_impl.dart'; + +import 'domain/repositories/bank_account_repository.dart'; +import 'domain/usecases/add_bank_account_usecase.dart'; +import 'domain/usecases/get_bank_accounts_usecase.dart'; +import 'presentation/blocs/bank_account_cubit.dart'; +import 'presentation/pages/bank_account_page.dart'; + +class StaffBankAccountModule extends Module { + @override + List get imports => [DataConnectModule()]; + + @override + void binds(Injector i) { + // Repositories + i.addLazySingleton( + () => BankAccountRepositoryImpl( + firebaseAuth: auth.FirebaseAuth.instance, + dataConnect: ExampleConnector.instance, + ), + ); + + // Use Cases + i.addLazySingleton(GetBankAccountsUseCase.new); + i.addLazySingleton(AddBankAccountUseCase.new); + + // Blocs + i.add( + () => BankAccountCubit( + getBankAccountsUseCase: i.get(), + addBankAccountUseCase: i.get(), + ), + ); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (_) => const BankAccountPage()); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/staff_bank_account.dart b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/staff_bank_account.dart new file mode 100644 index 00000000..226d9758 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/lib/staff_bank_account.dart @@ -0,0 +1,3 @@ +library staff_bank_account; + +export 'src/staff_bank_account_module.dart'; diff --git a/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/pubspec.yaml b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/pubspec.yaml new file mode 100644 index 00000000..4d6785ee --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/finances/staff_bank_account/pubspec.yaml @@ -0,0 +1,37 @@ +name: staff_bank_account +description: Staff Bank Account feature. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + bloc: ^8.1.0 + flutter_modular: ^6.3.0 + equatable: ^2.0.5 + lucide_icons: ^0.257.0 + firebase_auth: ^6.1.4 + firebase_data_connect: ^0.2.2+2 + + # Architecture Packages + design_system: + path: ../../../../../design_system + core_localization: + path: ../../../../../core_localization + krow_core: + path: ../../../../../core + krow_domain: + path: ../../../../../domain + krow_data_connect: + path: ../../../../../data_connect + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/analysis_options.yaml b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/analysis_options.yaml new file mode 100644 index 00000000..81e71ce5 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/analysis_options.yaml @@ -0,0 +1 @@ +include: ../../../../../../analysis_options.yaml diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/attire_module.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/attire_module.dart new file mode 100644 index 00000000..3302ae28 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/attire_module.dart @@ -0,0 +1,33 @@ +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; + +import 'data/repositories_impl/attire_repository_impl.dart'; +import 'domain/repositories/attire_repository.dart'; +import 'domain/usecases/get_attire_options_usecase.dart'; +import 'domain/usecases/save_attire_usecase.dart'; +import 'domain/usecases/upload_attire_photo_usecase.dart'; +import 'presentation/blocs/attire_cubit.dart'; +import 'presentation/pages/attire_page.dart'; + +class StaffAttireModule extends Module { + @override + void binds(Injector i) { + // Repository + i.addLazySingleton( + () => AttireRepositoryImpl(ExampleConnector.instance), + ); + + // Use Cases + i.addLazySingleton(GetAttireOptionsUseCase.new); + i.addLazySingleton(SaveAttireUseCase.new); + i.addLazySingleton(UploadAttirePhotoUseCase.new); + + // BLoC + i.addLazySingleton(AttireCubit.new); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (_) => const AttirePage()); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/data/repositories_impl/attire_repository_impl.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/data/repositories_impl/attire_repository_impl.dart new file mode 100644 index 00000000..aec7ee03 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/data/repositories_impl/attire_repository_impl.dart @@ -0,0 +1,46 @@ +import 'package:firebase_data_connect/firebase_data_connect.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:krow_domain/krow_domain.dart'; + +import '../../domain/repositories/attire_repository.dart'; + +/// Implementation of [AttireRepository]. +/// +/// Delegates data access to [ExampleConnector] from `data_connect`. +class AttireRepositoryImpl implements AttireRepository { + /// The Data Connect connector instance. + final ExampleConnector _connector; + + /// Creates an [AttireRepositoryImpl]. + AttireRepositoryImpl(this._connector); + + @override + Future> getAttireOptions() async { + final QueryResult result = await _connector.listAttireOptions().execute(); + return result.data.attireOptions.map((ListAttireOptionsAttireOptions e) => AttireItem( + id: e.itemId, + label: e.label, + iconName: e.icon, + imageUrl: e.imageUrl, + isMandatory: e.isMandatory ?? false, + )).toList(); + } + + @override + Future saveAttire({ + required List selectedItemIds, + required Map photoUrls, + }) async { + // TODO: Connect to actual backend mutation when available. + // For now, simulate network delay as per prototype behavior. + await Future.delayed(const Duration(seconds: 1)); + } + + @override + Future uploadPhoto(String itemId) async { + // TODO: Connect to actual storage service/mutation when available. + // For now, simulate upload delay and return mock URL. + await Future.delayed(const Duration(seconds: 1)); + return 'mock_url_for_$itemId'; + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/arguments/save_attire_arguments.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/arguments/save_attire_arguments.dart new file mode 100644 index 00000000..5894e163 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/arguments/save_attire_arguments.dart @@ -0,0 +1,19 @@ +import 'package:krow_core/core.dart'; + +/// Arguments for saving staff attire selections. +class SaveAttireArguments extends UseCaseArgument { + /// List of selected attire item IDs. + final List selectedItemIds; + + /// Map of item IDs to uploaded photo URLs. + final Map photoUrls; + + /// Creates a [SaveAttireArguments]. + const SaveAttireArguments({ + required this.selectedItemIds, + required this.photoUrls, + }); + + @override + List get props => [selectedItemIds, photoUrls]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/arguments/upload_attire_photo_arguments.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/arguments/upload_attire_photo_arguments.dart new file mode 100644 index 00000000..14ea832d --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/arguments/upload_attire_photo_arguments.dart @@ -0,0 +1,16 @@ +import 'package:krow_core/core.dart'; + +/// Arguments for uploading an attire photo. +class UploadAttirePhotoArguments extends UseCaseArgument { + /// The ID of the attire item being uploaded. + final String itemId; + // Note: typically we'd pass a File or path here too, but the prototype likely picks it internally or mocking it. + // The current logic takes "itemId" and returns a mock URL. + // We'll stick to that signature for now to "preserve behavior". + + /// Creates a [UploadAttirePhotoArguments]. + const UploadAttirePhotoArguments({required this.itemId}); + + @override + List get props => [itemId]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/repositories/attire_repository.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/repositories/attire_repository.dart new file mode 100644 index 00000000..1b4742ad --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/repositories/attire_repository.dart @@ -0,0 +1,15 @@ +import 'package:krow_domain/krow_domain.dart'; + +abstract interface class AttireRepository { + /// Fetches the list of available attire options. + Future> getAttireOptions(); + + /// Simulates uploading a photo for a specific attire item. + Future uploadPhoto(String itemId); + + /// Saves the user's attire selection and attestations. + Future saveAttire({ + required List selectedItemIds, + required Map photoUrls, + }); +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/usecases/get_attire_options_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/usecases/get_attire_options_usecase.dart new file mode 100644 index 00000000..9d8490d3 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/usecases/get_attire_options_usecase.dart @@ -0,0 +1,17 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; + +import '../repositories/attire_repository.dart'; + +/// Use case to fetch available attire options. +class GetAttireOptionsUseCase extends NoInputUseCase> { + final AttireRepository _repository; + + /// Creates a [GetAttireOptionsUseCase]. + GetAttireOptionsUseCase(this._repository); + + @override + Future> call() { + return _repository.getAttireOptions(); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/usecases/save_attire_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/usecases/save_attire_usecase.dart new file mode 100644 index 00000000..e8adb221 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/usecases/save_attire_usecase.dart @@ -0,0 +1,20 @@ +import 'package:krow_core/core.dart'; + +import '../arguments/save_attire_arguments.dart'; +import '../repositories/attire_repository.dart'; + +/// Use case to save user's attire selections. +class SaveAttireUseCase extends UseCase { + final AttireRepository _repository; + + /// Creates a [SaveAttireUseCase]. + SaveAttireUseCase(this._repository); + + @override + Future call(SaveAttireArguments arguments) { + return _repository.saveAttire( + selectedItemIds: arguments.selectedItemIds, + photoUrls: arguments.photoUrls, + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/usecases/upload_attire_photo_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/usecases/upload_attire_photo_usecase.dart new file mode 100644 index 00000000..2b5f6698 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/domain/usecases/upload_attire_photo_usecase.dart @@ -0,0 +1,16 @@ +import 'package:krow_core/core.dart'; +import '../arguments/upload_attire_photo_arguments.dart'; +import '../repositories/attire_repository.dart'; + +/// Use case to upload a photo for an attire item. +class UploadAttirePhotoUseCase extends UseCase { + final AttireRepository _repository; + + /// Creates a [UploadAttirePhotoUseCase]. + UploadAttirePhotoUseCase(this._repository); + + @override + Future call(UploadAttirePhotoArguments arguments) { + return _repository.uploadPhoto(arguments.itemId); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/blocs/attire_cubit.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/blocs/attire_cubit.dart new file mode 100644 index 00000000..76ae73c9 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/blocs/attire_cubit.dart @@ -0,0 +1,117 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:krow_domain/krow_domain.dart'; + +import '../../domain/arguments/save_attire_arguments.dart'; +import '../../domain/arguments/upload_attire_photo_arguments.dart'; +import '../../domain/usecases/get_attire_options_usecase.dart'; +import '../../domain/usecases/save_attire_usecase.dart'; +import '../../domain/usecases/upload_attire_photo_usecase.dart'; +import 'attire_state.dart'; + +class AttireCubit extends Cubit { + final GetAttireOptionsUseCase _getAttireOptionsUseCase; + final SaveAttireUseCase _saveAttireUseCase; + final UploadAttirePhotoUseCase _uploadAttirePhotoUseCase; + + AttireCubit( + this._getAttireOptionsUseCase, + this._saveAttireUseCase, + this._uploadAttirePhotoUseCase, + ) : super(const AttireState()) { + loadOptions(); + } + + Future loadOptions() async { + emit(state.copyWith(status: AttireStatus.loading)); + try { + final List options = await _getAttireOptionsUseCase(); + + // Auto-select mandatory items initially as per prototype + final List mandatoryIds = options + .where((AttireItem e) => e.isMandatory) + .map((AttireItem e) => e.id) + .toList(); + + final List initialSelection = List.from(state.selectedIds); + for (final String id in mandatoryIds) { + if (!initialSelection.contains(id)) { + initialSelection.add(id); + } + } + + emit(state.copyWith( + status: AttireStatus.success, + options: options, + selectedIds: initialSelection, + )); + } catch (e) { + emit(state.copyWith(status: AttireStatus.failure, errorMessage: e.toString())); + } + } + + void toggleSelection(String id) { + // Prevent unselecting mandatory items + if (state.isMandatory(id)) return; + + final List currentSelection = List.from(state.selectedIds); + if (currentSelection.contains(id)) { + currentSelection.remove(id); + } else { + currentSelection.add(id); + } + emit(state.copyWith(selectedIds: currentSelection)); + } + + void toggleAttestation(bool value) { + emit(state.copyWith(attestationChecked: value)); + } + + Future uploadPhoto(String itemId) async { + final Map currentUploading = Map.from(state.uploadingStatus); + currentUploading[itemId] = true; + emit(state.copyWith(uploadingStatus: currentUploading)); + + try { + final String url = await _uploadAttirePhotoUseCase( + UploadAttirePhotoArguments(itemId: itemId), + ); + + final Map currentPhotos = Map.from(state.photoUrls); + currentPhotos[itemId] = url; + + // Auto-select item on upload success if not selected + final List currentSelection = List.from(state.selectedIds); + if (!currentSelection.contains(itemId)) { + currentSelection.add(itemId); + } + + currentUploading[itemId] = false; + emit(state.copyWith( + uploadingStatus: currentUploading, + photoUrls: currentPhotos, + selectedIds: currentSelection, + )); + } catch (e) { + currentUploading[itemId] = false; + emit(state.copyWith( + uploadingStatus: currentUploading, + // Could handle error specifically via snackbar event + )); + } + } + + Future save() async { + if (!state.canSave) return; + + emit(state.copyWith(status: AttireStatus.saving)); + try { + await _saveAttireUseCase(SaveAttireArguments( + selectedItemIds: state.selectedIds, + photoUrls: state.photoUrls, + )); + emit(state.copyWith(status: AttireStatus.saved)); + } catch (e) { + emit(state.copyWith(status: AttireStatus.failure, errorMessage: e.toString())); + } + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/blocs/attire_state.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/blocs/attire_state.dart new file mode 100644 index 00000000..aba87810 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/blocs/attire_state.dart @@ -0,0 +1,75 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; + +enum AttireStatus { initial, loading, success, failure, saving, saved } + +class AttireState extends Equatable { + final AttireStatus status; + final List options; + final List selectedIds; + final Map photoUrls; + final Map uploadingStatus; + final bool attestationChecked; + final String? errorMessage; + + const AttireState({ + this.status = AttireStatus.initial, + this.options = const [], + this.selectedIds = const [], + this.photoUrls = const {}, + this.uploadingStatus = const {}, + this.attestationChecked = false, + this.errorMessage, + }); + + bool get uploading => uploadingStatus.values.any((bool u) => u); + + /// Helper to check if item is mandatory + bool isMandatory(String id) { + return options.firstWhere((AttireItem e) => e.id == id, orElse: () => const AttireItem(id: '', label: '')).isMandatory; + } + + /// Validation logic + bool get allMandatorySelected { + final Iterable mandatoryIds = options.where((AttireItem e) => e.isMandatory).map((AttireItem e) => e.id); + return mandatoryIds.every((String id) => selectedIds.contains(id)); + } + + bool get allMandatoryHavePhotos { + final Iterable mandatoryIds = options.where((AttireItem e) => e.isMandatory).map((AttireItem e) => e.id); + return mandatoryIds.every((String id) => photoUrls.containsKey(id)); + } + + bool get canSave => allMandatorySelected && allMandatoryHavePhotos && attestationChecked && !uploading; + + AttireState copyWith({ + AttireStatus? status, + List? options, + List? selectedIds, + Map? photoUrls, + Map? uploadingStatus, + bool? attestationChecked, + String? errorMessage, + }) { + return AttireState( + status: status ?? this.status, + options: options ?? this.options, + selectedIds: selectedIds ?? this.selectedIds, + photoUrls: photoUrls ?? this.photoUrls, + uploadingStatus: uploadingStatus ?? this.uploadingStatus, + attestationChecked: attestationChecked ?? this.attestationChecked, + errorMessage: errorMessage, + ); + } + + @override + List get props => [ + status, + options, + selectedIds, + photoUrls, + uploadingStatus, + attestationChecked, + errorMessage + ]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/navigation/attire_navigator.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/navigation/attire_navigator.dart new file mode 100644 index 00000000..77c58df6 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/navigation/attire_navigator.dart @@ -0,0 +1,10 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +/// Extension on [IModularNavigator] to provide strongly-typed navigation +/// for the staff attire feature. +extension AttireNavigator on IModularNavigator { + /// Navigates back. + void popAttire() { + pop(); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/pages/attire_page.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/pages/attire_page.dart new file mode 100644 index 00000000..776f5f77 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/pages/attire_page.dart @@ -0,0 +1,101 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:core_localization/core_localization.dart'; + +import '../blocs/attire_cubit.dart'; +import '../blocs/attire_state.dart'; +import '../widgets/attestation_checkbox.dart'; +import '../widgets/attire_bottom_bar.dart'; +import '../widgets/attire_grid.dart'; +import '../widgets/attire_info_card.dart'; + +class AttirePage extends StatelessWidget { + const AttirePage({super.key}); + + @override + Widget build(BuildContext context) { + // Note: t.staff_profile_attire is available via re-export of core_localization + final AttireCubit cubit = Modular.get(); + + return BlocProvider.value( + value: cubit, + child: Scaffold( + backgroundColor: UiColors.background, // FAFBFC + appBar: AppBar( + backgroundColor: UiColors.white, + elevation: 0, + leading: IconButton( + icon: const Icon(UiIcons.chevronLeft, color: UiColors.iconSecondary), + onPressed: () => Modular.to.pop(), + ), + title: Text( + t.staff_profile_attire.title, + style: UiTypography.headline3m.copyWith( + color: UiColors.textPrimary, + ), + ), + bottom: PreferredSize( + preferredSize: const Size.fromHeight(1.0), + child: Container(color: UiColors.border, height: 1.0), + ), + ), + body: BlocConsumer( + listener: (BuildContext context, AttireState state) { + if (state.status == AttireStatus.failure) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text(state.errorMessage ?? 'Error')), + ); + } + if (state.status == AttireStatus.saved) { + Modular.to.pop(); + } + }, + builder: (BuildContext context, AttireState state) { + if (state.status == AttireStatus.loading && state.options.isEmpty) { + return const Center(child: CircularProgressIndicator()); + } + + return Column( + children: [ + Expanded( + child: SingleChildScrollView( + padding: const EdgeInsets.all(UiConstants.space5), + child: Column( + children: [ + const AttireInfoCard(), + const SizedBox(height: UiConstants.space6), + AttireGrid( + items: state.options, + selectedIds: state.selectedIds, + photoUrls: state.photoUrls, + uploadingStatus: state.uploadingStatus, + onToggle: cubit.toggleSelection, + onUpload: cubit.uploadPhoto, + ), + const SizedBox(height: UiConstants.space6), + AttestationCheckbox( + isChecked: state.attestationChecked, + onChanged: (bool? val) => cubit.toggleAttestation(val ?? false), + ), + const SizedBox(height: 80), + ], + ), + ), + ), + AttireBottomBar( + canSave: state.canSave, + allMandatorySelected: state.allMandatorySelected, + allMandatoryHavePhotos: state.allMandatoryHavePhotos, + attestationChecked: state.attestationChecked, + onSave: cubit.save, + ), + ], + ); + }, + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/widgets/attestation_checkbox.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/widgets/attestation_checkbox.dart new file mode 100644 index 00000000..b7a1b7c8 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/widgets/attestation_checkbox.dart @@ -0,0 +1,50 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:core_localization/core_localization.dart'; + +class AttestationCheckbox extends StatelessWidget { + final bool isChecked; + final ValueChanged onChanged; + + const AttestationCheckbox({ + super.key, + required this.isChecked, + required this.onChanged, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.white, + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + border: Border.all(color: UiColors.border), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + width: 24, + height: 24, + child: Checkbox( + value: isChecked, + onChanged: onChanged, + activeColor: UiColors.primary, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(4), + ), + ), + ), + const SizedBox(width: UiConstants.space3), + Expanded( + child: Text( + t.staff_profile_attire.attestation, + style: UiTypography.body2r.copyWith(color: UiColors.textPrimary), + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/widgets/attire_bottom_bar.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/widgets/attire_bottom_bar.dart new file mode 100644 index 00000000..54b2fa4f --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/widgets/attire_bottom_bar.dart @@ -0,0 +1,65 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:core_localization/core_localization.dart'; + +class AttireBottomBar extends StatelessWidget { + final bool canSave; + final bool allMandatorySelected; + final bool allMandatoryHavePhotos; + final bool attestationChecked; + final VoidCallback onSave; + + const AttireBottomBar({ + super.key, + required this.canSave, + required this.allMandatorySelected, + required this.allMandatoryHavePhotos, + required this.attestationChecked, + required this.onSave, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space5), + decoration: const BoxDecoration( + color: UiColors.white, + border: Border(top: BorderSide(color: UiColors.border)), + ), + child: SafeArea( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + if (!canSave) + Padding( + padding: const EdgeInsets.only(bottom: UiConstants.space3), + child: Column( + children: [ + if (!allMandatorySelected) + _buildValidationError(t.staff_profile_attire.validation.select_required), + if (!allMandatoryHavePhotos) + _buildValidationError(t.staff_profile_attire.validation.upload_required), + if (!attestationChecked) + _buildValidationError(t.staff_profile_attire.validation.accept_attestation), + ], + ), + ), + UiButton.primary( + text: t.staff_profile_attire.actions.save, + onPressed: canSave ? onSave : null, // UiButton handles disabled/null? + // UiButton usually takes nullable onPressed to disable. + fullWidth: true, + ), + ], + ), + ), + ); + } + + Widget _buildValidationError(String text) { + return Text( + text, + style: UiTypography.body3r.copyWith(color: UiColors.destructive), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/widgets/attire_grid.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/widgets/attire_grid.dart new file mode 100644 index 00000000..4acb68c6 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/widgets/attire_grid.dart @@ -0,0 +1,239 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:lucide_icons/lucide_icons.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:krow_domain/krow_domain.dart'; + +class AttireGrid extends StatelessWidget { + final List items; + final List selectedIds; + final Map photoUrls; + final Map uploadingStatus; + final Function(String id) onToggle; + final Function(String id) onUpload; + + const AttireGrid({ + super.key, + required this.items, + required this.selectedIds, + required this.photoUrls, + required this.uploadingStatus, + required this.onToggle, + required this.onUpload, + }); + + @override + Widget build(BuildContext context) { + return GridView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: UiConstants.space3, + mainAxisSpacing: UiConstants.space3, + childAspectRatio: 0.8, + ), + itemCount: items.length, + itemBuilder: (BuildContext context, int index) { + final AttireItem item = items[index]; + final bool isSelected = selectedIds.contains(item.id); + final bool hasPhoto = photoUrls.containsKey(item.id); + final bool isUploading = uploadingStatus[item.id] ?? false; + + return _buildCard(item, isSelected, hasPhoto, isUploading); + }, + ); + } + + Widget _buildCard( + AttireItem item, + bool isSelected, + bool hasPhoto, + bool isUploading, + ) { + return Container( + decoration: BoxDecoration( + color: isSelected ? UiColors.primary.withOpacity(0.1) : Colors.transparent, + borderRadius: UiConstants.radiusSm, + border: Border.all( + color: isSelected ? UiColors.primary : UiColors.border, + width: 2, + ), + ), + child: Stack( + children: [ + if (item.isMandatory) + Positioned( + top: UiConstants.space2, + left: UiConstants.space2, + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 6, + vertical: 2, + ), + decoration: BoxDecoration( + color: UiColors.destructive, // Red + borderRadius: UiConstants.radiusSm, + ), + child: Text( + t.staff_profile_attire.status.required, + style: UiTypography.body3m.copyWith( // 12px Medium -> Bold + fontWeight: FontWeight.bold, + fontSize: 9, + color: UiColors.white, + ), + ), + ), + ), + if (hasPhoto) + Positioned( + top: UiConstants.space2, + right: UiConstants.space2, + child: Container( + width: 20, + height: 20, + decoration: const BoxDecoration( + color: UiColors.primary, + shape: BoxShape.circle, + ), + child: const Center( + child: Icon( + UiIcons.check, + color: UiColors.white, + size: 12, + ), + ), + ), + ), + Padding( + padding: const EdgeInsets.all(UiConstants.space3), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () => onToggle(item.id), + child: Column( + children: [ + item.imageUrl != null + ? Container( + height: 80, + width: 80, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + image: DecorationImage( + image: NetworkImage(item.imageUrl!), + fit: BoxFit.cover, + ), + ), + ) + : Icon( + _getIcon(item.iconName), + size: 48, + color: UiColors.textPrimary, // Was charcoal + ), + const SizedBox(height: UiConstants.space2), + Text( + item.label, + textAlign: TextAlign.center, + style: UiTypography.body2m.copyWith( + color: UiColors.textPrimary, + ), + ), + ], + ), + ), + const SizedBox(height: UiConstants.space3), + InkWell( + onTap: () => onUpload(item.id), + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + child: Container( + padding: const EdgeInsets.symmetric( + vertical: UiConstants.space2, + horizontal: UiConstants.space3, + ), + decoration: BoxDecoration( + color: hasPhoto + ? UiColors.primary.withOpacity(0.05) + : UiColors.white, + border: Border.all( + color: hasPhoto ? UiColors.primary : UiColors.border, + ), + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (isUploading) + const SizedBox( + width: 12, + height: 12, + child: CircularProgressIndicator( + strokeWidth: 2, + valueColor: AlwaysStoppedAnimation(UiColors.primary), + ), + ) + else if (hasPhoto) + const Icon( + UiIcons.check, + size: 12, + color: UiColors.primary, + ) + else + const Icon( + UiIcons.camera, + size: 12, + color: UiColors.textSecondary, // Was muted + ), + const SizedBox(width: 6), + Text( + isUploading + ? '...' + : hasPhoto + ? t.staff_profile_attire.status.added + : t.staff_profile_attire.status.add_photo, + style: UiTypography.body3m.copyWith( + color: hasPhoto ? UiColors.primary : UiColors.textSecondary, + ), + ), + ], + ), + ), + ), + if (hasPhoto) + Padding( + padding: const EdgeInsets.only(top: 4), + child: Text( + t.staff_profile_attire.status.pending, + style: UiTypography.body3r.copyWith( + fontSize: 10, + color: UiColors.textSecondary, + ), + ), + ), + ], + ), + ), + ], + ), + ); + } + + IconData _getIcon(String? name) { + switch (name) { + case 'footprints': + return LucideIcons.footprints; + case 'scissors': + return LucideIcons.scissors; + case 'user': + return LucideIcons.user; + case 'shirt': + return LucideIcons.shirt; + case 'hardHat': + return LucideIcons.hardHat; + case 'chefHat': + return LucideIcons.chefHat; + default: + return LucideIcons.helpCircle; + } + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/widgets/attire_info_card.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/widgets/attire_info_card.dart new file mode 100644 index 00000000..656d1626 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/src/presentation/widgets/attire_info_card.dart @@ -0,0 +1,47 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:lucide_icons/lucide_icons.dart'; +import 'package:core_localization/core_localization.dart'; + +class AttireInfoCard extends StatelessWidget { + const AttireInfoCard({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.primary.withOpacity(0.08), + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Using LucideIcons for domain specific content icon not in UiIcons + const Icon(LucideIcons.shirt, color: UiColors.primary, size: 24), + const SizedBox(width: UiConstants.space3), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + t.staff_profile_attire.info_card.title, + style: UiTypography.body2m.copyWith( + color: UiColors.textPrimary, + ), + ), + const SizedBox(height: 2), + Text( + t.staff_profile_attire.info_card.description, + style: UiTypography.body2r.copyWith( + color: UiColors.textSecondary, + ), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/staff_attire.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/staff_attire.dart new file mode 100644 index 00000000..c63a8cbe --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/lib/staff_attire.dart @@ -0,0 +1,3 @@ +library staff_attire; + +export 'src/attire_module.dart'; diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/pubspec.yaml b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/pubspec.yaml new file mode 100644 index 00000000..b87789a7 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/attire/pubspec.yaml @@ -0,0 +1,34 @@ +name: staff_attire +description: "Feature package for Staff Attire management" +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + flutter_modular: ^6.0.0 + equatable: ^2.0.5 + firebase_data_connect: ^0.2.2+1 + + # Internal packages + krow_core: + path: ../../../../../core + krow_domain: + path: ../../../../../domain + krow_data_connect: + path: ../../../../../data_connect + design_system: + path: ../../../../../design_system + core_localization: + path: ../../../../../core_localization + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^2.0.0 diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/analysis_options.yaml b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/analysis_options.yaml new file mode 100644 index 00000000..5dfc2bd0 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/analysis_options.yaml @@ -0,0 +1,5 @@ +# include: package:flutter_lints/flutter.yaml + +linter: + rules: + public_member_api_docs: false diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/data/repositories/emergency_contact_repository_impl.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/data/repositories/emergency_contact_repository_impl.dart new file mode 100644 index 00000000..a69b4bf7 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/data/repositories/emergency_contact_repository_impl.dart @@ -0,0 +1,25 @@ +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/repositories/emergency_contact_repository_interface.dart'; + +/// Implementation of [EmergencyContactRepositoryInterface]. +/// +/// This repository delegates data operations to the [ProfileRepositoryMock] +/// (or real implementation) from the `data_connect` package. +class EmergencyContactRepositoryImpl + implements EmergencyContactRepositoryInterface { + final ProfileRepositoryMock _profileRepository; + + /// Creates an [EmergencyContactRepositoryImpl]. + EmergencyContactRepositoryImpl(this._profileRepository); + + @override + Future> getContacts(String staffId) { + return _profileRepository.getEmergencyContacts(staffId); + } + + @override + Future saveContacts(String staffId, List contacts) { + return _profileRepository.saveEmergencyContacts(staffId, contacts); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/arguments/get_emergency_contacts_arguments.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/arguments/get_emergency_contacts_arguments.dart new file mode 100644 index 00000000..8fe22839 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/arguments/get_emergency_contacts_arguments.dart @@ -0,0 +1,13 @@ +import 'package:krow_core/core.dart'; + +/// Arguments for getting emergency contacts use case. +class GetEmergencyContactsArguments extends UseCaseArgument { + /// The ID of the staff member. + final String staffId; + + /// Creates a [GetEmergencyContactsArguments]. + const GetEmergencyContactsArguments({required this.staffId}); + + @override + List get props => [staffId]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/arguments/save_emergency_contacts_arguments.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/arguments/save_emergency_contacts_arguments.dart new file mode 100644 index 00000000..2aa195b5 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/arguments/save_emergency_contacts_arguments.dart @@ -0,0 +1,20 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; + +/// Arguments for saving emergency contacts use case. +class SaveEmergencyContactsArguments extends UseCaseArgument { + /// The ID of the staff member. + final String staffId; + + /// The list of contacts to save. + final List contacts; + + /// Creates a [SaveEmergencyContactsArguments]. + const SaveEmergencyContactsArguments({ + required this.staffId, + required this.contacts, + }); + + @override + List get props => [staffId, contacts]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/extensions/emergency_contact_extensions.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/extensions/emergency_contact_extensions.dart new file mode 100644 index 00000000..d246a6c2 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/extensions/emergency_contact_extensions.dart @@ -0,0 +1,26 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Extensions for [EmergencyContact] to support UI operations. +extension EmergencyContactExtensions on EmergencyContact { + /// returns a copy of this [EmergencyContact] with the given fields replaced. + EmergencyContact copyWith({ + String? name, + String? phone, + String? relationship, + }) { + return EmergencyContact( + name: name ?? this.name, + phone: phone ?? this.phone, + relationship: relationship ?? this.relationship, + ); + } + + /// Returns an empty [EmergencyContact]. + static EmergencyContact empty() { + return const EmergencyContact( + name: '', + phone: '', + relationship: 'family', + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/repositories/emergency_contact_repository_interface.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/repositories/emergency_contact_repository_interface.dart new file mode 100644 index 00000000..3cd5792b --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/repositories/emergency_contact_repository_interface.dart @@ -0,0 +1,13 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Repository interface for managing emergency contacts. +/// +/// This interface defines the contract for fetching and saving emergency contact information. +/// It must be implemented by the data layer. +abstract class EmergencyContactRepositoryInterface { + /// Retrieves the list of emergency contacts. + Future> getContacts(String staffId); + + /// Saves the list of emergency contacts. + Future saveContacts(String staffId, List contacts); +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/usecases/get_emergency_contacts_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/usecases/get_emergency_contacts_usecase.dart new file mode 100644 index 00000000..5c4faa1b --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/usecases/get_emergency_contacts_usecase.dart @@ -0,0 +1,21 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/arguments/get_emergency_contacts_arguments.dart'; +import '../../domain/repositories/emergency_contact_repository_interface.dart'; + +/// Use case for retrieving emergency contacts. +/// +/// This use case encapsulates the business logic for fetching emergency contacts +/// for a specific staff member. +class GetEmergencyContactsUseCase + extends UseCase> { + final EmergencyContactRepositoryInterface _repository; + + /// Creates a [GetEmergencyContactsUseCase]. + GetEmergencyContactsUseCase(this._repository); + + @override + Future> call(GetEmergencyContactsArguments params) { + return _repository.getContacts(params.staffId); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/usecases/save_emergency_contacts_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/usecases/save_emergency_contacts_usecase.dart new file mode 100644 index 00000000..49563678 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/domain/usecases/save_emergency_contacts_usecase.dart @@ -0,0 +1,20 @@ +import 'package:krow_core/core.dart'; +import '../arguments/save_emergency_contacts_arguments.dart'; +import '../repositories/emergency_contact_repository_interface.dart'; + +/// Use case for saving emergency contacts. +/// +/// This use case encapsulates the business logic for saving emergency contacts +/// for a specific staff member. +class SaveEmergencyContactsUseCase + extends UseCase { + final EmergencyContactRepositoryInterface _repository; + + /// Creates a [SaveEmergencyContactsUseCase]. + SaveEmergencyContactsUseCase(this._repository); + + @override + Future call(SaveEmergencyContactsArguments params) { + return _repository.saveContacts(params.staffId, params.contacts); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/blocs/emergency_contact_bloc.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/blocs/emergency_contact_bloc.dart new file mode 100644 index 00000000..73478061 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/blocs/emergency_contact_bloc.dart @@ -0,0 +1,168 @@ +import 'package:equatable/equatable.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/arguments/get_emergency_contacts_arguments.dart'; +import '../../domain/arguments/save_emergency_contacts_arguments.dart'; +import '../../domain/usecases/get_emergency_contacts_usecase.dart'; +import '../../domain/usecases/save_emergency_contacts_usecase.dart'; + +// Events +abstract class EmergencyContactEvent extends Equatable { + const EmergencyContactEvent(); + + @override + List get props => []; +} + +class EmergencyContactsLoaded extends EmergencyContactEvent {} + +class EmergencyContactAdded extends EmergencyContactEvent {} + +class EmergencyContactRemoved extends EmergencyContactEvent { + final int index; + + const EmergencyContactRemoved(this.index); + + @override + List get props => [index]; +} + +class EmergencyContactUpdated extends EmergencyContactEvent { + final int index; + final EmergencyContact contact; + + const EmergencyContactUpdated(this.index, this.contact); + + @override + List get props => [index, contact]; +} + +class EmergencyContactsSaved extends EmergencyContactEvent {} + +// State +enum EmergencyContactStatus { initial, loading, success, saving, failure } + +class EmergencyContactState extends Equatable { + final EmergencyContactStatus status; + final List contacts; + final String? errorMessage; + + const EmergencyContactState({ + this.status = EmergencyContactStatus.initial, + this.contacts = const [], + this.errorMessage, + }); + + EmergencyContactState copyWith({ + EmergencyContactStatus? status, + List? contacts, + String? errorMessage, + }) { + return EmergencyContactState( + status: status ?? this.status, + contacts: contacts ?? this.contacts, + errorMessage: errorMessage ?? this.errorMessage, + ); + } + + bool get isValid { + if (contacts.isEmpty) return false; + // Check if at least one contact is valid (or all?) + // Usually all added contacts should be valid. + return contacts.every((c) => c.name.isNotEmpty && c.phone.isNotEmpty); + } + + @override + List get props => [status, contacts, errorMessage]; +} + +// BLoC +class EmergencyContactBloc + extends Bloc { + final GetEmergencyContactsUseCase getEmergencyContacts; + final SaveEmergencyContactsUseCase saveEmergencyContacts; + final String staffId; + + EmergencyContactBloc({ + required this.getEmergencyContacts, + required this.saveEmergencyContacts, + required this.staffId, + }) : super(const EmergencyContactState()) { + on(_onLoaded); + on(_onAdded); + on(_onRemoved); + on(_onUpdated); + on(_onSaved); + } + + Future _onLoaded( + EmergencyContactsLoaded event, + Emitter emit, + ) async { + emit(state.copyWith(status: EmergencyContactStatus.loading)); + try { + final contacts = await getEmergencyContacts( + GetEmergencyContactsArguments(staffId: staffId), + ); + emit(state.copyWith( + status: EmergencyContactStatus.success, + contacts: contacts.isNotEmpty + ? contacts + : [const EmergencyContact(name: '', phone: '', relationship: 'family')], + )); + } catch (e) { + emit(state.copyWith( + status: EmergencyContactStatus.failure, + errorMessage: e.toString(), + )); + } + } + + void _onAdded( + EmergencyContactAdded event, + Emitter emit, + ) { + final updatedContacts = List.from(state.contacts) + ..add(const EmergencyContact(name: '', phone: '', relationship: 'family')); + emit(state.copyWith(contacts: updatedContacts)); + } + + void _onRemoved( + EmergencyContactRemoved event, + Emitter emit, + ) { + final updatedContacts = List.from(state.contacts) + ..removeAt(event.index); + emit(state.copyWith(contacts: updatedContacts)); + } + + void _onUpdated( + EmergencyContactUpdated event, + Emitter emit, + ) { + final updatedContacts = List.from(state.contacts); + updatedContacts[event.index] = event.contact; + emit(state.copyWith(contacts: updatedContacts)); + } + + Future _onSaved( + EmergencyContactsSaved event, + Emitter emit, + ) async { + emit(state.copyWith(status: EmergencyContactStatus.saving)); + try { + await saveEmergencyContacts( + SaveEmergencyContactsArguments( + staffId: staffId, + contacts: state.contacts, + ), + ); + emit(state.copyWith(status: EmergencyContactStatus.success)); + } catch (e) { + emit(state.copyWith( + status: EmergencyContactStatus.failure, + errorMessage: e.toString(), + )); + } + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/pages/emergency_contact_screen.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/pages/emergency_contact_screen.dart new file mode 100644 index 00000000..3d53be99 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/pages/emergency_contact_screen.dart @@ -0,0 +1,92 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import '../blocs/emergency_contact_bloc.dart'; +import '../widgets/emergency_contact_add_button.dart'; +import '../widgets/emergency_contact_form_item.dart'; +import '../widgets/emergency_contact_info_banner.dart'; +import '../widgets/emergency_contact_save_button.dart'; + + +/// The Staff Emergency Contact screen. +/// +/// This screen allows staff to manage their emergency contacts during onboarding. +/// It uses [EmergencyContactBloc] for state management and follows the +/// composed-widget pattern for UI elements. +class EmergencyContactScreen extends StatelessWidget { + const EmergencyContactScreen({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (_) => + Modular.get()..add(EmergencyContactsLoaded()), + child: const _EmergencyContactView(), + ); + } +} + +class _EmergencyContactView extends StatelessWidget { + const _EmergencyContactView(); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + elevation: 0, + leading: IconButton( + icon: Icon(UiIcons.chevronLeft, color: UiColors.textSecondary), + onPressed: () => Modular.to.pop(), + ), + title: Text( + 'Emergency Contact', + style: UiTypography.title1m.copyWith(color: UiColors.textPrimary), + ), + bottom: PreferredSize( + preferredSize: const Size.fromHeight(1.0), + child: Container(color: UiColors.border, height: 1.0), + ), + ), + body: BlocConsumer( + listener: (context, state) { + if (state.status == EmergencyContactStatus.failure) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text(state.errorMessage ?? 'An error occurred')), + ); + } + }, + builder: (context, state) { + if (state.status == EmergencyContactStatus.loading) { + return const Center(child: CircularProgressIndicator()); + } + return Column( + children: [ + Expanded( + child: SingleChildScrollView( + padding: EdgeInsets.all(UiConstants.space6), + child: Column( + children: [ + const EmergencyContactInfoBanner(), + SizedBox(height: UiConstants.space6), + ...state.contacts.asMap().entries.map( + (entry) => EmergencyContactFormItem( + index: entry.key, + contact: entry.value, + totalContacts: state.contacts.length, + ), + ), + const EmergencyContactAddButton(), + SizedBox(height: UiConstants.space16), + ], + ), + ), + ), + EmergencyContactSaveButton(state: state), + ], + ); + }, + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/widgets/emergency_contact_add_button.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/widgets/emergency_contact_add_button.dart new file mode 100644 index 00000000..40f9b81e --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/widgets/emergency_contact_add_button.dart @@ -0,0 +1,34 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../blocs/emergency_contact_bloc.dart'; + +class EmergencyContactAddButton extends StatelessWidget { + const EmergencyContactAddButton({super.key}); + + @override + Widget build(BuildContext context) { + return Center( + child: TextButton.icon( + onPressed: () => + context.read().add(EmergencyContactAdded()), + icon: Icon(UiIcons.add, size: 20.0), + label: Text( + 'Add Another Contact', + style: UiTypography.title2b, + ), + style: TextButton.styleFrom( + foregroundColor: UiColors.primary, + padding: EdgeInsets.symmetric( + horizontal: UiConstants.space6, + vertical: UiConstants.space3, + ), + shape: RoundedRectangleBorder( + borderRadius: UiConstants.radiusFull, + side: BorderSide(color: UiColors.primary), + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/widgets/emergency_contact_form_item.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/widgets/emergency_contact_form_item.dart new file mode 100644 index 00000000..b05c2783 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/widgets/emergency_contact_form_item.dart @@ -0,0 +1,188 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/extensions/emergency_contact_extensions.dart'; +import '../blocs/emergency_contact_bloc.dart'; + +class EmergencyContactFormItem extends StatelessWidget { + final int index; + final EmergencyContact contact; + final int totalContacts; + + const EmergencyContactFormItem({ + super.key, + required this.index, + required this.contact, + required this.totalContacts, + }); + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(bottom: UiConstants.space4), + padding: EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildHeader(context), + SizedBox(height: UiConstants.space4), + _buildLabel('Full Name'), + _buildTextField( + initialValue: contact.name, + hint: 'Contact name', + icon: UiIcons.user, + onChanged: (val) => context.read().add( + EmergencyContactUpdated( + index, + contact.copyWith(name: val), + ), + ), + ), + SizedBox(height: UiConstants.space4), + _buildLabel('Phone Number'), + _buildTextField( + initialValue: contact.phone, + hint: '+1 (555) 000-0000', + icon: UiIcons.phone, + onChanged: (val) => context.read().add( + EmergencyContactUpdated( + index, + contact.copyWith(phone: val), + ), + ), + ), + SizedBox(height: UiConstants.space4), + _buildLabel('Relationship'), + _buildDropdown( + context, + value: contact.relationship, + items: const ['family', 'friend', 'partner', 'other'], + onChanged: (val) { + if (val != null) { + context.read().add( + EmergencyContactUpdated( + index, + contact.copyWith(relationship: val), + ), + ); + } + }, + ), + ], + ), + ); + } + + Widget _buildHeader(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Contact ${index + 1}', + style: UiTypography.title2m.copyWith( + color: UiColors.textPrimary, + ), + ), + if (totalContacts > 1) + IconButton( + icon: Icon( + UiIcons.delete, + color: UiColors.textError, + size: 20.0, + ), + onPressed: () => context + .read() + .add(EmergencyContactRemoved(index)), + ), + ], + ); + } + + Widget _buildLabel(String label) { + return Padding( + padding: EdgeInsets.only(bottom: UiConstants.space2), + child: Text( + label, + style: UiTypography.body2m.copyWith( + color: UiColors.textSecondary, + ), + ), + ); + } + + Widget _buildTextField({ + required String initialValue, + required String hint, + required IconData icon, + required Function(String) onChanged, + }) { + return TextFormField( + initialValue: initialValue, + style: UiTypography.body1r.copyWith( + color: UiColors.textPrimary, + ), + decoration: InputDecoration( + hintText: hint, + hintStyle: TextStyle(color: UiColors.textPlaceholder), + prefixIcon: Icon(icon, color: UiColors.textSecondary, size: 20.0), + filled: true, + fillColor: UiColors.bgPopup, + contentPadding: EdgeInsets.symmetric(vertical: UiConstants.space4), + border: OutlineInputBorder( + borderRadius: UiConstants.radiusLg, + borderSide: BorderSide(color: UiColors.border), + ), + enabledBorder: OutlineInputBorder( + borderRadius: UiConstants.radiusLg, + borderSide: BorderSide(color: UiColors.border), + ), + focusedBorder: OutlineInputBorder( + borderRadius: UiConstants.radiusLg, + borderSide: BorderSide(color: UiColors.primary), + ), + ), + onChanged: onChanged, + ); + } + + Widget _buildDropdown( + BuildContext context, { + required String value, + required List items, + required Function(String?) onChanged, + }) { + return Container( + padding: EdgeInsets.symmetric(horizontal: UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.bgPopup, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + ), + child: DropdownButtonHideUnderline( + child: DropdownButton( + value: items.contains(value) ? value : items.first, + isExpanded: true, + icon: Icon(UiIcons.chevronDown, color: UiColors.textSecondary), + items: items.map((String item) { + return DropdownMenuItem( + value: item, + child: Text( + item.toUpperCase(), + style: UiTypography.body1r.copyWith( + color: UiColors.textPrimary, + ), + ), + ); + }).toList(), + onChanged: onChanged, + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/widgets/emergency_contact_info_banner.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/widgets/emergency_contact_info_banner.dart new file mode 100644 index 00000000..975529be --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/widgets/emergency_contact_info_banner.dart @@ -0,0 +1,21 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +class EmergencyContactInfoBanner extends StatelessWidget { + const EmergencyContactInfoBanner({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.accent.withOpacity(0.2), + borderRadius: BorderRadius.circular(UiConstants.radiusBase), + ), + child: Text( + 'Please provide at least one emergency contact. This information will only be used in case of an emergency during your shifts.', + style: UiTypography.body2r.copyWith(color: UiColors.textPrimary), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/widgets/emergency_contact_save_button.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/widgets/emergency_contact_save_button.dart new file mode 100644 index 00000000..28c4db1a --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/presentation/widgets/emergency_contact_save_button.dart @@ -0,0 +1,57 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../blocs/emergency_contact_bloc.dart'; + +class EmergencyContactSaveButton extends StatelessWidget { + final EmergencyContactState state; + + const EmergencyContactSaveButton({super.key, required this.state}); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.bgPopup, + border: Border(top: BorderSide(color: UiColors.border)), + ), + child: SafeArea( + child: SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: state.isValid + ? () => context + .read() + .add(EmergencyContactsSaved()) + : null, + style: ElevatedButton.styleFrom( + backgroundColor: UiColors.primary, + foregroundColor: UiColors.primaryForeground, + disabledBackgroundColor: UiColors.textPlaceholder, + padding: EdgeInsets.symmetric(vertical: UiConstants.space4), + shape: RoundedRectangleBorder( + borderRadius: UiConstants.radiusFull, + ), + elevation: 0, + ), + child: state.status == EmergencyContactStatus.saving + ? SizedBox( + height: 20.0, + width: 20.0, + child: CircularProgressIndicator( + strokeWidth: 2, + valueColor: + AlwaysStoppedAnimation(UiColors.primaryForeground), + ), + ) + : Text( + 'Save & Continue', + style: UiTypography.title2b, + ), + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/staff_emergency_contact_module.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/staff_emergency_contact_module.dart new file mode 100644 index 00000000..66048891 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/src/staff_emergency_contact_module.dart @@ -0,0 +1,46 @@ +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'data/repositories/emergency_contact_repository_impl.dart'; +import 'domain/repositories/emergency_contact_repository_interface.dart'; +import 'domain/usecases/get_emergency_contacts_usecase.dart'; +import 'domain/usecases/save_emergency_contacts_usecase.dart'; +import 'presentation/blocs/emergency_contact_bloc.dart'; +import 'presentation/pages/emergency_contact_screen.dart'; + +class StaffEmergencyContactModule extends Module { + @override + void binds(Injector i) { + // Repository + // Uses ProfileRepositoryMock from data_connect + i.addLazySingleton(ProfileRepositoryMock.new); + i.addLazySingleton( + () => EmergencyContactRepositoryImpl(i.get()), + ); + + // UseCases + i.addLazySingleton( + () => GetEmergencyContactsUseCase(i.get()), + ); + i.addLazySingleton( + () => SaveEmergencyContactsUseCase(i.get()), + ); + + // BLoC + i.addLazySingleton( + () => EmergencyContactBloc( + getEmergencyContacts: i.get(), + saveEmergencyContacts: i.get(), + staffId: 'mock-staff-id', // TODO: Get direct from auth state + ), + ); + } + + @override + void routes(RouteManager r) { + r.child( + '/', + child: (_) => const EmergencyContactScreen(), + transition: TransitionType.rightToLeft, + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/staff_emergency_contact.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/staff_emergency_contact.dart new file mode 100644 index 00000000..8f364342 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/lib/staff_emergency_contact.dart @@ -0,0 +1,5 @@ +library staff_emergency_contact; + +export 'src/staff_emergency_contact_module.dart'; +export 'src/presentation/pages/emergency_contact_screen.dart'; +// Export other necessary classes if needed by consumers diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/pubspec.yaml b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/pubspec.yaml new file mode 100644 index 00000000..15529c1b --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/emergency_contact/pubspec.yaml @@ -0,0 +1,34 @@ +name: staff_emergency_contact +description: Staff Emergency Contact feature. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + flutter_modular: ^6.3.0 + equatable: ^2.0.5 + + # Architecture Packages + krow_domain: + path: ../../../../../domain + krow_core: + path: ../../../../../core + krow_data_connect: + path: ../../../../../data_connect + design_system: + path: ../../../../../design_system + core_localization: + path: ../../../../../core_localization + +dev_dependencies: + flutter_test: + sdk: flutter + bloc_test: ^9.1.0 + mocktail: ^1.0.0 diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/analysis_options.yaml b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/analysis_options.yaml new file mode 100644 index 00000000..0c1670dc --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/analysis_options.yaml @@ -0,0 +1 @@ +# include: package:flutter_lints/flutter.yaml diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/data/repositories/experience_repository_impl.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/data/repositories/experience_repository_impl.dart new file mode 100644 index 00000000..3e451137 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/data/repositories/experience_repository_impl.dart @@ -0,0 +1,29 @@ +import 'package:krow_data_connect/krow_data_connect.dart'; +import '../../domain/repositories/experience_repository_interface.dart'; + +/// Implementation of [ExperienceRepositoryInterface] that delegates to Data Connect. +class ExperienceRepositoryImpl implements ExperienceRepositoryInterface { + final ProfileRepositoryMock _mockRepository; + + /// Creates a [ExperienceRepositoryImpl] with the given [ProfileRepositoryMock]. + ExperienceRepositoryImpl(this._mockRepository); + + @override + Future> getIndustries(String staffId) { + return _mockRepository.getStaffIndustries(staffId); + } + + @override + Future> getSkills(String staffId) { + return _mockRepository.getStaffSkills(staffId); + } + + @override + Future saveExperience( + String staffId, + List industries, + List skills, + ) { + return _mockRepository.saveExperience(staffId, industries, skills); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/arguments/get_experience_arguments.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/arguments/get_experience_arguments.dart new file mode 100644 index 00000000..20ca4cc3 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/arguments/get_experience_arguments.dart @@ -0,0 +1,10 @@ +import 'package:krow_core/core.dart'; + +class GetExperienceArguments extends UseCaseArgument { + final String staffId; + + GetExperienceArguments({required this.staffId}); + + @override + List get props => [staffId]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/arguments/save_experience_arguments.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/arguments/save_experience_arguments.dart new file mode 100644 index 00000000..6e911989 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/arguments/save_experience_arguments.dart @@ -0,0 +1,16 @@ +import 'package:krow_core/core.dart'; + +class SaveExperienceArguments extends UseCaseArgument { + final String staffId; + final List industries; + final List skills; + + SaveExperienceArguments({ + required this.staffId, + required this.industries, + required this.skills, + }); + + @override + List get props => [staffId, industries, skills]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/repositories/experience_repository_interface.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/repositories/experience_repository_interface.dart new file mode 100644 index 00000000..6f2e7d5f --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/repositories/experience_repository_interface.dart @@ -0,0 +1,15 @@ +/// Interface for accessing staff experience data. +abstract class ExperienceRepositoryInterface { + /// Fetches the list of industries associated with the staff member. + Future> getIndustries(String staffId); + + /// Fetches the list of skills associated with the staff member. + Future> getSkills(String staffId); + + /// Saves the staff member's experience (industries and skills). + Future saveExperience( + String staffId, + List industries, + List skills, + ); +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/usecases/get_staff_industries_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/usecases/get_staff_industries_usecase.dart new file mode 100644 index 00000000..d23671a1 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/usecases/get_staff_industries_usecase.dart @@ -0,0 +1,15 @@ +import 'package:krow_core/core.dart'; +import '../arguments/get_experience_arguments.dart'; +import '../repositories/experience_repository_interface.dart'; + +/// Use case for fetching staff industries. +class GetStaffIndustriesUseCase implements UseCase> { + final ExperienceRepositoryInterface _repository; + + GetStaffIndustriesUseCase(this._repository); + + @override + Future> call(GetExperienceArguments input) { + return _repository.getIndustries(input.staffId); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/usecases/get_staff_skills_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/usecases/get_staff_skills_usecase.dart new file mode 100644 index 00000000..7d7915e6 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/usecases/get_staff_skills_usecase.dart @@ -0,0 +1,15 @@ +import 'package:krow_core/core.dart'; +import '../arguments/get_experience_arguments.dart'; +import '../repositories/experience_repository_interface.dart'; + +/// Use case for fetching staff skills. +class GetStaffSkillsUseCase implements UseCase> { + final ExperienceRepositoryInterface _repository; + + GetStaffSkillsUseCase(this._repository); + + @override + Future> call(GetExperienceArguments input) { + return _repository.getSkills(input.staffId); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/usecases/save_experience_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/usecases/save_experience_usecase.dart new file mode 100644 index 00000000..08fc7ada --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/domain/usecases/save_experience_usecase.dart @@ -0,0 +1,22 @@ +import 'package:krow_core/core.dart'; +import '../arguments/save_experience_arguments.dart'; +import '../repositories/experience_repository_interface.dart'; + +/// Use case for saving staff experience details. +/// +/// Delegates the saving logic to [ExperienceRepositoryInterface]. +class SaveExperienceUseCase extends UseCase { + final ExperienceRepositoryInterface repository; + + /// Creates a [SaveExperienceUseCase]. + SaveExperienceUseCase(this.repository); + + @override + Future call(SaveExperienceArguments params) { + return repository.saveExperience( + params.staffId, + params.industries, + params.skills, + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/blocs/experience_bloc.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/blocs/experience_bloc.dart new file mode 100644 index 00000000..4ef70d5a --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/blocs/experience_bloc.dart @@ -0,0 +1,227 @@ +import 'package:equatable/equatable.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../../domain/arguments/get_experience_arguments.dart'; +import '../../domain/arguments/save_experience_arguments.dart'; +import '../../domain/usecases/get_staff_industries_usecase.dart'; +import '../../domain/usecases/get_staff_skills_usecase.dart'; +import '../../domain/usecases/save_experience_usecase.dart'; + +// Events +abstract class ExperienceEvent extends Equatable { + const ExperienceEvent(); + + @override + List get props => []; +} + +class ExperienceLoaded extends ExperienceEvent {} + +class ExperienceIndustryToggled extends ExperienceEvent { + final String industry; + const ExperienceIndustryToggled(this.industry); + + @override + List get props => [industry]; +} + +class ExperienceSkillToggled extends ExperienceEvent { + final String skill; + const ExperienceSkillToggled(this.skill); + + @override + List get props => [skill]; +} + +class ExperienceCustomSkillAdded extends ExperienceEvent { + final String skill; + const ExperienceCustomSkillAdded(this.skill); + + @override + List get props => [skill]; +} + +class ExperienceSubmitted extends ExperienceEvent {} + +// State +enum ExperienceStatus { initial, loading, success, failure } + +class ExperienceState extends Equatable { + final ExperienceStatus status; + final List selectedIndustries; + final List selectedSkills; + final List availableIndustries; + final List availableSkills; + final String? errorMessage; + + const ExperienceState({ + this.status = ExperienceStatus.initial, + this.selectedIndustries = const [], + this.selectedSkills = const [], + this.availableIndustries = const [], + this.availableSkills = const [], + this.errorMessage, + }); + + ExperienceState copyWith({ + ExperienceStatus? status, + List? selectedIndustries, + List? selectedSkills, + List? availableIndustries, + List? availableSkills, + String? errorMessage, + }) { + return ExperienceState( + status: status ?? this.status, + selectedIndustries: selectedIndustries ?? this.selectedIndustries, + selectedSkills: selectedSkills ?? this.selectedSkills, + availableIndustries: availableIndustries ?? this.availableIndustries, + availableSkills: availableSkills ?? this.availableSkills, + errorMessage: errorMessage ?? this.errorMessage, + ); + } + + @override + List get props => [ + status, + selectedIndustries, + selectedSkills, + availableIndustries, + availableSkills, + errorMessage, + ]; +} + +// BLoC +class ExperienceBloc extends Bloc { + static const List _kAllIndustries = [ + 'hospitality', + 'food_service', + 'warehouse', + 'events', + 'retail', + 'healthcare', + 'other', + ]; + + static const List _kAllSkills = [ + 'food_service', + 'bartending', + 'event_setup', + 'hospitality', + 'warehouse', + 'customer_service', + 'cleaning', + 'security', + 'retail', + 'cooking', + 'cashier', + 'server', + 'barista', + 'host_hostess', + 'busser', + ]; + + final GetStaffIndustriesUseCase getIndustries; + final GetStaffSkillsUseCase getSkills; + final SaveExperienceUseCase saveExperience; + final String staffId; + + ExperienceBloc({ + required this.getIndustries, + required this.getSkills, + required this.saveExperience, + required this.staffId, + }) : super(const ExperienceState( + availableIndustries: _kAllIndustries, + availableSkills: _kAllSkills, + )) { + on(_onLoaded); + on(_onIndustryToggled); + on(_onSkillToggled); + on(_onCustomSkillAdded); + on(_onSubmitted); + } + + Future _onLoaded( + ExperienceLoaded event, + Emitter emit, + ) async { + emit(state.copyWith(status: ExperienceStatus.loading)); + try { + final arguments = GetExperienceArguments(staffId: staffId); + final results = await Future.wait([ + getIndustries(arguments), + getSkills(arguments), + ]); + + emit(state.copyWith( + status: ExperienceStatus.initial, + selectedIndustries: results[0], + selectedSkills: results[1], + )); + } catch (e) { + emit(state.copyWith( + status: ExperienceStatus.failure, + errorMessage: e.toString(), + )); + } + } + + void _onIndustryToggled( + ExperienceIndustryToggled event, + Emitter emit, + ) { + final industries = List.from(state.selectedIndustries); + if (industries.contains(event.industry)) { + industries.remove(event.industry); + } else { + industries.add(event.industry); + } + emit(state.copyWith(selectedIndustries: industries)); + } + + void _onSkillToggled( + ExperienceSkillToggled event, + Emitter emit, + ) { + final skills = List.from(state.selectedSkills); + if (skills.contains(event.skill)) { + skills.remove(event.skill); + } else { + skills.add(event.skill); + } + emit(state.copyWith(selectedSkills: skills)); + } + + void _onCustomSkillAdded( + ExperienceCustomSkillAdded event, + Emitter emit, + ) { + if (!state.selectedSkills.contains(event.skill)) { + final skills = List.from(state.selectedSkills)..add(event.skill); + emit(state.copyWith(selectedSkills: skills)); + } + } + + Future _onSubmitted( + ExperienceSubmitted event, + Emitter emit, + ) async { + emit(state.copyWith(status: ExperienceStatus.loading)); + try { + await saveExperience( + SaveExperienceArguments( + staffId: staffId, + industries: state.selectedIndustries, + skills: state.selectedSkills, + ), + ); + emit(state.copyWith(status: ExperienceStatus.success)); + } catch (e) { + emit(state.copyWith( + status: ExperienceStatus.failure, + errorMessage: e.toString(), + )); + } + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/navigation/experience_navigator.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/navigation/experience_navigator.dart new file mode 100644 index 00000000..bee0f20f --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/navigation/experience_navigator.dart @@ -0,0 +1,6 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +extension ExperienceNavigator on IModularNavigator { + // Add navigation methods here if the page navigates deeper. + // Currently ExperiencePage is a leaf, but might need to navigate back or to success screen. +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/pages/experience_page.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/pages/experience_page.dart new file mode 100644 index 00000000..5e88170a --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/pages/experience_page.dart @@ -0,0 +1,207 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import '../blocs/experience_bloc.dart'; +import '../widgets/experience_custom_input.dart'; +import '../widgets/experience_section_title.dart'; + +class ExperiencePage extends StatelessWidget { + const ExperiencePage({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (_) => Modular.get()..add(ExperienceLoaded()), + child: const _ExperienceView(), + ); + } +} + +class _ExperienceView extends StatelessWidget { + const _ExperienceView(); + + String _getIndustryLabel(dynamic node, String key) { + switch (key) { + case 'hospitality': return node.hospitality; + case 'food_service': return node.food_service; + case 'warehouse': return node.warehouse; + case 'events': return node.events; + case 'retail': return node.retail; + case 'healthcare': return node.healthcare; + case 'other': return node.other; + default: return key; + } + } + + String _getSkillLabel(dynamic node, String key) { + switch (key) { + case 'food_service': return node.food_service; + case 'bartending': return node.bartending; + case 'event_setup': return node.event_setup; + case 'hospitality': return node.hospitality; + case 'warehouse': return node.warehouse; + case 'customer_service': return node.customer_service; + case 'cleaning': return node.cleaning; + case 'security': return node.security; + case 'retail': return node.retail; + case 'cooking': return node.cooking; + case 'cashier': return node.cashier; + case 'server': return node.server; + case 'barista': return node.barista; + case 'host_hostess': return node.host_hostess; + case 'busser': return node.busser; + default: return key; + } + } + + @override + Widget build(BuildContext context) { + final i18n = t.staff.onboarding.experience; + + return Scaffold( + backgroundColor: UiColors.background, + appBar: UiAppBar( + title: i18n.title, + onLeadingPressed: () => Modular.to.pop(), + ), + body: BlocConsumer( + listener: (context, state) { + if (state.status == ExperienceStatus.success) { + Modular.to.pop(); + } + }, + builder: (context, state) { + return Column( + children: [ + Expanded( + child: SingleChildScrollView( + padding: EdgeInsets.all(UiConstants.space5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ExperienceSectionTitle(title: i18n.industries_title), + Text( + i18n.industries_subtitle, + style: UiTypography.body2m.copyWith(color: UiColors.textSecondary), + ), + SizedBox(height: UiConstants.space3), + Wrap( + spacing: UiConstants.space2, + runSpacing: UiConstants.space2, + children: state.availableIndustries + .map( + (i) => UiChip( + label: _getIndustryLabel(i18n.industries, i), + isSelected: state.selectedIndustries.contains(i), + onTap: () => BlocProvider.of(context) + .add(ExperienceIndustryToggled(i)), + variant: state.selectedIndustries.contains(i) + ? UiChipVariant.primary + : UiChipVariant.secondary, + ), + ) + .toList(), + ), + SizedBox(height: UiConstants.space6), + ExperienceSectionTitle(title: i18n.skills_title), + Text( + i18n.skills_subtitle, + style: UiTypography.body2m.copyWith(color: UiColors.textSecondary), + ), + SizedBox(height: UiConstants.space3), + Wrap( + spacing: UiConstants.space2, + runSpacing: UiConstants.space2, + children: state.availableSkills + .map( + (s) => UiChip( + label: _getSkillLabel(i18n.skills, s), + isSelected: state.selectedSkills.contains(s), + onTap: () => BlocProvider.of(context) + .add(ExperienceSkillToggled(s)), + variant: state.selectedSkills.contains(s) + ? UiChipVariant.primary + : UiChipVariant.secondary, + ), + ) + .toList(), + ), + SizedBox(height: UiConstants.space4), + const ExperienceCustomInput(), + SizedBox(height: UiConstants.space4), + _buildCustomSkillsList(state, i18n), + SizedBox(height: UiConstants.space10), + ], + ), + ), + ), + _buildSaveButton(context, state, i18n), + ], + ); + }, + ), + ); + } + + Widget _buildCustomSkillsList(ExperienceState state, dynamic i18n) { + final customSkills = state.selectedSkills + .where((s) => !state.availableSkills.contains(s)) + .toList(); + if (customSkills.isEmpty) return const SizedBox.shrink(); + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + i18n.custom_skills_title, + style: UiTypography.body2m.copyWith(color: UiColors.textSecondary), + ), + SizedBox(height: UiConstants.space2), + Wrap( + spacing: UiConstants.space2, + runSpacing: UiConstants.space2, + children: customSkills.map((skill) { + return UiChip( + label: skill, + variant: UiChipVariant.accent, + ); + }).toList(), + ), + ], + ); + } + + Widget _buildSaveButton(BuildContext context, ExperienceState state, dynamic i18n) { + return Container( + padding: EdgeInsets.all(UiConstants.space4), + decoration: BoxDecoration( + color: UiColors.bgPopup, + border: Border(top: BorderSide(color: UiColors.border)), + ), + child: SafeArea( + child: SizedBox( + width: double.infinity, + child: UiButton.primary( + onPressed: state.status == ExperienceStatus.loading + ? null + : () => BlocProvider.of(context).add(ExperienceSubmitted()), + fullWidth: true, + text: state.status == ExperienceStatus.loading ? null : i18n.save_button, + child: state.status == ExperienceStatus.loading + ? SizedBox( + height: 20.0, + width: 20.0, + child: CircularProgressIndicator( + strokeWidth: 2, + valueColor: AlwaysStoppedAnimation(UiColors.white), // UiColors.primaryForeground is white mostly + ), + ) + : null, + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/widgets/experience_custom_input.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/widgets/experience_custom_input.dart new file mode 100644 index 00000000..c6d21cd0 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/widgets/experience_custom_input.dart @@ -0,0 +1,50 @@ +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import '../blocs/experience_bloc.dart'; + +class ExperienceCustomInput extends StatefulWidget { + const ExperienceCustomInput({super.key}); + + @override + State createState() => _ExperienceCustomInputState(); +} + +class _ExperienceCustomInputState extends State { + final TextEditingController _controller = TextEditingController(); + + void _addSkill() { + final skill = _controller.text.trim(); + if (skill.isNotEmpty) { + BlocProvider.of(context).add(ExperienceCustomSkillAdded(skill)); + _controller.clear(); + } + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Row( + children: [ + Expanded( + child: UiTextField( + controller: _controller, + onSubmitted: (_) => _addSkill(), + hintText: t.staff.onboarding.experience.custom_skill_hint, + ), + ), + SizedBox(width: UiConstants.space2), + UiIconButton.primary( + icon: UiIcons.add, + onTap: _addSkill, + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/widgets/experience_section_title.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/widgets/experience_section_title.dart new file mode 100644 index 00000000..7a588933 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/src/presentation/widgets/experience_section_title.dart @@ -0,0 +1,20 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +class ExperienceSectionTitle extends StatelessWidget { + final String title; + const ExperienceSectionTitle({super.key, required this.title}); + + @override + Widget build(BuildContext context) { + return Padding( + padding: EdgeInsets.only(bottom: UiConstants.space2), + child: Text( + title, + style: UiTypography.title2m.copyWith( + color: UiColors.textPrimary, + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/staff_profile_experience.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/staff_profile_experience.dart new file mode 100644 index 00000000..99a602d7 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/lib/staff_profile_experience.dart @@ -0,0 +1,58 @@ +library staff_profile_experience; + +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; + +import 'src/data/repositories/experience_repository_impl.dart'; +import 'src/domain/repositories/experience_repository_interface.dart'; +import 'src/domain/usecases/get_staff_industries_usecase.dart'; +import 'src/domain/usecases/get_staff_skills_usecase.dart'; +import 'src/domain/usecases/save_experience_usecase.dart'; +import 'src/presentation/blocs/experience_bloc.dart'; +import 'src/presentation/pages/experience_page.dart'; + +export 'src/presentation/pages/experience_page.dart'; + +class StaffProfileExperienceModule extends Module { + @override + List get imports => [DataConnectModule()]; + + @override + void binds(Injector i) { + // Repository + i.addLazySingleton( + () => ExperienceRepositoryImpl(i.get()), + ); + + // UseCases + i.addLazySingleton( + () => GetStaffIndustriesUseCase(i.get()), + ); + i.addLazySingleton( + () => GetStaffSkillsUseCase(i.get()), + ); + i.addLazySingleton( + () => SaveExperienceUseCase(i.get()), + ); + + // BLoC + i.addLazySingleton( + () => ExperienceBloc( + getIndustries: i.get(), + getSkills: i.get(), + saveExperience: i.get(), + // TODO: Get actual logged in staff ID + staffId: 'current-staff-id', + ), + ); + } + + @override + void routes(RouteManager r) { + r.child( + '/', + child: (_) => const ExperiencePage(), + transition: TransitionType.rightToLeft, + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/pubspec.yaml b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/pubspec.yaml new file mode 100644 index 00000000..5d63ba6c --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/experience/pubspec.yaml @@ -0,0 +1,35 @@ +name: staff_profile_experience +description: Staff Profile Experience feature. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + flutter_modular: ^6.3.0 + equatable: ^2.0.5 + + # Architecture Packages + krow_domain: + path: ../../../../../../domain + krow_core: + path: ../../../../../../core + krow_data_connect: + path: ../../../../../../data_connect + design_system: + path: ../../../../../../design_system + core_localization: + path: ../../../../../../core_localization + +dev_dependencies: + flutter_test: + sdk: flutter + bloc_test: ^9.1.0 + mocktail: ^1.0.0 + flutter_lints: ^6.0.0 diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/data/repositories/personal_info_repository_impl.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/data/repositories/personal_info_repository_impl.dart new file mode 100644 index 00000000..1674b42b --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/data/repositories/personal_info_repository_impl.dart @@ -0,0 +1,85 @@ +import 'package:firebase_data_connect/firebase_data_connect.dart'; +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:krow_domain/krow_domain.dart'; + +import '../../domain/repositories/personal_info_repository_interface.dart'; + +/// Implementation of [PersonalInfoRepositoryInterface] that delegates +/// to Firebase Data Connect for all data operations. +/// +/// This implementation follows Clean Architecture by: +/// - Implementing the domain's repository interface +/// - Delegating all data access to the data_connect layer +/// - Mapping between data_connect DTOs and domain entities +/// - Containing no business logic +class PersonalInfoRepositoryImpl implements PersonalInfoRepositoryInterface { + final ExampleConnector _dataConnect; + + /// Creates a [PersonalInfoRepositoryImpl]. + /// + /// Requires the Firebase Data Connect connector instance. + PersonalInfoRepositoryImpl({ + required ExampleConnector dataConnect, + }) : _dataConnect = dataConnect; + + @override + Future getStaffProfile(String staffId) async { + // Query staff data from Firebase Data Connect + final QueryResult result = + await _dataConnect.getStaffById(id: staffId).execute(); + + final staff = result.data.staff; + if (staff == null) { + throw Exception('Staff profile not found for ID: $staffId'); + } + + // Map from data_connect DTO to domain entity + return _mapToStaffEntity(staff); + } + + @override + Future updateStaffProfile(Staff staff) async { + // Update staff data through Firebase Data Connect + final OperationResult result = + await _dataConnect + .updateStaff(id: staff.id) + .fullName(staff.name) + .email(staff.email) + .phone(staff.phone) + .photoUrl(staff.avatar) + .execute(); + + if (result.data.staff_update == null) { + throw Exception('Failed to update staff profile'); + } + + // Fetch the updated staff profile to return complete entity + return getStaffProfile(staff.id); + } + + @override + Future uploadProfilePhoto(String filePath) async { + // TODO: Implement photo upload to Firebase Storage + // This will be implemented when Firebase Storage integration is ready + throw UnimplementedError( + 'Photo upload not yet implemented. Will integrate with Firebase Storage.', + ); + } + + /// Maps a data_connect Staff DTO to a domain Staff entity. + /// + /// This mapping isolates the domain from data layer implementation details. + Staff _mapToStaffEntity(GetStaffByIdStaff dto) { + return Staff( + id: dto.id, + authProviderId: dto.userId, + name: dto.fullName, + email: dto.email ?? '', + phone: dto.phone, + status: StaffStatus.active, // TODO: Map from actual status field when available + address: dto.addres, + avatar: dto.photoUrl, + livePhoto: null, // TODO: Map when available in data schema + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/data/repositories/personal_info_repository_mock.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/data/repositories/personal_info_repository_mock.dart new file mode 100644 index 00000000..e19847f9 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/data/repositories/personal_info_repository_mock.dart @@ -0,0 +1,60 @@ +import 'package:krow_domain/krow_domain.dart'; + +import '../../domain/repositories/personal_info_repository_interface.dart'; + +/// Mock implementation of [PersonalInfoRepositoryInterface]. +/// +/// This mock repository returns hardcoded data for development +/// and will be replaced with [PersonalInfoRepositoryImpl] when +/// Firebase Data Connect is fully configured. +/// +/// Following Clean Architecture, this mock: +/// - Implements the domain repository interface +/// - Returns domain entities (Staff) +/// - Simulates async operations with delays +/// - Provides realistic test data +class PersonalInfoRepositoryMock implements PersonalInfoRepositoryInterface { + // Simulated in-memory storage + Staff? _cachedStaff; + + @override + Future getStaffProfile(String staffId) async { + // Simulate network delay + await Future.delayed(const Duration(milliseconds: 500)); + + // Return cached staff or create mock data + return _cachedStaff ?? + const Staff( + id: 'mock-staff-1', + authProviderId: 'mock-auth-1', + name: 'Krower', + email: 'worker@krow.com', + phone: '', + status: StaffStatus.active, + address: 'Montreal, Quebec', + avatar: null, + livePhoto: null, + ); + } + + @override + Future updateStaffProfile(Staff staff) async { + // Simulate network delay + await Future.delayed(const Duration(milliseconds: 800)); + + // Store in cache + _cachedStaff = staff; + + // Return the updated staff + return staff; + } + + @override + Future uploadProfilePhoto(String filePath) async { + // Simulate upload delay + await Future.delayed(const Duration(seconds: 2)); + + // Return a mock URL + return 'https://example.com/photos/${DateTime.now().millisecondsSinceEpoch}.jpg'; + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/domain/repositories/personal_info_repository_interface.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/domain/repositories/personal_info_repository_interface.dart new file mode 100644 index 00000000..bb327203 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/domain/repositories/personal_info_repository_interface.dart @@ -0,0 +1,27 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Interface for managing personal information of staff members. +/// +/// This repository defines the contract for loading and updating +/// staff profile information during onboarding or profile editing. +/// +/// Implementations must delegate all data operations through +/// the data_connect layer, following Clean Architecture principles. +abstract interface class PersonalInfoRepositoryInterface { + /// Retrieves the staff profile for the specified staff ID. + /// + /// Returns the complete [Staff] entity with all profile information. + Future getStaffProfile(String staffId); + + /// Updates the staff profile information. + /// + /// Takes a [Staff] entity with updated fields and persists changes + /// through the data layer. Returns the updated [Staff] entity. + Future updateStaffProfile(Staff staff); + + /// Uploads a profile photo and returns the URL. + /// + /// Takes the file path of the photo to upload. + /// Returns the URL where the photo is stored. + Future uploadProfilePhoto(String filePath); +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/domain/usecases/get_personal_info_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/domain/usecases/get_personal_info_usecase.dart new file mode 100644 index 00000000..51c44264 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/domain/usecases/get_personal_info_usecase.dart @@ -0,0 +1,33 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/personal_info_repository_interface.dart'; + +/// Arguments for getting staff profile information. +class GetPersonalInfoArguments extends UseCaseArgument { + /// The staff member's ID. + final String staffId; + + const GetPersonalInfoArguments({required this.staffId}); + + @override + List get props => [staffId]; +} + +/// Use case for retrieving staff profile information. +/// +/// This use case fetches the complete staff profile from the repository, +/// which delegates to the data_connect layer for data access. +class GetPersonalInfoUseCase + implements UseCase { + final PersonalInfoRepositoryInterface _repository; + + /// Creates a [GetPersonalInfoUseCase]. + /// + /// Requires a [PersonalInfoRepositoryInterface] to fetch data. + GetPersonalInfoUseCase(this._repository); + + @override + Future call(GetPersonalInfoArguments arguments) { + return _repository.getStaffProfile(arguments.staffId); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/domain/usecases/update_personal_info_usecase.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/domain/usecases/update_personal_info_usecase.dart new file mode 100644 index 00000000..ea399231 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/domain/usecases/update_personal_info_usecase.dart @@ -0,0 +1,33 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/personal_info_repository_interface.dart'; + +/// Arguments for updating staff profile information. +class UpdatePersonalInfoArguments extends UseCaseArgument { + /// The staff entity with updated information. + final Staff staff; + + const UpdatePersonalInfoArguments({required this.staff}); + + @override + List get props => [staff]; +} + +/// Use case for updating staff profile information. +/// +/// This use case updates the staff profile information +/// through the repository, which delegates to the data_connect layer. +class UpdatePersonalInfoUseCase + implements UseCase { + final PersonalInfoRepositoryInterface _repository; + + /// Creates an [UpdatePersonalInfoUseCase]. + /// + /// Requires a [PersonalInfoRepositoryInterface] to update data. + UpdatePersonalInfoUseCase(this._repository); + + @override + Future call(UpdatePersonalInfoArguments arguments) { + return _repository.updateStaffProfile(arguments.staff); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/blocs/personal_info_bloc.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/blocs/personal_info_bloc.dart new file mode 100644 index 00000000..7bba02b1 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/blocs/personal_info_bloc.dart @@ -0,0 +1,165 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_domain/krow_domain.dart'; + +import '../../domain/usecases/get_personal_info_usecase.dart'; +import '../../domain/usecases/update_personal_info_usecase.dart'; +import 'personal_info_event.dart'; +import 'personal_info_state.dart'; + +/// BLoC responsible for managing staff profile information state. +/// +/// This BLoC handles loading, updating, and saving staff profile information +/// during onboarding or profile editing. It delegates business logic to +/// use cases following Clean Architecture principles. +class PersonalInfoBloc extends Bloc + implements Disposable { + final GetPersonalInfoUseCase _getPersonalInfoUseCase; + final UpdatePersonalInfoUseCase _updatePersonalInfoUseCase; + final String _staffId; + + /// Creates a [PersonalInfoBloc]. + /// + /// Requires the staff ID to load and update the correct profile. + PersonalInfoBloc({ + required GetPersonalInfoUseCase getPersonalInfoUseCase, + required UpdatePersonalInfoUseCase updatePersonalInfoUseCase, + required String staffId, + }) : _getPersonalInfoUseCase = getPersonalInfoUseCase, + _updatePersonalInfoUseCase = updatePersonalInfoUseCase, + _staffId = staffId, + super(const PersonalInfoState()) { + on(_onLoadRequested); + on(_onFieldUpdated); + on(_onSaveRequested); + on(_onPhotoUploadRequested); + } + + /// Handles loading staff profile information. + Future _onLoadRequested( + PersonalInfoLoadRequested event, + Emitter emit, + ) async { + emit(state.copyWith(status: PersonalInfoStatus.loading)); + try { + final Staff staff = await _getPersonalInfoUseCase( + GetPersonalInfoArguments(staffId: _staffId), + ); + emit(state.copyWith( + status: PersonalInfoStatus.loaded, + staff: staff, + )); + } catch (e) { + emit(state.copyWith( + status: PersonalInfoStatus.error, + errorMessage: e.toString(), + )); + } + } + + /// Handles updating a field value in the current staff profile. + void _onFieldUpdated( + PersonalInfoFieldUpdated event, + Emitter emit, + ) { + if (state.staff == null) return; + + final Staff updatedStaff = _updateField(state.staff!, event.field, event.value); + emit(state.copyWith(staff: updatedStaff)); + } + + /// Updates a specific field in the Staff entity. + /// + /// Returns a new Staff instance with the updated field. + Staff _updateField(Staff staff, String field, String value) { + // Note: Staff entity doesn't have a copyWith method or bio/languages/locations fields + // These fields would need to be added to the Staff entity or handled differently + // For now, we're just returning the same staff + // TODO: Add support for bio, languages, preferred locations to Staff entity + switch (field) { + case 'phone': + // Since Staff is immutable and doesn't have copyWith, we'd need to create a new instance + return Staff( + id: staff.id, + authProviderId: staff.authProviderId, + name: staff.name, + email: staff.email, + phone: value, + status: staff.status, + address: staff.address, + avatar: staff.avatar, + livePhoto: staff.livePhoto, + ); + case 'address': + return Staff( + id: staff.id, + authProviderId: staff.authProviderId, + name: staff.name, + email: staff.email, + phone: staff.phone, + status: staff.status, + address: value, + avatar: staff.avatar, + livePhoto: staff.livePhoto, + ); + default: + return staff; + } + } + + /// Handles saving staff profile information. + Future _onSaveRequested( + PersonalInfoSaveRequested event, + Emitter emit, + ) async { + if (state.staff == null) return; + + emit(state.copyWith(status: PersonalInfoStatus.saving)); + try { + final Staff updatedStaff = await _updatePersonalInfoUseCase( + UpdatePersonalInfoArguments(staff: state.staff!), + ); + emit(state.copyWith( + status: PersonalInfoStatus.saved, + staff: updatedStaff, + )); + } catch (e) { + emit(state.copyWith( + status: PersonalInfoStatus.error, + errorMessage: e.toString(), + )); + } + } + + /// Handles uploading a profile photo. + Future _onPhotoUploadRequested( + PersonalInfoPhotoUploadRequested event, + Emitter emit, + ) async { + if (state.staff == null) return; + + emit(state.copyWith(status: PersonalInfoStatus.uploadingPhoto)); + try { + // TODO: Implement photo upload when repository method is available + // final photoUrl = await _repository.uploadProfilePhoto(event.filePath); + // final updatedStaff = Staff(...); + // emit(state.copyWith( + // status: PersonalInfoStatus.loaded, + // staff: updatedStaff, + // )); + + // For now, just return to loaded state + emit(state.copyWith(status: PersonalInfoStatus.loaded)); + } catch (e) { + emit(state.copyWith( + status: PersonalInfoStatus.error, + errorMessage: e.toString(), + )); + } + } + + @override + void dispose() { + close(); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/blocs/personal_info_event.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/blocs/personal_info_event.dart new file mode 100644 index 00000000..05958631 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/blocs/personal_info_event.dart @@ -0,0 +1,43 @@ +import 'package:equatable/equatable.dart'; + +/// Base class for all Personal Info events. +abstract class PersonalInfoEvent extends Equatable { + const PersonalInfoEvent(); + + @override + List get props => []; +} + +/// Event to load personal information. +class PersonalInfoLoadRequested extends PersonalInfoEvent { + const PersonalInfoLoadRequested(); +} + +/// Event to update a field value. +class PersonalInfoFieldUpdated extends PersonalInfoEvent { + final String field; + final String value; + + const PersonalInfoFieldUpdated({ + required this.field, + required this.value, + }); + + @override + List get props => [field, value]; +} + +/// Event to save personal information. +class PersonalInfoSaveRequested extends PersonalInfoEvent { + const PersonalInfoSaveRequested(); +} + +/// Event to upload a profile photo. +class PersonalInfoPhotoUploadRequested extends PersonalInfoEvent { + final String filePath; + + const PersonalInfoPhotoUploadRequested({required this.filePath}); + + @override + List get props => [filePath]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/blocs/personal_info_state.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/blocs/personal_info_state.dart new file mode 100644 index 00000000..5641a4ed --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/blocs/personal_info_state.dart @@ -0,0 +1,63 @@ +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; + +/// Represents the status of personal info operations. +enum PersonalInfoStatus { + /// Initial state. + initial, + + /// Loading data. + loading, + + /// Data loaded successfully. + loaded, + + /// Saving data. + saving, + + /// Data saved successfully. + saved, + + /// Uploading photo. + uploadingPhoto, + + /// An error occurred. + error, +} + +/// State for the Personal Info BLoC. +/// +/// Uses the shared [Staff] entity from the domain layer. +class PersonalInfoState extends Equatable { + /// The current status of the operation. + final PersonalInfoStatus status; + + /// The staff profile information. + final Staff? staff; + + /// Error message if an error occurred. + final String? errorMessage; + + /// Creates a [PersonalInfoState]. + const PersonalInfoState({ + this.status = PersonalInfoStatus.initial, + this.staff, + this.errorMessage, + }); + + /// Creates a copy of this state with the given fields replaced. + PersonalInfoState copyWith({ + PersonalInfoStatus? status, + Staff? staff, + String? errorMessage, + }) { + return PersonalInfoState( + status: status ?? this.status, + staff: staff ?? this.staff, + errorMessage: errorMessage, + ); + } + + @override + List get props => [status, staff, errorMessage]; +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/navigation/onboarding_navigator.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/navigation/onboarding_navigator.dart new file mode 100644 index 00000000..4686f340 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/navigation/onboarding_navigator.dart @@ -0,0 +1,36 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +/// Typed navigation extensions for the Staff Profile Info feature. +/// +/// Provides type-safe navigation methods to avoid magic strings +/// throughout the codebase. +extension ProfileInfoNavigator on IModularNavigator { + /// Navigates to the Personal Info page. + /// + /// This page allows staff members to edit their personal information + /// including phone, bio, languages, and preferred locations. + Future pushPersonalInfo() { + return pushNamed('./personal-info'); + } + + /// Navigates to the Emergency Contact page. + /// + /// TODO: Implement when emergency contact page is created. + Future pushEmergencyContact() { + return pushNamed('/profile/onboarding/emergency-contact'); + } + + /// Navigates to the Experience page. + /// + /// TODO: Implement when experience page is created. + Future pushExperience() { + return pushNamed('/profile/onboarding/experience'); + } + + /// Navigates to the Attire page. + /// + /// TODO: Implement when attire page is created. + Future pushAttire() { + return pushNamed('/profile/onboarding/attire'); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/navigation/profile_info_navigator.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/navigation/profile_info_navigator.dart new file mode 100644 index 00000000..4686f340 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/navigation/profile_info_navigator.dart @@ -0,0 +1,36 @@ +import 'package:flutter_modular/flutter_modular.dart'; + +/// Typed navigation extensions for the Staff Profile Info feature. +/// +/// Provides type-safe navigation methods to avoid magic strings +/// throughout the codebase. +extension ProfileInfoNavigator on IModularNavigator { + /// Navigates to the Personal Info page. + /// + /// This page allows staff members to edit their personal information + /// including phone, bio, languages, and preferred locations. + Future pushPersonalInfo() { + return pushNamed('./personal-info'); + } + + /// Navigates to the Emergency Contact page. + /// + /// TODO: Implement when emergency contact page is created. + Future pushEmergencyContact() { + return pushNamed('/profile/onboarding/emergency-contact'); + } + + /// Navigates to the Experience page. + /// + /// TODO: Implement when experience page is created. + Future pushExperience() { + return pushNamed('/profile/onboarding/experience'); + } + + /// Navigates to the Attire page. + /// + /// TODO: Implement when attire page is created. + Future pushAttire() { + return pushNamed('/profile/onboarding/attire'); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/pages/personal_info_page.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/pages/personal_info_page.dart new file mode 100644 index 00000000..01971c2a --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/pages/personal_info_page.dart @@ -0,0 +1,102 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; + +import '../blocs/personal_info_bloc.dart'; +import '../blocs/personal_info_event.dart'; +import '../blocs/personal_info_state.dart'; +import '../widgets/personal_info_content.dart'; + + +/// The Personal Info page for staff onboarding. +/// +/// This page allows staff members to view and edit their personal information +/// including phone number and address. Full name and email are read-only as they come from authentication. +/// +/// This page is a StatelessWidget that uses BLoC for state management, +/// following Clean Architecture and the design system guidelines. +class PersonalInfoPage extends StatelessWidget { + /// Creates a [PersonalInfoPage]. + const PersonalInfoPage({super.key}); + + @override + Widget build(BuildContext context) { + final TranslationsStaffOnboardingPersonalInfoEn i18n = t.staff.onboarding.personal_info; + return BlocProvider( + create: (BuildContext context) => Modular.get() + ..add(const PersonalInfoLoadRequested()), + child: BlocListener( + listener: (BuildContext context, PersonalInfoState state) { + if (state.status == PersonalInfoStatus.saved) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text(i18n.save_success), + duration: const Duration(seconds: 2), + ), + ); + Modular.to.pop(); + } else if (state.status == PersonalInfoStatus.error) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text(state.errorMessage ?? 'An error occurred'), + backgroundColor: UiColors.destructive, + duration: const Duration(seconds: 3), + ), + ); + } + }, + child: Scaffold( + backgroundColor: UiColors.background, + appBar: AppBar( + backgroundColor: UiColors.bgPopup, + elevation: 0, + leading: IconButton( + icon: const Icon(UiIcons.chevronLeft, color: UiColors.textSecondary), + onPressed: () => Modular.to.pop(), + tooltip: MaterialLocalizations.of(context).backButtonTooltip, + ), + title: Text( + i18n.title, + style: UiTypography.title1m.copyWith(color: UiColors.textPrimary), + ), + bottom: PreferredSize( + preferredSize: const Size.fromHeight(1.0), + child: Container( + color: UiColors.border, + height: 1.0, + ), + ), + ), + body: SafeArea( + child: BlocBuilder( + builder: (BuildContext context, PersonalInfoState state) { + if (state.status == PersonalInfoStatus.loading || + state.status == PersonalInfoStatus.initial) { + return const Center( + child: CircularProgressIndicator(), + ); + } + + if (state.staff == null) { + return Center( + child: Text( + 'Failed to load personal information', + style: UiTypography.body1r.copyWith( + color: UiColors.textSecondary, + ), + ), + ); + } + + return PersonalInfoContent(staff: state.staff!); + }, + ), + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/widgets/personal_info_content.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/widgets/personal_info_content.dart new file mode 100644 index 00000000..8f9fe8c8 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/widgets/personal_info_content.dart @@ -0,0 +1,128 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:krow_domain/krow_domain.dart'; + +import '../blocs/personal_info_bloc.dart'; +import '../blocs/personal_info_event.dart'; +import '../blocs/personal_info_state.dart'; +import 'profile_photo_widget.dart'; +import 'personal_info_form.dart'; +import 'save_button.dart'; + + +/// Content widget that displays and manages the staff profile form. +/// +/// This widget is extracted from the page to handle form state separately, +/// following Clean Architecture's separation of concerns principle and the design system guidelines. +/// Works with the shared [Staff] entity from the domain layer. +class PersonalInfoContent extends StatefulWidget { + /// The staff profile to display and edit. + final Staff staff; + + /// Creates a [PersonalInfoContent]. + const PersonalInfoContent({ + super.key, + required this.staff, + }); + + @override + State createState() => _PersonalInfoContentState(); +} + +class _PersonalInfoContentState extends State { + late final TextEditingController _phoneController; + late final TextEditingController _addressController; + + @override + void initState() { + super.initState(); + _phoneController = TextEditingController(text: widget.staff.phone ?? ''); + _addressController = TextEditingController(text: widget.staff.address ?? ''); + + // Listen to changes and update BLoC + _phoneController.addListener(_onPhoneChanged); + _addressController.addListener(_onAddressChanged); + } + + @override + void dispose() { + _phoneController.dispose(); + _addressController.dispose(); + super.dispose(); + } + + + void _onPhoneChanged() { + context.read().add( + PersonalInfoFieldUpdated( + field: 'phone', + value: _phoneController.text, + ), + ); + } + + void _onAddressChanged() { + context.read().add( + PersonalInfoFieldUpdated( + field: 'address', + value: _addressController.text, + ), + ); + } + + void _handleSave() { + context.read().add(const PersonalInfoSaveRequested()); + } + + void _handlePhotoTap() { + // TODO: Implement photo picker + // context.read().add( + // PersonalInfoPhotoUploadRequested(filePath: pickedFilePath), + // ); + } + + @override + Widget build(BuildContext context) { + final TranslationsStaffOnboardingPersonalInfoEn i18n = t.staff.onboarding.personal_info; + return BlocBuilder( + builder: (BuildContext context, PersonalInfoState state) { + final bool isSaving = state.status == PersonalInfoStatus.saving; + return Column( + children: [ + Expanded( + child: SingleChildScrollView( + padding: const EdgeInsets.all(UiConstants.space6), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + ProfilePhotoWidget( + photoUrl: widget.staff.avatar, + fullName: widget.staff.name, + onTap: isSaving ? null : _handlePhotoTap, + ), + const SizedBox(height: UiConstants.space6), + PersonalInfoForm( + fullName: widget.staff.name, + email: widget.staff.email, + phoneController: _phoneController, + addressController: _addressController, + enabled: !isSaving, + ), + const SizedBox(height: UiConstants.space16), // Space for bottom button + ], + ), + ), + ), + SaveButton( + onPressed: isSaving ? null : _handleSave, + label: i18n.save_button, + isLoading: isSaving, + ), + ], + ); + }, + ); + } +} \ No newline at end of file diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/widgets/personal_info_form.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/widgets/personal_info_form.dart new file mode 100644 index 00000000..7b919362 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/widgets/personal_info_form.dart @@ -0,0 +1,162 @@ +import 'package:flutter/material.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; + + +/// A form widget containing all personal information fields. +/// +/// Includes read-only fields for full name and email, +/// and editable fields for phone and address. +/// Uses only design system tokens for colors, typography, and spacing. +class PersonalInfoForm extends StatelessWidget { + /// The staff member's full name (read-only). + final String fullName; + + /// The staff member's email (read-only). + final String email; + + /// Controller for the phone number field. + final TextEditingController phoneController; + + /// Controller for the address field. + final TextEditingController addressController; + + /// Whether the form fields are enabled for editing. + final bool enabled; + + /// Creates a [PersonalInfoForm]. + const PersonalInfoForm({ + super.key, + required this.fullName, + required this.email, + required this.phoneController, + required this.addressController, + this.enabled = true, + }); + + @override + Widget build(BuildContext context) { + final TranslationsStaffOnboardingPersonalInfoEn i18n = t.staff.onboarding.personal_info; + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _FieldLabel(text: i18n.full_name_label), + const SizedBox(height: UiConstants.space2), + _ReadOnlyField(value: fullName), + const SizedBox(height: UiConstants.space4), + + _FieldLabel(text: i18n.email_label), + const SizedBox(height: UiConstants.space2), + _ReadOnlyField(value: email), + const SizedBox(height: UiConstants.space4), + + _FieldLabel(text: i18n.phone_label), + const SizedBox(height: UiConstants.space2), + _EditableField( + controller: phoneController, + hint: i18n.phone_hint, + enabled: enabled, + ), + const SizedBox(height: UiConstants.space4), + + _FieldLabel(text: i18n.locations_label), + const SizedBox(height: UiConstants.space2), + _EditableField( + controller: addressController, + hint: i18n.locations_hint, + enabled: enabled, + ), + ], + ); + } +} + +/// A label widget for form fields. +/// A label widget for form fields. +class _FieldLabel extends StatelessWidget { + final String text; + + const _FieldLabel({required this.text}); + + @override + Widget build(BuildContext context) { + return Text( + text, + style: UiTypography.body2m.copyWith(color: UiColors.textPrimary), + ); + } +} + +/// A read-only field widget for displaying non-editable information. +/// A read-only field widget for displaying non-editable information. +class _ReadOnlyField extends StatelessWidget { + final String value; + + const _ReadOnlyField({required this.value}); + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + padding: const EdgeInsets.symmetric( + horizontal: UiConstants.space3, + vertical: UiConstants.space3, + ), + decoration: BoxDecoration( + color: UiColors.bgSecondary, + borderRadius: BorderRadius.circular(UiConstants.radiusMdValue), + border: Border.all(color: UiColors.border), + ), + child: Text( + value, + style: UiTypography.body2r.copyWith(color: UiColors.textPrimary), + ), + ); + } +} + +/// An editable text field widget. +/// An editable text field widget. +class _EditableField extends StatelessWidget { + final TextEditingController controller; + final String hint; + final bool enabled; + + const _EditableField({ + required this.controller, + required this.hint, + this.enabled = true, + }); + + @override + Widget build(BuildContext context) { + return TextField( + controller: controller, + enabled: enabled, + style: UiTypography.body2r.copyWith(color: UiColors.textPrimary), + decoration: InputDecoration( + hintText: hint, + hintStyle: UiTypography.body2r.copyWith(color: UiColors.textSecondary), + contentPadding: const EdgeInsets.symmetric( + horizontal: UiConstants.space3, + vertical: UiConstants.space3, + ), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(UiConstants.radiusMdValue), + borderSide: const BorderSide(color: UiColors.border), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(UiConstants.radiusMdValue), + borderSide: const BorderSide(color: UiColors.border), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(UiConstants.radiusMdValue), + borderSide: const BorderSide(color: UiColors.primary), + ), + fillColor: UiColors.bgPopup, + filled: true, + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/widgets/profile_photo_widget.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/widgets/profile_photo_widget.dart new file mode 100644 index 00000000..528e7e4d --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/widgets/profile_photo_widget.dart @@ -0,0 +1,100 @@ +import 'package:flutter/material.dart'; +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; + + +/// A widget displaying the staff member's profile photo with an edit option. +/// +/// Shows either the photo URL or an initial avatar if no photo is available. +/// Includes a camera icon button for changing the photo. +/// Uses only design system tokens for colors, typography, and spacing. +class ProfilePhotoWidget extends StatelessWidget { + /// The URL of the staff member's photo. + final String? photoUrl; + + /// The staff member's full name (used for initial avatar). + final String fullName; + + /// Callback when the photo/camera button is tapped. + final VoidCallback? onTap; + + /// Creates a [ProfilePhotoWidget]. + const ProfilePhotoWidget({ + super.key, + required this.photoUrl, + required this.fullName, + required this.onTap, + }); + + @override + Widget build(BuildContext context) { + final TranslationsStaffOnboardingPersonalInfoEn i18n = t.staff.onboarding.personal_info; + + return Column( + children: [ + GestureDetector( + onTap: onTap, + child: Stack( + children: [ + Container( + width: 96, + height: 96, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: UiColors.primary.withOpacity(0.1), + ), + child: photoUrl != null + ? ClipOval( + child: Image.network( + photoUrl!, + fit: BoxFit.cover, + ), + ) + : Center( + child: Text( + fullName.isNotEmpty ? fullName[0].toUpperCase() : '?', + style: UiTypography.displayL.copyWith( + color: UiColors.primary, + ), + ), + ), + ), + Positioned( + bottom: 0, + right: 0, + child: Container( + width: 32, + height: 32, + decoration: BoxDecoration( + color: UiColors.bgPopup, + shape: BoxShape.circle, + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: UiColors.textPrimary.withOpacity(0.1), + blurRadius: UiConstants.space1, + offset: const Offset(0, 2), + ), + ], + ), + child: const Center( + child: Icon( + UiIcons.camera, + size: 16, + color: UiColors.primary, + ), + ), + ), + ), + ], + ), + ), + const SizedBox(height: UiConstants.space3), + Text( + i18n.change_photo_hint, + style: UiTypography.body2r.copyWith(color: UiColors.textSecondary), + ), + ], + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/widgets/save_button.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/widgets/save_button.dart new file mode 100644 index 00000000..44b4d5c6 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/presentation/widgets/save_button.dart @@ -0,0 +1,79 @@ +import 'package:flutter/material.dart'; +import 'package:design_system/design_system.dart'; + + +/// A save button widget for the bottom of the personal info page. +/// +/// Displays a full-width button with a save icon and customizable label. +/// Uses only design system tokens for colors, typography, and spacing. +class SaveButton extends StatelessWidget { + /// Callback when the button is pressed. + final VoidCallback? onPressed; + + /// The button label text. + final String label; + + /// Whether to show a loading indicator. + final bool isLoading; + + /// Creates a [SaveButton]. + const SaveButton({ + super.key, + required this.onPressed, + required this.label, + this.isLoading = false, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(UiConstants.space5), + decoration: const BoxDecoration( + color: UiColors.bgPopup, + border: Border( + top: BorderSide(color: UiColors.border), + ), + ), + child: SafeArea( + child: SizedBox( + width: double.infinity, + height: 48, + child: ElevatedButton( + onPressed: onPressed, + style: ElevatedButton.styleFrom( + backgroundColor: UiColors.primary, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(UiConstants.radiusMdValue), + ), + elevation: 0, + ), + child: isLoading + ? const SizedBox( + width: 20, + height: 20, + child: CircularProgressIndicator( + strokeWidth: 2, + valueColor: AlwaysStoppedAnimation( + UiColors.bgPopup, + ), + ), + ) + : Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon(UiIcons.check, color: UiColors.bgPopup, size: 20), + const SizedBox(width: UiConstants.space2), + Text( + label, + style: UiTypography.body1m.copyWith( + color: UiColors.bgPopup, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/staff_profile_info_module.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/staff_profile_info_module.dart new file mode 100644 index 00000000..5679ae1f --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/src/staff_profile_info_module.dart @@ -0,0 +1,61 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; + +import 'data/repositories/personal_info_repository_mock.dart'; +import 'domain/repositories/personal_info_repository_interface.dart'; +import 'domain/usecases/get_personal_info_usecase.dart'; +import 'domain/usecases/update_personal_info_usecase.dart'; +import 'presentation/blocs/personal_info_bloc.dart'; +import 'presentation/pages/personal_info_page.dart'; + +/// The entry module for the Staff Profile Info feature. +/// +/// This module provides routing and dependency injection for +/// personal information functionality following Clean Architecture. +/// +/// The module: +/// - Registers repository implementations (mock for now, will use real impl later) +/// - Registers use cases that contain business logic +/// - Registers BLoC for state management +/// - Defines routes for navigation +class StaffProfileInfoModule extends Module { + @override + void binds(Injector i) { + // Repository - using mock for now + // TODO: Replace with PersonalInfoRepositoryImpl when Firebase Data Connect is configured + i.addLazySingleton( + PersonalInfoRepositoryMock.new, + ); + + // Use Cases - delegate business logic to repository + i.addLazySingleton( + () => GetPersonalInfoUseCase(i.get()), + ); + i.addLazySingleton( + () => UpdatePersonalInfoUseCase(i.get()), + ); + + // BLoC - manages presentation state + // TODO: Get actual staffId from authentication state + i.addLazySingleton( + () => PersonalInfoBloc( + getPersonalInfoUseCase: i.get(), + updatePersonalInfoUseCase: i.get(), + staffId: 'mock-staff-1', // TODO: Get from auth + ), + ); + } + + @override + void routes(RouteManager r) { + r.child( + '/personal-info', + child: (BuildContext context) => const PersonalInfoPage(), + ); + // Alias with trailing slash to be tolerant of external deep links + r.child( + '/personal-info/', + child: (BuildContext context) => const PersonalInfoPage(), + ); + } +} diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/staff_profile_info.dart b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/staff_profile_info.dart new file mode 100644 index 00000000..28387ab4 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/lib/staff_profile_info.dart @@ -0,0 +1,2 @@ +/// Export the modular feature definition. +export 'src/staff_profile_info_module.dart'; diff --git a/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/pubspec.yaml b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/pubspec.yaml new file mode 100644 index 00000000..86592162 --- /dev/null +++ b/apps/mobile/packages/features/staff/profile_sections/onboarding/profile_info/pubspec.yaml @@ -0,0 +1,39 @@ +name: staff_profile_info +description: Staff profile information feature package. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + bloc: ^8.1.0 + flutter_modular: ^6.3.0 + equatable: ^2.0.5 + + # Architecture Packages + design_system: + path: ../../../../../design_system + core_localization: + path: ../../../../../core_localization + krow_core: + path: ../../../../../core + krow_domain: + path: ../../../../../domain + krow_data_connect: + path: ../../../../../data_connect + +dev_dependencies: + flutter_test: + sdk: flutter + bloc_test: ^9.1.0 + mocktail: ^1.0.0 + flutter_lints: ^6.0.0 + +flutter: + uses-material-design: true diff --git a/apps/mobile/packages/features/staff/shifts/analysis_options.yaml b/apps/mobile/packages/features/staff/shifts/analysis_options.yaml new file mode 100644 index 00000000..f41560b9 --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/analysis_options.yaml @@ -0,0 +1,5 @@ +include: package:flutter_lints/flutter.yaml + +linter: + rules: + # Add project specific rules here diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/data/repositories_impl/shifts_repository_impl.dart b/apps/mobile/packages/features/staff/shifts/lib/src/data/repositories_impl/shifts_repository_impl.dart new file mode 100644 index 00000000..1c54242b --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/data/repositories_impl/shifts_repository_impl.dart @@ -0,0 +1,70 @@ +import 'package:krow_data_connect/krow_data_connect.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../../domain/repositories/shifts_repository_interface.dart'; + +/// Implementation of [ShiftsRepositoryInterface] that delegates to [ShiftsRepositoryMock]. +/// +/// This class resides in the data layer and handles the communication with +/// the external data sources (currently mocks). +class ShiftsRepositoryImpl implements ShiftsRepositoryInterface { + final ShiftsRepositoryMock _mock; + + ShiftsRepositoryImpl({ShiftsRepositoryMock? mock}) : _mock = mock ?? ShiftsRepositoryMock(); + + @override + Future> getMyShifts() async { + return _mock.getMyShifts(); + } + + @override + Future> getAvailableShifts(String query, String type) async { + // Delegates to mock. Logic kept here temporarily as per architecture constraints + // on data_connect modifications, mimicking a query capable datasource. + var shifts = await _mock.getAvailableShifts(); + + // Simple in-memory filtering for mock adapter + if (query.isNotEmpty) { + shifts = shifts.where((s) => + s.title.toLowerCase().contains(query.toLowerCase()) || + s.clientName.toLowerCase().contains(query.toLowerCase()) + ).toList(); + } + + if (type != 'all') { + if (type == 'one-day') { + shifts = shifts.where((s) => !s.title.contains('Multi-Day') && !s.title.contains('Long Term')).toList(); + } else if (type == 'multi-day') { + shifts = shifts.where((s) => s.title.contains('Multi-Day')).toList(); + } else if (type == 'long-term') { + shifts = shifts.where((s) => s.title.contains('Long Term')).toList(); + } + } + + return shifts; + } + + @override + Future> getPendingAssignments() async { + return _mock.getPendingAssignments(); + } + + @override + Future getShiftDetails(String shiftId) async { + return _mock.getShiftDetails(shiftId); + } + + @override + Future applyForShift(String shiftId) async { + await Future.delayed(const Duration(milliseconds: 500)); + } + + @override + Future acceptShift(String shiftId) async { + await Future.delayed(const Duration(milliseconds: 500)); + } + + @override + Future declineShift(String shiftId) async { + await Future.delayed(const Duration(milliseconds: 500)); + } +} diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/domain/arguments/get_available_shifts_arguments.dart b/apps/mobile/packages/features/staff/shifts/lib/src/domain/arguments/get_available_shifts_arguments.dart new file mode 100644 index 00000000..69098abb --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/domain/arguments/get_available_shifts_arguments.dart @@ -0,0 +1,19 @@ +import 'package:krow_core/core.dart'; + +/// Arguments for [GetAvailableShiftsUseCase]. +class GetAvailableShiftsArguments extends UseCaseArgument { + /// The search query to filter shifts. + final String query; + + /// The job type filter (e.g., 'all', 'one-day', 'multi-day', 'long-term'). + final String type; + + /// Creates a [GetAvailableShiftsArguments] instance. + const GetAvailableShiftsArguments({ + this.query = '', + this.type = 'all', + }); + + @override + List get props => [query, type]; +} diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/domain/repositories/shifts_repository_interface.dart b/apps/mobile/packages/features/staff/shifts/lib/src/domain/repositories/shifts_repository_interface.dart new file mode 100644 index 00000000..e0c36133 --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/domain/repositories/shifts_repository_interface.dart @@ -0,0 +1,28 @@ +import 'package:krow_domain/krow_domain.dart'; + +/// Interface for the Shifts Repository. +/// +/// Defines the contract for accessing and modifying shift-related data. +/// Implementations of this interface should reside in the data layer. +abstract interface class ShiftsRepositoryInterface { + /// Retrieves the list of shifts assigned to the current user. + Future> getMyShifts(); + + /// Retrieves available shifts matching the given [query] and [type]. + Future> getAvailableShifts(String query, String type); + + /// Retrieves shifts that are pending acceptance by the user. + Future> getPendingAssignments(); + + /// Retrieves detailed information for a specific shift by [shiftId]. + Future getShiftDetails(String shiftId); + + /// Applies for a specific open shift. + Future applyForShift(String shiftId); + + /// Accepts a pending shift assignment. + Future acceptShift(String shiftId); + + /// Declines a pending shift assignment. + Future declineShift(String shiftId); +} diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/domain/usecases/get_available_shifts_usecase.dart b/apps/mobile/packages/features/staff/shifts/lib/src/domain/usecases/get_available_shifts_usecase.dart new file mode 100644 index 00000000..54d0269e --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/domain/usecases/get_available_shifts_usecase.dart @@ -0,0 +1,19 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/shifts_repository_interface.dart'; +import '../arguments/get_available_shifts_arguments.dart'; + +/// Use case for retrieving available shifts with filters. +/// +/// This use case delegates to [ShiftsRepositoryInterface]. +class GetAvailableShiftsUseCase extends UseCase> { + final ShiftsRepositoryInterface repository; + + GetAvailableShiftsUseCase(this.repository); + + @override + Future> call(GetAvailableShiftsArguments arguments) async { + return repository.getAvailableShifts(arguments.query, arguments.type); + } +} + diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/domain/usecases/get_my_shifts_usecase.dart b/apps/mobile/packages/features/staff/shifts/lib/src/domain/usecases/get_my_shifts_usecase.dart new file mode 100644 index 00000000..5b9f172d --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/domain/usecases/get_my_shifts_usecase.dart @@ -0,0 +1,18 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/shifts_repository_interface.dart'; + +/// Use case for retrieving the user's assigned shifts. +/// +/// This use case delegates to [ShiftsRepositoryInterface]. +class GetMyShiftsUseCase extends NoInputUseCase> { + final ShiftsRepositoryInterface repository; + + GetMyShiftsUseCase(this.repository); + + @override + Future> call() async { + return repository.getMyShifts(); + } +} + diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/domain/usecases/get_pending_assignments_usecase.dart b/apps/mobile/packages/features/staff/shifts/lib/src/domain/usecases/get_pending_assignments_usecase.dart new file mode 100644 index 00000000..e4747c36 --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/domain/usecases/get_pending_assignments_usecase.dart @@ -0,0 +1,18 @@ +import 'package:krow_core/core.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../repositories/shifts_repository_interface.dart'; + +/// Use case for retrieving pending shift assignments. +/// +/// This use case delegates to [ShiftsRepositoryInterface]. +class GetPendingAssignmentsUseCase extends NoInputUseCase> { + final ShiftsRepositoryInterface repository; + + GetPendingAssignmentsUseCase(this.repository); + + @override + Future> call() async { + return repository.getPendingAssignments(); + } +} + diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_bloc.dart b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_bloc.dart new file mode 100644 index 00000000..9b33b7c4 --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_bloc.dart @@ -0,0 +1,83 @@ +import 'package:bloc/bloc.dart'; +import 'package:equatable/equatable.dart'; +import 'package:krow_domain/krow_domain.dart'; +import 'package:meta/meta.dart'; + +import '../../../domain/usecases/get_available_shifts_usecase.dart'; +import '../../../domain/arguments/get_available_shifts_arguments.dart'; +import '../../../domain/usecases/get_my_shifts_usecase.dart'; +import '../../../domain/usecases/get_pending_assignments_usecase.dart'; + +part 'shifts_event.dart'; +part 'shifts_state.dart'; + +class ShiftsBloc extends Bloc { + final GetMyShiftsUseCase getMyShifts; + final GetAvailableShiftsUseCase getAvailableShifts; + final GetPendingAssignmentsUseCase getPendingAssignments; + + ShiftsBloc({ + required this.getMyShifts, + required this.getAvailableShifts, + required this.getPendingAssignments, + }) : super(ShiftsInitial()) { + on(_onLoadShifts); + on(_onFilterAvailableShifts); + } + + Future _onLoadShifts( + LoadShiftsEvent event, + Emitter emit, + ) async { + if (state is! ShiftsLoaded) { + emit(ShiftsLoading()); + } + + // Determine what to load based on current tab? + // Or load all for simplicity as per prototype logic which had them all in memory. + + try { + final myShiftsResult = await getMyShifts(); + final pendingResult = await getPendingAssignments(); + + // Initial available with defaults + final availableResult = await getAvailableShifts(const GetAvailableShiftsArguments()); + + emit(ShiftsLoaded( + myShifts: myShiftsResult, + pendingShifts: pendingResult, + availableShifts: availableResult, + searchQuery: '', + jobType: 'all', + )); + } catch (_) { + emit(const ShiftsError('Failed to load shifts')); + } + } + + Future _onFilterAvailableShifts( + FilterAvailableShiftsEvent event, + Emitter emit, + ) async { + final currentState = state; + if (currentState is ShiftsLoaded) { + // Optimistic update or loading indicator? + // Since it's filtering, we can just reload available. + + try { + final result = await getAvailableShifts(GetAvailableShiftsArguments( + query: event.query ?? currentState.searchQuery, + type: event.jobType ?? currentState.jobType, + )); + + emit(currentState.copyWith( + availableShifts: result, + searchQuery: event.query ?? currentState.searchQuery, + jobType: event.jobType ?? currentState.jobType, + )); + } catch (_) { + // Error handling if filter fails + } + } + } +} diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_event.dart b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_event.dart new file mode 100644 index 00000000..41e01253 --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_event.dart @@ -0,0 +1,21 @@ +part of 'shifts_bloc.dart'; + +@immutable +sealed class ShiftsEvent extends Equatable { + const ShiftsEvent(); + + @override + List get props => []; +} + +class LoadShiftsEvent extends ShiftsEvent {} + +class FilterAvailableShiftsEvent extends ShiftsEvent { + final String? query; + final String? jobType; + + const FilterAvailableShiftsEvent({this.query, this.jobType}); + + @override + List get props => [query, jobType]; +} diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_state.dart b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_state.dart new file mode 100644 index 00000000..c6051cea --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_state.dart @@ -0,0 +1,57 @@ +part of 'shifts_bloc.dart'; + +@immutable +sealed class ShiftsState extends Equatable { + const ShiftsState(); + + @override + List get props => []; +} + +class ShiftsInitial extends ShiftsState {} + +class ShiftsLoading extends ShiftsState {} + +class ShiftsLoaded extends ShiftsState { + final List myShifts; + final List pendingShifts; + final List availableShifts; + final String searchQuery; + final String jobType; + + const ShiftsLoaded({ + required this.myShifts, + required this.pendingShifts, + required this.availableShifts, + required this.searchQuery, + required this.jobType, + }); + + ShiftsLoaded copyWith({ + List? myShifts, + List? pendingShifts, + List? availableShifts, + String? searchQuery, + String? jobType, + }) { + return ShiftsLoaded( + myShifts: myShifts ?? this.myShifts, + pendingShifts: pendingShifts ?? this.pendingShifts, + availableShifts: availableShifts ?? this.availableShifts, + searchQuery: searchQuery ?? this.searchQuery, + jobType: jobType ?? this.jobType, + ); + } + + @override + List get props => [myShifts, pendingShifts, availableShifts, searchQuery, jobType]; +} + +class ShiftsError extends ShiftsState { + final String message; + + const ShiftsError(this.message); + + @override + List get props => [message]; +} diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/navigation/shifts_navigator.dart b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/navigation/shifts_navigator.dart new file mode 100644 index 00000000..4832055b --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/navigation/shifts_navigator.dart @@ -0,0 +1,10 @@ +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:krow_domain/krow_domain.dart'; + +extension ShiftsNavigator on IModularNavigator { + void pushShiftDetails(Shift shift) { + pushNamed('/shifts/details/${shift.id}', arguments: shift); + } + + // Example for going back or internal navigation if needed +} diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/pages/shift_details_page.dart b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/pages/shift_details_page.dart new file mode 100644 index 00000000..fdb92535 --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/pages/shift_details_page.dart @@ -0,0 +1,814 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:lucide_icons/lucide_icons.dart'; +import 'package:intl/intl.dart'; +import 'package:design_system/design_system.dart'; +import 'package:krow_domain/krow_domain.dart'; + +// Shim to match POC styles locally +class AppColors { + static const Color krowBlue = UiColors.primary; + static const Color krowYellow = Color(0xFFFFED4A); + static const Color krowCharcoal = UiColors.textPrimary; // 121826 + static const Color krowMuted = UiColors.textSecondary; // 6A7382 + static const Color krowBorder = UiColors.border; // E3E6E9 + static const Color krowBackground = UiColors.background; // FAFBFC + static const Color white = Colors.white; +} + +class ShiftDetailsPage extends StatefulWidget { + final String shiftId; + final Shift? shift; + + const ShiftDetailsPage({super.key, required this.shiftId, this.shift}); + + @override + State createState() => _ShiftDetailsPageState(); +} + +class _ShiftDetailsPageState extends State { + late Shift _shift; + bool _isLoading = true; + bool _showDetails = true; + bool _isApplying = false; + + // Mock Managers + final List> _managers = [ + {'name': 'John Smith', 'phone': '+1 123 456 7890'}, + {'name': 'Jane Doe', 'phone': '+1 123 456 7890'}, + ]; + + @override + void initState() { + super.initState(); + _loadShift(); + } + + void _loadShift() async { + if (widget.shift != null) { + _shift = widget.shift!; + setState(() => _isLoading = false); + } else { + await Future.delayed(const Duration(milliseconds: 500)); + if (mounted) { + // Fallback mock shift + setState(() { + _shift = Shift( + id: widget.shiftId, + title: 'Event Server', + clientName: 'Grand Hotel', + logoUrl: null, + hourlyRate: 25.0, + date: DateFormat('yyyy-MM-dd').format(DateTime.now()), + startTime: '16:00', + endTime: '22:00', + location: 'Downtown', + locationAddress: '123 Main St, New York, NY', + status: 'open', + createdDate: DateTime.now().toIso8601String(), + description: 'Provide exceptional customer service. Respond to guest requests or concerns promptly and professionally.', + ); + _isLoading = false; + }); + } + } + } + + String _formatTime(String time) { + if (time.isEmpty) return ''; + try { + final parts = time.split(':'); + final hour = int.parse(parts[0]); + final minute = int.parse(parts[1]); + final dt = DateTime(2022, 1, 1, hour, minute); + return DateFormat('h:mma').format(dt).toLowerCase(); + } catch (e) { + return time; + } + } + + String _formatDate(String dateStr) { + if (dateStr.isEmpty) return ''; + try { + final date = DateTime.parse(dateStr); + return DateFormat('MMMM d').format(date); + } catch (e) { + return dateStr; + } + } + + double _calculateHours(String start, String end) { + try { + final startParts = start.split(':').map(int.parse).toList(); + final endParts = end.split(':').map(int.parse).toList(); + double h = (endParts[0] - startParts[0]) + (endParts[1] - startParts[1]) / 60; + if (h < 0) h += 24; + return h; + } catch (e) { + return 0; + } + } + + @override + Widget build(BuildContext context) { + if (_isLoading) { + return const Scaffold( + backgroundColor: AppColors.krowBackground, + body: Center(child: CircularProgressIndicator()), + ); + } + + final hours = _calculateHours(_shift.startTime, _shift.endTime); + final totalPay = _shift.hourlyRate * hours; + + return Scaffold( + backgroundColor: AppColors.krowBackground, + appBar: AppBar( + backgroundColor: Colors.white, + elevation: 0, + leading: IconButton( + icon: const Icon(LucideIcons.chevronLeft, color: AppColors.krowMuted), + onPressed: () => Modular.to.pop(), + ), + bottom: PreferredSize( + preferredSize: const Size.fromHeight(1.0), + child: Container(color: AppColors.krowBorder, height: 1.0), + ), + ), + body: Stack( + children: [ + SingleChildScrollView( + padding: const EdgeInsets.fromLTRB(20, 20, 20, 120), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Pending Badge + Align( + alignment: Alignment.centerRight, + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 4, + ), + decoration: BoxDecoration( + color: AppColors.krowYellow.withOpacity(0.3), + borderRadius: BorderRadius.circular(20), + ), + child: const Text( + 'Pending 6h ago', + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w500, + color: AppColors.krowCharcoal, + ), + ), + ), + ), + const SizedBox(height: 16), + + // Header + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 56, + height: 56, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: AppColors.krowBorder), + ), + child: _shift.logoUrl != null + ? ClipRRect( + borderRadius: BorderRadius.circular(12), + child: Image.network( + _shift.logoUrl!, + fit: BoxFit.contain, + ), + ) + : Center( + child: Text( + _shift.clientName.isNotEmpty ? _shift.clientName[0] : 'K', + style: const TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + color: AppColors.krowBlue, + ), + ), + ), + ), + const SizedBox(width: 16), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + _shift.title, + style: const TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + color: AppColors.krowCharcoal, + ), + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + '\$${_shift.hourlyRate.toStringAsFixed(0)}/h', + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: AppColors.krowCharcoal, + ), + ), + Text( + '(exp.total \$${totalPay.toStringAsFixed(0)})', + style: const TextStyle( + fontSize: 12, + color: AppColors.krowMuted, + ), + ), + ], + ), + ], + ), + Text( + _shift.clientName, + style: const TextStyle(color: AppColors.krowMuted), + ), + ], + ), + ), + ], + ), + const SizedBox(height: 16), + + // Tags + Row( + children: [ + _buildTag( + LucideIcons.zap, + 'Immediate start', + AppColors.krowBlue.withOpacity(0.1), + AppColors.krowBlue, + ), + const SizedBox(width: 8), + _buildTag( + LucideIcons.star, + 'No experience', + AppColors.krowYellow.withOpacity(0.3), + AppColors.krowCharcoal, + ), + ], + ), + const SizedBox(height: 24), + + // Additional Details Collapsible + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: AppColors.krowBorder), + ), + child: Column( + children: [ + InkWell( + onTap: () => + setState(() => _showDetails = !_showDetails), + child: Padding( + padding: const EdgeInsets.all(16), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + 'ADDITIONAL DETAILS', + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: 0.5, + color: AppColors.krowMuted, + ), + ), + Icon( + _showDetails + ? LucideIcons.chevronUp + : LucideIcons.chevronDown, + color: AppColors.krowMuted, + size: 20, + ), + ], + ), + ), + ), + if (_showDetails) + Padding( + padding: const EdgeInsets.fromLTRB(16, 0, 16, 16), + child: Column( + children: [ + _buildDetailRow('Tips', 'Yes', true), + _buildDetailRow('Travel Time', 'Yes', true), + _buildDetailRow('Meal Provided', 'No', false), + _buildDetailRow('Parking Available', 'Yes', true), + _buildDetailRow('Gas Compensation', 'No', false), + ], + ), + ), + ], + ), + ), + const SizedBox(height: 16), + + // Date & Duration Grid + Row( + children: [ + Expanded( + child: Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: AppColors.krowBorder), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'START', + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.bold, + color: AppColors.krowMuted, + ), + ), + const SizedBox(height: 8), + Text( + _formatDate(_shift.date), + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: AppColors.krowCharcoal, + ), + ), + const Text( + 'Date', + style: TextStyle( + fontSize: 12, + color: AppColors.krowMuted, + ), + ), + const SizedBox(height: 12), + Text( + _formatTime(_shift.startTime), + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: AppColors.krowCharcoal, + ), + ), + const Text( + 'Time', + style: TextStyle( + fontSize: 12, + color: AppColors.krowMuted, + ), + ), + ], + ), + ), + ), + const SizedBox(width: 16), + Expanded( + child: Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: AppColors.krowBorder), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'DURATION', + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.bold, + color: AppColors.krowMuted, + ), + ), + const SizedBox(height: 8), + Text( + '${hours.toStringAsFixed(0)} hours', + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: AppColors.krowCharcoal, + ), + ), + const Text( + 'Shift duration', + style: TextStyle( + fontSize: 12, + color: AppColors.krowMuted, + ), + ), + const SizedBox(height: 12), + const Text( + '1 hour', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: AppColors.krowCharcoal, + ), + ), + const Text( + 'Break duration', + style: TextStyle( + fontSize: 12, + color: AppColors.krowMuted, + ), + ), + ], + ), + ), + ), + ], + ), + const SizedBox(height: 16), + + // Location + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: AppColors.krowBorder), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'LOCATION', + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.bold, + color: AppColors.krowMuted, + ), + ), + const SizedBox(height: 12), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _shift.location, + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: AppColors.krowCharcoal, + ), + ), + Text( + _shift.locationAddress, + style: const TextStyle( + fontSize: 14, + color: AppColors.krowMuted, + ), + ), + ], + ), + ), + OutlinedButton.icon( + onPressed: () { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + _shift.locationAddress, + ), + duration: const Duration(seconds: 3), + ), + ); + }, + icon: const Icon(LucideIcons.navigation, size: 14), + label: const Text('Get direction'), + style: OutlinedButton.styleFrom( + foregroundColor: AppColors.krowCharcoal, + side: const BorderSide( + color: AppColors.krowBorder, + ), + textStyle: const TextStyle(fontSize: 12), + ), + ), + ], + ), + const SizedBox(height: 16), + Container( + height: 160, + width: double.infinity, + decoration: BoxDecoration( + color: const Color(0xFFF1F3F5), + borderRadius: BorderRadius.circular(12), + ), + child: const Center( + child: Icon( + LucideIcons.map, + color: AppColors.krowMuted, + size: 48, + ), + ), + ), + ], + ), + ), + const SizedBox(height: 16), + + // Manager Contact + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: AppColors.krowBorder), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'MANAGER CONTACT DETAILS', + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.bold, + color: AppColors.krowMuted, + ), + ), + const SizedBox(height: 16), + ..._managers + .map( + (manager) => Padding( + padding: const EdgeInsets.only(bottom: 16), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + gradient: const LinearGradient( + colors: [ + AppColors.krowBlue, + Color(0xFF0830B8), + ], + ), + borderRadius: BorderRadius.circular( + 8, + ), + ), + child: const Center( + child: Icon( + LucideIcons.user, + color: Colors.white, + size: 20, + ), + ), + ), + const SizedBox(width: 12), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + manager['name']!, + style: const TextStyle( + fontWeight: FontWeight.w600, + color: AppColors.krowCharcoal, + ), + ), + Text( + manager['phone']!, + style: const TextStyle( + fontSize: 12, + color: AppColors.krowMuted, + ), + ), + ], + ), + ], + ), + OutlinedButton.icon( + onPressed: () { + ScaffoldMessenger.of( + context, + ).showSnackBar( + SnackBar( + content: Text(manager['phone']!), + duration: const Duration(seconds: 3), + ), + ); + }, + icon: const Icon( + LucideIcons.phone, + size: 14, + color: Color(0xFF059669), + ), + label: const Text( + 'Call', + style: TextStyle( + color: Color(0xFF059669), + ), + ), + style: OutlinedButton.styleFrom( + side: const BorderSide( + color: Color(0xFFA7F3D0), + ), + backgroundColor: const Color(0xFFECFDF5), + textStyle: const TextStyle(fontSize: 12), + ), + ), + ], + ), + ), + ) + .toList(), + ], + ), + ), + const SizedBox(height: 16), + + // Additional Info + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: AppColors.krowBorder), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'ADDITIONAL INFO', + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.bold, + color: AppColors.krowMuted, + ), + ), + const SizedBox(height: 12), + Text( + _shift.description ?? + 'Providing Exceptional Customer Service.', + style: const TextStyle( + fontSize: 14, + color: AppColors.krowMuted, + height: 1.5, + ), + ), + ], + ), + ), + ], + ), + ), + + // Bottom Actions + Positioned( + bottom: 0, + left: 0, + right: 0, + child: Container( + padding: const EdgeInsets.all(20), + decoration: const BoxDecoration( + color: Colors.white, + border: Border(top: BorderSide(color: AppColors.krowBorder)), + ), + child: SafeArea( + top: false, + child: Column( + children: [ + SizedBox( + width: double.infinity, + height: 56, + child: ElevatedButton( + onPressed: () async { + setState(() => _isApplying = true); + await Future.delayed(const Duration(seconds: 1)); + if (mounted) { + setState(() => _isApplying = false); + Modular.to.pop(); + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar( + content: Text('Shift Accepted!'), + backgroundColor: Color(0xFF10B981), + ), + ); + } + }, + style: ElevatedButton.styleFrom( + backgroundColor: AppColors.krowBlue, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + elevation: 0, + ), + child: _isApplying + ? const SizedBox( + width: 24, + height: 24, + child: CircularProgressIndicator( + color: Colors.white, + ), + ) + : const Text( + 'Accept shift', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + color: Colors.white, + ), + ), + ), + ), + const SizedBox(height: 12), + SizedBox( + width: double.infinity, + height: 48, + child: TextButton( + onPressed: () => Modular.to.pop(), + child: const Text( + 'Decline shift', + style: TextStyle( + color: Color(0xFFEF4444), + fontSize: 16, + fontWeight: FontWeight.w500, + ), + ), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ); + } + + Widget _buildTag(IconData icon, String label, Color bg, Color text) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), + decoration: BoxDecoration( + color: bg, + borderRadius: BorderRadius.circular(20), + ), + child: Row( + children: [ + Icon(icon, size: 14, color: text), + const SizedBox(width: 4), + Text( + label, + style: TextStyle( + color: text, + fontSize: 12, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ); + } + + Widget _buildDetailRow(String label, String value, bool isPositive) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 6), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + label, + style: const TextStyle(fontSize: 14, color: AppColors.krowMuted), + ), + Text( + value, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: isPositive ? const Color(0xFF059669) : AppColors.krowMuted, + ), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/pages/shifts_page.dart b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/pages/shifts_page.dart new file mode 100644 index 00000000..e89ded58 --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/pages/shifts_page.dart @@ -0,0 +1,616 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:lucide_icons/lucide_icons.dart'; +import 'package:intl/intl.dart'; +import 'package:design_system/design_system.dart'; +import 'package:krow_domain/krow_domain.dart'; +import '../blocs/shifts/shifts_bloc.dart'; +import '../widgets/my_shift_card.dart'; +import '../widgets/shift_assignment_card.dart'; + +// Shim to match POC styles locally +class AppColors { + static const Color krowBlue = UiColors.primary; + static const Color krowYellow = Color(0xFFFFED4A); + static const Color krowCharcoal = UiColors.textPrimary; + static const Color krowMuted = UiColors.textSecondary; + static const Color krowBorder = UiColors.border; + static const Color krowBackground = UiColors.background; + static const Color white = Colors.white; + static const Color black = Colors.black; +} + +class ShiftsPage extends StatefulWidget { + final String? initialTab; + const ShiftsPage({super.key, this.initialTab}); + + @override + State createState() => _ShiftsPageState(); +} + +class _ShiftsPageState extends State { + late String _activeTab; + String _searchQuery = ''; + // ignore: unused_field + String? _cancelledShiftDemo; // 'lastMinute' or 'advance' + String _jobType = 'all'; // all, one-day, multi-day, long-term + + // Calendar State + DateTime _selectedDate = DateTime.now(); + int _weekOffset = 0; + + final ShiftsBloc _bloc = Modular.get(); + + @override + void initState() { + super.initState(); + _activeTab = widget.initialTab ?? 'myshifts'; + _bloc.add(LoadShiftsEvent()); + } + + @override + void didUpdateWidget(ShiftsPage oldWidget) { + super.didUpdateWidget(oldWidget); + if (widget.initialTab != null && widget.initialTab != _activeTab) { + setState(() { + _activeTab = widget.initialTab!; + }); + } + } + + List _getCalendarDays() { + final now = DateTime.now(); + int reactDayIndex = now.weekday == 7 ? 0 : now.weekday; + int daysSinceFriday = (reactDayIndex + 2) % 7; + final start = now + .subtract(Duration(days: daysSinceFriday)) + .add(Duration(days: _weekOffset * 7)); + final startDate = DateTime(start.year, start.month, start.day); + return List.generate(7, (index) => startDate.add(Duration(days: index))); + } + + bool _isSameDay(DateTime a, DateTime b) { + return a.year == b.year && a.month == b.month && a.day == b.day; + } + + void _confirmShift(String id) { + // TODO: Implement Bloc event + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Shift confirmed! (Placeholder)')), + ); + } + + void _declineShift(String id) { + // TODO: Implement Bloc event + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Shift declined. (Placeholder)')), + ); + } + + @override + Widget build(BuildContext context) { + return BlocProvider.value( + value: _bloc, + child: BlocBuilder( + builder: (context, state) { + final List myShifts = (state is ShiftsLoaded) ? state.myShifts : []; + final List availableJobs = (state is ShiftsLoaded) ? state.availableShifts : []; + final List pendingAssignments = (state is ShiftsLoaded) ? state.pendingShifts : []; + final List historyShifts = []; // Not in state yet, placeholder + + // Filter logic from POC + final filteredJobs = availableJobs.where((s) { + final matchesSearch = + s.title.toLowerCase().contains(_searchQuery.toLowerCase()) || + s.location.toLowerCase().contains(_searchQuery.toLowerCase()) || + s.clientName.toLowerCase().contains(_searchQuery.toLowerCase()); + + if (!matchesSearch) return false; + + if (_jobType == 'all') return true; + if (_jobType == 'one-day') { + return !s.title.contains('Long Term') && !s.title.contains('Multi-Day'); + } + if (_jobType == 'multi-day') return s.title.contains('Multi-Day'); + if (_jobType == 'long-term') return s.title.contains('Long Term'); + return true; + }).toList(); + + final calendarDays = _getCalendarDays(); + final weekStartDate = calendarDays.first; + final weekEndDate = calendarDays.last; + + final visibleMyShifts = myShifts.where((s) { + // Primitive check if shift date string compare + // In real app use DateTime logic + final sDateStr = s.date; + final wStartStr = DateFormat('yyyy-MM-dd').format(weekStartDate); + final wEndStr = DateFormat('yyyy-MM-dd').format(weekEndDate); + return sDateStr.compareTo(wStartStr) >= 0 && + sDateStr.compareTo(wEndStr) <= 0; + }).toList(); + + return Scaffold( + backgroundColor: AppColors.krowBackground, + body: Column( + children: [ + // Header (Blue) + Container( + color: AppColors.krowBlue, + padding: EdgeInsets.fromLTRB( + 20, + MediaQuery.of(context).padding.top + 20, + 20, + 24, + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + "Shifts", + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + Row( + children: [ + _buildDemoButton("Demo: Cancel <4hr", const Color(0xFFEF4444), () { + setState(() => _cancelledShiftDemo = 'lastMinute'); + _showCancelledModal('lastMinute'); + }), + const SizedBox(width: 8), + _buildDemoButton("Demo: Cancel >4hr", const Color(0xFFF59E0B), () { + setState(() => _cancelledShiftDemo = 'advance'); + _showCancelledModal('advance'); + }), + ], + ), + ], + ), + const SizedBox(height: 16), + // Tabs + Row( + children: [ + _buildTab("myshifts", "My Shifts", LucideIcons.calendar, myShifts.length), + const SizedBox(width: 8), + _buildTab("find", "Find Shifts", LucideIcons.search, filteredJobs.length), + const SizedBox(width: 8), + _buildTab("history", "History", LucideIcons.clock, historyShifts.length), + ], + ), + ], + ), + ), + + // Calendar Selector + if (_activeTab == 'myshifts') + Container( + color: Colors.white, + padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 20), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.only(bottom: 16), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + InkWell( + onTap: () => setState(() => _weekOffset--), + borderRadius: BorderRadius.circular(20), + child: const Padding( + padding: EdgeInsets.all(8.0), + child: Icon(LucideIcons.chevronLeft, size: 20, color: AppColors.krowCharcoal), + ), + ), + Text( + DateFormat('MMMM yyyy').format(weekStartDate), + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: AppColors.krowCharcoal, + ), + ), + InkWell( + onTap: () => setState(() => _weekOffset++), + borderRadius: BorderRadius.circular(20), + child: const Padding( + padding: EdgeInsets.all(8.0), + child: Icon(LucideIcons.chevronRight, size: 20, color: AppColors.krowCharcoal), + ), + ), + ], + ), + ), + // Days Grid + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: calendarDays.map((date) { + final isSelected = _isSameDay(date, _selectedDate); + final dateStr = DateFormat('yyyy-MM-dd').format(date); + final hasShifts = myShifts.any((s) => s.date == dateStr); + + return GestureDetector( + onTap: () => setState(() => _selectedDate = date), + child: Container( + width: 44, + padding: const EdgeInsets.symmetric(vertical: 12), + decoration: BoxDecoration( + color: isSelected ? AppColors.krowBlue : Colors.white, + borderRadius: BorderRadius.circular(999), + border: Border.all( + color: isSelected ? AppColors.krowBlue : AppColors.krowBorder, + width: 1, + ), + ), + child: Column( + children: [ + Text( + date.day.toString().padLeft(2, '0'), + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + color: isSelected ? Colors.white : AppColors.krowCharcoal, + ), + ), + const SizedBox(height: 2), + Text( + DateFormat('E').format(date), + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.w500, + color: isSelected ? Colors.white.withOpacity(0.8) : AppColors.krowMuted, + ), + ), + if (hasShifts) + Container( + margin: const EdgeInsets.only(top: 4), + width: 6, + height: 6, + decoration: BoxDecoration( + color: isSelected ? Colors.white : AppColors.krowBlue, + shape: BoxShape.circle, + ), + ), + ], + ), + ), + ); + }).toList(), + ), + ], + ), + ), + + if (_activeTab == 'myshifts') + const Divider(height: 1, color: AppColors.krowBorder), + + // Body Content + Expanded( + child: SingleChildScrollView( + padding: const EdgeInsets.all(20), + child: Column( + children: [ + if (_activeTab == 'find') ...[ + // Search & Filter + Padding( + padding: const EdgeInsets.only(bottom: 12), + child: Container( + height: 48, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColors.krowBorder), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.05), + blurRadius: 4, + offset: const Offset(0, 2), + ), + ], + ), + child: TextField( + onChanged: (val) => setState(() => _searchQuery = val), // Local filter for now + decoration: const InputDecoration( + prefixIcon: Icon(LucideIcons.search, size: 20, color: AppColors.krowMuted), + border: InputBorder.none, + hintText: "Search jobs...", + hintStyle: TextStyle(color: AppColors.krowMuted, fontSize: 14), + contentPadding: EdgeInsets.symmetric(vertical: 12), + ), + ), + ), + ), + Container( + margin: const EdgeInsets.only(bottom: 16), + padding: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: const Color(0xFFF1F3F5), + borderRadius: BorderRadius.circular(999), + ), + child: Row( + children: [ + _buildFilterTab('all', 'All Jobs'), + _buildFilterTab('one-day', 'One Day'), + _buildFilterTab('multi-day', 'Multi-Day'), + _buildFilterTab('long-term', 'Long Term'), + ], + ), + ), + ], + + if (_activeTab == 'myshifts') ...[ + if (pendingAssignments.isNotEmpty) ...[ + Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: const EdgeInsets.only(bottom: 12), + child: Row( + children: [ + Container(width: 8, height: 8, decoration: const BoxDecoration(color: Color(0xFFF59E0B), shape: BoxShape.circle)), + const SizedBox(width: 8), + const Text("Awaiting Confirmation", style: TextStyle( + fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xFFD97706) + )), + ], + ), + ), + ), + ...pendingAssignments.map((shift) => Padding( + padding: const EdgeInsets.only(bottom: 16), + child: ShiftAssignmentCard( + shift: shift, + onConfirm: () => _confirmShift(shift.id), + onDecline: () => _declineShift(shift.id), + ), + )), + ], + + // Cancelled Shifts Demo (Visual only as per POC) + Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: const EdgeInsets.only(bottom: 12), + child: const Text("Cancelled Shifts", style: TextStyle( + fontSize: 14, fontWeight: FontWeight.w600, color: AppColors.krowMuted + )), + ), + ), + _buildCancelledCard( + title: "Annual Tech Conference", client: "TechCorp Inc.", pay: "\$200", rate: "\$25/hr Β· 8h", + date: "Today", time: "10:00 AM - 6:00 PM", address: "123 Convention Center Dr", isLastMinute: true, + onTap: () => setState(() => _cancelledShiftDemo = 'lastMinute') + ), + const SizedBox(height: 12), + _buildCancelledCard( + title: "Morning Catering Setup", client: "EventPro Services", pay: "\$120", rate: "\$20/hr Β· 6h", + date: "Tomorrow", time: "8:00 AM - 2:00 PM", address: "456 Grand Ballroom Ave", isLastMinute: false, + onTap: () => setState(() => _cancelledShiftDemo = 'advance') + ), + const SizedBox(height: 24), + + // Confirmed Shifts + if (visibleMyShifts.isNotEmpty) ...[ + Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: const EdgeInsets.only(bottom: 12), + child: const Text("Confirmed Shifts", style: TextStyle( + fontSize: 14, fontWeight: FontWeight.w600, color: AppColors.krowMuted + )), + ), + ), + ...visibleMyShifts.map((shift) => Padding( + padding: const EdgeInsets.only(bottom: 12), + child: MyShiftCard(shift: shift), + )), + ], + ], + + if (_activeTab == 'find') ...[ + if (filteredJobs.isEmpty) + _buildEmptyState(LucideIcons.search, "No jobs available", "Check back later", null, null) + else + ...filteredJobs.map((shift) => MyShiftCard( + shift: shift, + onAccept: () {}, + onDecline: () {}, + )), + ], + + if (_activeTab == 'history') + _buildEmptyState(LucideIcons.clock, "No shift history", "Completed shifts appear here", null, null), + ], + ), + ), + ), + ], + ), + ); + }, + ), + ); + } + + Widget _buildFilterTab(String id, String label) { + final isSelected = _jobType == id; + return Expanded( + child: GestureDetector( + onTap: () => setState(() => _jobType = id), + child: Container( + padding: const EdgeInsets.symmetric(vertical: 8), + decoration: BoxDecoration( + color: isSelected ? AppColors.krowBlue : Colors.transparent, + borderRadius: BorderRadius.circular(999), + boxShadow: isSelected ? [BoxShadow(color: AppColors.krowBlue.withOpacity(0.2), blurRadius: 4, offset: const Offset(0, 2))] : null, + ), + child: Text(label, textAlign: TextAlign.center, style: TextStyle( + fontSize: 11, fontWeight: FontWeight.w600, color: isSelected ? Colors.white : AppColors.krowMuted + )), + ), + ), + ); + } + + Widget _buildTab(String id, String label, IconData icon, int count) { + final isActive = _activeTab == id; + return Expanded( + child: GestureDetector( + onTap: () => setState(() => _activeTab = id), + child: Container( + padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 8), + decoration: BoxDecoration( + color: isActive ? Colors.white : Colors.white.withAlpha((0.2 * 255).round()), + borderRadius: BorderRadius.circular(8), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Icon(icon, size: 14, color: isActive ? AppColors.krowBlue : Colors.white), + const SizedBox(width: 6), + Flexible(child: Text(label, style: TextStyle(fontSize: 13, fontWeight: FontWeight.w500, color: isActive ? AppColors.krowBlue : Colors.white), overflow: TextOverflow.ellipsis)), + const SizedBox(width: 4), + Container( + padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2), + constraints: const BoxConstraints(minWidth: 18), + decoration: BoxDecoration( + color: isActive ? AppColors.krowBlue.withAlpha((0.1 * 255).round()) : Colors.white.withAlpha((0.2 * 255).round()), + borderRadius: BorderRadius.circular(999), + ), + child: Center(child: Text("$count", style: TextStyle(fontSize: 10, fontWeight: FontWeight.bold, color: isActive ? AppColors.krowBlue : Colors.white))), + ), + ], + ), + ), + ), + ); + } + + Widget _buildDemoButton(String label, Color color, VoidCallback onTap) { + return GestureDetector( + onTap: onTap, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration(color: color, borderRadius: BorderRadius.circular(4)), + child: Text(label, style: const TextStyle(fontSize: 10, fontWeight: FontWeight.bold, color: Colors.white)), + ), + ); + } + + Widget _buildEmptyState(IconData icon, String title, String subtitle, String? actionLabel, VoidCallback? onAction) { + return Center(child: Padding(padding: const EdgeInsets.symmetric(vertical: 64), child: Column(children: [ + Container(width: 64, height: 64, decoration: BoxDecoration(color: const Color(0xFFF1F3F5), borderRadius: BorderRadius.circular(12)), child: Icon(icon, size: 32, color: AppColors.krowMuted)), + const SizedBox(height: 16), + Text(title, style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: AppColors.krowCharcoal)), + const SizedBox(height: 4), + Text(subtitle, style: const TextStyle(fontSize: 14, color: AppColors.krowMuted)), + if (actionLabel != null && onAction != null) ...[ + const SizedBox(height: 16), + ElevatedButton(onPressed: onAction, style: ElevatedButton.styleFrom(backgroundColor: AppColors.krowBlue, foregroundColor: Colors.white, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))), child: Text(actionLabel)), + ] + ]))); + } + + Widget _buildCancelledCard({required String title, required String client, required String pay, required String rate, required String date, required String time, required String address, required bool isLastMinute, required VoidCallback onTap}) { + return GestureDetector( + onTap: onTap, + child: Container(padding: const EdgeInsets.all(16), decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(16), border: Border.all(color: AppColors.krowBorder)), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row(children: [Container(width: 6, height: 6, decoration: const BoxDecoration(color: Color(0xFFEF4444), shape: BoxShape.circle)), const SizedBox(width: 6), const Text("CANCELLED", style: TextStyle(fontSize: 10, fontWeight: FontWeight.bold, color: Color(0xFFEF4444))), if (isLastMinute) ...[const SizedBox(width: 4), const Text("β€’ 4hr compensation", style: TextStyle(fontSize: 10, fontWeight: FontWeight.w500, color: Color(0xFF10B981)))]]), + const SizedBox(height: 12), + Row(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Container(width: 44, height: 44, decoration: BoxDecoration(gradient: LinearGradient(begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [AppColors.krowBlue.withAlpha((0.15 * 255).round()), AppColors.krowBlue.withAlpha((0.08 * 255).round())]), borderRadius: BorderRadius.circular(12), border: Border.all(color: AppColors.krowBlue.withAlpha((0.15 * 255).round()))), child: const Center(child: Icon(LucideIcons.briefcase, color: AppColors.krowBlue, size: 20))), + const SizedBox(width: 12), + Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [Text(title, style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: AppColors.krowCharcoal)), Text(client, style: const TextStyle(fontSize: 12, color: AppColors.krowMuted))])), Column(crossAxisAlignment: CrossAxisAlignment.end, children: [Text(pay, style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: AppColors.krowCharcoal)), Text(rate, style: const TextStyle(fontSize: 10, color: AppColors.krowMuted))])]), + const SizedBox(height: 8), + Row(children: [const Icon(LucideIcons.calendar, size: 12, color: AppColors.krowMuted), const SizedBox(width: 4), Text(date, style: const TextStyle(fontSize: 12, color: AppColors.krowMuted)), const SizedBox(width: 12), const Icon(LucideIcons.clock, size: 12, color: AppColors.krowMuted), const SizedBox(width: 4), Text(time, style: const TextStyle(fontSize: 12, color: AppColors.krowMuted))]), + const SizedBox(height: 4), + Row(children: [const Icon(LucideIcons.mapPin, size: 12, color: AppColors.krowMuted), const SizedBox(width: 4), Expanded(child: Text(address, style: const TextStyle(fontSize: 12, color: AppColors.krowMuted), overflow: TextOverflow.ellipsis))]), + ])), + ]), + ])), + ); + } + + void _showCancelledModal(String type) { + final isLastMinute = type == 'lastMinute'; + showDialog( + context: context, + builder: (context) => AlertDialog( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + title: Row( + children: [ + const Icon(LucideIcons.xCircle, color: Color(0xFFEF4444)), + const SizedBox(width: 8), + const Text("Shift Cancelled"), + ], + ), + content: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "We're sorry, but the following shift has been cancelled by the client:", + style: TextStyle(fontSize: 14), + ), + const SizedBox(height: 12), + Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.grey.shade50, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey.shade200), + ), + child: const Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("Annual Tech Conference", style: TextStyle(fontWeight: FontWeight.bold)), + Text("Today, 10:00 AM - 6:00 PM"), + ], + ), + ), + const SizedBox(height: 16), + if (isLastMinute) + Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: const Color(0xFFECFDF5), + borderRadius: BorderRadius.circular(8), + border: Border.all(color: const Color(0xFF10B981)), + ), + child: const Row( + children: [ + Icon(LucideIcons.checkCircle, color: Color(0xFF10B981), size: 16), + SizedBox(width: 8), + Expanded( + child: Text( + "You are eligible for 4hr cancellation compensation.", + style: TextStyle( + fontSize: 12, color: Color(0xFF065F46), fontWeight: FontWeight.w500), + ), + ), + ], + ), + ) + else + const Text( + "Reduced schedule at the venue. No compensation is due as this was cancelled more than 4 hours in advance.", + style: TextStyle(fontSize: 12, color: AppColors.krowMuted), + ), + ], + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context), + child: const Text("Close"), + ), + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/widgets/my_shift_card.dart b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/widgets/my_shift_card.dart new file mode 100644 index 00000000..e9e99b35 --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/widgets/my_shift_card.dart @@ -0,0 +1,412 @@ +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:krow_domain/krow_domain.dart'; +import 'package:design_system/design_system.dart'; +import 'package:core_localization/core_localization.dart'; + +class MyShiftCard extends StatefulWidget { + final Shift shift; + final bool historyMode; + final VoidCallback? onAccept; + final VoidCallback? onDecline; + final VoidCallback? onRequestSwap; + final int index; + + const MyShiftCard({ + super.key, + required this.shift, + this.historyMode = false, + this.onAccept, + this.onDecline, + this.onRequestSwap, + this.index = 0, + }); + + @override + State createState() => _MyShiftCardState(); +} + +class _MyShiftCardState extends State { + bool _isExpanded = false; + + String _formatTime(String time) { + if (time.isEmpty) return ''; + try { + final parts = time.split(':'); + final hour = int.parse(parts[0]); + final minute = int.parse(parts[1]); + final dt = DateTime(2022, 1, 1, hour, minute); + return DateFormat('h:mm a').format(dt); + } catch (e) { + return time; + } + } + + String _formatDate(String dateStr) { + if (dateStr.isEmpty) return ''; + try { + final date = DateTime.parse(dateStr); + final now = DateTime.now(); + final today = DateTime(now.year, now.month, now.day); + final tomorrow = today.add(const Duration(days: 1)); + final d = DateTime(date.year, date.month, date.day); + + if (d == today) return 'Today'; + if (d == tomorrow) return 'Tomorrow'; + return DateFormat('EEE, MMM d').format(date); + } catch (e) { + return dateStr; + } + } + + double _calculateDuration() { + if (widget.shift.startTime.isEmpty || widget.shift.endTime.isEmpty) { + return 0; + } + try { + final s = widget.shift.startTime.split(':').map(int.parse).toList(); + final e = widget.shift.endTime.split(':').map(int.parse).toList(); + double hours = ((e[0] * 60 + e[1]) - (s[0] * 60 + s[1])) / 60; + if (hours < 0) hours += 24; + return hours.roundToDouble(); + } catch (_) { + return 0; + } + } + + String _getShiftType() { + // Check title for type indicators (for mock data) + if (widget.shift.title.contains('Long Term')) return t.staff_shifts.filter.long_term; + if (widget.shift.title.contains('Multi-Day')) return t.staff_shifts.filter.multi_day; + return t.staff_shifts.filter.one_day; + } + + @override + Widget build(BuildContext context) { + // ignore: unused_local_variable + final duration = _calculateDuration(); + + // Status Logic + String? status = widget.shift.status; + Color statusColor = UiColors.primary; + Color statusBg = UiColors.primary; + String statusText = ''; + IconData? statusIcon; + + if (status == 'confirmed') { + statusText = t.staff_shifts.status.confirmed; + statusColor = UiColors.textLink; + statusBg = UiColors.primary; + } else if (status == 'pending' || status == 'open') { + statusText = t.staff_shifts.status.act_now; + statusColor = UiColors.destructive; + statusBg = UiColors.destructive; + } else if (status == 'swap') { + statusText = t.staff_shifts.status.swap_requested; + statusColor = UiColors.textWarning; + statusBg = UiColors.textWarning; + statusIcon = UiIcons.swap; + } else if (status == 'completed') { + statusText = t.staff_shifts.status.completed; + statusColor = UiColors.textSuccess; + statusBg = UiColors.iconSuccess; + } else if (status == 'no_show') { + statusText = t.staff_shifts.status.no_show; + statusColor = UiColors.destructive; + statusBg = UiColors.destructive; + } + + return GestureDetector( + onTap: () => setState(() => _isExpanded = !_isExpanded), + child: AnimatedContainer( + duration: const Duration(milliseconds: 300), + margin: const EdgeInsets.only(bottom: 12), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: UiConstants.radiusLg, + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.05), + blurRadius: 2, + offset: const Offset(0, 1), + ), + ], + ), + child: Column( + children: [ + // Collapsed Content + Padding( + padding: const EdgeInsets.all(UiConstants.space4), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Status Badge + if (statusText.isNotEmpty) + Padding( + padding: const EdgeInsets.only(bottom: 8), + child: Row( + children: [ + if (statusIcon != null) + Padding( + padding: const EdgeInsets.only(right: 6), + child: Icon( + statusIcon, + size: 12, + color: statusColor, + ), + ) + else + Container( + width: 6, + height: 6, + margin: const EdgeInsets.only(right: 6), + decoration: BoxDecoration( + color: statusBg, + shape: BoxShape.circle, + ), + ), + Text( + statusText, + style: UiTypography.display3r.copyWith( + color: statusColor, + letterSpacing: 0.5, + ), + ), + // Shift Type Badge for available/pending shifts + if (status == 'open' || status == 'pending') ...[ + const SizedBox(width: 8), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 6, + vertical: 2, + ), + decoration: BoxDecoration( + color: UiColors.primary.withOpacity(0.1), + borderRadius: BorderRadius.circular(4), + ), + child: Text( + _getShiftType(), + style: UiTypography.display3r.copyWith( + color: UiColors.primary, + fontWeight: FontWeight.w500, + ), + ), + ), + ], + ], + ), + ), + + // Main Content + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Date/Time Column + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + _formatDate(widget.shift.date), + style: UiTypography.display2m.copyWith( + color: UiColors.textPrimary, + ), + ), + if (widget.shift.durationDays != null) ...[ + const SizedBox(width: 8), + Container( + padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2), + decoration: BoxDecoration( + color: UiColors.primary.withOpacity(0.1), + borderRadius: BorderRadius.circular(4), + ), + child: Text( + t.staff_shifts.details.days(days: widget.shift.durationDays!), + style: UiTypography.display3r.copyWith( + color: UiColors.primary, + fontWeight: FontWeight.w600, + ), + ), + ), + ], + ], + ), + const SizedBox(height: 4), + Text( + '${_formatTime(widget.shift.startTime)} - ${_formatTime(widget.shift.endTime)}', + style: UiTypography.body2r.copyWith( + color: UiColors.textSecondary, + ), + ), + const SizedBox(height: 12), + Text( + widget.shift.title, + style: UiTypography.body2m.copyWith( + color: UiColors.textPrimary, + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + Row( + children: [ + const Icon( + UiIcons.mapPin, + size: 12, + color: UiColors.iconSecondary, + ), + const SizedBox(width: 4), + Text( + widget.shift.clientName, + style: UiTypography.display3r.copyWith( + color: UiColors.textSecondary, + ), + ), + ], + ), + ], + ), + ), + + // Logo Box + Container( + width: 48, + height: 48, + decoration: BoxDecoration( + color: UiColors.background, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: UiColors.border), + ), + child: widget.shift.logoUrl != null + ? ClipRRect( + borderRadius: BorderRadius.circular(8), + child: Image.network( + widget.shift.logoUrl!, + fit: BoxFit.cover, + ), + ) + : Center( + child: Text( + widget.shift.clientName.isNotEmpty + ? widget.shift.clientName[0] + : 'K', + style: UiTypography.title1m.textLink, + ), + ), + ), + ], + ), + ], + ), + ), + + // Expanded Actions + AnimatedCrossFade( + firstChild: const SizedBox(height: 0), + secondChild: Container( + decoration: const BoxDecoration( + border: Border( + top: BorderSide(color: UiColors.border), + ), + ), + child: Column( + children: [ + // Warning for Pending + if (status == 'pending' || status == 'open') + Container( + width: double.infinity, + padding: const EdgeInsets.symmetric( + vertical: 8, + horizontal: 16, + ), + color: UiColors.accent.withOpacity(0.1), + child: Row( + children: [ + const Icon( + UiIcons.warning, + size: 14, + color: UiColors.textWarning, + ), + const SizedBox(width: 8), + Text( + t.staff_shifts.status.pending_warning, + style: UiTypography.display3r.copyWith( + color: UiColors.textWarning, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ), + + Padding( + padding: const EdgeInsets.all(12), + child: Row( + children: [ + if (status == 'pending' || status == 'open') ...[ + Expanded( + child: OutlinedButton( + onPressed: widget.onDecline, + style: OutlinedButton.styleFrom( + foregroundColor: UiColors.destructive, + side: const BorderSide(color: UiColors.border), + padding: const EdgeInsets.symmetric(vertical: 12), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + child: Text(t.staff_shifts.action.decline), + ), + ), + const SizedBox(width: 12), + Expanded( + child: ElevatedButton( + onPressed: widget.onAccept, + style: ElevatedButton.styleFrom( + backgroundColor: UiColors.primary, + foregroundColor: Colors.white, + elevation: 0, + padding: const EdgeInsets.symmetric(vertical: 12), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + child: Text(t.staff_shifts.action.confirm), + ), + ), + ] else if (status == 'confirmed') ...[ + Expanded( + child: OutlinedButton.icon( + onPressed: widget.onRequestSwap, + icon: const Icon(UiIcons.swap, size: 16), + label: Text(t.staff_shifts.action.request_swap), + style: OutlinedButton.styleFrom( + foregroundColor: UiColors.textPrimary, + side: const BorderSide(color: UiColors.border), + padding: const EdgeInsets.symmetric(vertical: 12), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + ), + ), + ], + ], + ), + ), + ], + ), + ), + crossFadeState: _isExpanded + ? CrossFadeState.showSecond + : CrossFadeState.showFirst, + duration: const Duration(milliseconds: 200), + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/widgets/shift_assignment_card.dart b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/widgets/shift_assignment_card.dart new file mode 100644 index 00000000..d3c813ff --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/widgets/shift_assignment_card.dart @@ -0,0 +1,242 @@ +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:krow_domain/krow_domain.dart'; +import 'package:design_system/design_system.dart'; +import 'package:core_localization/core_localization.dart'; + +class ShiftAssignmentCard extends StatelessWidget { + final Shift shift; + final VoidCallback onConfirm; + final VoidCallback onDecline; + final bool isConfirming; + + const ShiftAssignmentCard({ + super.key, + required this.shift, + required this.onConfirm, + required this.onDecline, + this.isConfirming = false, + }); + + String _formatTime(String time) { + if (time.isEmpty) return ''; + try { + final parts = time.split(':'); + final hour = int.parse(parts[0]); + final minute = int.parse(parts[1]); + final dt = DateTime(2022, 1, 1, hour, minute); + return DateFormat('h:mm a').format(dt); + } catch (e) { + return time; + } + } + + String _formatDate(String dateStr) { + if (dateStr.isEmpty) return ''; + try { + final date = DateTime.parse(dateStr); + final now = DateTime.now(); + final today = DateTime(now.year, now.month, now.day); + final tomorrow = today.add(const Duration(days: 1)); + final d = DateTime(date.year, date.month, date.day); + + if (d == today) return 'Today'; + if (d == tomorrow) return 'Tomorrow'; + return DateFormat('EEE, MMM d').format(date); + } catch (e) { + return dateStr; + } + } + + double _calculateHours(String start, String end) { + if (start.isEmpty || end.isEmpty) return 0; + try { + final s = start.split(':').map(int.parse).toList(); + final e = end.split(':').map(int.parse).toList(); + return ((e[0] * 60 + e[1]) - (s[0] * 60 + s[1])) / 60; + } catch (_) { + return 0; + } + } + + @override + Widget build(BuildContext context) { + final hours = _calculateHours(shift.startTime, shift.endTime); + final totalPay = shift.hourlyRate * hours; + + return Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.all(color: UiColors.border), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.05), + blurRadius: 2, + offset: const Offset(0, 1), + ), + ], + ), + child: Column( + children: [ + // Header + Padding( + padding: const EdgeInsets.fromLTRB(16, 16, 16, 12), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: 36, + height: 36, + decoration: BoxDecoration( + color: UiColors.secondary, + borderRadius: BorderRadius.circular(8), + ), + child: Center( + child: Text( + shift.clientName.isNotEmpty + ? shift.clientName[0] + : 'K', + style: UiTypography.body2b.copyWith( + color: UiColors.textSecondary, + ), + ), + ), + ), + const SizedBox(width: 12), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + shift.title, + style: UiTypography.body2b.copyWith( + color: UiColors.textPrimary, + ), + ), + Text( + shift.clientName, + style: UiTypography.display3r.copyWith( + color: UiColors.textSecondary, + ), + ), + ], + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + "\$${totalPay.toStringAsFixed(0)}", + style: UiTypography.display2m.copyWith( + color: UiColors.textPrimary, + ), + ), + Text( + "\$${shift.hourlyRate}/hr Β· ${hours}h", + style: UiTypography.display3r.copyWith( + color: UiColors.textSecondary, + ), + ), + ], + ), + ], + ), + ), + + // Details + Padding( + padding: const EdgeInsets.fromLTRB(16, 0, 16, 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + const Icon( + UiIcons.calendar, + size: 14, + color: UiColors.iconSecondary, + ), + const SizedBox(width: 6), + Text( + _formatDate(shift.date), + style: UiTypography.display3r.copyWith( + color: UiColors.textSecondary, + ), + ), + const SizedBox(width: 16), + const Icon( + UiIcons.clock, + size: 14, + color: UiColors.iconSecondary, + ), + const SizedBox(width: 6), + Text( + "${_formatTime(shift.startTime)} - ${_formatTime(shift.endTime)}", + style: UiTypography.display3r.copyWith( + color: UiColors.textSecondary, + ), + ), + ], + ), + const SizedBox(height: 8), + Row( + children: [ + const Icon( + UiIcons.mapPin, + size: 14, + color: UiColors.iconSecondary, + ), + const SizedBox(width: 6), + Expanded( + child: Text( + shift.location, + style: UiTypography.display3r.copyWith( + color: UiColors.textSecondary, + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ], + ), + ), + + if (isConfirming) ...[ + const Divider(height: 1), + Row( + children: [ + Expanded( + child: TextButton( + onPressed: onDecline, + style: TextButton.styleFrom( + foregroundColor: UiColors.destructive, + padding: const EdgeInsets.symmetric(vertical: 16), + ), + child: Text(t.staff_shifts.action.decline), + ), + ), + Container(width: 1, height: 48, color: UiColors.border), + Expanded( + child: TextButton( + onPressed: onConfirm, + style: TextButton.styleFrom( + foregroundColor: UiColors.primary, + padding: const EdgeInsets.symmetric(vertical: 16), + ), + child: Text(t.staff_shifts.action.confirm), + ), + ), + ], + ), + ], + ], + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/staff_shifts_module.dart b/apps/mobile/packages/features/staff/shifts/lib/src/staff_shifts_module.dart new file mode 100644 index 00000000..95c428fc --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/src/staff_shifts_module.dart @@ -0,0 +1,31 @@ +import 'package:flutter_modular/flutter_modular.dart'; +import 'domain/repositories/shifts_repository_interface.dart'; +import 'data/repositories_impl/shifts_repository_impl.dart'; +import 'domain/usecases/get_my_shifts_usecase.dart'; +import 'domain/usecases/get_available_shifts_usecase.dart'; +import 'domain/usecases/get_pending_assignments_usecase.dart'; +import 'presentation/blocs/shifts/shifts_bloc.dart'; +import 'presentation/pages/shifts_page.dart'; +import 'presentation/pages/shift_details_page.dart'; + +class StaffShiftsModule extends Module { + @override + void binds(Injector i) { + // Repository + i.add(ShiftsRepositoryImpl.new); + + // UseCases + i.add(GetMyShiftsUseCase.new); + i.add(GetAvailableShiftsUseCase.new); + i.add(GetPendingAssignmentsUseCase.new); + + // Bloc + i.add(ShiftsBloc.new); + } + + @override + void routes(RouteManager r) { + r.child('/', child: (_) => const ShiftsPage()); + r.child('/details/:id', child: (_) => ShiftDetailsPage(shiftId: r.args.params['id'], shift: r.args.data)); + } +} diff --git a/apps/mobile/packages/features/staff/shifts/lib/staff_shifts.dart b/apps/mobile/packages/features/staff/shifts/lib/staff_shifts.dart new file mode 100644 index 00000000..28ae0ac4 --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/lib/staff_shifts.dart @@ -0,0 +1,4 @@ +library staff_shifts; + +export 'src/staff_shifts_module.dart'; + diff --git a/apps/mobile/packages/features/staff/shifts/pubspec.lock b/apps/mobile/packages/features/staff/shifts/pubspec.lock new file mode 100644 index 00000000..a2cdf2f8 --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/pubspec.lock @@ -0,0 +1,650 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" + source: hosted + version: "2.13.0" + auto_injector: + dependency: transitive + description: + name: auto_injector + sha256: "1fc2624898e92485122eb2b1698dd42511d7ff6574f84a3a8606fc4549a1e8f8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + bloc: + dependency: transitive + description: + name: bloc + sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e" + url: "https://pub.dev" + source: hosted + version: "8.1.4" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + core_localization: + dependency: "direct main" + description: + path: "../../../core_localization" + relative: true + source: path + version: "0.0.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" + source: hosted + version: "3.0.7" + csv: + dependency: transitive + description: + name: csv + sha256: c6aa2679b2a18cb57652920f674488d89712efaf4d3fdf2e537215b35fc19d6c + url: "https://pub.dev" + source: hosted + version: "6.0.0" + design_system: + dependency: "direct main" + description: + path: "../../../design_system" + relative: true + source: path + version: "0.0.1" + equatable: + dependency: "direct main" + description: + name: equatable + sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b" + url: "https://pub.dev" + source: hosted + version: "2.0.8" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c + url: "https://pub.dev" + source: hosted + version: "2.1.5" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: "direct main" + description: + name: flutter_bloc + sha256: b594505eac31a0518bdcb4b5b79573b8d9117b193cc80cc12e17d639b10aa27a + url: "https://pub.dev" + source: hosted + version: "8.1.6" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + flutter_localizations: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_modular: + dependency: "direct main" + description: + name: flutter_modular + sha256: "33a63d9fe61429d12b3dfa04795ed890f17d179d3d38e988ba7969651fcd5586" + url: "https://pub.dev" + source: hosted + version: "6.4.1" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + font_awesome_flutter: + dependency: transitive + description: + name: font_awesome_flutter + sha256: b9011df3a1fa02993630b8fb83526368cf2206a711259830325bab2f1d2a4eb0 + url: "https://pub.dev" + source: hosted + version: "10.12.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + google_fonts: + dependency: transitive + description: + name: google_fonts + sha256: "6996212014b996eaa17074e02b1b925b212f5e053832d9048970dc27255a8fb3" + url: "https://pub.dev" + source: hosted + version: "7.1.0" + hooks: + dependency: transitive + description: + name: hooks + sha256: "5d309c86e7ce34cd8e37aa71cb30cb652d3829b900ab145e4d9da564b31d59f7" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + http: + dependency: transitive + description: + name: http + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" + url: "https://pub.dev" + source: hosted + version: "1.6.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + intl: + dependency: "direct main" + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + krow_core: + dependency: "direct main" + description: + path: "../../../core" + relative: true + source: path + version: "0.0.1" + krow_data_connect: + dependency: "direct main" + description: + path: "../../../data_connect" + relative: true + source: path + version: "0.0.1" + krow_domain: + dependency: "direct main" + description: + path: "../../../domain" + relative: true + source: path + version: "0.0.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.dev" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + lints: + dependency: transitive + description: + name: lints + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + url: "https://pub.dev" + source: hosted + version: "3.0.0" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + lucide_icons: + dependency: transitive + description: + name: lucide_icons + sha256: ad24d0fd65707e48add30bebada7d90bff2a1bba0a72d6e9b19d44246b0e83c4 + url: "https://pub.dev" + source: hosted + version: "0.257.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + url: "https://pub.dev" + source: hosted + version: "1.17.0" + modular_core: + dependency: transitive + description: + name: modular_core + sha256: "1db0420a0dfb8a2c6dca846e7cbaa4ffeb778e247916dbcb27fb25aa566e5436" + url: "https://pub.dev" + source: hosted + version: "3.4.1" + native_toolchain_c: + dependency: transitive + description: + name: native_toolchain_c + sha256: "89e83885ba09da5fdf2cdacc8002a712ca238c28b7f717910b34bcd27b0d03ac" + url: "https://pub.dev" + source: hosted + version: "0.17.4" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "7fd0c4d8ac8980011753b9bdaed2bf15111365924cdeeeaeb596214ea2b03537" + url: "https://pub.dev" + source: hosted + version: "9.2.4" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: f2c65e21139ce2c3dad46922be8272bb5963516045659e71bb16e151c93b580e + url: "https://pub.dev" + source: hosted + version: "2.2.22" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + provider: + dependency: transitive + description: + name: provider + sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272" + url: "https://pub.dev" + source: hosted + version: "6.1.5+1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + result_dart: + dependency: transitive + description: + name: result_dart + sha256: "0666b21fbdf697b3bdd9986348a380aa204b3ebe7c146d8e4cdaa7ce735e6054" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + shared_preferences: + dependency: transitive + description: + name: shared_preferences + sha256: "2939ae520c9024cb197fc20dee269cd8cdbf564c8b5746374ec6cacdc5169e64" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "83af5c682796c0f7719c2bbf74792d113e40ae97981b8f266fa84574573556bc" + url: "https://pub.dev" + source: hosted + version: "2.4.18" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" + url: "https://pub.dev" + source: hosted + version: "2.5.6" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + slang: + dependency: transitive + description: + name: slang + sha256: "13e3b6f07adc51ab751e7889647774d294cbce7a3382f81d9e5029acfe9c37b2" + url: "https://pub.dev" + source: hosted + version: "4.12.0" + slang_flutter: + dependency: transitive + description: + name: slang_flutter + sha256: "0a4545cca5404d6b7487cf61cf1fe56c52daeb08de56a7574ee8381fbad035a0" + url: "https://pub.dev" + source: hosted + version: "4.12.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + url: "https://pub.dev" + source: hosted + version: "0.7.7" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8 + url: "https://pub.dev" + source: hosted + version: "4.5.2" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" + source: hosted + version: "15.0.2" + watcher: + dependency: transitive + description: + name: watcher + sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.10.7 <4.0.0" + flutter: ">=3.38.4" diff --git a/apps/mobile/packages/features/staff/shifts/pubspec.yaml b/apps/mobile/packages/features/staff/shifts/pubspec.yaml new file mode 100644 index 00000000..64467b03 --- /dev/null +++ b/apps/mobile/packages/features/staff/shifts/pubspec.yaml @@ -0,0 +1,33 @@ +name: staff_shifts +description: A new Flutter package project. +version: 0.0.1 +publish_to: 'none' + +environment: + sdk: '>=3.0.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_modular: ^6.3.2 + flutter_bloc: ^8.1.3 + equatable: ^2.0.5 + intl: ^0.20.2 + + # Internal packages + krow_core: + path: ../../../core + design_system: + path: ../../../design_system + krow_domain: + path: ../../../domain + krow_data_connect: + path: ../../../data_connect + core_localization: + path: ../../../core_localization + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^3.0.0 diff --git a/apps/mobile/packages/features/staff/staff_main/analysis_options.yaml b/apps/mobile/packages/features/staff/staff_main/analysis_options.yaml new file mode 100644 index 00000000..03ea3cc1 --- /dev/null +++ b/apps/mobile/packages/features/staff/staff_main/analysis_options.yaml @@ -0,0 +1,7 @@ +include: package:flutter_lints/flutter.yaml + +linter: + rules: + avoid_print: true + prefer_single_quotes: true + always_use_package_imports: true diff --git a/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/blocs/staff_main_cubit.dart b/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/blocs/staff_main_cubit.dart new file mode 100644 index 00000000..62953e03 --- /dev/null +++ b/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/blocs/staff_main_cubit.dart @@ -0,0 +1,65 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:staff_main/src/presentation/blocs/staff_main_state.dart'; +import 'package:staff_main/src/presentation/constants/staff_main_routes.dart'; +import 'package:staff_main/src/presentation/navigation/staff_main_navigator.dart'; + +class StaffMainCubit extends Cubit implements Disposable { + StaffMainCubit() : super(const StaffMainState()) { + Modular.to.addListener(_onRouteChanged); + _onRouteChanged(); + } + + void _onRouteChanged() { + if (isClosed) return; + final String path = Modular.to.path; + int newIndex = state.currentIndex; + + // Detect which tab is active based on the route path + // Using contains() to handle child routes and trailing slashes + if (path.contains(StaffMainRoutes.shiftsFull)) { + newIndex = 0; + } else if (path.contains(StaffMainRoutes.paymentsFull)) { + newIndex = 1; + } else if (path.contains(StaffMainRoutes.homeFull)) { + newIndex = 2; + } else if (path.contains(StaffMainRoutes.clockInFull)) { + newIndex = 3; + } else if (path.contains(StaffMainRoutes.profileFull)) { + newIndex = 4; + } + + if (newIndex != state.currentIndex) { + emit(state.copyWith(currentIndex: newIndex)); + } + } + + void navigateToTab(int index) { + if (index == state.currentIndex) return; + + switch (index) { + case 0: + Modular.to.navigateToShifts(); + break; + case 1: + Modular.to.navigateToPayments(); + break; + case 2: + Modular.to.navigateToHome(); + break; + case 3: + Modular.to.navigateToClockIn(); + break; + case 4: + Modular.to.navigateToProfile(); + break; + } + // State update will happen via _onRouteChanged + } + + @override + void dispose() { + Modular.to.removeListener(_onRouteChanged); + close(); + } +} diff --git a/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/blocs/staff_main_state.dart b/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/blocs/staff_main_state.dart new file mode 100644 index 00000000..68175302 --- /dev/null +++ b/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/blocs/staff_main_state.dart @@ -0,0 +1,16 @@ +import 'package:equatable/equatable.dart'; + +class StaffMainState extends Equatable { + const StaffMainState({ + this.currentIndex = 2, // Default to Home + }); + + final int currentIndex; + + StaffMainState copyWith({int? currentIndex}) { + return StaffMainState(currentIndex: currentIndex ?? this.currentIndex); + } + + @override + List get props => [currentIndex]; +} diff --git a/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/constants/staff_main_routes.dart b/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/constants/staff_main_routes.dart new file mode 100644 index 00000000..db753d22 --- /dev/null +++ b/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/constants/staff_main_routes.dart @@ -0,0 +1,16 @@ +abstract class StaffMainRoutes { + static const String modulePath = '/worker-main'; + + static const String shifts = '/shifts'; + static const String payments = '/payments'; + static const String home = '/home'; + static const String clockIn = '/clock-in'; + static const String profile = '/profile'; + + // Full paths + static const String shiftsFull = '$modulePath$shifts'; + static const String paymentsFull = '$modulePath$payments'; + static const String homeFull = '$modulePath$home'; + static const String clockInFull = '$modulePath$clockIn'; + static const String profileFull = '$modulePath$profile'; +} diff --git a/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/navigation/staff_main_navigator.dart b/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/navigation/staff_main_navigator.dart new file mode 100644 index 00000000..735ac1dd --- /dev/null +++ b/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/navigation/staff_main_navigator.dart @@ -0,0 +1,36 @@ +import 'package:flutter_modular/flutter_modular.dart'; +import '../constants/staff_main_routes.dart'; + +/// Extension to provide typed navigation for the Staff Main feature. +extension StaffMainNavigator on IModularNavigator { + /// Navigates to the Staff Main Shell (Home). + /// This replaces the current navigation stack. + void navigateStaffMain() { + navigate('${StaffMainRoutes.modulePath}/home/'); + } + + /// Navigates to the Shifts tab. + void navigateToShifts() { + navigate(StaffMainRoutes.shiftsFull); + } + + /// Navigates to the Payments tab. + void navigateToPayments() { + navigate(StaffMainRoutes.paymentsFull); + } + + /// Navigates to the Home tab. + void navigateToHome() { + navigate('${StaffMainRoutes.homeFull}/'); + } + + /// Navigates to the Clock In tab. + void navigateToClockIn() { + navigate(StaffMainRoutes.clockInFull); + } + + /// Navigates to the Profile tab. + void navigateToProfile() { + navigate(StaffMainRoutes.profileFull); + } +} diff --git a/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/pages/placeholder_page.dart b/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/pages/placeholder_page.dart new file mode 100644 index 00000000..b9d993d6 --- /dev/null +++ b/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/pages/placeholder_page.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class PlaceholderPage extends StatelessWidget { + const PlaceholderPage({required this.title, super.key}); + + final String title; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text(title)), + body: Center(child: Text('$title Page')), + ); + } +} diff --git a/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/pages/staff_main_page.dart b/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/pages/staff_main_page.dart new file mode 100644 index 00000000..53cad7c8 --- /dev/null +++ b/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/pages/staff_main_page.dart @@ -0,0 +1,38 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_modular/flutter_modular.dart'; + +import 'package:staff_main/src/presentation/blocs/staff_main_cubit.dart'; +import 'package:staff_main/src/presentation/blocs/staff_main_state.dart'; +import 'package:staff_main/src/presentation/widgets/staff_main_bottom_bar.dart'; + +/// The main page for the Staff app, acting as a shell for the bottom navigation. +/// +/// It follows KROW Clean Architecture by: +/// - Being a [StatelessWidget]. +/// - Delegating state management to [StaffMainCubit]. +/// - Using [RouterOutlet] for nested navigation. +class StaffMainPage extends StatelessWidget { + const StaffMainPage({super.key}); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (BuildContext context) => Modular.get(), + child: Scaffold( + extendBody: true, + body: const RouterOutlet(), + bottomNavigationBar: BlocBuilder( + builder: (BuildContext context, StaffMainState state) { + return StaffMainBottomBar( + currentIndex: state.currentIndex, + onTap: (int index) { + BlocProvider.of(context).navigateToTab(index); + }, + ); + }, + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/widgets/staff_main_bottom_bar.dart b/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/widgets/staff_main_bottom_bar.dart new file mode 100644 index 00000000..4655cf4d --- /dev/null +++ b/apps/mobile/packages/features/staff/staff_main/lib/src/presentation/widgets/staff_main_bottom_bar.dart @@ -0,0 +1,157 @@ +import 'dart:ui'; + +import 'package:core_localization/core_localization.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; + +/// A custom bottom navigation bar for the Staff app. +/// +/// This widget provides a glassmorphic bottom navigation bar with blur effect +/// and follows the KROW Design System guidelines. It displays five tabs: +/// Shifts, Payments, Home, Clock In, and Profile. +/// +/// The widget uses: +/// - [UiColors] for all color values +/// - [UiTypography] for text styling +/// - [UiIcons] for icon assets +/// - [UiConstants] for spacing and sizing +class StaffMainBottomBar extends StatelessWidget { + /// Creates a [StaffMainBottomBar]. + /// + /// The [currentIndex] indicates which tab is currently selected. + /// The [onTap] callback is invoked when a tab is tapped. + const StaffMainBottomBar({ + required this.currentIndex, + required this.onTap, + super.key, + }); + + /// The index of the currently selected tab. + final int currentIndex; + + /// Callback invoked when a tab is tapped. + /// + /// The callback receives the index of the tapped tab. + final ValueChanged onTap; + + @override + Widget build(BuildContext context) { + // Staff App colors from design system + // Using primary (Blue) for active as per prototype + const Color activeColor = UiColors.primary; + const Color inactiveColor = UiColors.textInactive; + + return Stack( + clipBehavior: Clip.none, + children: [ + // Glassmorphic background with blur effect + Positioned.fill( + child: ClipRect( + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + decoration: BoxDecoration( + color: UiColors.white.withValues(alpha: 0.85), + border: Border( + top: BorderSide( + color: UiColors.black.withValues(alpha: 0.1), + ), + ), + ), + ), + ), + ), + ), + // Navigation items + Container( + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).padding.bottom + UiConstants.space2, + top: UiConstants.space4, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + _buildNavItem( + index: 0, + icon: UiIcons.briefcase, + label: t.staff.main.tabs.shifts, + activeColor: activeColor, + inactiveColor: inactiveColor, + ), + _buildNavItem( + index: 1, + icon: UiIcons.dollar, + label: t.staff.main.tabs.payments, + activeColor: activeColor, + inactiveColor: inactiveColor, + ), + _buildNavItem( + index: 2, + icon: UiIcons.home, + label: t.staff.main.tabs.home, + activeColor: activeColor, + inactiveColor: inactiveColor, + ), + _buildNavItem( + index: 3, + icon: UiIcons.clock, + label: t.staff.main.tabs.clock_in, + activeColor: activeColor, + inactiveColor: inactiveColor, + ), + _buildNavItem( + index: 4, + icon: UiIcons.users, + label: t.staff.main.tabs.profile, + activeColor: activeColor, + inactiveColor: inactiveColor, + ), + ], + ), + ), + ], + ); + } + + /// Builds a single navigation item. + /// + /// Uses design system tokens for all styling: + /// - Icon size uses a standard value (24px is acceptable for navigation icons) + /// - Spacing uses [UiConstants.space1] + /// - Typography uses [UiTypography.footnote2m] + /// - Colors are passed as parameters from design system + Widget _buildNavItem({ + required int index, + required IconData icon, + required String label, + required Color activeColor, + required Color inactiveColor, + }) { + final bool isSelected = currentIndex == index; + return Expanded( + child: GestureDetector( + onTap: () => onTap(index), + behavior: HitTestBehavior.opaque, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Icon( + icon, + color: isSelected ? activeColor : inactiveColor, + size: 24, // Standard navigation icon size + ), + const SizedBox(height: UiConstants.space1), + Text( + label, + style: UiTypography.footnote2m.copyWith( + color: isSelected ? activeColor : inactiveColor, + ), + ), + ], + ), + ), + ); + } +} diff --git a/apps/mobile/packages/features/staff/staff_main/lib/src/staff_main_module.dart b/apps/mobile/packages/features/staff/staff_main/lib/src/staff_main_module.dart new file mode 100644 index 00000000..223c03c4 --- /dev/null +++ b/apps/mobile/packages/features/staff/staff_main/lib/src/staff_main_module.dart @@ -0,0 +1,71 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:staff_home/staff_home.dart'; +import 'package:staff_profile/staff_profile.dart'; +import 'package:staff_profile_info/staff_profile_info.dart'; +import 'package:staff_emergency_contact/staff_emergency_contact.dart'; +import 'package:staff_profile_experience/staff_profile_experience.dart'; +import 'package:staff_bank_account/staff_bank_account.dart'; +import 'package:staff_tax_forms/staff_tax_forms.dart'; +import 'package:staff_documents/staff_documents.dart'; +import 'package:staff_certificates/staff_certificates.dart'; +import 'package:staff_attire/staff_attire.dart'; +import 'package:staff_shifts/staff_shifts.dart'; +import 'package:staff_payments/staff_payements.dart'; + +import 'package:staff_main/src/presentation/blocs/staff_main_cubit.dart'; +import 'package:staff_main/src/presentation/constants/staff_main_routes.dart'; +import 'package:staff_main/src/presentation/pages/placeholder_page.dart'; +import 'package:staff_main/src/presentation/pages/staff_main_page.dart'; + +class StaffMainModule extends Module { + @override + void binds(Injector i) { + i.addSingleton(StaffMainCubit.new); + } + + @override + void routes(RouteManager r) { + r.child( + '/', + child: (BuildContext context) => const StaffMainPage(), + children: >[ + ModuleRoute( + StaffMainRoutes.shifts, + module: StaffShiftsModule(), + ), + ModuleRoute( + StaffMainRoutes.payments, + module: StaffPaymentsModule(), + ), + ModuleRoute( + StaffMainRoutes.home, + module: StaffHomeModule(), + ), + ChildRoute( + StaffMainRoutes.clockIn, + child: (BuildContext context) => + const PlaceholderPage(title: 'Clock In'), + ), + ModuleRoute( + StaffMainRoutes.profile, + module: StaffProfileModule(), + ), + ], + ); + r.module('/onboarding', module: StaffProfileInfoModule()); + r.module('/emergency-contact', module: StaffEmergencyContactModule()); + r.module('/experience', module: StaffProfileExperienceModule()); + r.module('/attire', module: StaffAttireModule()); + r.module('/bank-account', module: StaffBankAccountModule()); + r.module('/tax-forms', module: StaffTaxFormsModule()); + r.module( + '/documents', + module: StaffDocumentsModule(), + ); + r.module( + '/certificates', + module: StaffCertificatesModule(), + ); + } +} diff --git a/apps/mobile/packages/features/staff/staff_main/lib/staff_main.dart b/apps/mobile/packages/features/staff/staff_main/lib/staff_main.dart new file mode 100644 index 00000000..6f9aec7a --- /dev/null +++ b/apps/mobile/packages/features/staff/staff_main/lib/staff_main.dart @@ -0,0 +1,4 @@ +library; + +export 'src/presentation/navigation/staff_main_navigator.dart'; +export 'src/staff_main_module.dart'; diff --git a/apps/mobile/packages/features/staff/staff_main/pubspec.yaml b/apps/mobile/packages/features/staff/staff_main/pubspec.yaml new file mode 100644 index 00000000..616df90c --- /dev/null +++ b/apps/mobile/packages/features/staff/staff_main/pubspec.yaml @@ -0,0 +1,59 @@ +name: staff_main +description: Main shell and navigation for the staff application. +version: 0.0.1 +publish_to: none +resolution: workspace + +environment: + sdk: '>=3.10.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + flutter: + sdk: flutter + flutter_bloc: ^8.1.0 + flutter_modular: ^6.3.0 + equatable: ^2.0.5 + lucide_icons: ^0.257.0 + + # Architecture Packages + design_system: + path: ../../../design_system + core_localization: + path: ../../../core_localization + + # Features + staff_home: + path: ../home + staff_profile: + path: ../profile + staff_profile_info: + path: ../profile_sections/onboarding/profile_info + staff_emergency_contact: + path: ../profile_sections/onboarding/emergency_contact + staff_profile_experience: + path: ../profile_sections/onboarding/experience + staff_bank_account: + path: ../profile_sections/finances/staff_bank_account + staff_tax_forms: + path: ../profile_sections/compliance/tax_forms + staff_documents: + path: ../profile_sections/compliance/documents + staff_certificates: + path: ../profile_sections/compliance/certificates + staff_attire: + path: ../profile_sections/onboarding/attire + staff_shifts: + path: ../shifts + staff_payments: + path: ../payments + +dev_dependencies: + flutter_test: + sdk: flutter + bloc_test: ^9.1.0 + mocktail: ^1.0.0 + flutter_lints: ^6.0.0 + +flutter: + uses-material-design: true diff --git a/apps/mobile/pubspec.lock b/apps/mobile/pubspec.lock new file mode 100644 index 00000000..3fb0cc1a --- /dev/null +++ b/apps/mobile/pubspec.lock @@ -0,0 +1,1350 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: c209688d9f5a5f26b2fb47a188131a6fb9e876ae9e47af3737c0b4f58a93470d + url: "https://pub.dev" + source: hosted + version: "91.0.0" + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: cd83f7d6bd4e4c0b0b4fef802e8796784032e1cc23d7b0e982cf5d05d9bbe182 + url: "https://pub.dev" + source: hosted + version: "1.3.66" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: f51c8499b35f9b26820cfe914828a6a98a94efd5cc78b37bb7d03debae3a1d08 + url: "https://pub.dev" + source: hosted + version: "8.4.1" + ansi_styles: + dependency: transitive + description: + name: ansi_styles + sha256: "9c656cc12b3c27b17dd982b2cc5c0cfdfbdabd7bc8f3ae5e8542d9867b47ce8a" + url: "https://pub.dev" + source: hosted + version: "0.3.2+1" + archive: + dependency: transitive + description: + name: archive + sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d + url: "https://pub.dev" + source: hosted + version: "3.6.1" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" + source: hosted + version: "2.13.0" + auto_injector: + dependency: transitive + description: + name: auto_injector + sha256: "1fc2624898e92485122eb2b1698dd42511d7ff6574f84a3a8606fc4549a1e8f8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + billing: + dependency: transitive + description: + path: "packages/features/client/billing" + relative: true + source: path + version: "1.0.0+1" + bloc: + dependency: transitive + description: + name: bloc + sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e" + url: "https://pub.dev" + source: hosted + version: "8.1.4" + bloc_test: + dependency: transitive + description: + name: bloc_test + sha256: "165a6ec950d9252ebe36dc5335f2e6eb13055f33d56db0eeb7642768849b43d2" + url: "https://pub.dev" + source: hosted + version: "9.1.7" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + build: + dependency: transitive + description: + name: build + sha256: "275bf6bb2a00a9852c28d4e0b410da1d833a734d57d39d44f94bfc895a484ec3" + url: "https://pub.dev" + source: hosted + version: "4.0.4" + build_config: + dependency: transitive + description: + name: build_config + sha256: "4f64382b97504dc2fcdf487d5aae33418e08b4703fc21249e4db6d804a4d0187" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: bf05f6e12cfea92d3c09308d7bcdab1906cd8a179b023269eed00c071004b957 + url: "https://pub.dev" + source: hosted + version: "4.1.1" + build_runner: + dependency: transitive + description: + name: build_runner + sha256: b4d854962a32fd9f8efc0b76f98214790b833af8b2e9b2df6bfc927c0415a072 + url: "https://pub.dev" + source: hosted + version: "2.10.5" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "7931c90b84bc573fef103548e354258ae4c9d28d140e41961df6843c5d60d4d8" + url: "https://pub.dev" + source: hosted + version: "8.12.3" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + charcode: + dependency: transitive + description: + name: charcode + sha256: fb0f1107cac15a5ea6ef0a6ef71a807b9e4267c713bb93e00e92d737cc8dbd8a + url: "https://pub.dev" + source: hosted + version: "1.4.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" + url: "https://pub.dev" + source: hosted + version: "2.0.4" + cli_config: + dependency: transitive + description: + name: cli_config + sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec + url: "https://pub.dev" + source: hosted + version: "0.2.0" + cli_launcher: + dependency: transitive + description: + name: cli_launcher + sha256: "17d2744fb9a254c49ec8eda582536abe714ea0131533e24389843a4256f82eac" + url: "https://pub.dev" + source: hosted + version: "0.3.2+1" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" + client_coverage: + dependency: transitive + description: + path: "packages/features/client/client_coverage" + relative: true + source: path + version: "1.0.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: ae0db647e668cbb295a3527f0938e4039e004c80099dce2f964102373f5ce0b5 + url: "https://pub.dev" + source: hosted + version: "0.19.10" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "6a6cab2ba4680d6423f34a9b972a4c9a94ebe1b62ecec4e1a1f2cba91fd1319d" + url: "https://pub.dev" + source: hosted + version: "4.11.1" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + conventional_commit: + dependency: transitive + description: + name: conventional_commit + sha256: c40b1b449ce2a63fa2ce852f35e3890b1e182f5951819934c0e4a66254bc0dc3 + url: "https://pub.dev" + source: hosted + version: "0.6.1+1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + coverage: + dependency: transitive + description: + name: coverage + sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d" + url: "https://pub.dev" + source: hosted + version: "1.15.0" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" + source: hosted + version: "3.0.7" + csv: + dependency: transitive + description: + name: csv + sha256: c6aa2679b2a18cb57652920f674488d89712efaf4d3fdf2e537215b35fc19d6c + url: "https://pub.dev" + source: hosted + version: "6.0.0" + cupertino_icons: + dependency: transitive + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: a9c30492da18ff84efe2422ba2d319a89942d93e58eb0b73d32abe822ef54b7b + url: "https://pub.dev" + source: hosted + version: "3.1.3" + diff_match_patch: + dependency: transitive + description: + name: diff_match_patch + sha256: "2efc9e6e8f449d0abe15be240e2c2a3bcd977c8d126cfd70598aee60af35c0a4" + url: "https://pub.dev" + source: hosted + version: "0.4.1" + equatable: + dependency: transitive + description: + name: equatable + sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b" + url: "https://pub.dev" + source: hosted + version: "2.0.8" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c + url: "https://pub.dev" + source: hosted + version: "2.1.5" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + firebase_app_check: + dependency: transitive + description: + name: firebase_app_check + sha256: "45f0d279ea7ae4eac1867a4c85aa225761e3ac0ccf646386a860b2bc16581f76" + url: "https://pub.dev" + source: hosted + version: "0.4.1+4" + firebase_app_check_platform_interface: + dependency: transitive + description: + name: firebase_app_check_platform_interface + sha256: e32b4e6adeaac207a6f7afe0906d97c0811de42fb200d9b6317a09155de65e2b + url: "https://pub.dev" + source: hosted + version: "0.2.1+4" + firebase_app_check_web: + dependency: transitive + description: + name: firebase_app_check_web + sha256: "2cbc8a18a34813a7e31d7b30f989973087421cd5d0e397b4dd88a90289aa2bed" + url: "https://pub.dev" + source: hosted + version: "0.2.2+2" + firebase_auth: + dependency: transitive + description: + name: firebase_auth + sha256: b20d1540460814c5984474c1e9dd833bdbcff6ecd8d6ad86cc9da8cfd581c172 + url: "https://pub.dev" + source: hosted + version: "6.1.4" + firebase_auth_platform_interface: + dependency: transitive + description: + name: firebase_auth_platform_interface + sha256: fd0225320b6bbc92460c86352d16b60aea15f9ef88292774cca97b0522ea9f72 + url: "https://pub.dev" + source: hosted + version: "8.1.6" + firebase_auth_web: + dependency: transitive + description: + name: firebase_auth_web + sha256: be7dccb263b89fbda2a564de9d8193118196e8481ffb937222a025cdfdf82c40 + url: "https://pub.dev" + source: hosted + version: "6.1.2" + firebase_core: + dependency: transitive + description: + name: firebase_core + sha256: "923085c881663ef685269b013e241b428e1fb03cdd0ebde265d9b40ff18abf80" + url: "https://pub.dev" + source: hosted + version: "4.4.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: cccb4f572325dc14904c02fcc7db6323ad62ba02536833dddb5c02cac7341c64 + url: "https://pub.dev" + source: hosted + version: "6.0.2" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "83e7356c704131ca4d8d8dd57e360d8acecbca38b1a3705c7ae46cc34c708084" + url: "https://pub.dev" + source: hosted + version: "3.4.0" + firebase_data_connect: + dependency: transitive + description: + name: firebase_data_connect + sha256: "01d0f8e33c520a6e6f59cf5ac6ff281d1927f7837f094fa8eb5fdb0b1b328ad8" + url: "https://pub.dev" + source: hosted + version: "0.2.2+2" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: transitive + description: + name: flutter_bloc + sha256: b594505eac31a0518bdcb4b5b79573b8d9117b193cc80cc12e17d639b10aa27a + url: "https://pub.dev" + source: hosted + version: "8.1.6" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" + url: "https://pub.dev" + source: hosted + version: "6.0.0" + flutter_localizations: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_modular: + dependency: transitive + description: + name: flutter_modular + sha256: "33a63d9fe61429d12b3dfa04795ed890f17d179d3d38e988ba7969651fcd5586" + url: "https://pub.dev" + source: hosted + version: "6.4.1" + flutter_test: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + font_awesome_flutter: + dependency: transitive + description: + name: font_awesome_flutter + sha256: b9011df3a1fa02993630b8fb83526368cf2206a711259830325bab2f1d2a4eb0 + url: "https://pub.dev" + source: hosted + version: "10.12.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + get_it: + dependency: transitive + description: + name: get_it + sha256: d85128a5dae4ea777324730dc65edd9c9f43155c109d5cc0a69cab74139fbac1 + url: "https://pub.dev" + source: hosted + version: "7.7.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + google_fonts: + dependency: transitive + description: + name: google_fonts + sha256: ca1cc501704c47e478f69a667d7f2d882755ddf7baad3f60c3b1256594467022 + url: "https://pub.dev" + source: hosted + version: "7.0.2" + google_identity_services_web: + dependency: transitive + description: + name: google_identity_services_web + sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454" + url: "https://pub.dev" + source: hosted + version: "0.3.3+1" + googleapis_auth: + dependency: transitive + description: + name: googleapis_auth + sha256: befd71383a955535060acde8792e7efc11d2fccd03dd1d3ec434e85b68775938 + url: "https://pub.dev" + source: hosted + version: "1.6.0" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + grpc: + dependency: transitive + description: + name: grpc + sha256: e93ee3bce45c134bf44e9728119102358c7cd69de7832d9a874e2e74eb8cab40 + url: "https://pub.dev" + source: hosted + version: "3.2.4" + hooks: + dependency: transitive + description: + name: hooks + sha256: "5410b9f4f6c9f01e8ff0eb81c9801ea13a3c3d39f8f0b1613cda08e27eab3c18" + url: "https://pub.dev" + source: hosted + version: "0.20.5" + http: + dependency: transitive + description: + name: http + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" + url: "https://pub.dev" + source: hosted + version: "1.6.0" + http2: + dependency: transitive + description: + name: http2 + sha256: "382d3aefc5bd6dc68c6b892d7664f29b5beb3251611ae946a98d35158a82bbfa" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + intl: + dependency: transitive + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + js: + dependency: transitive + description: + name: js + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + url: "https://pub.dev" + source: hosted + version: "0.7.2" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.dev" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + lints: + dependency: transitive + description: + name: lints + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 + url: "https://pub.dev" + source: hosted + version: "6.0.0" + logger: + dependency: transitive + description: + name: logger + sha256: a7967e31b703831a893bbc3c3dd11db08126fe5f369b5c648a36f821979f5be3 + url: "https://pub.dev" + source: hosted + version: "2.6.2" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + lucide_icons: + dependency: transitive + description: + name: lucide_icons + sha256: ad24d0fd65707e48add30bebada7d90bff2a1bba0a72d6e9b19d44246b0e83c4 + url: "https://pub.dev" + source: hosted + version: "0.257.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + melos: + dependency: "direct dev" + description: + name: melos + sha256: ff2da25990d83b0db883eb257e4fa25eb78150a329e7bfab7a379499d0f5f6f7 + url: "https://pub.dev" + source: hosted + version: "7.3.0" + meta: + dependency: transitive + description: + name: meta + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + url: "https://pub.dev" + source: hosted + version: "1.17.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mocktail: + dependency: transitive + description: + name: mocktail + sha256: "890df3f9688106f25755f26b1c60589a92b3ab91a22b8b224947ad041bf172d8" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + modular_core: + dependency: transitive + description: + name: modular_core + sha256: "1db0420a0dfb8a2c6dca846e7cbaa4ffeb778e247916dbcb27fb25aa566e5436" + url: "https://pub.dev" + source: hosted + version: "3.4.1" + mustache_template: + dependency: transitive + description: + name: mustache_template + sha256: "4326d0002ff58c74b9486990ccbdab08157fca3c996fe9e197aff9d61badf307" + url: "https://pub.dev" + source: hosted + version: "2.0.3" + native_toolchain_c: + dependency: transitive + description: + name: native_toolchain_c + sha256: f8872ea6c7a50ce08db9ae280ca2b8efdd973157ce462826c82f3c3051d154ce + url: "https://pub.dev" + source: hosted + version: "0.17.2" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "55eb67ede1002d9771b3f9264d2c9d30bc364f0267bc1c6cc0883280d5f0c7cb" + url: "https://pub.dev" + source: hosted + version: "9.2.2" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: f2c65e21139ce2c3dad46922be8272bb5963516045659e71bb16e151c93b580e + url: "https://pub.dev" + source: hosted + version: "2.2.22" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1" + url: "https://pub.dev" + source: hosted + version: "7.0.1" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + pool: + dependency: transitive + description: + name: pool + sha256: "978783255c543aa3586a1b3c21f6e9d720eb315376a915872c61ef8b5c20177d" + url: "https://pub.dev" + source: hosted + version: "1.5.2" + process: + dependency: transitive + description: + name: process + sha256: c6248e4526673988586e8c00bb22a49210c258dc91df5227d5da9748ecf79744 + url: "https://pub.dev" + source: hosted + version: "5.0.5" + prompts: + dependency: transitive + description: + name: prompts + sha256: "3773b845e85a849f01e793c4fc18a45d52d7783b4cb6c0569fad19f9d0a774a1" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + protobuf: + dependency: transitive + description: + name: protobuf + sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + provider: + dependency: transitive + description: + name: provider + sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272" + url: "https://pub.dev" + source: hosted + version: "6.1.5+1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + pub_updater: + dependency: transitive + description: + name: pub_updater + sha256: "739a0161d73a6974c0675b864fb0cf5147305f7b077b7f03a58fa7a9ab3e7e7d" + url: "https://pub.dev" + source: hosted + version: "0.5.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + rename: + dependency: transitive + description: + name: rename + sha256: da5f4d67f8c68f066ad04edfd6585495dbe595f2baf3b1999eb6af1805d79539 + url: "https://pub.dev" + source: hosted + version: "3.1.0" + result_dart: + dependency: transitive + description: + name: result_dart + sha256: "0666b21fbdf697b3bdd9986348a380aa204b3ebe7c146d8e4cdaa7ce735e6054" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + shared_preferences: + dependency: transitive + description: + name: shared_preferences + sha256: "2939ae520c9024cb197fc20dee269cd8cdbf564c8b5746374ec6cacdc5169e64" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "83af5c682796c0f7719c2bbf74792d113e40ae97981b8f266fa84574573556bc" + url: "https://pub.dev" + source: hosted + version: "2.4.18" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" + url: "https://pub.dev" + source: hosted + version: "2.5.6" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 + url: "https://pub.dev" + source: hosted + version: "1.1.3" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + slang: + dependency: transitive + description: + name: slang + sha256: "13e3b6f07adc51ab751e7889647774d294cbce7a3382f81d9e5029acfe9c37b2" + url: "https://pub.dev" + source: hosted + version: "4.12.0" + slang_build_runner: + dependency: transitive + description: + name: slang_build_runner + sha256: "453d74b5430153a3c4150d5ba8f6380e0785f3939f7511f10ac5b6cf9bb7d2a7" + url: "https://pub.dev" + source: hosted + version: "4.12.0" + slang_flutter: + dependency: transitive + description: + name: slang_flutter + sha256: "0a4545cca5404d6b7487cf61cf1fe56c52daeb08de56a7574ee8381fbad035a0" + url: "https://pub.dev" + source: hosted + version: "4.12.0" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b + url: "https://pub.dev" + source: hosted + version: "2.1.2" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" + url: "https://pub.dev" + source: hosted + version: "0.10.13" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + staff_attire: + dependency: transitive + description: + path: "packages/features/staff/profile_sections/onboarding/attire" + relative: true + source: path + version: "0.0.1" + staff_bank_account: + dependency: transitive + description: + path: "packages/features/staff/profile_sections/finances/staff_bank_account" + relative: true + source: path + version: "0.0.1" + staff_certificates: + dependency: transitive + description: + path: "packages/features/staff/profile_sections/compliance/certificates" + relative: true + source: path + version: "0.0.1" + staff_documents: + dependency: transitive + description: + path: "packages/features/staff/profile_sections/compliance/documents" + relative: true + source: path + version: "0.0.1" + staff_payments: + dependency: transitive + description: + path: "packages/features/staff/payments" + relative: true + source: path + version: "0.0.1" + staff_shifts: + dependency: transitive + description: + path: "packages/features/staff/shifts" + relative: true + source: path + version: "0.0.1" + staff_tax_forms: + dependency: transitive + description: + path: "packages/features/staff/profile_sections/compliance/tax_forms" + relative: true + source: path + version: "0.0.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test: + dependency: transitive + description: + name: test + sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7" + url: "https://pub.dev" + source: hosted + version: "1.26.3" + test_api: + dependency: transitive + description: + name: test_api + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + url: "https://pub.dev" + source: hosted + version: "0.7.7" + test_core: + dependency: transitive + description: + name: test_core + sha256: "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0" + url: "https://pub.dev" + source: hosted + version: "0.6.12" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + url_launcher: + dependency: transitive + description: + name: url_launcher + sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8 + url: "https://pub.dev" + source: hosted + version: "6.3.2" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "767344bf3063897b5cf0db830e94f904528e6dd50a6dfaf839f0abf509009611" + url: "https://pub.dev" + source: hosted + version: "6.3.28" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: cfde38aa257dae62ffe79c87fab20165dfdf6988c1d31b58ebf59b9106062aad + url: "https://pub.dev" + source: hosted + version: "6.3.6" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: d5e14138b3bc193a0f63c10a53c94b91d399df0512b1f29b94a043db7482384a + url: "https://pub.dev" + source: hosted + version: "3.2.2" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: "368adf46f71ad3c21b8f06614adb38346f193f3a59ba8fe9a2fd74133070ba18" + url: "https://pub.dev" + source: hosted + version: "3.2.5" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: d0412fcf4c6b31ecfdb7762359b7206ffba3bbffd396c6d9f9c4616ece476c1f + url: "https://pub.dev" + source: hosted + version: "2.4.2" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "712c70ab1b99744ff066053cbe3e80c73332b38d46e5e945c98689b2e66fc15f" + url: "https://pub.dev" + source: hosted + version: "3.1.5" + uuid: + dependency: transitive + description: + name: uuid + sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8 + url: "https://pub.dev" + source: hosted + version: "4.5.2" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" + source: hosted + version: "15.0.2" + watcher: + dependency: transitive + description: + name: watcher + sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: "971043b3a0d3da28727e40ed3e0b5d18b742fa5a68665cca88e74b7876d5e025" + url: "https://pub.dev" + source: hosted + version: "6.6.1" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" + yaml_edit: + dependency: transitive + description: + name: yaml_edit + sha256: ec709065bb2c911b336853b67f3732dd13e0336bd065cc2f1061d7610ddf45e3 + url: "https://pub.dev" + source: hosted + version: "2.2.3" +sdks: + dart: ">=3.10.7 <4.0.0" + flutter: ">=3.38.4" diff --git a/apps/mobile/pubspec.yaml b/apps/mobile/pubspec.yaml new file mode 100644 index 00000000..0d3eba1a --- /dev/null +++ b/apps/mobile/pubspec.yaml @@ -0,0 +1,97 @@ +name: flutter_melos_modular_scaffold +publish_to: 'none' +description: "A sample project using melos and modular scaffold." +environment: + sdk: '>=3.10.0 <4.0.0' +workspace: + - packages/design_system + - packages/core + - packages/domain + - packages/data_connect + - packages/core_localization + - packages/features/staff/authentication + - packages/features/staff/home + - packages/features/staff/staff_main + - packages/features/staff/profile + - packages/features/staff/profile_sections/onboarding/emergency_contact + - packages/features/staff/profile_sections/onboarding/experience + - packages/features/staff/profile_sections/onboarding/profile_info + - packages/features/client/authentication + - packages/features/client/home + - packages/features/client/settings + - packages/features/client/hubs + - packages/features/client/create_order + - packages/features/client/view_orders + - packages/features/client/client_main + - apps/staff + - apps/client + - apps/design_system_viewer + +dev_dependencies: + melos: ^7.3.0 + flutter_lints: ^6.0.0 + +melos: + scripts: + info: + run: | + echo " πŸš€ KROW WORKFORCE CUSTOM COMMANDS πŸš€" + echo "============================================================" + echo " BUILD COMMANDS:" + echo " - melos run build:client : Build Client App (APK)" + echo " - melos run build:staff : Build Staff App (APK)" + echo " - melos run build:design-system : Build Design System Viewer" + echo "" + echo " DEBUG/START COMMANDS:" + echo " - melos run start:client -- -d : Run Client App" + echo " - melos run start:staff -- -d : Run Staff App" + echo " - melos run start:design-system : Run DS Viewer" + echo " (e.g., melos run start:client -- -d chrome)" + echo "" + echo " CODE GENERATION:" + echo " - melos run gen:l10n : Generate Slang l10n" + echo " - melos run gen:build : Run build_runner" + echo "============================================================" + description: "Display information about available custom Melos commands." + + gen:l10n: + exec: dart run slang + description: "Generate localization files using Slang across all packages." + packageFilters: + dependsOn: slang + + gen:build: + exec: dart run build_runner build --delete-conflicting-outputs + description: "Run build_runner build across all packages." + packageFilters: + dependsOn: build_runner + + build:client: + run: | + melos run gen:l10n --filter="core_localization" + melos run gen:build --filter="core_localization" + melos exec --scope="krowwithus_client" -- "flutter build apk" + description: "Build the Client app (Android APK by default)." + + build:staff: + run: | + melos run gen:l10n --filter="core_localization" + melos run gen:build --filter="core_localization" + melos exec --scope="krowwithus_staff" -- "flutter build apk" + description: "Build the Staff app (Android APK by default)." + + build:design-system: + run: melos exec --scope="design_system_viewer" -- "flutter build apk" + description: "Build the Design System Viewer app (Android APK by default)." + + start:client: + run: melos exec --scope="krowwithus_client" -- "flutter run" + description: "Start the Client app. Pass platform using -- -d , e.g. -d chrome" + + start:staff: + run: melos exec --scope="krowwithus_staff" -- "flutter run" + description: "Start the Staff app. Pass platform using -- -d , e.g. -d chrome" + + start:design-system: + run: melos exec --scope="design_system_viewer" -- "flutter run" + description: "Start the Design System Viewer app. Pass platform using -- -d , e.g. -d chrome" diff --git a/backend/dataconnect/connector/application/queries.gql b/backend/dataconnect/connector/application/queries.gql index 5e060ffd..6de03a97 100644 --- a/backend/dataconnect/connector/application/queries.gql +++ b/backend/dataconnect/connector/application/queries.gql @@ -302,3 +302,57 @@ query getApplicationsByStaffId( } } + +#getting staffs of an shiftrole ACCEPTED for orders view client +query listAcceptedApplicationsByShiftRoleKey( + $shiftId: UUID! + $roleId: UUID! + $offset: Int + $limit: Int +) @auth(level: USER) { + applications( + where: { + shiftId: { eq: $shiftId } + roleId: { eq: $roleId } + status: { eq: ACCEPTED } + } + offset: $offset + limit: $limit + orderBy: { appliedAt: ASC } + ) { + id + checkInTime + checkOutTime + staff { id fullName email phone photoUrl } + } +} + +#getting staffs of an shiftrole ACCEPTED for orders of the day view client +query listAcceptedApplicationsByBusinessForDay( + $businessId: UUID! + $dayStart: Timestamp! + $dayEnd: Timestamp! + $offset: Int + $limit: Int +) @auth(level: USER) { + applications( + where: { + status: { eq: ACCEPTED } + shift: { + date: { ge: $dayStart, le: $dayEnd } + order: { businessId: { eq: $businessId } } + } + } + offset: $offset + limit: $limit + orderBy: { appliedAt: ASC } + ) { + id + shiftId + roleId + checkInTime + checkOutTime + appliedAt + staff { id fullName email phone photoUrl } + } +} diff --git a/backend/dataconnect/connector/connector.yaml b/backend/dataconnect/connector/connector.yaml index a2aae747..1cf85dcd 100644 --- a/backend/dataconnect/connector/connector.yaml +++ b/backend/dataconnect/connector/connector.yaml @@ -1,7 +1,5 @@ connectorId: example generate: dartSdk: - - outputDir: ../../../apps/mobile-client/lib/dataconnect_generated - package: dataconnect_generated/generated.dart - - outputDir: ../../../apps/mobile-staff/lib/dataconnect_generated + - outputDir: ../../../apps/mobile/packages/data_connect/lib/src/dataconnect_generated package: dataconnect_generated/generated.dart diff --git a/backend/dataconnect/connector/order/mutations.gql b/backend/dataconnect/connector/order/mutations.gql index 4016d2ab..be3ec3f6 100644 --- a/backend/dataconnect/connector/order/mutations.gql +++ b/backend/dataconnect/connector/order/mutations.gql @@ -1,5 +1,5 @@ mutation createOrder( - $vendorId: UUID! + $vendorId: UUID $businessId: UUID! $orderType: OrderType! $location: String @@ -55,6 +55,7 @@ mutation updateOrder( $businessId: UUID $location: String $status: OrderStatus + $date: Timestamp $startDate: Timestamp $endDate: Timestamp $total: Float @@ -76,6 +77,7 @@ mutation updateOrder( businessId: $businessId location: $location status: $status + date: $date startDate: $startDate endDate: $endDate total: $total diff --git a/backend/dataconnect/connector/shiftRole/queries.gql b/backend/dataconnect/connector/shiftRole/queries.gql index 9dabe0cb..e377fbca 100644 --- a/backend/dataconnect/connector/shiftRole/queries.gql +++ b/backend/dataconnect/connector/shiftRole/queries.gql @@ -293,3 +293,145 @@ query listShiftRolesByVendorId( } } } + +#orders view client +query listShiftRolesByBusinessAndDateRange( + $businessId: UUID! + $start: Timestamp! + $end: Timestamp! + $offset: Int + $limit: Int +) @auth(level: USER) { + shiftRoles( + where: { + shift: { + date: { ge: $start, le: $end } + order: { businessId: { eq: $businessId } } + } + } + offset: $offset + limit: $limit + orderBy: { createdAt: DESC } + ) { + shiftId + roleId + count + assigned + hours + startTime + endTime + totalValue + role { id name } + shift { + id + date + location + locationAddress + title + status + order { id } + } + } +} + +#list shiftsroles for update order in client app +query listShiftRolesByBusinessAndOrder( + $businessId: UUID! + $orderId: UUID! + $offset: Int + $limit: Int +) @auth(level: USER) { + shiftRoles( + where: { + shift: { + orderId: { eq: $orderId } + order: { businessId: { eq: $businessId } } + } + } + offset: $offset + limit: $limit + orderBy: { createdAt: DESC } + ) { + id + shiftId + roleId + count + assigned + startTime + endTime + hours + breakType + totalValue + createdAt + + role { id name costPerHour } + + shift { + id + title + date + orderId + location + locationAddress + + order{ + vendorId + date + location + } + } + } +} + +#reorder get list by businessId +query listShiftRolesByBusinessDateRangeCompletedOrders( + $businessId: UUID! + $start: Timestamp! + $end: Timestamp! + $offset: Int + $limit: Int +) @auth(level: USER) { + shiftRoles( + where: { + shift: { + date: { ge: $start, le: $end } + order: { + businessId: { eq: $businessId } + status: { eq: COMPLETED } + } + } + } + offset: $offset + limit: $limit + orderBy: { createdAt: DESC } + ) { + shiftId + roleId + count + assigned + hours + startTime + endTime + totalValue + + role { + id + name + costPerHour + } + + shift { + id + date + location + locationAddress + title + status + + order { + id + orderType + } + } + } +} diff --git a/backend/dataconnect/connector/team/mutations.gql b/backend/dataconnect/connector/team/mutations.gql index 2f29e088..70c87e5a 100644 --- a/backend/dataconnect/connector/team/mutations.gql +++ b/backend/dataconnect/connector/team/mutations.gql @@ -1,6 +1,6 @@ mutation createTeam( $teamName: String! - $ownerId: String! + $ownerId: UUID! $ownerName: String! $ownerRole: String! $email: String diff --git a/backend/dataconnect/connector/team/queries.gql b/backend/dataconnect/connector/team/queries.gql index 63fd2771..85ac4764 100644 --- a/backend/dataconnect/connector/team/queries.gql +++ b/backend/dataconnect/connector/team/queries.gql @@ -44,7 +44,7 @@ query getTeamById($id: UUID!) @auth(level: USER) { } } -query getTeamsByOwnerId($ownerId: String!) @auth(level: USER) { +query getTeamsByOwnerId($ownerId: UUID!) @auth(level: USER) { teams(where: { ownerId: { eq: $ownerId } }) { id teamName diff --git a/backend/dataconnect/connector/teamHub/mutations.gql b/backend/dataconnect/connector/teamHub/mutations.gql index b145c46f..38542c35 100644 --- a/backend/dataconnect/connector/teamHub/mutations.gql +++ b/backend/dataconnect/connector/teamHub/mutations.gql @@ -2,10 +2,10 @@ mutation createTeamHub( $teamId: UUID! $hubName: String! $address: String! - $city: String! - $state: String! - $zipCode: String! - $managerName: String! + $city: String + $state: String + $zipCode: String + $managerName: String $isActive: Boolean $departments: Any ) @auth(level: USER) { diff --git a/backend/dataconnect/connector/teamHub/queries.gql b/backend/dataconnect/connector/teamHub/queries.gql index 240a17b1..697b50c3 100644 --- a/backend/dataconnect/connector/teamHub/queries.gql +++ b/backend/dataconnect/connector/teamHub/queries.gql @@ -56,7 +56,7 @@ query getTeamHubsByTeamId($teamId: UUID!) @auth(level: USER) { # LIST TEAM HUBS BY OWNER (Vendor/Business) # ------------------------------------------------------------ query listTeamHubsByOwnerId( - $ownerId: String! + $ownerId: UUID! ) @auth(level: USER) { teamHubs( where: { diff --git a/backend/dataconnect/schema/order.gql b/backend/dataconnect/schema/order.gql index 3ce96cae..c0db5d79 100644 --- a/backend/dataconnect/schema/order.gql +++ b/backend/dataconnect/schema/order.gql @@ -26,8 +26,8 @@ type Order @table(name: "orders") { id: UUID! @default(expr: "uuidV4()") eventName: String - vendorId: UUID! - vendor: Vendor! @ref(fields: "vendorId", references: "id") + vendorId: UUID + vendor: Vendor @ref(fields: "vendorId", references: "id") businessId: UUID! business: Business! @ref(fields: "businessId", references: "id") diff --git a/backend/dataconnect/schema/team.gql b/backend/dataconnect/schema/team.gql index e747e6b5..ccfb2d8a 100644 --- a/backend/dataconnect/schema/team.gql +++ b/backend/dataconnect/schema/team.gql @@ -3,7 +3,7 @@ type Team @table(name: "teams") { id: UUID! @default(expr: "uuidV4()") teamName: String! - ownerId: String! #vendor/business + ownerId: UUID! #vendor/business ownerName: String! ownerRole: String! email: String diff --git a/backend/dataconnect/schema/teamHub.gql b/backend/dataconnect/schema/teamHub.gql index fada65a5..a206a6fd 100644 --- a/backend/dataconnect/schema/teamHub.gql +++ b/backend/dataconnect/schema/teamHub.gql @@ -6,10 +6,10 @@ type TeamHub @table(name: "team_hubs") { hubName: String! address: String! - city: String! - state: String! - zipCode: String! - managerName: String! + city: String + state: String + zipCode: String + managerName: String isActive: Boolean! @default(expr: "true") departments: Any diff --git a/docs/05-project-onboarding-master.md b/docs/05-project-onboarding-master.md index 723e5444..31eab15a 100644 --- a/docs/05-project-onboarding-master.md +++ b/docs/05-project-onboarding-master.md @@ -1,7 +1,7 @@ # KROW Workforce Platform - Project Onboarding Master Document -> **Version:** 1.0 -> **Last Updated:** 2026-01-11 +> **Version:** 1.1 +> **Last Updated:** 2026-01-22 > **Purpose:** Source of Truth for Team Onboarding & Sprint Planning --- @@ -173,7 +173,7 @@ graph TB β”‚ β”œβ”€β”€ mobile/ | | β”œβ”€β”€ apps/ | | β”‚ β”œβ”€β”€ client/ # Flutter (business app) - | | β”‚ └── worker/ # Flutter (worker app) + | | β”‚ └── staff/ # Flutter (staff app) β”œβ”€β”€ backend/ β”‚ β”œβ”€β”€ dataconnect/ # Firebase Data Connect schemas β”‚ └── functions/ # Cloud Functions @@ -312,7 +312,7 @@ sequenceDiagram participant Client as Client App participant API as Backend API participant Admin as Admin - participant Staff as Worker App + participant Staff as Staff App Note over Client,API: 1. Event Creation Client->>API: Create Event with Shifts & Positions @@ -706,9 +706,9 @@ These **must be ported** from legacy: --- -#### 4.7.2 Mobile Worker App (Flutter) +#### 4.7.2 Mobile Staff App (Flutter) -**Location:** `internal/launchpad/prototypes-src/mobile/apps/worker/` +**Location:** `internal/launchpad/prototypes-src/mobile/apps/staff/` **Routes (35+ screens):** diff --git a/makefiles/mobile.mk b/makefiles/mobile.mk index e7d70b4a..d7797efb 100644 --- a/makefiles/mobile.mk +++ b/makefiles/mobile.mk @@ -1,68 +1,46 @@ # --- Mobile App Development --- -.PHONY: mobile-client-install mobile-client-dev mobile-client-build mobile-staff-install mobile-staff-dev mobile-staff-build +.PHONY: mobile-install mobile-info mobile-client-dev-android mobile-staff-dev-android mobile-client-build mobile-staff-build -FLAVOR := -ifeq ($(ENV),dev) - FLAVOR := dev -else ifeq ($(ENV),staging) - FLAVOR := staging -else ifeq ($(ENV),prod) - FLAVOR := production -endif +MOBILE_DIR := apps/mobile -BUILD_TYPE ?= appbundle +# --- General --- +mobile-install: install-melos + @echo "--> Bootstrapping mobile workspace (Melos)..." + @cd $(MOBILE_DIR) && melos bootstrap + @echo "--> Generating localization files..." + @cd $(MOBILE_DIR) && melos run gen:l10n + +mobile-info: + @echo "--> Fetching mobile command info..." + @cd $(MOBILE_DIR) && melos run info # --- Client App --- -mobile-client-install: - @echo "--> Installing Flutter dependencies for client app..." - @cd apps/mobile-client && $(FLUTTER) pub get - -mobile-client-dev: - @echo "--> Running client app in dev mode..." - @echo "--> If using VS code, use the debug configurations" - @cd apps/mobile-client && $(FLUTTER) run --flavor dev -t lib/main_dev.dart +mobile-client-dev-android: + @echo "--> Running client app on Android..." + @cd $(MOBILE_DIR) && melos run start:client -- -d android mobile-client-build: - @if [ "$(ENV)" != "dev" ] && [ "$(ENV)" != "staging" ] && [ "$(ENV)" != "prod" ]; then \ - echo "ERROR: ENV must be one of dev, staging, or prod."; exit 1; \ + @if [ -z "$(PLATFORM)" ]; then \ + echo "ERROR: PLATFORM is required (e.g. make mobile-client-build PLATFORM=apk)"; exit 1; \ fi - @if [ "$(PLATFORM)" != "android" ] && [ "$(PLATFORM)" != "ios" ]; then \ - echo "ERROR: PLATFORM must be either android or ios."; exit 1; \ - fi - @echo "--> Building client app for $(PLATFORM) with flavor $(FLAVOR)..." - @cd apps/mobile-client && \ - $(FLUTTER) pub get && \ - $(FLUTTER) pub run build_runner build --delete-conflicting-outputs && \ - if [ "$(PLATFORM)" = "android" ]; then \ - $(FLUTTER) build $(BUILD_TYPE) --flavor $(FLAVOR); \ - elif [ "$(PLATFORM)" = "ios" ]; then \ - $(FLUTTER) build ipa --flavor $(FLAVOR); \ - fi + @echo "--> Building client app for $(PLATFORM)..." + @cd $(MOBILE_DIR) && \ + melos run gen:l10n --filter="core_localization" && \ + melos run gen:build --filter="core_localization" && \ + melos exec --scope="krowwithus_client" -- "flutter build $(PLATFORM)" # --- Staff App --- -mobile-staff-install: - @echo "--> Installing Flutter dependencies for staff app..." - @cd apps/mobile-staff && $(FLUTTER) pub get - -mobile-staff-dev: - @echo "--> Running staff app in dev mode..." - @echo "--> If using VS code, use the debug configurations" - @cd apps/mobile-staff && $(FLUTTER) run --flavor dev -t lib/main_dev.dart +mobile-staff-dev-android: + @echo "--> Running staff app on Android..." + @cd $(MOBILE_DIR) && melos run start:staff -- -d android mobile-staff-build: - @if [ "$(ENV)" != "dev" ] && [ "$(ENV)" != "staging" ] && [ "$(ENV)" != "prod" ]; then \ - echo "ERROR: ENV must be one of dev, staging, or prod."; exit 1; \ + @if [ -z "$(PLATFORM)" ]; then \ + echo "ERROR: PLATFORM is required (e.g. make mobile-staff-build PLATFORM=apk)"; exit 1; \ fi - @if [ "$(PLATFORM)" != "android" ] && [ "$(PLATFORM)" != "ios" ]; then \ - echo "ERROR: PLATFORM must be either android or ios."; exit 1; \ - fi - @echo "--> Building staff app for $(PLATFORM) with flavor $(FLAVOR)..." - @cd apps/mobile-staff && \ - $(FLUTTER) pub get && \ - $(FLUTTER) pub run build_runner build --delete-conflicting-outputs && \ - if [ "$(PLATFORM)" = "android" ]; then \ - $(FLUTTER) build $(BUILD_TYPE) --flavor $(FLAVOR); \ - elif [ "$(PLATFORM)" = "ios" ]; then \ - $(FLUTTER) build ipa --flavor $(FLAVOR); \ - fi + @echo "--> Building staff app for $(PLATFORM)..." + @cd $(MOBILE_DIR) && \ + melos run gen:l10n --filter="core_localization" && \ + melos run gen:build --filter="core_localization" && \ + melos exec --scope="krowwithus_staff" -- "flutter build $(PLATFORM)" diff --git a/makefiles/tools.mk b/makefiles/tools.mk index 68f1f83a..fefe0468 100644 --- a/makefiles/tools.mk +++ b/makefiles/tools.mk @@ -1,6 +1,14 @@ # --- Development Tools --- -.PHONY: install-git-hooks sync-prototypes +.PHONY: install-git-hooks sync-prototypes install-melos + +install-melos: + @if ! command -v melos >/dev/null 2>&1; then \ + echo "--> Melos not found. Installing globally via dart pub..."; \ + dart pub global activate melos; \ + else \ + echo "βœ… Melos is already installed."; \ + fi install-git-hooks: @echo "--> Installing Git hooks..."