@lilaquadrat/interfaces 1.55.0 → 1.57.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/CHANGELOG.md +16 -0
- package/lib/cjs/AllocationHoursInput.d.ts +4 -0
- package/lib/cjs/AllocationIdParams.d.ts +4 -0
- package/lib/cjs/AllocationParams.d.ts +4 -0
- package/lib/cjs/AllocationQuery.d.ts +3 -0
- package/lib/cjs/BookingWindow.d.ts +4 -0
- package/lib/cjs/GenericData.d.ts +3 -2
- package/lib/cjs/GenericDataSingle.d.ts +1 -0
- package/lib/cjs/List.d.ts +5 -0
- package/lib/cjs/MemberShiftFilters.d.ts +1 -0
- package/lib/cjs/ProjectIdParams.d.ts +4 -0
- package/lib/cjs/ProjectParams.d.ts +4 -0
- package/lib/cjs/ProjectSiteParams.d.ts +4 -0
- package/lib/cjs/ShiftPlan.d.ts +2 -0
- package/lib/cjs/ShiftPlanChangeInput.d.ts +1 -0
- package/lib/cjs/ShiftPlanCreateInput.d.ts +1 -0
- package/lib/cjs/ShiftPlanSummary.d.ts +17 -0
- package/lib/cjs/TimeTrackingCategory.d.ts +6 -0
- package/lib/cjs/TimeTrackingMode.d.ts +1 -0
- package/lib/cjs/TimeTrackingProject.d.ts +15 -0
- package/lib/cjs/TimeTrackingProjectAllocation.d.ts +8 -0
- package/lib/cjs/TimeTrackingProjectAllocationInput.d.ts +2 -0
- package/lib/cjs/TimeTrackingProjectAllocationUsage.d.ts +8 -0
- package/lib/cjs/TimeTrackingProjectInput.d.ts +2 -0
- package/lib/cjs/TimeTrackingProjectListQuery.d.ts +5 -0
- package/lib/cjs/TimeTrackingProjectParams.d.ts +4 -0
- package/lib/cjs/Tracker.d.ts +7 -2
- package/lib/cjs/TrackerBooking.d.ts +25 -0
- package/lib/cjs/TrackerBookingShift.d.ts +14 -0
- package/lib/cjs/TrackerBookingsQuery.d.ts +4 -0
- package/lib/cjs/TrackerCategoriesParams.d.ts +4 -0
- package/lib/cjs/TrackerDayParams.d.ts +4 -0
- package/lib/cjs/TrackerDayQuery.d.ts +4 -0
- package/lib/cjs/TrackerListQuery.d.ts +5 -0
- package/lib/cjs/TrackerShiftBooking.d.ts +18 -0
- package/lib/cjs/TrackerStatistics.d.ts +10 -5
- package/lib/cjs/TrackerStatisticsQuery.d.ts +7 -0
- package/lib/cjs/TrackerUserQuery.d.ts +4 -0
- package/lib/cjs/index.d.ts +28 -0
- package/lib/esm/AllocationHoursInput.d.ts +4 -0
- package/lib/esm/AllocationHoursInput.js +2 -0
- package/lib/esm/AllocationHoursInput.js.map +1 -0
- package/lib/esm/AllocationIdParams.d.ts +4 -0
- package/lib/esm/AllocationIdParams.js +2 -0
- package/lib/esm/AllocationIdParams.js.map +1 -0
- package/lib/esm/AllocationParams.d.ts +4 -0
- package/lib/esm/AllocationParams.js +2 -0
- package/lib/esm/AllocationParams.js.map +1 -0
- package/lib/esm/AllocationQuery.d.ts +3 -0
- package/lib/esm/AllocationQuery.js +2 -0
- package/lib/esm/AllocationQuery.js.map +1 -0
- package/lib/esm/BookingWindow.d.ts +4 -0
- package/lib/esm/BookingWindow.js +2 -0
- package/lib/esm/BookingWindow.js.map +1 -0
- package/lib/esm/GenericData.d.ts +3 -2
- package/lib/esm/GenericDataSingle.d.ts +1 -0
- package/lib/esm/List.d.ts +5 -0
- package/lib/esm/MemberShiftFilters.d.ts +1 -0
- package/lib/esm/ProjectIdParams.d.ts +4 -0
- package/lib/esm/ProjectIdParams.js +2 -0
- package/lib/esm/ProjectIdParams.js.map +1 -0
- package/lib/esm/ProjectParams.d.ts +4 -0
- package/lib/esm/ProjectParams.js +2 -0
- package/lib/esm/ProjectParams.js.map +1 -0
- package/lib/esm/ProjectSiteParams.d.ts +4 -0
- package/lib/esm/ProjectSiteParams.js +2 -0
- package/lib/esm/ProjectSiteParams.js.map +1 -0
- package/lib/esm/ShiftPlan.d.ts +2 -0
- package/lib/esm/ShiftPlanChangeInput.d.ts +1 -0
- package/lib/esm/ShiftPlanCreateInput.d.ts +1 -0
- package/lib/esm/ShiftPlanSummary.d.ts +17 -0
- package/lib/esm/ShiftPlanSummary.js +2 -0
- package/lib/esm/ShiftPlanSummary.js.map +1 -0
- package/lib/esm/TimeTrackingCategory.d.ts +6 -0
- package/lib/esm/TimeTrackingCategory.js +2 -0
- package/lib/esm/TimeTrackingCategory.js.map +1 -0
- package/lib/esm/TimeTrackingMode.d.ts +1 -0
- package/lib/esm/TimeTrackingMode.js +2 -0
- package/lib/esm/TimeTrackingMode.js.map +1 -0
- package/lib/esm/TimeTrackingProject.d.ts +15 -0
- package/lib/esm/TimeTrackingProject.js +2 -0
- package/lib/esm/TimeTrackingProject.js.map +1 -0
- package/lib/esm/TimeTrackingProjectAllocation.d.ts +8 -0
- package/lib/esm/TimeTrackingProjectAllocation.js +2 -0
- package/lib/esm/TimeTrackingProjectAllocation.js.map +1 -0
- package/lib/esm/TimeTrackingProjectAllocationInput.d.ts +2 -0
- package/lib/esm/TimeTrackingProjectAllocationInput.js +2 -0
- package/lib/esm/TimeTrackingProjectAllocationInput.js.map +1 -0
- package/lib/esm/TimeTrackingProjectAllocationUsage.d.ts +8 -0
- package/lib/esm/TimeTrackingProjectAllocationUsage.js +2 -0
- package/lib/esm/TimeTrackingProjectAllocationUsage.js.map +1 -0
- package/lib/esm/TimeTrackingProjectInput.d.ts +2 -0
- package/lib/esm/TimeTrackingProjectInput.js +2 -0
- package/lib/esm/TimeTrackingProjectInput.js.map +1 -0
- package/lib/esm/TimeTrackingProjectListQuery.d.ts +5 -0
- package/lib/esm/TimeTrackingProjectListQuery.js +2 -0
- package/lib/esm/TimeTrackingProjectListQuery.js.map +1 -0
- package/lib/esm/TimeTrackingProjectParams.d.ts +4 -0
- package/lib/esm/TimeTrackingProjectParams.js +2 -0
- package/lib/esm/TimeTrackingProjectParams.js.map +1 -0
- package/lib/esm/Tracker.d.ts +7 -2
- package/lib/esm/TrackerBooking.d.ts +25 -0
- package/lib/esm/TrackerBooking.js +2 -0
- package/lib/esm/TrackerBooking.js.map +1 -0
- package/lib/esm/TrackerBookingShift.d.ts +14 -0
- package/lib/esm/TrackerBookingShift.js +2 -0
- package/lib/esm/TrackerBookingShift.js.map +1 -0
- package/lib/esm/TrackerBookingsQuery.d.ts +4 -0
- package/lib/esm/TrackerBookingsQuery.js +2 -0
- package/lib/esm/TrackerBookingsQuery.js.map +1 -0
- package/lib/esm/TrackerCategoriesParams.d.ts +4 -0
- package/lib/esm/TrackerCategoriesParams.js +2 -0
- package/lib/esm/TrackerCategoriesParams.js.map +1 -0
- package/lib/esm/TrackerDayParams.d.ts +4 -0
- package/lib/esm/TrackerDayParams.js +2 -0
- package/lib/esm/TrackerDayParams.js.map +1 -0
- package/lib/esm/TrackerDayQuery.d.ts +4 -0
- package/lib/esm/TrackerDayQuery.js +2 -0
- package/lib/esm/TrackerDayQuery.js.map +1 -0
- package/lib/esm/TrackerListQuery.d.ts +5 -0
- package/lib/esm/TrackerListQuery.js +2 -0
- package/lib/esm/TrackerListQuery.js.map +1 -0
- package/lib/esm/TrackerShiftBooking.d.ts +18 -0
- package/lib/esm/TrackerShiftBooking.js +2 -0
- package/lib/esm/TrackerShiftBooking.js.map +1 -0
- package/lib/esm/TrackerStatistics.d.ts +10 -5
- package/lib/esm/TrackerStatisticsQuery.d.ts +7 -0
- package/lib/esm/TrackerStatisticsQuery.js +2 -0
- package/lib/esm/TrackerStatisticsQuery.js.map +1 -0
- package/lib/esm/TrackerUserQuery.d.ts +4 -0
- package/lib/esm/TrackerUserQuery.js +2 -0
- package/lib/esm/TrackerUserQuery.js.map +1 -0
- package/lib/esm/index.d.ts +28 -0
- package/package.json +1 -1
- package/src/AllocationHoursInput.ts +4 -0
- package/src/AllocationIdParams.ts +5 -0
- package/src/AllocationParams.ts +5 -0
- package/src/AllocationQuery.ts +3 -0
- package/src/BookingWindow.ts +4 -0
- package/src/GenericData.ts +3 -2
- package/src/GenericDataSingle.ts +1 -0
- package/src/List.ts +6 -0
- package/src/MemberShiftFilters.ts +1 -0
- package/src/ProjectIdParams.ts +5 -0
- package/src/ProjectParams.ts +4 -0
- package/src/ProjectSiteParams.ts +5 -0
- package/src/ShiftPlan.ts +2 -0
- package/src/ShiftPlanChangeInput.ts +1 -0
- package/src/ShiftPlanCreateInput.ts +1 -0
- package/src/ShiftPlanSummary.ts +15 -0
- package/src/TimeTrackingCategory.ts +8 -0
- package/src/TimeTrackingMode.ts +1 -0
- package/src/TimeTrackingProject.ts +18 -0
- package/src/TimeTrackingProjectAllocation.ts +10 -0
- package/src/TimeTrackingProjectAllocationInput.ts +3 -0
- package/src/TimeTrackingProjectAllocationUsage.ts +10 -0
- package/src/TimeTrackingProjectInput.ts +3 -0
- package/src/TimeTrackingProjectListQuery.ts +5 -0
- package/src/TimeTrackingProjectParams.ts +5 -0
- package/src/Tracker.ts +9 -3
- package/src/TrackerBooking.ts +25 -0
- package/src/TrackerBookingShift.ts +14 -0
- package/src/TrackerBookingsQuery.ts +4 -0
- package/src/TrackerCategoriesParams.ts +5 -0
- package/src/TrackerDayParams.ts +5 -0
- package/src/TrackerDayQuery.ts +5 -0
- package/src/TrackerListQuery.ts +6 -0
- package/src/TrackerShiftBooking.ts +18 -0
- package/src/TrackerStatistics.ts +10 -5
- package/src/TrackerStatisticsQuery.ts +8 -0
- package/src/TrackerUserQuery.ts +4 -0
|
@@ -8,6 +8,7 @@ export interface ShiftPlanCreateInput {
|
|
|
8
8
|
list?: ObjectId;
|
|
9
9
|
name: string;
|
|
10
10
|
timeZone: string;
|
|
11
|
+
state?: 'draft' | 'publish';
|
|
11
12
|
settingsOverrides?: ShiftPlanningPolicyOverrides;
|
|
12
13
|
workAreaCategories?: ShiftPlanWorkArea[];
|
|
13
14
|
defaultParticipantState?: ListParticipants['state'] | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ObjectId } from 'mongodb';
|
|
2
|
+
|
|
3
|
+
/** Lightweight plan row for lists and pickers; the plan detail endpoint returns the full ShiftPlanResponse. */
|
|
4
|
+
export interface ShiftPlanSummary {
|
|
5
|
+
_id?: ObjectId;
|
|
6
|
+
name: string;
|
|
7
|
+
/** Publication state, defaulted to `draft` for documents saved before the field existed. */
|
|
8
|
+
state: 'draft' | 'publish';
|
|
9
|
+
/** Linked employee list identity, resolved to its name; null when the plan has no list. */
|
|
10
|
+
list: { _id: ObjectId; name: string } | null;
|
|
11
|
+
/** Total days of the plan; the list endpoint does not ship the day documents. */
|
|
12
|
+
dayCount: number;
|
|
13
|
+
/** Total shifts of the plan, independently of the list's date filter. */
|
|
14
|
+
shiftCount: number;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TimeTrackingMode = 'hours' | 'fromTo' | 'multiDay' | 'shifts';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TimeTrackingCategory } from './TimeTrackingCategory';
|
|
2
|
+
import type { TimeTrackingMode } from './TimeTrackingMode';
|
|
3
|
+
|
|
4
|
+
export interface TimeTrackingProject {
|
|
5
|
+
|
|
6
|
+
id: string;
|
|
7
|
+
company: string;
|
|
8
|
+
project: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
maximumHours?: number;
|
|
12
|
+
maximumHoursPerDay?: number;
|
|
13
|
+
modes: TimeTrackingMode;
|
|
14
|
+
shiftPlan?: string;
|
|
15
|
+
/** categories partition the budget; a plan that links a shift plan books on shifts and needs none */
|
|
16
|
+
categories?: TimeTrackingCategory[];
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** how much of the hours allocated to a person in one category the person has booked so far */
|
|
2
|
+
export interface TimeTrackingProjectAllocationUsage {
|
|
3
|
+
|
|
4
|
+
category: string;
|
|
5
|
+
/** the allocated hours, missing when the person is allocated without a limit */
|
|
6
|
+
hours?: number;
|
|
7
|
+
/** everything the person booked on the category of the plan, in milliseconds */
|
|
8
|
+
bookedTime: number;
|
|
9
|
+
|
|
10
|
+
}
|
package/src/Tracker.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { Me } from "./Me"
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/** the grouping key of a time entry: a shift id for shift bookings, a category id otherwise */
|
|
4
|
+
export type TrackerGroup = string
|
|
3
5
|
|
|
4
6
|
export interface Tracker {
|
|
5
7
|
indexedKey?: string,
|
|
6
8
|
description?: string,
|
|
7
|
-
category
|
|
9
|
+
/** legacy `worktime`|`call` or a plan category id; absent when the entry books on a shift */
|
|
10
|
+
category?: TrackerGroup,
|
|
8
11
|
startTime?: Date,
|
|
9
12
|
endTime?: Date,
|
|
10
13
|
currentTime?: number
|
|
11
14
|
mode: 'stopwatch' | 'timeframe',
|
|
12
15
|
user?: Pick<Me, 'lastname' | 'prename' | 'id' | 'email'> | string
|
|
13
16
|
company: string,
|
|
14
|
-
project: string
|
|
17
|
+
project: string,
|
|
18
|
+
timeTrackingProject: string,
|
|
19
|
+
shift?: string,
|
|
20
|
+
customer?: string,
|
|
15
21
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One time entry of a time tracking project as the plan view lists it. A booking carries either a
|
|
3
|
+
* category (plan categories, legacy `worktime`|`call`) or a shift, never both for new entries.
|
|
4
|
+
*/
|
|
5
|
+
export interface TrackerBooking {
|
|
6
|
+
/** tracker entry ObjectId as hex string, the id the single entry screen edits and removes */
|
|
7
|
+
id: string;
|
|
8
|
+
/** plan category id or legacy `worktime`|`call`; absent when the entry books on a shift */
|
|
9
|
+
category?: string;
|
|
10
|
+
/** shift ObjectId as hex string; absent when the entry books on a category */
|
|
11
|
+
shift?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
/** the account that booked the entry; names are absent when the account has no profile */
|
|
14
|
+
user: {
|
|
15
|
+
id: string;
|
|
16
|
+
prename?: string;
|
|
17
|
+
lastname?: string;
|
|
18
|
+
};
|
|
19
|
+
/** ISO instant */
|
|
20
|
+
startTime?: string;
|
|
21
|
+
/** ISO instant */
|
|
22
|
+
endTime?: string;
|
|
23
|
+
/** milliseconds */
|
|
24
|
+
currentTime: number;
|
|
25
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A shift one person may book tracked time on. The tracker app owns this projection so a member
|
|
3
|
+
* does not need `shifts:read`: the server resolves the caller's customer and only returns the
|
|
4
|
+
* shifts that customer is assigned to.
|
|
5
|
+
*/
|
|
6
|
+
export interface TrackerBookingShift {
|
|
7
|
+
/** shift ObjectId as hex string, the value a tracker entry stores as `shift` */
|
|
8
|
+
_id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
/** ISO instant, the shift's planned start */
|
|
11
|
+
start: string;
|
|
12
|
+
/** ISO instant, the shift's planned end */
|
|
13
|
+
end: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One time entry booked on a shift. The person is the shift assignment's customer, so it resolves
|
|
3
|
+
* against the shift's participants.
|
|
4
|
+
*/
|
|
5
|
+
export interface TrackerShiftBooking {
|
|
6
|
+
/** tracker entry ObjectId as hex string, the id the single entry screen edits and removes */
|
|
7
|
+
id: string;
|
|
8
|
+
/** shift ObjectId as hex string */
|
|
9
|
+
shift: string;
|
|
10
|
+
/** customer ObjectId as hex string; absent when the entry's owner has no connected customer */
|
|
11
|
+
customer?: string;
|
|
12
|
+
/** ISO instant */
|
|
13
|
+
startTime?: string;
|
|
14
|
+
/** ISO instant */
|
|
15
|
+
endTime?: string;
|
|
16
|
+
/** milliseconds */
|
|
17
|
+
currentTime: number;
|
|
18
|
+
}
|
package/src/TrackerStatistics.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Tracker } from "./Tracker";
|
|
1
|
+
import { Tracker, TrackerGroup } from "./Tracker";
|
|
2
2
|
|
|
3
|
+
/** the two category values plans created before categories existed recorded time under */
|
|
3
4
|
export type TrackerCategories = 'call' | 'worktime' | 'all';
|
|
4
5
|
|
|
5
6
|
export interface TrackerData {
|
|
@@ -7,13 +8,17 @@ export interface TrackerData {
|
|
|
7
8
|
time: number
|
|
8
9
|
}
|
|
9
10
|
|
|
11
|
+
/**
|
|
12
|
+
* the `categories` maps are keyed by the grouping of an entry: a shift id for shift bookings,
|
|
13
|
+
* a category id (or the legacy `worktime`|`call`) otherwise
|
|
14
|
+
*/
|
|
10
15
|
export interface TrackerStatistics {
|
|
11
16
|
count: number,
|
|
12
17
|
all: TrackerData,
|
|
13
18
|
categories: {
|
|
14
|
-
all?: Partial<Record<
|
|
15
|
-
byMonth?: Partial<Record<string, Partial<Record<
|
|
16
|
-
byDay?: Partial<Record<string, Partial<Record<
|
|
19
|
+
all?: Partial<Record<TrackerGroup, TrackerData>>
|
|
20
|
+
byMonth?: Partial<Record<string, Partial<Record<TrackerGroup, TrackerData>>>>
|
|
21
|
+
byDay?: Partial<Record<string, Partial<Record<TrackerGroup, TrackerData>>>>
|
|
17
22
|
}
|
|
18
23
|
start: Date,
|
|
19
24
|
end: Date
|
|
@@ -21,6 +26,6 @@ export interface TrackerStatistics {
|
|
|
21
26
|
export interface TrackerStatisticsDay {
|
|
22
27
|
data: Tracker[],
|
|
23
28
|
count: number,
|
|
24
|
-
statistics: Partial<Record<
|
|
29
|
+
statistics: Partial<Record<TrackerGroup, TrackerData>>
|
|
25
30
|
date: Date;
|
|
26
31
|
}
|