Antes de la última revisión de etapa 4. Sprint 1. Previo al ajuste de look n feel de app, reportes, nombre y colores.
This commit is contained in:
@@ -18,6 +18,29 @@ export class ProcessCostDb extends Dexie {
|
||||
resources: 'id, processId, name',
|
||||
simulations: 'id, processId, executedAt',
|
||||
})
|
||||
|
||||
// Sprint 1: agrega campos de automatización a Activity y volumetría a Process.
|
||||
// El upgrade popula datos existentes con defaults para garantizar invariante de tipo.
|
||||
this.version(2)
|
||||
.stores({
|
||||
processes: 'id, name, updatedAt',
|
||||
activities: 'id, processId, bpmnElementId',
|
||||
gateways: 'id, processId, bpmnElementId',
|
||||
resources: 'id, processId, name',
|
||||
simulations: 'id, processId, executedAt',
|
||||
})
|
||||
.upgrade(async (tx) => {
|
||||
await tx.table('activities').toCollection().modify((act) => {
|
||||
if (act.automatable === undefined) act.automatable = false
|
||||
if (act.automatedCostFixed === undefined) act.automatedCostFixed = 0
|
||||
if (act.automatedTimeMinutes === undefined) act.automatedTimeMinutes = 0
|
||||
})
|
||||
await tx.table('processes').toCollection().modify((proc) => {
|
||||
if (proc.annualFrequency === undefined) proc.annualFrequency = 1000
|
||||
if (proc.analysisHorizonYears === undefined) proc.analysisHorizonYears = 3
|
||||
if (proc.automationInvestment === undefined) proc.automationInvestment = 0
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user