@asumano/worklip-typeorm-db 1.1.82 → 1.1.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/views/Sections.d.ts
CHANGED
package/dist/views/Sections.js
CHANGED
|
@@ -85,6 +85,10 @@ __decorate([
|
|
|
85
85
|
(0, typeorm_1.ViewColumn)(),
|
|
86
86
|
__metadata("design:type", Number)
|
|
87
87
|
], Sections.prototype, "templates_count", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.ViewColumn)(),
|
|
90
|
+
__metadata("design:type", Array)
|
|
91
|
+
], Sections.prototype, "associates", void 0);
|
|
88
92
|
exports.Sections = Sections = __decorate([
|
|
89
93
|
(0, typeorm_1.ViewEntity)({
|
|
90
94
|
name: "sections",
|
|
@@ -88,6 +88,11 @@ export declare const FINAL_STAGE_ORDER_OFFSET = 1000;
|
|
|
88
88
|
export declare const finalStageOrder: (statusOrder: number) => number;
|
|
89
89
|
/** DOC: ¿Esta etapa es una de las finales (Finalizado, Por entregar, Entregado)? */
|
|
90
90
|
export declare const isFinalStageOrder: (stageOrder: number) => boolean;
|
|
91
|
+
export interface ISectionDetails {
|
|
92
|
+
workboard_stage?: boolean;
|
|
93
|
+
}
|
|
94
|
+
export declare const isWorkboardStage: (details: ISectionDetails | null | undefined) => boolean;
|
|
95
|
+
export declare const withWorkboardStage: (details: ISectionDetails | null | undefined, isStage: boolean) => ISectionDetails | null;
|
|
91
96
|
/**
|
|
92
97
|
* DOC: Lo mínimo que hace falta saber de una etapa para decidir si se puede mover. Se recibe
|
|
93
98
|
* así, y no la entidad completa, para que el front pueda llamar a esto con lo que ya tiene
|
package/dist/workboard.rules.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// Desde el barrel arrastra TypeORM, dotenv y `crypto` al navegador y rompe el build de
|
|
13
13
|
// producción. El typecheck NO lo detecta: solo `pnpm build`.
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.nextStageAfter = exports.canMoveStage = exports.isFinalStageOrder = exports.finalStageOrder = exports.FINAL_STAGE_ORDER_OFFSET = exports.WORKBOARD_SOURCE = exports.WORKBOARD_EVENT_TYPE = exports.VISIBLE_STAGE_STATES = exports.STAGE_STATE = exports.SEEDED_WORKBOARD_KINDS = exports.WORKBOARD_STATUS_KIND = void 0;
|
|
15
|
+
exports.nextStageAfter = exports.canMoveStage = exports.withWorkboardStage = exports.isWorkboardStage = exports.isFinalStageOrder = exports.finalStageOrder = exports.FINAL_STAGE_ORDER_OFFSET = exports.WORKBOARD_SOURCE = exports.WORKBOARD_EVENT_TYPE = exports.VISIBLE_STAGE_STATES = exports.STAGE_STATE = exports.SEEDED_WORKBOARD_KINDS = exports.WORKBOARD_STATUS_KIND = void 0;
|
|
16
16
|
/**
|
|
17
17
|
* DOC: La semántica de sistema de una columna del tablero (`workboard_status.kind`).
|
|
18
18
|
*
|
|
@@ -115,6 +115,23 @@ exports.finalStageOrder = finalStageOrder;
|
|
|
115
115
|
/** DOC: ¿Esta etapa es una de las finales (Finalizado, Por entregar, Entregado)? */
|
|
116
116
|
const isFinalStageOrder = (stageOrder) => stageOrder >= exports.FINAL_STAGE_ORDER_OFFSET;
|
|
117
117
|
exports.isFinalStageOrder = isFinalStageOrder;
|
|
118
|
+
// DOC: ¿Esta sección es una etapa del tablero? AUSENTE significa SÍ, y por eso esta función
|
|
119
|
+
// existe: si un lado tomara el ausente como "no", las secciones que ya existen desaparecerían
|
|
120
|
+
// del tablero sin que nadie hubiera destildado nada.
|
|
121
|
+
const isWorkboardStage = (details) => details?.workboard_stage !== false;
|
|
122
|
+
exports.isWorkboardStage = isWorkboardStage;
|
|
123
|
+
// DOC: Espejo de `withTemplateCost`: deja `details` listo para guardar sin pisar lo demás, y
|
|
124
|
+
// devuelve `null` si queda vacío para no dejar `{}` en la base.
|
|
125
|
+
const withWorkboardStage = (details, isStage) => {
|
|
126
|
+
const next = { ...(details ?? {}) };
|
|
127
|
+
// DOC: El `true` no se guarda: es el valor por defecto y escribirlo solo agranda el JSON.
|
|
128
|
+
if (isStage)
|
|
129
|
+
delete next.workboard_stage;
|
|
130
|
+
else
|
|
131
|
+
next.workboard_stage = false;
|
|
132
|
+
return Object.keys(next).length > 0 ? next : null;
|
|
133
|
+
};
|
|
134
|
+
exports.withWorkboardStage = withWorkboardStage;
|
|
118
135
|
/**
|
|
119
136
|
* DOC: LA REGLA DEL SAPITO. ¿Se puede mover el trabajo de `from` a `to`?
|
|
120
137
|
*
|