add models creditClassification and creditInsurance, update fixtures #151

This commit is contained in:
Bernat Exposito 2018-03-06 08:55:54 +01:00
parent 13c3ffce27
commit 96689eccc8
4 changed files with 50 additions and 17 deletions

View File

@ -13,10 +13,11 @@
"type": "Number",
"description": "Identifier"
},
"started": {
"type": "date"
"dateStart": {
"type": "date",
"required": true
},
"ended": {
"dateEnd": {
"type": "date"
}
},
@ -24,7 +25,7 @@
"client": {
"type": "belongsTo",
"model": "Client",
"foreignKey": "clientFk"
"foreignKey": "client"
}
}
}

View File

@ -0,0 +1,33 @@
{
"name": "CreditInsurance",
"description": "Credit insurance",
"base": "VnModel",
"options": {
"mysql": {
"table": "creditInsurance"
}
},
"properties": {
"id": {
"id": true,
"type": "Number",
"description": "Identifier"
},
"credit": {
"type": "Number"
},
"creationDate": {
"type": "date"
},
"grade": {
"type": "Number"
}
},
"relations": {
"creditClassification": {
"type": "belongsTo",
"model": "CreditClassification",
"foreignKey": "creditClassification"
}
}
}

View File

@ -31,5 +31,11 @@
},
"InvoiceOut": {
"dataSource": "vn"
},
"CreditInsurance": {
"dataSource": "vn"
},
"CreditClassification": {
"dataSource": "vn"
}
}

View File

@ -110,15 +110,6 @@ INSERT INTO `vn`.`cplusTerIdNif`(`id`, `description`)
VALUES
(1, 'NIF');
/* INSERT INTO `vn`.`worker`(`workerCode`, `id`, `firstName`, `name`, `userFk`)
VALUES
('LGN', 1, 'David Charles', 'Haller', 6),
('ANT', 2, 'Hank', 'Pym', 7),
('DCX', 3, 'Charles', 'Xavier', 8),
('HLK', 4, 'Bruce', 'Banner', 9),
('JJJ', 5, 'Jessica', 'Jones', 10),
('VSC', 20, 'Victor', 'Stone', 11); */
INSERT INTO `vn`.`contactChannel`(`id`, `name`)
VALUES
(1, 'Rumors on the streets'),
@ -228,6 +219,12 @@ INSERT INTO `vn`.`creditClassification`(`id`, `client`, `dateStart`, `dateEnd`)
(4, 104, CURDATE(), CURDATE()),
(5, 105, CURDATE(), CURDATE());
INSERT INTO `vn`.`creditInsurance`(`id`, `creditClassification`, `credit`, `creationDate`, `grade`)
VALUES
(1, 1 , 3000, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), NULL),
(2, 2 , 6000, DATE_ADD(CURDATE(), INTERVAL -2 MONTH), NULL),
(3, 3, 10000 , DATE_ADD(CURDATE(), INTERVAL -3 MONTH), NULL);
INSERT INTO `vn`.`route`(`id`, `created`)
VALUES
(1, CURDATE()),
@ -419,10 +416,6 @@ INSERT INTO `vn`.`itemBotanical`(`itemFk`, `botanical`, `genusFk`, `specieFk`)
( 3, 'Cycas revoluta', 2, NULL),
( 4, 'Polygonum', NULL, NULL);
/* INSERT INTO `salix`.`user`(`id`,`username`,`password`,`email`)
VALUES
(10, 'JessicaJones', 'ac754a330530832ba1bf7687f577da91', 'JessicaJones@verdnatura.es'); */
INSERT INTO `vn`.`tag`(`id`,`name`,`isFree`,`isQuantitatif`,`sourceTable`,`unit`)
VALUES
(1, 'Color', 0, 0, null, null),