boy scout: tests for invoices

This commit is contained in:
Pablo Martin 2024-06-20 15:00:59 +02:00
parent 34b678df26
commit 7aa667f7cf

View file

@ -137,7 +137,7 @@ models:
data_type: character varying
description: |
The default currency used to interact with this contact.
For customers, this is the currency we will usually use to invoice.
- name: validation_errors
@ -189,15 +189,18 @@ models:
description: ""
- name: stg_xero__invoices
description: |
Invoices that we have raised within our accounting books.
Invoices that we have raised within our accounting books.
This includes both our invoices towards customers and invoices provided by our suppliers.
This includes both our invoices towards customers and invoices provided by our suppliers.
You can read more here: https://developer.xero.com/documentation/api/accounting/invoices
You can read more here: https://developer.xero.com/documentation/api/accounting/invoices
columns:
- name: id_invoice
data_type: character varying
description: Xero's unique identifier for the invoice.
tests:
- not_null
- unique
- name: invoice_url
data_type: character varying
@ -212,42 +215,70 @@ models:
description: |
This field indicates whether the invoice is from Superhog towards a customer
(value is "ACCREC") or from a supplier towards Superhog (value is "ACCPAY").
tests:
- not_null
- accepted_values:
values:
- "ACCREC"
- "ACCPAY"
- name: total_amount_local_curr
data_type: numeric
description: The total amount to be paid, in the currency the invoice is denominated in.
tests:
- not_null
- name: total_amount_wo_tax_local_curr
data_type: numeric
description: The total amount to be paid minus taxes, in the currency the invoice is denominated in.
tests:
- not_null
- name: total_tax_local_curr
data_type: numeric
description: The total tax, in the currency the invoice is denominated in.
tests:
- not_null
- name: total_due_local_curr
data_type: numeric
description: The total amount outstanding right now, in the currency the invoice is denominated in.
tests:
- not_null
- name: total_paid_local_curr
data_type: numeric
description: The total amount that has already been paid, in the currency the invoice is denominated in.
tests:
- not_null
- name: invoice_status
data_type: character varying
description: |
description: |
The status of the invoice.
Can be one of: PAID, VOIDED, DRAFT, DELETED, AUTHORISED, SUBMITTED.
You can read more here: https://developer.xero.com/documentation/api/accounting/types#invoices
tests:
- not_null
- accepted_values:
values:
- PAID
- VOIDED
- DRAFT
- DELETED
- AUTHORISED
- SUBMITTED
- name: contact
- name: full_contact_details
data_type: jsonb
description: |
The contact related to this invoice.
The customer if it's an Accounts Receivables one, the supplier if it's an Accounts Payables one.
tests:
- not_null
- name: invoice_due_date_utc
data_type: timestamp with time zone
@ -265,12 +296,14 @@ models:
- name: line_items
data_type: jsonb
description: An array with all the line items and their details.
tests:
- not_null
- name: reference
data_type: character varying
description: |
The Superhog-set reference for the invoices. Only relevant for
records of invoice type (ACCREC).
records of invoice type (ACCREC).
- name: date_string
data_type: timestamp with time zone
@ -290,9 +323,9 @@ models:
- name: exchange_rate_to_gbp
data_type: numeric
description: |
description: |
The implied exchange rate between the invoice currency and GBP.
This is the XXX to GBP rate. So the number represented in this field is the units of currency GBP
that 1 unit of XXX buys you.
@ -325,8 +358,8 @@ models:
- name: total_credited_local_curr
data_type: numeric
description:
Total amount credited by related credit notes, over-payments and
description:
Total amount credited by related credit notes, over-payments and
pre-payments.
- name: has_attachments
@ -368,4 +401,4 @@ models:
- name: dwh_extracted_at_utc
data_type: timestamp with time zone
description: ""
description: ""