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


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

--

Legend:

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

    v16 v17  
    77=== Ентитети === 
    88
    9 ==== 1. Clients ====
    10 '''Id''' – SERIAL (Primary Key) //
    11 '''!FirstName''' – VARCHAR(50) (Mandatory attribute) //
    12 '''LastName''' – VARCHAR(50) //
    13 '''PhoneNumber''' – VARCHAR(20) //
     9==== 1. Client ====
     10'''Id''' – SERIAL (Primary Key)\\
     11'''!FirstName''' – VARCHAR(50) (Mandatory attribute)\\
     12'''!LastName''' – VARCHAR(50)\\
     13'''!PhoneNumber''' – VARCHAR(20)\\
    1414
    15 ==== 2. Mechanics ====
    16 '''EMBG''' – VARCHAR(13) (Primary Key) //
    17 '''!FirstName''' – VARCHAR(50) (Mandatory attribute) //
    18 '''!LastName''' – VARCHAR(50) (Mandatory attribute) //
     15==== 2. Mechanic ====
     16'''EMBG''' – VARCHAR(13) (Primary Key)\\
     17'''!FirstName''' – VARCHAR(50) (Mandatory attribute)\\
     18'''!LastName''' – VARCHAR(50) (Mandatory attribute)\\
    1919
    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 //
     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\\ 
    2828
    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) //
     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)\\ 
    3535
    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) //
     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)\\ 
    4242
    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) //
     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)\\ 
    4949
    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) //
     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)\\ 
    5555
    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) //
     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)\\ 
     63
    6364
    6465=== Релации ===