Additional Codes

Business rules for Additional Codes.

class additional_codes.business_rules.ACN1(transaction=None)[source]

The combination of additional code type, additional code ID and start date must be unique.

exception Violation(model: common.models.trackedmodel.TrackedModel, message: Optional[str] = None)

The combination of additional code type, additional code ID and start date must be unique.

class additional_codes.business_rules.ACN13(transaction=None)[source]

When an additional code is used in an additional code nomenclature measure then the validity period of the additional code must span the validity period of the measure.

exception Violation(model: common.models.trackedmodel.TrackedModel, message: Optional[str] = None)

When an additional code is used in an additional code nomenclature measure then the validity period of the additional code must span the validity period of the measure.

class additional_codes.business_rules.ACN14(transaction=None)[source]

An additional code cannot be deleted if it is used in an additional code nomenclature measure.

exception Violation(model: common.models.trackedmodel.TrackedModel, message: Optional[str] = None)

An additional code cannot be deleted if it is used in an additional code nomenclature measure.

class additional_codes.business_rules.ACN17(transaction=None)[source]

The validity period of the additional code type must span the validity period of the additional code.

exception Violation(model: common.models.trackedmodel.TrackedModel, message: Optional[str] = None)

The validity period of the additional code type must span the validity period of the additional code.

class additional_codes.business_rules.ACN2(transaction=None)[source]

The referenced additional code type must exist and have as application code “non-Meursing” or “Export Refund for Processed Agricultural Goods.

exception Violation(model: common.models.trackedmodel.TrackedModel, message: Optional[str] = None)

The referenced additional code type must exist and have as application code “non-Meursing” or “Export Refund for Processed Agricultural Goods.

validate(additional_code)[source]

Perform business rule validation.

Raises

NotImplementedError – Must be overridden by subclasses

class additional_codes.business_rules.ACN4(transaction=None)[source]

The validity period of the additional code must not overlap any other additional code with the same additional code type, additional code ID and start date.

exception Violation(model: common.models.trackedmodel.TrackedModel, message: Optional[str] = None)

The validity period of the additional code must not overlap any other additional code with the same additional code type, additional code ID and start date.

class additional_codes.business_rules.ACN5(transaction=None)[source]

At least one description is mandatory.

The start date of the first description period must be equal to the start date of the additional code. No two associated description periods may have the same start date. The start date must be less than or equal to the end date of the additional code.

exception Violation(model: common.models.trackedmodel.TrackedModel, message: Optional[str] = None)

At least one description is mandatory.

The start date of the first description period must be equal to the start date of the additional code. No two associated description periods may have the same start date. The start date must be less than or equal to the end date of the additional code.

class additional_codes.business_rules.CT1(transaction=None)[source]

The additional code type must be unique.

exception Violation(model: common.models.trackedmodel.TrackedModel, message: Optional[str] = None)

The additional code type must be unique.