supplierOrders Collection (RF07) #151
Labels
No labels
CI/CD
MongoDB
PostgreSQL
api
authentication
bug
documentation
duplicate
enhancement
example issue
fix
good first issue
help wanted
high-level requirement
infrastructure
invalid
low-level requirement
medium-level requirement
question
security
test
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AndreFerreira5/starranja#151
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This task involves designing and implementing the
supplierOrderscollection in MongoDB.This collection will serve a dual purpose:
workOrder).Consequently, the
workOrderIdfield will become optional.Tasks
1. Define Schema:
supplierName(String, Required): The vendor name.description(String, Required): A summary of what was ordered (e.g., "5W-30 Oil & Filters" or "Safety Equipment Restock").status(String, Required): Enum:Pending,Ordered,Shipped,Received,Cancelled.workOrderId(ObjectId, Optional, Ref:workOrders): Only present if the order is for a specific repair job.createdById(String/UUID, Required): The user placing the order.createdAt,updatedAt: Standard timestamps.2. Define Schema Validation:
workOrderIdis allowed to benullor missing (not in the required list).statusonly accepts the defined enum values.3. Define Indexes:
db.supplierOrders.createIndex({ workOrderId: 1 }): To find orders linked to a job (Sparse/Partial index recommended since many will be null).db.supplierOrders.createIndex({ status: 1 }): For dashboard filtering.db.supplierOrders.createIndex({ createdAt: -1 }): To show the most recent orders first.4. Update Artefacts:
database-mongodb-setup.js.docs/database_architecture.mdwith the new collection definition.this issue has already been integrated in the maion branch, closing...