ID: account-details | Legacy Source: CBACT01C, CBACT02C, CBACT03C, CBCUS01C + Flask GET /account/<id>
This guide covers the Account Details module — a unified view of a single account including its financial data, associated credit cards, and the linked customer profile resolved via the card cross-reference (XREF). This module replaces four COBOL batch readers and their orchestration in bridge.py.
| Layer | Target Component | Legacy Equivalent |
|---|---|---|
| API Controller | AccountsController.cs | Flask GET /account/<acct_id> |
| Application Query | GetAccountDetailsQuery.cs + GetAccountDetailsQueryHandler.cs | bridge.py:get_account(), get_cards_for_account(), get_customer_for_account() |
| Response DTO | AccountDetailsDto.cs (nested: cards[], customer) | Multiple ACCT01|CARD01|XREF03|CUST01 stream lines |
| Data Access | EF Core joins: Account → Cards → CardXref → Customer | Sequential reads of 4 ASCII flat files (CBACT01C/02C/03C, CBCUS01C) |
| React Page | AccountDetailPage.tsx | templates/account_detail.html |
| React Component | AccountInfoPanel.tsx | Account section in account_detail.html |
| React Component | CardListPanel.tsx | Cards section in account_detail.html |
| React Component | CustomerInfoPanel.tsx | Customer section in account_detail.html |
| React Hook | useAccountDetail.ts (TanStack Query) | Server-side render |
/api/accounts/{id}
Returns full account detail: account fields, associated cards, and linked customer. Equivalent to the combined output of CBACT01C + CBACT02C + CBACT03C + CBCUS01C.
{
"id": 4000000111,
"activeStatus": "Y",
"currentBalance": 1234.56,
"creditLimit": 5000.00,
"cashCreditLimit": 2500.00,
"openDate": "2018-03-15",
"expirationDate": "2028-03-15",
"reissueDate": "2023-03-15",
"currentCycleCredit": 0.00,
"currentCycleDebit": 0.00,
"addressZip": "10001",
"groupId": "GOLD",
"cards": [
{
"cardNumber": "4111111111111111",
"cvv": 123,
"embossedName": "JOHN A DOE",
"expirationDate": "2028-03",
"activeStatus": "Y"
}
],
"customer": {
"id": 111111111,
"firstName": "John",
"middleName": "A",
"lastName": "Doe",
"addressLine1": "123 Main St",
"addressStateCode": "NY",
"addressZip": "10001",
"ficoScore": 720,
"primaryCardHolder": "Y"
},
"xrefAmbiguityWarning": null
}
bridge.py:xref_cust_ambiguity_message() detects when multiple cards for the same account link to different customers. The xrefAmbiguityWarning field in the response must propagate this warning to the UI so users are informed when customer data may not be unique per account.
/api/accounts/{id}/cards
Returns only the list of cards associated with the account (no customer data).
// AccountDetailsDto — composite response for the detail page
public record AccountDetailsDto(
long Id,
string ActiveStatus,
decimal CurrentBalance,
decimal CreditLimit,
decimal CashCreditLimit,
DateOnly OpenDate,
DateOnly ExpirationDate,
DateOnly? ReissueDate,
decimal CurrentCycleCredit,
decimal CurrentCycleDebit,
string AddressZip,
string GroupId,
IReadOnlyList<CardDto> Cards,
CustomerSummaryDto? Customer,
string? XrefAmbiguityWarning // null if no ambiguity detected
);
4000000111 exists with 2 cards and a linked customer, When GET /api/accounts/4000000111 is called, Then the response includes all account fields, a 2-card array, and a customer object.GET /api/accounts/9999999999 is called, Then the API returns 404 Not Found with a descriptive message.templates/404.html behavior (mirrors COACTVWC "account not found in XREF" path).ibm_money filter).4000000999 has 0 cards in the cross-reference, When the detail page loads, Then the cards panel shows "No cards found for this account."4000000222 has 2 cards linked to 2 different customer IDs, When the detail page loads, Then a warning banner is displayed: "Warning: Multiple customers linked to this account via card cross-reference. Showing primary customer."xrefAmbiguityWarning string describing the ambiguity.4000000111, When they click "Edit Account", Then they are navigated to /accounts/4000000111/edit.| Points | Example |
|---|---|
| 1–2 | Add a "Copy Account ID" button. Show card expiration as a human-readable month/year string. |
| 3–5 | Implement the XREF ambiguity warning end-to-end (API + UI). Add transaction history panel (requires new endpoint). |
| 8+ | Add real-time account status monitoring via SignalR WebSockets. Account audit trail with full change history. |
GET /api/accounts/{id} response time: <200ms P95 (single EF Core query with Include).card_customer_xref(account_id, customer_id) to support efficient ambiguity detection.