Ticket Title: Create Payment Class with Sample Bank Account Generation
Priority: Medium
Description:
This ticket involves creating a Payment class to manage user payment details and simulate sample bank accounts. The class will generate users with fields such as name, pin, sort code, and account number. This will serve as the basis for handling payment processes in the ordering system.
Tasks:
Create the Payment Class:
Define fields for:
name (String) – The user's name.
pin (int) – A 4-digit PIN number for authentication.
sortCode (String) – A 6-digit sort code (e.g., "12-34-56").
accountNumber (String) – An 8-digit account number (e.g., "12345678").
Constructor:
Implement a constructor that initializes these fields and generates mock bank accounts for the users.
Account Generation:
Add a method to automatically generate random but valid-looking account numbers and sort codes for new users.
Accessor Methods:
Provide getter methods for all fields (getName(), getPin(), getSortCode(), and getAccountNumber()).
Testing and Validation:
Ensure the class can generate users with unique account details.
Validate that the pin is always a 4-digit number, and both sortCode and accountNumber follow the correct format.
Acceptance Criteria:
The Payment class must generate users with the fields: name, pin, sort code, and account number.
Each user’s account details should be unique, and all fields should be initialized correctly.
Accessor methods must work as expected to retrieve the details.
Test Plan:
Test that the Payment class can successfully generate multiple users with unique bank details.
Ensure that the pin is always 4 digits, and both sortCode and accountNumber are in the correct format.
Ticket Title: Create
Payment
Class with Sample Bank Account GenerationPriority: Medium
Description: This ticket involves creating a
Payment
class to manage user payment details and simulate sample bank accounts. The class will generate users with fields such as name, pin, sort code, and account number. This will serve as the basis for handling payment processes in the ordering system.Tasks:
Create the
Payment
Class:name
(String) – The user's name.pin
(int) – A 4-digit PIN number for authentication.sortCode
(String) – A 6-digit sort code (e.g., "12-34-56").accountNumber
(String) – An 8-digit account number (e.g., "12345678").Constructor:
Account Generation:
Accessor Methods:
getter
methods for all fields (getName()
,getPin()
,getSortCode()
, andgetAccountNumber()
).Testing and Validation:
pin
is always a 4-digit number, and bothsortCode
andaccountNumber
follow the correct format.Acceptance Criteria:
Payment
class must generate users with the fields: name, pin, sort code, and account number.Test Plan:
Payment
class can successfully generate multiple users with unique bank details.pin
is always 4 digits, and bothsortCode
andaccountNumber
are in the correct format.