3680-feat(claim): add packages, and next button #898
|
@ -0,0 +1 @@
|
|||
ALTER TABLE vn.claim ADD packages smallint(10) unsigned DEFAULT 0 NULL COMMENT 'packages received by the client';
|
|
@ -1705,12 +1705,12 @@ INSERT INTO `vn`.`claimState`(`id`, `code`, `description`, `roleFk`, `priority`)
|
|||
( 6, 'mana', 'Mana', 1, 4),
|
||||
( 7, 'lack', 'Faltas', 1, 2);
|
||||
|
||||
INSERT INTO `vn`.`claim`(`id`, `ticketCreated`, `claimStateFk`, `observation`, `clientFk`, `workerFk`, `responsibility`, `isChargedToMana`, `created` )
|
||||
INSERT INTO `vn`.`claim`(`id`, `ticketCreated`, `claimStateFk`, `observation`, `clientFk`, `workerFk`, `responsibility`, `isChargedToMana`, `created`, `packages`)
|
||||
VALUES
|
||||
(1, CURDATE(), 1, 'Cu nam labores lobortis definiebas, ei aliquyam salutatus persequeris quo, cum eu nemore fierent dissentiunt. Per vero dolor id, vide democritum scribentur eu vim, pri erroribus temporibus ex.', 1101, 18, 3, 0, CURDATE()),
|
||||
(2, CURDATE(), 2, 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.', 1101, 18, 3, 0, CURDATE()),
|
||||
(3, CURDATE(), 3, 'An vim commodo dolorem volutpat, cu expetendis voluptatum usu, et mutat consul adversarium his. His natum numquam legimus an, diam fabulas mei ut. Melius fabellas sadipscing vel id. Partem diceret mandamus mea ne, has te tempor nostrud. Aeque nostro eum no.', 1101, 18, 1, 1, CURDATE()),
|
||||
(4, CURDATE(), 3, 'Wisi forensibus mnesarchum in cum. Per id impetus abhorreant, his no magna definiebas, inani rationibus in quo. Ut vidisse dolores est, ut quis nominavi mel. Ad pri quod apeirian concludaturque.', 1104, 18, 5, 0, CURDATE());
|
||||
(1, CURDATE(), 1, 'Cu nam labores lobortis definiebas, ei aliquyam salutatus persequeris quo, cum eu nemore fierent dissentiunt. Per vero dolor id, vide democritum scribentur eu vim, pri erroribus temporibus ex.', 1101, 18, 3, 0, CURDATE(), 0),
|
||||
(2, CURDATE(), 2, 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.', 1101, 18, 3, 0, CURDATE(), 1),
|
||||
(3, CURDATE(), 3, 'An vim commodo dolorem volutpat, cu expetendis voluptatum usu, et mutat consul adversarium his. His natum numquam legimus an, diam fabulas mei ut. Melius fabellas sadipscing vel id. Partem diceret mandamus mea ne, has te tempor nostrud. Aeque nostro eum no.', 1101, 18, 1, 1, CURDATE(), 5),
|
||||
(4, CURDATE(), 3, 'Wisi forensibus mnesarchum in cum. Per id impetus abhorreant, his no magna definiebas, inani rationibus in quo. Ut vidisse dolores est, ut quis nominavi mel. Ad pri quod apeirian concludaturque.', 1104, 18, 5, 0, CURDATE(), 10);
|
||||
|
||||
INSERT INTO `vn`.`claimBeginning`(`id`, `claimFk`, `saleFk`, `quantity`)
|
||||
VALUES
|
||||
|
|
|
@ -692,6 +692,7 @@ export default {
|
|||
claimBasicData: {
|
||||
claimState: 'vn-claim-basic-data vn-autocomplete[ng-model="$ctrl.claim.claimStateFk"]',
|
||||
observation: 'vn-textarea[ng-model="$ctrl.claim.observation"]',
|
||||
packages: 'vn-input-number[ng-model="$ctrl.claim.packages"]',
|
||||
hasToPickUpCheckbox: 'vn-claim-basic-data vn-check[ng-model="$ctrl.claim.hasToPickUp"]',
|
||||
saveButton: `button[type=submit]`
|
||||
},
|
||||
|
|
|
@ -24,6 +24,8 @@ describe('Claim edit basic data path', () => {
|
|||
await page.autocompleteSearch(selectors.claimBasicData.claimState, 'Gestionado');
|
||||
await page.clearTextarea(selectors.claimBasicData.observation);
|
||||
await page.write(selectors.claimBasicData.observation, 'edited observation');
|
||||
await page.clearInput(selectors.claimBasicData.packages);
|
||||
await page.write(selectors.claimBasicData.packages, '2');
|
||||
await page.waitToClick(selectors.claimBasicData.saveButton);
|
||||
const message = await page.waitForSnackbar();
|
||||
|
||||
|
@ -64,10 +66,19 @@ describe('Claim edit basic data path', () => {
|
|||
expect(result).toEqual('edited observation');
|
||||
});
|
||||
|
||||
it('should confirm the claim packages was edited', async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(selectors.claimBasicData.packages, 'value');
|
||||
|
||||
expect(result).toEqual('2');
|
||||
});
|
||||
|
||||
it(`should edit the claim to leave it untainted`, async() => {
|
||||
await page.autocompleteSearch(selectors.claimBasicData.claimState, 'Pendiente');
|
||||
await page.clearTextarea(selectors.claimBasicData.observation);
|
||||
await page.write(selectors.claimBasicData.observation, 'Observation one');
|
||||
await page.clearInput(selectors.claimBasicData.packages);
|
||||
await page.write(selectors.claimBasicData.packages, '0');
|
||||
await page.waitToClick(selectors.claimBasicData.saveButton);
|
||||
const message = await page.waitForSnackbar();
|
||||
|
||||
|
|
|
@ -28,6 +28,10 @@ module.exports = Self => {
|
|||
{
|
||||
arg: 'hasToPickUp',
|
||||
type: 'boolean'
|
||||
},
|
||||
{
|
||||
arg: 'packages',
|
||||
type: 'number'
|
||||
}],
|
||||
returns: {
|
||||
type: 'object',
|
||||
|
|
|
@ -43,6 +43,9 @@
|
|||
},
|
||||
"workerFk": {
|
||||
"type": "number"
|
||||
},
|
||||
"packages": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
|
|
|
@ -44,6 +44,13 @@
|
|||
vn-focus>
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-input-number vn-one
|
||||
min="0"
|
||||
type="number"
|
||||
label="Packages received"
|
||||
ng-model="$ctrl.claim.packages">
|
||||
</vn-input-number>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textarea
|
||||
|
|
|
@ -6,3 +6,4 @@ Company: Empresa
|
|||
Sales/Client: Comercial/Cliente
|
||||
Pick up: Recoger
|
||||
When checked will notify a pickup to the salesPerson: Cuando se marque enviará una notificación de recogida al comercial
|
||||
Packages received: Bultos recibidos
|
|
@ -78,6 +78,11 @@
|
|||
</vn-table>
|
||||
</vn-card>
|
||||
</vn-data-viewer>
|
||||
<vn-button
|
||||
label="Next"
|
||||
class="next"
|
||||
ui-sref="claim.card.photos">
|
||||
</vn-button>
|
||||
<vn-float-button
|
||||
icon="add"
|
||||
ng-if="$ctrl.isRewritable"
|
||||
|
|
|
@ -25,3 +25,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
.next{
|
||||
float: right;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue