fssa-batch3 / fssa-batch3/sec_b_vignesh.ramachandran__corejava_project_2

Update Dish

Open
#11 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 2: Update Dish
#### Admin story
Admin can upate Dish details.
#### Pre-requisites:
- Implements Dish Service(update)-int dish_id, Dish dish
- Implement Dish DAO(update)- quantity, quantity_unit, dish_id
- Implement Category_Dish Service(update)
- Implement Category_Dish DAO(update)- dish_id(foreign key), status
- Implement Dish_Price Service(update)
- Implement Dish_Price DAO(update)-price, dish_id(foreign key)

#### Validation
- [ ] Form Validation
- dish null check
- id<=0
- quantity <0 && quantity >=10
- quantity_unit (null or empty string)
- price <=0
- [ ] Business Logic
- Is the dish_id is in the table or not?

#### Messages
- dish cannot be null
- Invalid quantity
- quantity_unit cannot be null or empty
- Invalid price
- dish_id not found (Business Validation)

#### Flow:
```mermaid
graph TD;
A["Dish Service: Dish Updation"] --> B["Form validation"]
B -- valid --> C0["Business Validation"]
C0 --> C["Category_Dish Service"]
B -- Invalid --> D["Validation Exception: Invalid input"]
C --> E["Check whether the dish_id is in the Category_Dish table or not"]
E -- Yes -->F["Dish DAO: Update Dish"]
E -- No -->F1["Validation Exception: dish_id not found"]
F --> G["Dish_Price: Update Dish_Price"]
G --> H0["Check the dish_price already exists or not"]
H0 -- Yes --> H1["No updates in the Dish_Price table"]
H0 -- No --> H2["Set the end_date on current Price"]
H2 --> I["Dish_Price: Create Dish_Price"]
```

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.