Skip to content

Commit

Permalink
Merge pull request bcgov#43 from turb0c0w/sam/host-dashboard
Browse files Browse the repository at this point in the history
adding completion chip
  • Loading branch information
turb0c0w authored Jul 9, 2024
2 parents 97117c4 + 4909b1b commit 0cb5d1a
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 11 deletions.
8 changes: 4 additions & 4 deletions strr-web/components/bcros/form-section/review/Subsection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<div class="flex flex-row justify-between w-full desktop:mb-[40px]">
<div class="flex flex-col w-full">
<div class="flex flex-row justify-between w-full mb-[24px] mobile:flex-col">
<BcrosFormSectionReviewItem
:title="tContact('preferred')"
:content="state.preferredName ? state.preferredName: '-'"
/>
<BcrosFormSectionReviewItem
:title="tContact('fullName')"
:content="getNames()"
/>
<BcrosFormSectionReviewItem
:title="tContact('preferred')"
:content="state.preferredName ? state.preferredName: '-'"
/>
<BcrosFormSectionReviewItem
:title="tContact('phoneNumber')"
:content="state.phoneNumber?.toString() ?? '-'"
Expand Down
12 changes: 10 additions & 2 deletions strr-web/interfaces/account-i.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export interface OrgI {
}

export interface ContactI {
socialInsuranceNumber: string,
businessNumber: string,
dateOfBirth: string,
details: {
emailAddress: string,
Expand Down Expand Up @@ -173,7 +175,11 @@ export interface MailingAddressAPII {
city: string,
postalCode: string,
province: string,
country: string,
country: string
}

export interface UnitAddressI extends MailingAddressAPII {
nickname: string
}

export interface ContactNameAPII {
Expand All @@ -193,6 +199,8 @@ export interface ContactAPII {
emailAddress: string
},
mailingAddress: MailingAddressAPII
socialInsuranceNumber: string,
businessNumber: string
}

export interface SelectedAccountMailingAPII {
Expand All @@ -218,7 +226,7 @@ export interface CreateAccountFormAPII {
}
primaryContact?: ContactAPII,
secondaryContact?: ContactAPII,
unitAddress: MailingAddressAPII,
unitAddress: UnitAddressI,
unitDetails: {
parcelIdentifier?: string,
businessLicense?: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ const provisionalRows = [
const getFlavour = (status: string, invoices: RegistrationI['invoices']):
{ alert: AlertsFlavourE, text: string } | undefined => {
if (status === 'PENDING' && invoices[0].payment_status_code === 'COMPLETED') {
if (invoices.length === 0) {
return {
text: tRegistrationStatus('applied'),
alert: AlertsFlavourE.APPLIED
}
}
if (invoices[0].payment_status_code === 'COMPLETED') {
return {
text: tRegistrationStatus('applied'),
alert: AlertsFlavourE.APPLIED
Expand Down
12 changes: 10 additions & 2 deletions strr-web/pages/application-details/[applicationId]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,13 @@ const history = await getRegistrationHistory(applicationId.toString())
const getFlavour = (status: string, invoices: RegistrationI['invoices']):
{ alert: AlertsFlavourE, text: string } | undefined => {
if (status === 'PENDING' && invoices[0].payment_status_code === 'COMPLETED') {
if (invoices.length === 0) {
return {
text: tRegistrationStatus('applied'),
alert: AlertsFlavourE.APPLIED
}
}
if (invoices[0].payment_status_code === 'COMPLETED') {
return {
text: tRegistrationStatus('applied'),
alert: AlertsFlavourE.APPLIED
Expand Down Expand Up @@ -301,6 +307,8 @@ const getContactRows = (contactBlock: ContactI) => [{
? contactBlock.details.extension
: ''
}
`
`,
SIN: contactBlock.socialInsuranceNumber,
'BN (GST)': contactBlock.businessNumber
}]
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@ const formatDate = (date: Date) => date.toLocaleDateString('en-US')
const getFlavour = (status: string, invoices: RegistrationI['invoices']):
{ alert: AlertsFlavourE, text: string } | undefined => {
if (status === 'PENDING' && invoices[0].payment_status_code === 'COMPLETED') {
if (invoices.length === 0) {
return {
text: tRegistrationStatus('applied'),
alert: AlertsFlavourE.APPLIED
}
}
if (invoices[0].payment_status_code === 'COMPLETED') {
return {
text: tRegistrationStatus('applied'),
alert: AlertsFlavourE.APPLIED
Expand Down
6 changes: 6 additions & 0 deletions strr-web/pages/application-status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ registrations.value =
const getFlavour = (status: string, invoices: RegistrationI['invoices']):
{ alert: AlertsFlavourE, text: string } | undefined => {
if (invoices.length === 0) {
return {
text: tRegistrationStatus('applied'),
alert: AlertsFlavourE.APPLIED
}
}
if (invoices[0].payment_status_code === 'COMPLETED') {
return {
text: tRegistrationStatus('applied'),
Expand Down
5 changes: 4 additions & 1 deletion strr-web/utils/formStateToApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export const formStateToApi = (
? formState.secondaryContact?.lastName
: '-'
}
dataContact.socialInsuranceNumber = stateContact.socialInsuranceNumber ?? ''
dataContact.businessNumber = stateContact.businessNumber ?? ''
dataContact.dateOfBirth = `${stateContact.birthYear}-${stateContact.birthMonth}-${stateContact.birthDay}`
dataContact.details = {
preferredName: stateContact.preferredName,
Expand Down Expand Up @@ -68,7 +70,8 @@ export const formStateToApi = (
city: formState.propertyDetails.city ?? '',
postalCode: formState.propertyDetails.postalCode ?? '',
province: formState.propertyDetails.province ?? '',
country: formState.propertyDetails.country ?? ''
country: formState.propertyDetails.country ?? '',
nickname: formState.propertyDetails.nickname ?? ''
}
formData.registration.unitDetails = {
parcelIdentifier: formState.propertyDetails.parcelIdentifier,
Expand Down

0 comments on commit 0cb5d1a

Please sign in to comment.