- ✅ Ticket 1.1: Estructura Clean Architecture en backend - ✅ Ticket 1.2: Schemas Zod compartidos - ✅ Ticket 1.3: Refactorización drugs.ts (1362 → 8 archivos modulares) - ✅ Ticket 1.4: Refactorización procedures.ts (3583 → 6 archivos modulares) - ✅ Ticket 1.5: Eliminación de duplicidades (~50 líneas) Cambios principales: - Creada estructura Clean Architecture en backend/src/ - Schemas Zod compartidos en backend/src/shared/schemas/ - Refactorización modular de drugs y procedures - Utilidades genéricas en src/utils/ (filter, validation) - Eliminados scripts obsoletos y documentación antigua - Corregidos errores: QueryClient, import test-error-handling - Build verificado y funcionando correctamente
60 lines
1.2 KiB
JavaScript
60 lines
1.2 KiB
JavaScript
"use strict";
|
|
exports.ValueSetter =
|
|
exports.Setter =
|
|
exports.DateToSystemTimezoneSetter =
|
|
void 0;
|
|
var _index = require("../../transpose.js");
|
|
var _index2 = require("../../constructFrom.js");
|
|
|
|
const TIMEZONE_UNIT_PRIORITY = 10;
|
|
|
|
class Setter {
|
|
subPriority = 0;
|
|
|
|
validate(_utcDate, _options) {
|
|
return true;
|
|
}
|
|
}
|
|
exports.Setter = Setter;
|
|
|
|
class ValueSetter extends Setter {
|
|
constructor(
|
|
value,
|
|
|
|
validateValue,
|
|
|
|
setValue,
|
|
|
|
priority,
|
|
subPriority,
|
|
) {
|
|
super();
|
|
this.value = value;
|
|
this.validateValue = validateValue;
|
|
this.setValue = setValue;
|
|
this.priority = priority;
|
|
if (subPriority) {
|
|
this.subPriority = subPriority;
|
|
}
|
|
}
|
|
|
|
validate(date, options) {
|
|
return this.validateValue(date, this.value, options);
|
|
}
|
|
|
|
set(date, flags, options) {
|
|
return this.setValue(date, flags, this.value, options);
|
|
}
|
|
}
|
|
exports.ValueSetter = ValueSetter;
|
|
|
|
class DateToSystemTimezoneSetter extends Setter {
|
|
priority = TIMEZONE_UNIT_PRIORITY;
|
|
subPriority = -1;
|
|
set(date, flags) {
|
|
if (flags.timestampIsSet) return date;
|
|
return (0, _index2.constructFrom)(date, (0, _index.transpose)(date, Date));
|
|
}
|
|
}
|
|
exports.DateToSystemTimezoneSetter = DateToSystemTimezoneSetter;
|