def create_claim_type(name): from pyclaim.domain.aggregates.claim_type.model.claim_type import ClaimType try: if not ClaimType.name_exists(name): claim_type = ClaimType() claim_type.name = name ClaimType.create(claim_type) return claim_type except Exception as ex: pass
def validate(self, name): is_name_exist = ClaimType.name_exists(name) if is_name_exist: super().custom.manual(ClaimTypeErrorCodes.CLAIM_TYPE_NAME_EXIST)