Vehicles Collection #44
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#44
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 the MongoDB collection to store vehicle information, as part of requirement RF01.
Each vehicle document will be directly linked to a document in the
clientscollection, establishing the one-to-many relationship (one client can own multiple vehicles).Tasks
vehiclescollection (fields:licensePlate,brand,model,vin(nr chassis),lastKms).clientIdfield (usingObjectId) that references the_idin theclientscollection.vehicles.licensePlateto prevent duplicates and an index onclientIdto quickly find all vehicles for a specific client)._idof a vehicle will be used as a reference (vehicleId) in theworkOrderscollection.This is the collection for vehicles that I came up with, if you have any sugestions or want to change anything please respond here. @miguelmiranda20
The three essential queries we need to optimize:
"Does this vehicle already exist?" (by registration) -> Unique Index
"What vehicles does this customer own?" -> Simple Index
"Does this chassis (VIN) already exist?" -> Unique Partial Index