Life-Pill / pharmacy-pos-main-backend

The Pharmacy POS System Backend is the server-side component of our comprehensive pharmacy management software. It is developed using Spring Boot, Java, Spring Security ,and Microservices Architecture
Apache License 2.0
5 stars 3 forks source link

Implement Update Employer Bank Account Details Endpoint #102

Closed PramithaMJ closed 6 months ago

PramithaMJ commented 6 months ago

Pull Request: Implement Update Employer Bank Account Details Endpoint

Title

Implement Update Employer Bank Account Details Endpoint

Description

This pull request adds functionality to update the bank account details of an employer via a new endpoint /employers/updateEmployerBankAccountDetailsWithId/{employerId}. It includes unit tests to ensure the correctness of the implementation and handles scenarios where the employer exists, doesn't exist, and when the bank details are missing.

Changes Made

New Endpoint Implementation:

Unit Tests:

Example Endpoint Usage:

Request:

POST /lifepill/v1/employers/updateEmployerBankAccountDetailsWithId/299
Content-Type: application/json

{
    "bankName": "new test",
    "bankBranchName": "Example Branch",
    "bankAccountNumber": "1234567890",
    "employerDescription": "Example Employer Description",
    "monthlyPayment": 1000.00,
    "employerId": 299,
    "monthlyPaymentStatus": true
}

Response:

{
    "code": 201,
    "message": "SUCCESS",
    "data": {
        "employerId": 299,
        "branchId": 3,
        "employerNicName": "ch",
        "employerFirstName": "John",
        "employerLastName": "Doe",
        "employerEmail": "emal@dasd.com",
        "employerPhone": "+1234567890",
        "employerAddress": "123 Main Street",
        "employerSalary": 50000.0,
        "employerNic": "ABCD1234",
        "gender": "MALE",
        "dateOfBirth": "1989-12-31T18:30:00.000+00:00",
        "role": "OWNER",
        "pin": 1234,
        "profileImage": null,
        "employerBankDetails": {
            "employerBankDetailsId": 174,
            "bankName": "new test",
            "bankBranchName": "Example Branch",
            "bankAccountNumber": "1234567890",
            "employerDescription": "Example Employer Description",
            "monthlyPayment": 1000.0,
            "monthlyPaymentStatus": true,
            "employerId": 299,
            "employers": null
        },
        "activeStatus": true
    }
}

Impact Analysis

Affected Files

Test Plan

Related Issues

Checklist

Conclusion

This pull request introduces a new endpoint to update employer bank account details, enhancing the functionality of the system. The implementation has been thoroughly tested to ensure reliability and correctness. Please review the changes and provide any feedback for further refinement.

Best regards,
Pramitha Jayasooriya, Backend Developer at LifePill, https://pramithamj.me