import { TranslatedPropertyRules } from './translated-property-rules';
export function validateEnumerationType(entity, isUniqueCodeRequired) {
    if (isUniqueCodeRequired === void 0) { isUniqueCodeRequired = false; }
    var rules = TranslatedPropertyRules.anyRequired('denomination')
        .withMessage('common:validation.enumType.denomination')
        .ensure('default').satisfies(function (value, enumType) {
        return value == false || enumType.active;
    }).withMessage('common:validation.enumType.default');
    if (isUniqueCodeRequired) {
        rules.ensure('uniqueCode').required();
    }
    rules.on(entity);
}
var enumerationTypeViewTemplate = function (type) {
    return 'digiwall-lib/vm/enumeration-types/enumeration-type-' + type + '-view-model-base.html';
};
export var EnumerationTypeRessourceName = "EnumerationType";
export var EnumerationTypeColorRessourceName = "EnumerationTypeColor";
export var enumerationTypeListViewTemplate = function () {
    return enumerationTypeViewTemplate('list');
};
export var enumerationTypeDetailViewTemplate = function () {
    return enumerationTypeViewTemplate('detail');
};

//# sourceMappingURL=enumeration-types-helper.js.map
