more schema, more tests
This commit is contained in:
parent
003c7cd185
commit
00b7940c25
1 changed files with 48 additions and 2 deletions
|
|
@ -44,6 +44,8 @@ models:
|
||||||
across both is that credit note amounts get their sign reversed (* -1) so
|
across both is that credit note amounts get their sign reversed (* -1) so
|
||||||
that aggregations happen naturally (credit amounts subtract from invoice
|
that aggregations happen naturally (credit amounts subtract from invoice
|
||||||
amounts). The final granularity of the table is on the line item level.
|
amounts). The final granularity of the table is on the line item level.
|
||||||
|
Invoice and credit note records can be told apart through the
|
||||||
|
document_class field.
|
||||||
|
|
||||||
The word _document_ in the context of this table encompasses both invoices
|
The word _document_ in the context of this table encompasses both invoices
|
||||||
and credit notes.
|
and credit notes.
|
||||||
|
|
@ -53,6 +55,9 @@ models:
|
||||||
document level data. Aggregating line fields can be done without worries.
|
document level data. Aggregating line fields can be done without worries.
|
||||||
Document level data can't be summed or averaged since it's duplicated per
|
Document level data can't be summed or averaged since it's duplicated per
|
||||||
line item, so be careful with it.
|
line item, so be careful with it.
|
||||||
|
|
||||||
|
Fields are not documented here: you can find more details in upstream
|
||||||
|
models.
|
||||||
|
|
||||||
columns:
|
columns:
|
||||||
- name: id_line_item
|
- name: id_line_item
|
||||||
|
|
@ -68,7 +73,14 @@ models:
|
||||||
|
|
||||||
- name: document_class
|
- name: document_class
|
||||||
data_type: text
|
data_type: text
|
||||||
description: ""
|
description: |
|
||||||
|
Indicates whether the record belongs in an invoice or a credit note.
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- accepted_values:
|
||||||
|
values:
|
||||||
|
- 'invoice'
|
||||||
|
- 'credit note'
|
||||||
|
|
||||||
- name: item_code
|
- name: item_code
|
||||||
data_type: text
|
data_type: text
|
||||||
|
|
@ -110,9 +122,14 @@ models:
|
||||||
data_type: text
|
data_type: text
|
||||||
description: ""
|
description: ""
|
||||||
|
|
||||||
- name: invoice_currency_iso_4217
|
- name: document_currency_iso_4217
|
||||||
data_type: character varying
|
data_type: character varying
|
||||||
description: ""
|
description: ""
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- length_between:
|
||||||
|
min_length: 3
|
||||||
|
max_length: 3
|
||||||
|
|
||||||
- name: line_description
|
- name: line_description
|
||||||
data_type: text
|
data_type: text
|
||||||
|
|
@ -121,6 +138,8 @@ models:
|
||||||
- name: id_document
|
- name: id_document
|
||||||
data_type: character varying
|
data_type: character varying
|
||||||
description: ""
|
description: ""
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
|
||||||
- name: reference
|
- name: reference
|
||||||
data_type: character varying
|
data_type: character varying
|
||||||
|
|
@ -141,6 +160,14 @@ models:
|
||||||
- name: document_type
|
- name: document_type
|
||||||
data_type: character varying
|
data_type: character varying
|
||||||
description: ""
|
description: ""
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- accepted_values:
|
||||||
|
values:
|
||||||
|
- "ACCREC"
|
||||||
|
- "ACCPAY"
|
||||||
|
- "ACCRECCREDIT"
|
||||||
|
- "ACCPAYCREDIT"
|
||||||
|
|
||||||
- name: document_currency_iso_4217
|
- name: document_currency_iso_4217
|
||||||
data_type: character varying
|
data_type: character varying
|
||||||
|
|
@ -149,14 +176,33 @@ models:
|
||||||
- name: exchange_rate_to_gbp
|
- name: exchange_rate_to_gbp
|
||||||
data_type: numeric
|
data_type: numeric
|
||||||
description: ""
|
description: ""
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- not_negative
|
||||||
|
|
||||||
- name: document_status
|
- name: document_status
|
||||||
data_type: character varying
|
data_type: character varying
|
||||||
description: ""
|
description: ""
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- accepted_values:
|
||||||
|
values:
|
||||||
|
- PAID
|
||||||
|
- VOIDED
|
||||||
|
- DRAFT
|
||||||
|
- DELETED
|
||||||
|
- AUTHORISED
|
||||||
|
- SUBMITTED
|
||||||
|
|
||||||
- name: line_amount_tax_inclusiveness
|
- name: line_amount_tax_inclusiveness
|
||||||
data_type: character varying
|
data_type: character varying
|
||||||
description: ""
|
description: ""
|
||||||
|
tests:
|
||||||
|
- accepted_values:
|
||||||
|
values:
|
||||||
|
- Inclusive
|
||||||
|
- Exclusive
|
||||||
|
- NoTax
|
||||||
|
|
||||||
- name: header_total_amount_local_curr
|
- name: header_total_amount_local_curr
|
||||||
data_type: numeric
|
data_type: numeric
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue