<aside>
</aside>
<aside>
</aside>
<aside>
</aside>
<aside>
</aside>
<aside>
</aside>

erDiagram
Company {
Int id PK
String companyName UNIQUE
String companyCode UNIQUE
DateTime createdAt
DateTime updatedAt
}
User {
Int id PK
Int companyId FK
String name
String email UNIQUE
String password
String employeeNumber UNIQUE
String phoneNumber
String imageUrl
Boolean isAdmin
DateTime createdAt
DateTime updatedAt
}
Customer {
Int id PK
Int companyId FK
String name
Gender gender
String phoneNumber
AgeGroup ageGroup
Region region
String email
String memo
Int contractCount
DateTime createdAt
DateTime updatedAt
}
Car {
Int id PK
Int companyId FK
Int modelId FK
String carNumber "UNIQUE"
Int manufacturingYear
Int mileage
Int price
Int accidentCount
String explanation
String accidentDetails
CarStatus carStatus
DateTime createdAt
DateTime updatedAt
}
Manufacturer {
Int id PK
String name "UNIQUE"
DateTime createdAt
DateTime updatedAt
}
CarModel {
Int id PK
Int manufacturerId FK
String name
String type
DateTime createdAt
DateTime updatedAt
}
Contract {
Int id PK
Int userId FK
Int carId FK
Int customerId FK
Int companyId FK
ContractStatus contractStatus
DateTime resolutionDate
Int contractPrice
DateTime createdAt
DateTime updatedAt
}
Meeting {
Int id PK
Int contractId FK
DateTime date
DateTime createdAt
DateTime updatedAt
}
Alarm {
Int id PK
Int meetingId FK
DateTime time
DateTime createdAt
DateTime updatedAt
}
ContractDocument {
Int id PK
Int contractId FK
String fileName
String filePath
Int fileSize
DateTime createdAt
DateTime updatedAt
}
Company ||--o{ User : "has"
Company ||--o{ Customer : "has"
Company ||--o{ Car : "has"
Company ||--o{ Contract : "has"
User ||--o{ Contract : "has"
Customer ||--o{ Contract : "has"
Car ||--o{ Contract : "has"
CarModel ||--o{ Car : "has"
Manufacturer ||--o{ CarModel : "has"
Contract ||--o{ Meeting : "has"
Contract ||--o{ ContractDocument : "has"
Meeting ||--o{ Alarm : "has"