Changes between Version 14 and Version 15 of ЕРДијаграм


Ignore:
Timestamp:
02/05/25 17:01:33 (2 weeks ago)
Author:
221550
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ЕРДијаграм

    v14 v15  
    77=== Ентитети === 
    88
    9 ==== 1. Client ==== 
    10 '''Id''' – SERIAL (Primary Key)\\ 
    11 '''!FirstName''' – VARCHAR(50) (Mandatory attribute)\\ 
    12 '''!LastName''' – VARCHAR(50)\\ 
    13 '''!PhoneNumber''' – VARCHAR(20)\\ 
     9==== 1. Clients ====
    1410
    15 ==== 2. Mechanic ==== 
    16 '''EMBG''' – VARCHAR(13) (Primary Key)\\ 
    17 '''!FirstName''' – VARCHAR(50) (Mandatory attribute)\\ 
    18 '''!LastName''' – VARCHAR(50) (Mandatory attribute)\\ 
     11'''Id''' – SERIAL (Primary Key)
     12'''!FirstName''' – VARCHAR(50) (Mandatory attribute)
     13'''LastName''' – VARCHAR(50)
     14'''PhoneNumber''' – VARCHAR(20)
    1915
    20 ==== 3. Motorcycle ==== 
    21 '''Id''' – SERIAL (Primary Key)\\ 
    22 '''!ClientId''' – INT (Mandatory attribute, Foreign Key to Client.Id)\\ 
    23 '''Model''' – VARCHAR(50) (Mandatory attribute)\\ 
    24 '''Year''' – INT\\ 
    25 '''!ChassisNumber''' – VARCHAR(50) (Unique)\\ 
    26 '''Registration''' – VARCHAR(20)\\ 
    27 '''Kilometers''' – INT\\ 
     16==== 2. Mechanics ====
    2817
    29 ==== 4. !ServiceItem ==== 
    30 '''Id''' – SERIAL (Primary Key)\\ 
    31 '''Description''' – TEXT (Mandatory attribute)\\ 
    32 '''!MeasurementUnit''' – VARCHAR(20) (Mandatory attribute)\\ 
    33 '''!PricePerUnit''' – DECIMAL(10,2) (Mandatory attribute)\\ 
    34 '''Tax''' – DECIMAL(5,2) (Mandatory attribute)\\ 
     18'''EMBG''' – VARCHAR(13) (Primary Key)
     19'''!FirstName''' – VARCHAR(50) (Mandatory attribute)
     20'''!LastName''' – VARCHAR(50) (Mandatory attribute)
    3521
    36 ==== 5. Service ==== 
    37 '''Id''' – SERIAL (Primary Key)\\ 
    38 '''!MotorcycleId''' – INT (Mandatory attribute, Foreign Key to Motorcycle.Id)\\ 
    39 '''!DateOfService''' – DATE (Mandatory attribute)\\ 
    40 '''!LaborCost''' – DECIMAL(10,2) (Mandatory attribute)\\ 
    41 '''!TotalPrice''' – DECIMAL(10,2) (Generated, Mandatory attribute)\\ 
     22==== 3. Motorcycles ====
    4223
    43 ==== 6. !ServiceAssignment (Junction Table) ==== 
    44 '''!ServiceId''' – INT (Foreign Key to Service.Id)\\ 
    45 '''MechanicEMBG''' – VARCHAR(13) (Foreign Key to Mechanic.EMBG)\\ 
    46 '''!ServiceItemId''' – INT (Foreign Key to !ServiceItem.Id)\\ 
    47 '''!UnitsUsed''' – DECIMAL(10,2) (Mandatory attribute)\\ 
    48 '''Composite Primary Key''': (!ServiceId, MechanicEMBG, !ServiceItemId)\\ 
     24'''Id''' – SERIAL (Primary Key)
     25'''!ClientId''' – INT (Mandatory attribute, Foreign Key to Clients.Id with ON DELETE CASCADE)
     26'''!Model''' – VARCHAR(50) (Mandatory attribute)
     27'''Year''' – INT
     28'''!ChassisNumber''' – VARCHAR(50) (Unique)
     29'''Registration''' – VARCHAR(20)
     30'''Kilometers''' – INT
    4931
    50 ==== 7. !ServiceInvoice ==== 
    51 '''Id''' – SERIAL (Primary Key)\\ 
    52 '''!ServiceId''' – INT (Unique, Mandatory attribute, Foreign Key to Service.Id)\\ 
    53 '''!IssueDate''' – TIMESTAMP (Mandatory attribute)\\ 
    54 '''!ImagePath''' – TEXT (Mandatory attribute)\\ 
     32==== 4. ServiceItems ====
    5533
    56 ==== 8. !FiscalBill ==== 
    57 '''Id''' – SERIAL (Primary Key)\\ 
    58 '''!ServiceInvoiceId''' – INT (Unique, Mandatory attribute, Foreign Key to !ServiceInvoice.Id)\\ 
    59 '''!IssueDateTime''' – TIMESTAMP (Mandatory attribute)\\ 
    60 '''Description''' – TEXT\\ 
    61 '''DDV''' – DECIMAL(5,2) (Mandatory attribute, VAT)\\ 
    62 '''EDB''' – VARCHAR(15) (Mandatory attribute, Tax ID)\\ 
     34'''Id''' – SERIAL (Primary Key)
     35'''!Description''' – TEXT (Mandatory attribute)
     36'''!MeasurementUnit''' – VARCHAR(20) (Mandatory attribute)
     37'''!PricePerUnit''' – DECIMAL(10,2) (Mandatory attribute)
     38'''Tax''' – DECIMAL(5,2) (Mandatory attribute)
    6339
     40==== 5. Services ====
     41
     42'''Id''' – SERIAL (Primary Key)
     43'''!MotorcycleId''' – INT (Mandatory attribute, Foreign Key to Motorcycles.Id with ON DELETE CASCADE)
     44'''!DateOfService''' – DATE (Mandatory attribute)
     45'''!LaborCost''' – DECIMAL(10,2) (Mandatory attribute)
     46'''!TotalPrice''' – DECIMAL(10,2) (Mandatory attribute; calculated manually by the application)
     47
     48==== 6. ServiceAssignments (Junction Table) ====
     49
     50'''!ServiceId''' – INT (Foreign Key to Services.Id with ON DELETE CASCADE)
     51'''MechanicEMBG''' – VARCHAR(13) (Foreign Key to Mechanics.EMBG with ON DELETE CASCADE)
     52'''!ServiceItemId''' – INT (Foreign Key to ServiceItems.Id with ON DELETE CASCADE)
     53'''!UnitsUsed''' – DECIMAL(10,2) (Mandatory attribute)
     54'''Composite Primary Key''': (ServiceId, MechanicEMBG, ServiceItemId)
     55
     56==== 7. ServiceInvoices ====
     57
     58'''Id''' – SERIAL (Primary Key)
     59'''!ServiceId''' – INT (Unique, Mandatory attribute, Foreign Key to Services.Id with ON DELETE CASCADE)
     60'''!IssueDate''' – TIMESTAMP (Mandatory attribute, defaults to NOW())
     61'''!ImagePath''' – TEXT (Mandatory attribute)
     62
     63==== 8. FiscalBills ====
     64
     65'''Id''' – SERIAL (Primary Key)
     66'''!ServiceInvoiceId''' – INT (Unique, Mandatory attribute, Foreign Key to ServiceInvoices.Id with ON DELETE CASCADE)
     67'''!IssueDateTime''' – TIMESTAMP (Mandatory attribute, defaults to NOW())
     68'''Description''' – TEXT
     69'''DDV''' – DECIMAL(5,2) (Mandatory attribute)
     70'''EDB''' – VARCHAR(15) (Mandatory attribute)
    6471=== Релации === 
    6572