416 lines
13 KiB
Plaintext
416 lines
13 KiB
Plaintext
BankFeeds Module — RAG Knowledge Base (Optimized)
|
|
|
|
Chunk 1: BankFeeds Module Overview
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: N/A
|
|
• type: overview
|
|
• domain: PaymentProcessing
|
|
• system: AWS Step Functions
|
|
• purpose: Bank feed ingestion, transformation, and Oracle posting
|
|
• tags: stepFunctionPipeline, multiBank, orchestration
|
|
|
|
Content:
|
|
Purpose: Multi-stage AWS Step Functions pipeline for processing bank payment feeds into Oracle AR cash receipts.
|
|
Processing Logic:
|
|
|
|
Stage 1: Parse raw bank feed rows into PaymentRecord objects.
|
|
Stage 2: Enrich PaymentRecords into CashReceipt objects.
|
|
Stage 3: Group CashReceipts into ClientBatch for Oracle OIC submission.
|
|
Supported Banks: U.S. Bank Lockbox, U.S. Bank ELockbox (electronic), First Horizon Bank.
|
|
Integration: Oracle Integration Cloud (OIC) for AR posting, DynamoDB for state, CloudWatch for metrics.
|
|
Key Concepts: payment record transformation, orphan detection, chargeback handling, policy validation, batch submission.
|
|
References: ParseBankFeedLambda Stage, EnrichmentLambda Stage, GroupingLambda Stage
|
|
|
|
Chunk 2: ParseBankFeedLambda Stage
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: ParseBankFeedLambda
|
|
• type: component
|
|
• domain: PaymentProcessing
|
|
• system: AWS Lambda
|
|
• stage: 1
|
|
• purpose: Raw feed parsing
|
|
• tags: parser, lambda, bankFeed
|
|
• references: IBankFeedParser, Orphan Detection and Handling
|
|
|
|
Content:
|
|
Purpose: Converts raw bank feed rows into PaymentRecord objects.
|
|
Processing Logic:
|
|
|
|
Receives StepFunctionContext with FeedType, BatchReference, RawRows.
|
|
Resolves appropriate parser via IBankFeedParserResolver.
|
|
Invokes parser.ParseAsync to produce Payments, OrphanRemits, OrphanChecks, Errors, ChargeBacks.
|
|
Wraps in try-catch; logs exceptions; fails Step Function task on unexpected errors.
|
|
Output: Payments array, OrphanRemits/OrphanChecks, Errors list, ChargeBacks list.
|
|
Key Rules: StepFunctionContext updated per batch; errors do not halt entire batch; first stage of 3-stage pipeline.
|
|
|
|
Chunk 3: EnrichmentLambda Stage
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: EnrichmentLambda
|
|
• type: component
|
|
• domain: PaymentProcessing
|
|
• system: AWS Lambda
|
|
• stage: 2
|
|
• purpose: Payment enrichment
|
|
• tags: enrichment, lambda
|
|
• references: Lockbox Enrichment Pipeline, ELockbox Enrichment Pipeline, First Horizon Enrichment Pipeline
|
|
|
|
Content:
|
|
Purpose: Transforms PaymentRecord objects into CashReceipt objects.
|
|
Processing Logic:
|
|
|
|
Resolves bank-specific enrichment pipeline via IBankFeedEnrichmentPipelineResolver.
|
|
Calls pipeline.EnrichPayments with Payments array.
|
|
Handles empty payment arrays without breaking workflow.
|
|
Logs payment counts or reports no payments with orphan counts.
|
|
Output: Receipts array in StepFunctionContext.
|
|
|
|
Chunk 4: GroupingLambda Stage
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: GroupingLambda
|
|
• type: component
|
|
• domain: PaymentProcessing
|
|
• system: AWS Lambda
|
|
• stage: 3
|
|
• purpose: Cash receipt batching
|
|
• tags: batch, aggregation, lambda
|
|
• references: ClientBatch Model
|
|
|
|
Content:
|
|
Purpose: Aggregates CashReceipt objects into ClientBatch for Oracle submission.
|
|
Processing Logic:
|
|
|
|
Creates ClientBatch using BatchReference.
|
|
Adds all CashReceipts to batch.
|
|
Serializes batch to JSON (BatchJson).
|
|
Sets Status to Completed and ExecutionCompletedUtc timestamp.
|
|
Publishes EnrichmentLogSummary via IBankFeedMetricsPublisher if available.
|
|
Validation: Throws InvalidOperationException if Receipts null or empty.
|
|
|
|
Chunk 5: Lockbox Parser (U.S. Bank)
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: LockboxParser
|
|
• type: component
|
|
• domain: PaymentProcessing
|
|
• system: U.S. Bank
|
|
• feedType: Lockbox
|
|
• purpose: Parse paper check/remit feeds
|
|
• tags: parser, checkRemit, validation
|
|
• references: PaymentRecord Model, Orphan Detection and Handling, Transaction Validation Rules
|
|
|
|
Content:
|
|
Purpose: Parses Lockbox feeds with check and remittance rows.
|
|
Processing Logic:
|
|
|
|
Groups rows by integer TransactionId.
|
|
Pairs remits to checks.
|
|
Validates check total equals sum of remits within $0.01 tolerance.
|
|
Orphan checks/remits collected and logged.
|
|
Returns PaymentRecord objects for paired transactions.
|
|
|
|
Chunk 6: ELockbox Parser (U.S. Bank Electronic)
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: ELockboxParser
|
|
• type: component
|
|
• domain: PaymentProcessing
|
|
• system: U.S. Bank
|
|
• feedType: ELockbox
|
|
• purpose: Parse electronic Lockbox feeds
|
|
• tags: parser, electronic, checkRemit
|
|
• references: PaymentRecord Model, Orphan Detection and Handling
|
|
|
|
Content:
|
|
Purpose: Parses electronic Lockbox feeds using string TransactionId.
|
|
Processing Logic:
|
|
|
|
Groups rows by string TransactionId.
|
|
Pairs REMIT and CHECK rows.
|
|
Assigns PolicyNumber to ReceiptNumber.
|
|
Orphan remits/checks logged; no balance validation.
|
|
Returns PaymentRecord objects for paired transactions.
|
|
|
|
Chunk 7: First Horizon Parser
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: FirstHorizonParser
|
|
• type: component
|
|
• domain: PaymentProcessing
|
|
• system: First Horizon Bank
|
|
• feedType: FirstHorizon
|
|
• purpose: Parse simple payment rows and detect chargebacks
|
|
• tags: parser, chargeback
|
|
• references: PaymentRecord Model, ChargebackRecord Model
|
|
|
|
Content:
|
|
Purpose: Parses single-row-per-payment structure; detects chargebacks.
|
|
Processing Logic:
|
|
|
|
Creates PaymentRecord for each valid payment.
|
|
Identifies chargebacks via ReturnIndicator → IsChargeback flag.
|
|
Logs ChargebackRecord; excludes chargebacks from enrichment.
|
|
|
|
Chunk 8: PaymentRecord Model
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: PaymentRecord
|
|
• type: model
|
|
• domain: PaymentProcessing
|
|
• system: AWS Lambda
|
|
• purpose: Intermediate payment representation
|
|
• tags: parserOutput, enrichmentInput
|
|
• references: RemittanceDetail Model, CashReceipt Model
|
|
|
|
Content:
|
|
Properties: InternalPolicyNumber, CustomerAccountNumber, Amount, Currency, PaymentDate, ReceiptNumber, Remittances (list of RemittanceDetail).
|
|
Usage: Created by parser, consumed by enrichment pipeline.
|
|
|
|
Chunk 9: CashReceipt Model
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: CashReceipt
|
|
• type: model
|
|
• domain: OracleAR
|
|
• system: Oracle Fusion
|
|
• purpose: AR cash receipt record
|
|
• tags: oracleDocument, enrichmentOutput
|
|
• references: PaymentRecord Model, Policy Number Validation
|
|
|
|
Content:
|
|
Properties: ReceiptNumber, ReceiptMethod, BusinessUnit, Amount, Currency, ReferenceNumber, BusinessGroup, IntercompanyPaymentReference, UnidentifiedFundsClassification, RefundInvoiceNumber.
|
|
Logic: Matches valid policy → ReceiptMatchBy="Purchase Order"; invalid → UnidentifiedFundsClassification set.
|
|
|
|
Chunk 10: ClientBatch Model
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: ClientBatch
|
|
• type: model
|
|
• domain: OracleAR
|
|
• system: Oracle Fusion
|
|
• purpose: Grouped CashReceipts for OIC submission
|
|
• tags: batch, serialization
|
|
• references: CashReceipt Model
|
|
|
|
Content:
|
|
Properties: BatchReference, Receipts array.
|
|
Methods: Add(CashReceipt), Count.
|
|
Serialization: JsonProperty attributes for Oracle OIC.
|
|
|
|
Chunk 11: RemittanceDetail Model
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: RemittanceDetail
|
|
• type: model
|
|
• domain: PaymentProcessing
|
|
• system: AWS Lambda
|
|
• purpose: Invoice-level remittance detail
|
|
• tags: lineItem, parserOutput
|
|
• references: PaymentRecord Model, CashReceipt Model
|
|
|
|
Content:
|
|
Represents amount applied to an invoice/policy.
|
|
Parsed from Lockbox REMIT rows; multiple per PaymentRecord; generates CashReceipt per remittance.
|
|
|
|
Chunk 12: ChargebackRecord Model
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: ChargebackRecord
|
|
• type: model
|
|
• domain: PaymentProcessing
|
|
• system: First Horizon Bank
|
|
• purpose: Track returned payments
|
|
• tags: exceptionTracking, chargeback
|
|
• references: First Horizon Parser
|
|
|
|
Content:
|
|
Properties: PolicyNumber, Amount, Reason, PaymentDate.
|
|
First Horizon parser sets IsChargeback; stored in ParseResult.ChargeBacks; not enriched downstream.
|
|
|
|
Chunk 13: StepFunctionContext Model
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: StepFunctionContext
|
|
• type: model
|
|
• domain: PaymentProcessing
|
|
• system: AWS Step Functions
|
|
• purpose: Workflow state container
|
|
• tags: context, stateObject
|
|
• references: All Lambda Stages, ClientBatch Model
|
|
|
|
Content:
|
|
Properties: FeedType, BatchReference, RawRows, Payments, OrphanRemits, OrphanChecks, Errors, ChargeBacks, Receipts, BatchJson, Status, ExecutionCompletedUtc.
|
|
Lifecycle: Created by Step Function → parser → enrichment → grouping.
|
|
Serialization: JSON between Lambda invocations.
|
|
|
|
Chunk 14: Lockbox Enrichment Pipeline
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: LockboxEnrichmentPipeline
|
|
• type: component
|
|
• domain: PaymentProcessing
|
|
• system: AWS Lambda
|
|
• feedType: Lockbox
|
|
• purpose: Convert PaymentRecords to CashReceipts
|
|
• tags: enrichment, policyValidation
|
|
• references: PaymentRecord Model, CashReceipt Model, Policy Number Validation
|
|
|
|
Content:
|
|
|
|
Iterates PaymentRecord.Remittances.
|
|
Validates policy using RegexPatterns.PolicyRegex.
|
|
Creates CashReceipt per RemittanceDetail; sets ReferenceNumber if policy valid; otherwise sets UnidentifiedFundsClassification.
|
|
ReceiptMethod="HFA US Bank", BusinessUnit/Group=HFA constants.
|
|
|
|
Chunk 15: ELockbox Enrichment Pipeline
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: ELockBoxEnrichmentPipeline
|
|
• type: component
|
|
• domain: PaymentProcessing
|
|
• system: AWS Lambda
|
|
• feedType: ELockbox
|
|
• purpose: Convert electronic PaymentRecords to CashReceipts
|
|
• tags: enrichment, electronic
|
|
• references: PaymentRecord Model, CashReceipt Model, Policy Number Validation
|
|
|
|
Content:
|
|
Similar to Lockbox enrichment; tailored to electronic feed; validates policy; creates receipts per remittance. ReceiptMethod adjusted for electronic.
|
|
|
|
Chunk 16: First Horizon Enrichment Pipeline
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: FirstHorizonEnrichmentPipeline
|
|
• type: component
|
|
• domain: PaymentProcessing
|
|
• system: AWS Lambda
|
|
• feedType: FirstHorizon
|
|
• purpose: Convert PaymentRecords to CashReceipts using confirmation numbers
|
|
• tags: enrichment, chargebackExcluded
|
|
• references: PaymentRecord Model, CashReceipt Model
|
|
|
|
Content:
|
|
Creates one CashReceipt per PaymentRecord; validates policy; confirmation number → ReceiptNumber. Chargebacks excluded.
|
|
|
|
Chunk 17: Orphan Detection and Handling
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: N/A
|
|
• type: rule
|
|
• domain: PaymentProcessing
|
|
• system: All Lockbox Banks
|
|
• purpose: Identify unmatched check/remit rows
|
|
• tags: exceptionTracking
|
|
• references: ParseBankFeedLambda, LockboxParser, ELockboxParser
|
|
|
|
Content:
|
|
|
|
OrphanChecks: checks without remits; added to ParseResult.OrphanChecks.
|
|
OrphanRemits: remits without checks; added to ParseResult.OrphanRemits.
|
|
Logged as errors; require manual research.
|
|
|
|
Chunk 18: Transaction Validation Rules
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: N/A
|
|
• type: rule
|
|
• domain: PaymentProcessing
|
|
• system: Lockbox
|
|
• purpose: Ensure payment data integrity
|
|
• tags: validation
|
|
• references: Lockbox Parser
|
|
|
|
Content:
|
|
|
|
Check amount = sum of remits (tolerance $0.01).
|
|
Duplicate check detection per TransactionId.
|
|
Missing check numbers flagged.
|
|
Unbalanced transactions logged as errors.
|
|
|
|
Chunk 19: Policy Number Validation
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: RegexPatterns.PolicyRegex
|
|
• type: rule
|
|
• domain: PaymentProcessing
|
|
• system: Oracle Fusion
|
|
• purpose: Validate policy numbers for Oracle matching
|
|
• tags: validation, receiptMatching
|
|
• references: Lockbox Enrichment Pipeline, First Horizon Enrichment Pipeline
|
|
|
|
Content:
|
|
Valid policy → ReceiptMatchBy="Purchase Order", ReferenceNumber set. Invalid/missing → UnidentifiedFundsClassification applied.
|
|
|
|
Chunk 20: Business Unit, Legal Entity, and Receipt Method Defaults
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: CashReceiptConstants
|
|
• type: concept
|
|
• domain: Oracle AR
|
|
• system: Oracle Fusion
|
|
• purpose: Organizational defaults for receipts
|
|
• tags: configuration
|
|
• references: CashReceipt Model, Enrichment Pipelines
|
|
|
|
Content:
|
|
|
|
BusinessUnit_HFABU, BusinessGroup_HFA, LegalEntity_HfaLegalEntityID.
|
|
CurrencyUSD applied.
|
|
ReceiptMethod bank-specific: Lockbox="HFA US Bank".
|
|
|
|
Chunk 21: Error Collection and Reporting
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: ParseResult.Errors
|
|
• type: concept
|
|
• domain: PaymentProcessing
|
|
• system: All Banks
|
|
• purpose: Track parsing/enrichment errors
|
|
• tags: errorHandling
|
|
• references: ParseBankFeedLambda, EnrichmentLambda
|
|
|
|
Content:
|
|
|
|
Logs balance failures, duplicates, orphan rows, unknown types.
|
|
Does not halt processing; partial batches allowed.
|
|
Included in EnrichmentLogSummary for monitoring.
|
|
|
|
Chunk 22: Use Case — Standard Lockbox Processing
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: N/A
|
|
• type: workflow
|
|
• domain: PaymentProcessing
|
|
• system: U.S. Bank
|
|
• purpose: Daily Lockbox batch processing
|
|
• tags: workflow, example
|
|
• references: Lockbox Parser, Lockbox Enrichment Pipeline, GroupingLambda Stage
|
|
|
|
Content:
|
|
Scenario: Daily Lockbox file received with check/remit data.
|
|
|
|
Parser pairs checks/remits, validates balances.
|
|
Enrichment pipeline creates CashReceipts per remittance with policy validation.
|
|
GroupingLambda submits ClientBatch to Oracle OIC.
|
|
Orphans tracked for manual research.
|
|
|
|
Chunk 23: Use Case — First Horizon Chargeback Detection
|
|
Metadata:
|
|
• module: BankFeeds
|
|
• component: N/A
|
|
• type: workflow
|
|
• domain: PaymentProcessing
|
|
• system: First Horizon Bank
|
|
• purpose: Detect returned payments
|
|
• tags: workflow, example
|
|
• references: First Horizon Parser, ChargebackRecord Model
|
|
|
|
Content:
|
|
Scenario: Feed includes payment flagged as ReturnIndicator.
|
|
|
|
Parser sets IsChargeback, creates ChargebackRecord.
|
|
Chargebacks excluded from enrichment; logged for potential future processing.
|