Skip to content
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

18769 - EFT switching logic fix #3002

Merged
merged 5 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 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.6.85",
"version": "2.6.86",
"appName": "Auth Web",
"sbcName": "SBC Common Components",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,14 @@

<script lang="ts">
import { AccessType, Account, LoginSource, Pages, PaymentTypes, Permission, Role } from '@/util/constants'
import { CreateRequestBody, OrgPaymentDetails, PADInfo, PADInfoValidation } from '@/models/Organization'
import {
CreateRequestBody, Member, MembershipType, OrgPaymentDetails, Organization, PADInfo, PADInfoValidation
} from '@/models/Organization'
import { computed, defineComponent, onMounted, reactive, ref, toRefs, watch } from '@vue/composition-api'
import { BcolProfile } from '@/models/bcol'
import ModalDialog from '@/components/auth/common/ModalDialog.vue'
import PaymentMethods from '@/components/auth/common/PaymentMethods.vue'
import { StatementNotificationSettings } from '@/models/statement'
import { useAccount } from '@/composables/account-factory'
import { useOrgStore } from '@/stores/org'
import { useUserStore } from '@/stores/user'
Expand Down Expand Up @@ -146,7 +149,9 @@ export default defineComponent({
ejvValid: false,
paymentMethodChanged: props.hasPaymentChanged,
isFuturePaymentMethodAvailable: false, // set true if in between 3 days cooling period
isTOSandAcknowledgeCompleted: false // set true if TOS already accepted
isTOSandAcknowledgeCompleted: false, // set true if TOS already accepted
activeOrgMembers: computed<Member[]>(() => orgStore.activeOrgMembers),
currentOrganization: computed<Organization>(() => orgStore.currentOrganization)
})
const errorDialog = ref<InstanceType<typeof ModalDialog>>()
Expand Down Expand Up @@ -331,6 +336,7 @@ export default defineComponent({
state.isLoading = true
const { isValid, createRequestBody } = await getCreateRequestBody()
const selectedPaymentMethod = state.selectedPaymentMethod
if (isValid) {
try {
Expand All @@ -339,7 +345,27 @@ export default defineComponent({
state.isLoading = false
state.paymentMethodChanged = false
initialize()
orgStore.setCurrentOrganizationPaymentType(state.selectedPaymentMethod)
orgStore.setCurrentOrganizationPaymentType(selectedPaymentMethod)
if (selectedPaymentMethod === PaymentTypes.EFT) {
const recipientList = []
await orgStore.syncActiveOrgMembers()
state.activeOrgMembers.forEach((member) => {
if (member.membershipTypeCode !== MembershipType.User) {
recipientList.push({
authUserId: member.user?.id,
firstname: member.user?.firstname,
lastname: member.user?.lastname,
email: member.user?.contacts[0]?.email
})
}
})
const statementNotification: StatementNotificationSettings = {
statementNotificationEnabled: true,
recipients: recipientList,
accountName: state.currentOrganization.name
}
await orgStore.updateStatementNotifications(statementNotification)
}
} catch (error) {
console.error(error)
state.isLoading = false
Expand Down
Loading