fssa-batch3 / fssa-batch3/sec_a_saran.selvaraj__corejava_project_2

User module | Register User

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

Description

## User Registration Process

### User Story

## User Story: User Registration

**As a new user**, I want to be able to register for the application by providing my personal information so that I can access its features.

### Acceptance Criteria:

1. **Scenario:** User enters the registration page.
- **Given** I am on the registration page.
- **When** I see the registration form.
- **Then** I should see fields for:
- First Name
- Last Name
- Phone Number
- Email
- Gender
- DOB
- Password
- Confirm Password

2. **Scenario:** User submits the registration form with valid information.
- **Given** I have filled out all the required fields correctly.
- **When** I click the "Register" button.
- **Then** my registration should be successful, and I should receive a confirmation message.

3. **Scenario:** User enters an invalid email address.
- **Given** I have entered an email address that does not follow the correct format.
- **When** I click the "Register" button.
- **Then** I should see an error message stating "Invalid email address."

4. **Scenario:** User enters a weak password.
- **Given** I have entered a password that does not meet the security requirements.
- **When** I click the "Register" button.
- **Then** I should see an error message describing the password criteria (e.g., "Password must contain at least 8 characters, including one uppercase letter, one lowercase letter, and one special character").

5. **Scenario:** User enters a password and confirm password that do not match.
- **Given** I have entered a password and confirm password that do not match.
- **When** I click the "Register" button.
- **Then** I should see an error message stating "Passwords do not match."

6. **Scenario:** User tries to register with an email that is already in use.
- **Given** I have entered an email address that is already registered.
- **When** I click the "Register" button.
- **Then** I should see an error message indicating that the email is already associated with an existing account.

7. **Scenario:** User successfully completes registration.
- **Given** I have filled out all the required fields correctly.
- **When** I click the "Register" button.
- **Then** my registration should be successful, and I should be redirected to the application's login page.

### Task

1. **Implement Data Access Object (DAO) Layer.**

- `createUser()`: Creates a new user in the database.

2. **Implement Service Layer.**

- `registerUser()`: Registers a new user using the Service Layer.

3. **Create JUnit Test Cases.**

- `testValidRegisterUser()`: Tests the registration of a valid user.
- `testInvalidRegisterUser()`: Tests the handling of invalid registration.

4. **Ensure that the test cases are passing.**

5. **Write clear and concise comments in the code to explain complex logic.**

### DAO

- `createUser()`: This method should be responsible for creating a new user in the database.

### Service

- `registerUser()`: The service layer should use this method to register a new user. It should handle the interaction between the presentation layer and the DAO layer for user registration.

### JUnit Tests

- `testValidRegisterUser()`: This test case should ensure that a valid user can be registered successfully. It should test the happy path of user registration.

- `testInvalidRegisterUser()`: This test case should test the handling of invalid user registration scenarios. Specifically, it should test cases where either the email or password is invalid and ensure that appropriate error messages are displayed.

### Estimation

Estimated time for completing these tasks: 5.5 hours

### Flowchart

![Diagram](https://user-images.githubusercontent.com/118425951/262475858-5fe2b3fc-d48d-4300-ae48-909fc338380b.png)

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.