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

PRIME-2706 Mismatch Missing Business License flag in Admin #2506

Merged
Merged
Show file tree
Hide file tree
Changes from 5 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
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) {
bergomi02 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading