create models saleChecked saleComponent, added fixtures and ACL
This commit is contained in:
parent
6df5f1c3fa
commit
60f3bfc7b8
|
@ -415,6 +415,29 @@ INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `pric
|
|||
( 2, 1, 1, 'Gem of Time', 2 , 1.5, 0, 0, 0, CURDATE()),
|
||||
( 3, 2, 2, 'Mjolnir' , 10, 4 , 0, 0, 0, CURDATE());
|
||||
|
||||
INSERT INTO `vn`.`saleChecked`(`saleFk`, `isChecked`)
|
||||
VALUES
|
||||
( 1, 0),
|
||||
( 2, 1);
|
||||
|
||||
INSERT INTO `vn`.`componentTypeRate`(`id`, `type`)
|
||||
VALUES
|
||||
( 1, 'agency'),
|
||||
( 2, 'client'),
|
||||
( 3, 'company');
|
||||
|
||||
INSERT INTO `vn`.`componentRate`(`id`, `name`, `componentTypeRate`, `classRate`, `tax`, `isRenewable`)
|
||||
VALUES
|
||||
( 1, 'Special price', 1, NULL, NULL, 1),
|
||||
( 2, 'Delivery', 2, NULL, NULL, 1),
|
||||
( 3, 'Mana', 3, 1, NULL, 0 );
|
||||
|
||||
INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`)
|
||||
VALUES
|
||||
( 1, 1, 0.5),
|
||||
( 2, 2, 1.2 );
|
||||
|
||||
|
||||
INSERT INTO `vn`.`itemBarcode`(`id`, `itemFk`, `code`)
|
||||
VALUES
|
||||
(1, 1 ,1 ),
|
||||
|
|
|
@ -7,3 +7,5 @@ INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `pri
|
|||
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('TicketPackaging', '*', '*', 'ALLOW', 'ROLE', 'employee');
|
||||
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Packaging', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
|
||||
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Packaging', '*', 'WRITE', 'ALLOW', 'ROLE', 'logistic');
|
||||
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('SaleChecked', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
|
||||
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('SaleComponent', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
|
|
@ -0,0 +1,11 @@
|
|||
USE `vn`;
|
||||
CREATE
|
||||
OR REPLACE ALGORITHM = UNDEFINED
|
||||
DEFINER = `root`@`%`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `vn`.`saleChecked` AS
|
||||
SELECT
|
||||
`m`.`Id_Movimiento` AS `saleFk`,
|
||||
`m`.`checked` AS `isChecked`
|
||||
FROM
|
||||
`vn2008`.`Movimientos_checked` `m`;
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"name": "ComponentRate",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "componentRate"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"id": true,
|
||||
"type": "Number",
|
||||
"description": "Identifier"
|
||||
},
|
||||
"name": {
|
||||
"type": "String"
|
||||
},
|
||||
"classRate": {
|
||||
"type": "Number"
|
||||
},
|
||||
"tax": {
|
||||
"type": "Number"
|
||||
},
|
||||
"isRenewable": {
|
||||
"type": "Number"
|
||||
},
|
||||
"componentTypeRate": {
|
||||
"type": "Number"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"name": "SaleChecked",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "saleChecked"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"isChecked": {
|
||||
"type": "Number"
|
||||
},
|
||||
"saleFk": {
|
||||
"id": true
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"sale": {
|
||||
"type": "belongsTo",
|
||||
"model": "Sale",
|
||||
"foreignKey": "saleFk"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"name": "SaleComponent",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "saleComponent"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"value": {
|
||||
"type": "Number"
|
||||
},
|
||||
"saleFk": {
|
||||
"id": true
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"sale": {
|
||||
"type": "belongsTo",
|
||||
"model": "Sale",
|
||||
"foreignKey": "saleFk"
|
||||
},
|
||||
"componentRate": {
|
||||
"type": "belongsTo",
|
||||
"model": "componentRate",
|
||||
"foreignKey": "componentFk"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,5 +16,11 @@
|
|||
},
|
||||
"Packaging": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"SaleChecked": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue