@lilaquadrat/interfaces 1.56.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.
Files changed (169) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/lib/cjs/AllocationHoursInput.d.ts +4 -0
  3. package/lib/cjs/AllocationIdParams.d.ts +4 -0
  4. package/lib/cjs/AllocationParams.d.ts +4 -0
  5. package/lib/cjs/AllocationQuery.d.ts +3 -0
  6. package/lib/cjs/BookingWindow.d.ts +4 -0
  7. package/lib/cjs/GenericData.d.ts +3 -2
  8. package/lib/cjs/GenericDataSingle.d.ts +1 -0
  9. package/lib/cjs/List.d.ts +5 -0
  10. package/lib/cjs/MemberShiftFilters.d.ts +1 -0
  11. package/lib/cjs/ProjectIdParams.d.ts +4 -0
  12. package/lib/cjs/ProjectParams.d.ts +4 -0
  13. package/lib/cjs/ProjectSiteParams.d.ts +4 -0
  14. package/lib/cjs/ShiftPlan.d.ts +2 -0
  15. package/lib/cjs/ShiftPlanChangeInput.d.ts +1 -0
  16. package/lib/cjs/ShiftPlanCreateInput.d.ts +1 -0
  17. package/lib/cjs/ShiftPlanSummary.d.ts +2 -0
  18. package/lib/cjs/TimeTrackingCategory.d.ts +6 -0
  19. package/lib/cjs/TimeTrackingMode.d.ts +1 -0
  20. package/lib/cjs/TimeTrackingProject.d.ts +15 -0
  21. package/lib/cjs/TimeTrackingProjectAllocation.d.ts +8 -0
  22. package/lib/cjs/TimeTrackingProjectAllocationInput.d.ts +2 -0
  23. package/lib/cjs/TimeTrackingProjectAllocationUsage.d.ts +8 -0
  24. package/lib/cjs/TimeTrackingProjectInput.d.ts +2 -0
  25. package/lib/cjs/TimeTrackingProjectListQuery.d.ts +5 -0
  26. package/lib/cjs/TimeTrackingProjectParams.d.ts +4 -0
  27. package/lib/cjs/Tracker.d.ts +7 -2
  28. package/lib/cjs/TrackerBooking.d.ts +25 -0
  29. package/lib/cjs/TrackerBookingShift.d.ts +14 -0
  30. package/lib/cjs/TrackerBookingsQuery.d.ts +4 -0
  31. package/lib/cjs/TrackerCategoriesParams.d.ts +4 -0
  32. package/lib/cjs/TrackerDayParams.d.ts +4 -0
  33. package/lib/cjs/TrackerDayQuery.d.ts +4 -0
  34. package/lib/cjs/TrackerListQuery.d.ts +5 -0
  35. package/lib/cjs/TrackerShiftBooking.d.ts +18 -0
  36. package/lib/cjs/TrackerStatistics.d.ts +10 -5
  37. package/lib/cjs/TrackerStatisticsQuery.d.ts +7 -0
  38. package/lib/cjs/TrackerUserQuery.d.ts +4 -0
  39. package/lib/cjs/index.d.ts +27 -0
  40. package/lib/esm/AllocationHoursInput.d.ts +4 -0
  41. package/lib/esm/AllocationHoursInput.js +2 -0
  42. package/lib/esm/AllocationHoursInput.js.map +1 -0
  43. package/lib/esm/AllocationIdParams.d.ts +4 -0
  44. package/lib/esm/AllocationIdParams.js +2 -0
  45. package/lib/esm/AllocationIdParams.js.map +1 -0
  46. package/lib/esm/AllocationParams.d.ts +4 -0
  47. package/lib/esm/AllocationParams.js +2 -0
  48. package/lib/esm/AllocationParams.js.map +1 -0
  49. package/lib/esm/AllocationQuery.d.ts +3 -0
  50. package/lib/esm/AllocationQuery.js +2 -0
  51. package/lib/esm/AllocationQuery.js.map +1 -0
  52. package/lib/esm/BookingWindow.d.ts +4 -0
  53. package/lib/esm/BookingWindow.js +2 -0
  54. package/lib/esm/BookingWindow.js.map +1 -0
  55. package/lib/esm/GenericData.d.ts +3 -2
  56. package/lib/esm/GenericDataSingle.d.ts +1 -0
  57. package/lib/esm/List.d.ts +5 -0
  58. package/lib/esm/MemberShiftFilters.d.ts +1 -0
  59. package/lib/esm/ProjectIdParams.d.ts +4 -0
  60. package/lib/esm/ProjectIdParams.js +2 -0
  61. package/lib/esm/ProjectIdParams.js.map +1 -0
  62. package/lib/esm/ProjectParams.d.ts +4 -0
  63. package/lib/esm/ProjectParams.js +2 -0
  64. package/lib/esm/ProjectParams.js.map +1 -0
  65. package/lib/esm/ProjectSiteParams.d.ts +4 -0
  66. package/lib/esm/ProjectSiteParams.js +2 -0
  67. package/lib/esm/ProjectSiteParams.js.map +1 -0
  68. package/lib/esm/ShiftPlan.d.ts +2 -0
  69. package/lib/esm/ShiftPlanChangeInput.d.ts +1 -0
  70. package/lib/esm/ShiftPlanCreateInput.d.ts +1 -0
  71. package/lib/esm/ShiftPlanSummary.d.ts +2 -0
  72. package/lib/esm/TimeTrackingCategory.d.ts +6 -0
  73. package/lib/esm/TimeTrackingCategory.js +2 -0
  74. package/lib/esm/TimeTrackingCategory.js.map +1 -0
  75. package/lib/esm/TimeTrackingMode.d.ts +1 -0
  76. package/lib/esm/TimeTrackingMode.js +2 -0
  77. package/lib/esm/TimeTrackingMode.js.map +1 -0
  78. package/lib/esm/TimeTrackingProject.d.ts +15 -0
  79. package/lib/esm/TimeTrackingProject.js +2 -0
  80. package/lib/esm/TimeTrackingProject.js.map +1 -0
  81. package/lib/esm/TimeTrackingProjectAllocation.d.ts +8 -0
  82. package/lib/esm/TimeTrackingProjectAllocation.js +2 -0
  83. package/lib/esm/TimeTrackingProjectAllocation.js.map +1 -0
  84. package/lib/esm/TimeTrackingProjectAllocationInput.d.ts +2 -0
  85. package/lib/esm/TimeTrackingProjectAllocationInput.js +2 -0
  86. package/lib/esm/TimeTrackingProjectAllocationInput.js.map +1 -0
  87. package/lib/esm/TimeTrackingProjectAllocationUsage.d.ts +8 -0
  88. package/lib/esm/TimeTrackingProjectAllocationUsage.js +2 -0
  89. package/lib/esm/TimeTrackingProjectAllocationUsage.js.map +1 -0
  90. package/lib/esm/TimeTrackingProjectInput.d.ts +2 -0
  91. package/lib/esm/TimeTrackingProjectInput.js +2 -0
  92. package/lib/esm/TimeTrackingProjectInput.js.map +1 -0
  93. package/lib/esm/TimeTrackingProjectListQuery.d.ts +5 -0
  94. package/lib/esm/TimeTrackingProjectListQuery.js +2 -0
  95. package/lib/esm/TimeTrackingProjectListQuery.js.map +1 -0
  96. package/lib/esm/TimeTrackingProjectParams.d.ts +4 -0
  97. package/lib/esm/TimeTrackingProjectParams.js +2 -0
  98. package/lib/esm/TimeTrackingProjectParams.js.map +1 -0
  99. package/lib/esm/Tracker.d.ts +7 -2
  100. package/lib/esm/TrackerBooking.d.ts +25 -0
  101. package/lib/esm/TrackerBooking.js +2 -0
  102. package/lib/esm/TrackerBooking.js.map +1 -0
  103. package/lib/esm/TrackerBookingShift.d.ts +14 -0
  104. package/lib/esm/TrackerBookingShift.js +2 -0
  105. package/lib/esm/TrackerBookingShift.js.map +1 -0
  106. package/lib/esm/TrackerBookingsQuery.d.ts +4 -0
  107. package/lib/esm/TrackerBookingsQuery.js +2 -0
  108. package/lib/esm/TrackerBookingsQuery.js.map +1 -0
  109. package/lib/esm/TrackerCategoriesParams.d.ts +4 -0
  110. package/lib/esm/TrackerCategoriesParams.js +2 -0
  111. package/lib/esm/TrackerCategoriesParams.js.map +1 -0
  112. package/lib/esm/TrackerDayParams.d.ts +4 -0
  113. package/lib/esm/TrackerDayParams.js +2 -0
  114. package/lib/esm/TrackerDayParams.js.map +1 -0
  115. package/lib/esm/TrackerDayQuery.d.ts +4 -0
  116. package/lib/esm/TrackerDayQuery.js +2 -0
  117. package/lib/esm/TrackerDayQuery.js.map +1 -0
  118. package/lib/esm/TrackerListQuery.d.ts +5 -0
  119. package/lib/esm/TrackerListQuery.js +2 -0
  120. package/lib/esm/TrackerListQuery.js.map +1 -0
  121. package/lib/esm/TrackerShiftBooking.d.ts +18 -0
  122. package/lib/esm/TrackerShiftBooking.js +2 -0
  123. package/lib/esm/TrackerShiftBooking.js.map +1 -0
  124. package/lib/esm/TrackerStatistics.d.ts +10 -5
  125. package/lib/esm/TrackerStatisticsQuery.d.ts +7 -0
  126. package/lib/esm/TrackerStatisticsQuery.js +2 -0
  127. package/lib/esm/TrackerStatisticsQuery.js.map +1 -0
  128. package/lib/esm/TrackerUserQuery.d.ts +4 -0
  129. package/lib/esm/TrackerUserQuery.js +2 -0
  130. package/lib/esm/TrackerUserQuery.js.map +1 -0
  131. package/lib/esm/index.d.ts +27 -0
  132. package/package.json +1 -1
  133. package/src/AllocationHoursInput.ts +4 -0
  134. package/src/AllocationIdParams.ts +5 -0
  135. package/src/AllocationParams.ts +5 -0
  136. package/src/AllocationQuery.ts +3 -0
  137. package/src/BookingWindow.ts +4 -0
  138. package/src/GenericData.ts +3 -2
  139. package/src/GenericDataSingle.ts +1 -0
  140. package/src/List.ts +6 -0
  141. package/src/MemberShiftFilters.ts +1 -0
  142. package/src/ProjectIdParams.ts +5 -0
  143. package/src/ProjectParams.ts +4 -0
  144. package/src/ProjectSiteParams.ts +5 -0
  145. package/src/ShiftPlan.ts +2 -0
  146. package/src/ShiftPlanChangeInput.ts +1 -0
  147. package/src/ShiftPlanCreateInput.ts +1 -0
  148. package/src/ShiftPlanSummary.ts +2 -0
  149. package/src/TimeTrackingCategory.ts +8 -0
  150. package/src/TimeTrackingMode.ts +1 -0
  151. package/src/TimeTrackingProject.ts +18 -0
  152. package/src/TimeTrackingProjectAllocation.ts +10 -0
  153. package/src/TimeTrackingProjectAllocationInput.ts +3 -0
  154. package/src/TimeTrackingProjectAllocationUsage.ts +10 -0
  155. package/src/TimeTrackingProjectInput.ts +3 -0
  156. package/src/TimeTrackingProjectListQuery.ts +5 -0
  157. package/src/TimeTrackingProjectParams.ts +5 -0
  158. package/src/Tracker.ts +9 -3
  159. package/src/TrackerBooking.ts +25 -0
  160. package/src/TrackerBookingShift.ts +14 -0
  161. package/src/TrackerBookingsQuery.ts +4 -0
  162. package/src/TrackerCategoriesParams.ts +5 -0
  163. package/src/TrackerDayParams.ts +5 -0
  164. package/src/TrackerDayQuery.ts +5 -0
  165. package/src/TrackerListQuery.ts +6 -0
  166. package/src/TrackerShiftBooking.ts +18 -0
  167. package/src/TrackerStatistics.ts +10 -5
  168. package/src/TrackerStatisticsQuery.ts +8 -0
  169. package/src/TrackerUserQuery.ts +4 -0
@@ -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
+ export interface TimeTrackingProjectAllocation {
2
+
3
+ company: string;
4
+ project: string;
5
+ timeTrackingProject: string;
6
+ category: string;
7
+ user: string;
8
+ hours?: number;
9
+
10
+ }
@@ -0,0 +1,3 @@
1
+ import type { TimeTrackingProjectAllocation } from './TimeTrackingProjectAllocation';
2
+
3
+ export type TimeTrackingProjectAllocationInput = Omit<TimeTrackingProjectAllocation, 'company' | 'project'>;
@@ -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
+ }
@@ -0,0 +1,3 @@
1
+ import type { TimeTrackingProject } from './TimeTrackingProject';
2
+
3
+ export type TimeTrackingProjectInput = Omit<TimeTrackingProject, 'company' | 'project'>;
@@ -0,0 +1,5 @@
1
+ export interface TimeTrackingProjectListQuery {
2
+ search?: string;
3
+ sort?: string;
4
+ order?: string;
5
+ }
@@ -0,0 +1,5 @@
1
+ import type { ProjectParams } from './ProjectParams';
2
+
3
+ export interface TimeTrackingProjectParams extends ProjectParams {
4
+ timeTrackingProject: string;
5
+ }
package/src/Tracker.ts CHANGED
@@ -1,15 +1,21 @@
1
1
  import { Me } from "./Me"
2
- import { TrackerCategories } from "./TrackerStatistics"
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?: TrackerCategories,
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,4 @@
1
+ import type { BookingWindow } from './BookingWindow';
2
+ import type { TrackerUserQuery } from './TrackerUserQuery';
3
+
4
+ export interface TrackerBookingsQuery extends BookingWindow, TrackerUserQuery {}
@@ -0,0 +1,5 @@
1
+ import type { ProjectParams } from './ProjectParams';
2
+
3
+ export interface TrackerCategoriesParams extends ProjectParams {
4
+ search: string;
5
+ }
@@ -0,0 +1,5 @@
1
+ import type { ProjectParams } from './ProjectParams';
2
+
3
+ export interface TrackerDayParams extends ProjectParams {
4
+ day: string;
5
+ }
@@ -0,0 +1,5 @@
1
+ import type { TrackerUserQuery } from './TrackerUserQuery';
2
+
3
+ export interface TrackerDayQuery extends TrackerUserQuery {
4
+ timeTrackingProject?: string;
5
+ }
@@ -0,0 +1,6 @@
1
+ import type { TrackerUserQuery } from './TrackerUserQuery';
2
+
3
+ /** every other key is passed on to the list filter */
4
+ export interface TrackerListQuery extends TrackerUserQuery {
5
+ [key: string]: string | undefined;
6
+ }
@@ -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
+ }
@@ -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<TrackerCategories, TrackerData>>
15
- byMonth?: Partial<Record<string, Partial<Record<TrackerCategories, TrackerData>>>>
16
- byDay?: Partial<Record<string, Partial<Record<TrackerCategories, TrackerData>>>>
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<TrackerCategories, TrackerData>>
29
+ statistics: Partial<Record<TrackerGroup, TrackerData>>
25
30
  date: Date;
26
31
  }
@@ -0,0 +1,8 @@
1
+ import type { TrackerUserQuery } from './TrackerUserQuery';
2
+
3
+ export interface TrackerStatisticsQuery extends TrackerUserQuery {
4
+ month?: string;
5
+ year?: string;
6
+ timeTrackingProject?: string;
7
+ wholePlan?: string;
8
+ }
@@ -0,0 +1,4 @@
1
+ export interface TrackerUserQuery {
2
+ /** a person's account id or `all`; only honoured for `tracker:admin` */
3
+ user?: string;
4
+ }