# 06. Database Design

## Database Name

```text
SCMS
```

## Collections

### Users

Fields:

- username
- password

Validation:

- username is required and unique.
- password is required and encrypted using bcrypt.

### Suppliers

Fields:

- supplierCode
- supplierName
- telephone
- address
- email

Validation:

- All fields are required.
- supplierCode is unique.
- email is unique.

### Shipments

Fields:

- supplier
- shipmentNumber
- shipmentDate
- shipmentStatus
- destination

Validation:

- All fields are required.
- shipmentNumber is unique.
- supplier references the Suppliers collection.

### Deliveries

Fields:

- shipment
- deliveryCode
- deliveryDate
- quantityDelivered
- deliveryStatus

Validation:

- All fields are required.
- deliveryCode is unique.
- quantityDelivered must be greater than zero.
- shipment references the Shipments collection.

