Tarea #1259 crear modelo ticketServiceType

This commit is contained in:
Javi Gallego 2019-04-10 14:44:41 +02:00
parent 49ef341eb6
commit 50d70f0f6f
6 changed files with 43 additions and 7 deletions

View File

@ -0,0 +1,13 @@
DROP TABLE IF EXISTS `vn`.`ticketServiceType`;
CREATE TABLE vn.`ticketServiceType` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Lista de los posibles servicios a elegir';
INSERT INTO `vn`.`ticketServiceType` (`name`) VALUES ('Porte Agencia');
INSERT INTO `vn`.`ticketServiceType` (`name`) VALUES ('Portes Retorno');
INSERT INTO `vn`.`ticketServiceType` (`name`) VALUES ('Porte Carry');
INSERT INTO `vn`.`ticketServiceType` (`name`) VALUES ('Cargo FITOSANITARIO');
INSERT INTO `vn`.`ticketServiceType` (`name`) VALUES ('Documentos');

View File

@ -455,7 +455,7 @@ export default {
}, },
ticketService: { ticketService: {
addServiceButton: 'vn-ticket-service > form > vn-card > div > vn-one:nth-child(3) > vn-icon-button > button > vn-icon', addServiceButton: 'vn-ticket-service > form > vn-card > div > vn-one:nth-child(3) > vn-icon-button > button > vn-icon',
firstDescriptionInput: 'vn-ticket-service vn-textfield[label="Description"] input', firstDescriptionInput: 'vn-ticket-service vn-autocomplete[label="Documentos"]',
firstQuantityInput: 'vn-ticket-service vn-input-number[label="Quantity"] input', firstQuantityInput: 'vn-ticket-service vn-input-number[label="Quantity"] input',
firstPriceInput: 'vn-ticket-service vn-input-number[label="Price"] input', firstPriceInput: 'vn-ticket-service vn-input-number[label="Price"] input',
firstVatTypeAutocomplete: 'vn-ticket-service vn-autocomplete[label="Tax class"]', firstVatTypeAutocomplete: 'vn-ticket-service vn-autocomplete[label="Tax class"]',

View File

@ -55,7 +55,7 @@ describe('Ticket services path', () => {
expect(result).toEqual('General VAT'); expect(result).toEqual('General VAT');
}); });
it('should delete the service', async() => { fit('should delete the service', async() => {
const result = await nightmare const result = await nightmare
.waitToClick(selectors.ticketService.fistDeleteServiceButton) .waitToClick(selectors.ticketService.fistDeleteServiceButton)
.waitForNumberOfElements(selectors.ticketService.serviceLine, 0) .waitForNumberOfElements(selectors.ticketService.serviceLine, 0)

View File

@ -56,6 +56,9 @@
"TicketService":{ "TicketService":{
"dataSource": "vn" "dataSource": "vn"
}, },
"TicketServiceType":{
"dataSource": "vn"
},
"TicketTracking": { "TicketTracking": {
"dataSource": "vn" "dataSource": "vn"
}, },

View File

@ -0,0 +1,19 @@
{
"name": "TicketServiceType",
"options": {
"mysql": {
"table": "ticketServiceType"
}
},
"properties": {
"id": {
"type": "Number",
"id": true,
"description": "Identifier"
},
"name": {
"type": "String",
"required": true
}
}
}

View File

@ -14,13 +14,14 @@
<vn-card pad-large> <vn-card pad-large>
<vn-one> <vn-one>
<vn-horizontal ng-repeat="service in services track by $index"> <vn-horizontal ng-repeat="service in services track by $index">
<vn-textfield <vn-autocomplete vn-one
vn-one
vn-focus vn-focus
url="/api/TicketServiceTypes"
label="Description" label="Description"
model="service.description" show-field="name"
rule="TicketService.description"> value-field="name"
</vn-textfield> field="service.description">
</vn-autocomplete>
<vn-input-number vn-one min="0" step="1" <vn-input-number vn-one min="0" step="1"
label="Quantity" label="Quantity"
model="service.quantity" model="service.quantity"