SmartPark PSSMS - Entity Relationship Diagram (ERD)
====================================================

Entities with Primary Keys and Attributes:
-----------------------------------------

1. USERS
   - UserID (PK) - Unique identifier
   - Username (Unique) - Login username
   - PasswordHash - Encrypted password

2. CAR
   - PlateNumber (PK) - Vehicle plate number
   - DriverName - Driver's full name
   - PhoneNumber - Driver's contact number

3. PARKINGSLOT
   - SlotNumber (PK) - Parking slot identifier
   - SlotStatus - 'available' or 'occupied'

4. PARKINGRECORD
   - RecordID (PK) - Unique record identifier
   - PlateNumber (FK) - References Car.PlateNumber
   - SlotNumber (FK) - References ParkingSlot.SlotNumber
   - EntryTime - Car entry timestamp
   - ExitTime - Car exit timestamp
   - Duration - Parking duration in hours

5. PAYMENT
   - PaymentID (PK) - Unique payment identifier
   - RecordID (FK) - References ParkingRecord.RecordID
   - AmountPaid - Total amount in RWF
   - PaymentDate - Payment timestamp

Relationship Diagram (Text Representation):
-----------------------------------------

    USERS
    (No relationships - standalone auth table)

        |
        |
        v
                    CAR 1 ──────────────────────────────── * PARKINGRECORD
                 +-------------+                      +------------------+
                 |             | PlateNumber (PK)───────>| PlateNumber (FK) |
                 |             | DriverName             | SlotNumber (FK)  |
                 +-------------+                        | RecordID (PK)    |
                    ▲                                 | EntryTime        |
                    |                                   | ExitTime         |
                    |                                   | Duration         |
                    |                                   +------------------+
                    |                                           |
                    |                                           | RecordID (FK)
                    |                                           ▼
                    |
                    |
    PARKINGSLOT 1 ───────────────────────────────────────────── *
    +---------------+
    | SlotNumber (PK)
    | SlotStatus
    +---------------+

                    PARKINGRECORD 1 ──────────────────── 1 PAYMENT
                    +------------------+
                    | RecordID (PK)    |
                    +------------------+                                      +------------------+
                                                                             | PaymentID (PK)   |
                                                                             | RecordID (FK)      |
                                                                             | AmountPaid         |
                                                                             | PaymentDate        |
                                                                             +------------------+

Cardinality Symbols:
-------------------
- || (double line) = One
- > (single line) = Many
- | ── || = One-to-One
- | ── > = One-to-Many

Actual Relationships:
--------------------
- Car (1) ──> ParkingRecord (M) : One car can have multiple parking records
- ParkingSlot (1) ──> ParkingRecord (M) : One slot can host multiple parking sessions
- ParkingRecord (1) ──> Payment (1) : Each record generates exactly one payment