Skip to content

Commit

Permalink
#24298 Ensure no errors occur even when conflict corp information is …
Browse files Browse the repository at this point in the history
…empty. (#1548)

* Ensure no errors occur even when conflict corp information is empty.

* update version

* bug fix

* correct a build error

* update
  • Loading branch information
eve-git authored Nov 8, 2024
1 parent 97d053f commit d08062a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
8 changes: 4 additions & 4 deletions app/components/examine/recipe/match/BCCorp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<p>BC Corporation</p>

<h3 class="font-bold">Corp Number</h3>
<p>{{ data['incorp #'] }}</p>
<p>{{ data['identifier'] }}</p>

<h3 class="font-bold">Directors</h3>
<div class="flex flex-col">
<p v-if="data.directors === 'Not Available'">Not Available</p>
<p v-if="!data?.directors?.length">Not Available</p>
<p v-else v-for="director in data.directors">{{ director }}</p>
</div>

Expand All @@ -20,7 +20,7 @@
<div class="grid basis-1/2 grid-cols-2 overflow-x-auto">
<h3 class="font-bold">Records Office Delivery Address</h3>
<div>
<p v-if="data['records office delivery address'] === 'Not Available'">
<p v-if="!data?.['records office delivery address']?.length">
Not Available
</p>
<p
Expand All @@ -34,7 +34,7 @@
</div>

<h3 class="font-bold">Registered Office Delivery Address</h3>
<div>
<div v-if="data['registered office delivery address']">
<p
v-for="addrLine in parseAddress(
data['registered office delivery address']
Expand Down
8 changes: 4 additions & 4 deletions app/components/examine/recipe/match/XproCorp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<p>XPRO Corporation</p>

<h3 class="font-bold">Corp Number</h3>
<p>{{ conflict['incorp #'] }}</p>
<p>{{ conflict['identifier'] }}</p>

<h3 class="font-bold">Attorneys</h3>
<div class="flex flex-col">
<p v-if="isNotAvailable(conflict['attorney names'])">Not available</p>
<p v-if="!conflict?.['attorney names']?.length">Not available</p>
<p v-else v-for="attorney in conflict['attorney names']">
{{ attorney }}
</p>
Expand All @@ -22,12 +22,12 @@
<div class="grid basis-1/2 grid-cols-2 overflow-x-auto">
<h3 class="font-bold">Directors</h3>
<div class="flex flex-col">
<p v-if="isNotAvailable(conflict.directors)">Not available</p>
<p v-if="!conflict?.directors?.length">Not available</p>
<p v-else v-for="director in conflict.directors">{{ director }}</p>
</div>

<h3 class="font-bold">Head Office</h3>
<div>
<div v-if="conflict['head office']" >
<p v-for="addrLine in parseAddress(conflict['head office'])">
{{ addrLine }}
</p>
Expand Down
2 changes: 1 addition & 1 deletion app/components/examine/recipe/match/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</div>
<div v-else-if="conflictData">
<ExamineRecipeMatchNames
v-if="conflict.source === 'NR' || conflict.source === 'NRO'"
v-if="conflict.source === 'NAMEREQUEST' || conflict.source === 'NRO'"
:conflict="(conflictData as NameRequest)"
/>
<ExamineRecipeMatchBCCorp
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "name-examination",
"version": "1.2.34",
"version": "1.2.35",
"private": true,
"scripts": {
"build": "nuxt generate",
Expand Down
7 changes: 6 additions & 1 deletion app/store/examine/conflict-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ import {
type Corporation,
type NameRequest,
} from '~/types'
import { getCorporation, getNameRequest } from '~/util/namex-api'
import { getBusiness, getCorporation, getNameRequest } from '~/util/namex-api'

export const useConflictData = defineStore('conflict-data', () => {
async function getCorpConflict(corpNum: string): Promise<Corporation> {
// search for businsess in BCRS
const businessResponse = await getBusiness(corpNum)
if (businessResponse.ok) return businessResponse.json()

// search for business in COLIN
const response = await getCorporation(corpNum)
return response.json()
}
Expand Down
10 changes: 5 additions & 5 deletions app/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ export interface Comment {
export type ConflictData = NameRequest | Corporation

export interface Corporation {
'incorp #': string
directors: string[] | 'Not Available'
'identifier': string
directors: string[]
'nature of business': string
jurisdiction: string
}

export interface BCCorporation extends Corporation {
'records office delivery address': string[] | 'Not Available'
'records office delivery address': string[]
'registered office delivery address': string[]
}

export interface XproCorporation extends Corporation {
'attorney names': string[] | 'Not Available'
'attorney names': string[]
'head office': string[]
}

Expand Down Expand Up @@ -75,7 +75,7 @@ export interface Histories {

export enum ConflictSource {
Corp = 'CORP',
NameRequest = 'NR',
NameRequest = 'NAMEREQUEST',
NRO = 'NRO',
}

Expand Down

0 comments on commit d08062a

Please sign in to comment.