Skip to content

Commit

Permalink
21790 - Filing history template and item headers (#18)
Browse files Browse the repository at this point in the history
* 21790 - adding filng templates bases.

* 21790 - some style updates.

* 21790 - eslint fixes.

* 21790 - test fixes.

* 21790 - pr changes.

* 21790 - updating tests and some after PR changes stuff.
  • Loading branch information
hfekete authored Jul 22, 2024
1 parent 27ac21d commit c9739fa
Show file tree
Hide file tree
Showing 48 changed files with 1,443 additions and 29 deletions.
13 changes: 13 additions & 0 deletions cypress/e2e/components/filings/section.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { allFilings } from '../../../fixtures/filings/allFilings'

context('Filings history section', () => {
it('Verifies filing history is displayed, and it shows data', () => {
cy.visitBusinessDashFor('businessInfo/ben/active.json', undefined, false, undefined, allFilings)

cy.get('[data-cy="filingHistoryItem-header"]').should('have.length', allFilings.length)

cy.get('[data-cy="filingHistoryItem-header"]').each((header, index) => {
cy.wrap(header).should('contain.text', allFilings[index].displayName)
})
})
})
4 changes: 3 additions & 1 deletion cypress/e2e/initial-page-load.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ context('Business Dashboard -> Basic page rendering tests', () => {

it('Loads the page with expected text', () => {
cy.get('[data-cy="business-dashboard"]').should('exist')
cy.get('[data-cy="business-dashboard"]').should('contain.text', 'TBD')

cy.get('[data-cy="business-dashboard"]').should('contain.text', 'To Do (0)')
cy.get('[data-cy="business-dashboard"]').should('contain.text', 'Recent Filing History (0)')
})
})
26 changes: 26 additions & 0 deletions cypress/fixtures/filings/addressChange/completed.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export const addressChange = {
availableOnPaperOnly: false,
businessIdentifier: 'CP1002605',
commentsCount: 0,
commentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/149681/comments',
data: {
applicationDate: '2024-07-02T07:00:00+00:00',
legalFilings: [
'changeOfAddress'
]
},
displayLedger: true,
displayName: 'Address Change',
documentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/149681/documents',
effectiveDate: 'Tue, 02 Jul 2024 16:30:56 GMT',
filingId: 149681,
filingLink: 'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/149681',
isFutureEffective: false,
name: 'changeOfAddress',
paymentStatusCode: 'COMPLETED',
status: 'COMPLETED',
submittedDate: 'Tue, 02 Jul 2024 16:30:56 GMT',
submitter: 'Registry Staff'
}
19 changes: 19 additions & 0 deletions cypress/fixtures/filings/allFilings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ApiResponseFilingI } from '../../../src/interfaces/filing-i'
import { addressChange } from './addressChange/completed'
import { annualReport } from './annualReport/completed'
import { directorChange } from './directorChange/directorChange'
import { administrativeDissolution } from './dissolution/administrativeDissolution'
import { bcGeneralPartnershipRegistration } from './bcGeneralPartnershipRegistration/bcGeneralPartnershipRegistration'
import { changeOfRegistrationApplication } from './changeOfRegistrationApplication/changeOfRegistrationApplication'
import { incorporationApplication } from './incoporationApplication/incorporationApplication'

export const allFilings: ApiResponseFilingI[] =
[
addressChange,
annualReport,
directorChange,
administrativeDissolution,
bcGeneralPartnershipRegistration,
changeOfRegistrationApplication,
incorporationApplication
]
31 changes: 31 additions & 0 deletions cypress/fixtures/filings/annualReport/completed.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export const annualReport = {
availableOnPaperOnly: false,
businessIdentifier: 'BC0814603',
commentsCount: 0,
commentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/BC0814603/filings/144620/comments',
data: {
annualReport: {
annualGeneralMeetingDate: null,
annualReportDate: '2011-01-25',
annualReportFilingYear: 2011
},
applicationDate: '2011-01-25',
legalFilings: [
'annualReport'
]
},
displayLedger: true,
displayName: 'Annual Report (2011)',
documentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/BC0814603/filings/144620/documents',
effectiveDate: 'Mon, 24 Apr 2023 05:40:24 GMT',
filingId: 144620,
filingLink: 'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/BC0814603/filings/144620',
isFutureEffective: false,
name: 'annualReport',
paymentStatusCode: 'COMPLETED',
status: 'COMPLETED',
submittedDate: 'Mon, 24 Apr 2023 05:40:24 GMT',
submitter: 'Registry Staff'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export const bcGeneralPartnershipRegistration =
{
availableOnPaperOnly: false,
businessIdentifier: 'FM1060265',
commentsCount: 0,
commentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/FM1060265/filings/147287/comments',
data: {
applicationDate: '2023-11-28T23:55:58.822929+00:00',
legalFilings: [
'registration'
],
registration: {
legalName: "BTR'S GENERAL PARTNERSHIP",
nrNumber: 'NR 0474544'
}
},
displayLedger: true,
displayName: 'BC General Partnership Registration',
documentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/FM1060265/filings/147287/documents',
effectiveDate: 'Tue, 28 Nov 2023 23:56:00 GMT',
filingId: 147287,
filingLink: 'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/FM1060265/filings/147287',
isFutureEffective: false,
name: 'registration',
paymentStatusCode: 'APPROVED',
status: 'COMPLETED',
submittedDate: 'Tue, 28 Nov 2023 23:55:58 GMT',
submitter: 'BCREG2 Liang FORTY'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export const changeOfRegistrationApplication =
{
availableOnPaperOnly: false,
businessIdentifier: 'FM1060265',
commentsCount: 0,
commentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/FM1060265/filings/147691/comments',
data: {
applicationDate: '2024-01-13T00:17:17.937213+00:00',
changeOfRegistration: {},
legalFilings: [
'changeOfRegistration'
]
},
displayLedger: true,
displayName: 'Change of Registration Application',
documentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/FM1060265/filings/147691/documents',
effectiveDate: 'Sat, 13 Jan 2024 00:17:18 GMT',
filingId: 147691,
filingLink: 'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/FM1060265/filings/147691',
isFutureEffective: false,
name: 'changeOfRegistration',
paymentStatusCode: 'COMPLETED',
status: 'COMPLETED',
submittedDate: 'Sat, 13 Jan 2024 00:17:17 GMT',
submitter: 'BCREG2 Ayisha FIFTY'
}
26 changes: 26 additions & 0 deletions cypress/fixtures/filings/directorChange/directorChange.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export const directorChange = {
availableOnPaperOnly: false,
businessIdentifier: 'CP1002605',
commentsCount: 0,
commentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/150006/comments',
data: {
applicationDate: '2024-07-11T07:00:00+00:00',
legalFilings: [
'changeOfDirectors'
]
},
displayLedger: true,
displayName: 'Director Change',
documentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/150006/documents',
effectiveDate: 'Thu, 11 Jul 2024 07:00:00 GMT',
filingId: 150006,
filingLink: 'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/150006',
isFutureEffective: false,
name: 'changeOfDirectors',
paymentStatusCode: 'COMPLETED',
status: 'COMPLETED',
submittedDate: 'Thu, 11 Jul 2024 18:02:53 GMT',
submitter: 'BCREG2 Ayisha FIFTY'
}
36 changes: 36 additions & 0 deletions cypress/fixtures/filings/dissolution/administrativeDissolution.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
export const administrativeDissolution = {
availableOnPaperOnly: false,
businessIdentifier: 'BC0814603',
commentsCount: 0,
commentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/BC0814603/filings/144622/comments',
data: {
applicationDate: '2023-04-24T05:55:43.070891+00:00',
dissolution: {
dissolutionDate: '2023-04-24',
dissolutionType: 'administrative'
},
legalFilings: [
'dissolution'
],
order: {
effectOfOrder: 'planOfArrangement',
fileNumber: '234234234234',
orderDetails: 'asasdasd'
}
},
displayLedger: true,
displayName: 'Administrative Dissolution',
documentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/BC0814603/filings/144622/documents',
effectiveDate: 'Mon, 24 Apr 2023 05:55:43 GMT',
filingId: 144622,
filingLink: 'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/BC0814603/filings/144622',
filingSubType: 'administrative',
isFutureEffective: false,
name: 'dissolution',
paymentStatusCode: 'COMPLETED',
status: 'COMPLETED',
submittedDate: 'Mon, 24 Apr 2023 05:55:43 GMT',
submitter: 'Registry Staff'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export const incorporationApplication = {
availableOnPaperOnly: false,
businessIdentifier: 'CP1002605',
commentsCount: 0,
commentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/147296/comments',
data: {
applicationDate: '2023-11-29T00:11:46.078781+00:00',
incorporationApplication: {
legalName: "BTR'S COOP",
nrNumber: 'NR 8181266'
},
legalFilings: [
'incorporationApplication'
]
},
displayLedger: true,
displayName: 'Incorporation Application',
documentsLink:
'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/147296/documents',
effectiveDate: 'Wed, 29 Nov 2023 00:11:46 GMT',
filingId: 147296,
filingLink: 'https://legal-api-dev.apps.silver.devops.gov.bc.ca/api/v2/businesses/CP1002605/filings/147296',
isFutureEffective: false,
name: 'incorporationApplication',
paymentStatusCode: 'APPROVED',
status: 'COMPLETED',
submittedDate: 'Wed, 29 Nov 2023 00:11:46 GMT',
submitter: 'BCREG2 Liang FORTY'
}
15 changes: 13 additions & 2 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ Cypress.Commands.add('interceptTasks', (fixture) => {
})
})

Cypress.Commands.add('interceptFilingHistory', (businessIdentifier, filings) => {
cy.intercept(
'GET',
`**/api/v2/businesses/${businessIdentifier}/filings`,
{ filings }
)
})

Cypress.Commands.add('visitBusinessDash',
(
identifier = 'BC0871427',
Expand Down Expand Up @@ -140,7 +148,8 @@ Cypress.Commands.add('visitBusinessDashFor',
path: string,
identifier = undefined,
hasAffiliationInvitations = false,
taskFixture = 'tasksEmpty.json'
taskFixture = 'tasksEmpty.json',
filings = []
) => {
sessionStorage.setItem('FAKE_CYPRESS_LOGIN', 'true')
// settings
Expand Down Expand Up @@ -169,6 +178,7 @@ Cypress.Commands.add('visitBusinessDashFor',
cy.interceptParties(business.legalType, business.state === BusinessStateE.HISTORICAL).as('getParties')
cy.interceptAffiliationRequests(hasAffiliationInvitations).as('getAffiliationRequests')
cy.interceptTasks(taskFixture).as('getTasks')
cy.interceptFilingHistory(business.identifier, filings).as('getFilingHistory')

// go !
cy.visit(`/${business.identifier}`)
Expand All @@ -180,7 +190,8 @@ Cypress.Commands.add('visitBusinessDashFor',
'@getAddresses',
'@getParties',
'@getAffiliationRequests',
'@getTasks'
'@getTasks',
'@getFilingHistory'
])
cy.injectAxe()
})
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"http-status-codes": "^2.3.0",
"keycloak-js": "^24.0.4",
"launchdarkly-vue-client-sdk": "^2.2.0",
"lodash.isdate": "^4.0.1",
"lodash.isequal": "^4.5.0",
"lodash.omit": "^4.5.0",
"moment": "^2.30.1",
Expand Down
7 changes: 7 additions & 0 deletions pnpm-lock.yaml

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

24 changes: 8 additions & 16 deletions src/components/bcros/businessDetails/Links.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- staff comments todo: -->
<!-- COLIN link button -->
<span
v-if="isDisableNonBenCorps && !!currentBusiness.identifier"
v-if="isDisableNonBenCorps() && !!currentBusiness.identifier"
>
<BcrosTooltip
:text="$t('tooltip.filing.button.colinLink')"
Expand All @@ -26,7 +26,9 @@

<!-- View and Change Business Information -->
<span
v-if="!isDisableNonBenCorps && currentBusiness.identifier && currentBusiness.state !== BusinessStateE.HISTORICAL"
v-if="!isDisableNonBenCorps() &&
currentBusiness.identifier &&
currentBusiness.state !== BusinessStateE.HISTORICAL"
>
<UButton
id="business-information-button"
Expand Down Expand Up @@ -59,7 +61,7 @@
</span>

<!-- Download Business Summary -->
<span v-if="!isDisableNonBenCorps && isAllowedBusinessSummary">
<span v-if="!isDisableNonBenCorps() && isAllowedBusinessSummary">
<BcrosTooltip
:text="$t('tooltip.filing.button.businessSummary')"
:popper="{
Expand Down Expand Up @@ -89,7 +91,7 @@
</span>

<div class="mb-2">
<BcrosBusinessDetailsLinkActions v-if="!isDisableNonBenCorps && currentBusiness.identifier" />
<BcrosBusinessDetailsLinkActions v-if="!isDisableNonBenCorps() && currentBusiness.identifier" />
</div>
</div>
</template>
Expand All @@ -100,25 +102,15 @@ import type { DocumentI } from '~/interfaces/document-i'
import { BusinessStateE } from '~/enums/business-state-e'
import { fetchDocuments, saveBlob } from '~/utils/download-file'
const { currentBusiness } = storeToRefs(useBcrosBusiness())
const { currentBusiness, isFirm } = storeToRefs(useBcrosBusiness())
const { getStoredFlag } = useBcrosLaunchdarkly()
const { isAllowedToFile } = useBcrosBusiness()
const { isFirm } = storeToRefs(useBcrosBusiness())
const { isAllowedToFile, isDisableNonBenCorps } = useBcrosBusiness()
const enableNonBenCorpsFlag = computed(() => getStoredFlag('enable-non-ben-corps'))
const isAllowedBusinessSummary = computed(() =>
currentBusiness.value.identifier &&
!!getStoredFlag('supported-business-summary-entities')?.includes(currentBusiness.value.legalType)
)
const isDisableNonBenCorps = computed(() => {
if ([CorpTypeCd.BENEFIT_COMPANY, CorpTypeCd.BC_ULC_COMPANY, CorpTypeCd.BC_CCC]
.includes(currentBusiness.value.legalType)) {
return !enableNonBenCorpsFlag
}
return false
})
const isPendingDissolution = computed(() => {
return false
// todo: implement !!FUTURE not implemented in current dashboard
Expand Down
Loading

0 comments on commit c9739fa

Please sign in to comment.