Data model

"accounts"."ACCOUNT" {
  shape: sql_table
    link: "../../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 
}
"cards"."CARD" {
  shape: sql_table
    link: "../../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 
}
"rules"."EXPENSE_LIMIT_RULE" {
  shape: sql_table
    link: "../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: "../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"."id" -> "cards"."CARD"."account_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