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