UNPKG

hravemzdy.procezor

Version:

payroll-procezor Salary, Health, Social, Taxing Properties for years 2010-2022

90 lines 5.2 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.TermResultError = void 0; var ContractCode_1 = require("../service_types/ContractCode"); var PositionCode_1 = require("../service_types/PositionCode"); var ArticleCode_1 = require("../service_types/ArticleCode"); var ConceptCode_1 = require("../service_types/ConceptCode"); var VariantCode_1 = require("../service_types/VariantCode"); var TermResultError = /** @class */ (function (_super) { __extends(TermResultError, _super); function TermResultError(period, target, errorText) { var _this = this; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; _this = _super.call(this, "ResultError for ".concat(errorText)) || this; _this.target = target; _this.period = period; _this.contract = (_b = (_a = _this.target) === null || _a === void 0 ? void 0 : _a.contract) !== null && _b !== void 0 ? _b : ContractCode_1.ContractCode.new(); _this.position = (_d = (_c = _this.target) === null || _c === void 0 ? void 0 : _c.position) !== null && _d !== void 0 ? _d : PositionCode_1.PositionCode.new(); _this.article = (_f = (_e = _this.target) === null || _e === void 0 ? void 0 : _e.article) !== null && _f !== void 0 ? _f : ArticleCode_1.ArticleCode.new(); _this.concept = (_h = (_g = _this.target) === null || _g === void 0 ? void 0 : _g.concept) !== null && _h !== void 0 ? _h : ConceptCode_1.ConceptCode.new(); _this.variant = (_k = (_j = _this.target) === null || _j === void 0 ? void 0 : _j.variant) !== null && _k !== void 0 ? _k : VariantCode_1.VariantCode.new(); return _this; } TermResultError.prototype.articleDescr = function () { if (this.target == null) { return "ArticleCode for ".concat(this.article.value); } return this.target.articleDescr(); }; TermResultError.prototype.conceptDescr = function () { if (this.target == null) { return "ConceptCode for ".concat(this.concept.value); } return this.target.conceptDescr(); }; TermResultError.CreateEvalResultError = function (period, target) { return new TermResultError(period, target, "evaluation failed"); }; TermResultError.CreateExtractResultError = function (period, target) { return new TermResultError(period, target, "extract result failed"); }; TermResultError.CreateNoImplementationError = function (period, target) { return new TermResultError(period, target, "failed with no-implementation"); }; TermResultError.CreateNoResultFuncError = function (period, target) { return new TermResultError(period, target, "failed with no-result function"); }; TermResultError.CreateInvalidResultError = function (period, target, typeDescr) { return new TermResultError(period, target, "invalid result type ".concat(typeDescr, " error!")); }; TermResultError.CreateInvalidRulesetError = function (period, target, typeDescr) { return new TermResultError(period, target, "invalid ".concat(typeDescr, " Ruleset error!")); }; TermResultError.CreateInvalidTargetError = function (period, target, typeDescr) { return new TermResultError(period, target, "invalid target type ".concat(typeDescr, " error!")); }; TermResultError.CreateNoResultFoundError = function (period, target, articleDescr, contract, position) { return new TermResultError(period, target, "result for ".concat(articleDescr).concat(TermResultError.messageContractPosition(contract, position), " Not Found")); }; TermResultError.CreateNullResultFoundError = function (period, target, articleDescr, contract, position) { return new TermResultError(period, target, "result found for ".concat(articleDescr).concat(TermResultError.messageContractPosition(contract, position), " but Instance is Null!")); }; TermResultError.messageContractPosition = function (contract, position) { if (contract !== undefined && position !== undefined) { return ", contract=".concat(contract.value, ", position=").concat(position.value); } else if (contract !== undefined) { return ", contract=".concat(contract.value); } return ""; }; return TermResultError; }(Error)); exports.TermResultError = TermResultError; //# sourceMappingURL=TermResultError.js.map