-
Notifications
You must be signed in to change notification settings - Fork 69
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
24576 - Updates to NSF messaging #3207
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a495569
Updates to NSF
rodrigo-barraza e40ce2e
Updating unit test
rodrigo-barraza ed6f4ab
Updating unit test
rodrigo-barraza 220b65a
Unit test update
rodrigo-barraza 41fba79
grabbing suspension reason from NSF endpoint instead
rodrigo-barraza 69035c0
Cleaning up date type
rodrigo-barraza bf4cbdd
Small typo fix
rodrigo-barraza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
large | ||
class="mt-2" | ||
> | ||
mdi-alert-circle-outline | ||
mdi-alert | ||
</v-icon> | ||
<div | ||
v-if="isSuspendedForNSF" | ||
|
@@ -21,7 +21,7 @@ | |
Account Suspended | ||
</div> | ||
<div> | ||
Account has been suspended for {{ accountSuspendReason }}. | ||
This acount has been suspended. Returned system error message: {{ reason }}. | ||
</div> | ||
<div class="mt-6 title font-weight-bold"> | ||
BALANCE DUE: ${{ totalAmountToPay.toFixed(2) }} | ||
|
@@ -38,7 +38,7 @@ | |
class="d-flex flex-column ml-7" | ||
> | ||
<div class="title font-weight-bold"> | ||
Account Suspended ({{ suspendedReason() }}) | ||
Account Suspended ({{ suspendedReason }}) | ||
</div> | ||
<div class="d-flex"> | ||
<span>Date Suspended: {{ suspendedDate }}<span class="vertical-line" /> Suspended by: {{ suspendedBy }}</span> | ||
|
@@ -50,60 +50,49 @@ | |
</template> | ||
|
||
<script lang="ts"> | ||
import { AccountStatus, SuspensionReasonCode } from '@/util/constants' | ||
import { Action, State } from 'pinia-class' | ||
import { Component, Vue } from 'vue-property-decorator' | ||
import { Code } from '@/models/Code' | ||
import { computed, defineComponent, onMounted, reactive, toRefs } from '@vue/composition-api' | ||
import { AccountStatus } from '@/util/constants' | ||
import CommonUtils from '@/util/common-util' | ||
import { FailedInvoice } from '@/models/invoice' | ||
import { Organization } from '@/models/Organization' | ||
import { useCodesStore } from '@/stores/codes' | ||
import { useOrgStore } from '@/stores/org' | ||
|
||
@Component | ||
export default class AccountSuspendAlert extends Vue { | ||
@Action(useOrgStore) private calculateFailedInvoices!: () => FailedInvoice | ||
@State(useOrgStore) private currentOrganization!: Organization | ||
@State(useCodesStore) private suspensionReasonCodes!: Code[] | ||
private formatDate = CommonUtils.formatDisplayDate | ||
export default defineComponent({ | ||
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. Thank you looks good |
||
name: 'AccountSuspendAlert', | ||
setup () { | ||
const orgStore = useOrgStore() | ||
const codesStore = useCodesStore() | ||
const currentOrganization = computed(() => orgStore.currentOrganization) | ||
|
||
totalTransactionAmount = 0 | ||
totalAmountToPay = 0 | ||
totalPaidAmount = 0 | ||
const state = reactive({ | ||
totalTransactionAmount: 0, | ||
totalAmountToPay: 0, | ||
totalPaidAmount: 0, | ||
reason: '', | ||
suspendedDate: currentOrganization.value?.suspendedOn | ||
? CommonUtils.formatDateToHumanReadable(currentOrganization.value.suspendedOn) : '', | ||
isSuspendedForNSF: computed(() => currentOrganization.value?.statusCode === AccountStatus.NSF_SUSPENDED), | ||
suspendedBy: computed(() => currentOrganization.value?.decisionMadeBy), | ||
suspendedReason: computed(() => { | ||
return codesStore.suspensionReasonCodes?.find( | ||
suspensionReasonCode => suspensionReasonCode?.code === currentOrganization.value?.suspensionReasonCode | ||
)?.desc | ||
}) | ||
}) | ||
|
||
get suspendedDate () { | ||
return (this.currentOrganization?.suspendedOn) | ||
? this.formatDate(new Date(this.currentOrganization.suspendedOn)) : '' | ||
} | ||
|
||
get isSuspendedForNSF (): boolean { | ||
return this.currentOrganization?.statusCode === AccountStatus.NSF_SUSPENDED | ||
} | ||
|
||
get suspendedBy (): string { | ||
return this.currentOrganization?.decisionMadeBy | ||
} | ||
|
||
get accountSuspendReason (): string { | ||
if (this.currentOrganization?.suspensionReasonCode === SuspensionReasonCode.OVERDUE_EFT) { | ||
return 'overdue EFT payments' | ||
} | ||
return 'outstanding balance (NSF)' | ||
} | ||
|
||
suspendedReason (): string { | ||
return this.suspensionReasonCodes?.find(suspensionReasonCode => | ||
suspensionReasonCode?.code === this.currentOrganization?.suspensionReasonCode)?.desc | ||
} | ||
|
||
async mounted () { | ||
if (this.isSuspendedForNSF) { | ||
const failedInvoices: FailedInvoice = await this.calculateFailedInvoices() | ||
this.totalTransactionAmount = failedInvoices.totalTransactionAmount || 0 | ||
this.totalAmountToPay = failedInvoices.totalAmountToPay || 0 | ||
onMounted(async () => { | ||
if (state.isSuspendedForNSF) { | ||
const failedInvoices: FailedInvoice = await orgStore.calculateFailedInvoices() | ||
state.totalTransactionAmount = failedInvoices.totalTransactionAmount || 0 | ||
state.totalAmountToPay = failedInvoices.totalAmountToPay || 0 | ||
state.reason = failedInvoices.reason || '' | ||
} | ||
}) | ||
return { | ||
...toRefs(state) | ||
} | ||
} | ||
} | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,16 +85,9 @@ | |
{{ currentOrganization.name }} | ||
</h1> | ||
<p | ||
v-if="isPremiumAccount" | ||
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. Aye good stuff |
||
class="mt-3 mb-0" | ||
> | ||
Manage account information, and view account activity. | ||
</p> | ||
<p | ||
v-else | ||
class="mt-3 mb-0" | ||
> | ||
Manage account information, team members, and authentication settings. | ||
Manage account settings, team members, and view transactions for this account | ||
</p> | ||
</div> | ||
|
||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
acount