Skip to content

feat: add member application workflow foundation - #6462

Open
jaidesx wants to merge 3 commits into
apache:developfrom
kiraboibrahim:feat/member-module-foundation
Open

jaidesx wants to merge 3 commits into
apache:developfrom
kiraboibrahim:feat/member-module-foundation

Conversation

@jaidesx

@jaidesx jaidesx commented Sep 16, 2026

Copy link
Copy Markdown

Summary

This PR introduces the foundational member-application workflow for Nsimbi CBS while preserving Apache Fineract’s m_client table as the canonical member record.

The implementation adds a one-to-one application extension for managing member onboarding, review and approval before later integration with client activation, KYC and account-opening processes.

Changes

  • Added the MemberApplication domain entity.

  • Added DIRECT and AGENCY application channels.

  • Added the following workflow states:

    • DRAFT
    • SUBMITTED
    • UNDER_REVIEW
    • RETURNED_FOR_CORRECTION
    • APPROVED
    • REJECTED
    • WITHDRAWN
  • Added a Spring Data repository with lookup by Fineract client ID.

  • Added member-application-specific domain exceptions.

  • Added optimistic locking to prevent conflicting updates.

  • Added Liquibase migration 0243.

  • Registered migration 0243 in the final tenant changelog.

  • Added six member-application permissions.

Business Rules

The implementation enforces:

  • One member application per m_client record.
  • Maker and checker separation.
  • Decisions by the checker assigned when review begins.
  • Protection against silent checker substitution.
  • Required transition timestamps.
  • Chronological workflow timestamps.
  • Terminal-state restrictions.
  • Clearing previous review information during resubmission.
  • Mandatory reasons for rejection and return for correction.
  • Agency-reference and decision-reason length limits.
  • Trimming of stored agency references and decision reasons.
  • No partial entity mutation when validation fails.

Database Changes

The migration creates nsimbi_member_application with:

  • A unique foreign key to m_client.
  • Maker and checker foreign keys to m_appuser.
  • Workflow and application-channel fields.
  • Submission, review and decision timestamps.
  • Agency-reference and decision-reason fields.
  • Optimistic-lock versioning.
  • Workflow-status and agency-reference indexes.

Agency-reference uniqueness is intentionally deferred until the originating agency identity and composite idempotency rules are defined.

Permissions

  • CREATE_MEMBER_APPLICATION
  • SUBMIT_MEMBER_APPLICATION
  • REVIEW_MEMBER_APPLICATION
  • APPROVE_MEMBER_APPLICATION
  • REJECT_MEMBER_APPLICATION
  • WITHDRAW_MEMBER_APPLICATION

Verification

  • 71 focused tests passed.
  • Zero test failures.
  • Zero skipped tests.
  • git diff --check passed.
  • Untracked-file whitespace checks passed.
  • spotlessMiscCheck passed as the available XML and miscellaneous formatting check.
  • Changed member Java files are formatting-clean.

The exact original test command encountered a Swagger scanner heap failure during the resolve task. The focused tests passed using the same JVM memory limit while excluding :fineract-provider:resolve.

Module-wide spotlessJavaCheck remains affected by seven inherited formatting violations in user-role and security files that were not modified by this PR.

Deferred Work

This foundation PR does not implement:

  • REST APIs and command services.
  • Fineract client activation integration.
  • Permanent member-number generation.
  • Detailed KYC states, overrides and expiry rules.
  • External NIN-verification fallback.
  • Duplicate-member merging.
  • Account-opening eligibility.
  • Agency onboarding workflow.
  • KYC and supporting document management.
  • Persistent workflow-transition history.
  • Frontend functionality.
  • Joint membership or group customization.

Migration 0243 has not yet been executed against a live supported database and must be verified before this work is merged into the final development branch.

Branch Information

  • Base: feat/user-role-administration
  • Compare: feat/member-module-foundation
  • Commit: f58d716bf1

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.

2 participants