pha-hermes 1.15.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/expenses/expenseClient.d.ts +1 -1
- package/dist/api/liphe_legacy/assignment/assignmentClient.d.ts +28 -0
- package/dist/api/{liphe1.0 → liphe_legacy}/auth/authClient.d.ts +1 -1
- package/dist/api/liphe_legacy/contract_request/contractRequestClient.d.ts +80 -0
- package/dist/api/liphe_legacy/contract_request_period/contractRequestPeriodClient.d.ts +47 -0
- package/dist/api/{lipheApiClient.d.ts → liphe_legacy/lipheApiClient.d.ts} +4 -2
- package/dist/api/liphe_legacy/practitioner/practitionerClient.d.ts +7 -0
- package/dist/api/{apiClient.d.ts → salesforce/apiClient.d.ts} +3 -4
- package/dist/api/{auth → salesforce/auth}/auth.d.ts +1 -1
- package/dist/api/{payperiod → salesforce/payperiod}/payperiodClient.d.ts +1 -7
- package/dist/api/{practitioner → salesforce/practitioner}/practitionerClient.d.ts +1 -1
- package/dist/api/{timesheet → salesforce/timesheet}/timesheetClient.d.ts +1 -1
- package/dist/api/{workorder → salesforce/workorder}/workorderClient.d.ts +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/models/index.d.ts +13 -17
- package/dist/models/{practitioner.d.ts → user.d.ts} +4 -0
- package/dist/models/workorder.d.ts +20 -0
- package/dist/pha-hermes.cjs.development.js +253 -17
- package/dist/pha-hermes.cjs.development.js.map +1 -1
- package/dist/pha-hermes.cjs.production.min.js +1 -1
- package/dist/pha-hermes.cjs.production.min.js.map +1 -1
- package/dist/pha-hermes.esm.js +255 -18
- package/dist/pha-hermes.esm.js.map +1 -1
- package/package.json +2 -1
- package/src/api/expenses/expenseClient.ts +2 -2
- package/src/api/liphe_legacy/assignment/assignmentClient.ts +67 -0
- package/src/api/{liphe1.0 → liphe_legacy}/auth/authClient.ts +11 -2
- package/src/api/liphe_legacy/contract_request/contractRequestClient.ts +128 -0
- package/src/api/liphe_legacy/contract_request_period/contractRequestPeriodClient.ts +233 -0
- package/src/api/{lipheApiClient.ts → liphe_legacy/lipheApiClient.ts} +23 -3
- package/src/api/{liphe1.0 → liphe_legacy}/practitioner/practitionerClient.ts +12 -4
- package/src/api/{apiClient.ts → salesforce/apiClient.ts} +12 -12
- package/src/api/{auth → salesforce/auth}/auth.ts +2 -5
- package/src/api/{payperiod → salesforce/payperiod}/payperiodClient.ts +1 -8
- package/src/api/{practitioner → salesforce/practitioner}/practitionerClient.ts +1 -1
- package/src/api/{timesheet → salesforce/timesheet}/timesheetClient.ts +1 -1
- package/src/api/{workorder → salesforce/workorder}/workorderClient.ts +1 -1
- package/src/index.ts +13 -8
- package/src/models/index.ts +13 -18
- package/src/models/{practitioner.ts → user.ts} +5 -0
- package/src/models/workorder.ts +21 -0
- package/dist/api/liphe1.0/practitioner/practitionerClient.d.ts +0 -13
- package/src/api/.env +0 -5
|
@@ -3,7 +3,7 @@ import { Expense } from '../../models/expense';
|
|
|
3
3
|
declare type FrontendExpense = {
|
|
4
4
|
workorderPeriodId: string;
|
|
5
5
|
amount: string;
|
|
6
|
-
type: 'Other' | 'Lodging' | 'Transportation' | 'Travel (Hours
|
|
6
|
+
type: 'Other' | 'Lodging' | 'Transportation' | 'Travel (Hours)' | 'Per diem' | 'Meals';
|
|
7
7
|
};
|
|
8
8
|
export declare class SFExpenseClient {
|
|
9
9
|
private axiosInstance;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
export interface LipheAssignment {
|
|
3
|
+
id: number;
|
|
4
|
+
request_id: number;
|
|
5
|
+
dates_start: Date;
|
|
6
|
+
dates_end: Date;
|
|
7
|
+
shift: 'morning' | 'afternoon' | 'evening' | 'night';
|
|
8
|
+
time_start: Date;
|
|
9
|
+
time_end: Date;
|
|
10
|
+
status: 'draft' | 'inprogress' | 'approved' | 'rejected';
|
|
11
|
+
selected_client: Record<string, any>;
|
|
12
|
+
approver: string;
|
|
13
|
+
cost_covered: number | null;
|
|
14
|
+
travel: number | null;
|
|
15
|
+
lodging: number | null;
|
|
16
|
+
meal: number | null;
|
|
17
|
+
others: number | null;
|
|
18
|
+
modified_by: string | null;
|
|
19
|
+
created_at: Date;
|
|
20
|
+
updated_at: Date;
|
|
21
|
+
}
|
|
22
|
+
export declare class AssignmentClient {
|
|
23
|
+
private axiosInstance;
|
|
24
|
+
constructor(axiosInstance: AxiosInstance);
|
|
25
|
+
fetchAllAssignments(agencyId?: number, from?: Date, to?: Date, assignedPractitionerId?: string, page?: number, page_size?: number): Promise<LipheAssignment[]>;
|
|
26
|
+
fetchAssignment(assignmentId: string): Promise<LipheAssignment>;
|
|
27
|
+
createAssignment(assignment: LipheAssignment): Promise<LipheAssignment>;
|
|
28
|
+
}
|
|
@@ -7,7 +7,7 @@ export declare class LipheAuthenticator {
|
|
|
7
7
|
private email;
|
|
8
8
|
private password;
|
|
9
9
|
private type;
|
|
10
|
-
constructor(authenticatedAxiosInstance: AxiosInstance, baseUrl: string, email: string, password: string, type?:
|
|
10
|
+
constructor(authenticatedAxiosInstance: AxiosInstance, baseUrl: string, email: string, password: string, type?: 'user' | 'client');
|
|
11
11
|
initializeAuth(): Promise<void>;
|
|
12
12
|
private login;
|
|
13
13
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Workorder } from '../../../models';
|
|
3
|
+
export interface LipheContractRequest {
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
po_number: string | null;
|
|
7
|
+
level: string;
|
|
8
|
+
deadline: string;
|
|
9
|
+
from: string;
|
|
10
|
+
by: string;
|
|
11
|
+
by_value: string;
|
|
12
|
+
date: Date;
|
|
13
|
+
email_request: string;
|
|
14
|
+
type_of_request: string;
|
|
15
|
+
status: string;
|
|
16
|
+
is_deleted: number;
|
|
17
|
+
created_at: Date;
|
|
18
|
+
updated_at: Date;
|
|
19
|
+
created_by: string;
|
|
20
|
+
updated_by: string;
|
|
21
|
+
community_id: number;
|
|
22
|
+
agency_id: number;
|
|
23
|
+
contract_id: number;
|
|
24
|
+
job_id: number;
|
|
25
|
+
start_date: Date;
|
|
26
|
+
end_date: Date;
|
|
27
|
+
department_id: number | null;
|
|
28
|
+
job: LipheJob;
|
|
29
|
+
community: LipheCommunity;
|
|
30
|
+
}
|
|
31
|
+
interface LipheJob {
|
|
32
|
+
id: number;
|
|
33
|
+
code_nethris: number;
|
|
34
|
+
translations: LipheJobTranslation[];
|
|
35
|
+
}
|
|
36
|
+
interface LipheJobTranslation {
|
|
37
|
+
id: number;
|
|
38
|
+
translatable_type: string;
|
|
39
|
+
translatable_id: number;
|
|
40
|
+
column: string;
|
|
41
|
+
content: string;
|
|
42
|
+
locale: string;
|
|
43
|
+
created_at: Date;
|
|
44
|
+
updated_at: Date;
|
|
45
|
+
}
|
|
46
|
+
interface LipheCommunity {
|
|
47
|
+
id: number;
|
|
48
|
+
name: string;
|
|
49
|
+
region: LipheRegion;
|
|
50
|
+
contact: LipheContact;
|
|
51
|
+
}
|
|
52
|
+
interface LipheRegion {
|
|
53
|
+
id: number;
|
|
54
|
+
translations: LipheRegionTranslation[];
|
|
55
|
+
}
|
|
56
|
+
interface LipheRegionTranslation {
|
|
57
|
+
id: number;
|
|
58
|
+
translatable_type: string;
|
|
59
|
+
translatable_id: number;
|
|
60
|
+
column: string;
|
|
61
|
+
content: string;
|
|
62
|
+
locale: string;
|
|
63
|
+
created_at: Date;
|
|
64
|
+
updated_at: Date;
|
|
65
|
+
}
|
|
66
|
+
interface LipheContact {
|
|
67
|
+
id: number;
|
|
68
|
+
address: string;
|
|
69
|
+
address_city: string;
|
|
70
|
+
address_zip: string;
|
|
71
|
+
address_country: string;
|
|
72
|
+
address_state: string;
|
|
73
|
+
phone: string;
|
|
74
|
+
}
|
|
75
|
+
export declare class ContractRequestClient {
|
|
76
|
+
private axiosInstance;
|
|
77
|
+
constructor(axiosInstance: AxiosInstance);
|
|
78
|
+
fetchAllContractRequests(agencyId: number, from?: Date, to?: Date, page?: number, page_size?: number): Promise<Workorder[]>;
|
|
79
|
+
}
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Agency, Period, Workorder } from '../../../models';
|
|
3
|
+
import { LipheContractRequest } from '../contract_request/contractRequestClient';
|
|
4
|
+
import { LipheAssignment } from '../assignment/assignmentClient';
|
|
5
|
+
interface LipheContractRequestPeriodData {
|
|
6
|
+
id: number;
|
|
7
|
+
contract_request_id: number;
|
|
8
|
+
start_date: Date;
|
|
9
|
+
end_date: Date;
|
|
10
|
+
shift: 'morning' | 'afternoon' | 'evening' | 'night';
|
|
11
|
+
start_time: Date;
|
|
12
|
+
end_time: Date;
|
|
13
|
+
departement_id: number;
|
|
14
|
+
note: string;
|
|
15
|
+
assignment_id: number;
|
|
16
|
+
assignment_parent_id: number | null;
|
|
17
|
+
created_at: Date;
|
|
18
|
+
updated_at: Date;
|
|
19
|
+
contract_request: LipheContractRequest;
|
|
20
|
+
department: string | null;
|
|
21
|
+
assignment: LipheAssignment;
|
|
22
|
+
assigned_employee_details: UserDetails;
|
|
23
|
+
assignment_employee: any;
|
|
24
|
+
}
|
|
25
|
+
interface UserDetails {
|
|
26
|
+
id: number;
|
|
27
|
+
name: string;
|
|
28
|
+
email: string | null;
|
|
29
|
+
}
|
|
30
|
+
export declare class ContractRequestPeriodClient {
|
|
31
|
+
private axiosInstance;
|
|
32
|
+
constructor(axiosInstance: AxiosInstance);
|
|
33
|
+
fetchAllContractRequestPeriods(agencyId: Agency, from?: Date, to?: Date, page?: number, activeAssignationsOnly?: boolean, assignedPractitionerId?: string): Promise<Workorder[]>;
|
|
34
|
+
fetchContractRequestPeriod(workorderId: string): Promise<LipheContractRequestPeriodData>;
|
|
35
|
+
getPayPeriodDatesForPayPeriodId(payPeriodId: string): Promise<Period[]>;
|
|
36
|
+
private getRole;
|
|
37
|
+
/**
|
|
38
|
+
* Calculates the pay period day of week that comes before the start date
|
|
39
|
+
* @param firstPayPeriodDate The first pay period date from the agency
|
|
40
|
+
* @param startDate The start date to find the pay period before
|
|
41
|
+
* @returns The day of week (0-6, where 0 is Sunday) of the pay period before start_date
|
|
42
|
+
*/
|
|
43
|
+
private getPayPeriodDayBeforeStartDate;
|
|
44
|
+
private getLastDayOfPayPeriod;
|
|
45
|
+
private calculateWeeksBetween;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { LiphePractitionerClient } from './
|
|
2
|
+
import { LiphePractitionerClient } from './practitioner/practitionerClient';
|
|
3
|
+
import { ContractRequestPeriodClient } from './contract_request_period/contractRequestPeriodClient';
|
|
3
4
|
export declare class LipheApiClient {
|
|
4
5
|
private instance;
|
|
5
6
|
private axiosInstance;
|
|
6
7
|
private authenticator;
|
|
7
8
|
practitionerClient: LiphePractitionerClient;
|
|
8
|
-
|
|
9
|
+
contractRequestPeriodClient: ContractRequestPeriodClient;
|
|
10
|
+
constructor(baseUrl: string, email: string, password: string, type?: 'user' | 'client');
|
|
9
11
|
init(): Promise<void>;
|
|
10
12
|
setInstance(instance: LipheApiClient): void;
|
|
11
13
|
getInstance(): LipheApiClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios';
|
|
2
|
+
import { Practitioner } from '../../../models';
|
|
3
|
+
export declare class LiphePractitionerClient {
|
|
4
|
+
private axios;
|
|
5
|
+
constructor(axiosInstance: AxiosInstance);
|
|
6
|
+
fetchAllPractitioners(agencyId?: number): Promise<Practitioner[]>;
|
|
7
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SFTimesheetClient } from './timesheet/timesheetClient';
|
|
2
2
|
import { SFPractitionerClient } from './practitioner/practitionerClient';
|
|
3
|
-
import { Role } from '
|
|
3
|
+
import { Role } from '../../models';
|
|
4
4
|
import { SFWorkorderClient } from './workorder/workorderClient';
|
|
5
5
|
import { SFPayPeriodClient } from './payperiod/payperiodClient';
|
|
6
|
-
import { SFExpenseClient } from '
|
|
6
|
+
import { SFExpenseClient } from '../expenses/expenseClient';
|
|
7
7
|
export declare const SF_API_VERSION: string;
|
|
8
8
|
export declare class SFApiClient {
|
|
9
9
|
private instance;
|
|
@@ -15,8 +15,7 @@ export declare class SFApiClient {
|
|
|
15
15
|
practitionerClient: SFPractitionerClient;
|
|
16
16
|
payPeriodClient: SFPayPeriodClient;
|
|
17
17
|
expenseClient: SFExpenseClient;
|
|
18
|
-
|
|
19
|
-
init(sfClientId: string, sfClientSecret: string, onTokenRefresh?: () => Promise<{
|
|
18
|
+
init(baseUrl: string, sfClientId: string, sfClientSecret: string, onTokenRefresh?: () => Promise<{
|
|
20
19
|
clientId: string;
|
|
21
20
|
clientSecret: string;
|
|
22
21
|
}>): Promise<void>;
|
|
@@ -5,7 +5,7 @@ export declare class SFAuthenticator {
|
|
|
5
5
|
token: string | undefined;
|
|
6
6
|
private refreshToken;
|
|
7
7
|
private tokenRefreshPromise;
|
|
8
|
-
constructor(authenticatedAxiosInstance: AxiosInstance, baseUrl
|
|
8
|
+
constructor(authenticatedAxiosInstance: AxiosInstance, baseUrl: string);
|
|
9
9
|
initializeAuth(clientId: string, clientSecret: string, onTokenRefresh?: () => Promise<{
|
|
10
10
|
clientId: string;
|
|
11
11
|
clientSecret: string;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
|
|
3
|
-
payPeriodId: string;
|
|
4
|
-
startDate: Date;
|
|
5
|
-
endDate: Date;
|
|
6
|
-
timesheetId?: string;
|
|
7
|
-
workorderId?: string;
|
|
8
|
-
}
|
|
2
|
+
import { Period } from '../../../models';
|
|
9
3
|
export declare class SFPayPeriodClient {
|
|
10
4
|
private axiosInstance;
|
|
11
5
|
constructor(axiosInstance: AxiosInstance);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { SFApiClient } from './api/apiClient';
|
|
2
|
-
export { SFPractitionerClient } from './api/practitioner/practitionerClient';
|
|
3
|
-
export { SFTimesheetClient } from './api/timesheet/timesheetClient';
|
|
4
|
-
export { SFAuthenticator } from './api/auth/auth';
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export { LiphePractitionerClient } from './api/liphe1.0/practitioner/practitionerClient';
|
|
1
|
+
export { SFApiClient } from './api/salesforce/apiClient';
|
|
2
|
+
export { SFPractitionerClient } from './api/salesforce/practitioner/practitionerClient';
|
|
3
|
+
export { SFTimesheetClient } from './api/salesforce/timesheet/timesheetClient';
|
|
4
|
+
export { SFAuthenticator } from './api/salesforce/auth/auth';
|
|
5
|
+
export { LipheApiClient } from './api/liphe_legacy/lipheApiClient';
|
|
6
|
+
export { LipheAuthenticator } from './api/liphe_legacy/auth/authClient';
|
|
7
|
+
export { LiphePractitionerClient } from './api/liphe_legacy/practitioner/practitionerClient';
|
|
9
8
|
export { SFExpenseClient } from './api/expenses/expenseClient';
|
|
9
|
+
export { Practitioner, Role, TimesheetDayEntry, Workorder, Agency, Period } from './models';
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
practitionerId: string;
|
|
13
|
-
startDate: Date;
|
|
14
|
-
endDate: Date;
|
|
15
|
-
createdAt: Date;
|
|
16
|
-
updatedAt: Date;
|
|
1
|
+
export declare enum Agency {
|
|
2
|
+
CHCA = "7",
|
|
3
|
+
CodeBleu = "5",
|
|
4
|
+
NordikOntario = "6",
|
|
5
|
+
PHA = "8",
|
|
6
|
+
PremierSoin = "1",
|
|
7
|
+
PremierSoinNordik = "3",
|
|
8
|
+
SolutionNursing = "4",
|
|
9
|
+
SolutionsStaffing = "9",
|
|
10
|
+
Transport = "2",
|
|
11
|
+
SSI = "99"
|
|
17
12
|
}
|
|
18
13
|
export * from './timesheet';
|
|
19
|
-
export * from './
|
|
14
|
+
export * from './user';
|
|
15
|
+
export * from './workorder';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface Period {
|
|
2
|
+
payPeriodId: string;
|
|
3
|
+
startDate: Date;
|
|
4
|
+
endDate: Date;
|
|
5
|
+
timesheetId?: string;
|
|
6
|
+
workorderId?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface Workorder {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
region: string;
|
|
12
|
+
establishmentName: string;
|
|
13
|
+
establishmentId: string;
|
|
14
|
+
role: string;
|
|
15
|
+
practitionerId?: string;
|
|
16
|
+
startDate: Date;
|
|
17
|
+
endDate: Date;
|
|
18
|
+
createdAt?: Date;
|
|
19
|
+
updatedAt?: Date;
|
|
20
|
+
}
|