#6533 - MyLogger to salix #1877

Open
jsegarra wants to merge 12 commits from 6533_myLogger_model into dev
20 changed files with 799 additions and 418 deletions

View File

@ -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
}

View File

@ -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": {

View File

@ -0,0 +1,47 @@
const path = require('path');
const fs = require('fs');
const BACK_MODELS = `back/models`;
const FILE_EXTENSION = '.json';
const FILE_ENCODING = 'utf-8';
module.exports = Self => {
Self.remoteMethod('logInfo', {
description: 'Gets all models information',
accepts: [],
returns: {
type: 'Object',
root: true
},
http: {
path: `/logInfo`,
verb: 'GET'
}
});
const modelsLocale = new Map();
const modulesDir = path.resolve(`${process.cwd()}/modules`);
const modules = fs.readdirSync(modulesDir);
for (const mod of modules) {
const modelsDir = path.join(modulesDir, mod, BACK_MODELS);
if (!fs.existsSync(modelsDir)) continue;
handleModels(modelsDir);
}
const pathVn = path.join(process.cwd(), BACK_MODELS);
handleModels(pathVn);
Self.logInfo = async function() {
return Object.fromEntries(modelsLocale);
};
function handleModels(modelsDir) {
const models = (fs.readdirSync(modelsDir)).filter(fileName => fileName.endsWith(FILE_EXTENSION));
for (const model of models) {
const modelFile = path.join(modelsDir, model);
const modelConfig = JSON.parse(fs.readFileSync(modelFile, {encoding: FILE_ENCODING}));
const {log} = modelConfig;
if (!log?.mainTable) continue;
const key = modelConfig.name.startsWith('Vn') ? modelConfig.name.slice(2) : modelConfig.name;
modelsLocale.set(key.toLowerCase(), log);
}
}
};

View File

@ -6,4 +6,5 @@ module.exports = function(Self) {
require('../methods/application/executeProc')(Self);
require('../methods/application/executeFunc')(Self);
require('../methods/application/getEnumValues')(Self);
require('../methods/application/getEnumValues')(Self);
};

View File

@ -1,4 +1,5 @@
module.exports = function(Self) {
require('../methods/schema/model-info')(Self);
require('../methods/schema/log-info')(Self);
};

View File

@ -7,6 +7,12 @@
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"property": "logInfo",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
]
}

View File

@ -4,6 +4,20 @@
"mixins": {
"Loggable": true
},
"log": {
"logTable": "claimLog",
"mainTable": "claim",
"tables": [
{
"name": "claimDms",
"idName": "dmsFk"
},
"claimDevelopment",
"claimBeginning",
"claimEnd",
"claimObservation"
]
},
"options": {
"mysql": {
"table": "claim"

View File

@ -1,267 +1,304 @@
{
"name": "Client",
"base": "VnModel",
"name": "Client",
"base": "VnModel",
"mixins": {
"Loggable": true
},
"options": {
"mysql": {
"table": "client"
}
},
"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"
},
"options": {
"mysql": {
"table": "client"
}
},
"log": {
"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": {

View File

@ -9,6 +9,14 @@
"table": "entry"
}
},
"log": {
"logTable": "entryLog",
"mainTable": "entry",
"tables": [
"buy",
"entryObservation"
]
},
"properties": {
"id": {
"type": "number",
@ -35,9 +43,9 @@
},
"isVirtual": {
"type": "boolean",
"mysql": {
"columnName": "isRaid"
}
"mysql": {
"columnName": "isRaid"
}
},
"isRaid": {
"type": "boolean"
@ -53,9 +61,9 @@
},
"observation": {
"type": "string",
"mysql": {
"columnName": "evaNotes"
}
"mysql": {
"columnName": "evaNotes"
}
},
"loadPriority": {
"type": "number"

View File

@ -9,6 +9,14 @@
"table": "invoiceIn"
}
},
"log": {
"logTable": "invoiceInLog",
"mainTable": "invoiceIn",
"tables": [
"invoiceInDueDay",
"invoiceInTax"
]
},
"properties": {
"id": {
"id": true,
@ -111,5 +119,3 @@
}
}
}

View File

@ -9,6 +9,48 @@
"table": "item"
}
},
"log": {
"logTable": "itemLog",
"mainTable": "item",
"tables": [
"itemBarcode",
"itemBotanical",
{
"name": "itemTag",
"showRelation": "tagFk"
},
{
"name": "itemTaxCountry",
"types": {
"taxClassFk": "integer"
}
},
{
"name": "item",
"showField": "name",
"exclude": [
"lastUsed",
"supplyResponseFk",
"tag5",
"tag6",
"tag7",
"tag8",
"tag9",
"tag10",
"value5",
"value6",
"value7",
"value8",
"value9",
"value10",
"image"
],
"logFields":[
"size"
]
}
]
},
"properties": {
"id": {
"type": "number",

View File

@ -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"

View File

@ -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",

View File

@ -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",

View File

@ -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"
}
}
}

View File

@ -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,

View File

@ -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",

View File

@ -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": {

View File

@ -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"
}
]

View File

@ -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"
}
}
}