-
Notifications
You must be signed in to change notification settings - Fork 0
PM-1304 - add audit trail when description gets updated #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,9 @@ export class AdminService { | |
} | ||
: undefined, | ||
}, | ||
include: { | ||
winnings: true, | ||
}, | ||
}); | ||
} | ||
|
||
|
@@ -119,6 +122,18 @@ export class AdminService { | |
}, | ||
}), | ||
); | ||
|
||
if (payment.installment_number === 1) { | ||
transactions.push((tx) => | ||
this.addAudit( | ||
userId, | ||
winningsId, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. high |
||
`Modified payment description from "${payment.winnings.description}" to "${body.description}"`, | ||
body.auditNote, | ||
tx, | ||
), | ||
); | ||
} | ||
} | ||
|
||
let paymentStatus = payment.payment_status as PaymentStatus; | ||
|
@@ -546,6 +561,7 @@ export class AdminService { | |
}, | ||
}, | ||
take: 1000, | ||
orderBy: { created_at: 'desc' }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. medium |
||
}); | ||
|
||
result.data = audits.map((item) => ({ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
medium
performance
Consider checking if
body.description
is different frompayment.winnings.description
before adding an audit entry. This will prevent unnecessary audit entries when the description hasn't actually changed.