From 1d1d858831f643401fec602828c19e5290e37cb6 Mon Sep 17 00:00:00 2001 From: JazzarKarim Date: Thu, 9 May 2024 09:45:57 -0700 Subject: [PATCH 1/3] Removed badge logic from InvoluntaryDissolution view --- .../src/views/auth/staff/InvoluntaryDissolution.vue | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/auth-web/src/views/auth/staff/InvoluntaryDissolution.vue b/auth-web/src/views/auth/staff/InvoluntaryDissolution.vue index 9a4b3de2ee..dd28868c61 100644 --- a/auth-web/src/views/auth/staff/InvoluntaryDissolution.vue +++ b/auth-web/src/views/auth/staff/InvoluntaryDissolution.vue @@ -45,11 +45,8 @@ badgeText="Paused" icon="mdi-calendar-clock" label="Automated Dissolution Schedule" - :showBadge="isOnHold" - /> - + @@ -70,12 +67,9 @@ export default defineComponent({ DissolutionSchedule }, setup () { - const isOnHold = ref(false) const staffStore = useStaffStore() - onMounted(() => { - isOnHold.value = staffStore.isDissolutionBatchOnHold() - }) + onMounted(() => {}) /** * The number of B.C. businesses that are ready for D1 Dissolution. @@ -84,8 +78,7 @@ export default defineComponent({ const businessesReadyforDissolutionNumber = computed(() => 0) return { - businessesReadyforDissolutionNumber, - isOnHold + businessesReadyforDissolutionNumber } } }) From 682b9e8f957e60dc4b4f79fd6baa250fed3224ae Mon Sep 17 00:00:00 2001 From: JazzarKarim Date: Mon, 13 May 2024 11:38:19 -0700 Subject: [PATCH 2/3] 20929 - Implemented GET involuntary dissolution configurations endpoint --- .../auth/staff/DissolutionSchedule.vue | 65 ++++++------------- auth-web/src/models/Staff.ts | 12 +++- auth-web/src/services/staff.services.ts | 6 +- auth-web/src/stores/staff.ts | 37 ++++------- .../auth/staff/InvoluntaryDissolution.vue | 5 +- 5 files changed, 49 insertions(+), 76 deletions(-) diff --git a/auth-web/src/components/auth/staff/DissolutionSchedule.vue b/auth-web/src/components/auth/staff/DissolutionSchedule.vue index f4bc16636d..7b8ed588c1 100644 --- a/auth-web/src/components/auth/staff/DissolutionSchedule.vue +++ b/auth-web/src/components/auth/staff/DissolutionSchedule.vue @@ -16,7 +16,7 @@ > Cancel @@ -103,54 +103,36 @@ import { useStaffStore } from '@/stores/staff' export default defineComponent({ name: 'DissolutionSchedule', - emits: ['update:onHold'], - setup (_, { emit }) { + setup () { const state = reactive({ menu: false, - numberOfBusinesses: 0, + numberOfBusinessesEdit: 0, + numberOfBusinessesNonEdit: 0, numberOfBusinessesRef: null, - isEdit: false, - isOnHold: false + isEdit: false }) const staffStore = useStaffStore() - /** - * Set local properties to values from the store. - * TODO: Update once BE work is done. - */ - onMounted(() => { - state.numberOfBusinesses = staffStore.getDissolutionBatchSize() - state.isOnHold = staffStore.isDissolutionBatchOnHold() - }) + /** Set local properties to values from the store. */ + onMounted(async () => { + // Make the call to get the involuntary dissolution configurations array and set it in store. + await staffStore.getDissolutionConfigurations() - /** - * Update whether the dissolution batch is paused or running. - * Emit the status to the parent to know whether the "Paused" badge is going to be shown. - * TODO: Modify/Update this once the BE is done. - */ - const actionBtnClicked = (): void => { - state.isOnHold = !staffStore.isDissolutionBatchOnHold() - // Emit whether on hold or not to the parent. - emit('update:onHold', state.isOnHold) - staffStore.updateDissolutionBatchOnHold(!staffStore.isDissolutionBatchOnHold()) - } + // Get the batch size current value (number of businesses to be dissolved per job run) + const numDissolutions = staffStore.involuntaryDissolutionConfigurations.configurations.find( + config => config.name === 'NUM_DISSOLUTIONS_ALLOWED').value + state.numberOfBusinessesNonEdit = parseInt(numDissolutions) + }) /** Edit, Cancel, or Save (successful) button is clicked. */ const triggerEditOnOff = (): void => { + // set text field value + state.numberOfBusinessesEdit = state.numberOfBusinessesNonEdit state.isEdit = !state.isEdit // closing the menu state.menu = false } - /** - * Cancel button clicked. - * Revert numberOfBusinesses to store value. Hide the edit components. - */ - const cancelBtnClicked = (): void => { - state.numberOfBusinesses = staffStore.getDissolutionBatchSize() - triggerEditOnOff() - } - /** * Save button is clicked. Update the dissolution batch size. * Only save if the inputted number is valid. @@ -158,7 +140,8 @@ export default defineComponent({ */ const saveBtnClicked = (): void => { if (state.numberOfBusinessesRef.validate()) { - staffStore.updateDissolutionBatchSize(state.numberOfBusinesses) + // staffStore.updateDissolutionBatchSize(state.numberOfBusinesses) + state.numberOfBusinessesNonEdit = state.numberOfBusinessesEdit triggerEditOnOff() } } @@ -173,24 +156,16 @@ export default defineComponent({ ] }) - /** The action button text depending on whether the dissolution job is paused or running. */ - const actionBtnText = computed(() => { - return state.isOnHold ? 'Resume' : 'Pause' - }) - /** * If non-edit, show the number of businesses into D1 from the store. * Otherwise, it'll be reactive to whatever is being typed in the text field. */ const scheduleSummaryNumber = computed(() => { - return state.isEdit ? state.numberOfBusinesses : staffStore.getDissolutionBatchSize() + return state.isEdit ? state.numberOfBusinessesEdit : state.numberOfBusinessesNonEdit }) return { ...toRefs(state), - actionBtnClicked, - actionBtnText, - cancelBtnClicked, dissolutionBatchSizeRules, triggerEditOnOff, saveBtnClicked, diff --git a/auth-web/src/models/Staff.ts b/auth-web/src/models/Staff.ts index dbcd132d05..3226bf2abb 100644 --- a/auth-web/src/models/Staff.ts +++ b/auth-web/src/models/Staff.ts @@ -59,7 +59,13 @@ export interface FilingTypeResponse { items: FilingType[] } -export interface InvoluntaryDissolutionIF { - batchSize: number - onHold: boolean +export interface InvoluntaryDissolutionConfigurationIF { + fullDescription: string + name: string + shortDescription: string + value: string +} + +export interface Configurations { + configurations: InvoluntaryDissolutionConfigurationIF[] } diff --git a/auth-web/src/services/staff.services.ts b/auth-web/src/services/staff.services.ts index 9813aabedd..e4c035f455 100644 --- a/auth-web/src/services/staff.services.ts +++ b/auth-web/src/services/staff.services.ts @@ -1,4 +1,4 @@ -import { AccountType, ProductCode, Products, ProductsRequestBody } from '@/models/Staff' +import { AccountType, Configurations, ProductCode, Products, ProductsRequestBody } from '@/models/Staff' import { OrgFilterParams, OrgList, Organizations } from '@/models/Organization' import { AxiosResponse } from 'axios' import ConfigHelper from '@/util/config-helper' @@ -48,4 +48,8 @@ export default class StaffService { static async getSafeEmails (): Promise> { return axios.get(`${ConfigHelper.getNotifiyAPIUrl()}/safe_list`) } + + static async getInvoluntaryDissolutionConfigurations (): Promise> { + return axios.get(`${ConfigHelper.getLegalAPIV2Url()}/admin/configurations`) + } } diff --git a/auth-web/src/stores/staff.ts b/auth-web/src/stores/staff.ts index 1793af504c..23f387ddba 100644 --- a/auth-web/src/stores/staff.ts +++ b/auth-web/src/stores/staff.ts @@ -1,5 +1,5 @@ import { AccountStatus, AffidavitStatus, TaskAction, TaskRelationshipStatus, TaskRelationshipType, TaskType } from '@/util/constants' -import { AccountType, GLCode, InvoluntaryDissolutionIF, ProductCode } from '@/models/Staff' +import { AccountType, Configurations, GLCode, ProductCode } from '@/models/Staff' import { MembershipType, OrgFilterParams, Organization } from '@/models/Organization' import { SyncAccountPayload, Task } from '@/models/Task' import { computed, reactive, toRefs } from '@vue/composition-api' @@ -25,7 +25,7 @@ export const useStaffStore = defineStore('staff', () => { accountUnderReviewAdminContact: {} as Contact, accountUnderReviewAffidavitInfo: {} as AffidavitInformation, activeStaffOrgs: [] as Organization[], - involuntaryDissolutionBatch: {} as InvoluntaryDissolutionIF, + involuntaryDissolutionConfigurations: {} as Configurations, pendingInvitationOrgs: [] as Organization[], pendingStaffOrgs: [] as Organization[], products: [] as ProductCode[], @@ -42,7 +42,7 @@ export const useStaffStore = defineStore('staff', () => { state.accountUnderReviewAdminContact = {} as Contact state.accountUnderReviewAffidavitInfo = {} as AffidavitInformation state.activeStaffOrgs = [] as Organization[] - state.involuntaryDissolutionBatch = {} as InvoluntaryDissolutionIF + state.involuntaryDissolutionConfigurations = {} as Configurations state.pendingInvitationOrgs = [] as Organization[] state.pendingStaffOrgs = [] as Organization[] state.products = [] as ProductCode[] @@ -80,14 +80,13 @@ export const useStaffStore = defineStore('staff', () => { } } - /** TODO: Implement the call from BE to grab this number. */ - function getDissolutionBatchSize (): number { - return state.involuntaryDissolutionBatch.batchSize || 0 - } - - /** TODO: Implement the call from BE to grab the status. */ - function isDissolutionBatchOnHold (): boolean { - return state.involuntaryDissolutionBatch.onHold || false + /** Get the involuntary dissolution configurations array from Legal API. */ + async function getDissolutionConfigurations (): Promise { + const response = await StaffService.getInvoluntaryDissolutionConfigurations() + if (response?.data && response.status === 200) { + state.involuntaryDissolutionConfigurations = response.data + return response.data + } } async function getAccountTypes (): Promise { @@ -293,14 +292,9 @@ export const useStaffStore = defineStore('staff', () => { } /** TODO: Make the backend call to the number of businesses to be dissolved. */ - function updateDissolutionBatchSize (dissolutionBatchSize: number) { - state.involuntaryDissolutionBatch.batchSize = dissolutionBatchSize - } - - /** TODO: Make the backend call to the number of businesses to be dissolved. */ - function updateDissolutionBatchOnHold (onHold: boolean) { - state.involuntaryDissolutionBatch.onHold = onHold - } + // function updateDissolutionBatchSize (dissolutionBatchSize: number) { + // state.involuntaryDissolutionBatch.batchSize = dissolutionBatchSize + // } return { accountNotaryContact, @@ -308,8 +302,7 @@ export const useStaffStore = defineStore('staff', () => { approveAccountUnderReview, deleteOrg, getAccountTypes, - getDissolutionBatchSize, - isDissolutionBatchOnHold, + getDissolutionConfigurations, getGLCode, getGLCodeList, getGLCodeFiling, @@ -330,8 +323,6 @@ export const useStaffStore = defineStore('staff', () => { syncSuspendedStaffOrgs, syncPendingStaffOrgs, updateGLCodeFiling, - updateDissolutionBatchSize, - updateDissolutionBatchOnHold, $reset } }) diff --git a/auth-web/src/views/auth/staff/InvoluntaryDissolution.vue b/auth-web/src/views/auth/staff/InvoluntaryDissolution.vue index dd28868c61..e9ee7f59ae 100644 --- a/auth-web/src/views/auth/staff/InvoluntaryDissolution.vue +++ b/auth-web/src/views/auth/staff/InvoluntaryDissolution.vue @@ -55,10 +55,9 @@