Skip to content

Commit

Permalink
Merge pull request #355 from bcgov/ofmcc-5295-operating-cost-update
Browse files Browse the repository at this point in the history
OFMCC-5295 - Update Application's Operating Cost
  • Loading branch information
vietle-cgi authored Sep 11, 2024
2 parents f8c0827 + 837ff6f commit 9187c10
Show file tree
Hide file tree
Showing 11 changed files with 321 additions and 198 deletions.
3 changes: 3 additions & 0 deletions backend/src/util/mapping/Mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ const ApplicationMappings = [
{ back: 'ofm_gt_2mliability_insurance_coverage', front: 'liabilityInsuranceCoverage' },
{ back: 'ofm_economic_analysis_participation', front: 'economicAnalysisParticipation' },
{ back: 'ofm_operate_separate_bank_account', front: 'operateSeparateBankAccount' },
{ back: 'ofm_month_to_month', front: 'monthToMonthRentLease' },
{ back: 'ofm_costs_lease_start_date', front: 'rentLeaseStartDate' },
{ back: 'ofm_costs_lease_end_date', front: 'rentLeaseEndDate' },
]

const ApplicationProviderEmployeeMappings = [
Expand Down
103 changes: 103 additions & 0 deletions frontend/src/components/applications/RentLeaseInformation.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<template>
<v-card class="my-4 px-6 pt-4 pb-6">
<h4>Rent/Lease Information</h4>
<p class="mt-2 mb-4">Please select the start and end date of your facility's rental or lease agreement.</p>
<v-card variant="outlined" class="pa-2">
<v-row no-gutters class="px-2">
<AppLabel class="pt-8">Rent/Lease Date Range:</AppLabel>
<v-row no-gutters class="mt-4">
<AppDateInput
id="start-date"
v-model="model.rentLeaseStartDate"
:rules="isMonthToMonthRentLease ? [] : [...rules.required, rules.MMDDYYYY]"
:disabled="readonly"
:hide-details="readonly || isMonthToMonthRentLease"
label="Start"
class="mx-3" />
<AppDateInput
id="end-date"
v-model="model.rentLeaseEndDate"
:rules="isMonthToMonthRentLease ? [] : [...rules.required, rules.MMDDYYYY, rules.validEndDate(model.rentLeaseStartDate)]"
:disabled="readonly"
:hide-details="readonly || isMonthToMonthRentLease"
label="End"
class="mx-3 mt-4 mt-sm-0" />
</v-row>
</v-row>
<v-checkbox
id="month-to-month-rent"
v-model="model.monthToMonthRentLease"
color="primary"
:true-value="YES_NO_CRM_MAPPING.YES"
:false-value="YES_NO_CRM_MAPPING.NO"
:disabled="readonly"
hide-details
class="mt-6">
<template #label>My facility's rent/lease is on a month-to-month basis.</template>
</v-checkbox>
<div id="arm-length" class="d-flex mt-2">
<v-checkbox v-model="model.armsLength" color="primary" :true-value="YES_NO_CHOICE_CRM_MAPPING.YES" :rules="rules.required" :disabled="readonly" :hide-details="readonly">
<template #label>I attest that the rent/lease agreement is at Arm's Length.</template>
</v-checkbox>
<v-tooltip content-class="tooltip" max-width="300px" text="Third-parties dealing with each other at arm's length are independent and unrelated to each other.">
<template #activator="{ props }">
<v-icon size="large" v-bind="props" class="ml-2 pt-7">mdi-information-slab-circle-outline</v-icon>
</template>
</v-tooltip>
</div>
</v-card>
</v-card>
</template>

<script>
import AppDateInput from '@/components/ui/AppDateInput.vue'
import AppLabel from '@/components/ui/AppLabel.vue'
import { useApplicationsStore } from '@/stores/applications'
import { mapState } from 'pinia'
import rules from '@/utils/rules'
import { YES_NO_CHOICE_CRM_MAPPING, YES_NO_CRM_MAPPING } from '@/utils/constants'
export default {
components: { AppDateInput, AppLabel },
props: {
readonly: {
type: Boolean,
default: false,
},
},
emits: ['update'],
data() {
return {
model: {},
}
},
computed: {
...mapState(useApplicationsStore, ['currentApplication']),
isMonthToMonthRentLease() {
return this.model.monthToMonthRentLease === YES_NO_CRM_MAPPING.YES
},
},
watch: {
model: {
handler() {
this.model.rentLeaseStartDate = this.model.rentLeaseStartDate ? this.model.rentLeaseStartDate : null
this.model.rentLeaseEndDate = this.model.rentLeaseEndDate && this.model.rentLeaseEndDate > this.model.rentLeaseStartDate ? this.model.rentLeaseEndDate : null
this.model.armsLength = this.model.armsLength ? this.model.armsLength : null
this.$emit('update', this.model)
},
deep: true,
},
},
created() {
this.rules = rules
this.YES_NO_CHOICE_CRM_MAPPING = YES_NO_CHOICE_CRM_MAPPING
this.YES_NO_CRM_MAPPING = YES_NO_CRM_MAPPING
this.model = {
rentLeaseStartDate: this.currentApplication?.rentLeaseStartDate,
rentLeaseEndDate: this.currentApplication?.rentLeaseEndDate,
monthToMonthRentLease: this.currentApplication?.monthToMonthRentLease,
armsLength: this.currentApplication?.armsLength,
}
},
}
</script>
42 changes: 21 additions & 21 deletions frontend/src/components/applications/YearlyFacilityCost.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<template>
<v-container fluid class="pa-0 my-8">
<AppLabel>Yearly Facility Cost</AppLabel>
<h4>Yearly Facility Cost</h4>
<v-card class="my-2" variant="outlined">
<!-- RENT/LEASE -->
<v-row v-if="facilityType === FACILITY_TYPES.RENT_LEASE" no-gutters class="pt-4">
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>Rent/Lease</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.rentLeaseCost" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
Expand All @@ -20,30 +20,30 @@
<v-row v-if="facilityType === FACILITY_TYPES.OWNED_WITH_MORTGAGE" no-gutters class="mt-2 pt-2">
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>Mortgage</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.mortgageCost" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
</v-col>
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>Property/Municipal Tax</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.propertyTax" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
</v-col>
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>Strata Fees</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.strataFee" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
Expand All @@ -54,20 +54,20 @@
<v-row v-if="facilityType === FACILITY_TYPES.OWNED_WITHOUT_MORTGAGE" no-gutters class="mt-2 pt-2">
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>Property/Municipal Tax</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.propertyTax" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
</v-col>
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>Strata Fees</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.strataFee" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
Expand All @@ -78,30 +78,30 @@
<v-row v-if="facilityType === FACILITY_TYPES.PROVIDED_FREE_OF_CHARGE" no-gutters class="mt-2 pt-2">
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>Fee (If Applicable)</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.applicableFee" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
</v-col>
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>Property/Municipal Tax</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.propertyTax" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
</v-col>
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>Strata Fees</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.strataFee" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
Expand All @@ -111,10 +111,10 @@
<v-row no-gutters class="mt-2">
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<AppLabel>Total Yearly Costs</AppLabel>
</v-col>
<v-col cols="6" xl="7" class="pl-6">
<v-col cols="12" sm="5" class="pl-sm-6">
<AppNumberInput :value="totalYearlyCost" :format="totalNumberFormat" variant="plain" readonly class="totalYearlyCost"></AppNumberInput>
</v-col>
</v-row>
Expand Down
68 changes: 34 additions & 34 deletions frontend/src/components/applications/YearlyOperatingCost.vue
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
<template>
<v-container fluid class="pa-0">
<AppLabel>Yearly Operating Cost</AppLabel>
<h4>Yearly Operating Cost</h4>
<v-card class="my-2" variant="outlined">
<v-row no-gutters class="mt-2 pt-2">
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>
Insurance
<v-tooltip content-class="tooltip" text="Costs directly related to labour costs, property insurance, utilities and garbage disposal." max-width="300px">
<template v-slot:activator="{ props }">
Maintenance and Minor Repairs
<v-tooltip content-class="tooltip" text="Costs directly related to third-party labour costs, property insurance, utilities and garbage disposal." max-width="300px">
<template #activator="{ props }">
<v-icon size="large" v-bind="props">mdi-information-slab-circle-outline</v-icon>
</template>
</v-tooltip>
</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.insuranceCost" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
</v-col>
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>
Upkeep and Labour
Upkeep
<v-tooltip content-class="tooltip" text="Costs may include garbage removal, recycling charges, applicable supplies." max-width="300px">
<template v-slot:activator="{ props }">
<template #activator="{ props }">
<v-icon size="large" v-bind="props">mdi-information-slab-circle-outline</v-icon>
</template>
</v-tooltip>
</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.upkeepLabourCost" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
Expand All @@ -41,34 +41,34 @@
<v-row no-gutters class="mt-2">
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>
Utilities
<v-tooltip content-class="tooltip" text="Costs may include gas, electricity, water, phone, internet." max-width="300px">
<template v-slot:activator="{ props }">
Office Furniture and Equipment
<v-tooltip content-class="tooltip" text="Costs may include laptops, tablets, cell phones used for the operation of the business, desks, chairs, tables." max-width="300px">
<template #activator="{ props }">
<v-icon size="large" v-bind="props">mdi-information-slab-circle-outline</v-icon>
</template>
</v-tooltip>
</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<AppNumberInput v-model.lazy="model.utilitiesCost" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.furnitureEquipmentsCost" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
</v-col>
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>
Maintenance and Repairs
Facility Maintenance and Minor Improvements
<v-tooltip content-class="tooltip" text="Costs may include repairs, appliance/furniture replacement, snow removal." max-width="300px">
<template v-slot:activator="{ props }">
<template #activator="{ props }">
<v-icon size="large" v-bind="props">mdi-information-slab-circle-outline</v-icon>
</template>
</v-tooltip>
</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.maintenanceRepairsCost" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
Expand All @@ -77,46 +77,46 @@
<v-row no-gutters class="mt-2">
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>
Furniture and Equipment
<v-tooltip content-class="tooltip" text="Costs may include laptops, tablets, cell phones used for the operation of the business, desks, chairs, tables." max-width="300px">
<template v-slot:activator="{ props }">
Janitorial Services
<v-tooltip content-class="tooltip" text="Provided by arm's length third party." max-width="300px">
<template #activator="{ props }">
<v-icon size="large" v-bind="props">mdi-information-slab-circle-outline</v-icon>
</template>
</v-tooltip>
</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<AppNumberInput v-model.lazy="model.furnitureEquipmentsCost" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.suppliesCost" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
</v-col>
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<p>
Supplies
<v-tooltip content-class="tooltip" text="Provided by arm’s length third party." max-width="300px">
<template v-slot:activator="{ props }">
Utilities
<v-tooltip content-class="tooltip" text="Costs may include gas, electricity, water, phone, internet." max-width="300px">
<template #activator="{ props }">
<v-icon size="large" v-bind="props">mdi-information-slab-circle-outline</v-icon>
</template>
</v-tooltip>
</p>
</v-col>
<v-col cols="6" xl="7" align="center" class="px-2">
<AppNumberInput v-model.lazy="model.suppliesCost" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
<v-col cols="12" sm="5" align="center" class="px-sm-2">
<AppNumberInput v-model.lazy="model.utilitiesCost" :format="fieldNumberFormat" :disabled="readonly" prefix="$" maxlength="12" :rules="[rules.max(5000000)]"></AppNumberInput>
</v-col>
</v-row>
</v-col>
</v-row>
<v-row no-gutters class="mt-2">
<v-col cols="12" lg="6" class="px-4">
<v-row no-gutters>
<v-col cols="6" xl="5" class="pt-2">
<v-col cols="12" sm="7" class="pt-2">
<AppLabel>Total Yearly Costs</AppLabel>
</v-col>
<v-col cols="6" xl="7" class="pl-6">
<v-col cols="12" sm="5" class="pl-sm-6">
<AppNumberInput :value="totalYearlyCost" :format="totalNumberFormat" variant="plain" readonly class="totalYearlyCost"></AppNumberInput>
</v-col>
</v-row>
Expand Down
Loading

0 comments on commit 9187c10

Please sign in to comment.