## Recommended tasks for the next sprint


* In the mobile applications, since the structure is now finalized (at least for the existing features), we need to **strictly follow best practices while coding**:
  * Break down large widgets into **smaller, reusable widgets**
  * Add **doc comments** where necessary to improve readability and maintainability
  * **Remove overly complicated or unnecessary logic** introduced by AI and simplify where possible
* Improvement points
- apps/mobile/packages/features/client/client_coverage/lib/src/data/repositories_impl/coverage_repository_impl.dart
  - Fix the location field in CoverageShiftRole to use the correct fallback logic.
  - line 125 remove redundant location values.

- Change the name of the dataconnect connector replacing the "ExampleConnecter" with "KrowConnecter" 

- `  final String status;` in `OrderItem` make it an enum.
-  /// Date of the shift (ISO format).
  final String date; make this in the DateTime format instead of string.

- in `view_orders_cubit.dart` combine the logic of `_calculateUpNextCount ` and `_calculateTodayCount` into a single function that calculates both counts together to avoid redundant filtering of orders.
- In places api call in the when the api's not working we need to show a proper error message instead of just an empty list.
- pending should come first in the view order list.




- How to check if the shift can be accepted by a worker?
  - if a shift is already accepted in that time

- track minimum shift hours in the staff profile and show a warning if they try to apply for shifts that are below their minimum hours.
  - this need to be added in the BE and also a FE validation (5 hrs).

- Cannot cancel before 24 hours of the shift start time. If do we should charge for 4 hours of work for each shifts.

- verify the order creation process in the client app.
  - Vendor don't need to verify the order, when the order is created it should be automatically published.
  - rethink the order status, we need to simplify it.

- Validation layer
  - Profile info
  - emergency contact
  - experiences
  - attires
    - there should be manual verification by the client even if the ai verification is passed.
    - to track false positives and false negatives.
  - certifications
    - there should be manual verification by the client even if the ai verification is passed.
    - to track false positives and false negatives.
  - documents
  - tax forms

- How do we handle the current bank account verifcaiton in the current legacy application.
- We need have a show a list of clothing items in the staff app -> shift page.
- Template models for the pdf reports in the client and web apps.
- remove `any` type and replace it with the correct types in the codebase.


- What is the worker signup process







# Developement Tasks

## BE
- Shift acceptance validation by a worker
  - How do we check if a shift can be accepted by a worker?
    - if a shift is already accepted in that time
    - we need to prevent accepting overlapping shifts.
    - Make the alogrithm sclable which enables to add future rules for shift acceptance.
    - This validation should be done in BE.
- Shift creation validation by a client
  - Implement validation logic to ensure that shifts created by clients meet certain criteria
  - This validation should be done in BE.
  - CURRENTLY only add a Soft check for minimum shift hours when creating an order by a client
    - When a client is creating an order, we need to check if the shift hours are below the minimum hours set by the vendor.
    - This validation should be done in BE and also a FE validation
    - Current minimum hours is 5 hrs.
  - Make the alogrithm sclable which enables to add future rules for shift acceptance.
- Cancellation policy enforcement
  - Implement logic to prevent cancellations within 24 hours of shift start time.
  - If a cancellation is attempted within this window
   - We need to finalise the penalty for this cancellation.
- Documentation upload process
    - Implement a secure and efficient process for workers to upload required documentation (e.g., certifications, tax forms).
    - Ensure that the uploaded documents are properly stored and linked to the worker's profile.
- Documentation parsing
  - Implement a system to parse and extract relevant information from uploaded documents (e.g., certifications, tax forms) for verification purposes.
  - there should be manual verification by the client even if the ai verification is passed.
- Attire upload
    - Implement a system for workers to upload images of their attire for verification purposes.
- Attire verification
    - Implement a system to verify the uploaded attire images against the required dress code for shifts.
    - there should be manual verification by the client even if the ai verification is passed.
- Shift that require "awaiting confirmation" status
  - Implement logic to handle shifts that require "awaiting confirmation" status, where the worker needs to manually confirm the shift before it becomes active.
- Enable NFC-based clock-in and clock-out functionality for staff members, allowing them to easily record their attendance using NFC technology (BE tasks).
- Enable worker profile visibility, where the worker's can hide their profile from clients if they choose to, and implement the necessary logic to handle profile visibility settings (BE tasks).
- Rapid order parsing (voice and text) using AI, allowing clients to quickly create orders by simply describing their needs, and implementing the necessary logic to parse and interpret the client's input to create accurate orders (BE tasks)
  - This is always mapped similar to one time order creation.

## FE

### Staff mobile application
- Show google maps location in the shift details page in the woker app.
- Add a requirment section in the shift details page in the worker app which shows the requirements for that shift.
- Attire screen
  - Show the list of MUST HAVE attire items.
  - Show the list of NICE TO HAVE attire items.
  - Allow workers to upload images of their attire for verification purposes.
  - Show the list of uploaded attire images in the worker profile.
- FAQ screen in the worker app.
- Privacy and Security screen in the worker app.
  - Profile visbility setting
  - Terms of services (For now use a generated one but we need to have a proper one for the launch)
  - Privacy policy (For now use a generated one but we need to have a proper one for the launch)

### Client mobile application
- Implement the remaining order types
 - Rapid order creation using voicd and text input, allowing clients to quickly create orders by simply describing their needs, and implementing the necessary UI and logic to parse and interpret the client's input to create accurate orders (FE tasks).
   - After parsing this should be populated in the screen similar to one time order creation screen where the client can make any necessary adjustments before finalising the order.
   - This is always mapped similar to one time order creation as this only handles same day orders.

# Research Tasks
- How do we validate the SSN number of a worker in the US?
  - Research third-party services or APIs that provide SSN validation.
  - Evaluate the cost, reliability, and ease of integration of these services.
  - Plan the integration process and identify any potential challenges.
- How do we validate the bank account details of a worker in the US?
  - Research third-party services or APIs that provide bank account validation.
  - Evaluate the cost, reliability, and ease of integration of these services.
  - Plan the integration process and identify any potential challenges.
  - In the legacy application we are only using soft FE checks but we need to have a proper validation process.
- What are the payment platforms we want to integrate for processing payments to workers?
  - Research popular payment platforms (e.g., Stripe, PayPal, Square) that support payouts to workers.
  - Evaluate the cost, reliability, and ease of integration of these platforms.
  - Plan the integration process and identify any potential challenges.
- Implement test cases for 2 features in the web dashboard to be run in the agent browser (https://agent-browser.dev/)
  - Research how to implement test cases for web applications using the agent browser.


# Business Tasks
- Create a template models for the pdf reports in the client and web apps.
- How do we handle situations like
  - If a worker is a no-show for a shift.
  - If the certain shifts are not getting enough applicants.
  - These situtations hevaly disadvantages the clients and we need to have a clear policy on how to handle these situations.
- Terms of service and privacy policy for the mobile applications.
- How to handle the data request from worker side.
- Having a discussion about rephrasing certain termeniologies in the application
  - Meaning of the worker registration process, is it signup or onboarding, because we are not doing a proper signup process where the worker can create an account by themselves, instead we are doing an onboarding process where the worker needs to provide their phone number and then we create an account for them and send them the OTP to login, as they should be already attached to a vendor when they are providing their phone number, we can consider this as an onboarding process rather than a signup process.
  - Meaning of the worker profile visibility, is it "profile visibility" or "availability status", because the worker is not making their profile completely invisible to the clients, instead they are just marking themselves as unavailable for work, so we can consider this as "availability status" rather than "profile visibility".


- Meaning of the the auto match ?
  - Shouldn't we do this any way ?
  - Is this only a marketing item ?


- Validation layer
  - Profile info
  - emergency contact
  - experiences
  - attires
    - there should be manual verification by the client even if the ai verification is passed.
    - to track false positives and false negatives.
  - certifications
    - there should be manual verification by the client even if the ai verification is passed.
    - to track false positives and false negatives.
  - documents
  - tax forms

- We need have a show a list of clothing items in the staff app -> shift page.
