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

Feature/456 Add Financial Report Controllers and Refactor Tests for Comprehensive Coverage #101

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

urbantech
Copy link
Contributor

This PR introduces three new controllers and refactors test cases to enhance the Financial Report API's robustness, maintainability, and validation. Key updates include:

  1. New Controllers:

    • Business Logic Controller: Implements core financial calculations, including net income, currency rounding, and period validation for both annual and quarterly reports.
    • Authorization Controller: Manages user permissions for accessing and modifying reports, API key validation, and report access restrictions based on user roles.
    • CRUD Controller: Handles create, read, update, and delete operations for financial reports, with validations for report ID uniqueness, field requirements, and error handling.
  2. Test Enhancements:

    • Comprehensive Test Coverage: Each controller has corresponding tests for successful operations, validation errors, data integrity, and error handling.
    • Refined Test Logic: Refactored tests provide more granular validation of calculation accuracy, permission restrictions, and CRUD functionality.
    • Additional Edge Cases: Tests now cover scenarios like duplicate ReportID, negative financial values, invalid periods, missing API keys, and cross-user report access.

Key Changes:

  • Added financialReportLogicController.js, financialReportAuthController.js, and financialReportCRUDController.js.
  • Refactored test files:
    • financialReportLogic.test.js
    • financialReportAuth.test.js
    • financialReportCRUD.test.js
  • Updated globalSetup.js for consistent database setup and teardown across all test cases.

Impact:
This refactor strengthens the integrity of the Financial Report API, providing detailed validation, security measures, and consistent data handling, while ensuring better coverage across different business and access scenarios.

…, including tests for financial calculations, reporting period, and data validation
@urbantech urbantech merged commit c386c37 into main Nov 6, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant