---
# System prepended metadata

title: Untitled

---



```mermaid
 classDiagram
      User --o Order
      Courier --o Order
      Restaurant --o Order
      RestaurantChain --o Restaurant
      Restaurant --o MenuItem
      OrderItem --o Order
      MenuItem --o OrderItem
      User -- Location
      Restaurant -- Location
      Courier -- Location
      
      class User{
          id Id
          username String
          phone String
          password_hash PasswordHash
          email String
          address Location
      }
      
      class Courier{
          id Id
          username String
          phone String
          password_hash PasswordHash
          email String
          working_status Status
          adress Location
      }
      
      class RestaurantChain {
          id Id
          title String
          description Text
      }
      
      class Restaurant{
          id Id
          restaurant_chain_id Id
          phone String
          password_hash PasswordHash
          address Address
          description Text
      }
      
      
      class MenuItem {
          id Id
          restaurant_id Id
          title String
          description Text
          price Money
      }
      
      class Admin{
          id Id
          username String
          phone String
          password_hash PasswordHash
          email String
      }
      
      class Order{
          id Id
          user_id Id
          restaurant_id Id
          courier_id Id
          order_item_ids Id[]
          delivery_price Money
          total_price Money
          status Status
          created Datetime          
      }
      
      class OrderItem{
          id Id
          menu_item_id Id
          count Int
      }
      
      class Location{
          latitude Double
          longitude Double
      }
```



