add new model clientRisk

This commit is contained in:
Bernat 2018-10-16 08:36:25 +02:00
parent a681f6f854
commit b6ac4ff900
3 changed files with 99 additions and 57 deletions

View File

@ -0,0 +1,27 @@
{
"name": "ClientRisk",
"base": "VnModel",
"options": {
"mysql": {
"table": "clientRisk",
"database": "vn"
}
},
"properties": {
"amount": {
"type": "Number"
}
},
"relations": {
"client": {
"type": "belongsTo",
"model": "Client",
"foreignKey": "clientFk"
},
"company": {
"type": "belongsTo",
"model": "Company",
"foreignKey": "companyFk"
}
}
}

View File

@ -55,5 +55,8 @@
},
"Defaulter": {
"dataSource": "vn"
},
"ClientRisk": {
"dataSource": "vn"
}
}

View File

@ -0,0 +1,12 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `clientRisk` AS
SELECT
`c`.`customer_id` AS `clientFk`,
`c`.`company_id` AS `companyFk`,
`c`.`amount` AS `amount`
FROM
`bi`.`customer_risk` `c`;