Domain Models

Detailed breakdown of the shared MongoDB entities in Arya Banking.

Shared Entity Models

The arya-banking-common library defines the foundational domain models used across the microservices ecosystem. These are persisted in MongoDB Atlas.


1. User Entity (User)

The primary entity for user profile information.

FieldTypeDescription
userIdStringUnique app-level ID (e.g., ARYA3F9A12).
firstNameStringUser's legal first name.
lastNameStringUser's legal last name.
emailIdStringPrimary email address (unique).
primaryContactNumberString10-digit Indian mobile format.
contactNumbersListCollection of ContactNumber objects.
addressesListCollection of Address objects.
statusEnumACTIVE, BLOCKED, DORMANT.

2. Security Details (SecurityDetails)

Owner of the multi-factor and account-lock state.

FieldTypeDescription
userIdStringReference to the User entity.
securityQuestionsListCollection of SecurityQuestions (Q&A).
loginFailedAttemptsIntegerCounter for failed logins (max 5).
twoFactorEnabledBooleanGlobal toggle for 2FA.
isEmailVerifiedBooleanEmail verification status.

3. Registration Progress (RegistrationProgress)

State machine data for the 3-step registration flow.

FieldTypeDescription
userIdStringReference to the User entity.
statusStringGlobal registration status (IN_PROGRESS / COMPLETE).
subStatusStringDetailed step (e.g., ADDRESS_ADDED).
nextStepStringHint for the UI on what to collect next.

Common Base: AryaBase

All major entities extend AryaBase, inheriting automatic tracking fields:

  • createdAt: Timestamp of creation.
  • updatedAt: Timestamp of the last update.
  • deleted: Soft-delete flag.
Audit trails are automatically managed via Spring Data MongoDB's @EnableMongoAuditing.