Skip to content

Commit

Permalink
17327 & 17856 - Add in overdue to the transactions table & fix status…
Browse files Browse the repository at this point in the history
… for Online Banking (#2578)

* Add in overdue to the transactions table.

* minor cleanup

* Fix missing description.

* UX fixes

* small ux tweaks
  • Loading branch information
seeker25 authored Sep 29, 2023
1 parent 8c247f5 commit 1db921a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 9 deletions.
4 changes: 2 additions & 2 deletions auth-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auth-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auth-web",
"version": "2.4.29",
"version": "2.4.30",
"appName": "Auth Web",
"sbcName": "SBC Common Components",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@
>
mdi-check
</v-icon>
<v-icon
v-if="InvoiceStatus.OVERDUE === item.statusCode"
color="error"
:style="{ 'margin-right': '2px' }"
>
mdi-alert
</v-icon>
<b>{{ invoiceStatusDisplay[item.statusCode] }}</b>
<br>
<span
Expand All @@ -116,15 +123,16 @@
/>
</v-col>
<v-col
class="pl-2"
class="pl-1"
align-self="center"
>
<icon-tooltip
v-if="[InvoiceStatus.REFUND_REQUESTED, InvoiceStatus.REFUNDED].includes(item.statusCode)"
v-if="[InvoiceStatus.OVERDUE, InvoiceStatus.REFUND_REQUESTED, InvoiceStatus.REFUNDED].includes(item.statusCode)"
icon="mdi-information-outline"
maxWidth="300px"
:location="{top: true}"
>
<div v-html="getRefundHelpText(item)" />
<div v-sanitize="getHelpText(item)" />
</icon-tooltip>
</v-col>
</v-row>
Expand Down Expand Up @@ -196,6 +204,7 @@ export default defineComponent({
const statusCodeDescs = [
{ description: 'Transaction is cancelled', value: invoiceStatusDisplay[InvoiceStatus.CANCELLED].toUpperCase() },
{ description: 'Funds received', value: invoiceStatusDisplay[InvoiceStatus.PAID].toUpperCase() },
{ description: 'Transaction created', value: invoiceStatusDisplay[InvoiceStatus.CREATED].toUpperCase() },
{ description: 'Funds have been credited', value: invoiceStatusDisplay[InvoiceStatus.CREDITED].toUpperCase() },
{ description: 'Transaction is waiting to be processed', value: invoiceStatusDisplay[InvoiceStatus.PENDING].toUpperCase() },
{ description: 'Transaction is in progress', value: invoiceStatusDisplay[InvoiceStatus.APPROVED].toUpperCase() },
Expand All @@ -205,13 +214,16 @@ export default defineComponent({
const getStatusCodeHelpText = () => statusCodeDescs.reduce((text, statusCode) => {
return `${text}<div class="mt-1">${statusCode.value} - ${statusCode.description}</div>`
}, '')
const getRefundHelpText = (item: Transaction) => {
const getHelpText = (item: Transaction) => {
if (item?.statusCode === InvoiceStatus.REFUND_REQUESTED) {
return 'We are processing your refund request.<br/>It may take up to 7 business days to refund your total amount.'
}
if (item?.statusCode === InvoiceStatus.REFUNDED) {
return '$' + (item?.total?.toFixed(2) || '') + ' has been refunded to the account used for this transaction.'
}
if (item?.statusCode === InvoiceStatus.OVERDUE) {
return 'Your monthly statement is overdue.<br/>Please make your payment as soon as possible.'
}
return ''
}
Expand Down Expand Up @@ -245,7 +257,7 @@ export default defineComponent({
invoiceStatusDisplay,
showDatePicker,
statusCodeDescs,
getRefundHelpText,
getHelpText,
getStatusCodeHelpText,
tableDataOptions,
transactions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const invoiceStatusDisplay = {
[InvoiceStatus.CREDITED]: 'Credited',
[InvoiceStatus.DELETED]: 'Deleted',
[InvoiceStatus.DELETE_ACCEPTED]: 'Deleted',
[InvoiceStatus.OVERDUE]: 'Overdue',
[InvoiceStatus.PAID]: 'Completed',
[InvoiceStatus.PARTIAL]: 'Partial Paid',
[InvoiceStatus.PENDING]: 'Pending',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,14 @@ export const TransactionTableHeaders: BaseTableHeaderI[] = [
type: 'select',
value: ''
},
itemFn: (val: Transaction) => invoiceStatusDisplay[val.statusCode],
itemFn: (val: Transaction) => {
// Special case for Online Banking - it shouldn't show NSF, should show Pending.
if (val.paymentMethod === PaymentTypes.ONLINE_BANKING &&
val.statusCode === InvoiceStatus.SETTLEMENT_SCHEDULED) {
return invoiceStatusDisplay[InvoiceStatus.PENDING]
}
return invoiceStatusDisplay[val.statusCode]
},
hasFilter: true,
minWidth: '195px',
value: 'Payment Status'
Expand Down
1 change: 1 addition & 0 deletions auth-web/src/util/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export enum InvoiceStatus {
COMPLETED = 'COMPLETED', // NOTE: this === PAID value (api alters it from PAID to COMPLETED in postdump)
DELETE_ACCEPTED = 'DELETE_ACCEPTED',
DELETED = 'DELETED',
OVERDUE = 'OVERDUE',
PAID = 'PAID',
PARTIAL = 'PARTIAL_PAID',
PENDING = 'PENDING',
Expand Down

0 comments on commit 1db921a

Please sign in to comment.