From dee1510bb6bbb0c687bfe293bd67ceb3ec3d8064 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 25 Apr 2024 07:33:46 +0200 Subject: [PATCH] feat(mylogger): refs #6533 #6533 export logs.local.yml into each model.json --- back/models/vn-role.json | 28 +- back/models/vn-user.json | 28 + modules/claim/back/models/claim.json | 14 +- modules/client/back/models/client.json | 539 ++++++++++-------- modules/entry/back/models/entry.json | 22 +- modules/invoiceIn/back/models/invoice-in.json | 12 +- modules/item/back/models/item.json | 41 +- modules/route/back/models/route.json | 26 +- modules/shelving/back/models/parking.json | 9 +- modules/shelving/back/models/shelving.json | 6 +- modules/supplier/back/models/supplier.json | 137 +++-- modules/ticket/back/models/ticket.json | 59 +- modules/travel/back/models/travel.json | 19 +- .../worker/back/models/device-production.json | 20 +- modules/worker/back/models/worker.json | 78 ++- modules/zone/back/models/zone.json | 125 ++-- 16 files changed, 732 insertions(+), 431 deletions(-) diff --git a/back/models/vn-role.json b/back/models/vn-role.json index c7d7e172b..97bab481f 100644 --- a/back/models/vn-role.json +++ b/back/models/vn-role.json @@ -1,12 +1,30 @@ { "name": "VnRole", "base": "Role", - "validateUpsert": true, + "validateUpsert": true, "options": { - "mysql": { - "table": "account.role" - } - }, + "mysql": { + "table": "account.role" + } + }, + "log": { + "schema": "account", + "logTable": "roleLog", + "mainTable": "role", + "tables": [ + { + "name": "role", + "exclude": [ + "modified" + ] + }, + { + "name": "roleInherit", + "relation": "role", + "showRelation": "inheritsFrom" + } + ] + }, "mixins": { "Loggable": true } diff --git a/back/models/vn-user.json b/back/models/vn-user.json index 5f6ac3f47..2ef7af98b 100644 --- a/back/models/vn-user.json +++ b/back/models/vn-user.json @@ -10,6 +10,34 @@ "mixins": { "Loggable": true }, + "log": { + "schema": "account", + "logTable": "userLog", + "mainTable": "user", + "tables": [ + { + "name": "user", + "modelName": "VnUser", + "exclude": [ + "bcryptPassword", + "password", + "verificationToken" + ] + }, + { + "name": "account", + "relation": "id" + }, + { + "name": "mailAliasAccount", + "relation": "account" + }, + { + "name": "mailForward", + "relation": "account" + } + ] + }, "resetPasswordTokenTTL": "604800", "properties": { "id": { diff --git a/modules/claim/back/models/claim.json b/modules/claim/back/models/claim.json index e6fa8d392..a1304fe87 100644 --- a/modules/claim/back/models/claim.json +++ b/modules/claim/back/models/claim.json @@ -5,8 +5,18 @@ "Loggable": true }, "log": { - "model":"ClaimLog", - "showField": "id" + "logTable": "claimLog", + "mainTable": "claim", + "tables": [ + { + "name": "claimDms", + "idName": "dmsFk" + }, + "claimDevelopment", + "claimBeginning", + "claimEnd", + "claimObservation" + ] }, "options": { "mysql": { diff --git a/modules/client/back/models/client.json b/modules/client/back/models/client.json index 68e404806..94f63dc61 100644 --- a/modules/client/back/models/client.json +++ b/modules/client/back/models/client.json @@ -1,271 +1,304 @@ { - "name": "Client", - "base": "VnModel", + "name": "Client", + "base": "VnModel", "mixins": { "Loggable": true }, - "options": { - "mysql": { - "table": "client" - } - }, + "options": { + "mysql": { + "table": "client" + } + }, "log": { - "model":"ClientLog", - "showField": "id" - }, - "properties": { - "id": { - "type": "number", - "id": true, - "description": "Identifier" - }, - "name": { - "type": "string", - "required": true - }, - "fi": { - "type": "string", - "description": "Fiscal indentifier" - }, - "socialName": { - "type": "string", - "required": true - }, - "contact": { - "type": "string" - }, - "street": { - "type": "string", - "required": true - }, - "city": { - "type": "string", - "required": true - }, - "postcode": { - "type": "string" - }, - "email": { - "type": "string" - }, - "phone": { - "type": "string" - }, - "mobile": { - "type": "string" - }, - "isActive": { - "type": "boolean" - }, - "credit": { - "type": "number" - }, - "creditInsurance": { - "type": "number" - }, - "iban": { - "type": "string" - }, - "dueDay": { - "type": "number" - }, - "isEqualizated": { - "type": "boolean", - "description": "The client has equalization tax" - }, - "isFreezed": { - "type": "boolean", - "description": "The client frozen" - }, - "hasToInvoiceByAddress": { - "type": "boolean", - "description": "The client has to be invoiced by address" - }, - "hasToInvoice": { - "type": "boolean", - "description": "Global invoicing enabled for the client" - }, - "isToBeMailed": { - "type": "boolean", - "description": "Send invoices by email" - }, - "hasSepaVnl": { - "type": "boolean" - }, - "hasLcr": { - "type": "boolean" - }, - "hasCoreVnl": { - "type": "boolean" - }, - "hasCoreVnh": { - "type": "boolean" - }, - "hasIncoterms": { - "type": "boolean" - }, - "isTaxDataChecked":{ - "type": "boolean" - }, - "eypbc": { - "type": "boolean" - }, - "quality": { - "type": "number" - }, - "isVies": { - "type": "boolean" - }, - "isRelevant": { - "type": "boolean" - }, - "accountingAccount": { - "type": "string" - }, - "created": { - "type": "date" - }, - "sageTaxTypeFk": { - "type": "number", - "mysql": { - "columnName": "taxTypeSageFk" - } - }, - "sageTransactionTypeFk": { - "type": "number", - "mysql": { - "columnName": "transactionTypeSageFk" - } - }, - "businessTypeFk": { - "type": "string", - "mysql": { - "columnName": "businessTypeFk" - } - }, - "salesPersonFk": { - "type": "number" - }, - "hasElectronicInvoice": { - "type": "boolean" - }, - "rating": { - "type": "number" - }, - "recommendedCredit": { - "type": "number" - } - - }, - "relations": { - "account": { - "type": "belongsTo", - "model": "VnUser", - "foreignKey": "id" - }, - "user": { - "type": "belongsTo", - "model": "VnUser", - "foreignKey": "id" - }, - "payMethod": { - "type": "belongsTo", - "model": "PayMethod", - "foreignKey": "payMethodFk" - }, - "salesPersonUser": { - "type": "belongsTo", - "model": "VnUser", - "foreignKey": "salesPersonFk" - }, - "province": { - "type": "belongsTo", - "model": "Province", - "foreignKey": "provinceFk" - }, - "country": { - "type": "belongsTo", - "model": "Country", - "foreignKey": "countryFk" - }, + "logTable": "clientLog", + "mainTable": "client", + "tables": [ + "address", + { + "name": "client", + "types": { + "payMethodFk": "integer" + }, + "exclude": [ + "defaultAddressFk" + ] + }, + { + "name": "clientContact", + "relation": "clientFk" + }, + "clientDms", + "clientObservation", + { + "name": "clientSample", + "relation": "clientFk" + }, + { + "name": "greuge", + "relation": "clientFk" + }, + { + "name": "recovery", + "relation": "clientFk" + }, + { + "name": "clientUnpaid", + "relation": "clientFk" + } + ] + }, + "properties": { + "id": { + "type": "number", + "id": true, + "description": "Identifier" + }, + "name": { + "type": "string", + "required": true + }, + "fi": { + "type": "string", + "description": "Fiscal indentifier" + }, + "socialName": { + "type": "string", + "required": true + }, + "contact": { + "type": "string" + }, + "street": { + "type": "string", + "required": true + }, + "city": { + "type": "string", + "required": true + }, + "postcode": { + "type": "string" + }, + "email": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "credit": { + "type": "number" + }, + "creditInsurance": { + "type": "number" + }, + "iban": { + "type": "string" + }, + "dueDay": { + "type": "number" + }, + "isEqualizated": { + "type": "boolean", + "description": "The client has equalization tax" + }, + "isFreezed": { + "type": "boolean", + "description": "The client frozen" + }, + "hasToInvoiceByAddress": { + "type": "boolean", + "description": "The client has to be invoiced by address" + }, + "hasToInvoice": { + "type": "boolean", + "description": "Global invoicing enabled for the client" + }, + "isToBeMailed": { + "type": "boolean", + "description": "Send invoices by email" + }, + "hasSepaVnl": { + "type": "boolean" + }, + "hasLcr": { + "type": "boolean" + }, + "hasCoreVnl": { + "type": "boolean" + }, + "hasCoreVnh": { + "type": "boolean" + }, + "hasIncoterms": { + "type": "boolean" + }, + "isTaxDataChecked": { + "type": "boolean" + }, + "eypbc": { + "type": "boolean" + }, + "quality": { + "type": "number" + }, + "isVies": { + "type": "boolean" + }, + "isRelevant": { + "type": "boolean" + }, + "accountingAccount": { + "type": "string" + }, + "created": { + "type": "date" + }, + "sageTaxTypeFk": { + "type": "number", + "mysql": { + "columnName": "taxTypeSageFk" + } + }, + "sageTransactionTypeFk": { + "type": "number", + "mysql": { + "columnName": "transactionTypeSageFk" + } + }, + "businessTypeFk": { + "type": "string", + "mysql": { + "columnName": "businessTypeFk" + } + }, + "salesPersonFk": { + "type": "number" + }, + "hasElectronicInvoice": { + "type": "boolean" + }, + "rating": { + "type": "number" + }, + "recommendedCredit": { + "type": "number" + } + }, + "relations": { + "account": { + "type": "belongsTo", + "model": "VnUser", + "foreignKey": "id" + }, + "user": { + "type": "belongsTo", + "model": "VnUser", + "foreignKey": "id" + }, + "payMethod": { + "type": "belongsTo", + "model": "PayMethod", + "foreignKey": "payMethodFk" + }, + "salesPersonUser": { + "type": "belongsTo", + "model": "VnUser", + "foreignKey": "salesPersonFk" + }, + "province": { + "type": "belongsTo", + "model": "Province", + "foreignKey": "provinceFk" + }, + "country": { + "type": "belongsTo", + "model": "Country", + "foreignKey": "countryFk" + }, "isSocialNameUnique": { "type": "belongsTo", "model": "Country", "foreignKey": "countryFk" }, - "contactChannel": { - "type": "belongsTo", - "model": "ContactChannel", - "foreignKey": "contactChannelFk" - }, - "type": { - "type": "belongsTo", - "model": "ClientType", - "foreignKey": "typeFk" - }, - "businessType": { - "type": "belongsTo", - "model": "BusinessType", - "foreignKey": "businessTypeFk" - }, - "addresses": { - "type": "hasMany", - "model": "Address", - "foreignKey": "clientFk" - }, - "greuge": { - "type": "hasMany", - "model": "Greuge", - "foreignKey": "clientFk" - }, - "classifications": { - "type": "hasMany", - "model": "CreditClassification", - "foreignKey": "client" - }, - "defaultAddress": { - "type": "belongsTo", - "model": "Address", - "foreignKey": "defaultAddressFk" - }, - "contacts": { - "type": "hasMany", - "model": "ClientContact", - "foreignKey": "clientFk" - }, - "bank": { - "type": "belongsTo", - "model": "BankEntity", - "foreignKey": "bankEntityFk" - }, - "defaulters": { - "type": "hasMany", - "model": "Defaulter", - "foreignKey": "clientFk" - }, - "clientRisks": { - "type": "hasMany", - "model": "ClientRisk", - "foreignKey": "clientFk" - }, - "claimsRatio": { - "type": "hasOne", - "model": "ClaimRatio", - "foreignKey": "clientFk" - }, - "transferor": { - "type": "belongsTo", - "model": "Client", - "foreignKey": "transferorFk" - }, - "supplier": { + "contactChannel": { + "type": "belongsTo", + "model": "ContactChannel", + "foreignKey": "contactChannelFk" + }, + "type": { + "type": "belongsTo", + "model": "ClientType", + "foreignKey": "typeFk" + }, + "businessType": { + "type": "belongsTo", + "model": "BusinessType", + "foreignKey": "businessTypeFk" + }, + "addresses": { + "type": "hasMany", + "model": "Address", + "foreignKey": "clientFk" + }, + "greuge": { + "type": "hasMany", + "model": "Greuge", + "foreignKey": "clientFk" + }, + "classifications": { + "type": "hasMany", + "model": "CreditClassification", + "foreignKey": "client" + }, + "defaultAddress": { + "type": "belongsTo", + "model": "Address", + "foreignKey": "defaultAddressFk" + }, + "contacts": { + "type": "hasMany", + "model": "ClientContact", + "foreignKey": "clientFk" + }, + "bank": { + "type": "belongsTo", + "model": "BankEntity", + "foreignKey": "bankEntityFk" + }, + "defaulters": { + "type": "hasMany", + "model": "Defaulter", + "foreignKey": "clientFk" + }, + "clientRisks": { + "type": "hasMany", + "model": "ClientRisk", + "foreignKey": "clientFk" + }, + "claimsRatio": { + "type": "hasOne", + "model": "ClaimRatio", + "foreignKey": "clientFk" + }, + "transferor": { + "type": "belongsTo", + "model": "Client", + "foreignKey": "transferorFk" + }, + "supplier": { "type": "belongsTo", "model": "Supplier", "foreignKey": "fi", "primaryKey": "nif" } - }, - "scopes": { + }, + "scopes": { "isActive": { "where": { "isActive": { diff --git a/modules/entry/back/models/entry.json b/modules/entry/back/models/entry.json index d7d71c698..c2e13afc2 100644 --- a/modules/entry/back/models/entry.json +++ b/modules/entry/back/models/entry.json @@ -10,9 +10,13 @@ } }, "log": { - "model":"EntryLog", - "showField": "id" - }, + "logTable": "entryLog", + "mainTable": "entry", + "tables": [ + "buy", + "entryObservation" + ] + }, "properties": { "id": { "type": "number", @@ -39,9 +43,9 @@ }, "isVirtual": { "type": "boolean", - "mysql": { - "columnName": "isRaid" - } + "mysql": { + "columnName": "isRaid" + } }, "isRaid": { "type": "boolean" @@ -57,9 +61,9 @@ }, "observation": { "type": "string", - "mysql": { - "columnName": "evaNotes" - } + "mysql": { + "columnName": "evaNotes" + } }, "loadPriority": { "type": "number" diff --git a/modules/invoiceIn/back/models/invoice-in.json b/modules/invoiceIn/back/models/invoice-in.json index e31523d81..d40c0c52d 100644 --- a/modules/invoiceIn/back/models/invoice-in.json +++ b/modules/invoiceIn/back/models/invoice-in.json @@ -10,9 +10,13 @@ } }, "log": { - "model":"InvoiceInLog", - "showField": "id" - }, + "logTable": "invoiceInLog", + "mainTable": "invoiceIn", + "tables": [ + "invoiceInDueDay", + "invoiceInTax" + ] + }, "properties": { "id": { "id": true, @@ -115,5 +119,3 @@ } } } - - diff --git a/modules/item/back/models/item.json b/modules/item/back/models/item.json index 2b4b1797d..287522062 100644 --- a/modules/item/back/models/item.json +++ b/modules/item/back/models/item.json @@ -10,9 +10,42 @@ } }, "log": { - "model":"ItemLog", - "showField": "id" - }, + "logTable": "itemLog", + "mainTable": "item", + "tables": [ + "itemBarcode", + "itemBotanical", + { + "name": "itemTag", + "showRelation": "tagFk" + }, + { + "name": "itemTaxCountry", + "types": { + "taxClassFk": "integer" + } + }, + { + "name": "item", + "exclude": [ + "lastUsed", + "supplyResponseFk", + "tag5", + "tag6", + "tag7", + "tag8", + "tag9", + "tag10", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10" + ] + } + ] + }, "properties": { "id": { "type": "number", @@ -227,4 +260,4 @@ } } } -} \ No newline at end of file +} diff --git a/modules/route/back/models/route.json b/modules/route/back/models/route.json index f8be9023c..b111c762a 100644 --- a/modules/route/back/models/route.json +++ b/modules/route/back/models/route.json @@ -1,6 +1,6 @@ { "name": "Route", - "base": "VnModel", + "base": "VnModel", "mixins": { "Loggable": true }, @@ -9,6 +9,16 @@ "table": "route" } }, + "log": { + "logTable": "routeLog", + "mainTable": "route", + "tables": [ + { + "name": "routesMonitor", + "relation": "routeFk" + } + ] + }, "properties": { "id": { "type": "number", @@ -70,13 +80,13 @@ "type": "belongsTo", "model": "AgencyMode", "foreignKey": "agencyModeFk" - }, - "ticket": { - "type": "hasMany", - "model": "Ticket", - "foreignKey": "routeFk" - }, - "zone": { + }, + "ticket": { + "type": "hasMany", + "model": "Ticket", + "foreignKey": "routeFk" + }, + "zone": { "type": "belongsTo", "model": "Zone", "foreignKey": "zoneFk" diff --git a/modules/shelving/back/models/parking.json b/modules/shelving/back/models/parking.json index 47a3305ae..6b6ea4649 100644 --- a/modules/shelving/back/models/parking.json +++ b/modules/shelving/back/models/parking.json @@ -1,11 +1,18 @@ { "name": "Parking", - "base": "VnModel", + "base": "VnModel", "options": { "mysql": { "table": "parking" } }, + "log": { + "logTable": "parkingLog", + "mainTable": "parking", + "tables": [ + "saleGroup" + ] + }, "properties": { "id": { "type": "number", diff --git a/modules/shelving/back/models/shelving.json b/modules/shelving/back/models/shelving.json index 46fce31e8..a2a03f80e 100644 --- a/modules/shelving/back/models/shelving.json +++ b/modules/shelving/back/models/shelving.json @@ -1,6 +1,6 @@ { "name": "Shelving", - "base": "VnModel", + "base": "VnModel", "mixins": { "Loggable": true }, @@ -9,6 +9,10 @@ "table": "shelving" } }, + "log": { + "logTable": "shelvingLog", + "mainTable": "shelving" + }, "properties": { "id": { "type": "number", diff --git a/modules/supplier/back/models/supplier.json b/modules/supplier/back/models/supplier.json index 90b266ba9..de2eabd86 100644 --- a/modules/supplier/back/models/supplier.json +++ b/modules/supplier/back/models/supplier.json @@ -9,6 +9,31 @@ "table": "supplier" } }, + "log": { + "logTable": "supplierLog", + "mainTable": "supplier", + "tables": [ + { + "name": "supplier", + "types": { + "payMethodFk": "integer" + } + }, + { + "name": "supplierAccount", + "showField": "iban" + }, + { + "name": "supplierAddress", + "relation": "supplierFk" + }, + "supplierContact", + { + "name": "supplierDms", + "idName": "supplierFk" + } + ] + }, "properties": { "id": { "type": "number", @@ -85,23 +110,23 @@ "type": "number" }, "sageTaxTypeFk": { - "type": "number", - "mysql": { - "columnName": "taxTypeSageFk" - } - }, - "sageTransactionTypeFk": { - "type": "number", - "mysql": { - "columnName": "transactionTypeSageFk" - } - }, + "type": "number", + "mysql": { + "columnName": "taxTypeSageFk" + } + }, + "sageTransactionTypeFk": { + "type": "number", + "mysql": { + "columnName": "transactionTypeSageFk" + } + }, "sageWithholdingFk": { - "type": "number", - "mysql": { - "columnName": "withholdingSageFk" - } - }, + "type": "number", + "mysql": { + "columnName": "withholdingSageFk" + } + }, "isPayMethodChecked": { "type": "boolean" }, @@ -116,26 +141,26 @@ } }, "relations": { - "payMethod": { - "type": "belongsTo", - "model": "PayMethod", - "foreignKey": "payMethodFk" - }, + "payMethod": { + "type": "belongsTo", + "model": "PayMethod", + "foreignKey": "payMethodFk" + }, "payDem": { "type": "belongsTo", "model": "PayDem", "foreignKey": "payDemFk" }, - "province": { - "type": "belongsTo", - "model": "Province", - "foreignKey": "provinceFk" - }, - "country": { - "type": "belongsTo", - "model": "Country", - "foreignKey": "countryFk" - }, + "province": { + "type": "belongsTo", + "model": "Province", + "foreignKey": "provinceFk" + }, + "country": { + "type": "belongsTo", + "model": "Country", + "foreignKey": "countryFk" + }, "client": { "type": "belongsTo", "model": "Client", @@ -147,35 +172,35 @@ "model": "Worker", "foreignKey": "workerFk" }, - "sageTaxType": { - "type": "belongsTo", - "model": "SageTaxType", + "sageTaxType": { + "type": "belongsTo", + "model": "SageTaxType", "foreignKey": "sageTaxTypeFk" - }, - "sageTransactionType": { - "type": "belongsTo", - "model": "SageTransactionType", - "foreignKey": "sageTransactionTypeFk" - }, - "sageWithholding": { - "type": "belongsTo", - "model": "SageWithholding", - "foreignKey": "sageWithholdingFk" - }, + }, + "sageTransactionType": { + "type": "belongsTo", + "model": "SageTransactionType", + "foreignKey": "sageTransactionTypeFk" + }, + "sageWithholding": { + "type": "belongsTo", + "model": "SageWithholding", + "foreignKey": "sageWithholdingFk" + }, "contacts": { - "type": "hasMany", - "model": "SupplierContact", + "type": "hasMany", + "model": "SupplierContact", "foreignKey": "supplierFk" }, "addresses": { - "type": "hasMany", - "model": "SupplierAddress", - "foreignKey": "supplierFk" - }, - "supplierActivity": { - "type": "belongsTo", - "model": "SupplierActivity", - "foreignKey": "supplierActivityFk" - } + "type": "hasMany", + "model": "SupplierAddress", + "foreignKey": "supplierFk" + }, + "supplierActivity": { + "type": "belongsTo", + "model": "SupplierActivity", + "foreignKey": "supplierActivityFk" + } } } diff --git a/modules/ticket/back/models/ticket.json b/modules/ticket/back/models/ticket.json index 248c0312f..43aa972c6 100644 --- a/modules/ticket/back/models/ticket.json +++ b/modules/ticket/back/models/ticket.json @@ -1,14 +1,69 @@ { "name": "Ticket", - "base": "VnModel", + "base": "VnModel", "mixins": { "Loggable": true }, "options": { "mysql": { - "table": "ticket" + "table": "ticket" } }, + "log": { + "logTable": "ticketLog", + "mainTable": "ticket", + "tables": [ + "expedition", + { + "name": "sale", + "showField": "concept", + "types": { + "discount": "integer" + }, + "exclude": [ + "priceFixed" + ] + }, + { + "name": "ticket", + "types": { + "priority": "integer" + }, + "exclude": [ + "totalWithVat", + "totalWithoutVat" + ] + }, + { + "name": "ticketDms", + "idName": "dmsFk" + }, + { + "name": "ticketObservation", + "types": { + "observationTypeFk": "integer" + } + }, + "ticketPackaging", + { + "name": "ticketRefund", + "relation": "originalTicketFk" + }, + "ticketRequest", + "ticketService", + { + "name": "ticketTracking", + "showRelation": "stateFk", + "types": { + "stateFk": "integer" + }, + "exclude": [ + "failFk" + ] + }, + "ticketWeekly" + ] + }, "properties": { "id": { "id": true, diff --git a/modules/travel/back/models/travel.json b/modules/travel/back/models/travel.json index 701894a76..b77b07d10 100644 --- a/modules/travel/back/models/travel.json +++ b/modules/travel/back/models/travel.json @@ -1,6 +1,6 @@ { "name": "Travel", - "base": "VnModel", + "base": "VnModel", "mixins": { "Loggable": true }, @@ -9,6 +9,23 @@ "table": "travel" } }, + "log": { + "logTable": "travelLog", + "mainTable": "travel", + "tables": [ + { + "name": "travel", + "showField": "ref", + "types": { + "totalEntries": "integer" + } + }, + { + "name": "travelThermograph", + "showField": "thermographFk" + } + ] + }, "properties": { "id": { "type": "number", diff --git a/modules/worker/back/models/device-production.json b/modules/worker/back/models/device-production.json index f6e5105ad..230d128ed 100644 --- a/modules/worker/back/models/device-production.json +++ b/modules/worker/back/models/device-production.json @@ -5,7 +5,11 @@ "Loggable": true }, "log": { - "model": "DeviceProductionLog" + "logTable": "deviceProductionLog", + "mainTable": "deviceProduction", + "tables": [ + "deviceProductionUser" + ] }, "options": { "mysql": { @@ -24,25 +28,25 @@ "type": "number" }, "macWifi": { - "type" : "string" + "type": "string" }, "serialNumber": { - "type" : "string" + "type": "string" }, "android_id": { - "type" : "string" + "type": "string" }, "purchased": { - "type" : "date" + "type": "date" }, "stateFk": { - "type" : "string" + "type": "string" }, "isInScaleFusion": { - "type" : "boolean" + "type": "boolean" }, "description": { - "type" : "string" + "type": "string" } }, "relations": { diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index c203f6e09..616ae5b5d 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -10,6 +10,30 @@ "table": "worker" } }, + "log": { + "logTable": "workerLog", + "mainTable": "worker", + "tables": [ + { + "name": "worker", + "showField": "firstName", + "exclude": [ + "balance" + ] + }, + { + "name": "workerDocument", + "showRelation": "document", + "modelName": "WorkerDms", + "relation": "worker" + }, + "business", + { + "name": "workerTimeControl", + "relation": "userFk" + } + ] + }, "properties": { "id": { "type": "number", @@ -25,40 +49,40 @@ "required": true }, "phone": { - "type" : "string" + "type": "string" }, "bossFk": { - "type" : "number" + "type": "number" }, "maritalStatus": { - "type" : "string" + "type": "string" }, "originCountryFk": { - "type" : "number" + "type": "number" }, "educationLevelFk": { - "type" : "number" + "type": "number" }, "SSN": { - "type" : "string" + "type": "string" }, "mobileExtension": { - "type" : "number" + "type": "number" }, "code": { - "type" : "string" + "type": "string" }, "locker": { - "type" : "number" + "type": "number" }, "fi": { - "type" : "string" + "type": "string" }, "birth": { - "type" : "date" + "type": "date" }, "isF11Allowed": { - "type" : "boolean" + "type": "boolean" } }, "relations": { @@ -93,38 +117,51 @@ "foreignKey": "workerFk" } }, - "scopes":{ + "scopes": { "summary": { "include": [ { "relation": "user", "scope": { - "fields": ["email", "name", "nickname", "roleFk", "emailVerified"], + "fields": [ + "email", + "name", + "nickname", + "roleFk", + "emailVerified" + ], "include": [ { "relation": "role", "scope": { - "fields": ["name"] + "fields": [ + "name" + ] } }, { "relation": "emailUser", "scope": { - "fields": ["email"] + "fields": [ + "email" + ] } } ] } - }, { + }, + { "relation": "department", "scope": { "include": { "relation": "department" } } - }, { + }, + { "relation": "boss" - }, { + }, + { "relation": "client", "scope": { "fields": [ @@ -169,7 +206,8 @@ "recommendedCredit" ] } - }, { + }, + { "relation": "sip" } ] diff --git a/modules/zone/back/models/zone.json b/modules/zone/back/models/zone.json index cf7371053..5105c9bdd 100644 --- a/modules/zone/back/models/zone.json +++ b/modules/zone/back/models/zone.json @@ -1,74 +1,87 @@ { - "name": "Zone", - "base": "VnModel", + "name": "Zone", + "base": "VnModel", "mixins": { "Loggable": true }, - "options": { - "mysql": { - "table": "zone" - } - }, - "properties": { - "id": { - "id": true, - "type": "number" - }, - "name": { - "type": "string", - "required": true - }, - "hour": { - "type": "date", - "required": true - }, - "travelingDays": { - "type": "number" - }, - "price": { - "type": "number" - }, - "bonus": { - "type": "number" - }, - "isVolumetric": { - "type": "boolean" - }, - "inflation": { - "type": "number" - }, - "m3Max": { - "type": "number" - }, - "itemMaxSize": { - "type": "number" - } - }, - "relations": { + "options": { + "mysql": { + "table": "zone" + } + }, + "log": { + "logTable": "zoneLog", + "mainTable": "zone", + "tables": [ + "zoneEvent", + "zoneExclusion", + "zoneWarehouse", + { + "name": "zoneIncluded", + "idName": "zoneFk" + } + ] + }, + "properties": { + "id": { + "id": true, + "type": "number" + }, + "name": { + "type": "string", + "required": true + }, + "hour": { + "type": "date", + "required": true + }, + "travelingDays": { + "type": "number" + }, + "price": { + "type": "number" + }, + "bonus": { + "type": "number" + }, + "isVolumetric": { + "type": "boolean" + }, + "inflation": { + "type": "number" + }, + "m3Max": { + "type": "number" + }, + "itemMaxSize": { + "type": "number" + } + }, + "relations": { "agencyMode": { "type": "belongsTo", "model": "AgencyMode", "foreignKey": "agencyModeFk" - }, - "events": { + }, + "events": { "type": "hasMany", "model": "ZoneEvent", "foreignKey": "zoneFk" }, - "exclusions": { + "exclusions": { "type": "hasMany", "model": "ZoneExclusion", - "foreignKey": "zoneFk" - }, - "warehouses": { - "type": "hasMany", - "model": "ZoneWarehouse", - "foreignKey": "zoneFk" + "foreignKey": "zoneFk" }, - "closures": { - "type": "hasMany", - "model": "ZoneClosure", - "foreignKey": "zoneFk" + "warehouses": { + "type": "hasMany", + "model": "ZoneWarehouse", + "foreignKey": "zoneFk" + }, + "closures": { + "type": "hasMany", + "model": "ZoneClosure", + "foreignKey": "zoneFk" } } }