Implementation of the backend data model for the supplierOrders #159

Merged
GFMpt13 merged 2 commits from data-model-for-supplierOrders into main 2025-12-11 12:35:56 +00:00
GFMpt13 commented 2025-12-06 17:49:47 +00:00 (Migrated from github.com)

This data model was based on the documentation recently updated in #152 that was not yet review. With that in mind, any changes required in the base structure of supplierOrders will also need to be updated in the file models\supplier_order.py

Closes #158

This data model was based on the documentation recently updated in #152 that was not yet review. With that in mind, any changes required in the base structure of supplierOrders will also need to be updated in the file models\supplier_order.py Closes #158
AndreFerreira5 (Migrated from github.com) reviewed 2025-12-06 17:49:47 +00:00
duarteneves5 (Migrated from github.com) reviewed 2025-12-06 17:49:47 +00:00
vascodias23 (Migrated from github.com) reviewed 2025-12-06 17:49:47 +00:00
JoaoTF03 (Migrated from github.com) reviewed 2025-12-06 17:49:47 +00:00
miguelmiranda20 (Migrated from github.com) requested changes 2025-12-07 18:45:07 +00:00
miguelmiranda20 (Migrated from github.com) left a comment

The Pydantic models and DTO structure look good, but the database index definitions require changes to ensure performance and consistency with the database setup script.

  1. Sparse Index for workOrderId: The index for workOrderId must be sparse. Since this field is optional, a standard index will index all null values, wasting resources. This is a mandatory requirement to match the behavior defined in the DB setup script.

  2. Centralize Index Definitions: Defining indexes in two places (inline with Annotated and inside Settings) causes redundancy. You must remove the inline Indexed() wrappers and define all indexes centrally in the Settings class to support the required sparse option properly.

The Pydantic models and DTO structure look good, but the database index definitions require changes to ensure performance and consistency with the database setup script. 1. Sparse Index for workOrderId: The index for workOrderId must be sparse. Since this field is optional, a standard index will index all null values, wasting resources. This is a mandatory requirement to match the behavior defined in the DB setup script. 2. Centralize Index Definitions: Defining indexes in two places (inline with Annotated and inside Settings) causes redundancy. You must remove the inline Indexed() wrappers and define all indexes centrally in the Settings class to support the required sparse option properly.
GFMpt13 commented 2025-12-11 11:46:12 +00:00 (Migrated from github.com)

Fixed both required changes @miguelmiranda20

Fixed both required changes @miguelmiranda20
miguelmiranda20 (Migrated from github.com) approved these changes 2025-12-11 12:33:43 +00:00
miguelmiranda20 (Migrated from github.com) left a comment

Looks good! Ready to merge

Looks good! Ready to merge
Sign in to join this conversation.
No description provided.