diff --git a/db/changes/231401/00-deviceProduction.sql b/db/changes/231401/00-deviceProduction.sql new file mode 100644 index 000000000..37a2f1371 --- /dev/null +++ b/db/changes/231401/00-deviceProduction.sql @@ -0,0 +1,5 @@ +DROP TRIGGER `vn`.`deviceProduction_afterInsert`; +DROP TRIGGER `vn`.`deviceProduction_afterUpdate`; + +DROP TRIGGER `vn`.`deviceProductionUser_afterDelete`; + diff --git a/modules/worker/back/model-config.json b/modules/worker/back/model-config.json index 145934700..fd34c013b 100644 --- a/modules/worker/back/model-config.json +++ b/modules/worker/back/model-config.json @@ -23,6 +23,9 @@ "DeviceProduction": { "dataSource": "vn" }, + "DeviceProductionLog": { + "dataSource": "vn" + }, "DeviceProductionModels": { "dataSource": "vn" }, diff --git a/modules/worker/back/models/device-production-log.json b/modules/worker/back/models/device-production-log.json new file mode 100644 index 000000000..c935398fc --- /dev/null +++ b/modules/worker/back/models/device-production-log.json @@ -0,0 +1,55 @@ +{ + "name": "DeviceProductionLog", + "base": "VnModel", + "options": { + "mysql": { + "table": "deviceProductionLog" + } + }, + "properties": { + "id": { + "id": true, + "type": "number", + "forceId": false + }, + "originFk": { + "type": "number", + "required": true + }, + "userFk": { + "type": "number" + }, + "deviceProduction": { + "type": "number" + }, + "action": { + "type": "string", + "required": true + }, + "created": { + "type": "date" + }, + "oldInstance": { + "type": "object" + }, + "newInstance": { + "type": "object" + }, + "changedModel": { + "type": "string" + }, + "changedModelId": { + "type": "number" + } + }, + "relations": { + "user": { + "type": "belongsTo", + "model": "Account", + "foreignKey": "userFk" + } + }, + "scope": { + "order": ["created DESC", "id DESC"] + } +} diff --git a/modules/worker/back/models/device-production-user.json b/modules/worker/back/models/device-production-user.json index 568e79413..3eeaae137 100644 --- a/modules/worker/back/models/device-production-user.json +++ b/modules/worker/back/models/device-production-user.json @@ -1,6 +1,10 @@ { "name": "DeviceProductionUser", - "base": "VnModel", + "base": "Loggable", + "log": { + "model": "DeviceProductionLog", + "relation": "deviceProduction" + }, "options": { "mysql": { "table": "deviceProductionUser" diff --git a/modules/worker/back/models/device-production.json b/modules/worker/back/models/device-production.json index 63672500b..35787cccc 100644 --- a/modules/worker/back/models/device-production.json +++ b/modules/worker/back/models/device-production.json @@ -1,6 +1,9 @@ { "name": "DeviceProduction", - "base": "VnModel", + "base": "Loggable", + "log": { + "model": "DeviceProductionLog" + }, "options": { "mysql": { "table": "deviceProduction" diff --git a/modules/worker/front/pda/index.html b/modules/worker/front/pda/index.html index 2f1626ba8..be67dd903 100644 --- a/modules/worker/front/pda/index.html +++ b/modules/worker/front/pda/index.html @@ -31,11 +31,12 @@ value-field="id" show-field="serialNumber"> - ID: {{id}} - - {{'Model' | translate}}: {{modelFk}} - - {{'Serial Number' | translate}}: {{serialNumber}} +
+ ID: {{id}} +
+
+ {{modelFk}}, {{serialNumber}} +