Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| staging_id | bigserial | 19 | √ | nextval('staging.stg_declaration_monthly_staging_id_seq'::regclass) |
|
|
|||||
| declaration_year | int4 | 10 | √ | null |
|
|
|||||
| declaration_month | int4 | 10 | √ | null |
|
|
|||||
| taxpayer_nif | varchar | 255 | √ | null |
|
|
|||||
| taxpayer_name | varchar | 255 | √ | null |
|
|
|||||
| declared_revenue | numeric | 38,2 | √ | null |
|
|
|||||
| vat_collected | numeric | 38,2 | √ | null |
|
|
|||||
| vat_import_deducted | numeric | 38,2 | √ | null |
|
|
|||||
| net_vat | numeric | 38,2 | √ | null |
|
|
|||||
| declaration_status | varchar | 255 | √ | null |
|
|
|||||
| submission_date | date | 13 | √ | null |
|
|
|||||
| source_id | int8 | 19 | √ | null |
|
|
|||||
| import_batch_id | uuid | 2147483647 | null |
|
|
||||||
| source_system | varchar | 255 | √ | null |
|
|
|||||
| source_table | varchar | 255 | √ | null |
|
|
|||||
| row_hash | varchar | 255 | √ | null |
|
|
|||||
| quality_score | numeric | 38,2 | √ | null |
|
|
|||||
| validation_status | varchar | 255 | √ | 'PENDING'::character varying |
|
|
|||||
| error_message | varchar | 255 | √ | null |
|
|
|||||
| created_at | timestamp | 29,6 | √ | CURRENT_TIMESTAMP |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| stg_declaration_monthly_pkey | Primary key | Asc | staging_id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| chk_declaration_month | (((declaration_month IS NULL) OR ((declaration_month >= 1) AND (declaration_month <= 12)))) |