Clients Collection #43

Closed
opened 2025-10-22 14:18:40 +00:00 by GFMpt13 · 1 comment
GFMpt13 commented 2025-10-22 14:18:40 +00:00 (Migrated from github.com)

This task involves designing the MongoDB collection to store customer information, as part of requirement RF01.

This collection will act as the single source of truth for all client data, allowing it to be referenced by vehicles, workOrders, and invoices without data duplication.

Tasks

  • Define the schema for the clients collection (fields: name, nif, phone, email, address, etc.).
  • Identify necessary indexes for fast lookups and to ensure data integrity (e.g., a unique index on clients.nif and an index on phone).
  • Document that the _id of a client will be used as a reference (clientId) in other collections.
This task involves designing the MongoDB collection to store customer information, as part of requirement **RF01**. This collection will act as the single source of truth for all client data, allowing it to be referenced by `vehicles`, `workOrders`, and `invoices` without data duplication. ### Tasks - [x] Define the schema for the `clients` collection (fields: `name`, `nif`, `phone`, `email`, `address`, etc.). - [x] Identify necessary indexes for fast lookups and to ensure data integrity (e.g., a **unique index** on `clients.nif` and an index on `phone`). - [x] Document that the `_id` of a client will be used as a reference (`clientId`) in other collections.
GFMpt13 commented 2025-10-22 18:25:26 +00:00 (Migrated from github.com)

This is the collection for clients that I came up with, if you have any sugestions or want to change anything please respond here. @miguelmiranda20
Image

To comply with RF01 (manage customers) and RNF03 (response time < 3s), indexes are essential.

Unique Index by NIF: Most important business rule. Prevent duplicate customers.

Index by Phone and Email: Allows for quick searches when a customer calls or to avoid duplicate emails.

This is the collection for clients that I came up with, if you have any sugestions or want to change anything please respond here. @miguelmiranda20 <img width="371" height="309" alt="Image" src="https://github.com/user-attachments/assets/8c05b213-c9a1-4df2-8587-4a57e8fa3de3" /> To comply with RF01 (manage customers) and RNF03 (response time < 3s), indexes are essential. Unique Index by NIF: Most important business rule. Prevent duplicate customers. Index by Phone and Email: Allows for quick searches when a customer calls or to avoid duplicate emails.
Sign in to join this conversation.
No description provided.