@startuml Database

entity TransactionIn {
  * id
  __
  * capture_vehicle
  * transaction_number
}

entity TransactionOut {
  * id
  __
  * plat_number
  price
  * transaction_in_id
  * parking_fee_id
  * user_id
}

entity User {
  * id
  __
  * name
  * phone
  * email
  * status
  * password
  * role_id
}

entity Role {
  * id
  __
  * name
}

entity TypeVehicle {
  * id
  __
  * type
}

entity ParkingFee {
  * id
  __
  * price
  * time_period
  * type_vehicle_id
}

entity Member {
  * id
  __
  * name
  * phone
  * exp_date
  * type_member_id
}

entity Vehicle {
  * id
  __
  * plat_number
  * member_id
  * transaction_out_id
  * type_vehicle_id
}

entity TypeMember {
  * id
  __
  * type
  * description
  * price
}

entity MaxVehicle {
  * id
  __
  * max
  * type_member_id
  * type_vehicle_id
}

entity TopUp {
  * id
  __
  * amount
  * exp_date
  * member_id
  * user_id
}

entity Expense {
  * id
  __
  * description
  * amount
  * user_id
}

entity Mutation {
  * id
  __
  * type
  * amount
  transaction_out_id
  expense_id
  topup_id
}

TransactionIn ||--|| TransactionOut
TransactionOut ||--|| Mutation
TransactionOut ||--|{ Vehicle
TransactionOut ||--|{ ParkingFee
TransactionOut ||--|{ User
TypeVehicle ||--|| ParkingFee
TypeVehicle }|--|| Vehicle
TypeVehicle }|--|| MaxVehicle
User ||--|{ Role
User }|--|| TopUp
User }|--|| Expense
Member }|--|| TopUp
Member ||--|| TypeMember
Member }|--|| Vehicle
Expense ||--|| Mutation
TypeMember }|--|| MaxVehicle
TopUp ||--|| Mutation