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

@ -1,59 +1,62 @@
{
"AddressObservation": {
"dataSource": "vn"
},
"ClientCredit": {
"dataSource": "vn"
},
"ClientObservation": {
"dataSource": "vn"
},
"ClientContact": {
"dataSource": "vn"
},
"Greuge": {
"dataSource": "vn"
},
"GreugeType": {
"dataSource": "vn"
},
"Mandate": {
"dataSource": "vn"
},
"MandateType": {
"dataSource": "vn"
},
"ObservationType": {
"dataSource": "vn"
},
"Recovery": {
"dataSource": "vn"
},
"InvoiceOut": {
"dataSource": "vn"
},
"CreditInsurance": {
"dataSource": "vn"
},
"CreditClassification": {
"dataSource": "vn"
},
"Sample": {
"dataSource": "vn"
},
"ClientSample": {
"dataSource": "vn"
},
"TpvError": {
"dataSource": "hedera"
},
"TpvMerchant": {
"dataSource": "hedera"
},
"TpvResponse": {
"dataSource": "hedera"
},
"Defaulter": {
"dataSource": "vn"
}
"AddressObservation": {
"dataSource": "vn"
},
"ClientCredit": {
"dataSource": "vn"
},
"ClientObservation": {
"dataSource": "vn"
},
"ClientContact": {
"dataSource": "vn"
},
"Greuge": {
"dataSource": "vn"
},
"GreugeType": {
"dataSource": "vn"
},
"Mandate": {
"dataSource": "vn"
},
"MandateType": {
"dataSource": "vn"
},
"ObservationType": {
"dataSource": "vn"
},
"Recovery": {
"dataSource": "vn"
},
"InvoiceOut": {
"dataSource": "vn"
},
"CreditInsurance": {
"dataSource": "vn"
},
"CreditClassification": {
"dataSource": "vn"
},
"Sample": {
"dataSource": "vn"
},
"ClientSample": {
"dataSource": "vn"
},
"TpvError": {
"dataSource": "hedera"
},
"TpvMerchant": {
"dataSource": "hedera"
},
"TpvResponse": {
"dataSource": "hedera"
},
"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`;