Skip to content

Commit

Permalink
PRIME-2706 Mismatch Missing Business License flag in Admin (#2506)
Browse files Browse the repository at this point in the history
* initial commit

* fix unit test

* fix PR issue

---------

Co-authored-by: Alan Leung <alan.leung57@gmail.com>
  • Loading branch information
bergomi02 and neophyte57 committed Jul 11, 2024
1 parent 815b66f commit eab5e82
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ export class SiteRegistrationContainerComponent extends AbstractSiteAdminPage im
status,
businessLicence,
flagged,
isNew
isNew,
missingBusinessLicence
} = site;

return {
Expand All @@ -244,7 +245,8 @@ export class SiteRegistrationContainerComponent extends AbstractSiteAdminPage im
status,
businessLicence,
flagged,
isNew
isNew,
missingBusinessLicence
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@
*matHeaderCellDef
scope="col"> Missing Business Licence </th>
<td mat-cell
*matCellDef="let row;"> {{ ((row.careSettingCode === CareSettingEnum.COMMUNITY_PHARMACIST)
? row.missingBusinessLicence : null) | yesNo | default: 'N/A' }} </td>
*matCellDef="let row;"> {{ displayMissingBusinessLicence(row) }} </td>
</ng-container>

<ng-container matColumnDef="actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,22 @@ export class SiteRegistrationTableComponent implements OnInit, AfterViewInit {
}
}

public displayMissingBusinessLicence(row: SiteRegistrationListViewModel): string {
if (row.careSettingCode === CareSettingEnum.COMMUNITY_PHARMACIST) {
if (row.missingBusinessLicence === undefined) {
row.missingBusinessLicence = row.businessLicence === null ||
row.businessLicence.businessLicenceDocument === null
}
if (row.missingBusinessLicence) {
return "Yes"
} else {
return "No"
}
} else {
return "N/A";
}
}

public remoteUsers(siteRegistration: SiteRegistrationListViewModel): number | 'Yes' | 'No' | 'N/A' {
const count = siteRegistration.remoteUserCount;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class Site {
activeBeforeRegistration: boolean;
isNew: boolean;
deviceProviderId: string;
missingBusinessLicence: boolean;

public static getExpiryDate(site: Site | SiteListViewModel): string | null {
if (!site) {
Expand All @@ -67,7 +68,7 @@ export class Site {
}
}

export interface SiteListViewModel extends Pick<Site, 'id' | 'physicalAddress' | 'doingBusinessAs' | 'submittedDate' | 'careSettingCode' | 'siteVendors' | 'completed' | 'pec' | 'mnemonic' | 'status' | 'businessLicence' | 'flagged' | 'approvedDate' | 'isNew'> {
export interface SiteListViewModel extends Pick<Site, 'id' | 'physicalAddress' | 'doingBusinessAs' | 'submittedDate' | 'careSettingCode' | 'siteVendors' | 'completed' | 'pec' | 'mnemonic' | 'status' | 'businessLicence' | 'flagged' | 'approvedDate' | 'isNew' | 'missingBusinessLicence'> {
adjudicatorIdir: string;
remoteUserCount: number;
flagged: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export class MockCommunitySiteService {
activeBeforeRegistration: false,
isNew: false,
individualDeviceProviders: [],
deviceProviderId: null
deviceProviderId: null,
missingBusinessLicence: false
});
}

Expand Down

0 comments on commit eab5e82

Please sign in to comment.