feat: add rejected status to the customers list
This commit is contained in:
parent
2a3e954484
commit
4ec4ec4917
1 changed files with 21 additions and 0 deletions
|
|
@ -100,12 +100,33 @@ const getAuthorizedStatus = (it, triggers, customRequests) => {
|
||||||
return false
|
return false
|
||||||
}, fields)
|
}, fields)
|
||||||
|
|
||||||
|
const rejectedFieldStatus = R.map(ite => {
|
||||||
|
if (isManualField(ite)) {
|
||||||
|
if (uuid.validate(ite)) {
|
||||||
|
const request = R.find(
|
||||||
|
iter => iter.infoRequestId === ite,
|
||||||
|
it.customInfoRequests
|
||||||
|
)
|
||||||
|
return !R.isNil(request) && R.equals(request.override, 'blocked')
|
||||||
|
}
|
||||||
|
|
||||||
|
const regularFieldValue = R.includes(ite, fieldsWithPathSuffix)
|
||||||
|
? it[`${ite}Path`]
|
||||||
|
: it[`${ite}`]
|
||||||
|
if (R.isNil(regularFieldValue)) return false
|
||||||
|
return R.equals(it[`${ite}Override`], 'blocked')
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}, fields)
|
||||||
|
|
||||||
if (it.authorizedOverride === CUSTOMER_BLOCKED)
|
if (it.authorizedOverride === CUSTOMER_BLOCKED)
|
||||||
return { label: 'Blocked', type: 'error' }
|
return { label: 'Blocked', type: 'error' }
|
||||||
if (it.isSuspended)
|
if (it.isSuspended)
|
||||||
return it.daysSuspended > 0
|
return it.daysSuspended > 0
|
||||||
? { label: `${it.daysSuspended} day suspension`, type: 'warning' }
|
? { label: `${it.daysSuspended} day suspension`, type: 'warning' }
|
||||||
: { label: `< 1 day suspension`, type: 'warning' }
|
: { label: `< 1 day suspension`, type: 'warning' }
|
||||||
|
if (R.any(ite => ite === true, rejectedFieldStatus))
|
||||||
|
return { label: 'Rejected', type: 'error' }
|
||||||
if (R.any(ite => ite === true, pendingFieldStatus))
|
if (R.any(ite => ite === true, pendingFieldStatus))
|
||||||
return { label: 'Pending', type: 'warning' }
|
return { label: 'Pending', type: 'warning' }
|
||||||
return { label: 'Authorized', type: 'success' }
|
return { label: 'Authorized', type: 'success' }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue