From 95b4610927b85cd8fc3a3b501d882422c5f8990a Mon Sep 17 00:00:00 2001 From: Sean Date: Wed, 8 Apr 2026 12:47:30 -0400 Subject: [PATCH] Reorganize Book folder --- Books/Accounting/{ => Accounting}/Account.txt | 0 .../Accounting/{ => Accounting}/BankFeed.txt | 0 .../{ => Accounting}/BillingChange.txt | 0 .../{ => Accounting}/CashReceipts.txt | 0 Books/Accounting/{ => Accounting}/Common.txt | 0 .../{ => Accounting}/Endorsement.txt | 0 Books/Accounting/{ => Accounting}/Fifo.txt | 0 .../{ => Accounting}/Integrations.txt | 0 .../{ => Accounting}/PayoffBalance.txt | 0 Books/Accounting/{ => Accounting}/Policy.txt | 0 Books/Accounting/{ => Accounting}/Quote.txt | 0 .../{ => Accounting}/Repository.txt | 0 .../Accounting/{ => Accounting}/Services.txt | 0 Books/Accounting/{ => Accounting}/Starter.txt | 0 .../{ => Accounting}/StructuredTags.txt | 0 .../AccountsReceivable/AccountsReceivable.txt | 557 ++++++++++++++++++ .../AccountsReceivableAdjustments.txt | 490 +++++++++++++++ ...ountsReceivableCashReceiptApplications.txt | 241 ++++++++ .../AccountsReceivableCashReceipts.txt | 402 +++++++++++++ .../AccountsReceivableCommon.txt | 458 ++++++++++++++ ...countsReceivableCreditMemoApplications.txt | 276 +++++++++ .../AccountsReceivableCreditMemoRefunds.txt | 0 .../AccountsReceivableCreditMemos.txt | 190 ++++++ .../AccountsReceivableInvoiceInstallments.txt | 178 ++++++ Books/Music/Song Queues/Seans Mission.txt | 30 + .../Song Queues/The Strong Willed Man.txt | 27 + Books/Music/Song Queues/The Undecided Man.txt | 30 + Scales.py | 2 +- 28 files changed, 2880 insertions(+), 1 deletion(-) rename Books/Accounting/{ => Accounting}/Account.txt (100%) rename Books/Accounting/{ => Accounting}/BankFeed.txt (100%) rename Books/Accounting/{ => Accounting}/BillingChange.txt (100%) rename Books/Accounting/{ => Accounting}/CashReceipts.txt (100%) rename Books/Accounting/{ => Accounting}/Common.txt (100%) rename Books/Accounting/{ => Accounting}/Endorsement.txt (100%) rename Books/Accounting/{ => Accounting}/Fifo.txt (100%) rename Books/Accounting/{ => Accounting}/Integrations.txt (100%) rename Books/Accounting/{ => Accounting}/PayoffBalance.txt (100%) rename Books/Accounting/{ => Accounting}/Policy.txt (100%) rename Books/Accounting/{ => Accounting}/Quote.txt (100%) rename Books/Accounting/{ => Accounting}/Repository.txt (100%) rename Books/Accounting/{ => Accounting}/Services.txt (100%) rename Books/Accounting/{ => Accounting}/Starter.txt (100%) rename Books/Accounting/{ => Accounting}/StructuredTags.txt (100%) create mode 100644 Books/Accounting/AccountsReceivable/AccountsReceivable.txt create mode 100644 Books/Accounting/AccountsReceivable/AccountsReceivableAdjustments.txt create mode 100644 Books/Accounting/AccountsReceivable/AccountsReceivableCashReceiptApplications.txt create mode 100644 Books/Accounting/AccountsReceivable/AccountsReceivableCashReceipts.txt create mode 100644 Books/Accounting/AccountsReceivable/AccountsReceivableCommon.txt create mode 100644 Books/Accounting/AccountsReceivable/AccountsReceivableCreditMemoApplications.txt create mode 100644 Books/Accounting/AccountsReceivable/AccountsReceivableCreditMemoRefunds.txt create mode 100644 Books/Accounting/AccountsReceivable/AccountsReceivableCreditMemos.txt create mode 100644 Books/Accounting/AccountsReceivable/AccountsReceivableInvoiceInstallments.txt create mode 100644 Books/Music/Song Queues/Seans Mission.txt create mode 100644 Books/Music/Song Queues/The Strong Willed Man.txt create mode 100644 Books/Music/Song Queues/The Undecided Man.txt diff --git a/Books/Accounting/Account.txt b/Books/Accounting/Accounting/Account.txt similarity index 100% rename from Books/Accounting/Account.txt rename to Books/Accounting/Accounting/Account.txt diff --git a/Books/Accounting/BankFeed.txt b/Books/Accounting/Accounting/BankFeed.txt similarity index 100% rename from Books/Accounting/BankFeed.txt rename to Books/Accounting/Accounting/BankFeed.txt diff --git a/Books/Accounting/BillingChange.txt b/Books/Accounting/Accounting/BillingChange.txt similarity index 100% rename from Books/Accounting/BillingChange.txt rename to Books/Accounting/Accounting/BillingChange.txt diff --git a/Books/Accounting/CashReceipts.txt b/Books/Accounting/Accounting/CashReceipts.txt similarity index 100% rename from Books/Accounting/CashReceipts.txt rename to Books/Accounting/Accounting/CashReceipts.txt diff --git a/Books/Accounting/Common.txt b/Books/Accounting/Accounting/Common.txt similarity index 100% rename from Books/Accounting/Common.txt rename to Books/Accounting/Accounting/Common.txt diff --git a/Books/Accounting/Endorsement.txt b/Books/Accounting/Accounting/Endorsement.txt similarity index 100% rename from Books/Accounting/Endorsement.txt rename to Books/Accounting/Accounting/Endorsement.txt diff --git a/Books/Accounting/Fifo.txt b/Books/Accounting/Accounting/Fifo.txt similarity index 100% rename from Books/Accounting/Fifo.txt rename to Books/Accounting/Accounting/Fifo.txt diff --git a/Books/Accounting/Integrations.txt b/Books/Accounting/Accounting/Integrations.txt similarity index 100% rename from Books/Accounting/Integrations.txt rename to Books/Accounting/Accounting/Integrations.txt diff --git a/Books/Accounting/PayoffBalance.txt b/Books/Accounting/Accounting/PayoffBalance.txt similarity index 100% rename from Books/Accounting/PayoffBalance.txt rename to Books/Accounting/Accounting/PayoffBalance.txt diff --git a/Books/Accounting/Policy.txt b/Books/Accounting/Accounting/Policy.txt similarity index 100% rename from Books/Accounting/Policy.txt rename to Books/Accounting/Accounting/Policy.txt diff --git a/Books/Accounting/Quote.txt b/Books/Accounting/Accounting/Quote.txt similarity index 100% rename from Books/Accounting/Quote.txt rename to Books/Accounting/Accounting/Quote.txt diff --git a/Books/Accounting/Repository.txt b/Books/Accounting/Accounting/Repository.txt similarity index 100% rename from Books/Accounting/Repository.txt rename to Books/Accounting/Accounting/Repository.txt diff --git a/Books/Accounting/Services.txt b/Books/Accounting/Accounting/Services.txt similarity index 100% rename from Books/Accounting/Services.txt rename to Books/Accounting/Accounting/Services.txt diff --git a/Books/Accounting/Starter.txt b/Books/Accounting/Accounting/Starter.txt similarity index 100% rename from Books/Accounting/Starter.txt rename to Books/Accounting/Accounting/Starter.txt diff --git a/Books/Accounting/StructuredTags.txt b/Books/Accounting/Accounting/StructuredTags.txt similarity index 100% rename from Books/Accounting/StructuredTags.txt rename to Books/Accounting/Accounting/StructuredTags.txt diff --git a/Books/Accounting/AccountsReceivable/AccountsReceivable.txt b/Books/Accounting/AccountsReceivable/AccountsReceivable.txt new file mode 100644 index 0000000..980006d --- /dev/null +++ b/Books/Accounting/AccountsReceivable/AccountsReceivable.txt @@ -0,0 +1,557 @@ +RAG Knowledge Chunks for CMH.HFA.Accounting.AccountsReceivable +--- +Title: CustomerCreateLambda - Oracle Customer Creation Component +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: CustomerCreateLambda +• type: component +• domain: Customer Management +• system: Oracle +Content: Purpose: AWS Lambda function that creates new customer records in Oracle via OracleCustomerIntegration. +Processing Logic: +• Accepts OracleCustomer object as input +• Sets AccountSource to "HFA" for first account +• Delegates to IOracleCustomerIntegration.CreateCustomer +• Returns created OracleCustomer with Oracle-assigned IDs +Key Rules: +• AccountSource is always "HFA" for account creation +• Lambda configuration: 256MB memory, 30s timeout +Example Questions: +• How do I create a new customer in Oracle? +• What AccountSource is used for HFA customer creation? +• Which component handles customer creation? +--- +Title: CustomerGetLambda - Multi-Method Customer Retrieval +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: CustomerGetLambda +• type: component +• domain: Customer Management +• system: Oracle +Content: Purpose: AWS Lambda providing multiple methods to retrieve customer data from Oracle and account links from AccountsService. +Processing Logic: +• Get() method: Retrieves customer by AccountSourceReference, AccountNumber, or CustAccountId (priority order) +• GetAccountWithLinks(): Retrieves iSeries account key linked to AccountSourceReference +• GetAccountLinksByLinkedAccountNumber(): Retrieves accounts by linked account number and source +• GetCustomerActivity(): Retrieves customer account activity summary by CustAccountId +Key Rules: +• Throws ArgumentNullException if all identifiers are null +• Priority: AccountSourceReference > AccountNumber > CustAccountId +Example Questions: +• How do I retrieve a customer using policy number? +• What identifiers can query Oracle customers? +• How do I get iSeries account keys for Oracle customers? +--- +Title: OracleCustomer DTO Structure +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: OracleCustomer +• type: concept +• domain: Customer Management +• system: Oracle +Content: Purpose: Data structure representing Oracle customer entity with party and account information. +Properties: +• Version, SourceSystem, PartyId +• CustomerNumber (Oracle-assigned) +• PartyType (Person/Organization) +• FirstName, MiddleName, LastName, NameSuffix +• PartySourceSystemReferenceId (external system reference) +• Accounts[] (array of Account objects) +Inheritance: Extends AuditableEntityBase for audit tracking +Example Questions: +• What fields define an Oracle customer? +• How is customer name structured in Oracle? +• What is PartySourceSystemReferenceId used for? +--- +Title: Account DTO Structure +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: Account +• type: concept +• domain: Customer Management +• system: Oracle +Content: Purpose: Data structure representing Oracle customer account with source references and status. +Properties: +• CustAccountId (Oracle ID, mapped from "CustAccountId" JSON) +• AccountNumber, AccountSource, AccountSourceReference +• AccountDescription, AccountType, CustomerClass +• AccountEstablishedDate, AccountTerminationDate (DateOnly) +• AccountStatus, PartyId +• Sites[] (array of Site objects) +Inheritance: Extends AuditableEntityBase +Example Questions: +• What identifies an Oracle account record? +• How are account source references structured? +• What account metadata is tracked? +--- +Title: AccountIdDto - Account Identifier Container +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: AccountIdDto +• type: concept +• domain: Customer Management +• system: Multi-system +Content: Purpose: Container for passing account identifiers between step functions and Lambda invocations. +Properties: +• AccountSourceReference (nullable string) - external system reference +• AccountNumber (nullable string) - Oracle account number +• CustAccountId (nullable string) - Oracle customer account ID +Key Rules: +• All fields optional, at least one required for customer lookups +• Used as input parameter for CustomerGetLambda methods +Example Questions: +• How do I pass account identifiers to Lambda functions? +• What account lookup keys are supported? +• What DTO is used for step function account passing? +--- +Title: PolicyInvoiceLambda - Invoice Get/Post Operations +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: PolicyInvoiceLambda +• type: component +• domain: Invoice Management +• system: Oracle +Content: Purpose: AWS Lambda for retrieving and posting invoices to Oracle via OIC (Oracle Integration Cloud). +Processing Logic: +• Get(): Retrieves invoice by InvoiceId OR by PolicyNumber+CustomerNumber combination +• Post(): Creates new invoice in Oracle +• Delegates all operations to IOracleInvoiceIntegration +Key Rules: +• Get requires either InvoiceId OR (PolicyNumber AND CustomerNumber) +• Throws exception for invalid request combinations +Example Questions: +• How do I retrieve an invoice by policy number? +• Which Lambda posts invoices to Oracle? +• What are valid invoice lookup parameters? +--- +Title: InvoicesGetLambda - Multi-Invoice Retrieval with Sorting +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: InvoicesGetLambda +• type: component +• domain: Invoice Management +• system: Oracle +Content: Purpose: Retrieves multiple invoices from Oracle with configurable sorting. +Processing Logic: +• Accepts GetInvoicesDto with filter and sort criteria +• Delegates retrieval to IOracleInvoiceIntegration +• Applies sorting based on OrderOptions.PropertyName and SortBy +• Returns sorted List +Sortable Fields: +• DocumentNumber (default), TransactionDate, DueDate, AccountingDate, TransactionNumber +Key Rules: +• Throws ArgumentException for unsupported sort fields +• Supports Ascending/Descending order via SortByOption +Example Questions: +• How do I retrieve invoices sorted by due date? +• What fields can invoices be sorted by? +• Which Lambda handles bulk invoice retrieval? +--- +Title: OracleInvoice DTO Structure +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: OracleInvoice +• type: concept +• domain: Invoice Management +• system: Oracle +Content: Purpose: Data structure representing an invoice in Oracle AR system. +Key Properties: +• TransactionID, TransactionNumber, DocumentNumber +• TransactionClass (always "Invoice"), TransactionType +• TransactionDate, AccountingDate, DueDate (date fields) +• CustomerAccountNumber, SitePurposeSiteNumber +• TransactionLines[] (list of Transactionline objects) +• InvoiceBalanceAmount, TransactionStatus, PrintStatus +Static Values: +• BusinessUnit = "HFA BU" +• TransactionSource = "HFA Agency Management System" +• CurrencyCode = "USD" +• LegalEntityID = "62-1764688" +Computed Property: +• PremiumAmount: Sum of transaction lines containing "premium" in description +Example Questions: +• What fields define an Oracle invoice? +• What static values are set for HFA invoices? +• How is premium amount calculated? +--- +Title: InvoiceStatic Constants - Invoice Configuration Values +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: InvoiceStatic +• type: rule +• domain: Invoice Management +• system: Oracle +Content: Purpose: Centralized constant values for invoice processing configuration. +Core Constants: +• HfaLegalEntityID: "62-1764688" +• HfaAgencyManagementSystem: "HFA Agency Management System" +• USD: "USD", Invoice: "Invoice", Billing: "Billing" +• GenerateBillNo: "No", BillTo: "BILL_TO" +Business Groups: +• HfaHmhPremium, HfaMhwHbppPremium, HfaMhwEscPremium +Line Types: +• Premium, Fees, NonRefundableFees, NonRefundableFeesWithCommission, SalesTax +Coverage Codes: +• CTX, EMPAT, FCPRS, HCFAS, IGA, LFPEA, MNFSR, POLFE, SURC +Example Questions: +• What is the HFA legal entity ID for invoices? +• What business groups are supported? +• What line types are available for invoices? +--- +Title: HfaStatic Constants - HFA System-Wide Values +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: HfaStatic +• type: rule +• domain: System Configuration +• system: HFA +Content: Purpose: System-wide constant values used across HFA accounting modules. +Constants: +• Credit: "Credit", Debit: "Debit" +• HFA: "HFA" +• HfaAgencyManagementSystem: "HFA Agency Management System" +• HfaBusinessUnit: "HFA BU" +• HFASystems: "HFA SYSTEMS" +• NewStatus: "New", RenewalStatus: "Renewal" +• USD: "USD" +Usage: Referenced throughout invoice, general ledger, and customer modules for consistent value assignment. +Example Questions: +• What is the HFA business unit identifier? +• What currency code is used for HFA transactions? +• What status values are used for new vs renewal transactions? +--- +Title: GeneralLedgerStatic Constants - GL Configuration +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: GeneralLedgerStatic +• type: rule +• domain: General Ledger +• system: Oracle GL +Content: Purpose: Centralized constants for general ledger posting configuration. +Core Constants: +• LedgerName: "Clayton GAAP USD" +• ActualFlag_A: "A", Version19: "V1.9" +• ApplicaitonName: "CMH.HFA.Accounting.AccountsReceivable" +• SourceServer: "AWS", Priority: 2, MaxWait: 3000 +Account Codes: +• A198000, A200001, A200110, A201004, A450007, A450008 +Cost Centers: C0700, C999, C9999 Entities: E200, E400, E500, E501, E999 Product Lines: P001, P003, P004, P999 Location: L00000, Future: F99999 +Example Questions: +• What ledger name is used for HFA general ledger? +• What account codes are used for GL postings? +• What is the GL version identifier? +--- +Title: GeneralLedgerHelper - GL Posting and Event Publishing +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: GeneralLedgerHelper +• type: component +• domain: General Ledger +• system: Integration Hub +Content: Purpose: Posts general ledger entries to Integration Hub and publishes retail disbursement events. +Processing Logic: +• Post(): Submits GeneralLedgerModel to Integration Hub +• GetRetailDisbursementEvent(): Maps PreGeneralLedger to CommissionDisbursementEvent for retail consumption +Key Rules: +• Returns success message with GL ID from first payload item +• Event includes SubType, PolicyNumber, CommissionReference, amounts +Example Questions: +• How do I post general ledger entries? +• Which component publishes retail disbursement events? +• What is included in commission disbursement events? +--- +Title: ApPaymentRequestHelper - AP Payment Processing +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: ApPaymentRequestHelper +• type: component +• domain: Accounts Payable +• system: Integration Hub +Content: Purpose: Posts AP payment requests to Integration Hub and maps account links to keys. +Processing Logic: +• Post(): Validates and submits ApPaymentRequestModel +• MapAccountLinkToAccountKey(): Extracts iSeriesAccountKey from AccountLinks +• MapAccountLinkToPolicyNo(): Extracts HfaPolicyNumber from AccountLinks +Validation Rules: +• ClaytonBusinessUnit, ApplicationName, SourceServer required +• Payload must have at least one item +• Invoice with InvoiceNumber and InvoiceLines required +• InvoiceLine Amount must be > 0 +Example Questions: +• How do I submit an AP payment request? +• How do I map account links to iSeries account key? +• What validations apply to AP payment requests? +--- +Title: AccountLink Mapping Rules - iSeries and Policy Number Extraction +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: ApPaymentRequestHelper +• type: rule +• domain: Account Management +• system: Multi-system +Content: Purpose: Extract specific account keys from AccountLinks array based on AccountSource. +Mapping Logic: +• iSeriesAccountKey: Find AccountLink where AccountSource contains "iSeriesAccountKey" (case-insensitive substring match) +• HfaPolicyNumber: Find AccountLink where AccountSource equals "HfaPolicyNumber" (case-insensitive exact match) +Key Rules: +• Throws InvalidOperationException if target AccountLink not found +• Requires at least one AccountLink in AccountDto +• Returns AccountNumber from matched AccountLink +Example Questions: +• How do I extract iSeries account key from account links? +• What AccountSource identifies HFA policy numbers? +• How are account links filtered? +--- +Title: UnappliedCashReceiptNotifyLambda - Email Notification Workflow +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: UnappliedCashReceiptNotifyLambda +• type: workflow +• domain: Cash Receipts +• system: Email/Mail Relay +Content: Purpose: Notifies stakeholders about unapplied cash receipts via email with Excel attachment. +Processing Flow: +1. Filter receipts: UnappliedAmount > 0 AND ReceiptState = "Unapplied" (case-insensitive) +2. Generate Excel report with receipt details (if receipts found) +3. Send email via IMailRelayService with attachment +4. Return execution result with email status +Key Rules: +• FromEmail: "noreply_hfa_accountsreceivable@claytonhomes.com" +• Resilient: sends email without attachment if Excel generation fails +• Returns success if no unapplied receipts (nothing to notify) +Example Questions: +• How are unapplied receipts identified? +• Which Lambda sends unapplied receipt notifications? +• What happens if no unapplied receipts are found? +--- +Title: ReceiptStatic Constants - Receipt Configuration +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: ReceiptStatic +• type: rule +• domain: Cash Receipts +• system: Oracle AR +Content: Purpose: Constant values for receipt processing and status identification. +Constants: +• ReceiptMethodIcVmf: "HFA I/C VMF" +• Unapplied: "Unapplied" +• Remitted: "Remitted" +Usage: Used to identify receipt states and methods throughout receipt processing workflows. +Example Questions: +• What receipt method identifier is used for VMF? +• What value indicates an unapplied receipt? +• What are valid receipt status values? +--- +Title: OracleIntegrationBase - Authentication and Request Building +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: OracleIntegrationBase +• type: component +• domain: Integration +• system: Oracle OIC +Content: Purpose: Base class for Oracle Integration Cloud (OIC) integrations providing authentication and request configuration. +Processing Logic: +• OracleBaseUrl(): Constructs base URL using environment-specific OIC subdomain +• GetRequestAsync(): Creates authenticated Flurl request with basic auth credentials +• GetRequestForJsonContent(): Adds "Content-Type: application/json" header +Secret Management: +• Retrieves credentials from secrets: {environment}-hfa-oic-username, {environment}-hfa-oic-password +• Retrieves OIC environment from: {environment}-hfa-oic-environment +URL Pattern: https://erp-{oicEnv}-oicintegration-idq4hj6bgo2f-ia.integration.ocp.oraclecloud.com +Example Questions: +• How do Oracle integrations authenticate? +• What is the OIC base URL structure? +• How are OIC credentials retrieved? +--- +Title: OracleEndpoints - OIC API Endpoint Definitions +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: OracleEndpoints +• type: rule +• domain: Integration +• system: Oracle OIC +Content: Purpose: Centralized definitions of Oracle Integration Cloud REST API endpoints. +Endpoint Definitions: +• LookupEndpoint: /ic/api/integration/v1/flows/rest/CHI_LOOKUP_API/1.0/lookup?LookupType=CHI_HFA_LOOKUPS +• InvoiceEndpoint: /ic/api/integration/v1/flows/rest/CHI_ARINVOICE_AP/1.0/invoice +• CustomerEndpoint: /ic/api/integration/v1/flows/rest/CHI_CUSTOMER_API/1.0/Customer +• InstallmentEndpoint: /ic/api/integration/v1/flows/rest/CHI_INSTALLMEN_API/1.0/installment +• PostApplyReceiptToInvoiceEndpoint: /ic/api/integration/v1/flows/rest/CHI_RECEIPTAPP_API/1.0/ReceiptApplication +• CustomerAccountActivitySummaryEndpoint: /ic/api/integration/v1/flows/rest/CHI_ARCUSTOMER_API/1.0/ARCustomerAccountActivities +Example Questions: +• What is the endpoint for posting invoices to Oracle? +• Which endpoint retrieves customer account activity? +• What are the OIC flow names for HFA integrations? +--- +Title: DecrementPolicyNumberLambda - Policy Number Decrement Logic +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: DecrementPolicyNumberLambda +• type: component +• domain: Policy Management +• system: HFA +Content: Purpose: Decrements the last two digits of a policy number using modulo arithmetic. +Processing Logic: +• Extract prefix (all characters except last 2) +• Extract numeral part (last 2 characters) +• Parse numeral as integer +• Decrement: (numeral - 1 + 100) % 100 +• Return: prefix + decremented numeral (zero-padded to 2 digits) +Validation: +• Policy number must be at least 2 characters +• Last 2 characters must be numeric +Example Questions: +• How do I decrement a policy number? +• What format is required for policy numbers? +• How are policy number suffixes handled? +--- +Title: StringExtension - Pre-Value Padding Helper +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: StringExtension +• type: rule +• domain: String Manipulation +• system: N/A +Content: Purpose: Extension method to pad strings with leading characters to reach target length. +Method Signature: +• AddPreValuePadding(this string value, int totalCharLimit, char paddingChar = '0') +Processing Logic: +• If value is null, treat as empty string +• If value.Length > totalCharLimit, return unchanged +• Calculate padding: totalCharLimit - value.Length +• Return: new string(paddingChar, padding) + value +Default Behavior: Pads with '0' characters +Example Questions: +• How do I left-pad a string with zeros? +• What happens if string exceeds character limit? +• How do I pad transaction numbers to fixed length? +--- +Title: RetailGeneralLedger - Retail GL Mapping Component +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: RetailGeneralLedger +• type: component +• domain: General Ledger +• system: Retail +Content: Purpose: Maps retail general ledger DTOs to GeneralLedgerModel for debit and credit entries. +Processing Logic: +• MapDebit(): Maps debit retail commission to GL lines +• MapCredit(): Maps credit retail commission to GL lines +• Both methods delegate line generation to IRetailCommissionMapHelper +• Sets shared properties: JournalSource, JournalCategory, LedgerName, batch/journal names +Key Rules: +• JournalSource = JournalCategory = RetailStatic.JournalSource +• LedgerName = "Clayton GAAP USD" +• BusinessCategory = "Retail" +• ClaytonBusinessUnit = "Retail" +Example Questions: +• How do I map retail commissions to general ledger? +• Which component handles retail GL entries? +• What journal source is used for retail transactions? +--- +Title: Retail GL Journal Entry Naming Convention +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: RetailGeneralLedger +• type: rule +• domain: General Ledger +• system: Retail +Content: Purpose: Defines naming conventions for retail GL batch and journal entries. +BatchName Format: +• Pattern: "INS {TransactionDate} {PolicyNumber} {TransactionNumber}" +• TransactionDate format: "yyyy-MM-dd" +JournalEntryName Format: +• Total length: exactly 12 characters +• Pattern: "INS" + zero-padding + TransactionNumber +• Padding calculation: 12 - TransactionNumber.Length - 3 +• Example: "INS000012345" for transaction number 12345 +Example Questions: +• What format is used for retail GL batch names? +• How are journal entry names constructed? +• What is the fixed length for journal entry names? +--- +Title: LicensingLambda - Home Center License Validation +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: LicensingLambda +• type: component +• domain: Licensing +• system: Licensing API +Content: Purpose: Validates if a home center is licensed in a specific state via Licensing API integration. +Processing Logic: +• Accepts LicenseInfo with MasterDealerNumber and StateCode +• Skips validation if MasterDealerNumber <= 0 +• Calls ILicensingApiIntegration.GetLicenseInfo with today's date +• Sets IsHomeCenterLicensed = true if any license matches StateCode +• Returns updated LicenseInfo +Key Rules: +• Only processes when MasterDealerNumber > 0 +• Validates against current date (DateOnly.FromDateTime(DateTime.Today)) +Example Questions: +• How do I check if a home center is licensed? +• Which Lambda validates dealer licensing? +• What determines if a home center is licensed in a state? +--- +Title: PolicyRefundDisbursementLambda - Refund Event Publishing +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: PolicyRefundDisbursementLambda +• type: component +• domain: Refunds +• system: Event Publishing +Content: Purpose: Publishes policy refund disbursement events to accounting service event bus. +Processing Logic: +• PublishCheck(): Publishes event with EventSubType = "Check" +• PublishTransfer(): Publishes event with EventSubType = "Transfer" +• Both methods wrap PolicyRefundDisbursementPayload in EventMessage +• Delegates publishing to IAccountingServiceIntegration +Event Properties: +• EventType: "PolicyRefundDisbursement" +• Source: "Aws.Accounting.AccountsReceivable" +• Reporter: "AccountsReceivable.Event.PolicyRefundDisbursementLambda" +• EventVersion: "v1", EventClass: EventClass.Detail +Example Questions: +• How do I publish a policy refund event? +• What event types are available for refund disbursements? +• Which component publishes refund check events? +--- +Title: Unapplied Receipt Filtering Rule +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: UnappliedCashReceiptNotifyLambda +• type: rule +• domain: Cash Receipts +• system: Oracle AR +Content: Purpose: Defines criteria for identifying unapplied cash receipts requiring notification. +Filter Criteria (both conditions must be true): +• UnappliedAmount > 0 (decimal comparison) +• ReceiptState equals "Unapplied" (case-insensitive string comparison) +Processing: +• Applied using LINQ Where clause on IEnumerable +• Result used to trigger email notification workflow +• Empty result skips notification +Example Questions: +• What conditions identify an unapplied receipt? +• How are unapplied receipts filtered from receipt lists? +• What ReceiptState value triggers notifications? +--- +Title: Journal Entry Description Mapping by Line Context +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable +• component: RetailGeneralLedger +• type: rule +• domain: General Ledger +• system: Retail +Content: Purpose: Maps business group line context to appropriate journal entry descriptions. +Mapping Rules: +• HfaHmhPremium → "InsPolicyTransaction" (from JournalEntryLineDescription) +• HfaMhwHbppPremium → "HbpPolicies" +• HfaMhwEscPremium → "HbpPolicies" +• Default: "HbpPolicies" +Processing: Uses case-insensitive StringComparison.OrdinalIgnoreCase for matching. +Example Questions: +• What journal description is used for HMH premium? +• How are journal entry descriptions determined? +• What description applies to HBPP premium transactions? +--- +This completes the RAG knowledge chunks for the CMH.HFA.Accounting.AccountsReceivable module. Each chunk is atomic, focuses on a single concept, and provides query-ready information optimized for retrieval-augmented generation systems. diff --git a/Books/Accounting/AccountsReceivable/AccountsReceivableAdjustments.txt b/Books/Accounting/AccountsReceivable/AccountsReceivableAdjustments.txt new file mode 100644 index 0000000..2699486 --- /dev/null +++ b/Books/Accounting/AccountsReceivable/AccountsReceivableAdjustments.txt @@ -0,0 +1,490 @@ +RAG Knowledge Chunks for CMH.HFA.Accounting.AccountsReceivable.Adjustments +--- +Title: InvoiceAdjustment Lambda - Invoice Adjustment Get/Post/Map +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: InvoiceAdjustment +• type: component +• domain: Invoice Adjustments +• system: Oracle +Content: Purpose: AWS Lambda for retrieving, creating, and mapping invoice adjustments in Oracle AR. +Processing Logic: +• Get(): Retrieves invoice adjustments by filter criteria via IInvoiceAdjustmentIntegration +• Post(): Creates new invoice adjustment in Oracle +• Map(): Filters adjustments list by ReceivablesTrxId, creates mapped adjustment with negated amount +Key Rules: +• Throws ArgumentNullException if request is null +• Map uses ordinal string comparison for ReceivablesTrxId matching +• Mapped adjustment: Amount negated (*-1), ApplyDate/GlDate set to today +• Sets OrgId, SetOfBooksId from AdjustmentConfiguration +Example Questions: +• How do I create an invoice adjustment in Oracle? +• Which Lambda maps earned premium invoice adjustments? +• How are invoice adjustment amounts negated? +--- +Title: CreditMemoAdjustment Lambda - Credit Memo Adjustment Operations +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: CreditMemoAdjustment +• type: component +• domain: Credit Memo Adjustments +• system: Oracle +Content: Purpose: AWS Lambda for retrieving, creating, and mapping credit memo adjustments in Oracle AR. +Processing Logic: +• Get(): Retrieves credit memo adjustments by filter criteria +• Post(): Creates new credit memo adjustment in Oracle +• Map(): Filters adjustments by ReceivablesTrxId, creates mapped adjustment with negated amount +Key Rules: +• Throws ArgumentNullException if request is null +• Map uses ordinal string comparison for ReceivablesTrxId matching (trimmed) +• Mapped adjustment: Amount negated (*-1), ApplyDate/GlDate set to today +• TransactionAdjustmentType="LINE", AdjustmentType="M", CurrencyCode="USD" +Example Questions: +• How do I post a credit memo adjustment? +• Which Lambda handles credit memo adjustment mapping? +• What adjustment type is used for credit memos? +--- +Title: WriteOffAdjustment Lambda - Write-Off Threshold Logic +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: WriteOffAdjustment +• type: component +• domain: Write-Off Adjustments +• system: Oracle +Content: Purpose: Creates write-off adjustments for credit memos and installments below threshold balance. +Processing Logic: +• Map1(): Maps credit memo to write-off adjustment if UnappliedBalance within threshold +• Map2(): Maps installment to write-off adjustment if single open installment within threshold +• Returns null if balance exceeds WriteOffBalanceThreshold (5.00) or is zero +Key Rules: +• WriteOffBalanceThreshold = 5m (decimal) +• TransactionAdjustmentType="LINE", AdjustmentType="M" +• Amount negated: Math.Abs(balance) * -1 +• Map2 throws exception if multiple open installments found +Example Questions: +• What is the write-off balance threshold? +• How do I write off small credit memo balances? +• Which Lambda handles installment write-offs? +--- +Title: Write-Off Balance Threshold Rule +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: WriteOffAdjustment +• type: rule +• domain: Write-Off Adjustments +• system: Oracle +Content: Purpose: Defines threshold for automatic write-off eligibility. +Threshold Value: 5.00 (decimal constant WriteOffBalanceThreshold) +Eligibility Criteria: +• Credit Memo: 0 < Math.Abs(UnappliedBalanceDecimal) <= 5.00 +• Installment: 0 < Sum(InstallmentBalanceDue) <= 5.00 +• Returns null if balance is zero or exceeds threshold +Additional Rules: +• Only "Open" status installments considered +• Only one open installment allowed for write-off +• Amount always negated in adjustment +Example Questions: +• What is the maximum write-off amount? +• When is a credit memo eligible for write-off? +• What balance triggers automatic write-off? +--- +Title: ServiceFeeAdjustment Lambda - Service Fee Processing +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: ServiceFeeAdjustment +• type: component +• domain: Service Fee Adjustments +• system: Oracle +Content: Purpose: Processes and maps service fee adjustments for open installments. +Processing Logic: +• Pre(): Filters open installments with AmountAdjusted > 0, creates adjustment list +• Map(): Creates reinstatement service fee for earliest open installment within 30 days +• MapFee(): Creates fee adjustment for earliest open installment if no matching adjustment exists +• Value(): Returns sum of adjustment amounts from Pre() +Key Rules: +• Only "Open" status installments processed (case-insensitive) +• InstallmentBalanceDue > 0 and AmountAdjustedDecimal > 0 required +• Amount negated: AmountAdjustedDecimal * -1 +• Earliest installment selected by InstallmentDueDate +Example Questions: +• How are service fee adjustments calculated? +• Which Lambda processes installment service fees? +• What conditions trigger service fee adjustments? +--- +Title: Service Fee Adjustment Eligibility Rule +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: ServiceFeeAdjustment +• type: rule +• domain: Service Fee Adjustments +• system: Oracle +Content: Purpose: Defines criteria for service fee adjustment creation on installments. +Eligibility Criteria (all must be true): +• InstallmentBalanceDue > 0 +• AmountAdjustedDecimal > 0 +• InstallmentStatus = "Open" (case-insensitive) +• ReceivablesTrxId matches AdjustmentConfiguration.ReceivableTrxId +Timing Rule: +• InstallmentDueDate <= DateTime.Today.AddDays(30) +• Earliest open installment selected (OrderBy InstallmentDueDate) +Processing: +• Requires more than 1 installment +• Skips if matching adjustment already exists +Example Questions: +• When is a service fee adjustment applicable? +• What date range qualifies for service fee? +• How are eligible installments identified? +--- +Title: AdjustmentConfigurationModel - Adjustment Configuration Structure +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: AdjustmentConfigurationModel +• type: concept +• domain: Adjustment Configuration +• system: Oracle +Content: Purpose: Configuration model defining Oracle adjustment transaction parameters. +Properties: +• Id (Guid): Unique identifier +• ReceivableTrxId (string): Oracle receivables transaction ID +• Name, Type: Configuration identifiers +• OrgId, SetOfBooksId: Oracle organizational identifiers +• IsActiveFlag (bool): Active status +• StartActiveDate, InactiveDate, EndActiveDate: Date range strings +Usage: Passed in mapping DTOs to provide Oracle-specific configuration values for adjustment creation. +Example Questions: +• What fields configure adjustment transactions? +• How are Oracle org parameters specified? +• What is ReceivableTrxId used for? +--- +Title: GetAdjustmentDto - Base Adjustment Query DTO +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: GetAdjustmentDto +• type: concept +• domain: Adjustment Retrieval +• system: Oracle +Content: Purpose: Abstract base DTO for querying adjustments with common filter parameters. +Properties: +• AdjustmentNumber (string): Filter by adjustment number +• AdjustmentId (string): Filter by adjustment ID +Derived Classes: +• GetInvoiceAdjustmentDto: Adds InvoiceAdjustmentId property +• GetCreditMemoAdjustmentDto: Adds CreditMemoAdjustmentId property +Usage: Provides common query parameters inherited by specific adjustment type queries. +Example Questions: +• What parameters filter adjustment queries? +• How do I query adjustments by number? +• What is the base DTO for adjustment retrieval? +--- +Title: MapInvoiceAdjustmentDto - Invoice Adjustment Mapping Input +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: MapInvoiceAdjustmentDto +• type: concept +• domain: Invoice Adjustments +• system: Oracle +Content: Purpose: Input DTO for mapping earned premium invoice adjustments from adjustment list. +Properties: +• Adjustments (IList): List of adjustments to filter +• AdjustmentConfiguration (AdjustmentConfigurationModel): Oracle configuration parameters +Processing Context: +• Used by InvoiceAdjustment.Map() to find matching adjustment by ReceivableTrxId +• Returns mapped adjustment with negated amount and today's dates +Example Questions: +• What input is needed for invoice adjustment mapping? +• How are adjustments filtered for mapping? +• What DTO provides adjustment configuration? +--- +Title: MapCreditMemoAdjustmentDto - Credit Memo Adjustment Mapping Input +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: MapCreditMemoAdjustmentDto +• type: concept +• domain: Credit Memo Adjustments +• system: Oracle +Content: Purpose: Input DTO for mapping earned premium credit memo adjustments from adjustment list. +Properties: +• Adjustments (IList): List of credit memo adjustments to filter +• AdjustmentConfiguration (AdjustmentConfigurationModel): Oracle configuration parameters +Processing Context: +• Used by CreditMemoAdjustment.Map() to find matching adjustment by ReceivableTrxId +• Returns mapped adjustment with negated amount and today's dates +Example Questions: +• What input is needed for credit memo adjustment mapping? +• How do I pass credit memo adjustments for mapping? +• What configuration is required for credit memo adjustments? +--- +Title: MapCreditMemoWriteOffAdjustmentDto - Credit Memo Write-Off Input +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: MapCreditMemoWriteOffAdjustmentDto +• type: concept +• domain: Write-Off Adjustments +• system: Oracle +Content: Purpose: Input DTO for creating credit memo write-off adjustments. +Properties: +• CreditMemo (CreditMemo): Credit memo with UnappliedBalanceDecimal to write off +• AdjustmentConfiguration (AdjustmentConfigurationModel): Oracle configuration parameters +Processing Context: +• Used by WriteOffAdjustment.Map1() to create write-off for balances <= $5.00 +• Returns null if balance exceeds threshold or is zero +Example Questions: +• What input creates credit memo write-off adjustments? +• How do I pass credit memo data for write-off? +• What DTO wraps credit memo and configuration? +--- +Title: MapInstallmentWriteOffAdjustmentDto - Installment Write-Off Input +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: MapInstallmentWriteOffAdjustmentDto +• type: concept +• domain: Write-Off Adjustments +• system: Oracle +Content: Purpose: Input DTO for creating installment write-off adjustments. +Properties: +• Installments (IList): List of installments to evaluate for write-off +• AdjustmentConfiguration (AdjustmentConfigurationModel): Oracle configuration parameters +Processing Context: +• Used by WriteOffAdjustment.Map2() to create write-off for single open installment +• Filters for "Open" status installments +• Returns null if multiple open installments or balance exceeds threshold +Example Questions: +• What input creates installment write-off adjustments? +• How do I pass installments for write-off processing? +• What DTO handles installment write-off mapping? +--- +Title: PreProcessServiceFeeAdjustmentDto - Service Fee Pre-Processing Input +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: PreProcessServiceFeeAdjustmentDto +• type: concept +• domain: Service Fee Adjustments +• system: Oracle +Content: Purpose: Input DTO for pre-processing service fee adjustments on installments. +Properties: +• Installments (IList): List of installments to process +• Adjustments (IList): Existing adjustments +• AdjustmentConfiguration (AdjustmentConfigurationModel): Oracle configuration parameters +Processing Context: +• Used by ServiceFeeAdjustment.Pre() to create adjustments for open installments with service fees +• Matches installments to adjustments by PaymentScheduleId +• Filters for InstallmentBalanceDue > 0, AmountAdjustedDecimal > 0, Status="Open" +Example Questions: +• What input is needed for service fee pre-processing? +• How are installments and adjustments passed together? +• What DTO handles service fee adjustment creation? +--- +Title: PreProcessReinstatementServiceFeeAdjustmentDto - Reinstatement Fee Input +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: PreProcessReinstatementServiceFeeAdjustmentDto +• type: concept +• domain: Service Fee Adjustments +• system: Oracle +Content: Purpose: Input DTO for creating reinstatement service fee adjustments. +Properties: +• Installments (IList): List of installments to evaluate +• Invoice (OracleInvoice): Invoice containing InstallmentFee value +• AdjustmentConfiguration (AdjustmentConfigurationModel): Oracle configuration parameters +Processing Context: +• Used by ServiceFeeAdjustment.Map() for reinstatement scenarios +• Selects earliest open installment within 30 days of due date +• Uses Invoice.InstallmentFee as adjustment amount +Example Questions: +• What input creates reinstatement service fee adjustments? +• How is installment fee passed for reinstatement? +• What DTO handles reinstatement fee processing? +--- +Title: MapServiceFeeAdjustmentDto - Service Fee Mapping Input +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: MapServiceFeeAdjustmentDto +• type: concept +• domain: Service Fee Adjustments +• system: Oracle +Content: Purpose: Input DTO for mapping service fee adjustments to invoices. +Properties: +• Installments (IList): Installments for fee allocation +• Invoice (OracleInvoice): Invoice to apply fee adjustment +• Adjustments (IList): Existing adjustments to check +• AdjustmentConfiguration (AdjustmentConfigurationModel): Oracle configuration +Processing Context: +• Used by ServiceFeeAdjustment.MapFee() to create fee adjustment if none exists +• Checks for matching ReceivableTrxId and PaymentScheduleId +• Creates adjustment only if earliest open installment within 30 days and no match found +Example Questions: +• What input maps service fee to invoice? +• How do I check for existing service fee adjustments? +• What DTO handles service fee invoice mapping? +--- +Title: OracleInvoiceAdjustment Integration - Invoice Adjustment API +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: OracleInvoiceAdjustment +• type: component +• domain: Invoice Adjustments +• system: Oracle OIC +Content: Purpose: Oracle Integration Cloud (OIC) client for invoice adjustment operations. +Interface Methods: +• GetInvoiceAdjustmentsAsync(): Retrieves invoice adjustments by query parameters +• PostInvoiceAdjustmentAsync(): Posts new invoice adjustment to Oracle +Implementation: +• Inherits from OracleBaseAdjustment +• Delegates to base GetAdjustmentsAsync and PostAdjustmentsAsync +• Passes InvoiceAdjustmentId as customerTrxId parameter +Example Questions: +• How do I integrate with Oracle invoice adjustment API? +• Which integration retrieves invoice adjustments? +• What interface defines invoice adjustment operations? +--- +Title: OracleCreditMemoAdjustment Integration - Credit Memo Adjustment API +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: OracleCreditMemoAdjustment +• type: component +• domain: Credit Memo Adjustments +• system: Oracle OIC +Content: Purpose: Oracle Integration Cloud (OIC) client for credit memo adjustment operations. +Interface Methods: +• GetCreditMemoAdjustmentsAsync(): Retrieves credit memo adjustments by query parameters +• PostCreditMemoAdjustmentAsync(): Posts new credit memo adjustment to Oracle +Implementation: +• Inherits from OracleBaseAdjustment +• Delegates to base GetAdjustmentsAsync and PostAdjustmentsAsync +• Passes CreditMemoAdjustmentId as customerTrxId parameter +Example Questions: +• How do I integrate with Oracle credit memo adjustment API? +• Which integration posts credit memo adjustments? +• What interface defines credit memo adjustment operations? +--- +Title: OracleBaseAdjustment - Base Adjustment Integration +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: OracleBaseAdjustment +• type: component +• domain: Adjustments +• system: Oracle OIC +Content: Purpose: Abstract base class for Oracle adjustment API integrations. +Endpoint: +• AdjustmentEndpoint: "/ic/api/integration/v1/flows/rest/CHI_ADJUSTMENT_API/1.0/Adjustment" +Methods: +• GetAdjustmentsAsync(): GET with query params (CustomerTrxId, AdjustmentId, AdjustmentNumber), returns ARAdjustments array from JSON +• PostAdjustmentsAsync(): POST with JSON body, returns deserialized response +Key Rules: +• Allows HTTP 404 status on GET requests +• Extracts adjustments from JObject["ARAdjustments"] +• Returns empty list if null +Example Questions: +• What is the Oracle adjustment API endpoint? +• How are adjustment query parameters passed? +• Which base class handles adjustment API calls? +--- +Title: Adjustment Mapping Amount Negation Rule +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: InvoiceAdjustment, CreditMemoAdjustment, WriteOffAdjustment, ServiceFeeAdjustment +• type: rule +• domain: Adjustments +• system: Oracle +Content: Purpose: Defines amount transformation rule for adjustment mapping across all adjustment types. +Negation Formula: +• Invoice/CreditMemo Earned Premium: (decimal.Parse(Amount) * -1).ToString() +• Write-Off Credit Memo: (Math.Abs(UnappliedBalanceDecimal) * -1).ToString() +• Write-Off Installment: (InstallmentBalanceDue * -1).ToString() +• Service Fee: (AmountAdjustedDecimal * -1).ToString() +Key Rule: All adjustment amounts are negated (*-1) during mapping to reverse original transaction amounts. +Example Questions: +• Why are adjustment amounts negated? +• How are adjustment amounts calculated? +• What transformation is applied to adjustment amounts? +--- +Title: Adjustment Common Field Values +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: All Adjustment Lambdas +• type: rule +• domain: Adjustments +• system: Oracle +Content: Purpose: Defines standard field values consistently applied across all adjustment types. +Standard Values: +• TransactionAdjustmentType: "LINE" +• AdjustmentType: "M" +• CurrencyCode: "USD" +• ApplyDate: DateOnly.FromDateTime(DateTime.Today) +• GlDate: DateOnly.FromDateTime(DateTime.Today) +Configuration-Derived Values: +• OrgId: From AdjustmentConfiguration.OrgId +• SetOfBooksId: From AdjustmentConfiguration.SetOfBooksId +• ReceivablesTrxId: From AdjustmentConfiguration.ReceivableTrxId +Example Questions: +• What adjustment type code is used? +• What currency is used for adjustments? +• What GL date is set for adjustments? +--- +Title: Adjustment Workflow - Earned Premium Reversal +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: InvoiceAdjustment, CreditMemoAdjustment +• type: workflow +• domain: Invoice/Credit Memo Adjustments +• system: Oracle +Content: Purpose: Describes workflow for reversing earned premium via invoice or credit memo adjustments. +Workflow Steps: +1. Retrieve existing adjustments list from Oracle +2. Filter adjustments: match ReceivablesTrxId (trimmed, ordinal comparison) to AdjustmentConfiguration.ReceivableTrxId +3. If match found, create new adjustment copying matched values +4. Negate amount: (decimal.Parse(match.Amount) * -1).ToString() +5. Set ApplyDate and GlDate to today +6. Set OrgId, SetOfBooksId from AdjustmentConfiguration +7. Post new adjustment to Oracle via integration +Example Questions: +• How are earned premium adjustments reversed? +• What workflow maps adjustment amounts? +• How is ReceivablesTrxId matched for adjustments? +--- +Title: Service Fee Adjustment Workflow - Open Installment Processing +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: ServiceFeeAdjustment +• type: workflow +• domain: Service Fee Adjustments +• system: Oracle +Content: Purpose: Describes workflow for creating service fee adjustments on open installments. +Workflow Steps: +1. Match installments to adjustments by PaymentScheduleId (InstallmentId) +2. Filter for: InstallmentBalanceDue > 0, AmountAdjustedDecimal > 0, Status="Open", ReceivablesTrxId match +3. For each eligible installment, create InvoiceAdjustmentModel +4. Set Amount to (AmountAdjustedDecimal * -1) +5. Set CustomerTrxId from TransactionId +6. Set TransactionAdjustmentType="LINE", AdjustmentType="M" +7. Apply dates and configuration values +8. Return list of adjustments for posting +Example Questions: +• How are service fees matched to installments? +• What workflow creates service fee adjustments? +• How are installments filtered for service fee processing? +--- +Title: Write-Off Adjustment Workflow - Threshold-Based Creation +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Adjustments +• component: WriteOffAdjustment +• type: workflow +• domain: Write-Off Adjustments +• system: Oracle +Content: Purpose: Describes workflow for creating write-off adjustments based on balance threshold. +Workflow Steps (Credit Memo): +1. Check UnappliedBalanceDecimal != 0 and Math.Abs(UnappliedBalanceDecimal) <= 5.00 +2. If within threshold, create adjustment with negated absolute value +3. Otherwise return null +Workflow Steps (Installment): +1. Filter for InstallmentStatus="Open" +2. Check sum(InstallmentBalanceDue) > 0 and <= 5.00 +3. Ensure exactly one open installment (throw exception if multiple) +4. Create adjustment with negated balance +5. Otherwise return null +Example Questions: +• How are write-offs created based on balance? +• What workflow checks write-off threshold? +• When is a write-off adjustment generated? +--- +This completes the RAG knowledge chunks for the CMH.HFA.Accounting.AccountsReceivable.Adjustments module. Each chunk is atomic, non-overlapping, and optimized for retrieval-augmented generation systems with precise technical information. diff --git a/Books/Accounting/AccountsReceivable/AccountsReceivableCashReceiptApplications.txt b/Books/Accounting/AccountsReceivable/AccountsReceivableCashReceiptApplications.txt new file mode 100644 index 0000000..4bcab48 --- /dev/null +++ b/Books/Accounting/AccountsReceivable/AccountsReceivableCashReceiptApplications.txt @@ -0,0 +1,241 @@ +RAG Knowledge Chunks for CMH.HFA.Accounting.AccountsReceivable.CashReceiptApplications +--- +Title: RcptAppLambda - Cash Receipt Application Lambda +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceiptApplications +• component: RcptAppLambda +• type: component +• domain: Cash Receipt Applications +• system: Oracle +Content: Purpose: AWS Lambda for posting cash receipt applications to Oracle and preprocessing receipt-to-installment applications. +Processing Logic: +• Post(): Posts single OracleReceiptApplication to Oracle via integration +• Pre(): Generates receipt applications by matching unapplied receipts to open installments +Key Rules: +• Lambda configuration: 256MB memory, 30s timeout +• Pre() method name truncated due to 127-character Lambda naming limit +• Returns empty list if no unapplied receipts or installments +Example Questions: +• How do I post a cash receipt application to Oracle? +• Which Lambda applies receipts to installments? +• What component preprocesses receipt applications? +--- +Title: Cash Receipt Application Preprocessing Workflow +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceiptApplications +• component: RcptAppLambda +• type: workflow +• domain: Cash Receipt Applications +• system: Oracle +Content: Purpose: Automated workflow for applying unapplied cash receipts to open installments using greedy allocation. +Workflow Steps: +1. Filter receipts: UnappliedAmount > 0 AND ReceiptState = "Unapplied" (case-insensitive) +2. Filter installments: InstallmentBalanceDue > 0 +3. Sort installments by InstallmentSequence (ascending) +4. For each unapplied receipt, iterate through sorted installments +5. Apply Math.Min(UnappliedAmount, InstallmentBalanceDue) to each installment +6. Decrement both UnappliedAmount and InstallmentBalanceDue +7. Create OracleReceiptApplication for each allocation +8. Stop when receipt fully applied or all installments paid +Example Questions: +• How are receipts automatically applied to installments? +• What algorithm allocates receipts to installments? +• In what order are installments paid? +--- +Title: Receipt Application Allocation Algorithm +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceiptApplications +• component: RcptAppLambda +• type: rule +• domain: Cash Receipt Applications +• system: Oracle +Content: Purpose: Greedy allocation algorithm for applying cash receipts to installments in sequence order. +Algorithm Logic: +• AmountApplied = Math.Min(UnappliedAmount, InstallmentBalanceDue) +• Installments processed in InstallmentSequence order (ascending) +• Nested loop: outer (receipts), inner (installments) +• Breaks inner loop when receipt UnappliedAmount = 0 +• Breaks outer loop when sum(InstallmentBalanceDue) = 0 +Mutation: +• UnappliedAmount and InstallmentBalanceDue decremented in-place during processing +Key Rule: Earliest installments paid first until receipt exhausted or all installments satisfied. +Example Questions: +• How is application amount calculated? +• What order are installments processed? +• When does receipt application stop? +--- +Title: OracleReceiptApplication DTO Structure +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceiptApplications +• component: OracleReceiptApplication +• type: concept +• domain: Cash Receipt Applications +• system: Oracle +Content: Purpose: Data structure representing a cash receipt application to an invoice installment. +Key Properties: +• ActionType (string): Application action (e.g., "Apply") +• AmountApplied (decimal): Amount applied to transaction +• ReceiptId (string): Oracle receipt identifier +• CustomerTrxId (string): Invoice transaction ID +• Instalment (string): Installment sequence number +• InstalmentId (string): Installment identifier +• ApplicationDate, AccountingDate (DateOnly): Application and GL dates +• Comments (string): Application notes +• ReceiptDate (DateOnly?), Currency (string), BusinessUnit (string) +• ReversalGlDate (DateOnly?), ApplicationId (string) +Example Questions: +• What fields define a receipt application? +• How is installment identified in receipt application? +• What dates are required for receipt application? +--- +Title: PreProcessReceiptApplicaitonsDto - Receipt Application Input +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceiptApplications +• component: PreProcessReceiptApplicaitonsDto +• type: concept +• domain: Cash Receipt Applications +• system: Oracle +Content: Purpose: Input DTO for preprocessing cash receipt applications containing receipts and installments to match. +Properties: +• CashReceipts (IEnumerable): Collection of cash receipts with UnappliedAmount +• Installments (IEnumerable): Collection of installments with InstallmentBalanceDue +Processing Context: +• Used by RcptAppLambda.Pre() to generate receipt applications +• Receipts filtered for Unapplied state +• Installments filtered for open balances and sorted by sequence +Example Questions: +• What input is needed for receipt application preprocessing? +• How do I pass receipts and installments together? +• What DTO handles receipt-to-installment matching? +--- +Title: CashReceiptApplicationOicIntegration - Receipt Application API Client +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceiptApplications +• component: CashReceiptApplicationOicIntegration +• type: component +• domain: Cash Receipt Applications +• system: Oracle OIC +Content: Purpose: Oracle Integration Cloud (OIC) client for posting cash receipt applications. +Endpoint: +• CashReceiptApplicationEndpoint: "/ic/api/integration/v1/flows/rest/CHI_RECEIPTAPP_API/1.0/ReceiptApplication?" +Processing Logic: +• PostCashReceiptApplicationAsync(): Serializes OracleReceiptApplication to JSON, POSTs to Oracle, deserializes response +• Inherits from OracleIntegrationBase for authentication +• Sets "Content-Type: application/json" header +Example Questions: +• What is the Oracle receipt application endpoint? +• How do I integrate with Oracle receipt application API? +• Which integration posts receipt applications? +--- +Title: Unapplied Receipt Filtering Rule +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceiptApplications +• component: RcptAppLambda +• type: rule +• domain: Cash Receipt Applications +• system: Oracle +Content: Purpose: Defines criteria for identifying receipts eligible for automatic application. +Filter Criteria (both conditions must be true): +• UnappliedAmount > 0 (decimal comparison) +• ReceiptState equals "Unapplied" (case-insensitive, StringComparison.OrdinalIgnoreCase) +Processing: +• Applied using LINQ Where clauses on IEnumerable +• Results used for automated application to installments +• Returns empty list if no matches found +Example Questions: +• What receipts qualify for automatic application? +• How are unapplied receipts identified? +• What conditions filter receipts for application? +--- +Title: Open Installment Filtering and Sorting Rule +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceiptApplications +• component: RcptAppLambda +• type: rule +• domain: Cash Receipt Applications +• system: Oracle +Content: Purpose: Defines filtering and ordering criteria for installments eligible for receipt application. +Filter Criteria: +• InstallmentBalanceDue > 0 (only installments with outstanding balance) +Sort Order: +• OrderBy InstallmentSequence (ascending) +• Earliest installments processed first +Processing: +• Applied using LINQ Where and OrderBy on IEnumerable +• Sorted list ensures sequential payment application +• Returns empty list if no installments with balance +Example Questions: +• How are installments sorted for receipt application? +• What installments are eligible for payment? +• In what sequence are installments paid? +--- +Title: Receipt Application Standard Field Values +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceiptApplications +• component: RcptAppLambda +• type: rule +• domain: Cash Receipt Applications +• system: Oracle +Content: Purpose: Defines standard field values for automatically generated receipt applications. +Standard Values (Pre method): +• ActionType: "Apply" +• Comments: "" (empty string) +• ApplicationDate: DateOnly.FromDateTime(DateTime.Now) +• AccountingDate: DateOnly.FromDateTime(DateTime.Now) +Dynamic Values: +• AmountApplied: Math.Min(UnappliedAmount, InstallmentBalanceDue) +• ReceiptId: unappliedReceipt.ReceiptId.ToString() +• CustomerTrxId: installment.TransactionId.ToString() +• Instalment: installment.InstallmentSequence.ToString() +Example Questions: +• What ActionType is used for receipt applications? +• What date is set for application and accounting? +• How are receipt and transaction IDs set? +--- +Title: Receipt Application Loop Termination Conditions +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceiptApplications +• component: RcptAppLambda +• type: rule +• domain: Cash Receipt Applications +• system: Oracle +Content: Purpose: Defines conditions that terminate receipt application processing loops. +Inner Loop Break (per receipt): +• Condition: unappliedReceipt.UnappliedAmount == 0 +• Stops processing installments when current receipt fully applied +Outer Loop Break (all receipts): +• Condition: sortedInstallments.Sum(x => x.InstallmentBalanceDue) == 0 +• Stops processing receipts when all installments fully paid +Processing: +• Inner loop breaks before moving to next receipt +• Outer loop breaks to avoid processing remaining receipts +• Optimizes processing by stopping when no work remains +Example Questions: +• When does receipt application processing stop? +• What conditions break application loops? +• How is early termination handled? +--- +Title: Receipt-to-Installment Matching Strategy +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceiptApplications +• component: RcptAppLambda +• type: workflow +• domain: Cash Receipt Applications +• system: Oracle +Content: Purpose: Strategy for matching multiple receipts to multiple installments using nested iteration. +Matching Strategy: +• Outer loop: Iterate through unapplied receipts (unordered) +• Inner loop: Iterate through installments (ordered by sequence) +• While loop: Apply portions until receipt or installment exhausted +• Creates one OracleReceiptApplication per partial/full application +Allocation Behavior: +• Receipts applied to earliest installments first +• Single receipt can pay multiple installments +• Single installment can receive payments from multiple receipts +• Tracks remaining balances in-place during processing +Example Questions: +• How are multiple receipts matched to installments? +• Can one receipt pay multiple installments? +• What strategy allocates payments across installments? +--- +This completes the RAG knowledge chunks for the CMH.HFA.Accounting.AccountsReceivable.CashReceiptApplications module. Each chunk is atomic, non-overlapping, and optimized for retrieval-augmented generation with precise technical details about receipt application processing. diff --git a/Books/Accounting/AccountsReceivable/AccountsReceivableCashReceipts.txt b/Books/Accounting/AccountsReceivable/AccountsReceivableCashReceipts.txt new file mode 100644 index 0000000..7613f33 --- /dev/null +++ b/Books/Accounting/AccountsReceivable/AccountsReceivableCashReceipts.txt @@ -0,0 +1,402 @@ +RAG Knowledge Chunks for CMH.HFA.Accounting.AccountsReceivable.CashReceipts +--- +Title: CashReceiptLambda - Cash Receipt CRUD Operations +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: CashReceiptLambda +• type: component +• domain: Cash Receipts +• system: Oracle +Content: Purpose: AWS Lambda for retrieving, creating, and batch posting cash receipts to Oracle AR. +Processing Logic: +• GetCashReceipt(): Retrieves receipts with pagination (25 per page), defaults to last 12 months if no date specified +• GetCashReceiptByReceiptId(): Retrieves receipts by specific ReceiptId +• Post(): Creates single cash receipt in Oracle +• BatchPost(): Creates multiple cash receipts in single batch operation +Key Rules: +• LookupStartDate must be within past year from today +• Pagination continues until fewer than 25 results returned +• Results deduplicated by ReceiptId +• BatchPost validates ClientBatchRef is not null/empty +Example Questions: +• How do I retrieve cash receipts for an account? +• Which Lambda posts cash receipts to Oracle? +• How does cash receipt pagination work? +--- +Title: Cash Receipt Pagination and Lookback Logic +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: CashReceiptLambda +• type: workflow +• domain: Cash Receipts +• system: Oracle +Content: Purpose: Paginated retrieval workflow for cash receipts with automatic date range handling. +Workflow Steps: +1. Validate LookupStartDate within past year (default: 12 months ago if null) +2. Retrieve batch of receipts (max 25) from Oracle +3. If results found, update LookupStartDate to first receipt's ReceiptDate +4. Add results to collection +5. Continue if exactly 25 results returned (indicates more available) +6. Deduplicate final collection by ReceiptId +Key Rules: +• maxLookBackDate = DateTime.Today.AddYears(-1) +• Throws ArgumentException if LookupStartDate < maxLookBackDate +• Pagination stops when result count < 25 +Example Questions: +• How does cash receipt pagination work? +• What is the maximum lookback period for receipts? +• How are duplicate receipts handled? +--- +Title: OracleReceipt DTO Structure +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: OracleReceipt +• type: concept +• domain: Cash Receipts +• system: Oracle +Content: Purpose: Data structure representing a cash receipt in Oracle AR system. +Key Properties: +• ReceiptId (long), ReceiptNumber (string): Identifiers +• ReceiptDate, AccountingDate (DateTime): Date fields +• Amount, UnappliedAmount (decimal): Receipt amounts +• ReceiptState (default: "Unapplied"), ReceiptStatus (default: "Remitted") +• CustomerAccountNumber (string): Customer identifier +• Comments, IntercompanyPaymentReference, UnidentifiedFundsClassification, RefundInvoiceNumber (string): Additional info +Default Values: +• BusinessUnit: "HFA BU" +• BusinessGroup: "HFA" +• ReceiptMethod: "HFA I/C VMF" +• Currency: "USD" +Example Questions: +• What fields define an Oracle cash receipt? +• What are the default receipt values? +• How are unapplied amounts tracked? +--- +Title: MapCashReceipt Lambda - Escrow Event to Receipt Mapping +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: MapCashReceipt +• type: component +• domain: Cash Receipts +• system: Oracle +Content: Purpose: AWS Lambda that maps EscrowDisbursementInsuranceEvent to OracleReceipt using AutoMapper. +Processing Logic: +• Map(): Uses AutoMapper to transform EscrowDisbursementInsuranceEvent to OracleReceipt +• MapCustomer(): Extracts CustomerAccountNumber from customer's HFA account +• Logs event, receipt, and customer data as JSON for troubleshooting +Key Rules: +• Filters customer accounts for AccountSource equals "HFA" (case-insensitive) +• Uses First() to select HFA account (assumes exists) +• Sets receipt.CustomerAccountNumber from hfaAccount.AccountNumber +Example Questions: +• How do I map escrow events to cash receipts? +• Which Lambda converts insurance events to receipts? +• How is customer account number extracted? +--- +Title: EscrowDisbursementInsuranceEvent to OracleReceipt AutoMapper Profile +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: AutoMapperProfile +• type: rule +• domain: Cash Receipts +• system: Oracle +Content: Purpose: AutoMapper configuration for mapping EscrowDisbursementInsuranceEvent to OracleReceipt. +Mapping Rules: +• Amount ← Payload.Amount +• ReceiptNumber ← Payload.PolicyNumber +• ReceiptDate ← Payload.Date +• AccountingDate ← Payload.Date +• IntercompanyPaymentReference ← Payload.LoanNumber +Configuration: Defined in CreateReceiptMappingProfile() within AutoMapperProfile class. +Example Questions: +• How are escrow events mapped to receipts? +• What AutoMapper profile maps insurance events? +• How is ReceiptNumber derived from events? +--- +Title: CashReceiptMapDto - Receipt Mapping Input +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: CashReceiptMapDto +• type: concept +• domain: Cash Receipts +• system: Oracle +Content: Purpose: Input DTO containing event and customer data for cash receipt mapping. +Properties: +• EscrowDisbursementInsuranceEvent: Source event containing disbursement details +• OracleCustomer: Customer data with accounts for extracting CustomerAccountNumber +Processing Context: +• Used by MapCashReceipt.Map() to transform event to OracleReceipt +• Provides customer account context for mapping +• Enables customer account number extraction from HFA account +Example Questions: +• What input is needed for receipt mapping? +• How do I pass event and customer data together? +• What DTO contains receipt mapping context? +--- +Title: CashReceiptGetDTO - Receipt Query Parameters +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: CashReceiptGetDTO +• type: concept +• domain: Cash Receipts +• system: Oracle +Content: Purpose: Query parameters DTO for retrieving cash receipts from Oracle. +Properties: +• AccountId (string, nullable): Customer account number filter +• LookupStartDate (DateOnly, nullable): Start date for receipt lookup +• ReceiptId (string, nullable): Specific receipt identifier +Processing Context: +• Used by CashReceiptLambda.GetCashReceipt() for paginated queries +• Used by CashReceiptLambda.GetCashReceiptByReceiptId() for single receipt lookup +• LookupStartDate defaults to 12 months ago if null +Example Questions: +• What parameters filter cash receipt queries? +• How do I query receipts by date range? +• What DTO specifies receipt lookup criteria? +--- +Title: EscrowDisbursementInsuranceEventPayload - Insurance Escrow Data +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: EscrowDisbursementInsuranceEventPayload +• type: concept +• domain: Cash Receipts +• system: Insurance/Escrow +Content: Purpose: Payload structure for escrow disbursement insurance events. +Properties: +• Id (Guid): Event identifier +• AccountIdentifier: Account type and value +• Date, EffectiveDate (DateTime): Disbursement dates +• Amount (decimal): Disbursement amount +• CompanyNumber, CustomerNumber, LoanNumber (int): Entity identifiers +• TransferCode (int): Transfer type +• PolicyNumber (string): Insurance policy identifier +PII Fields: AccountIdentifier, CustomerNumber, LoanNumber, PolicyNumber marked with PersonallyIdentifiableInformation attribute. +Example Questions: +• What data is in escrow disbursement events? +• How are insurance disbursements structured? +• What PII is tracked in escrow events? +--- +Title: EscrowDisbursementInsuranceEvent - Event Message Structure +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: EscrowDisbursementInsuranceEvent +• type: concept +• domain: Cash Receipts +• system: Event Bus +Content: Purpose: Event message wrapper for escrow disbursement insurance payloads. +Structure: +• Inherits from EventMessage +• EventType attribute: EventType = "EscrowDisbursement", SubType = "Insurance" +• Contains strongly-typed Payload of type EscrowDisbursementInsuranceEventPayload +Usage: Consumed by MapCashReceipt to create cash receipts from escrow disbursements. +Example Questions: +• What event triggers cash receipt creation? +• How are escrow events structured? +• What event type represents insurance disbursements? +--- +Title: BatchCashReceipt - Batch Upload Receipt Item +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: BatchCashReceipt +• type: concept +• domain: Cash Receipts +• system: Oracle +Content: Purpose: Single cash receipt item structure for batch upload operations. +Properties: +• ReceiptNumber, ReceiptMethod, BusinessUnit: Receipt identifiers +• Amount (decimal), Currency: Monetary values +• CustomerAccountNumber: Customer identifier +• ReceiptMatchBy, ReferenceAmount, ReferenceNumber: Matching criteria +• BusinessGroup, IntercompanyPaymentReference: Business context +• UnidentifiedFundsClassification, UnidentifiedFundsSourceDocument: Unidentified fund handling +• RefundInvoiceNumber: Refund reference +Usage: Collection of these items wrapped in BatchCashReceiptRequest for batch posting. +Example Questions: +• What fields define a batch receipt item? +• How are batch receipts structured? +• What matching criteria are supported? +--- +Title: BatchCashReceiptRequest - Batch Receipt Submission +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: BatchCashReceiptRequest +• type: concept +• domain: Cash Receipts +• system: Oracle +Content: Purpose: Request structure for submitting multiple cash receipts in a single batch operation. +Properties: +• Receipts (IEnumerable): Collection of receipt items +• ClientBatchRef (string): Client-provided unique batch identifier +Validation Rules: +• BatchCashReceiptRequest cannot be null +• Receipts collection cannot be null +• ClientBatchRef must not be null/whitespace +• Empty Receipts collection returns immediately without error +Example Questions: +• How do I submit batch cash receipts? +• What validates batch receipt requests? +• What DTO wraps batch receipt collections? +--- +Title: CashReceiptOicIntegration - Cash Receipt API Client +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: CashReceiptOicIntegration +• type: component +• domain: Cash Receipts +• system: Oracle OIC +Content: Purpose: Oracle Integration Cloud (OIC) client for cash receipt operations. +Endpoints: +• CashReceiptPrefixEndpoint: "/ic/api/integration/v1/flows/rest/CHI_RECEIPT_API/1.0/Receipt?" +• BatchCashReceiptEndpoint: "/ic/api/integration/v2/flows/rest/project/CHI_HFA_OASIS/CHI_HFA_BATCHCAS_API/1.0/CashReceipt/Batch" +Methods: +• GetCashReceiptAsync(): GET with AccountId and date filter +• GetCashReceiptByReceiptIdAsync(): GET by ReceiptId +• PostCashReceiptAsync(): POST single receipt +• PostBatchCashReceiptsAsync(): POST batch receipts to v2 endpoint +Key Rules: +• Extracts "ARReceipts" array from JSON response +• Returns empty list if no results +Example Questions: +• What are the Oracle cash receipt endpoints? +• How do I integrate with Oracle receipt API? +• Which integration handles batch receipts? +--- +Title: Cash Receipt Query Endpoint Construction +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: CashReceiptOicIntegration +• type: rule +• domain: Cash Receipts +• system: Oracle OIC +Content: Purpose: Defines Oracle API endpoint URL construction rules for cash receipt queries. +Endpoint Patterns: +• By Account and Date: "{prefix}CustomerAccountNumber={accountId}&q=ReceiptDate>={receiptDate}" +• By Receipt ID: "{prefix}ReceiptId={receiptId}" +• Post Receipt: "{prefix}CustomerAccountNumber={customerAccountNumber}&q=ReceiptDate>={receiptDate}" +Date Format: "yyyy-MM-dd" +Base Prefix: "/ic/api/integration/v1/flows/rest/CHI_RECEIPT_API/1.0/Receipt?" +Example Questions: +• How are receipt query URLs constructed? +• What date format is used in receipt queries? +• How do I query receipts by account and date? +--- +Title: Cash Receipt JSON Response Parsing +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: CashReceiptOicIntegration +• type: rule +• domain: Cash Receipts +• system: Oracle OIC +Content: Purpose: Extracts receipt array from Oracle API JSON response wrapper. +Processing Logic: +• Parse JSON string to JObject +• Extract "ARReceipts" property as JArray +• Convert JArray to string +• Deserialize to IEnumerable +• Return empty list if array is null or JSON is empty string +Method: GetArrayString(string jsonString, string arrayPropValue) +Key Rule: Empty JSON responses return empty list rather than null. +Example Questions: +• How are Oracle receipt responses parsed? +• What JSON property contains receipts? +• How are empty responses handled? +--- +Title: ReceiptStatic Constants - Receipt Configuration Values +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: ReceiptStatic +• type: rule +• domain: Cash Receipts +• system: Oracle +Content: Purpose: Centralized constant values for cash receipt processing. +Constants: +• ReceiptMethodIcVmf: "HFA I/C VMF" (default receipt method) +• Unapplied: "Unapplied" (receipt state for unallocated receipts) +• Remitted: "Remitted" (default receipt status) +Usage: Referenced throughout receipt processing for consistent value assignment to ReceiptMethod, ReceiptState, and ReceiptStatus fields. +Example Questions: +• What is the default receipt method for HFA? +• What value indicates an unapplied receipt? +• What are valid receipt status values? +--- +Title: HFA Account Extraction from Customer +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: MapCashReceipt +• type: rule +• domain: Cash Receipts +• system: Oracle +Content: Purpose: Extracts HFA account number from Oracle customer account collection. +Extraction Logic: +• Filter customer.Accounts for AccountSource equals "HFA" (case-insensitive, InvariantCultureIgnoreCase) +• Use First() to select matching account +• Extract AccountNumber from selected account +• Assign to receipt.CustomerAccountNumber +Key Rule: Assumes at least one HFA account exists (First() throws if none found). +Example Questions: +• How is customer account number extracted? +• How do I filter for HFA accounts? +• What comparison is used for AccountSource matching? +--- +Title: Cash Receipt Batch Validation Rules +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: CashReceiptLambda +• type: rule +• domain: Cash Receipts +• system: Oracle +Content: Purpose: Defines validation rules for batch cash receipt submissions. +Validation Rules: +1. BatchCashReceiptRequest cannot be null (throws ArgumentNullException) +2. Receipts collection cannot be null (throws ArgumentNullException) +3. ClientBatchRef must not be null/whitespace (throws ArgumentException) +4. Empty Receipts collection (Any() returns false) results in early return without processing +Processing: Validation occurs in CashReceiptLambda.BatchPost() before calling integration. +Example Questions: +• What validates batch receipt requests? +• What happens if receipts collection is empty? +• Is ClientBatchRef required for batch posts? +--- +Title: Cash Receipt Default Field Values +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: OracleReceipt +• type: rule +• domain: Cash Receipts +• system: Oracle +Content: Purpose: Defines standard default values for OracleReceipt properties. +Default Values: +• ReceiptState: "Unapplied" (from ReceiptStatic.Unapplied) +• ReceiptStatus: "Remitted" (from ReceiptStatic.Remitted) +• BusinessUnit: "HFA BU" (from HfaStatic.HfaBusinessUnit) +• BusinessGroup: "HFA" (from HfaStatic.HFA) +• ReceiptMethod: "HFA I/C VMF" (from ReceiptStatic.ReceiptMethodIcVmf) +• Currency: "USD" (from HfaStatic.USD) +Usage: Set during OracleReceipt instantiation or mapping operations. +Example Questions: +• What are default receipt field values? +• What currency is used for receipts? +• What receipt state is default? +--- +Title: Cash Receipt Event-to-Receipt Mapping Workflow +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.CashReceipts +• component: MapCashReceipt +• type: workflow +• domain: Cash Receipts +• system: Oracle +Content: Purpose: Workflow for transforming EscrowDisbursementInsuranceEvent into OracleReceipt. +Workflow Steps: +1. Log incoming EscrowDisbursementInsuranceEvent as JSON +2. Use AutoMapper to transform event to OracleReceipt (Amount, ReceiptNumber, dates, LoanNumber) +3. Filter customer.Accounts for AccountSource = "HFA" (case-insensitive) +4. Extract AccountNumber from HFA account +5. Set receipt.CustomerAccountNumber to extracted value +6. Log mapped receipt and customer details as JSON +7. Return completed OracleReceipt +Example Questions: +• How are escrow events converted to receipts? +• What workflow maps insurance disbursements? +• How is customer account linked to receipts? +--- +This completes the RAG knowledge chunks for the CMH.HFA.Accounting.AccountsReceivable.CashReceipts module. Each chunk is atomic, non-overlapping, and optimized for retrieval-augmented generation with precise technical details about cash receipt processing, event mapping, and Oracle integration. diff --git a/Books/Accounting/AccountsReceivable/AccountsReceivableCommon.txt b/Books/Accounting/AccountsReceivable/AccountsReceivableCommon.txt new file mode 100644 index 0000000..97b5cca --- /dev/null +++ b/Books/Accounting/AccountsReceivable/AccountsReceivableCommon.txt @@ -0,0 +1,458 @@ +RAG Knowledge Chunks for CMH.HFA.Accounting.AccountsReceivable.Common +--- +Title: Adjustment Base Class - Common Adjustment Properties +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: Adjustment +• type: concept +• domain: Adjustments +• system: Oracle +Content: Purpose: Abstract base class defining common properties for invoice and credit memo adjustments in Oracle AR. +Core Properties: +• AdjustmentId, AdjustmentNumber: Identifiers +• OrgId, CustomerTrxId, ReceivablesTrxId: Oracle references +• TransactionAdjustmentType, AdjustmentType: Classification +• Amount (string), ApplyDate, GlDate (DateOnly): Financial data +• PaymentScheduleId, SetOfBooksId: Accounting references +• Comments, CurrencyCode, Status, ReasonCode: Metadata +Special JSON Properties: +• BusinessUnit: Mapped from "__FLEX_Context" +• RequiresApproval: Mapped from "Attribute1" +Inheritance: InvoiceAdjustment and CreditMemoAdjustment inherit from this base. +Example Questions: +• What properties are common to all adjustments? +• How is BusinessUnit mapped in adjustment JSON? +• What is the base class for invoice adjustments? +--- +Title: InvoiceAdjustment DTO - Invoice Adjustment Type +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: InvoiceAdjustment +• type: concept +• domain: Invoice Adjustments +• system: Oracle +Content: Purpose: Data structure representing invoice-specific adjustments, inheriting all properties from Adjustment base class. +Structure: +• Inherits all properties from Adjustment abstract class +• No additional properties defined +• Used to distinguish invoice adjustments from credit memo adjustments at type level +Usage: Provides strong typing for invoice adjustment operations while leveraging common adjustment properties from base class. +Example Questions: +• What type represents invoice adjustments? +• Does InvoiceAdjustment have unique properties? +• What class does InvoiceAdjustment inherit from? +--- +Title: CreditMemoAdjustment DTO - Credit Memo Adjustment Type +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: CreditMemoAdjustment +• type: concept +• domain: Credit Memo Adjustments +• system: Oracle +Content: Purpose: Data structure representing credit memo-specific adjustments, inheriting all properties from Adjustment base class. +Structure: +• Inherits all properties from Adjustment abstract class +• No additional properties defined +• Used to distinguish credit memo adjustments from invoice adjustments at type level +Usage: Provides strong typing for credit memo adjustment operations while leveraging common adjustment properties from base class. +Example Questions: +• What type represents credit memo adjustments? +• Does CreditMemoAdjustment have unique properties? +• What class does CreditMemoAdjustment inherit from? +--- +Title: Installment DTO - Invoice Payment Schedule Structure +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: Installment +• type: concept +• domain: Installments +• system: Oracle +Content: Purpose: Data structure representing invoice payment installments with balance and payment tracking. +Key Properties: +• TransactionId (long): Invoice transaction identifier +• InstallmentId (string): Installment identifier (JSON mapped from "Installment") +• InstallmentSequence (int): Payment order sequence +• InstallmentDueDate (string): Due date +• InstallmentOriginalAmount, InstallmentBalanceDue (decimal): Amount tracking +• AmountApplied, AmountCredited, AmountAdjusted, AmountInDispute (string): Payment details +• InstallmentStatus (string): Status (e.g., "Open", "Closed") +Computed Property: +• AmountAdjustedDecimal: Parses AmountAdjusted to decimal (returns 0 if parse fails) +Example Questions: +• What fields define an installment? +• How is InstallmentBalanceDue tracked? +• What computed property parses AmountAdjusted? +--- +Title: CreditMemo DTO - Credit Memo Transaction Structure +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: CreditMemo +• type: concept +• domain: Credit Memos +• system: Oracle +Content: Purpose: Data structure representing Oracle credit memo transactions with line items and unapplied balance tracking. +Key Properties: +• TransactionId, TransactionNumber, DocumentNumber: Identifiers +• TransactionSource, TransactionType, CreditReason: Classification +• TransactionDate, AccountingDate (DateOnly): Dates +• CurrencyCode, LegalEntityId, UnappliedBalance: Financial data +• CustomerAccountNumber, SitePurposeSiteNumber: Customer references +• BusinessUnit, BusinessGroup, GenerateBill: Business context +• ReceivablesCreditMemoLines (List): Line items (JSON: "receivablesCreditMemoLines") +Computed Property: +• UnappliedBalanceDecimal: Parses UnappliedBalance to decimal (returns 0 if parse fails) +Example Questions: +• What structure represents Oracle credit memos? +• How is UnappliedBalance accessed as decimal? +• What property contains credit memo line items? +--- +Title: CreditMemoLine DTO - Credit Memo Line Item Structure +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: CreditMemoLine +• type: concept +• domain: Credit Memos +• system: Oracle +Content: Purpose: Data structure representing individual line items within credit memo transactions. +Properties: +• TransactionLineId (string): Line identifier (JSON mapped from "TransactionLineID") +• LineNumber (string): Line sequence number +• Description (string): Line description +• Quantity (int): Item quantity +• UnitPrice (decimal): Unit price +• MemoLine (string): Memo line reference +• CreatedBy, LastUpdatedBy (string): Audit fields +• CreationDate, LastUpdateDate (DateTime): Audit timestamps +Usage: Collection of CreditMemoLine objects stored in CreditMemo.ReceivablesCreditMemoLines. +Example Questions: +• What defines a credit memo line item? +• How is line item identifier mapped from JSON? +• What audit fields are tracked on credit memo lines? +--- +Title: OracleIntegrationBase - Base Oracle OIC Integration +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: OracleIntegrationBase +• type: component +• domain: Integration +• system: Oracle OIC +Content: Purpose: Abstract base class for Oracle Integration Cloud (OIC) integrations providing authentication and request building. +Processing Logic: +• OicBaseUrl(): Constructs "https://erp-{oicEnv}-oicintegration-idq4hj6bgo2f-ia.integration.us-ashburn-1.ocp.oraclecloud.com" +• GetRequestAsync(): Retrieves credentials from AWS Parameter Store, creates authenticated Flurl request with basic auth +• UpdateEndpoint(): Appends endpoint path to existing Flurl request URL +Secret Keys: +• {environment}-hfa-oic-username +• {environment}-hfa-oic-password +• {environment}-hfa-oic-environment +Key Rule: Throws exception if ENVIRONMENT variable not set. +Example Questions: +• How do Oracle integrations authenticate? +• What is the OIC base URL structure? +• Where are OIC credentials retrieved from? +--- +Title: SecretString Service - AWS Parameter Store Integration +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: SecretString +• type: component +• domain: Configuration +• system: AWS Parameter Store +Content: Purpose: Service for retrieving encrypted secrets from AWS Systems Manager Parameter Store. +Interface: ISecretString with GetSecretString(string key) method. +Processing Logic: +• Creates AmazonSimpleSystemsManagementClient +• Builds GetParameterRequest with key and WithDecryption = true +• Calls GetParameterAsync +• Returns Parameter.Value from response +Usage: Injected into integration classes to retrieve OIC credentials, mail relay certificates, and other secrets. +Example Questions: +• How are secrets retrieved from Parameter Store? +• What service retrieves encrypted parameters? +• Is decryption enabled for secret retrieval? +--- +Title: MailRelayService - Email Relay Integration +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: MailRelayService +• type: component +• domain: Email/Notifications +• system: Mail Relay +Content: Purpose: Service for sending emails via Clayton's mail relay infrastructure with SSL certificate validation. +Configuration: +• Production: "mailrelay.cct-eto.com" +• Non-production: "mailrelay.dev.cct-eto.com" +• Port: 587 +• EnableSsl: true, Timeout: 30000ms +Processing Logic: +• Validates fromAddress and toAddress not null/empty +• Creates SmtpClient via ISmtpClientFactory +• Configures TLS certificate validation from Parameter Store +• Sends MailMessage with optional attachments +• Returns true on success, false on failure +Key Rules: +• IsBodyHtml = false (plain text) +• Thread-safe certificate validation callback +• Restores existing ServerCertificateValidationCallback after send +Example Questions: +• How do I send emails via mail relay? +• What SMTP server is used for production? +• What port does mail relay use? +--- +Title: UnappliedNotificationHelper - Notification Utility Methods +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: UnappliedNotificationHelper +• type: component +• domain: Notifications +• system: N/A +Content: Purpose: Static utility methods for unapplied notification Lambda functions providing logging and subject line formatting. +Methods: +• SafeLog(string message): Wraps LambdaLogger.Log in try-catch for test environment compatibility +• GetEnvironmentPrefixedSubject(string baseSubject): Adds environment prefix to subject for non-production emails +Subject Line Logic: +• Production: Returns baseSubject unchanged +• Non-production: Prepends capitalized environment name (e.g., "Dev: {baseSubject}") +• Default environment: "dev" if null/empty/whitespace +Example Questions: +• How do I prefix email subjects by environment? +• What utility provides safe logging for tests? +• How are production vs non-production email subjects distinguished? +--- +Title: Environment-Based Email Subject Prefix Rule +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: UnappliedNotificationHelper +• type: rule +• domain: Notifications +• system: N/A +Content: Purpose: Defines rule for prefixing email subjects based on deployment environment. +Logic: +• Read ENVIRONMENT variable (default: "dev" if null/empty/whitespace) +• Trim and convert to lowercase +• If environment == "prod": return baseSubject unchanged +• Else: capitalize first character, return "{CapitalizedEnv}: {baseSubject}" +Examples: +• prod: "Unapplied Cash Receipt Notification" +• dev: "Dev: Unapplied Cash Receipt Notification" +• sit: "Sit: Unapplied Cash Receipt Notification" +Example Questions: +• How are email subjects prefixed by environment? +• Do production emails have subject prefixes? +• What format is used for non-production subject prefixes? +--- +Title: IMailRelayService Interface - Email Service Contract +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: IMailRelayService +• type: component +• domain: Email/Notifications +• system: Mail Relay +Content: Purpose: Interface defining contract for mail relay email services. +Methods: +• SendEmail(fromAddress, toAddress, subject, body): Sends plain text email +• SendEmail(fromAddress, toAddress, subject, body, attachments): Sends plain text email with optional attachments +Requirements: +• fromAddress must use noreply_* format +• Body is plain text (not HTML) +• Returns true on success, false on failure +Usage: Implemented by MailRelayService, injectable for testing and dependency management. +Example Questions: +• What interface defines email sending? +• What format is required for sender addresses? +• Do mail relay methods support attachments? +--- +Title: ISmtpClientFactory Interface - SMTP Client Factory Contract +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: ISmtpClientFactory +• type: component +• domain: Email/Notifications +• system: SMTP +Content: Purpose: Factory interface for creating SMTP client instances, enabling dependency injection and testing. +Method: +• CreateSmtpClient(string host, int port): Creates configured SmtpClient instance +Purpose: Enables mocking SMTP clients in unit tests to avoid real network I/O. +Implementations: +• DefaultSmtpClientFactory: Creates real SmtpClient for production +• Test mocks: Provide fake/mock implementations for testing +Example Questions: +• How do I inject SMTP client creation? +• What factory creates SMTP clients? +• How are SMTP clients mocked for testing? +--- +Title: DefaultSmtpClientFactory - Production SMTP Client Factory +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: DefaultSmtpClientFactory +• type: component +• domain: Email/Notifications +• system: SMTP +Content: Purpose: Default implementation of ISmtpClientFactory that creates real SMTP client instances for production use. +Implementation: +• CreateSmtpClient(string host, int port): Returns new SmtpClient(host, port) +Usage: Registered in dependency injection container as singleton for production scenarios where actual email sending is required. +Example Questions: +• What creates real SMTP clients? +• How is ISmtpClientFactory implemented for production? +• What factory is used for actual email sending? +--- +Title: NewtonsoftJsonLambdaSerializer - Lambda JSON Serialization +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: NewtonsoftJsonLambdaSerializer +• type: component +• domain: Serialization +• system: AWS Lambda +Content: Purpose: Custom Lambda serializer using Newtonsoft.Json with specific configuration for Lambda function input/output. +Configuration: +• NullValueHandling: Ignore (omit null properties) +• Converters: StringEnumConverter (serialize enums as strings) +Methods: +• Serialize(): Writes object to response stream as JSON, resets stream position to beginning +• Deserialize(): Reads object from request stream as JSON +Global Settings: Sets JsonConvert.DefaultSettings on instantiation. +Usage: Applied to Lambda functions via [assembly: LambdaSerializer(typeof(NewtonsoftJsonLambdaSerializer))]. +Example Questions: +• How do Lambdas serialize JSON? +• What JSON settings are used for Lambda functions? +• How are enums serialized in Lambda responses? +--- +Title: CommonBaseLambdaService - Base Lambda Service with DI +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: CommonBaseLambdaService +• type: component +• domain: Lambda Infrastructure +• system: AWS Lambda +Content: Purpose: Abstract base class for Lambda services providing dependency injection capabilities. +Processing Logic: +• ConfigureStartup(IStartup startup): Creates ServiceCollection, calls startup.ConfigureServices(), builds ServiceProvider +• GetService(): Resolves service instance from built ServiceProvider +Usage: Lambda classes inherit from this to access dependency-injected services (integrations, helpers, etc.). +Pattern: Constructor initializes dependencies via ConfigureStartup(), then GetService() retrieves instances. +Example Questions: +• How do Lambda functions access dependency injection? +• What base class provides DI for Lambdas? +• How are services resolved in Lambda functions? +--- +Title: IStartup Interface - Service Configuration Contract +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: IStartup +• type: component +• domain: Configuration +• system: N/A +Content: Purpose: Interface defining contract for configuring dependency injection services. +Method: +• ConfigureServices(IServiceCollection service): Registers services into DI container +Usage: Implemented by startup classes to define service registrations for Lambda functions. +Pattern: Lambda base classes call ConfigureServices() to build ServiceProvider for dependency resolution. +Example Questions: +• What interface configures DI services? +• How do startups register dependencies? +• What method registers services in DI container? +--- +Title: ComonStartup - Common Service Configuration +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: ComonStartup +• type: component +• domain: Configuration +• system: N/A +Content: Purpose: Abstract base startup class that registers common services used across Lambda functions. +Registered Services (Singleton): +• IMailRelayService → MailRelayService +• ISecretString → SecretString +Usage: Lambda-specific startup classes inherit from ComonStartup to include common service registrations plus their own specific services. +Pattern: Provides consistent service registration baseline across all Lambda projects in solution. +Example Questions: +• What services are registered by default? +• What startup class provides common services? +• How are mail relay and secret services registered? +--- +Title: Mail Relay Environment-Based Server Selection +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: MailRelayService +• type: rule +• domain: Email/Notifications +• system: Mail Relay +Content: Purpose: Defines rule for selecting mail relay server based on deployment environment. +Server Selection Logic: +• Read ENVIRONMENT variable (default: "dev" if null) +• Convert to lowercase +• If environment == "prod": Use "mailrelay.cct-eto.com" +• Else (dev, sit, etc.): Use "mailrelay.dev.cct-eto.com" +Configuration: +• Port: 587 (all environments) +• SSL: Enabled (all environments) +Example Questions: +• What mail relay server is used in production? +• How is mail server selected by environment? +• What port is used for mail relay? +--- +Title: Mail Relay TLS Certificate Validation +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: MailRelayService +• type: workflow +• domain: Email/Notifications +• system: Mail Relay +Content: Purpose: Configures TLS certificate validation for mail relay SMTP connections. +Workflow: +1. Retrieve cached certificate from Parameter Store (or cache) +2. Lock _tlsCallbackLock for thread safety +3. Set ServicePointManager.ServerCertificateValidationCallback +4. Add certificate to chain.ChainPolicy.ExtraStore +5. Build certificate chain: chain.Build((X509Certificate2)cert) +6. Return validation result (true if valid) +7. Restore previous callback after email sent +Key Rules: +• Certificate cached after first retrieval (_cachedCertificate) +• Thread-safe callback management +• Returns null-safe (skips if certificate null) +Example Questions: +• How is mail relay TLS validated? +• How are mail relay certificates cached? +• What ensures thread-safe certificate validation? +--- +Title: Installment AmountAdjustedDecimal Parsing Rule +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: Installment +• type: rule +• domain: Installments +• system: Oracle +Content: Purpose: Provides safe decimal parsing of string-based AmountAdjusted field. +Parsing Logic: +• decimal.TryParse(AmountAdjusted, out var amount) +• Returns parsed amount if successful +• Returns 0m if parse fails +Property: AmountAdjustedDecimal (computed, read-only) +Usage: Enables numeric operations on adjustment amounts without exception risk from invalid string values. +Example Questions: +• How is AmountAdjusted converted to decimal? +• What happens if AmountAdjusted parsing fails? +• What computed property provides decimal adjustment amount? +--- +Title: CreditMemo UnappliedBalanceDecimal Parsing Rule +Metadata: +• module: CMH.HFA.Accounting.AccountsReceivable.Common +• component: CreditMemo +• type: rule +• domain: Credit Memos +• system: Oracle +Content: Purpose: Provides safe decimal parsing of string-based UnappliedBalance field. +Parsing Logic: +• Decimal.TryParse(UnappliedBalance, out decimal unappliedBalanceDecimal) +• Returns parsed value if successful +• Returns 0 if parse fails +Property: UnappliedBalanceDecimal (computed, read-only) +Usage: Enables numeric comparisons and calculations on credit memo balances without exception risk from invalid string values. +Example Questions: +• How is UnappliedBalance converted to decimal? +• What happens if UnappliedBalance parsing fails? +• What computed property provides decimal unapplied balance? +--- +This completes the RAG knowledge chunks for the CMH.HFA.Accounting.AccountsReceivable.Common module. Each chunk is atomic, non-overlapping, and optimized for retrieval-augmented generation with precise technical details about common models, integration services, and infrastructure components. diff --git a/Books/Accounting/AccountsReceivable/AccountsReceivableCreditMemoApplications.txt b/Books/Accounting/AccountsReceivable/AccountsReceivableCreditMemoApplications.txt new file mode 100644 index 0000000..3d1038b --- /dev/null +++ b/Books/Accounting/AccountsReceivable/AccountsReceivableCreditMemoApplications.txt @@ -0,0 +1,276 @@ +Title: CreditMemoApplication Lambda - Get Method +Metadata: +• module: CreditMemoApplications +• component: CreditMemoApplication +• type: component +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Retrieves credit memo applications from Oracle AR based on search criteria. +Processing Logic: +• Accepts GetCreditMemoApplicationDto with search parameters +• Delegates to ICreditMemoApplicationOicIntegration.GetCreditMemoApplicationAsync +• Returns List +• Lambda configuration: 256MB memory, 30s timeout +Example Questions: +• How do I retrieve credit memo applications by credit memo number? +• What Lambda method gets credit memo applications from Oracle? +• What are the input parameters for retrieving credit memo applications? +--- +Title: CreditMemoApplication Lambda - Post Method +Metadata: +• module: CreditMemoApplications +• component: CreditMemoApplication +• type: component +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Posts a single credit memo application to Oracle AR system. +Processing Logic: +• Accepts OracleCreditMemoApplication DTO +• Delegates to ICreditMemoApplicationOicIntegration.PostCreditMemoApplicationAsync +• Returns posted OracleCreditMemoApplication with Oracle-assigned values +• Lambda configuration: 256MB memory, 30s timeout +Example Questions: +• How do I create a credit memo application in Oracle? +• What Lambda method posts credit memo applications? +• What is the return value when posting a credit memo application? +--- +Title: CreditMemoApplication Lambda - Pre Method (Preprocessing) +Metadata: +• module: CreditMemoApplications +• component: CreditMemoApplication +• type: component +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Preprocesses credit memo applications by matching unapplied credit memos to open installments. +Processing Logic: +• Accepts PreProcessCreditMemoApplicationsDto with CreditMemos and Installments collections +• Filters credit memos where UnappliedBalanceDecimal < 0 +• Filters installments where InstallmentBalanceDue > 0, sorts by InstallmentSequence +• Routes to ApplyEndorsementEvenly for "HFA CM Endorse Int" or "HFA CM Endorse Ext" transaction types +• Routes to ApplySequentially for all other transaction types +• Returns IEnumerable +• Lambda configuration: 256MB memory, 30s timeout +Example Questions: +• How are credit memos matched to installments automatically? +• What Lambda method generates credit memo application recommendations? +• How does preprocessing determine which application algorithm to use? +--- +Title: Credit Memo Application - Sequential Allocation Algorithm +Metadata: +• module: CreditMemoApplications +• component: CreditMemoApplication +• type: workflow +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Applies credit memo balance to installments sequentially (oldest first) using greedy algorithm. +Processing Logic: +1. Iterates through sorted installments (by InstallmentSequence ascending) +2. For each installment with InstallmentBalanceDue > 0 and creditMemo.UnappliedBalanceDecimal < 0: +• Calculates unappliedCreditMemoBalance = UnappliedBalanceDecimal * -1 +• Calculates amountApplied = Math.Min(unappliedCreditMemoBalance, InstallmentBalanceDue) +• Creates OracleCreditMemoApplication with amountApplied +• Updates creditMemo.UnappliedBalance (adds amountApplied) +• Reduces installment.InstallmentBalanceDue by amountApplied +3. Breaks when creditMemo.UnappliedBalanceDecimal == 0 +Example Questions: +• How does the sequential credit memo allocation algorithm work? +• How are credit memo balances applied to installments in order? +• What is the greedy algorithm for credit memo applications? +--- +Title: Credit Memo Application - Endorsement Even Distribution Algorithm +Metadata: +• module: CreditMemoApplications +• component: CreditMemoApplication +• type: workflow +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Distributes endorsement credit memo balance evenly across all open installments. +Processing Logic: +1. Calculates remainingToDistribute = Math.Abs(UnappliedBalanceDecimal) +2. Filters active installments where InstallmentBalanceDue > 0 +3. Calculates equalShare = Math.Round(remainingToDistribute / installmentCount, 2, AwayFromZero) +4. If equalShare <= 0, sets to Math.Min(remainingToDistribute, 0.01m) +5. For each installment: allocates Math.Min(equalShare, InstallmentBalanceDue) +6. Updates credit memo and installment balances after each allocation +7. Adds any remaining balance to first installment (InstallmentNumber == "1") +Key Rules: +• Minimum allocation: 0.01m (one cent) +• Remainder goes to installment 1 +Example Questions: +• How are endorsement credit memos distributed across installments? +• What transaction types trigger even distribution of credit memos? +• How is rounding handled for endorsement credit memo applications? +--- +Title: Credit Memo Application - Unapplied Credit Memo Filtering Rule +Metadata: +• module: CreditMemoApplications +• component: CreditMemoApplication +• type: rule +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Filters credit memos eligible for automatic application. +Processing Logic: +• Filters credit memos where UnappliedBalanceDecimal < 0 (negative indicates available credit) +• Returns empty collection if no unapplied credit memos or no installments available +• Negative UnappliedBalanceDecimal values represent credit available to apply +Key Rules: +• UnappliedBalanceDecimal < 0 indicates available credit +• Both credit memos and installments must exist for processing +Example Questions: +• How do I identify credit memos available for application? +• What does a negative UnappliedBalanceDecimal mean? +• What filtering rules determine eligible credit memos? +--- +Title: Credit Memo Application - Endorsement Transaction Type Rule +Metadata: +• module: CreditMemoApplications +• component: CreditMemoApplication +• type: rule +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Determines credit memo application algorithm based on transaction type. +Processing Logic: +• If TransactionType is "HFA CM Endorse Int" OR "HFA CM Endorse Ext": use ApplyEndorsementEvenly +• All other transaction types: use ApplySequentially +Key Rules: +• Endorsement internal and external credit memos distribute evenly +• Standard credit memos apply sequentially +• Constants: HfaCmEndorseInt = "HFA CM Endorse Int", HfaCmEndorseExt = "HFA CM Endorse Ext" +Example Questions: +• How does the system determine credit memo application strategy? +• What transaction types trigger even distribution? +• How are endorsement credit memos handled differently? +--- +Title: OracleCreditMemoApplication DTO +Metadata: +• module: CreditMemoApplications +• component: OracleCreditMemoApplication +• type: concept +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Data transfer object representing credit memo applications in Oracle AR. +Processing Logic: +• Core properties: ActionType, ApplicationId, ApplicationDate, ApplicationAmount, ApplicationStatus, AccountingDate +• Relationship properties: CreditMemoId, CreditMemoNumber, InvoiceId, InvoiceNumber, InstallmentId, InstallmentNumber +• Metadata properties: BusinessUnit, TransactionType, CreditMemoStatus, ReferenceTransactionStatus, CustomerSiteNumber, Comments, IsLatestApplication +• Computed property: AppAmount (decimal parsed from ApplicationAmount string) +Example Questions: +• What properties define a credit memo application? +• How is the application amount stored in Oracle integration? +• What identifiers link a credit memo application to invoices and installments? +--- +Title: PreProcessCreditMemoApplicationsDto +Metadata: +• module: CreditMemoApplications +• component: PreProcessCreditMemoApplicationsDto +• type: concept +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Input DTO for credit memo application preprocessing Lambda method. +Processing Logic: +• CreditMemos: IEnumerable collection of credit memos to apply +• Installments: IEnumerable collection of target installments +• InvoiceId: string identifier for the invoice being applied to +• Used as input to Pre() method for automatic credit memo application generation +Example Questions: +• What input does the credit memo preprocessing method require? +• How do I specify credit memos and installments for automatic matching? +• What is the structure of the preprocessing request DTO? +--- +Title: GetCreditMemoApplicationDto +Metadata: +• module: CreditMemoApplications +• component: GetCreditMemoApplicationDto +• type: concept +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Query parameters DTO for retrieving credit memo applications. +Processing Logic: +• ApplicationId: filters by unique application identifier +• CustAccountId: filters by customer account identifier +• CreditMemoNumber: filters by credit memo number +• InvoiceNumber: filters by invoice number +• HasSearchCriteriaAvailable: computed property returns true if any parameter is non-empty +• At least one parameter required for valid query +Example Questions: +• What search criteria can I use to find credit memo applications? +• How do I query credit memo applications by customer account? +• What validation ensures search criteria are provided? +--- +Title: CreditMemoApplicationOicIntegration - POST Method +Metadata: +• module: CreditMemoApplications +• component: CreditMemoApplicationOicIntegration +• type: component +• domain: Accounts Receivable +• system: Oracle OIC +Content: +Purpose: Posts credit memo application to Oracle Integration Cloud. +Processing Logic: +• Endpoint: "/ic/api/integration/v1/flows/rest/CHI_CREDTIMEMO_API/1.0/CreditMemoApplication" +• Serializes OracleCreditMemoApplication to JSON using Newtonsoft.Json +• Sets Content-Type header to "application/json" +• Posts via Flurl PostStringAsync +• Deserializes response to OracleCreditMemoApplication +• Returns created application with Oracle-assigned values +Example Questions: +• What Oracle OIC endpoint is used for posting credit memo applications? +• How are credit memo applications serialized for Oracle integration? +• What is the return value from the Oracle credit memo application API? +--- +Title: CreditMemoApplicationOicIntegration - GET Method +Metadata: +• module: CreditMemoApplications +• component: CreditMemoApplicationOicIntegration +• type: component +• domain: Accounts Receivable +• system: Oracle OIC +Content: +Purpose: Retrieves credit memo applications from Oracle Integration Cloud with query filters. +Processing Logic: +• Validates GetCreditMemoApplicationDto.HasSearchCriteriaAvailable, throws ArgumentException if false +• Endpoint: "/ic/api/integration/v1/flows/rest/CHI_CREDTIMEMO_API/1.0/CreditMemoApplication" +• Appends query parameters via SetQueryParam for: ApplicationId, CustAccountId, CreditMemoNumber, InvoiceNumber +• Parses JSON response, checks for "CreditMemoApplications" wrapper property +• If wrapper exists, extracts array from jsonObject["CreditMemoApplications"] +• Returns List +• Throws exception with FlurlHttpException details on error +Example Questions: +• How do I retrieve credit memo applications by invoice number? +• What validation is performed on credit memo application search criteria? +• How does the API handle JSON response parsing for credit memo applications? +--- +Title: Credit Memo Application - Standard Field Values +Metadata: +• module: CreditMemoApplications +• component: CreditMemoApplication +• type: rule +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Defines default values for credit memo application fields. +Processing Logic: +• ActionType: "Apply" +• ApplicationDate: DateOnly.FromDateTime(DateTime.Today) +• BusinessUnit: "HFA BU" +• ApplicationAmount: decimal amount converted to string +• InvoiceId, InstallmentId, CreditMemoId: from input parameters +• InstallmentNumber: InstallmentSequence converted to string +Key Rules: +• ApplicationDate always set to today's date +• ActionType always "Apply" for automatic applications +• BusinessUnit always "HFA BU" +Example Questions: +• What are the default values for credit memo application fields? +• What ActionType is used for automatic credit memo applications? +• How is the application date determined for credit memo applications? diff --git a/Books/Accounting/AccountsReceivable/AccountsReceivableCreditMemoRefunds.txt b/Books/Accounting/AccountsReceivable/AccountsReceivableCreditMemoRefunds.txt new file mode 100644 index 0000000..e69de29 diff --git a/Books/Accounting/AccountsReceivable/AccountsReceivableCreditMemos.txt b/Books/Accounting/AccountsReceivable/AccountsReceivableCreditMemos.txt new file mode 100644 index 0000000..6538713 --- /dev/null +++ b/Books/Accounting/AccountsReceivable/AccountsReceivableCreditMemos.txt @@ -0,0 +1,190 @@ +Title: CreditMemoLambda - Post Method +Metadata: +• module: CreditMemos +• component: CreditMemoLambda +• type: component +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Posts a credit memo to Oracle AR system. +Processing Logic: +• Accepts CreditMemo model from Common namespace +• Delegates to ICreditMemoOicIntegration.PostCreditMemoAsync +• Returns posted CreditMemo with Oracle-assigned values +• Lambda configuration: 256MB memory, 30s timeout +• Resource name: "CreditMemoPost" +Example Questions: +• How do I create a credit memo in Oracle? +• What Lambda method posts credit memos? +• What is the return value when posting a credit memo? +--- +Title: CreditMemoLambda - Get Method +Metadata: +• module: CreditMemos +• component: CreditMemoLambda +• type: component +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Retrieves credit memos from Oracle AR based on search criteria. +Processing Logic: +• Accepts GetCreditMemosDto with search parameters +• Delegates to ICreditMemoOicIntegration.GetCreditMemoAsync +• Returns IEnumerable +• Lambda configuration: 256MB memory, 30s timeout +Example Questions: +• How do I retrieve credit memos by customer account number? +• What Lambda method gets credit memos from Oracle? +• What search criteria can I use to find credit memos? +--- +Title: CreditMemoLambda - SelectMostRecentValidCreditMemo Method +Metadata: +• module: CreditMemos +• component: CreditMemoLambda +• type: component +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Filters and selects the most recent valid cancellation credit memo from a list. +Processing Logic: +• Accepts List +• Filters by AllowedTypes: "HFA CM Cancel Int" or "HFA CM Cancel Ext" (case-insensitive) +• Orders by TransactionDate descending +• Returns first match or null if none found +• Lambda configuration: 256MB memory, 30s timeout +Example Questions: +• How do I find the most recent cancellation credit memo? +• What credit memo types are valid for selection? +• How does the system filter credit memos by transaction type? +--- +Title: Credit Memo - Valid Cancellation Type Rule +Metadata: +• module: CreditMemos +• component: CreditMemoLambda +• type: rule +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Defines allowed transaction types for cancellation credit memo selection. +Processing Logic: +• AllowedTypes HashSet contains: "HFA CM Cancel Int", "HFA CM Cancel Ext" +• Case-insensitive comparison via StringComparer.OrdinalIgnoreCase +• Used by SelectMostRecentValidCreditMemo to filter valid credit memos +Key Rules: +• Only internal and external cancellation credit memos are valid +• Case-insensitive matching +Example Questions: +• What transaction types are valid for cancellation credit memos? +• How are credit memo types validated for selection? +• Is credit memo type matching case-sensitive? +--- +Title: GetCreditMemosDto +Metadata: +• module: CreditMemos +• component: GetCreditMemosDto +• type: concept +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Query parameters DTO for retrieving credit memos from Oracle. +Processing Logic: +• CustomerAccountNumber: filters by customer account +• CreditMemoId: filters by unique transaction identifier +• PurchaseOrderNumber: optional secondary filter used with CustomerAccountNumber +• At least one identifier required (CustomerAccountNumber or CreditMemoId) +Example Questions: +• What parameters can I use to search for credit memos? +• How do I query credit memos by purchase order number? +• What is the structure of the credit memo query DTO? +--- +Title: CreditMemoOicIntegration - GET Method +Metadata: +• module: CreditMemos +• component: CreditMemoOicIntegration +• type: component +• domain: Accounts Receivable +• system: Oracle OIC +Content: +Purpose: Retrieves credit memos from Oracle Integration Cloud with conditional query logic. +Processing Logic: +• Endpoint: "/ic/api/integration/v1/flows/rest/CHI_CREDITMEMO_API/1.0/CreditMemo" +• If CustomerAccountNumber provided: appends CustomerAccountNumber query param, optionally appends PurchaseOrderNumber +• Else if CreditMemoId provided: appends as "TransactionId" query param +• Else throws ArgumentException "An Identifier is Required to GET Credit Memo" +• Parses JSON response, extracts "ARCreditMemos" array +• Returns List or empty list if null +Example Questions: +• What Oracle OIC endpoint retrieves credit memos? +• How does the API validate credit memo search criteria? +• What JSON property contains the credit memo array in responses? +--- +Title: CreditMemoOicIntegration - POST Method +Metadata: +• module: CreditMemos +• component: CreditMemoOicIntegration +• type: component +• domain: Accounts Receivable +• system: Oracle OIC +Content: +Purpose: Posts credit memo to Oracle Integration Cloud. +Processing Logic: +• Endpoint: "/ic/api/integration/v1/flows/rest/CHI_CREDITMEMO_API/1.0/CreditMemo" +• Serializes CreditMemo to JSON using Newtonsoft.Json +• Sets Content-Type header to "application/json" +• Posts via Flurl PostStringAsync +• Deserializes response to CreditMemo +• Returns created credit memo with Oracle-assigned values +Example Questions: +• What Oracle OIC endpoint is used for posting credit memos? +• How are credit memos serialized for Oracle integration? +• What is the return value from the Oracle credit memo API? +--- +Title: Credit Memo Query - Conditional Parameter Logic +Metadata: +• module: CreditMemos +• component: CreditMemoOicIntegration +• type: workflow +• domain: Accounts Receivable +• system: Oracle OIC +Content: +Purpose: Implements conditional query parameter logic for credit memo retrieval. +Processing Logic: +1. Check if CustomerAccountNumber is provided (not null/empty) +• If yes: append CustomerAccountNumber query param +• Check if PurchaseOrderNumber is provided +• If yes: append PurchaseOrderNumber query param +2. Else check if CreditMemoId is provided (not null/empty) +• If yes: append as "TransactionId" query param +3. Else throw ArgumentException +Key Rules: +• CustomerAccountNumber is primary search method +• PurchaseOrderNumber only valid with CustomerAccountNumber +• CreditMemoId maps to "TransactionId" query parameter +• At least one identifier required +Example Questions: +• How does the credit memo API determine which query parameters to use? +• Can I search credit memos by purchase order alone? +• What happens if no search criteria are provided? +--- +Title: Credit Memo Selection - Most Recent by Transaction Date +Metadata: +• module: CreditMemos +• component: CreditMemoLambda +• type: workflow +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Selects most recent valid cancellation credit memo from a collection. +Processing Logic: +1. Validate input list not null or empty (return null if invalid) +2. Filter credit memos where TransactionType matches AllowedTypes ("HFA CM Cancel Int" or "HFA CM Cancel Ext") +3. Order filtered results by TransactionDate descending +4. Return FirstOrDefault (most recent or null) +Key Rules: +• TransactionDate is sorting key +• Only cancellation types considered +• Returns null if no valid credit memos found +Example Questions: +• How does the system determine the most recent credit memo? +• What sorting is applied to credit memo selection? +• What happens when no valid credit memos exist? diff --git a/Books/Accounting/AccountsReceivable/AccountsReceivableInvoiceInstallments.txt b/Books/Accounting/AccountsReceivable/AccountsReceivableInvoiceInstallments.txt new file mode 100644 index 0000000..cf3fdd3 --- /dev/null +++ b/Books/Accounting/AccountsReceivable/AccountsReceivableInvoiceInstallments.txt @@ -0,0 +1,178 @@ +Title: MapInstallmentSequenceLambda - Map Method +Metadata: +• module: InvoiceInstallments +• component: MapInstallmentSequenceLambda +• type: component +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Finds installment sequence by matching installment ID from a collection. +Processing Logic: +• Accepts MapInstallmentSequenceDto containing InstallmentId and Installments list +• Validates InstallmentId is not null/empty, throws ArgumentNullException if invalid +• Validates Installments list is not null, throws ArgumentNullException if invalid +• Uses FirstOrDefault to find installment where InstallmentId matches +• Returns InstallmentSequence as string, or null if no match found +• Lambda configuration: 256MB memory, 30s timeout +Example Questions: +• How do I find an installment sequence by installment ID? +• What Lambda method maps installment IDs to sequence numbers? +• What validation is performed on installment mapping inputs? +--- +Title: GetInvoiceWithInstallments Lambda - Handler Method +Metadata: +• module: InvoiceInstallments +• component: GetInvoiceWithInstallments +• type: component +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Retrieves invoice and associated installments for a customer policy. +Processing Logic: +• Accepts InvoiceInstallmentsDto with PolicyNumber and AccountNumber +• Deconstructs DTO to extract policy and account number +• Creates GetInvoicesDto with PolicyNumber and CustomerAccountNumber +• Calls IOracleInvoiceIntegration.GetInvoicesAsync to retrieve invoices +• Throws exception "Invoice not found" if invoices null or empty +• Selects first invoice from results (invoices[0]) +• Calls IInstallmentIntegration.GetAsync with invoice.TransactionID +• Returns new Invoice object combining OracleInvoice and installments +Example Questions: +• How do I retrieve an invoice with its installments? +• What happens when no invoice is found for a policy number? +• What integrations are used to fetch invoice and installment data? +--- +Title: InvoiceInstallmentsDto +Metadata: +• module: InvoiceInstallments +• component: InvoiceInstallmentsDto +• type: concept +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Input DTO for retrieving invoice with installments, with deconstruction support. +Processing Logic: +• PolicyNumber: string identifier for the policy +• AccountNumber: string customer account identifier +• Deconstruct method: extracts PolicyNumber and AccountNumber as tuple +• Validates PolicyNumber not null during deconstruction, throws ArgumentNullException +• Validates AccountNumber not null during deconstruction, throws ArgumentNullException +• Enables tuple-style assignment: (string policy, string account) = dto +Example Questions: +• What input parameters are needed to retrieve invoice with installments? +• How does InvoiceInstallmentsDto support tuple deconstruction? +• What validation occurs during DTO deconstruction? +--- +Title: MapInstallmentSequenceDto +Metadata: +• module: InvoiceInstallments +• component: MapInstallmentSequenceDto +• type: concept +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Input DTO for mapping installment ID to sequence number. +Processing Logic: +• InstallmentId: string identifier for the target installment +• Installments: List collection to search within +• Both properties are nullable +• Validation performed in consuming Lambda (MapInstallmentSequenceLambda) +Example Questions: +• What properties are needed to map installment sequence? +• How is the installment collection provided for sequence mapping? +• Is MapInstallmentSequenceDto validated in the DTO or Lambda? +--- +Title: Invoice Model (InvoiceInstallments Module) +Metadata: +• module: InvoiceInstallments +• component: Invoice +• type: concept +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Extended invoice model combining OracleInvoice properties with installments collection. +Processing Logic: +• Inherits from OracleInvoice base class +• Adds Installments property: IEnumerable +• Constructor accepts OracleInvoice and installments collection +• Copies all OracleInvoice properties: TransactionID, TransactionType, TransactionNumber, DocumentNumber, TransactionDate, AccountingDate, PaymentTerms, DueDate, Comments, PurchaseOrderNumber, ProductType, PremiumPayable, InstallmentFee, PhysicalAddressState, PolicyTermOriginalInvoice, CustomerAccountNumber, SitePurposeSiteNumber, TransactionStatus, PrintStatus, InvoiceBalanceAmount, TransactionLines, CreatedOn +• Assigns Installments collection +Example Questions: +• How is an invoice model extended to include installments? +• What properties are copied from OracleInvoice to the extended Invoice model? +• How do I combine invoice and installment data in a single object? +--- +Title: Invoice with Installments Retrieval Workflow +Metadata: +• module: InvoiceInstallments +• component: GetInvoiceWithInstallments +• type: workflow +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Orchestrates retrieval of invoice and installments from Oracle integrations. +Processing Logic: +1. Receive InvoiceInstallmentsDto with PolicyNumber and AccountNumber +2. Deconstruct DTO to extract values +3. Build GetInvoicesDto request +4. Call invoice integration to retrieve invoices by policy and account +5. Validate invoice collection not null/empty +6. Extract first invoice from results +7. Call installment integration with invoice.TransactionID +8. Construct extended Invoice model with OracleInvoice data and installments +9. Return combined Invoice object +Key Rules: +• Always uses first invoice if multiple returned +• Throws exception if no invoices found +Example Questions: +• What is the step-by-step process for retrieving invoice with installments? +• How are invoice and installment data combined? +• What happens if multiple invoices match the policy number? +--- +Title: Installment Sequence Lookup Rule +Metadata: +• module: InvoiceInstallments +• component: MapInstallmentSequenceLambda +• type: rule +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Defines matching logic for finding installment sequence by ID. +Processing Logic: +• Uses LINQ FirstOrDefault to search installments collection +• Matches on InstallmentId equality (i.InstallmentId == mapInstallmentSequenceDto.InstallmentId) +• Extracts InstallmentSequence property from matched installment +• Converts InstallmentSequence integer to string via ToString() +• Returns null if no matching installment found +Key Rules: +• Exact match on InstallmentId required +• Returns null (not exception) for no match +• Sequence converted to string for return +Example Questions: +• How is installment ID matched to find sequence? +• What is returned when no matching installment ID is found? +• How is the installment sequence formatted for return? +--- +Title: InvoiceInstallmentsDto Deconstruction Pattern +Metadata: +• module: InvoiceInstallments +• component: InvoiceInstallmentsDto +• type: rule +• domain: Accounts Receivable +• system: Oracle AR +Content: +Purpose: Implements tuple deconstruction for extracting policy and account numbers. +Processing Logic: +• Deconstruct method signature: out string policyNumber, out string accountNumber +• Validates PolicyNumber not null before assignment, throws ArgumentNullException if null +• Validates AccountNumber not null before assignment, throws ArgumentNullException if null +• Assigns PolicyNumber to policyNumber out parameter +• Assigns AccountNumber to accountNumber out parameter +• Enables syntax: (string policy, string account) = dto +Key Rules: +• Validation occurs during deconstruction, not construction +• Both properties required (no null allowed) +Example Questions: +• How does InvoiceInstallmentsDto support C# deconstruction syntax? +• When are PolicyNumber and AccountNumber validated? +• What exception is thrown for null policy or account numbers? diff --git a/Books/Music/Song Queues/Seans Mission.txt b/Books/Music/Song Queues/Seans Mission.txt new file mode 100644 index 0000000..5567be7 --- /dev/null +++ b/Books/Music/Song Queues/Seans Mission.txt @@ -0,0 +1,30 @@ +Seans Mission +Chunk 1: Introduction +Metadata: + theme: rocket on launch pad preparing for flight, birds flying, gentle ocean swells nearby, the rocket is tall, the engines are steaming. + emotion: quiet + character: ephemeral + +Chunk 2: The Inciting Incident +Metadata: + theme: final system checks, preparation, crew strapping in, buttons being pressed + emotion: anticipation + character: excitement + +Chunk 3: Rising Action +Metadata: + theme: the countdown begins, the control room brims with talk as last minute systems are checked. + emotion: adrenaline rush + character: fear mixed with excitement and hope + +Chunk 4: The Turning Point +Metadata: + theme: Launch. The engines burst alive. The rocket lifts from the pad. The tower releases and swings away. + emotion: euphoria + character: the hope that the liftoff goes well + +Chunk 5: Resolution +Metadata: + theme: The rocket soars away, gaining speed and momentum. Bursting through the clouds. The contrail it leaves behind. + emotion: happiness, thrill of success, + character: optimism for the future of all mankind. \ No newline at end of file diff --git a/Books/Music/Song Queues/The Strong Willed Man.txt b/Books/Music/Song Queues/The Strong Willed Man.txt new file mode 100644 index 0000000..25ea90f --- /dev/null +++ b/Books/Music/Song Queues/The Strong Willed Man.txt @@ -0,0 +1,27 @@ +The Strong Willed Man +Chunk 1: The Setup +Metadata: + theme: awakens, tired, struggle out of bed + emotion: another day, tired + character: pick yourself up +Chunk 2: The Inciting Incident +Metadata: + theme: rainy, lightning, storm clouds swirling, flashes of light + emotion: caution, impending doom + character: the will to face it +Chunk 3: Rising Action +Metadata: + theme: storm coming closer, blinding lightning, gale winds + emotion: turn back, can't make it + character: too much to overcome +Chunk 4: The Turning Point +Metadata: + theme: clouds parting, winds die down + emotion: elation, happiness + character: boldness +Chunk 5: Resolution +Metadata: + theme: sunshine, blue sky + emotion: resolve + character: stand string + diff --git a/Books/Music/Song Queues/The Undecided Man.txt b/Books/Music/Song Queues/The Undecided Man.txt new file mode 100644 index 0000000..cfc11b3 --- /dev/null +++ b/Books/Music/Song Queues/The Undecided Man.txt @@ -0,0 +1,30 @@ +The Undecided Man +Chunk 1: Introduction +Metadata: + theme: melodic introduction with harmonic notes + emotion: quiet + character: ephemeral + +Chunk 2: The Inciting Incident +Metadata: + theme: focuses on the inner world of the boy. + emotion: concern + character: distress + +Chunk 3: Rising Action +Metadata: + theme: growing unrest and despair at his inability to integrate socially. Makes bad decisions + emotion: growing concern + character: disturbed + +Chunk 4: The Turning Point +Metadata: + theme: he's always in trouble. Can't quite get it right. Can't think things through. + emotion: futility + character: giving up. + +Chunk 5: Resolution +Metadata: + theme: comes around and becomes a man. Growing his life. Getting things right. + emotion: happiness + character: resolve \ No newline at end of file diff --git a/Scales.py b/Scales.py index ee980f3..aeb5ec0 100644 --- a/Scales.py +++ b/Scales.py @@ -12,7 +12,7 @@ MODE_PATTERNS = { def build_scale(root, pattern): idx = NOTES.index(root) - scale = [NOTES[idx]] + scale = [NOTES[idx] for step in pattern[:-1]: idx = (idx + step) % 12 scale.append(NOTES[idx])