KRYSTALM7 opened a new pull request, #67: URL: https://github.com/apache/fineract-loan-origination/pull/67
## Summary Implements the LOS backend API layer for staff authentication, loan management, and approval workflow — including JWT token handling, staff credential storage, role resolution, and Flyway V8 migration for staff credentials table. JIRA: https://issues.apache.org/jira/browse/FINERACT-2442 ## Changes ### Staff Auth APIs - `AdminStaffController` — staff registration and management endpoints - `StaffController` (`GET /api/v1/staff/me`) — returns authenticated staff member's resolved LOS role - `AuthController` — updated to return `FineractAuthResponse` with role and token - `StaffProfileResponse`, `StaffApplicationDetailResponse` — new response DTOs ### JWT & Security - `JwtService` — token generation, validation, and claims extraction - `JwtAuthFilter` — JWT authentication filter wired into Spring Security chain - `FineractRoleResolver` — maps Fineract roles to LOS workflow roles - `LosRole` enum — defines valid LOS workflow roles - `SecurityConfig` — updated filter chain and endpoint authorization rules ### Loan Management Backend - `LoanApplicationController` — extended with staff review endpoints - `LoanApplicationService` — business logic for loan state transitions - `StaffManagementService` — staff CRUD and credential management - `ApprovalWorkflowService` — updated workflow validation with role enforcement - `ApprovalWorkflowProperties` — configurable role-to-stage mappings ### Error Handling - `ApprovalStageMismatchException` — thrown when staff role doesn't match expected stage - `LosRoleNotAssignedException` — thrown when authenticated staff has no mapped LOS role - `GlobalExceptionHandler` — registers both new exceptions - `LosErrorConstants` — adds corresponding error message constants ### Database - `StaffCredential` domain entity and `StaffCredentialRepository` - `V8__create_staff_credentials.sql` — Flyway migration for staff credentials table - `ApprovalStageRepository` — improved query methods ### Tests - `ApprovalWorkflowServiceTest` — extended for role validation and mismatch scenarios ## Checklist - [x] I have read the Apache Fineract Contributing Guidelines. - [x] My pull request is linked to the correct JIRA ticket. - [x] My commit message follows the `FINERACT-<issue-no>: <description>` format. - [x] I have added or updated tests where appropriate. - [x] I have verified that the project builds successfully. ## Method of Testing ### Build & Tests ```bash ./mvnw clean verify ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
