From adebf5e0df149d9ca9397bb9385d4238beac5974 Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 30 Nov 2018 08:00:35 +0100 Subject: [PATCH] now a claim state is 'resolved' when a refund ticket is created --- .../common/methods/claim-beginning/importToNewRefundTicket.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/loopback/common/methods/claim-beginning/importToNewRefundTicket.js b/services/loopback/common/methods/claim-beginning/importToNewRefundTicket.js index 9cbe7a94e..dbbf94927 100644 --- a/services/loopback/common/methods/claim-beginning/importToNewRefundTicket.js +++ b/services/loopback/common/methods/claim-beginning/importToNewRefundTicket.js @@ -135,6 +135,10 @@ module.exports = Self => { newRefundTicket.id, claim.ticketFk ], {transaction: transaction}); + let claimState = await Self.app.models.ClaimState.findOne({where: {description: 'Resuelto'}}); + + await claim.updateAttribute('claimStateFk', claimState.id, {transaction: transaction}); + await transaction.commit(); return newRefundTicket;