fssa-batch3 / fssa-batch3/sec_b_vignesh.ramachandran__corejava_project_2

Create Dish

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

### Feature 1: Create Dish
#### Admin story
Admin can create Dish.
#### Pre-requisites:
- Implements Dish Service(create)
- Implement Dish DAO(create)-String dish_name, int quantity,String quantity_unit
- Implement Category_Dish Service(create)
- Implement Category_Dish DAO(create)-menu_id(foreign key), category_id(foreign key), dish_id(foreign key), status
- Implement Dish_Price Service(create)
- Implement Dish_Price DAO(create)-int price, start_date, end_date, dish_id(foreign key)

#### Validation
- [ ] Form Validation
- dish null check
- quantity <0 && quantity >=10
- dish_name (null or empty string)
- quantity_unit (null or empty string)
- menu_id <=0
- category_id <=0
- price <=0
- [ ] Business Logic
- Is the menu_id is in the Menu table?
- Is the category_id is in the Category table?
- dish name alreadyExists in the same Menu & Category in Category_Dish table

#### Messages
- dish cannot be null
- Invalid quantity
- dish_name cannot be null or empty
- quantity_unit cannot be null or empty
- Invalid menu_id
- Invalid category_id
- Invalid price
- menu_id not found (Business Validation)
- category_id not found (Business Validation)
- dish_name alreadyexists(Business Validation)

#### Flow:
```mermaid
graph TD;
A["Dish Service: Dish Creation"] --> B["Form validation"]
B -- Valid --> C0["Business Validation"]
C0 --> C["Category_Dish Service"]
B -- Invalid --> C1["Validation Exception: Invalid input"]
C --> D0["Check the menu_id is in the table or not"]
D0 -- Yes --> D["Check the category_id is in the table or not"]
D0 -- No --> D1["Validation Exception: menu_id not found"]
D -- Yes --> E["Check the dish_name already exists"]
D -- No --> E1["Validation Exception: category_id not found"]
E -- Yes --> F["dish_name already exists"]
E -- No --> F1["Dish DAO: Create Dish"]
F1 -- dish_id --> G["Category_Dish DAO: Category_Dish Creation"]
F1 -- dish_id --> H["Dish_Price DAO: Dish_Price Creation"]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.