This canvas describes the RCP Command service, which is part of the Flexifin application.

Name:

RCP Command service

Description:

This service is responsible for transaction processing of loans with one or more disbursements, variable and/or linked interest rates, fees through the consuming and/or emitting of events mapped to the transactions. It tracks loan components, portions, arrears, waterfall payment allocation and responds to retroactive events through immutable state and transaction event types. The Service is responsible for emitting events related to the loan that will be used by subsidiary microservices responsible for the querying of the debtor loan account and the financial ledger.

REST API:

Actuator Endpoints

Endpoint

Invoked by

GET - /actuator

GET - /actuator/invariant/triggeredEventIdsHash/{numberOfMinutes}

Prometheus/Grafana

Command Canvas

Command

Invoked By

Source Service

CreateAccountCommand

POST - /api/v1/customers/{customerId}/accounts

Application Assembly

LoanApplicationApprovedEvent

ActivateAccountCommand

POST - /api/v1/customers/{customerId}/accounts

Disbursement, PaymentHub

DisbursementProcessedEvent, AccountDisbursedEvent, LoanDisbursedEvent

InitiateAccountCommand

POST - /api/v1/customers/{customerId}/accounts/initiate

Application Assembly

LoanApplicationApprovedEvent, AccountDisbursedEvent

DisburseAccountCommand

PUT - /api/v1/accounts/{accountNumber}/disburse

AccountCreatedEvent

AddTransactionalEventCommand

PUT - /api/v1/accounts/{accountNumber}/transactional-event

AddTransactionalEventRequestedEvent

UpdateInstalmentCommand

PaymentRecalculated

Pmt Calc

CancelExpiredAccountCommand

ExpiredDisbursementBlockedEvent

Disbursement

CaptureDisbursementCommand

POST - /api/v1/accounts/{accountNumber}/captureDisbursement

AdjustPaymentAllocatedCommand

PUT - /accounts/{accountNumber}/adjustPaymentAllocated

ChangeInstalmentCommand

PUT - /api/v1/accounts/{accountNumber}/instalment

ChangeInstalmentCommand

PUT - /api/v1/accounts/{accountNumber}/instalment

ChangeSpvKeyCommand

PUT - /api/v1/accounts/{accountNumber}/spvKey

ChangeTermRemainingCommand

PUT - /api/v1/accounts/{accountNumber}/termRemaining

CreditAdjustmentCommand

PUT - /api/v1/accounts/{accountNumber}/creditAdjustment

DeallocatePaymentCommand

PUT - /api/v1/accounts/{accountNumber}/payments/deallocate

EscalationUpdateCommand

PUT - /api/v1/accounts/{accountNumber}/escalation

ReadvanceCommand

PUT - /api/v1/accounts/{accountNumber}/readvance

RecalculateInstalmentCommand

PUT - /api/v1/accounts/{accountNumber}/recalculateInstalment

RecalculateTermCommand

PUT - /api/v1/accounts/{accountNumber}/recalculateTerm

ReserveFundsCommand

Event - ReserveInstructionSent

Banking Command

RequestLoanCancelCommand

POST - /api/v1/accounts/{accountNumber}/create-loan-cancellation

API

ExecuteLoanCancelCommand

POST - /api/v1/accounts/{accountNumber}/execute-loan-cancellation

API

Event - LoanCancellationRequestedEvent

RCP Command

AbortLoanCancelCommand

POST - /api/v1/accounts/{accountNumber}/abort-loan-cancellation

API

RequestLoanCoolOffCommand

POST - /api/v1/accounts/{accountNumber}/cooloff

API

ExecuteLoanCoolOffCommand

PUT - /api/v1/accounts/{accountNumber}/cooloff

API

AbortLoanCoolOffCommand

DELETE - /api/v1/accounts/{accountNumber}/cooloff

API

RequestRefinanceCommand

GET /api/v1/accounts/{accountNumber}/refinances

CancelRefinanceCommand

POST /api/v1/refinances/{refinanceId}/reject

API

Event - LoanApplicationDeclinedEvent

Application Assembly

Event - DisbursementFailed

Disbursement

cron

refinance expires

ApproveRefinanceCommand

Event - AccountCreatedEvent

RCP Command

ExecuteRefinanceCommand

Event - DisbursementProcessedEvent

Disbursement

RequestRefundCommand

GET /api/v1/accounts/{accountNumber}/refunds

API

ApproveRefundCommand

POST /api/v1/refunds/{refundId}/approve

API

CancelRefundCommand

POST /api/v1/refunds/{refundId}/reject

API

Event - DisbursementFailed

Disbursement

ExecuteRefundCommand

Event - DisbursementProcessedEvent

Disbursement

UpdateAttributePayloadCommand

PUT - /api/v1/accounts/{accountNumber}/attributePayload

UpdateNextInstalmentDateCommand

PUT - /api/v1/accounts/{accountNumber}/nextInstalmentDate

UpdatePayDayCommand

PUT - /api/v1/accounts/{accountNumber}/payDay

UpdatePaymentHolidayDateCommand

PUT - /api/v1/accounts/{accountNumber}/paymentHoliday

UpdateRatesCommand

PUT - /api/v1/accounts/updateRates

UpdateRuleOfAccountCommand

PUT - /api/v1/accounts/{accountNumber}/rules, Event - ReasonCodeApplied

LoadAddonCommand

PUT - /api/v1/accounts/{accountNumber}/addons

CreateAllocationOrderCommand

POST - /api/v1/allocations

UpdateAllocationOrderCommand

PUT - /api/v1/allocations/{allocationId}

CreateComponentCommand

POST - /api/v1/components

Masterdata

JuristicCustomerCreatedEvent

UpdateComponentCommand

PUT - /api/v1/components/{componentId}

Masterdata

JuristicCustomerUpdatedEvent

CreateEventConfigCommand

POST - /api/v1/eventConfigs

UpdateEventConfigCommand

PUT - /api/v1/eventConfigs/{id}

DeleteEventConfigCommand

DELETE - /api/v1/eventConfigs/{id}

InitiateAccountDayEndCommand

PUT - /api/v1/accounts/{accountNumber}/dayEnds

InitiateDayEndCommand

PUT - /api/v1/dayEnds

ProcessAccountDayEndCommand

PUT - /api/v1/accounts/{accountNumber}/dayEndsSync

AccountActivatedEvent, DayEndInitiatedEvent

ProcessAccountMonthEndCommand

HLAccountDisbursedEvent

UpdateDisbursementCommand

DisbursementFailedEvent, DisbursementProcessedEvent

AdjustAndCloseCommand

PUT - /api/v1/accounts/{accountNumber}/adjustAndClose

AdjustAndCloseRequestedEvent

ApplyAdjustmentCommand

PUT - /api/v1/accounts/{accountNumber}/adjustments

AdjustmentRequestedEvent

ApplyPaymentCommand

PUT - /api/v1/accounts/{accountNumber}/payments

Banking, FTL, PaymentHub

PaymentReceivedEvent (Banking) , PaymentReceivedEvent (FTL) , PaymentReceivedInstructionSentEvent, TransferMadeInstructionSent (PH)

CreateFeeCommand

POST - /api/v1/accounts/{accountNumber}/fee

CreateFeeRequestedEvent

CreateJournalCommand

PUT - /api/v1/account/{accountNumber}/journals

MakePaymentCommand

PUT - /api/v1/account/{accountNumber}/make-payment

Disbursement, FTL

DrawdownCompletedEvent, ReadvanceCompletedEvent, MakePaymentRequestedEvent

QuarterlyRateResetCommand

PUT - /api/v1/account/{accountNumber}/rateChange

HLAccountDisbursedEvent, ReadvanceAddedEvent

RequestSettlementCommand

PUT - /api/v1/account/{accountNumber}/requestSettlement

SettleCommand

PUT - /api/v1/account/{accountNumber}/settle

UndoPaymentCommand

PUT - /api/v1/account/{accountNumber}/payments/undo

UpdateFeeCommand

PUT - /api/v1/account/{accountNumber}/fee

CreateOfferRequestCommand

POST - /api/v1/variableOffers

GenerateRCPQuoteCommand

PUT - /api/v1/generateQuote

Payments

MakeTransferCommand

PUT - /api/v1/accounts/{accountNumber}/transfers

PurchaseCommand

PurchaseInstructionSentEvent

PaymentHub

ReceiveTransferCommand

TransferMadeInstructionSentEvent

PaymentHub

Statement Mappings

CreateStatementConfigCommand

POST - /api/v1/statementConfigs

UpdateStatementConfigCommand

PUT - /api/v1/statementConfigs/{configId}

DeleteStatementConfigCommand

DELETE - /api/v1/statementConfigs/{id}

Event Description Mappings & Transaction Event Mappings

CreateEDMCommand

POST - /api/v1/eventDescriptionMappings

DeleteEDMCommand

DELETE - /api/v1/eventDescriptionMappings/{id}

UpdateEDMCommand

PUT - /api/v1/eventDescriptionMappings/{mappingId}

CreateTranEventMappingCommand

POST - /api/v1/transactionEventMappings

DeleteTranEventMappingCommand

DELETE - /api/v1/transactionEventMappings/{transactionEventMappingId}

UpdateTranEventMappingCommand

PUT - /api/v1/transactionEventMappings/{mappingId}

Product Configs

CreateSpvKeyConfigCommand

POST - /api/v1/spvKeyConfigs

UpdateSpvKeyConfigCommand

PUT - /api/v1/spvKeyConfigs/{spvKeyConfigId}

CreateFeeConfigCommand

POST - /api/v1/feeConfigs

UpdateFeeConfigCommand

PUT - /api/v1feeConfigs/{feeConfigId}

CreateAddonConfigCommand

POST - /api/v1/addonConfigs

CreateRuleCommand

POST - /api/v1/rules

UpdateRuleCommand

PUT - /api/v1rules/{ruleId}

DeleteRuleCommand

DELETE - /api/v1rules/{ruleId}

CreateProductCommand

POST - /api/v1/products

UpdateProductCommand

PUT - /api/v1products/{productId}

AddAddonConfigsCommand

POST - /api/v1/products/{productId}/addonConfigs

UpdateAddonConfigCommand

PUT - /api/v1/addonConfigs/{addonConfigId}

AddFeeConfigsCommand

PUT - /api/v1/products/{productId}/feeConfigs

UpdateFeeConfigCommand

PUT - /api/v1/products/{productId}/feeConfigs/{feeConfigId}, PUT - feeConfigs/{feeConfigId}

UpdateProductRulesCommand

PUT - /api/v1/products/{productId}/rules

External Calls

Command / API

Target Service

MakePaymentCommand

GET - /pmtcalc/api/v1/accounts/{accountNumber}/payment, flexifin-pmtcalc

InitiateDayEndCommand

GET - /pmtcalc/api/v1/accounts/{accountNumber}/payment, flexifin-pmtcalc

MakeTransferCommand

GET - /banking-query/api/v1/accounts/{accountNumber}, flexifin-banking-query

GenerateRCPQuoteCommand

GET - /api/v1/customers/{customerId}/quotes, flexifin-quote

GET - /accounts/{accountNumber}/transactions/document

GET - /rcp-query/api/v1/accounts/{accountNumber}, flexifin-rcp-query

POST - /accounts/{accountNumber}/monthlyStatements

GET - /masterdata/api/v1/customer/{customerId}, flexifin-masterdata (based on template definition)

refinance LoanApplicationApprovedEvent

GET - /masterdata/api/v1/naturalCustomers/{customerId}/preferredBankAccountDetails

Event Canvas

Event

Consuming Service

LoanComponentEvent

LoanComponentCreatedEvent

LoanComponentUpdatedEvent

LoanAccountExpirationBaseEvent

LoanAccountExpirationRequestedEvent

flexifin-disbursement

LoanAccountExpiredEvent

flexifin-disbursement

LookupEvent

LookupCreatedEvent

LookupDeletedEvent

LookupUpdatedEvent

LoanAgreementBaseEvent

LoanAgreementGeneratedEvent

SignedLoanAgreementUploadedEvent

StateEvent

AccountActivatedEvent

flexifin-message

AccountAttributePayloadUpdatedEvent

AccountCloseRequestedEvent

AccountCreatedEvent

flexifin-card-management, flexifin-disbursement, flexifin-application-assembly

AccountCancelledEvent

flexifin-disbursement

AccountDisbursedEvent

flexifin-disbursement

AccountEscalationUpdatedEvent

AccountInitiatedEvent

flexifin-application-assembly

AccountNextInstalmentDateUpdatedEvent

AccountPaymentHolidayDateUpdatedEvent

AccountReOpenRequestedEvent

AccountRuleUpdatedEvent

AccountSettledEvent

flexifin-disbursement

AccountSnapshotEvent

AccountStateChangedEvent

flexifin-disbursement

AccountStatementEvent

flexifin-message

AddonConfigCreatedEvent

AddonConfigUpdatedEvent

AddonCreatedEvent

AddonInterestAccruedEvent

AddonInterestDeferredEvent

AddonSnapshot

AddonTermUpdatedEvent

AddonUpdatedEvent

AddTransactionalEventRequestedEvent

AdhocAdjustmentAppliedEvent

AdjustAndCloseRequestedEvent

AdjustmentRequestedEvent

flexifin-deferred-payment

AllocationCreatedEvent

AllocationUpdatedEvent

ArrearsAccruedEvent

CreateFeeRequestedEvent

CreditPerformanceIndicatorCreatedEvent

CurrentInstalmentEscalatedEvent

CurrentPaymentUpdatedEvent

DayEndCompletedEvent

DayEndInitiatedEvent

DisbursementCapturedEvent

DisbursementRequestedEvent

flexifin-disbursement

DisbursementUpdatedEvent

EventConfigCreatedEvent

EventConfigDeletedEvent

EventConfigUpdatedEvent

EventDescriptionMappingCreatedEvent

EventDescriptionMappingDeletedEvent

EventDescriptionMappingUpdatedEvent

FeeConfigCreatedEvent

FeeConfigUpdatedEvent

FeeCreatedEvent

FeeUpdatedEvent

FundsReservedEvent

HLAccountCreatedEvent

HLAccountDisbursedEvent

HLAddonCreatedEvent

HLAddonUpdatedEvent

InstalmentPortionCreatedEvent

InstalmentPortionUpdatedEvent

InterestAccruedEvent

InterestDeferredEvent

LoanCancellationAbortedEvent

flexifin-disbursement

LoanCancellationExecutedEvent

flexifin-disbursement

LoanCancellationRequestedEvent

flexifin-disbursement

LoanCoolOffAbortedEvent

flexifin-disbursement

LoanCoolOffExecutedEvent

flexifin-disbursement

LoanCoolOffRequestedEvent

flexifin-disbursement

MakePaymentRequestedEvent

OfferRequestCreatedEvent

PayDayUpdatedEvent

PaymentAllocatedEvent

PaymentAppliedStateEvent

PaymentDeallocatedEvent

ProductCreatedEvent

ProductUpdatedEvent

RatesUpdatedEvent

RcpReasonCodeActionDefinitionLoadedEvent

flexifin-reason-codes

RcpReasonCodeAppliedEvent

RcpReasonCodeLiftedEvent

RuleCreatedEvent

RuleDeletedEvent

RuleUpdatedEvent

ScheduleUpdatedEvent

SettlementRequestedEvent

SpvKeyConfigCreatedEvent

SpvKeyConfigUpdatedEvent

StatementConfigCreatedEvent

StatementConfigDeletedEvent

StatementConfigUpdatedEvent

TermRemainingChangedEvent

TermUpdatedEvent

TransactionEventMappingCreatedEvent

TransactionEventMappingDeletedEvent

TransactionEventMappingUpdatedEvent

MemoEvent

RecalculatePaymentRequestedEvent

AccountRatesUpdatedEvent

AddonInstalmentChangedEvent

CreditAdjustedEvent

FeesCapitalisedEvent

GlobalRateChangedEvent

InstalmentChangedEvent

InterestRateChangedEvent

LendingMemoEvent

MonthEndClosingEvent

MonthEndOpeningEvent

PayDayUpdatedEvent

SpvKeyConfigUpdatedMemoEvent

TransactionalEvent

CapitalAddedEvent

flexifin-product-ledger

InAndOutTransactionalEvent

flexifin-product-ledger

InterestCapitalisedEvent

flexifin-product-ledger, flexifin-message

PaymentAppliedEvent

flexifin-product-ledger

PaymentMadeEvent

flexifin-product-ledger, flexifin-payment-hub

PurchaseMadeEvent

flexifin-product-ledger

RCPTransferAppliedEvent

**Deprecated

RCPTransferMadeEvent

**Deprecated

ReadvanceAddedEvent

flexifin-product-ledger

TransferAppliedEvent

flexifin-product-ledger

TransferMadeEvent

flexifin-product-ledger, flexifin-payment-hub

TransactionalEvent

SPVChangedFromEvent

SPVChangedToEvent