Skip to content

Commit

Permalink
product approve call for gvn account
Browse files Browse the repository at this point in the history
  • Loading branch information
shabeeb-aot committed Jan 6, 2022
1 parent 4570124 commit f057868
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
20 changes: 17 additions & 3 deletions auth-web/src/store/modules/staff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,20 @@ export default class StaffModule extends VuexModule {
@Action({ rawError: true })
public async syncAccountAffidavit (task: Task): Promise<void> {
const taskUserGuid = task?.user?.keycloakGuid
const status = task.relationshipStatus === TaskRelationshipStatus.PENDING_STAFF_REVIEW ? AffidavitStatus.PENDING : task.relationshipStatus
let status = task.relationshipStatus

switch (task.relationshipStatus) {
case TaskRelationshipStatus.PENDING_STAFF_REVIEW:
status = AffidavitStatus.PENDING
break
case TaskRelationshipStatus.REJECTED:
status = AffidavitStatus.REJECTED
break
default:
status = AffidavitStatus.APPROVED
break
}

const affidavitResponse = await UserService.getAffidavitInfo(taskUserGuid, status)
if (affidavitResponse?.data && affidavitResponse?.status === 200) {
this.context.commit('setAccountUnderReviewAffidavitInfo', affidavitResponse.data)
Expand All @@ -204,8 +217,9 @@ export default class StaffModule extends VuexModule {
@Action({ rawError: true })
public async approveAccountUnderReview (task:Task) {
if (task) {
await TaskService.approvePendingTask(task)
await this.context.dispatch('syncTaskUnderReview', task)
const response = await TaskService.approvePendingTask(task)
const newTask = response.data || task
await this.context.dispatch('syncTaskUnderReview', newTask)
}
}

Expand Down
3 changes: 2 additions & 1 deletion auth-web/src/views/auth/staff/ReviewAccountView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ export default class ReviewAccountView extends Vue {
// both reject and hold will happen here passing second argument to determine which call need to make
await this.rejectorOnHoldAccountUnderReview({ task: this.task, isRejecting, remarks: onholdReasons })
}
const taskType: TaskType = TaskType[this.task.type]
const taskType: any = this.task.type
if ([TaskType.GOVM_REVIEW, TaskType.GOVN_REVIEW].includes(taskType)) {
await this.createAccountFees(this.task.relationshipId)
}
Expand Down

0 comments on commit f057868

Please sign in to comment.