Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

18640 Amalgamating business table (initial) #586

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-create-ui",
"version": "5.6.4",
"version": "5.6.5",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down
1 change: 1 addition & 0 deletions src/assets/styles/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ $app-red: #d3272c; // same as the Vuetify theme error
$app-lt-blue: #e4edf7;
$app-dk-blue: #38598a; // same as the Vuetify theme appDkBlue
$app-lt-gray: rgba(0, 0, 0, 0.54); // used for overriding Vuetify red validation color for checkboxes
$app-orange: #f8661a; // same as the Vuetify theme warning
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See Vuetify theme declaration in main.ts.


// Sizes for Fonts
$px-11: 0.6875rem;
Expand Down
33 changes: 21 additions & 12 deletions src/components/Amalgamation/AmalgamatingBusinesses.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
flat
class="section-container mt-4 pr-0"
>
<v-row
no-gutters
>
<v-row no-gutters>
<v-col
cols="12"
sm="3"
Expand Down Expand Up @@ -82,9 +80,7 @@
flat
class="section-container mt-4"
>
<v-row
no-gutters
>
<v-row no-gutters>
<v-col
cols="12"
sm="3"
Expand All @@ -104,7 +100,8 @@
</v-row>
</v-card>
</v-expand-transition>
<v-row class="mt-4 ml-1">

<!-- <v-row class="mt-4 ml-1">
<ul>
Amalgamating Businesses: <br><br>
<li
Expand All @@ -126,7 +123,15 @@
</template>
</li>
</ul>
</v-row>
</v-row> -->
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to keep this around for a bit while figuring out what business data we need in the table.

Copy link
Collaborator

@JazzarKarim JazzarKarim Dec 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sev, one thing I'm scratching my head around are A companies and companies that are not found in LEAR. Currently, in my upcoming PR, I have the business as what the lookup returns. The identifier alongside a couple of fields. Is that fine?

This way, we have two flavors:

  • LEAR businesses (We have all the information including mailing address + email)
  • Business lookup businesses like A and not in LEAR (identifier + good standing + name + status, all can be used in the table)

I'm wondering, that's enough right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lookup returns an object that contains some fields but not all. That's why you have to make other API calls to fetch the rest.

"A" companies are, I believe xpros. That means they're out-of-BC companies but we still have a COLIN/LEAR record for them, so we can handle them normally.

Foreign companies won't be returned by business lookup. Staff will enter those 3 data fields for them only. I would consider their identified "special" in that it's user-entered and not necessarily unique. We will have to assume they are in good standing.

Yes, we have 2 flavours: LEAR (including A) + Foreign.


<!-- FOR DEBUGGING -->
<!-- <pre>getAmalgamatingBusinesses={{ getAmalgamatingBusinesses }}</pre> -->
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can delete this soon, but not yet as I'm enabling/disabling this while verifying the data.

<BusinessTable
class="mt-8"
:class="{ 'invalid-section': getShowErrors && !businessTableValid }"
@valid="businessTableValid=$event"
/>
</div>
</template>

Expand All @@ -137,24 +142,28 @@ import { useStore } from '@/store/store'
import { CommonMixin } from '@/mixins'
import { BusinessLookupServices, LegalServices } from '@/services'
import { BusinessLookup } from '@bcrs-shared-components/business-lookup'
import { BusinessIF, BusinessLookupIF, EmptyBusinessLookup } from '@/interfaces'
import { BusinessLookupIF, EmptyBusinessLookup } from '@/interfaces'
import BusinessTable from '@/components/Amalgamation/BusinessTable.vue'

@Component({
components: {
BusinessLookup
BusinessLookup,
BusinessTable
}
})
export default class AmalgamatingBusinesses extends Mixins(CommonMixin) {
@Getter(useStore) getAmalgamatingBusinesses!: Array<BusinessIF>
@Getter(useStore) getAmalgamatingBusinesses!: Array<any>
@Getter(useStore) getShowErrors!: boolean
@Getter(useStore) isAmalgamationFilingHorizontal!: boolean
@Getter(useStore) isRoleStaff!: boolean

@Action(useStore) setAmalgamatingBusinesses!: (x: Array<BusinessIF>) => void
@Action(useStore) setAmalgamatingBusinesses!: (x: Array<any>) => void

// Local properties
amalgamatingBusinessesValid = false
amalgamatingBusinesses = []
initialBusinessLookupObject = EmptyBusinessLookup
businessTableValid = false
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that initial value here doesn't matter since the BusinessTable component computes this early on and emits its validity.


// Button properties
isAddingAmalgamatingBusiness = false
Expand Down
102 changes: 102 additions & 0 deletions src/components/Amalgamation/BusinessStatus.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<template>
<div class="business-status d-flex align-start">
<v-tooltip
top
max-width="24rem"
content-class="top-tooltip"
transition="fade-transition"
:disabled="!tooltip"
>
<template #activator="{ on }">
<v-icon
small
:color="color"
v-on="on"
>
{{ icon }}
</v-icon>
</template>
<span>{{ tooltip }}</span>
</v-tooltip>

<span class="ml-2">{{ text }}</span>
</div>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'
import { BusinessStatuses } from '@/enums'

@Component({})
export default class BusinessStatus extends Vue {
@Prop({ required: true }) readonly status!: BusinessStatuses

get icon (): string {
switch (this.status) {
case BusinessStatuses.OK: return 'mdi-check'

case BusinessStatuses.ERROR_AFFILIATION:
case BusinessStatuses.ERROR_CCC_MISMATCH:
case BusinessStatuses.ERROR_FOREIGN:
case BusinessStatuses.ERROR_NIGS: return 'mdi-alert'

default: return 'mdi-help' // should never happen
}
}

get color (): string {
switch (this.status) {
case BusinessStatuses.OK: return 'success'

case BusinessStatuses.ERROR_AFFILIATION:
case BusinessStatuses.ERROR_CCC_MISMATCH:
case BusinessStatuses.ERROR_FOREIGN:
case BusinessStatuses.ERROR_NIGS: return 'warning'

default: return 'gray7' // should never happen
}
}

get text (): string {
switch (this.status) {
case BusinessStatuses.OK: return 'Ready'

case BusinessStatuses.ERROR_AFFILIATION:
case BusinessStatuses.ERROR_CCC_MISMATCH:
case BusinessStatuses.ERROR_FOREIGN:
case BusinessStatuses.ERROR_NIGS: return 'Attention Required'

default: return 'Unknown' // should never happen
}
}

get tooltip (): string {
switch (this.status) {
case BusinessStatuses.OK:
return ''
case BusinessStatuses.ERROR_AFFILIATION:
return 'This business is not affiliated with the currently selected BC Registries account. ' +
'Affiliate this business with the account on My Business Registry page.'
case BusinessStatuses.ERROR_CCC_MISMATCH:
return 'A BC Community Contribution Company must amalgamate to form a new BC Community ' +
'Contribution Company.'
case BusinessStatuses.ERROR_FOREIGN:
return 'A foreign corporation must not amalgamate with a limited company and continue as ' +
'an unlimited liability company.'
case BusinessStatuses.ERROR_NIGS:
return 'This business is not in good standing. This filing cannot be submitted until all ' +
'businesses are in good standing.'

default: return null // should never happen
}
}
}
</script>

<style lang="scss" scoped>
// @import '@/assets/styles/theme.scss';

.v-icon {
margin-top: 3px;
}
</style>
Loading
Loading