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", "type": "Number",
"description": "Identifier" "description": "Identifier"
}, },
"started": { "dateStart": {
"type": "date" "type": "date",
"required": true
}, },
"ended": { "dateEnd": {
"type": "date" "type": "date"
} }
}, },
@ -24,7 +25,7 @@
"client": { "client": {
"type": "belongsTo", "type": "belongsTo",
"model": "Client", "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": { "InvoiceOut": {
"dataSource": "vn" "dataSource": "vn"
},
"CreditInsurance": {
"dataSource": "vn"
},
"CreditClassification": {
"dataSource": "vn"
} }
} }

View File

@ -110,15 +110,6 @@ INSERT INTO `vn`.`cplusTerIdNif`(`id`, `description`)
VALUES VALUES
(1, 'NIF'); (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`) INSERT INTO `vn`.`contactChannel`(`id`, `name`)
VALUES VALUES
(1, 'Rumors on the streets'), (1, 'Rumors on the streets'),
@ -228,6 +219,12 @@ INSERT INTO `vn`.`creditClassification`(`id`, `client`, `dateStart`, `dateEnd`)
(4, 104, CURDATE(), CURDATE()), (4, 104, CURDATE(), CURDATE()),
(5, 105, 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`) INSERT INTO `vn`.`route`(`id`, `created`)
VALUES VALUES
(1, CURDATE()), (1, CURDATE()),
@ -419,10 +416,6 @@ INSERT INTO `vn`.`itemBotanical`(`itemFk`, `botanical`, `genusFk`, `specieFk`)
( 3, 'Cycas revoluta', 2, NULL), ( 3, 'Cycas revoluta', 2, NULL),
( 4, 'Polygonum', NULL, 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`) INSERT INTO `vn`.`tag`(`id`,`name`,`isFree`,`isQuantitatif`,`sourceTable`,`unit`)
VALUES VALUES
(1, 'Color', 0, 0, null, null), (1, 'Color', 0, 0, null, null),