@golemio/pid
Version:
Golemio PID Module
28 lines • 1.3 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PriorityMapper = void 0;
const JISInfotextSeverityLevelEnum_1 = require("../../../../helpers/jis/JISInfotextSeverityLevelEnum");
const InfotextPriorityEnum_1 = require("../../domain/InfotextPriorityEnum");
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 JISInfotextSeverityLevelEnum_1.JISInfotextSeverityLevel.Info:
return InfotextPriorityEnum_1.InfotextPriority.Low;
case JISInfotextSeverityLevelEnum_1.JISInfotextSeverityLevel.Warning:
return InfotextPriorityEnum_1.InfotextPriority.Normal;
case JISInfotextSeverityLevelEnum_1.JISInfotextSeverityLevel.Severe:
return InfotextPriorityEnum_1.InfotextPriority.High;
default:
throw new golemio_errors_1.GeneralError(`Unknown severity level: ${input}`);
}
}
}
exports.PriorityMapper = PriorityMapper;
//# sourceMappingURL=PriorityMapper.js.map