7167-testToMaster_2414 #2244

Merged
alexm merged 643 commits from 7167-testToMaster_2414 into master 2024-04-04 05:32:41 +00:00
1 changed files with 6 additions and 3 deletions
Showing only changes of commit 70096e7a76 - Show all commits

View File

@ -33,12 +33,15 @@ module.exports = Self => {
fields: ['originFk', 'creationDate', 'newInstance']
}, myOptions);
console.log('ticket', ticket);
const now = Date.vnNew();
const maxDate = new Date(ticket.updated);
const maxDate = new Date(ticket.creationDate);
maxDate.setHours(maxDate.getHours() + 1);
if (now > maxDate)
throw new UserError(`You can only restore a ticket within the first hour after deletion`);
if (ticket.newInstance.includes('isDeleted: true')) {
if (now > maxDate)
throw new UserError(`You can only restore a ticket within the first hour after deletion`);
}
// Send notification to salesPerson
const salesPersonId = ticket.client().salesPersonFk;