Changes between Version 4 and Version 5 of ERModel


Ignore:
Timestamp:
06/05/26 11:55:24 (12 days ago)
Author:
201165
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ERModel

    v4 v5  
    11== Nutritioneer | Концептуален дијаграм и ЕР Модел
    2 Следните информации се насочуваат кон идејата на проектот, неговиот концепт и осврнувајќи се на формата која ќе ја има базата.
    32
    4 === ЕР Модел - концепт на проектот
    5 [[Image(Nutritioneer_ER_201165.png, 75%)]]
    6 === Ентитети
     3[[Image(Nutritioneer_ER_201165_v.1.png, 80%)]]
     4=== Ентитети и табели
     5
     6User – сите корисници на целиот систем
     7• email (PK, text, not nullable)
     8• username (text, not nullable)
     9• password (text, not nullable)
     10• role (enum, not nullable)
     11  o User, Administrator, Trainer
     12
     13Recipe – сите рецепти и нивни информации
     14• id (PK, bigint, not nullable)
     15• name (text, not nullable)
     16• guide (text, not nullable)
     17• kcal_sum (numeric, not nullable)
     18
     19Ingredient – сите намирници и состојки
     20• name (PK, text, not nullable)
     21• description (text, not nullable)
     22• energy (numeric, not nullable)
     23• kcal (numeric, not nullable)
     24• type (enum, not nullable)
     25  o Dairy, Meat, Fish, Herb, Carb, Vegetable, Fruit, Other, …
     26
     27Nutrient – различните хранливи материи кои се неопходни
     28• id (PK, bigint, not nullable)
     29• quantity (numeric, not nullable)
     30• description (text, not nullable)
     31• unit (enum, not nullable)
     32  o Milligram, gram, microgram
     33• type (enum, not nullable)
     34  o Macro-nutrient, Micro-nutrient
     35
     36Restriction – хранлива рестрикција од различна сфера на секојдневието
     37• id (PK, bigint, not nullable)
     38• description (text, not nullable)
     39• type (enum, not nullable)
     40  o Vegan, Vegetarian, Halal, Kosher, Pescatarian, Allergens, Keto, …
     41
     42Post – ентитет кој ке го содржи секој пост на апликацијата
     43• id (PK, bigint, not nullable)
     44• media (blob, nullable)
     45• isPrivate (Boolean, not nullable)
     46• isFavourite (Boolean, not nullable)
     47• created_by (FK, bigint, not nullable)
     48• status (enum, not nullable)
     49  o Published, Draft, Archived
     50
     51Comment – ентитет за коментарите присутни на постовите
     52• id (PK, bigint, not nullable)
     53• description (text, not nullable)
     54• post_id (FK, bigint, not nullable)
     55• created_by (FK, bigint, not nullable)
     56
     57Grocery_List – ентитет за пазарната листа со два начини на вметување записи
     58• id (PK, bigint, not nullable)
     59• date_time (timestamp, not nullable)
     60• notes (text, nullable)
     61• isBought (Boolean, not nullable)
     62• kcal (numeric, not nullable)
     63• user_id(FK, bigint, not nullable)
     64
     65Intake_Planner – записи за логирање исхрана и создавање meal-plan
     66• id (PK, bigint, not nullable)
     67• date_time (timestamp, not nullable)
     68• notes (text, nullable)
     69• kcal (numeric, not nullable)
     70• isConsumed (Boolean, not nullable)
     71• user_id (FK, bigint, not nullable)
     72
     73Biometrics – биометрички податоци сместени во ентитет за компаративна анализа
     74• id (PK, bigint, not nullable)
     75• date(date, not nullable)
     76• weight (numeric, nullable)
     77• height (numeric, nullable)
     78• age (numeric, nullable)
     79• muscle_fat_ratio (numeric, nullable)
     80• user_id (FK, bigint, not nullable)
     81
     82===Релациски табели
     83
     84Recipe_Contains_Ingeredient
     85• recipe_id (FK, bigint, non nullable)
     86• ingredient_name (FK, text, non nullable)
     87• ingredient_quantity (numeric, non nullable)
     88• PK (recipe_id, ingredient_name)
     89
     90Ingredient_Contains_Nutrient
     91• ingredient_name (FK, text, non nullable)
     92• nutrient_id (FK, bigint, non nullable)
     93• quantitiy  (numeric, non nullable)
     94• PK (ingredient_name, nutrient_id)
     95
     96Recipe_Contains_Restriction
     97• restriction_id (FK, bigint, non nullable)
     98• recipe_id (FK, bigint, non nullable)
     99• PK (recipe_id, restriction_id)
     100
     101Grocery_List_Bulk_Add_Ingredient
     102• list_id (FK, bigint, non nullable)
     103• recipe_id (FK, bigint, non nullable)
     104• PK (list_id, recipe_id)
     105
     106Grocery_List_Single_Add_Ingredient
     107• list_id (FK, bigint, non nullable)
     108• ingredient_name (FK, text, non nullable)
     109• buy_quantity (numeric, non nullable)
     110• PK (list_id, ingredient_name)
     111
     112Intake_Planner_save_to_list_Post
     113• planner_id (FK, bigint, not nullable)
     114• post_id (FK, bigint, not nullable)
     115• PK (planner_id, post_id)
     116
     117=== Релации
     118USER creates POST | 1:N
     119POST has COMMENT | 1:N
     120USER posts_on COMMENT | 1:N
     121INTAKE_PLANER save_to_list POST | M:N
     122USER create RECIPE 1:N
     123USER record_intake INTAKE_PLANNER | 1:N
     124USER record BIOMETRICS | 1:N
     125RECIPE contains INGREDIENT | M:N
     126GROCERY_LIST add_bulk_ingedients INGREDIENT (from RECIPE) | M:N
     127GROCERY_LIST add_single_ingredient IGREDIENT | M:N
     128INGREDIENT contains NUTRIENT | M:N
     129USER modify GROCERY_LIST | 1:N
    7130
    8131
    9 === Релации
    10132
    11133== Навигација низ проектот