Loan offer operations
- Follow a channel inquiry, offer utilization and the resulting campaign work through their owners.
Select a component to trace its direct connections. Drag to pan · Ctrl + wheel or pinch to zoom.
- Inquiry returns an available amount and an equated monthly instalment (EMI) under the applicable rules. It is a read at a point in time and leaves the allowance available for other callers.
- Utilization spends that allowance. The writer must check the current limit again if another utilization has committed since the inquiry.
Reading
- Inquiry calculates usable amount and EMI for the requested offer.
- Utilization changes offer and limit state. A later inquiry can see less availability.
- Campaign refresh has its own completion signal. A channel can receive a local result while Customer Power still has work to finish.
Loan offer operations
Loan offer operations
Customer/product offers and shared PAN controls
From channel request to usable offer
- Create or refresh selects a customer/product record and can replace its prior active offer.
- Inquiry combines that active offer with configured amount, EMI and eligibility rules. A shared allowance can restrict what the customer may use.
- Utilization applies the relevant limits. Suppression withdraws availability. Eligible mutations also trigger campaign work.
Follow one changed result
- A customer inquires, then utilizes part of an eligible offer. LCM updates the relevant business state.
- The channel can inquire again for the remaining usable amount. Campaign workers separately suppress or refresh the eligible banners in Customer Power.
- A slow campaign refresh can leave a stale banner. Recheck availability at the authoritative loan operation before accepting a use.
Choose the change boundary
- Keep offer mutation and its applicable rules under one consistency owner. Introducing a remote call between a debit and shared-limit enforcement adds a second failure boundary.
- Consider separating campaign dispatch capacity when measured queue age or provider waits interfere with serving requests. Preserve the existing loan API response semantics during migration.
- LoanInquiry routes a channel request through the loan wrapper to the configured rules. Measure rule time and downstream wait separately when a channel misses its deadline.
File and maintenance entry
File and maintenance entry
Customer/product offers and shared PAN controls
Bulk creation
- File registration, staging and authorization precede record processing. The configured sync or async path invokes the loan creation service.
- A file identifier proves intake only. Inspect the owning file and record states before reporting committed offers.
Maintenance and concurrency
- Operations users have a separate maintenance entry. Contract and authorization determine which states they may change.
- A replacement or withdrawal can race with a channel utilization. The proposed writer rechecks offer status and version after acquiring the relevant guards.
Concurrent utilization and replay
Proposed local transaction contract · illustrative acceptance cases
Bind replay to the business command
- Prefer an existing durable transaction reference after verifying uniqueness, scope and retry behavior. If the caller cannot supply a stable identity, expose authorized outcome lookup before accepting automatic replay.
- Scope the receipt to the authorized caller and operation. Persist a normalized request fingerprint so the same ID cannot silently acquire a new amount or target.
- Reserve the unique ID in the mutation transaction. After a lost response, check that receipt before re-evaluating a now-smaller allowance.
Proposed transaction and replay contracttext
Proposed utilization contract (pseudocode, illustrative fields)
Before opening the transaction:
Authenticate the caller and authorize today's access to this offer.
Normalize units, product, operation type and expected offer version.
Bind these fields and the affected offer identity to the command fingerprint.
In one local transaction:
Reserve (authorized caller scope, stable operation ID) under a unique constraint.
If already committed:
Different fingerprint -> reject ID reuse.
Same fingerprint -> return the authorized, stored business result.
If another transaction owns the reservation:
Wait within the request deadline or return the agreed pending outcome.
Re-read the authoritative receipt before starting any new attempt.
Resolve all applicable offer and shared-control rows.
Acquire guards in a consistent order across all writers.
Recheck rule membership, offer version, status, amount and EMI using current rows.
If stale or ineligible:
Record a deterministic rejection for this command and commit the receipt.
Otherwise:
Apply local utilization to offer and applicable shared controls.
Record the result and, where required, durable campaign-dispatch intent.
Commit once, then reply.
If the reply is lost:
Use the original caller scope, operation ID and fingerprint for result lookup.
If the commit is unresolved, reconcile at the transaction owner before re-execution.
Outside the transaction:
Dispatch any committed campaign intent using its own recoverable stage protocol.
A remote campaign acknowledgement describes a separate outcome.
Two concurrent uses
- Start two eligible 50-unit commands for separate offers sharing 80 units. Lock or conditionally update the relevant controls at commit, with consistent ordering for every writer.
- Either order can win. The first accepted use leaves 30. The second must re-evaluate and receive the established insufficient-availability outcome.
- An earlier inquiry is a quote. If the business promises a time-limited reservation, add a separately approved hold/expiry contract and size the capacity tied up in holds.
Acceptance cases for two simultaneous usesjson
{
"scope": "Proposed acceptance scenario, shared amount is the binding rule",
"setup": { "offerA": 60, "offerB": 60, "sharedRemaining": 80 },
"commands": [
{ "id": "first-use", "offer": "A", "units": 50 },
{ "id": "other-use", "offer": "B", "units": 50 }
],
"allowedSchedules": [
{ "commitOrder": ["first-use", "other-use"], "accepted": "first-use", "remaining": 30 },
{ "commitOrder": ["other-use", "first-use"], "accepted": "other-use", "remaining": 30 }
],
"failureChecks": [
{ "event": "Accepted response lost; same command delivered again", "expected": "Return original receipt; remaining stays 30" },
{ "event": "Repeat accepted ID with a different amount", "expected": "Reject the changed fingerprint; remaining stays 30" },
{ "event": "Crash before local commit", "expected": "No debit, committed receipt or dispatch intent for that transaction" },
{ "event": "Crash after local commit, before campaign send", "expected": "One local debit, committed result and discoverable dispatch intent" }
]
}
Check the crash boundaries
| Failure | Check at the authoritative writer |
|---|---|
| Request times out before commit is known | Look up the same operation within caller scope. Keep an unresolved result pending investigation. |
| Commit succeeds and response is lost | Replaying the same ID and fingerprint returns the recorded result. One debit and at most one local intent exist. |
| Old offer is refreshed before utilization | Recheck the expected version/status and all controls. Preserve the channel’s documented rejection or re-inquiry contract. |
| Campaign send is delayed or redelivered | Reuse the committed dispatch identity and reconcile CP’s stage outcome. Local commit alone cannot prove remote application. |
Adopt and reverse safely
- First inspect every channel, bulk and maintenance writer, existing transaction resources, locks and receipt semantics. Reuse an equivalent mechanism where verified.
- Exercise both race orders, concurrent duplicate IDs, changed payload, stale offer version, and disconnects before/after commit against the target database. Include hot-key lock waits and deadline exhaustion.
- Roll out one write owner at a time, with a compatible receipt reader for old requests. During rollback retain receipts and dispatched operation IDs throughout the agreed retry horizon.
- Compare lock-wait latency and queue age under mixed load. Expanding synchronous critical sections to include a remote campaign call would make CP latency hold offer locks.