Updated documentation and db script with the supplierOrders Collection #152

Merged
GFMpt13 merged 2 commits from supplierOrders-Collection-docs-update into main 2025-12-11 12:35:28 +00:00
GFMpt13 commented 2025-12-05 17:26:10 +00:00 (Migrated from github.com)

Added the supplierOrders Collection in aligment to the discussion in the last meeting.

Would appreciate the review of the overall state of the collections by @Cordeir01 and @miguelmiranda20 to ensure that a problem/missing something don't happen again. Thanks

Added the supplierOrders Collection in aligment to the discussion in the last meeting. Would appreciate the review of the overall state of the collections by @Cordeir01 and @miguelmiranda20 to ensure that a problem/missing something don't happen again. Thanks
AndreFerreira5 (Migrated from github.com) reviewed 2025-12-05 17:26:10 +00:00
Cordeir01 (Migrated from github.com) reviewed 2025-12-05 17:26:10 +00:00
miguelmiranda20 commented 2025-12-07 18:13:37 +00:00 (Migrated from github.com)

The implementation looks solid and the documentation is up to date.

The implementation looks solid and the documentation is up to date.
miguelmiranda20 (Migrated from github.com) approved these changes 2025-12-07 18:14:46 +00:00
miguelmiranda20 (Migrated from github.com) requested changes 2025-12-07 18:33:37 +00:00
miguelmiranda20 (Migrated from github.com) left a comment

Regarding the index definition on line 471:

The code comment mentions a "Sparse index", but createIndex creates a standard index by default. This means MongoDB will index every document where workOrderId is null, which consumes unnecessary resources given that this field is optional.

To fix this and ensure we save memory on internal orders (as per the ticket requirements), please add the { sparse: true } option:

// Suggested change:
db.supplierOrders.createIndex({ workOrderId: 1 }, { sparse: true });

Regarding the index definition on **line 471**: The code comment mentions a "Sparse index", but `createIndex` creates a standard index by default. This means MongoDB will index every document where `workOrderId` is `null`, which consumes unnecessary resources given that this field is optional. To fix this and ensure we save memory on internal orders (as per the ticket requirements), please add the `{ sparse: true }` option: // Suggested change: db.supplierOrders.createIndex({ workOrderId: 1 }, { sparse: true });
GFMpt13 commented 2025-12-11 11:30:27 +00:00 (Migrated from github.com)

Fixed @miguelmiranda20

Fixed @miguelmiranda20
miguelmiranda20 (Migrated from github.com) approved these changes 2025-12-11 12:32:27 +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.