Skip to content

Commit

Permalink
Merge pull request #129 from ArwenQin/24655-Ledger-For-Withdrawn-Fili…
Browse files Browse the repository at this point in the history
…ng-and-NoW

24655 - Ledger for Withdrawn Filing and NoW
  • Loading branch information
severinbeauvais authored Jan 28, 2025
2 parents 8040ca0 + 143d27f commit f3003c0
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "bcros-business-dashboard",
"private": true,
"type": "module",
"version": "1.0.10",
"version": "1.0.11",
"scripts": {
"build": "nuxt generate",
"build:local": "nuxt build",
Expand Down
2 changes: 2 additions & 0 deletions src/components/bcros/filing/CommonTemplate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<slot name="subtitle">
<!-- fixme: naming is bit confusing, as status paid leads to PAID AND PENDING message on the UI -->
<BcrosFilingCommonFiledAndPendingPaid v-if="isStatusPaid" :filing="filing" />
<BcrosFilingCommonFiledAndWithdrawn v-else-if="isStatusWithdrawn" :filing="filing" />
<BcrosFilingCommonFiledAndPaid v-else :filing="filing" />
</slot>
</div>
Expand Down Expand Up @@ -110,6 +111,7 @@ if (filing.value.commentsCount && filing.value.commentsLink) {
const isStatusPaid = computed(() => isFilingStatus(filing.value, FilingStatusE.PAID))
const isStatusApproved = computed(() => isFilingStatus(filing.value, FilingStatusE.APPROVED))
const isStatusWithdrawn = computed(() => isFilingStatus(filing.value, FilingStatusE.WITHDRAWN))
const isShowBody = ref(false)
Expand Down
5 changes: 3 additions & 2 deletions src/components/bcros/filing/common/FiledLabel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<script setup lang="ts">
import { FilingTypes } from '@bcrs-shared-components/enums'
import type { ApiResponseFilingI } from '#imports'
import { isStaffFiling } from '#imports'
import { isStaffFiling, FilingStatusE } from '#imports'
const t = useNuxtApp().$i18n.t
Expand All @@ -54,6 +54,7 @@ const showEffectiveAs = computed(() => {
FilingTypes.REGISTRARS_ORDER,
FilingTypes.COURT_ORDER
]
return !dontShow.includes(props.filing.name)
const isWithdrawn = props.filing.status === FilingStatusE.WITHDRAWN
return !dontShow.includes(props.filing.name) && !isWithdrawn
})
</script>
19 changes: 19 additions & 0 deletions src/components/bcros/filing/common/filedAnd/Withdrawn.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<template>
<div>
<span> {{ $t('text.filing.withdrawn') }} {{ $t('text.filing.on') }}
<BcrosTooltipDate v-if="filing.withdrawnDate" :date="filing.withdrawnDate" />
<span v-else> Unknown </span>
</span>
<BcrosDivider class="mx-2" />
<span>{{ $t('text.filing.paid') }}</span>
<BcrosFilingCommonFiledLabel :filing="filing" />
</div>
</template>

<script setup lang="ts">
import type { ApiResponseFilingI } from '~/interfaces/filing-i'
defineProps({
filing: { type: Object as PropType<ApiResponseFilingI>, required: true }
})
</script>
3 changes: 2 additions & 1 deletion src/interfaces/bootstrap-i.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface BootstrapFilingI {
amalgamationApplication?: AmalgamationApplicationI
continuationIn?: BootstrapFilingDataI
incorporationApplication?: BootstrapFilingDataI
noticeOfWithdrawal?: any
registration?: BootstrapFilingDataI
header: TaskApiHeaderI
}
Expand All @@ -25,5 +26,5 @@ export interface BootstrapFilingApiResponseI {
documentsLink: string,
filing: BootstrapFilingI,
filingLink: string,
isFutureEffective: boolean,
isFutureEffective: boolean
}
3 changes: 3 additions & 0 deletions src/interfaces/filing-i.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,7 @@ export interface ApiResponseFilingI {
// properties added by the UI
comments?: Array<CommentIF>
documents?: Array<DocumentI>

// withdrawn filings only
withdrawnDate?: ApiDateTimeUtc
}
1 change: 1 addition & 0 deletions src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@
"filedAndPending": "FILED AND PENDING",
"paid": "PAID",
"rejected": "REJECTED",
"withdrawn": "WITHDRAWN",
"futureEffectiveIncorporation": "FUTURE EFFECTIVE INCORPORATION",
"futureEffectiveContinuation": "FUTURE EFFECTIVE",
"futureEffectiveAlteration": "FUTURE EFFECTIVE ALTERATION",
Expand Down
9 changes: 5 additions & 4 deletions src/stores/businessBootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const useBcrosBusinessBootstrap = defineStore('bcros/businessBootstrap',
)
const isAmalgamationFiling = computed(() =>
bootstrapFilingType.value === FilingTypes.AMALGAMATION_APPLICATION &&
[FilingStatusE.CANCELLED, FilingStatusE.PAID].includes(bootstrapFilingStatus.value)
[FilingStatusE.CANCELLED, FilingStatusE.PAID, FilingStatusE.WITHDRAWN].includes(bootstrapFilingStatus.value)
)
const isContinuationInTodo = computed(() =>
bootstrapFilingType.value === FilingTypes.CONTINUATION_IN &&
Expand All @@ -64,7 +64,8 @@ export const useBcrosBusinessBootstrap = defineStore('bcros/businessBootstrap',
)
const isContinuationInFiling = computed(() =>
bootstrapFilingType.value === FilingTypes.CONTINUATION_IN &&
[FilingStatusE.COMPLETED, FilingStatusE.PAID, FilingStatusE.REJECTED].includes(bootstrapFilingStatus.value)
[FilingStatusE.COMPLETED, FilingStatusE.PAID, FilingStatusE.REJECTED, FilingStatusE.WITHDRAWN]
.includes(bootstrapFilingStatus.value)
)

const isIncorporationApplicationTodo = computed(() =>
Expand All @@ -73,15 +74,15 @@ export const useBcrosBusinessBootstrap = defineStore('bcros/businessBootstrap',
)
const isIncorporationApplicationFiling = computed(() =>
bootstrapFilingType.value === FilingTypes.INCORPORATION_APPLICATION &&
[FilingStatusE.COMPLETED, FilingStatusE.PAID].includes(bootstrapFilingStatus.value)
[FilingStatusE.COMPLETED, FilingStatusE.PAID, FilingStatusE.WITHDRAWN].includes(bootstrapFilingStatus.value)
)
const isRegistrationTodo = computed(() =>
bootstrapFilingType.value === FilingTypes.REGISTRATION &&
[FilingStatusE.DRAFT, FilingStatusE.PENDING].includes(bootstrapFilingStatus.value)
)
const isRegistrationFiling = computed(() =>
bootstrapFilingType.value === FilingTypes.REGISTRATION &&
[FilingStatusE.COMPLETED, FilingStatusE.PAID].includes(bootstrapFilingStatus.value)
[FilingStatusE.COMPLETED, FilingStatusE.PAID, FilingStatusE.WITHDRAWN].includes(bootstrapFilingStatus.value)
)

const isBootstrapTodo = computed(() =>
Expand Down
32 changes: 32 additions & 0 deletions src/stores/filings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export const useBcrosFilings = defineStore('bcros/filings', () => {
const displayName = header.name === FilingTypes.AMALGAMATION_APPLICATION
? filingName
: `${description} ${filingName}`
const noticeOfWithdrawal = bootstrapFiling.filing.noticeOfWithdrawal?.filing || null

filings.value = [{
availableOnPaperOnly: header.availableOnPaperOnly,
Expand All @@ -149,6 +150,37 @@ export const useBcrosFilings = defineStore('bcros/filings', () => {
},
latestReviewComment: header.latestReviewComment
} as ApiResponseFilingI]
if (noticeOfWithdrawal) {
const header = noticeOfWithdrawal.header
const business = noticeOfWithdrawal.business
const displayName = filingTypeToName(header.name, null, null, header.status)
const filingLink = `${apiURL}/businesses/${business.identifier}/filings/${header.filingId}`
const commentsLink = `${filingLink}/comments`
const documentsLink = `${filingLink}/documents`
filings.value.unshift({
availableOnPaperOnly: header.availableOnPaperOnly,
businessIdentifier: business.identifier,
commentsCount: header.comments?.length,
commentsLink,
displayLedger: bootstrapFiling.displayLedger,
displayName,
documentsLink,
effectiveDate: apiToUtcString(header.effectiveDate),
filingId: header.filingId,
filingLink,
isFutureEffective: false,
name: header.name,
status: header.status,
submittedDate: apiToUtcString(header.date),
submitter: header.submitter,
data: {
applicationDate: dateToYyyyMmDd(apiToDate(header.date)),
legalFilings: [header.name],
order: noticeOfWithdrawal.noticeOfWithdrawal.courtOrder
},
latestReviewComment: header.latestReviewComment
} as ApiResponseFilingI)
}
}

return {
Expand Down
1 change: 1 addition & 0 deletions src/utils/todo/task-filing/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const filingTypeToName = (
case FilingTypes.SPECIAL_RESOLUTION: return FilingNames.SPECIAL_RESOLUTION
case FilingTypes.TRANSITION: return FilingNames.TRANSITION_APPLICATION
case FilingTypes.PUT_BACK_ON: return FilingNames.PUT_BACK_ON
case FilingTypes.NOTICE_OF_WITHDRAWAL: return FilingNames.NOTICE_OF_WITHDRAWAL
}
// fallback for unknown filings
return camelCaseToWords(type)
Expand Down

0 comments on commit f3003c0

Please sign in to comment.