| 14 | | * '''ROLE''' ('''role_id''', '''role_name''', '''description''') |
| 15 | | * '''APP_USER''' ('''user_id''', '''role_id'''* ('''ROLE'''), '''username''', '''password_hash''', '''first_name''', '''last_name''', '''email''', '''active''') |
| 16 | | * '''SESSION''' ('''token''', '''user_id'''* ('''APP_USER'''), '''created_at''', '''expires_at''') |
| 17 | | * '''AUDIT_LOG''' ('''log_id''', '''user_id'''* ('''APP_USER'''), '''action''', '''entity_name''', '''created_at''') |
| 18 | | * '''SHIFT''' ('''shift_id''', '''user_id'''* ('''APP_USER'''), '''start_time''', '''end_time''') |
| 19 | | * '''SHIFT_CLOSE''' ('''shift_id''', '''closed_at''', '''closed_by'''* ('''APP_USER'''), '''total''', '''order_count''') |
| 20 | | * '''CATEGORY''' ('''category_id''', '''name''', '''description''', '''active''') |
| 21 | | * '''PRODUCT''' ('''product_id''', '''category_id'''* ('''CATEGORY'''), '''name''', '''description''', '''price''', '''active''', '''min_stock''') |
| 22 | | * '''RECIPE''' ('''recipe_id''', '''product_id'''* ('''PRODUCT''')) |
| 23 | | * '''RECIPE_ITEM''' ('''recipe_id''', '''ingredient_id''', '''quantity_needed''') |
| 24 | | * '''INGREDIENT''' ('''ingredient_id''', '''name''', '''unit''', '''min_stock''', '''active''') |
| 25 | | * '''INGREDIENT_INVENTORY''' ('''id''', '''ingredient_id'''* ('''INGREDIENT'''), '''quantity_change''', '''operation_type''', '''created_at''') |
| 26 | | * '''INVENTORY''' ('''inventory_id''', '''product_id'''* ('''PRODUCT'''), '''quantity_change''', '''operation_type''', '''created_at''') |
| 27 | | * '''RESTAURANT_TABLE''' ('''table_id''', '''table_number''', '''capacity''', '''status''') |
| 28 | | * '''ORDERS''' ('''order_id''', '''user_id'''* ('''APP_USER'''), '''table_id'''* ('''RESTAURANT_TABLE'''), '''created_at''', '''status''') |
| 29 | | * '''ORDER_ITEM''' ('''order_id''', '''item_number''', '''product_id'''* ('''PRODUCT'''), '''quantity''', '''unit_price''', '''status''') |
| 30 | | * '''PAYMENT''' ('''payment_id''', '''order_id'''* ('''ORDERS'''), '''amount''', '''method''', '''payment_date''') |
| 31 | | * '''INVOICE''' ('''invoice_id''', '''payment_id'''* ('''PAYMENT'''), '''invoice_number''', '''issued_at''') |
| 32 | | * '''APP_SETTINGS''' ('''id''', '''restaurant_name''', '''vat_rate''', '''currency''', '''printer_config''') |
| 33 | | * '''SETTINGS''' ('''id''', '''restaurant_name''', '''vat_percent''', '''currency''', '''printer_ip''', '''printer_port''') |
| | 14 | === Табели === |
| | 15 | |
| | 16 | * '''ROLE''' (__'''role_id'''__, '''role_name''', description) |
| | 17 | * '''APP_USER''' (__'''user_id'''__, '''role_id'''* ('''ROLE'''), username, '''password_hash''', first_name, last_name, email, active) |
| | 18 | * '''SESSION''' (__'''token'''__, '''user_id'''* ('''APP_USER'''), '''created_at''', '''expires_at''') |
| | 19 | * '''AUDIT_LOG''' (__'''log_id'''__, '''user_id'''* ('''APP_USER'''), '''action''', entity_name, created_at) |
| | 20 | * '''SHIFT''' (__'''shift_id'''__, '''user_id'''* ('''APP_USER'''), '''start_time''', end_time) |
| | 21 | * '''SHIFT_CLOSE''' (__'''shift_id'''__, '''closed_at''', '''closed_by'''* ('''APP_USER'''), '''total''', '''order_count''') |
| | 22 | * '''CATEGORY''' (__'''category_id'''__, '''name''', description, active) |
| | 23 | * '''PRODUCT''' (__'''product_id'''__, '''category_id'''* ('''CATEGORY'''), '''name''', description, '''price''', active, '''min_stock''') |
| | 24 | * '''RECIPE''' (__'''recipe_id'''__, product_id* ('''PRODUCT''')) |
| | 25 | * '''RECIPE_ITEM''' (__'''recipe_id'''__, __'''ingredient_id'''__, '''quantity_needed''') |
| | 26 | * '''INGREDIENT''' (__'''ingredient_id'''__, '''name''', '''unit''', '''min_stock''', '''active''') |
| | 27 | * '''INGREDIENT_INVENTORY''' (__'''id'''__, '''ingredient_id'''* ('''INGREDIENT'''), '''quantity_change''', '''operation_type''', '''created_at''') |
| | 28 | * '''INVENTORY''' (__'''inventory_id'''__, '''product_id'''* ('''PRODUCT'''), '''quantity_change''', operation_type, created_at) |
| | 29 | * '''RESTAURANT_TABLE''' (__'''table_id'''__, '''table_number''', '''capacity''', '''status''') |
| | 30 | * '''ORDERS''' (__'''order_id'''__, '''user_id'''* ('''APP_USER'''), '''table_id'''* ('''RESTAURANT_TABLE'''), created_at, '''status''') |
| | 31 | * '''ORDER_ITEM''' (__'''order_id'''__, __'''item_number'''__, product_id* ('''PRODUCT'''), '''quantity''', '''unit_price''', '''status''') |
| | 32 | * '''PAYMENT''' (__'''payment_id'''__, '''order_id'''* ('''ORDERS'''), '''amount''', '''method''', payment_date) |
| | 33 | * '''INVOICE''' (__'''invoice_id'''__, '''payment_id'''* ('''PAYMENT'''), '''invoice_number''', issued_at) |
| | 34 | * '''APP_SETTINGS''' (__'''id'''__, '''restaurant_name''', '''vat_rate''', '''currency''', '''printer_config''') |
| | 35 | * '''SETTINGS''' (__'''id'''__, '''restaurant_name''', '''vat_percent''', '''currency''', printer_ip, '''printer_port''') |