Data model

"accounts"."ACCOUNT_HOLDER" {
  shape: sql_table
    link: "../../subcomponents/accounts/internals/models/#components.payment_gateway.subcomponents.accounts.models.account_holder.AccountHolder"

"id": UUID {constraint: primary_key}
  "description": TEXT 
  "external_id": VARCHAR(255) 
  "provider": VARCHAR(255) 
  "reference": TEXT 
  "terminated_at": DATETIME 
}
"accounts"."ACCOUNT" {
  shape: sql_table
    link: "../../subcomponents/accounts/internals/models/#components.payment_gateway.subcomponents.accounts.models.account.Account"

"id": UUID {constraint: primary_key}
  "account_holder_id": UUID 
  "description": TEXT 
  "external_id": VARCHAR(255) 
  "provider": VARCHAR(255) 
  "reference": TEXT 
  "terminated_at": DATETIME 
}
"accounts"."ACCOUNT_STATUS_LOG" {
  shape: sql_table
    link: "../../subcomponents/accounts/internals/models/#components.payment_gateway.subcomponents.accounts.models.account.AccountStatusLog"

"id": UUID {constraint: primary_key}
  "account_id": UUID 
  "status": VARCHAR(255) 
}
"cards"."CARD_HOLDER" {
  shape: sql_table
    link: "../../subcomponents/cards/internals/models/#components.payment_gateway.subcomponents.cards.models.card_holder.CardHolder"

"id": UUID {constraint: primary_key}
  "display_name": TEXT 
  "external_id": VARCHAR(255) 
  "first_name": TEXT 
  "last_name": TEXT 
  "provider": VARCHAR(255) 
  "short_name": VARCHAR(18) 
  "terminated_at": DATETIME 
}
"cards"."CARD" {
  shape: sql_table
    link: "../../subcomponents/cards/internals/models/#components.payment_gateway.subcomponents.cards.models.card.Card"

"id": UUID {constraint: primary_key}
  "account_id": UUID 
  "card_holder_id": UUID 
  "description": TEXT 
  "display_name": TEXT 
  "expiration_date": DATE 
  "external_id": VARCHAR(255) 
  "is_virtual": BOOLEAN 
  "issuance_reason": TEXT 
  "issued_at": DATETIME 
  "last_four_digits": VARCHAR(4) 
  "provider": VARCHAR(255) 
  "reference": TEXT 
  "terminated_at": DATETIME 
}
"cards"."CARD_STATUS_LOG" {
  shape: sql_table
    link: "../../subcomponents/cards/internals/models/#components.payment_gateway.subcomponents.cards.models.card.CardStatusLog"

"id": UUID {constraint: primary_key}
  "card_id": UUID 
  "reason": TEXT 
  "status": VARCHAR(255) 
  "suspension_source": VARCHAR(255) 
}
"WEBHOOK_LOG" {
  shape: sql_table
    link: "../internals/models/#components.payment_gateway.internal.models.webhook_log.WebhookLog"

"id": UUID {constraint: primary_key}
  "payload": JSONB 
  "source": VARCHAR(255) 
  "status": VARCHAR(255) 
}
"transfers"."TRANSFER_EVENT" {
  shape: sql_table
    link: "../../subcomponents/transfers/internals/models/#components.payment_gateway.subcomponents.transfers.models.transfer_event.TransferEvent"

"id": UUID {constraint: primary_key}
  "balance": INTEGER 
  "effective_date": DATETIME 
  "external_id": VARCHAR(255) 
  "provider": VARCHAR(255) 
  "raw": JSONB 
  "received": INTEGER 
  "reserved": INTEGER 
  "status": VARCHAR 
}
"transfers"."TRANSFER_HISTORY" {
  shape: sql_table
    link: "../../subcomponents/transfers/internals/models/#components.payment_gateway.subcomponents.transfers.models.transfer_history.TransferHistory"

"id": UUID {constraint: primary_key}
  "private_ref": VARCHAR(255) 
  "private_type": VARCHAR(255) 
}
"transfers"."TRANSFER_UPDATE" {
  shape: sql_table
    link: "../../subcomponents/transfers/internals/models/#components.payment_gateway.subcomponents.transfers.models.transfer_update.TransferUpdate"

"id": UUID {constraint: primary_key}
  "amount": INTEGER 
  "currency": VARCHAR(3) 
  "direction": VARCHAR(255) 
  "external_transaction_id": VARCHAR(255) 
  "external_transfer_id": VARCHAR(255) 
  "occurred_at": DATETIME 
  "provider": VARCHAR(255) 
  "raw": JSONB 
  "sequence_number": INTEGER 
  "status": VARCHAR 
  "transfer_id": UUID 
  "transfer_type": VARCHAR(255) 
}
"transfers"."ACCOUNT_TRANSFER_TRANSFER_EVENT_ASSOCIATION" {
  shape: sql_table
    link: "../../subcomponents/transfers/internals/models/#components.payment_gateway.subcomponents.transfers.models.account_transfer.AccountTransferTransferEventAssociation"

"id": UUID {constraint: primary_key}
  "account_transfer_id": UUID 
  "sequence": INTEGER 
  "transfer_event_id": UUID 
}
"transfers"."ACCOUNT_TRANSFER" {
  shape: sql_table
    link: "../../subcomponents/transfers/internals/models/#components.payment_gateway.subcomponents.transfers.models.account_transfer.AccountTransfer"

"id": UUID {constraint: primary_key}
  "account_id": UUID 
  "direction": VARCHAR(255) 
  "effective_date": DATETIME 
  "external_id": VARCHAR(255) 
  "provider": VARCHAR(255) 
  "raw": JSONB 
  "reference": VARCHAR(255) 
  "transfer_history_id": UUID 
}
"accounts"."SEPA_BENEFICIARY" {
  shape: sql_table
    link: "../../subcomponents/accounts/internals/models/#components.payment_gateway.subcomponents.accounts.models.sepa_beneficiary.SepaBeneficiary"

"id": UUID {constraint: primary_key}
  "account_id": UUID 
  "external_id": VARCHAR(255) 
  "iban": VARCHAR(34) 
  "issued_at": DATETIME 
  "name": VARCHAR(255) 
  "provider": VARCHAR(255) 
}
"accounts"."SEPA_BENEFICIARY_STATUS_LOG" {
  shape: sql_table
    link: "../../subcomponents/accounts/internals/models/#components.payment_gateway.subcomponents.accounts.models.sepa_beneficiary.SepaBeneficiaryStatusLog"

"id": UUID {constraint: primary_key}
  "sepa_beneficiary_id": UUID 
  "status": VARCHAR(255) 
}
"banking_documents"."SEPA_MANDATE" {
  shape: sql_table
    link: "../../subcomponents/banking_documents/internals/models/#components.payment_gateway.subcomponents.banking_documents.models.sepa_mandate.SepaMandate"

"id": UUID {constraint: primary_key}
  "account_holder_id": UUID 
  "debtor_country": VARCHAR(3) 
  "debtor_iban": VARCHAR(34) 
  "debtor_name": VARCHAR(255) 
  "external_id": VARCHAR(255) 
  "issued_at": DATETIME 
  "provider": VARCHAR(255) 
  "sepa_creditor_identifier": VARCHAR(255) 
  "unique_mandate_reference": VARCHAR(255) 
}
"banking_documents"."SEPA_MANDATE_STATUS_LOG" {
  shape: sql_table
    link: "../../subcomponents/banking_documents/internals/models/#components.payment_gateway.subcomponents.banking_documents.models.sepa_mandate.SepaMandateStatusLog"

"id": UUID {constraint: primary_key}
  "sepa_mandate_id": UUID 
  "status": VARCHAR(255) 
}
"transfers"."BANK_TRANSFER_TRANSFER_EVENT_ASSOCIATION" {
  shape: sql_table
    link: "../../subcomponents/transfers/internals/models/#components.payment_gateway.subcomponents.transfers.models.bank_transfer.BankTransferTransferEventAssociation"

"id": UUID {constraint: primary_key}
  "bank_transfer_id": UUID 
  "sequence": INTEGER 
  "transfer_event_id": UUID 
}
"transfers"."BANK_TRANSFER" {
  shape: sql_table
    link: "../../subcomponents/transfers/internals/models/#components.payment_gateway.subcomponents.transfers.models.bank_transfer.BankTransfer"

"id": UUID {constraint: primary_key}
  "account_id": UUID 
  "direction": VARCHAR(255) 
  "effective_date": DATETIME 
  "external_id": VARCHAR(255) 
  "provider": VARCHAR(255) 
  "raw": JSONB 
  "sepa_beneficiary_id": UUID 
  "sepa_mandate_id": UUID 
  "transfer_history_id": UUID 
}
"transfers"."CARD_PAYMENT_TRANSFER_EVENT_ASSOCIATION" {
  shape: sql_table
    link: "../../subcomponents/transfers/internals/models/#components.payment_gateway.subcomponents.transfers.models.card_transfer.CardTransferTransferEventAssociation"

"id": UUID {constraint: primary_key}
  "card_payment_id": UUID 
  "sequence": INTEGER 
  "transfer_event_id": UUID 
}
"transfers"."CARD_PAYMENT" {
  shape: sql_table
    link: "../../subcomponents/transfers/internals/models/#components.payment_gateway.subcomponents.transfers.models.card_transfer.CardTransfer"

"id": UUID {constraint: primary_key}
  "account_id": UUID 
  "card_id": UUID 
  "city": VARCHAR(255) 
  "country": VARCHAR(255) 
  "effective_date": DATETIME 
  "external_id": VARCHAR(255) 
  "mcc": VARCHAR(10) 
  "merchant_id": VARCHAR(255) 
  "name": VARCHAR(255) 
  "postal_code": VARCHAR(255) 
  "provider": VARCHAR(255) 
  "raw": JSONB 
  "transfer_history_id": UUID 
}
"transfers"."INTERNAL_TRANSFER" {
  shape: sql_table
    link: "../../subcomponents/transfers/internals/models/#components.payment_gateway.subcomponents.transfers.models.internal_transfer.InternalTransfer"

"id": UUID {constraint: primary_key}
  "amount": INTEGER 
  "description": TEXT 
  "effective_date": DATETIME 
  "reference": VARCHAR 
  "transfer_history_id": UUID 
}
"cards"."CARD_ORDER" {
  shape: sql_table
    link: "../../subcomponents/cards/internals/models/#components.payment_gateway.subcomponents.cards.models.card_order.CardOrder"

"id": UUID {constraint: primary_key}
  "card_id": UUID 
  "delivery_status": VARCHAR(255) 
  "shipping_method": VARCHAR(255) 
  "tracking_number": VARCHAR(255) 
}
"cards"."CARD_PROVISIONING" {
  shape: sql_table
    link: "../../subcomponents/cards/internals/models/#components.payment_gateway.subcomponents.cards.models.card_provisioning.CardProvisioning"

"id": UUID {constraint: primary_key}
  "card_id": UUID 
  "external_id": VARCHAR(255) 
  "provider": VARCHAR(255) 
  "provisioning_date": DATETIME 
  "provisioning_type": VARCHAR(255) 
  "wallet_provider": VARCHAR 
}
"authorizations"."AUTHORIZATION_REQUEST" {
  shape: sql_table
    link: "../../subcomponents/authorizations/internals/models/#components.payment_gateway.subcomponents.authorizations.models.authorization_request.AuthorizationRequest"

"id": UUID {constraint: primary_key}
  "authorization_metadata": JSONB 
  "external_id": VARCHAR(255) 
  "provider": VARCHAR(255) 
  "status": VARCHAR(255) 
}
"authorizations"."EXPENSE_CATEGORY" {
  shape: sql_table
    link: "../../subcomponents/authorizations/internals/models/#components.payment_gateway.subcomponents.authorizations.models.expense_category.ExpenseCategory"

"id": UUID {constraint: primary_key}
  "code": VARCHAR(64) 
  "description": TEXT 
  "name": VARCHAR(255) 
  "reference": TEXT 
  "terminated_at": DATETIME 
}
"authorizations"."EXPENSE_TRACKER" {
  shape: sql_table
    link: "../../subcomponents/authorizations/internals/models/#components.payment_gateway.subcomponents.authorizations.models.expense_tracker.ExpenseTracker"

"id": UUID {constraint: primary_key}
  "credits_limit": INTEGER 
  "expensed_credits": INTEGER 
  "line_of_credit_id": UUID 
}
"authorizations"."LINE_OF_CREDIT" {
  shape: sql_table
    link: "../../subcomponents/authorizations/internals/models/#components.payment_gateway.subcomponents.authorizations.models.line_of_credit.LineOfCredit"

"id": UUID {constraint: primary_key}
  "expense_category_id": UUID 
  "owner_ref": UUID 
  "owner_type": VARCHAR(64) 
  "terminated_at": DATETIME 
}
"ledgers"."LEDGER" {
  shape: sql_table
    link: "../../subcomponents/ledgers/internals/models/#components.payment_gateway.subcomponents.ledgers.models.ledger.Ledger"

"id": UUID {constraint: primary_key}
  "description": TEXT 
  "reference": TEXT 
  "terminated_at": DATETIME 
}
"ledgers"."LEDGER_ENTRY" {
  shape: sql_table
    link: "../../subcomponents/ledgers/internals/models/#components.payment_gateway.subcomponents.ledgers.models.ledger_entry.LedgerEntry"

"id": UUID {constraint: primary_key}
  "amount": INTEGER 
  "description": TEXT 
  "ending_balance": INTEGER 
  "entry_metadata": JSONB 
  "external_transaction_id": VARCHAR(255) 
  "ledger_id": UUID 
  "occurred_at": DATETIME 
  "opening_balance": INTEGER 
  "reference": TEXT 
}
"merchants"."MERCHANT_INFO" {
  shape: sql_table
    link: "../../subcomponents/merchants/internals/models/#components.payment_gateway.subcomponents.merchants.models.merchant_info.MerchantInfo"

"id": UUID {constraint: primary_key}
  "acquirer_id": VARCHAR(30) 
  "city": VARCHAR 
  "country": VARCHAR 
  "mcc": VARCHAR(4) 
  "merchant_id": VARCHAR(30) 
  "name": VARCHAR 
  "postal_code": VARCHAR 
}
"rules"."EXPENSE_LIMIT_RULE" {
  shape: sql_table
    link: "../../subcomponents/rules/internals/models/#components.payment_gateway.subcomponents.rules.models.expense_limit_rule.ExpenseLimitRule"

"id": UUID {constraint: primary_key}
  "amount": INTEGER 
  "card_id": UUID 
  "criteria": JSONB 
  "currency": VARCHAR(255) 
  "description": TEXT 
  "end": DATETIME 
  "external_id": VARCHAR(255) 
  "first_day": INTEGER 
  "is_active": BOOLEAN 
  "period": VARCHAR(255) 
  "reference": TEXT 
  "start": DATETIME 
  "terminated_at": DATETIME 
}
"rules"."USAGE_RESTRICTION_RULE" {
  shape: sql_table
    link: "../../subcomponents/rules/internals/models/#components.payment_gateway.subcomponents.rules.models.usage_restriction_rule.UsageRestrictionRule"

"id": UUID {constraint: primary_key}
  "account_id": UUID 
  "criteria": JSONB 
  "description": TEXT 
  "end": DATETIME 
  "external_id": VARCHAR(255) 
  "is_active": BOOLEAN 
  "reference": TEXT 
  "start": DATETIME 
  "terminated_at": DATETIME 
}
"accounts"."ACCOUNT_HOLDER"."id" -> "accounts"."ACCOUNT"."account_holder_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"accounts"."ACCOUNT"."id" -> "accounts"."ACCOUNT_STATUS_LOG"."account_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
"cards"."CARD_HOLDER"."id" -> "cards"."CARD"."card_holder_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"accounts"."ACCOUNT"."id" -> "cards"."CARD"."account_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"cards"."CARD"."id" -> "cards"."CARD_STATUS_LOG"."card_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
"transfers"."ACCOUNT_TRANSFER"."id" -> "transfers"."ACCOUNT_TRANSFER_TRANSFER_EVENT_ASSOCIATION"."account_transfer_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
"transfers"."TRANSFER_EVENT"."id" -> "transfers"."ACCOUNT_TRANSFER_TRANSFER_EVENT_ASSOCIATION"."transfer_event_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-one-required
}
"transfers"."TRANSFER_HISTORY"."id" -> "transfers"."ACCOUNT_TRANSFER"."transfer_history_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
"accounts"."ACCOUNT"."id" -> "transfers"."ACCOUNT_TRANSFER"."account_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"accounts"."ACCOUNT"."id" -> "accounts"."SEPA_BENEFICIARY"."account_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"accounts"."SEPA_BENEFICIARY"."id" -> "accounts"."SEPA_BENEFICIARY_STATUS_LOG"."sepa_beneficiary_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
"accounts"."ACCOUNT_HOLDER"."id" -> "banking_documents"."SEPA_MANDATE"."account_holder_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"banking_documents"."SEPA_MANDATE"."id" -> "banking_documents"."SEPA_MANDATE_STATUS_LOG"."sepa_mandate_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
"transfers"."TRANSFER_EVENT"."id" -> "transfers"."BANK_TRANSFER_TRANSFER_EVENT_ASSOCIATION"."transfer_event_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-one-required
}
"transfers"."BANK_TRANSFER"."id" -> "transfers"."BANK_TRANSFER_TRANSFER_EVENT_ASSOCIATION"."bank_transfer_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
"accounts"."ACCOUNT"."id" -> "transfers"."BANK_TRANSFER"."account_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"banking_documents"."SEPA_MANDATE"."id" -> "transfers"."BANK_TRANSFER"."sepa_mandate_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"transfers"."TRANSFER_HISTORY"."id" -> "transfers"."BANK_TRANSFER"."transfer_history_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
"accounts"."SEPA_BENEFICIARY"."id" -> "transfers"."BANK_TRANSFER"."sepa_beneficiary_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"transfers"."TRANSFER_EVENT"."id" -> "transfers"."CARD_PAYMENT_TRANSFER_EVENT_ASSOCIATION"."transfer_event_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-one-required
}
"transfers"."CARD_PAYMENT"."id" -> "transfers"."CARD_PAYMENT_TRANSFER_EVENT_ASSOCIATION"."card_payment_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
"cards"."CARD"."id" -> "transfers"."CARD_PAYMENT"."card_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"transfers"."TRANSFER_HISTORY"."id" -> "transfers"."CARD_PAYMENT"."transfer_history_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
"accounts"."ACCOUNT"."id" -> "transfers"."CARD_PAYMENT"."account_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"transfers"."TRANSFER_HISTORY"."id" -> "transfers"."INTERNAL_TRANSFER"."transfer_history_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
"cards"."CARD"."id" -> "cards"."CARD_ORDER"."card_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
"cards"."CARD"."id" -> "cards"."CARD_PROVISIONING"."card_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"authorizations"."LINE_OF_CREDIT"."id" -> "authorizations"."EXPENSE_TRACKER"."line_of_credit_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-one-required
}
"authorizations"."EXPENSE_CATEGORY"."id" -> "authorizations"."LINE_OF_CREDIT"."expense_category_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
"ledgers"."LEDGER"."id" -> "ledgers"."LEDGER_ENTRY"."ledger_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"cards"."CARD"."id" -> "rules"."EXPENSE_LIMIT_RULE"."card_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"accounts"."ACCOUNT"."id" -> "rules"."USAGE_RESTRICTION_RULE"."account_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
Hold "Alt" / "Option" to enable pan & zoom