diff --git a/db/changes/10190-postRegulation/00-claimState.sql b/db/changes/10190-postRegulation/00-claimState.sql new file mode 100644 index 000000000..72159d102 --- /dev/null +++ b/db/changes/10190-postRegulation/00-claimState.sql @@ -0,0 +1,10 @@ +ALTER TABLE `vn`.`claimState` +ADD COLUMN `priority` INT NOT NULL DEFAULT 1 AFTER `roleFk`; + +UPDATE `vn`.`claimState` SET `priority` = '1' WHERE (`id` = '1'); +UPDATE `vn`.`claimState` SET `priority` = '5' WHERE (`id` = '2'); +UPDATE `vn`.`claimState` SET `priority` = '7' WHERE (`id` = '3'); +UPDATE `vn`.`claimState` SET `priority` = '6' WHERE (`id` = '4'); +UPDATE `vn`.`claimState` SET `priority` = '3' WHERE (`id` = '5'); +UPDATE `vn`.`claimState` SET `priority` = '4' WHERE (`id` = '6'); +UPDATE `vn`.`claimState` SET `priority` = '2' WHERE (`id` = '7'); \ No newline at end of file diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index f9bbce092..6b3e1905e 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -1473,14 +1473,15 @@ INSERT INTO `vn`.`clientSample`(`id`, `clientFk`, `typeFk`, `created`, `workerFk (4, 102, 2, CURDATE(), 18, 18, 567), (5, 102, 3, CURDATE(), 19, 19, 567); -INSERT INTO `vn`.`claimState`(`id`, `code`, `description`, `roleFk`) +INSERT INTO `vn`.`claimState`(`id`, `code`, `description`, `roleFk`, `priority`) VALUES - ( 1, 'pending', 'Pendiente', 1), - ( 2, 'managed', 'Gestionado', 1), - ( 3, 'resolved', 'Resuelto', 21), - ( 4, 'canceled', 'Anulado', 1), - ( 5, 'disputed', 'Cuestionado', 21), - ( 6, 'mana', 'Mana', 1); + ( 1, 'pending', 'Pendiente', 1, 1), + ( 2, 'managed', 'Gestionado', 1, 5), + ( 3, 'resolved', 'Resuelto', 21, 7), + ( 4, 'canceled', 'Anulado', 1, 6), + ( 5, 'disputed', 'Cuestionado', 21, 3), + ( 6, 'mana', 'Mana', 1, 4), + ( 7, 'inProgress', 'En Curso', 1, 2); INSERT INTO `vn`.`claim`(`id`, `ticketCreated`, `claimStateFk`, `observation`, `clientFk`, `workerFk`, `responsibility`, `isChargedToMana`, `created` ) VALUES diff --git a/modules/claim/back/methods/claim/filter.js b/modules/claim/back/methods/claim/filter.js index 33909eedc..1caa120be 100644 --- a/modules/claim/back/methods/claim/filter.js +++ b/modules/claim/back/methods/claim/filter.js @@ -114,7 +114,6 @@ module.exports = Self => { LEFT JOIN claimState cs ON cs.id = cl.claimStateFk` ); - stmt.merge(conn.makeSuffix(filter)); let itemsIndex = stmts.push(stmt) - 1; diff --git a/modules/claim/back/models/claim-state.json b/modules/claim/back/models/claim-state.json index 08d9cb12b..c905aacba 100644 --- a/modules/claim/back/models/claim-state.json +++ b/modules/claim/back/models/claim-state.json @@ -19,6 +19,10 @@ "description": { "type": "String", "required": true + }, + "priority": { + "type": "nomber", + "required": true } }, "relations": { diff --git a/modules/claim/front/basic-data/index.html b/modules/claim/front/basic-data/index.html index 948ac6b18..63a3d0294 100644 --- a/modules/claim/front/basic-data/index.html +++ b/modules/claim/front/basic-data/index.html @@ -40,6 +40,7 @@ show-field="description" value-field="id" label="Claim state" + order="priority ASC" vn-focus> diff --git a/modules/claim/front/main/index.html b/modules/claim/front/main/index.html index c66c02f14..8a9447125 100644 --- a/modules/claim/front/main/index.html +++ b/modules/claim/front/main/index.html @@ -2,7 +2,7 @@ vn-id="model" url="Claims/filter" limit="20" - order="claimStateFk ASC, created DESC" + order="priority ASC, created DESC" auto-load="true">