From 649b7f0e21f876a5588c08d0c98cacfd62feb8af Mon Sep 17 00:00:00 2001 From: Gerard Date: Mon, 25 Mar 2019 09:36:24 +0100 Subject: [PATCH] log added to ticket module models --- .../ticket/back/models/ticket-request.json | 7 ++- .../ticket/back/models/ticket-service.json | 12 ++++- .../ticket/back/models/ticket-tracking.json | 51 ++++++++++--------- modules/ticket/back/models/ticket-weekly.json | 7 ++- 4 files changed, 51 insertions(+), 26 deletions(-) diff --git a/modules/ticket/back/models/ticket-request.json b/modules/ticket/back/models/ticket-request.json index 2ec916d69..32d3163e2 100644 --- a/modules/ticket/back/models/ticket-request.json +++ b/modules/ticket/back/models/ticket-request.json @@ -1,6 +1,11 @@ { "name": "TicketRequest", - "base": "VnModel", + "base": "Loggable", + "log": { + "model": "TicketLog", + "relation": "ticket", + "changedModelValue": "description" + }, "options": { "mysql": { "table": "ticketRequest" diff --git a/modules/ticket/back/models/ticket-service.json b/modules/ticket/back/models/ticket-service.json index 2007d931c..e14ff68ec 100644 --- a/modules/ticket/back/models/ticket-service.json +++ b/modules/ticket/back/models/ticket-service.json @@ -1,6 +1,11 @@ { "name": "TicketService", - "base": "VnModel", + "base": "Loggable", + "log": { + "model": "TicketLog", + "relation": "ticket", + "changedModelValue": "description" + }, "options": { "mysql": { "table": "ticketService" @@ -38,6 +43,11 @@ "type": "belongsTo", "model": "TaxClass", "foreignKey": "taxClassFk" + }, + "ticket": { + "type": "belongsTo", + "model": "Ticket", + "foreignKey": "ticketFk" } } } \ No newline at end of file diff --git a/modules/ticket/back/models/ticket-tracking.json b/modules/ticket/back/models/ticket-tracking.json index b1f2769d4..3512643d1 100644 --- a/modules/ticket/back/models/ticket-tracking.json +++ b/modules/ticket/back/models/ticket-tracking.json @@ -1,38 +1,43 @@ { "name": "TicketTracking", - "base": "VnModel", + "base": "Loggable", + "log": { + "model": "TicketLog", + "relation": "ticket", + "changedModelValue": "stateFk" + }, "options": { "mysql": { - "table": "ticketTracking" + "table": "ticketTracking" } }, "properties": { "id": { - "id": true, - "type": "Number", - "forceId": false + "id": true, + "type": "Number", + "forceId": false }, "created": { - "type": "Date", - "required": false + "type": "Date", + "required": false } }, "relations": { - "ticket": { - "type": "belongsTo", - "model": "Ticket", - "foreignKey": "ticketFk" - }, - "state": { - "type": "belongsTo", - "model": "State", - "foreignKey": "stateFk" - }, - "worker": { - "type": "belongsTo", - "model": "Worker", - "foreignKey": "workerFk" - } + "ticket": { + "type": "belongsTo", + "model": "Ticket", + "foreignKey": "ticketFk" + }, + "state": { + "type": "belongsTo", + "model": "State", + "foreignKey": "stateFk" + }, + "worker": { + "type": "belongsTo", + "model": "Worker", + "foreignKey": "workerFk" + } } - } +} \ No newline at end of file diff --git a/modules/ticket/back/models/ticket-weekly.json b/modules/ticket/back/models/ticket-weekly.json index daec2c21a..7c107659a 100644 --- a/modules/ticket/back/models/ticket-weekly.json +++ b/modules/ticket/back/models/ticket-weekly.json @@ -1,6 +1,11 @@ { "name": "TicketWeekly", - "base": "VnModel", + "base": "Loggable", + "log": { + "model": "TicketLog", + "relation": "ticket", + "changedModelValue": "ticketFk" + }, "options": { "mysql": { "table": "ticketWeekly"