Data model

"billing"."INSTALLMENT" {
  shape: sql_table
    link: "../internals/models/#components.es.subcomponents.billing.internal.models.es_installment.EsInstallment"

"id": UUID {constraint: primary_key}
  "amount": INTEGER 
  "installment_plan_id": UUID 
}
"billing"."PAYMENT" {
  shape: sql_table
    link: "../internals/models/#components.es.subcomponents.billing.internal.models.es_payment.EsPayment"

"id": UUID {constraint: primary_key}
  "amount": INTEGER 
  "bank_transfer_reference": VARCHAR(255) 
  "contract_ref": VARCHAR(64) 
  "contract_type": VARCHAR(32) 
  "dispute_reason": VARCHAR(255) 
  "disputed_payment_id": UUID 
  "failure_reason": VARCHAR(255) 
  "iban_id": UUID 
  "installment_id": UUID 
  "invoice_id": UUID 
  "off_session": BOOLEAN 
  "payment_date": DATE 
  "refunded_payment_id": UUID 
  "status": VARCHAR(255) 
  "stripe_charge_id": VARCHAR(255) 
  "stripe_dispute_id": VARCHAR(255) 
  "stripe_payment_intent_id": VARCHAR(255) 
  "stripe_refund_id": VARCHAR(255) 
  "type": VARCHAR(255) 
}
"payroll"."PREMIUM_ENTRY" {
  shape: sql_table
    link: "[components.es.subcomponents.payroll.internal.models.es_premium_entry.EsPremiumEntry][]"

"id": UUID {constraint: primary_key}
  "base_price": INTEGER 
  "cancelled_premium_entry_id": UUID 
  "days_in_month": INTEGER 
  "enrollment_id": UUID 
  "enrollment_option_id": UUID 
  "finiquito_id": UUID 
  "invoice_id": UUID 
  "month": DATE 
  "pay_csv_id": UUID 
  "premium": INTEGER 
  "version": INTEGER 
}
"billing"."INVOICE" {
  shape: sql_table
    link: "../internals/models/#components.es.subcomponents.billing.internal.models.es_invoice.EsInvoice"

"id": UUID {constraint: primary_key}
  "amount_to_charge": INTEGER 
  "amount_to_refund": INTEGER 
  "appendix_uri": VARCHAR(2083) 
  "billing_reason": VARCHAR(32) 
  "contract_ref": VARCHAR(64) 
  "contract_type": VARCHAR(32) 
  "due_date": DATE 
  "email_sent_at": DATETIME 
  "event_date": DATE 
  "invoice_number": VARCHAR(255) 
  "issued_date": DATE 
  "month_amount": INTEGER 
  "payment_pending": BOOLEAN 
  "payment_skipped": BOOLEAN 
  "previous_balance": INTEGER 
  "refund_pending": BOOLEAN 
  "regularization_amount": INTEGER 
  "remaining_balance": INTEGER 
  "settlement_status": VARCHAR(31) 
  "uri": VARCHAR(2083) 
}
"IBAN" {
  shape: sql_table
    link: "[components.es.internal.models.es_iban.EsIBAN][]"

"id": UUID {constraint: primary_key}
  "company_id": UUID 
  "country_iso": VARCHAR(2) 
  "end_date": DATE 
  "healthy_benefits_sepa_unique_id": VARCHAR(35) 
  "iban": VARCHAR(34) 
  "name": VARCHAR(255) 
  "sepa_unique_id": VARCHAR(35) 
  "start_date": DATE 
  "stripe_healthy_benefits_payment_method_id": VARCHAR(255) 
  "stripe_payment_method_id": VARCHAR(255) 
  "stripe_sepa_debit_source_id": VARCHAR(255) 
  "suspended_by_stripe_on": DATE 
  "swift": VARCHAR(11) 
  "type": VARCHAR(255) 
  "user_id": UUID 
}
"billing"."BILLING_TASK_EXECUTION" {
  shape: sql_table
    link: "../internals/models/#components.es.subcomponents.billing.internal.models.es_billing_task_execution.EsBillingTaskExecution"

"id": UUID {constraint: primary_key}
  "category": VARCHAR 
  "country_prefix": VARCHAR 
  "end_time": DATETIME 
  "enqueued_jobs_count": INTEGER 
  "failure_message": VARCHAR 
  "scheduler_run_datetime": DATETIME 
  "start_time": DATETIME 
  "status": VARCHAR 
  "type": VARCHAR 
}
"billing"."BILLING_TASK_EXECUTION_RQ_JOB" {
  shape: sql_table
    link: "../internals/models/#components.es.subcomponents.billing.internal.models.es_billing_task_execution_rq_job.EsBillingTaskExecutionRqJob"

"id": UUID {constraint: primary_key}
  "billing_task_execution_id": UUID 
  "rq_job_id": VARCHAR 
}
"billing"."INSTALLMENT_PLAN" {
  shape: sql_table
    link: "../internals/models/#components.es.subcomponents.billing.internal.models.es_installment_plan.EsInstallmentPlan"

"id": UUID {constraint: primary_key}
  "contract_ref": VARCHAR(64) 
  "contract_type": VARCHAR(32) 
}
"billing"."INSTALLMENT_PLAN"."id" -> "billing"."INSTALLMENT"."installment_plan_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
"IBAN"."id" -> "billing"."PAYMENT"."iban_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"billing"."INSTALLMENT"."id" -> "billing"."PAYMENT"."installment_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"billing"."PAYMENT"."id" -> "billing"."PAYMENT"."refunded_payment_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"billing"."PAYMENT"."id" -> "billing"."PAYMENT"."disputed_payment_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-one-required
}
"billing"."INVOICE"."id" -> "billing"."PAYMENT"."invoice_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"billing"."INVOICE"."id" -> "payroll"."PREMIUM_ENTRY"."invoice_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-many
}
"payroll"."PREMIUM_ENTRY"."id" -> "payroll"."PREMIUM_ENTRY"."cancelled_premium_entry_id": {
  source-arrowhead.shape: cf-one
  target-arrowhead.shape: cf-one-required
}
"billing"."BILLING_TASK_EXECUTION"."id" -> "billing"."BILLING_TASK_EXECUTION_RQ_JOB"."billing_task_execution_id": {
  source-arrowhead.shape: cf-one-required
  target-arrowhead.shape: cf-many
}
Hold "Alt" / "Option" to enable pan & zoom