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


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

--

Legend:

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

    v15 v16  
    77=== Ентитети === 
    88
    9 ==== 1. Clients ====
     9==== 1. Clients ====
     10'''Id''' – SERIAL (Primary Key) //
     11'''!FirstName''' – VARCHAR(50) (Mandatory attribute) //
     12'''LastName''' – VARCHAR(50) //
     13'''PhoneNumber''' – VARCHAR(20) //
    1014
    11 '''Id''' – SERIAL (Primary Key)
    12 '''!FirstName''' – VARCHAR(50) (Mandatory attribute)
    13 '''LastName''' – VARCHAR(50)
    14 '''PhoneNumber''' – VARCHAR(20)
     15==== 2. Mechanics ====
     16'''EMBG''' – VARCHAR(13) (Primary Key) //
     17'''!FirstName''' – VARCHAR(50) (Mandatory attribute) //
     18'''!LastName''' – VARCHAR(50) (Mandatory attribute) //
    1519
    16 ==== 2. Mechanics ====
     20==== 3. Motorcycles ====
     21'''Id''' – SERIAL (Primary Key) //
     22'''!ClientId''' – INT (Mandatory attribute, Foreign Key to Clients.Id with ON DELETE CASCADE) //
     23'''!Model''' – VARCHAR(50) (Mandatory attribute) //
     24'''Year''' – INT //
     25'''!ChassisNumber''' – VARCHAR(50) (Unique) //
     26'''Registration''' – VARCHAR(20) //
     27'''Kilometers''' – INT //
    1728
    18 '''EMBG''' – VARCHAR(13) (Primary Key)
    19 '''!FirstName''' – VARCHAR(50) (Mandatory attribute)
    20 '''!LastName''' – VARCHAR(50) (Mandatory attribute)
     29==== 4. ServiceItems ====
     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) //
    2135
    22 ==== 3. Motorcycles ====
     36==== 5. Services ====
     37'''Id''' – SERIAL (Primary Key) //
     38'''!MotorcycleId''' – INT (Mandatory attribute, Foreign Key to Motorcycles.Id with ON DELETE CASCADE) //
     39'''!DateOfService''' – DATE (Mandatory attribute) //
     40'''!LaborCost''' – DECIMAL(10,2) (Mandatory attribute) //
     41'''!TotalPrice''' – DECIMAL(10,2) (Mandatory attribute; calculated manually by the application) //
    2342
    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
     43==== 6. ServiceAssignments  ====
     44'''!ServiceId''' – INT (Foreign Key to Services.Id with ON DELETE CASCADE) //
     45'''MechanicEMBG''' – VARCHAR(13) (Foreign Key to Mechanics.EMBG with ON DELETE CASCADE) //
     46'''!ServiceItemId''' – INT (Foreign Key to ServiceItems.Id with ON DELETE CASCADE) //
     47'''!UnitsUsed''' – DECIMAL(10,2) (Mandatory attribute) //
     48'''Composite Primary Key''': (ServiceId, MechanicEMBG, ServiceItemId) //
    3149
    32 ==== 4. ServiceItems ====
     50==== 7. ServiceInvoices ====
     51'''Id''' – SERIAL (Primary Key) //
     52'''!ServiceId''' – INT (Unique, Mandatory attribute, Foreign Key to Services.Id with ON DELETE CASCADE) //
     53'''!IssueDate''' – TIMESTAMP (Mandatory attribute, defaults to NOW()) //
     54'''!ImagePath''' – TEXT (Mandatory attribute) //
    3355
    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)
     56==== 8. FiscalBills ====
     57'''Id''' – SERIAL (Primary Key) //
     58'''!ServiceInvoiceId''' – INT (Unique, Mandatory attribute, Foreign Key to ServiceInvoices.Id with ON DELETE CASCADE) //
     59'''!IssueDateTime''' – TIMESTAMP (Mandatory attribute, defaults to NOW()) //
     60'''Description''' – TEXT //
     61'''DDV''' – DECIMAL(5,2) (Mandatory attribute) //
     62'''EDB''' – VARCHAR(15) (Mandatory attribute) //
    3963
    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)
    7164=== Релации === 
    7265