Insurance Services
General Insurance Services
BCP Components and APIs
BCP Data Model
Sidebar On this page

This document describes the entities, relationships, and data flows of the InsureMO BCP (Billing/Collection/Payment) module for General Insurance.


Entity Relationship Diagram

BcpBizTransaction ----> BcpFee --------------------------> GLIntegrationVoucherDetail
(root) (fee breakdown) (via GLMappingRule - Data Table)
|
+----> BcpArap <-----------------------------------------------+
| (AR/AP) |
| |
| +-----------------> BcpCollection -----> BcpCollectionDetail ----> BcpSuspense
| | (money in) (detail) (parked funds)
| | |
| +--------------- BcpOffset <--------------------------------------------+
| (AR/AP netting) |
| |
+----> BcpPayment ----> BcpPaymentDetail ----> BcpArap |
(money out) (detail) (direct clear, NO Offset) |
|
(Suspense used in Offset)

Core Entities

BcpBizTransaction — Root Business Transaction

The root object for every financial activity in BCP. Immutable once created.

FieldDescriptionCode Table
BizTransIdUnique identifier
BizTransTypeTransaction type (NEWBIZ, ENDORSEMENT, CLAIM, etc.)BizTransactionType
PolicyNoAssociated policy number
ProductCodeAssociated productProducts
BizModuleModule origin (PA, Claim, Finance)BizModule
BizSourceDirect, Fac In, CoinsuranceBizSource
AmountTransaction amount
CurrencyCodeTransaction currency
PaymentMethodPayment method (Cash, Cheque, etc.)BcpPaymentMethod
ChannelCodeProducer/Agent IDSalesChannelAPI
RefTransIdReference transaction ID for lookups
BizTransTimeTimestamp of the transaction

API: loadBizTransaction, loadBizTransactionsByRefTransId, queryEsData


BcpFee — Fee Component

Raw data source for GL generation. Contains detailed fee breakdowns (Net Premium, Tax, Commission). The original Fee created during billing is immutable once sent, but new Fee records are generated during each subsequent transaction (Collection, Payment, Offset, Reverse) to record fee movements for GL.

FieldDescriptionCode Table
BcpFeeIdUnique identifier
BizTransIdParent BizTransaction
BcpFeeTypeFee type code
AmountFee amount
AmountSignSign (+/-) indicating debit/credit
CurrencyCodeCurrency

One BizTransaction can produce multiple Fee records. Each fee may:

  • Enter BcpArap — trigger receivable/payable creation
  • Enter SalesCommission — create commission records in orchestration layer
  • Send to GL — map to General Ledger via GLMappingRule - Data Table

API: syncDataToBCP, getFeeList, syncAdditionalFeeToBCP


BcpArap — Accounts Receivable / Payable

Tracks BCP transaction status (Outstanding, Paid, Cancelled) and balance (remaining amount to collect/pay).

FieldDescriptionCode Table
ArapIdUnique identifier
BizTransIdParent BizTransaction
ArapTypePremium, Claim Settlement etc.BcpArapType
AmountOriginal AR/AP amount
BalanceRemaining uncollected/unpaid amount
ArapStatus1=Outstanding, 2=Settled, 7=CancelledBcpArapStatus
ArapCate1=Receivable, 2=PayableBcpArapCate
CurrencyCodeCurrency
DueDatePayment due date

Key Rule: One business data transmission with multiple fee components generates one AR or one AP per installment.


BcpCollection — Collection Record

Money received from customers (premium payments, endorsements, prepayments).

FieldDescriptionCode Table
CollectionIdUnique identifier
CollectionNoBusiness reference number
CollectionType1=Prepay, 2=collection, 3=Policy Premium, etc.BcpCollectionType
CollectionStatus1=Collected, 2=Confirmed, 3=Reversed, 4=RefundBcpCollectionStatus
PaymentMethodMethod of payout (Cheque, Credit Card, etc.)BcpPaymentMethod
AmountTotal collected amount
ReceiptNoManual or system-generated receipt number
PayerPayeeNameName of the payer
ConfirmTimeWhen the collection was finalized
BankAccountNoSource bank account
OrderIdsLinks to BcpPrepayOrder (for prepayments)

CollectionDetail sub-records:

FieldDescription
AmountDetail amount
CurrencyCodeCurrency
RefIdReference ID (links to BcpSuspense)
RefTypeAlways 2 (Suspense) for CollectionDetail

Timestamp Fields

BcpCollection carries three categories of timestamps. Each business-event timestamp has a paired System variant that records the actual system-clock time at processing (useful for audit when the business time was back-dated or forward-dated).

Business-event timestamps — when the business event nominally occurred (the *Time fields; set only if not already provided, so they may be back-dated by the caller):

FieldWhen set
ReceiveTimeWhen the receipt/payment was received. Auto-filled only if null — the caller may pass a back-dated value (e.g. Prepay ReceiptDate, or manual receipt input).
ConfirmTimeWhen the collection was confirmed/finalized (normally triggered by a 3rd-party payment-integration callback).
ReverseTimeWhen the collection was reversed.
LastOperateTimeRefreshed by every business operation that touches the collection (collect, apply/offset, confirm, reverse, payment). Paired with LastOperateBy (who operated).

System timestamps — the real system clock at processing; unconditionally overwritten and not editable by the caller:

FieldWhen set
SystemReceiveTimeSet at collection creation, always overwritten regardless of caller input.
SystemConfirmTimeSet when confirmed.
SystemReverseTimeSet when reversed.

Audit timestamps — inherited from the base domain model (set via @PrePersist / @PreUpdate), not Collection-specific:

FieldDescription
InsertTimeDB row creation time. Set once on first persist.
UpdateTimeDB row last-modified time. Refreshed on every insertOrUpdate, including non-business field changes.
note

How to distinguish the three categories in practice:

  • Use ReceiveTime for business / reporting cut-offs and reconciliation — it can be back-dated.
  • Compare ReceiveTime vs SystemReceiveTime to detect back-dated or forward-dated receipts (any divergence means the business time was supplied rather than auto-filled).
  • Use LastOperateTime + LastOperateBy to see when business activity last touched the receipt (business-level activity) — not UpdateTime.
  • Use InsertTime / UpdateTime for DB-level audit and incremental data sync only; they have no direct business meaning.

All timestamps use DateContext.getLocalDateTimeForCurrentUser() — they are recorded in the current user’s timezone; apply timezone conversion when displaying across regions.

API: collectionApplication, confirmCollection, policyCollectionAndOffset, producerCollect


BcpSuspense — Suspense Record

Temporarily parked funds awaiting allocation or reconciliation.

FieldDescriptionCode Table
SuspenseIdUnique identifier
SuspenseNoBusiness reference number
SuspenseTypeQuotation, Producer, Collection, etc.BcpSuspenseType
SuspenseStatusInactive (0), Active (1)BcpSuspenseStatus
BalanceRemaining unallocated amount
CurrencyCodeCurrency
ReferenceNoRelated document reference

SuspenseDetail sub-records:

RefTypeMeaning
3Collection
4Premium Offset
5Reverse

BcpOffset — Offset / Settlement Record

AR/AP netting engine. Matches AR and AP entries to reduce balances to zero. Does NOT involve Payment.

FieldDescriptionCode Table
OffsetIdUnique identifier
OffsetNoBusiness reference number (prefix: OFS)
OffsetType1=ARAP Offset, 2=Application, 3=Tolerance, 4=Write-offBcpOffsetType
OffsetStatus1=Active, 2=ReversedBcpOffsetStatus
AmountAmount matched/reconciled
OffsetTimeDate/time of reconciliation
StatementNoAssociated statement (if applicable)
ToleranceOffsetReasonReason for small balance write-offsBcpToleranceOffsetReason

OffsetDetail sub-records — links Offset to source records:

RefTypeMeaning
1Links to BcpFee (Commission Offset)
2Links to BcpSuspense
3Links to BcpArap

API: arapOffset, toleranceOffset, reverseOffset


BcpPayment — Payment (Disbursement) Record

Money going out: claim payouts, premium refunds (endorsement/cancellation). Does NOT go through Offset. Directly clears BcpArap balance.

FieldDescriptionCode Table
PaymentIdUnique identifier
PaymentNoBusiness reference number (prefix: PYMT)
PaymentStatus2=Approved, 3=Paid, 5=ReversedBcpPaymentStatus
PaymentType1=Direct Billing, 2=Agent BillingBcpPaymentType
AmountTotal payout amount
PayerPayeeCodeID of the payee (claimant/agent)
PayerPayeeNameName of the payee
ApproveByUser who authorized the paymentUserInfo
ApproveTimeWhen payment was approved
CompleteTimeWhen payment was settled
PaymentMethodMethod of payout (Cheque, Credit Card, etc.)BcpPaymentMethod
ArapIdsList of source BcpArap IDs
BizTransIdParent BizTransaction

PaymentDetail sub-records:

FieldDescription
AmountDetail amount
RefIdReference ID (links to BcpArap)
RefTypeAlways 3 (ARAP) for PaymentDetail

Important: PaymentDetail.RefType is always 3 (ARAP), unlike OffsetDetail which uses both RefType 2 (Suspense) and RefType 3 (ARAP).

PaymentStatus lifecycle:

[Created] Status 2 (Approved) Status 3 (Paid) Status 5 (Reversed)

└──► singlePayment API
sets ArapStatus=2 (Settled)
sets Arap.Balance=0
updates SalesCommission.CommissionStatus=2

API: approvePaymentWithEs, approvePaymentByArapIds, approvePaymentAdvanced, approveStatementPayment, singlePayment, massivePayment, receiptRefund, reversePayment


BcpPrepayOrder — Prepayment Order

Prepayment orders created when IsPrepay="Y" (Cash Before Cover). Not tracked as ARAP or Fee — settled via Balance and OrderStatus fields.


BcpReverse — Reversal Record

Records reversal operations for Collection, Payment, and Offset transactions.

FieldDescriptionCode Table
ReverseIdUnique identifier
RefIdReference to the reversed entity
ReverseType1=Collection, 2=Payment, 3=OffsetBcpReverseType
ReverseReasonReason for reversal
ReverseByUser who performed the reversal
ReverseTimeWhen the reversal occurred

Currency & Exchange Rate

Every BCP financial record (BcpBizTransaction, BcpFee, BcpArap, BcpCollection, BcpPayment, BcpOffset, and their detail lines) carries four currency codes and a set of direct exchange-rate (ER) fields to support cross-currency billing, booking, and collection.

Currency Codes

FieldDescription
CurrencyCodeTransaction currency — the currency actually received or paid. On a Collection this is the collected currency; on an Offset this is the currency used in the current operation
BizCurrencyCodeBusiness currency — the policy/product currency (header-level only: BcpCollection, BcpSuspense)
BookingCurrencyCodeBooking (ledger) currency — derived from branch via CurrencySdkClient.currencySettingApi().getBookingCurrencyCode(branch)
LocalCurrencyCodeLocal (base) currency — derived from branch via CurrencySdkClient.currencySettingApi().getLocalCurrencyCode(branch)

Direct Exchange-Rate Fields

Each Direct*Er field converts from CurrencyCode to a target currency:

FieldConverts CurrencyCodePresent on
DirectErLocalCurrencyCode (local)All financial objects
DirectBookingErBookingCurrencyCode (booking)All financial objects
DirectBusiErBizCurrencyCode (business)BcpCollection header & BcpSuspense only
OffsetDirectErOffsetCurrencyCode (AR/AP original currency)BcpOffset & BcpOffsetDetail only
caution

DirectBusiEr (“Busi”) is a different field from DirectBizEr (“Biz”) — do not conflate them.

Direction Convention

note

Target-currency amount = CurrencyCode amount × Direct*Er

Each rate is expressed as “target-currency units per 1 unit of CurrencyCode. When CurrencyCode equals the target currency, the rate is 1 (no conversion).

Rates are fetched at runtime from the Currency service (CurrencySdkClient.currencyExchangeApi().getExchangeRate(currency=<CurrencyCode>), returning sourceCurrencyCode plus a Map<targetCurrency, rate>). Daily rates are maintained under Global Configuration > Exchange Rate.

Examples

ScenarioCurrencyCodeTarget currencyFieldValue
Same currency (USD books to USD)USDLocal USDDirectEr1
Collect USD, books in CNYUSDLocal CNYDirectEr7.1
Collect CNY, business USDCNYBusiness USDDirectBusiEr≈0.14

Worked example: Amount = 100 USD, DirectEr = 7.1 → local amount = 100 × 7.1 = 710 CNY.

Offset: Additional Currency Dimension

BcpOffset and BcpOffsetDetail carry OffsetCurrencyCode and OffsetDirectEr in addition to the standard currency/ER fields, because the AR/AP being offset may have been recorded in a different currency than the current offset operation.

FieldDescription
OffsetCurrencyCodeOriginal currency of the AR/AP being offset (the currency the receivable/payable was originally recorded in)
CurrencyCodeCurrency used in THIS offset operation
OffsetDirectErExchange rate from CurrencyCode (this operation) to OffsetCurrencyCode (AR/AP original)

Per the direction convention (source = CurrencyCode):

OffsetCurrencyCode (original) amount = CurrencyCode (this operation) amount × OffsetDirectEr

Example: OffsetCurrencyCode = CNY (AR/AP original), CurrencyCode = USD (this offset operation) → OffsetDirectEr = 7.1 (1 USD = 7.1 CNY; a 100 USD operation = 710 CNY in the AR/AP’s original currency).


GL Accounting Entities

GLIntegrationVoucherDetail — GL Voucher Detail

Accounting representation of BCP Fee events. Created from BcpFee via GLIntegrationMappingRule double-entry transformation.

FieldDescription
VoucherDetailIdUnique identifier (PK)
VoucherHeaderKeyLink to Voucher Header
BcpFeeIdSource BCP Fee
BizTransTypeInherited from BizTransaction (COLLECTION, PAYMENT, etc.)
DuePostDateScheduled date for accounting entry
VoucherProcessStatusStatus of posting to GL
GlPostBatchIdID of the batch job for posting (→ GLIntegrationPostBatch)
IsGlProcessFailedY/N flag for integration errors
GlProcessErrorMsgError message from GL system

Dynamic segments (defined in Data Dictionary BCP_GL_INT_DD):

  • Custom fields: GL_Account_Code, Department_ID, BranchCode, etc.
  • Filled by Groovy expressions from GLMappingRule

API: queryGLByConditionEx

Physical Tables:

TableDescription
t_bcp_gl_int_voucher_dtlCurrent voucher records (before GL posting)
t_bcp_gl_int_voucher_dtl_hisArchived voucher records (after queryVoucherDetailsOrderByIdForPostGL completed)

Both tables share the same DD model (GLIntegrationVoucherDetail). The distinction is whether queryVoucherDetailsOrderByIdForPostGL has been called — once called and completed, records are moved to the _his table.


GLIntegrationMappingRule — GL Mapping Rule Configuration

DataTable configuration (dataTableName: GLIntegrationMappingRule) that defines how BcpFee transforms into GL Voucher Details (single-entry BCP Fee → double-entry GL).

Condition Types:

  • FeeType Mapping — Match specific BCP fee type (e.g., 100501 for Direct Premium)
  • FilterExpression — Groovy script for complex logic

FilterExpression Context Objects:

ObjectDSL VariableExample
BCP FeeFee${Fee.BranchCode}
BizTransactiontransaction${transaction.BizSource}
Collectioncollection${collection.AccountType}
Paymentpayment${payment.BankAccountNo}
Offsetoffset
Reversereverse

GLIntegrationPostBatch — GL Post Batch

Groups vouchers for a specific accounting period before transmitting to the external GL system.

FieldDescription
BatchIdUnique identifier
DueDateAccounting period due date
StatusBatch status

Posting Workflow:

  1. createGLPostBatchRecord — Create batch with due date
  2. Transmit to external GL system
  3. completePostBatch — Mark vouchers as “Completed”

Data Flows

Billing Flow

BizTransaction -> BcpFee
|
+-> (EnterBcpArap) -> BcpArap
+-> (SendToGL) -> GLIntegrationVoucherDetail
via GLMappingRule

Collection Flow (Money In)

BcpCollection -> BcpCollectionDetail -> BcpSuspense
|
v
BcpOffset (RefType=2 -> Suspense)
|
v
BcpOffset (RefType=3 -> ARAP)
|
v
BcpArap.Balance = 0

Payment Flow (Money Out) — No Offset Involved

BcpPayment (Status=2, Approved)
|
v singlePayment API
BcpPayment (Status=3, Paid)
|
+-> BcpPaymentDetail (RefType=3) -> BcpArap
| |
| ArapStatus = 2 (Settled)
| Arap.Balance = 0
|
+-> SalesCommission.CommissionStatus = 2

Receipt Refund Flow (Suspense -> Payment)

BcpSuspense (balance > 0)
|
v receiptRefund API
BcpPayment (Status=2)
|
+-> BcpPaymentDetail (RefType=2) -> BcpSuspense
|
Suspense.Balance = 0

GL Accounting Flow

BcpFee + GLIntegrationMappingRule
|
+-> GLIntegrationVoucherDetail (row 1: Debit)
+-> GLIntegrationVoucherDetail (row 2: Credit)
|
v
GLIntegrationPostBatch -> External GL System

RefType Reference

RefType values are context-dependent — the same RefType number means different things in different entities.

EntityRefType=1RefType=2RefType=3RefType=4RefType=5
BcpOffsetDetailFEE (Commission)SuspenseARAP
BcpCollectionDetailSuspense
BcpPaymentDetailSuspense (receipt refund)ARAP (standard payment)
BcpSuspenseDetailCollectionPremium OffsetReverse

Entity ID Signing

Some APIs accept signed entity IDs (numeric,hash format). Use sign.py to generate signed values before calling those APIs.


DB Table Reference

Billing Related:

TableDescription
t_bcp_biz_transactionRoot level. It stores main business transaction information.
t_bcp_prepay_orderisPrepay==“Y”, if prepayment data will be in neither ARAP nor fee.
t_bcp_feefeeList, detailed list of fee split. It can be the preparatory stage for GL generation.
t_bcp_arapfeeList, detailed list of AR and AP for the purpose of BCP transaction.
t_bcp_commissionDeprecated

Transaction Related:

TableDescription
t_bcp_collectionCollection information
t_bcp_collection_detailCollection transaction relationship. Now only suspense relation (2) is supported.
t_bcp_suspenseSuspense account information
t_bcp_suspense_detailSuspense account movement and transaction relationship. Now collection (3), premium offset (4) and reverse (5) are supported.
t_bcp_offsetOffset information between AR and AP
t_bcp_offset_detailOffset transaction relationship. Now suspense (2) and AR (3) are supported.
t_bcp_paymentPayment information
t_bcp_payment_detailPayment transaction relationship. Now suspense (2) and AP (3) are supported.
t_bcp_reverseReversal information
t_bcp_reverse_detailDetailed reversal information

GL Integration Related:

TableDescription
t_bcp_gl_int_voucher_dtlCurrent GL voucher detail records (before GL posting, queryVoucherDetailsOrderByIdForPostGL not yet called)
t_bcp_gl_int_voucher_dtl_hisArchived GL voucher detail records (after GL posting completed)

Feedback
Was this page helpful?
|
Provide feedback