diff --git a/backend/src/components/applications.js b/backend/src/components/applications.js index 4e80db52..cce657e7 100644 --- a/backend/src/components/applications.js +++ b/backend/src/components/applications.js @@ -38,7 +38,7 @@ function mapSupplementaryApplicationObjectForFront(data) { async function getApplications(req, res) { try { const applications = [] - const operation = `ofm_applications?$select=ofm_application,ofm_summary_ministry_last_updated,ofm_summary_provider_last_updated,ofm_summary_submittedon,statuscode,statecode,_ofm_facility_value&$filter=(${buildFilterQuery( + const operation = `ofm_applications?$select=ofm_application,ofm_summary_ministry_last_updated,ofm_summary_provider_last_updated,ofm_summary_submittedon,statuscode,statecode,ofm_unionized,_ofm_facility_value&$filter=(${buildFilterQuery( req?.query, ApplicationMappings, )})` diff --git a/backend/src/util/mapping/Mappings.js b/backend/src/util/mapping/Mappings.js index 36a8d5f9..48c5e18b 100644 --- a/backend/src/util/mapping/Mappings.js +++ b/backend/src/util/mapping/Mappings.js @@ -28,6 +28,7 @@ const UserProfileFacilityMappings = [ { back: 'ofm_program_start_date', front: 'programStartDate' }, { back: 'statecode', front: 'facilityStateCode' }, { back: 'statuscode', front: 'facilityStatusCode' }, + { back: 'ofm_unionized', front: 'isUnionized' }, ] const RequestCategoryMappings = [ @@ -261,6 +262,7 @@ const FacilityMappings = [ { back: 'ofm_ypp_designation', front: 'yppDesignation' }, { back: 'ofm_ypp_enrolled', front: 'yppEnrolled' }, { back: 'ofm_personal_residence', front: 'personalResidence' }, + { back: 'ofm_unionized', front: 'isUnionized' }, ] const ContactMappings = [ diff --git a/frontend/src/components/messages/NewRequestDialog.vue b/frontend/src/components/messages/NewRequestDialog.vue index 069e134f..2c227269 100644 --- a/frontend/src/components/messages/NewRequestDialog.vue +++ b/frontend/src/components/messages/NewRequestDialog.vue @@ -306,6 +306,7 @@ import { mapState, mapActions } from 'pinia' import { useAuthStore } from '@/stores/auth' import { useAppStore } from '@/stores/app' import { useMessagesStore } from '@/stores/messages' +import { useOrgStore } from '@/stores/org' import AppButton from '@/components/ui/AppButton.vue' import AppDialog from '@/components/ui/AppDialog.vue' import AppLabel from '@/components/ui/AppLabel.vue' @@ -324,7 +325,7 @@ import MessageService from '@/services/messageService' import OrganizationService from '@/services/organizationService' import FundingAgreementService from '@/services/fundingAgreementService' import { ASSISTANCE_REQUEST_STATUS_CODES, CRM_STATE_CODES, OFM_PROGRAM_CODES, PREVENT_CHANGE_REQUEST_TYPES } from '@/utils/constants' -import { REQUEST_CATEGORY_NAMES, REQUEST_SUB_CATEGORY_NAMES, PHONE_FORMAT, EMAIL_FORMAT, VIRUS_SCAN_ERROR_MESSAGE, FUNDING_AGREEMENT_STATUS_CODES } from '@/utils/constants' +import { REQUEST_CATEGORY_NAMES, REQUEST_SUB_CATEGORY_NAMES, PHONE_FORMAT, EMAIL_FORMAT, VIRUS_SCAN_ERROR_MESSAGE, FUNDING_AGREEMENT_STATUS_CODES, PROVIDER_TYPE_CODES } from '@/utils/constants' export default { name: 'NewRequestDialog', @@ -396,6 +397,7 @@ export default { computed: { ...mapState(useAppStore, ['requestCategories', 'requestSubCategories', 'getRequestCategoryIdByName', 'getRequestSubCategoryIdByName']), ...mapState(useAuthStore, ['currentFacility', 'userInfo']), + ...mapState(useOrgStore, ['currentOrg']), permittedRequestCategories() { let categories = [...this.requestCategories] @@ -502,7 +504,11 @@ export default { }, filteredFacilties() { if (this.isIrregularExpenseRequest) { - return this.facilities.filter((fac) => this.fundingAgreements.some((app) => app?.facilityId === fac?.facilityId)) + //family org can never apply for irregular expense + if (this.currentOrg?.providerType === PROVIDER_TYPE_CODES.FAMILY) { + return [] + } + return this.facilities.filter((fac) => this.fundingAgreements.some((app) => app?.facilityId === fac?.facilityId) && fac?.isUnionized === 0) } return this.facilities }, @@ -550,6 +556,9 @@ export default { if (this.isIrregularExpenseRequest && !this.fundingAgreements) { this.isLoading = true await this.getFundingAgreements() + if (!this.currentOrg) { + await this.getOrganizationInfo(this.userInfo?.organizationId) + } this.isLoading = false } this.resetModelData(this.isAccountMaintenanceRequest) @@ -587,6 +596,7 @@ export default { }, methods: { ...mapActions(useMessagesStore, ['addNewAssistanceRequestToStore', 'updateAssistanceRequestInStore']), + ...mapActions(useOrgStore, ['getOrganizationInfo']), //this function runs to check if the selected facility is able to submit certain kinds of assitance requests. //it is only available to Account Managers and should only be called if the correct checkbox(es) are selected diff --git a/frontend/src/components/supp-allowances/IndigenousProgrammingAllowance.vue b/frontend/src/components/supp-allowances/IndigenousProgrammingAllowance.vue index 646dda6a..42ed2bad 100644 --- a/frontend/src/components/supp-allowances/IndigenousProgrammingAllowance.vue +++ b/frontend/src/components/supp-allowances/IndigenousProgrammingAllowance.vue @@ -1,5 +1,5 @@