"""Schemas for Ledger Accounting Run VAT serialization.""" from abacus_common_logic.marshalling.custom_fields import ma class LedgerAccountingRunVatDetailSchema(ma.Schema): """Ledger Accounting Run VAT GET schema.""" ledger_accounting_run_vat_id = ma.NonNegativeInteger() account_name = ma.NonemptyString() account_id = ma.NonNegativeInteger() accounting_run_id = ma.NonNegativeInteger() abacus_event_id = ma.NonNegativeInteger() contract_id = ma.NonNegativeInteger() contract_name = ma.NonemptyString() currency_code = ma.NonemptyString() country_of_tax_residence = ma.NonemptyString() gross_revenue = ma.Decimal(as_string=True) net_revenue = ma.Decimal(as_string=True) distribution_fee = ma.Decimal(as_string=True) gross_vat_rate = ma.Decimal(as_string=True) distribution_vat_rate = ma.Decimal(as_string=True) gross_vat = ma.Decimal(as_string=True) distribution_vat = ma.Decimal(as_string=True) adjusted_net_revenue = ma.Decimal(as_string=True) exempt_reason = ma.String(allow_none=True) class LedgerAccountingRunVatOverviewSchema(ma.Schema): """GET schema describing count of contracts for each VAT category and country.""" vat_category = ma.String(required=True) country_of_tax_residence = ma.String(required=True, allow_none=True) contract_count = ma.NonNegativeInteger(required=True) class LedgerAccountingRunVatSchema(LedgerAccountingRunVatDetailSchema): """Ledger Accounting Run VAT GET schema.""" accounting_period_id = ma.NonNegativeInteger()