fssa-batch3 / fssa-batch3/sec_b_mathivanan.pachiyappan__corejava_project_2

Add new candidate

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: Create Candidate
>Create a new Candidate in a database.
#### Pre-requisites:
- [ ] candidate table
- [ ] election table
- [ ] Candidate DAO( create Candidate )
- [ ] Candidate service ( create(Candidate candidate ))
- [ ] Election DAO (create Election)
- [ ] Election Service ( create (Election election))
#### Validations:
- [ ] Form Validation
* create( Candidate candidate )
* candidate null
* candidateName (null, empty)
* candidate_id (>0)
* election_id (>0)
* create_at (>current date)
* create (Election election)
* election null
* id (>0);
- [ ] Business Validation
* check Election
* check Candidate Already exists
#### Messages:
* Invalid Candidate object
* Invalid Candidate Id input
* Invalid Create Date input
* Invalid Candidate Name input
* Candidate already exists
* Invalid Election object
* Invalid Election Id
#### Flow:
```mermaid

graph TD;

A[Candidate Service: Create Candidate] --> B[Form Validation]

B -- Yes --> C[Business Validation]
B -- No --> G[Throws Exception]

C -- Yes --> T[Election Validation]
C -- No --> F[Candidate Service: Candidate Already Exists]

T -- Yes --> D[Candidate DAO: Create Candidate]
T -- No --> H[Throws Exception]

D --> E[Candidate Service: Candidate Created]

```

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.