"""Schema validation for run controller.""" from abacus_common_logic.marshalling.custom_fields import ma from royalties.constants.constants import CONTRACT_TYPES class BaseRunControllerSchema(ma.Schema): """Run controller POST body.""" run_controller_name = ma.NonemptyString(required=True) contract_type = ma.Enum( options=CONTRACT_TYPES, data_key='contract_type', required=True ) class RunControllerDetailSchema(BaseRunControllerSchema): """Run controller GET response.""" run_controller_id = ma.IntegerId() class RunControllerListEntrySchema(RunControllerDetailSchema): """Run controller list entry.""" contract_count = ma.Integer()