UNPKG

@golemio/pid

Version:
28 lines 1.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PriorityMapper = void 0; const InfotextPriorityEnum_1 = require("../../domain/InfotextPriorityEnum"); const InfotextSeverityLevelEnum_1 = require("../../../shared/constants/jis/InfotextSeverityLevelEnum"); const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors"); class PriorityMapper { /** * Map input severity level from DB to output priority for API * * @param input Severity level type from DB * @returns Priority for API */ static mapInputToOutputPriority(input) { switch (input) { case InfotextSeverityLevelEnum_1.InfotextSeverityLevel.Info: return InfotextPriorityEnum_1.InfotextPriority.Low; case InfotextSeverityLevelEnum_1.InfotextSeverityLevel.Warning: return InfotextPriorityEnum_1.InfotextPriority.Normal; case InfotextSeverityLevelEnum_1.InfotextSeverityLevel.Severe: return InfotextPriorityEnum_1.InfotextPriority.High; default: throw new golemio_errors_1.GeneralError(`Unknown severity level: ${input}`); } } } exports.PriorityMapper = PriorityMapper; //# sourceMappingURL=PriorityMapper.js.map