"""Schema validation for account_payment_term.""" from abacus_common_logic.marshalling.custom_fields import ma from abacus_account.constants import constants class BaseAccountPaymentTermSchema(ma.Schema): """Shared account_payment_term fields.""" account_id = ma.Integer(required=True) currency_code = ma.NonemptyString(required=True) payment_entity_id = ma.IntegerId(allow_none=True) payment_minimum = ma.Decimal(as_string=True, allow_none=True) payment_schedule = ma.Enum(options=constants.PAYMENT_SCHEDULE, allow_none=True) agreement_type_id = ma.IntegerId() class AccountPaymentTermDetailSchema(BaseAccountPaymentTermSchema): """account_payment_term POST body.""" account_payment_term_id = ma.Integer(required=True) class AccountPaymentTermPostSchema(BaseAccountPaymentTermSchema): """account_payment_term POST body.""" pass class AccountPaymentTermPutSchema(BaseAccountPaymentTermSchema): """account_payment_term PUT body.""" currency_code = ma.NonemptyString()