Taghunter98 / JavaGo

0 stars 0 forks source link

Create Payment Class #5

Open Taghunter98 opened 1 month ago

Taghunter98 commented 1 month ago

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:

  1. 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").
  2. Constructor:

    • Implement a constructor that initializes these fields and generates mock bank accounts for the users.
  3. Account Generation:

    • Add a method to automatically generate random but valid-looking account numbers and sort codes for new users.
  4. Accessor Methods:

    • Provide getter methods for all fields (getName(), getPin(), getSortCode(), and getAccountNumber()).
  5. 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:

Test Plan: