Skip to content

Commit

Permalink
18027 AGM Location change (bcgov#551)
Browse files Browse the repository at this point in the history
* 18027-agm location details 1

* 18027-agm location details 2

* 18027-agm location details 3

* 18027-update package version

* 18027-agm location details 4

* 18027-agm location details 5

* 18027-agm location details 6

* 18027-agm location details 7

* 18027-agm location details 8

* 18027-agm location details 9
  • Loading branch information
ketaki-deodhar authored and JazzarKarim committed Jan 27, 2024
1 parent 3f71127 commit 4ba88d2
Show file tree
Hide file tree
Showing 21 changed files with 504 additions and 531 deletions.
40 changes: 20 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
},
"dependencies": {
"@babel/compat-data": "^7.21.5",
"@bcrs-shared-components/base-address": "2.0.7",
"@bcrs-shared-components/base-address": "2.0.9",
"@bcrs-shared-components/breadcrumb": "2.1.11",
"@bcrs-shared-components/confirm-dialog": "1.2.1",
"@bcrs-shared-components/corp-type-module": "1.0.11",
"@bcrs-shared-components/court-order-poa": "2.1.4",
"@bcrs-shared-components/document-delivery": "1.2.1",
"@bcrs-shared-components/enums": "1.0.50",
"@bcrs-shared-components/enums": "1.0.51",
"@bcrs-shared-components/expandable-help": "^1.0.0",
"@bcrs-shared-components/folio-number-input": "1.1.18",
"@bcrs-shared-components/interfaces": "1.0.75",
"@bcrs-shared-components/mixins": "1.1.25",
"@bcrs-shared-components/interfaces": "1.0.76",
"@bcrs-shared-components/mixins": "1.1.27",
"@bcrs-shared-components/staff-comments": "1.3.11",
"@bcrs-shared-components/staff-payment": "2.1.11",
"@mdi/font": "^5.9.55",
Expand Down
71 changes: 71 additions & 0 deletions src/components/AgmLocationChange/AgmYear.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<template>
<v-text-field
id="year-txt"
ref="textAreaRef"
hide-spin-buttons
type="number"
filled
:label="label"
:rules="rules"
:value="value"
validate-on-blur
@input="emitInput($event)"
/>
</template>

<script lang="ts">
import { Component, Emit, Prop, Vue, Watch } from 'vue-property-decorator'
import { Debounce } from 'vue-debounce-decorator'
@Component({})
export default class AgmYear extends Vue {
// Refs
$refs!: {
textAreaRef: any
}
@Prop({ default: '' }) readonly value!: string
@Prop({ default: 'Year' }) readonly label!: string
@Prop({ default: () => [] }) readonly rules!: any[]
@Prop({ default: false }) readonly validateForm!: boolean
agmYear = ''
/** Called when component is created. */
created (): void {
// inform parent of initial validity
this.emitValid(this.value)
}
@Watch('value')
@Debounce(300)
onValueChanged (val: string): void {
this.emitValid(val)
}
/** Validate business name field */
@Watch('validateForm')
validateAgmYear (): void {
if (this.validateForm && !this.agmYear) {
this.$refs.textAreaRef.validate()
this.$refs.textAreaRef.error = true
}
}
/** Emits an event with the changed input (ie, updated v-model). */
@Emit('input')
// eslint-disable-next-line @typescript-eslint/no-unused-vars
emitInput (val: string): void {}
/** Emits an event indicating whether or not this component is valid. */
@Emit('valid')
emitValid (val: string): boolean {
// component is valid if every rule is valid
return this.rules.every(rule => rule(val) === true)
}
}
</script>
33 changes: 33 additions & 0 deletions src/components/Dashboard/TodoList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,9 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E
if (header) {
switch (header.name) {
case FilingTypes.AGM_LOCATION_CHANGE:
await this.loadAgmLocationChange(task)
break
case FilingTypes.ANNUAL_REPORT:
await this.loadAnnualReport(task)
break
Expand Down Expand Up @@ -1479,6 +1482,36 @@ export default class TodoList extends Mixins(AllowableActionsMixin, DateMixin, E
}
}
async loadAgmLocationChange (task: ApiTaskIF): Promise<void> {
const filing = task.task.filing
const header = filing.header
const agmLocationChange = filing.agmLocationChange
if (header && agmLocationChange) {
const paymentStatusCode = header.paymentStatusCode
const payErrorObj = paymentStatusCode && await PayServices.getPayErrorObj(this.getPayApiUrl, paymentStatusCode)
const item = {
name: FilingTypes.AGM_LOCATION_CHANGE,
filingId: header.filingId,
title: FilingNames.AGM_LOCATION_CHANGE,
draftTitle: FilingNames.AGM_LOCATION_CHANGE,
status: header.status,
enabled: task.enabled,
order: task.order,
paymentMethod: header.paymentMethod || null,
paymentToken: header.paymentToken || null,
payErrorObj,
// FUTURE: ideally, this would come from the filing:
warnings: this.getBusinessWarnings.map(warning => warning.message)
} as TodoItemIF
this.todoItems.push(item)
} else {
// eslint-disable-next-line no-console
console.log('ERROR - invalid header or business in filing =', filing)
}
}
async loadContinuationOut (task: ApiTaskIF): Promise<void> {
const filing = task.task.filing
const header = filing.header
Expand Down
2 changes: 1 addition & 1 deletion src/components/EntityInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class EntityInfo extends Vue {
get isInLocalFilingPage (): boolean {
return (
this.$route?.name === Routes.AGM_EXTENSION ||
this.$route?.name === Routes.AGM_LOCATION_CHG ||
this.$route?.name === Routes.AGM_LOCATION_CHANGE ||
this.$route?.name === Routes.ANNUAL_REPORT ||
this.$route?.name === Routes.CONSENT_CONTINUATION_OUT ||
this.$route?.name === Routes.CONTINUATION_OUT ||
Expand Down
59 changes: 38 additions & 21 deletions src/components/EntityInfo/EntityMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,25 +186,33 @@
</v-tooltip>

<!-- Request AGM Location Change -->
<v-tooltip
right
content-class="right-tooltip"
>
<template #activator="{ on }">
<v-list-item
v-if="enableAgmLocationChg"
id="agm-loc-chg-list-item"
:disabled="!isAllowed(AllowableActions.AGM_LOCATION_CHG)"
v-on="on"
@click="goToAgmLocationChgFiling()"
>
<v-list-item-title>
<span class="app-blue">Request AGM Location Change</span>
</v-list-item-title>
</v-list-item>
</template>
Request an AGM location change.
</v-tooltip>
<div>
<v-tooltip
right
content-class="right-tooltip"
>
<template #activator="{ on }">
<div
v-if="enableAgmLocationChg"
class="d-inline-block"
v-on="on"
>
<v-list-item
id="agm-loc-chg-list-item"
:disabled="!isAllowed(AllowableActions.AGM_LOCATION_CHANGE)"
v-on="on"
@click="goToAgmLocationChgFiling()"
>
<v-list-item-title>
<span class="app-blue">Request AGM Location Change</span>
</v-list-item-title>
</v-list-item>
</div>
</template>
<span>{{ toolTipText }}</span>
</v-tooltip>
</div>

</v-list-item-group>
</v-list>
</v-menu>
Expand Down Expand Up @@ -250,7 +258,16 @@ export default class EntityMenu extends Mixins(AllowableActionsMixin) {
}
get enableAgmLocationChg (): boolean {
return !!GetFeatureFlag('enable-agm-location-chg')
return !!GetFeatureFlag('supported-agm-location-chg-entities').includes(this.getLegalType)
}
/** get tooltip text for AGM location chg list item. Text is different if action item is disabled */
get toolTipText (): string {
if (!this.isAllowed(AllowableActions.AGM_LOCATION_CHANGE)) {
return 'The business must be in good standing to request an AGM location change.'
} else {
return 'Request an AGM location change.'
}
}
/**
Expand Down Expand Up @@ -294,7 +311,7 @@ export default class EntityMenu extends Mixins(AllowableActionsMixin) {
goToAgmLocationChgFiling (): void {
// 0 means "new filing"
this.$router.push({ name: Routes.AGM_LOCATION_CHG, params: { filingId: '0' } })
this.$router.push({ name: Routes.AGM_LOCATION_CHANGE, params: { filingId: '0' } })
}
/** Emits an event to confirm dissolution. */
Expand Down
8 changes: 7 additions & 1 deletion src/components/common/Certify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</template>
</v-checkbox>
<p class="certify-clause signature-date">
<strong>Date:</strong> {{ getCurrentDate }}
<strong>Date:</strong> {{ formattedCurrentDate }}
</p>
<p class="certify-clause">
{{ message }}
Expand All @@ -50,6 +50,7 @@
<script lang="ts">
import { Component, Emit, Prop, Vue, Watch } from 'vue-property-decorator'
import { Getter } from 'pinia-class'
import { DateUtilities } from '@/services'
import { useRootStore } from '@/stores'
@Component({})
Expand Down Expand Up @@ -87,6 +88,11 @@ export default class Certify extends Vue {
this.emitValid(!!this.trimmedCertifiedBy && this.isCertified)
}
get formattedCurrentDate (): string {
const date = DateUtilities.yyyyMmDdToDate(this.getCurrentDate)
return (DateUtilities.dateToPacificDate(date, true) || 'Unknown')
}
/** The trimmed "Certified By" string (may be ''). */
get trimmedCertifiedBy (): string {
// remove repeated inline whitespace, and leading/trailing whitespace
Expand Down
2 changes: 1 addition & 1 deletion src/enums/allowableActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export enum AllowableActions {
ADDRESS_CHANGE = 1, // skip 0 which is falsy
ADMINISTRATIVE_DISSOLUTION,
AGM_EXTENSION,
AGM_LOCATION_CHG,
AGM_LOCATION_CHANGE,
ANNUAL_REPORT,
BUSINESS_INFORMATION,
BUSINESS_SUMMARY,
Expand Down
2 changes: 1 addition & 1 deletion src/enums/routes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export enum Routes {
AGM_EXTENSION = 'agm-extension',
AGM_LOCATION_CHG = 'agm-location-chg',
AGM_LOCATION_CHANGE = 'agm-location-chg',
ANNUAL_REPORT = 'annual-report',
CONSENT_CONTINUATION_OUT = 'consent-continuation-out',
CONTINUATION_OUT = 'continuation-out',
Expand Down
7 changes: 6 additions & 1 deletion src/interfaces/api-filing-interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CorpTypeCd, EffectOfOrderTypes, FilingStatus, FilingSubTypes, FilingTypes } from '@/enums'
import { ApiDateTimeUtc, CommentIF, DocumentIF, FormattedDateTimeGmt, IsoDatePacific, SpecialResolutionIF }
import { AddressIF, ApiDateTimeUtc, CommentIF, DocumentIF, FormattedDateTimeGmt, IsoDatePacific, SpecialResolutionIF }
from '@/interfaces'

/**
Expand Down Expand Up @@ -41,6 +41,11 @@ export interface ApiFilingIF {
freeze: boolean
}

agmLocationChange?: {
year: string,
newAgmLocation: AddressIF
}

// alteration filings only
alteration?: {
fromLegalType?: CorpTypeCd
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/api-task-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface ApiHeaderIF {
* Note that only `business` and `header` are required.
*/
export interface TaskTodoIF {
agmLocationChange?: any
alteration?: AlterationIF
annualReport?: any
business: ApiBusinessIF
Expand Down
5 changes: 2 additions & 3 deletions src/mixins/allowable-actions-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ export default class AllowableActionsMixin extends Vue {
// return this.isAllowedFiling(FilingTypes.AGM_EXTENSION)
}

case AllowableActions.AGM_LOCATION_CHG: {
return true // *** FOR DEBUGGING ONLY
// return this.isAllowedFiling(FilingTypes.AGM_LOCATION_CHG)
case AllowableActions.AGM_LOCATION_CHANGE: {
return this.isAllowedFiling(FilingTypes.AGM_LOCATION_CHANGE)
}

case AllowableActions.BUSINESS_INFORMATION: {
Expand Down
Loading

0 comments on commit 4ba88d2

Please sign in to comment.