Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[User Story] Provide Basic Personal Information #5

Closed
8 tasks done
chriscoderdr opened this issue Oct 22, 2024 · 7 comments
Closed
8 tasks done

[User Story] Provide Basic Personal Information #5

chriscoderdr opened this issue Oct 22, 2024 · 7 comments
Assignees
Labels
in-progress In Progress user-story User Story

Comments

@chriscoderdr
Copy link
Owner

chriscoderdr commented Oct 22, 2024

[User Story] Provide Basic Personal Information

Description:

As a new driver, I want to provide my basic personal information so that I can create an account in the app.

Acceptance Criteria:

  • A form to input basic details (e.g., name, email, phone number, password) is available for new drivers.
  • Data is validated (e.g., email format, phone number length) before submission.
  • The account is successfully created after the information is submitted and verified.

Tasks:

Backend:

  • Set up API endpoint for new driver registration.
  • Validate personal information on the server (email, phone number, etc.).
  • Store driver data securely in the database.
  • Implement error handling for validation failures and data submission.

Mobile:

Labels:

  • User Story

Related

@chriscoderdr
Copy link
Owner Author

Task is overdue due to prioritizing task #12 which took longer than expected and also power and internet outages yesterday caused by kristine typhon

@chriscoderdr chriscoderdr added this to the Driver Alpha milestone Oct 25, 2024
@chriscoderdr chriscoderdr self-assigned this Oct 25, 2024
@chriscoderdr chriscoderdr removed this from the Driver Alpha milestone Oct 25, 2024
@chriscoderdr
Copy link
Owner Author

chriscoderdr commented Oct 25, 2024

@chriscoderdr
Copy link
Owner Author

Wanted to support autofill of password but find out this issue:

facebook/react-native#21911

I'm disabling it for now, maybe later we find a solution

@chriscoderdr
Copy link
Owner Author

chriscoderdr commented Oct 25, 2024

Test Cases for Registration Form

1. Form Field Validation (Front-end Validation)

ID Test Case Preconditions Steps Expected Result
1 Validate that the email field is required Registration form is open 1. Leave the email field empty.
2. Click "Register".
An error message should appear indicating that the email field is required.
2 Validate that the email field has the correct format Registration form is open 1. Enter text without an email format (e.g., "user") in the email field.
2. Click "Register".
An error message should appear indicating that the email is invalid.
3 Validate that the password field has at least 8 characters Registration form is open 1. Enter a password with fewer than 8 characters.
2. Click "Register".
An error message should appear indicating that the password must have at least 8 characters.
4 Validate that passwords match Registration form is open 1. Enter a password in "Create a password".
2. Enter a different password in "Confirm Password".
3. Click "Register".
An error message should appear indicating that the passwords do not match.
5 Validate that the password confirmation has at least 8 characters Registration form is open 1. Enter a valid password in "Create a password".
2. Enter a password with fewer than 8 characters in "Confirm Password".
3. Click "Register".
An error message should appear indicating that the confirmation password is invalid.

2. Data Submission to Backend for Account Creation

ID Test Case Preconditions Steps Expected Result
6 Submit valid data to the backend All fields contain valid data 1. Fill in all fields with valid data.
2. Click "Register".
The data should be successfully sent to the backend.
7 Submit data to the backend with front-end validation errors One or more fields have validation errors 1. Fill in the fields with invalid data.
2. Click "Register".
Data should not be sent, and the form should display error messages according to front-end validation.
8 Submit data to the backend without filling all required fields Required fields are not completed 1. Leave one or more required fields empty.
2. Click "Register".
Data should not be sent, and the form should display error messages.

3. Display Success or Error Messages Based on Backend Response

ID Test Case Preconditions Steps Expected Result
9 Display success message when the account is successfully created Valid data submitted 1. Submit valid data to the backend.
2. Receive a success response from the backend.
A success message should appear indicating that the account has been created.
10 Display error message when the backend returns an error Data submitted with error 1. Submit data with an error (e.g., duplicate email).
2. Receive an error message from the backend.
An error message should appear indicating the specific reason for the failure.
11 Handle network errors when submitting data Connection issues 1. Fill out the form.
2. Click "Register".
3. Simulate a network failure.
An error message should appear indicating connection issues.
12 Handle server errors when submitting data Server issues 1. Fill out the form.
2. Click "Register".
3. Receive a 500 error from the server.
An error message should appear indicating a server problem.

chriscoderdr added a commit that referenced this issue Oct 29, 2024
…ation

- Added Docker configuration for API and PostgreSQL services
- Created Dockerfile and docker-compose.yml for streamlined setup
- Configured Sequelize and connected to PostgreSQL
- Refactored TypeScript setup and excluded test files from production build
- Resolved issues with module imports and improved build process for production
@chriscoderdr
Copy link
Owner Author

Method HTTP: POST
Route: /api/drivers/register
Expected Data:

{
  "name": "John Doe",
  "email": "johndoe@example.com",
  "phone": "+123456789",
  "password": "securepassword123"
}

chriscoderdr added a commit that referenced this issue Oct 30, 2024
…etup

- Updated Driver model to specify tableName instead of modelName
- Improved Docker and database configurations for production environment
chriscoderdr added a commit that referenced this issue Oct 30, 2024
…shing

- Added beforeEach hook in tests to clear drivers table, ensuring no duplicate entries.
- Updated driver model to validate password presence and apply bcrypt hashing in beforeCreate hook.
chriscoderdr added a commit that referenced this issue Oct 30, 2024
…asic-personal-information-backend

#5 user story title provide basic personal information backend
@chriscoderdr
Copy link
Owner Author

Adding the phone input I modified the styles in the package https://www.npmjs.com/package/react-native-phone-number-input#props to match ours
also I encapsulated in our own input and put in the input field component, also I wanted formatting separating by dash and library didn't support so made a patch using patch-package

chriscoderdr added a commit that referenced this issue Oct 30, 2024
… backend fixes, and enable Docker hot-reload
chriscoderdr added a commit that referenced this issue Oct 30, 2024
- Integrated `react-native-phone-number-input` for phone input
- Customized `react-native-phone-number-input` styles to align with app design
- Added patches for:
  - `react-native-phone-number-input` to enable format-as-you-type functionality
  - `react-native-country-picker-modal` to resolve deprecated defaultProps warning
- Added e2e tests
chriscoderdr added a commit that referenced this issue Oct 30, 2024
…asic-personal-information-integration

feat(#5):  integrate frontend and backend for driver registration
@chriscoderdr
Copy link
Owner Author

closed by #18

@chriscoderdr chriscoderdr changed the title [User Story] Title: Provide Basic Personal Information [User Story] Provide Basic Personal Information Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-progress In Progress user-story User Story
Projects
None yet
Development

No branches or pull requests

1 participant