feat: add pending manual compliance notifications
This commit is contained in:
parent
068f68e838
commit
3dbf10183e
4 changed files with 175 additions and 58 deletions
|
|
@ -173,7 +173,8 @@ function complianceNotify (settings, customer, deviceId, action, period) {
|
|||
|
||||
const msgCore = {
|
||||
BLOCKED: `was blocked`,
|
||||
SUSPENDED: `was suspended for ${!!period && period} days`
|
||||
SUSPENDED: `was suspended for ${!!period && period} days`,
|
||||
PENDING_COMPLIANCE: `is waiting for your manual approval`,
|
||||
}
|
||||
|
||||
const rec = {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ const customerComplianceNotify = (customer, deviceId, code, days = null) => {
|
|||
if (days) {
|
||||
date.setDate(date.getDate() + days)
|
||||
}
|
||||
const message = code === 'SUSPENDED' ? `Customer suspended until ${date.toLocaleString()}` : `Customer blocked`
|
||||
const message = code === 'SUSPENDED' ? `Customer ${customer.phone} suspended until ${date.toLocaleString()}` :
|
||||
code === 'BLOCKED' ? `Customer ${customer.phone} blocked` :
|
||||
`Customer ${customer.phone} has pending compliance`
|
||||
|
||||
return clearOldCustomerSuspendedNotifications(customer.id, deviceId)
|
||||
.then(() => queries.getValidNotifications(COMPLIANCE, detailB))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue