@lilaquadrat/interfaces 1.51.1 → 1.54.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 (270) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/lib/cjs/CustomersModelActions.d.ts +1 -1
  3. package/lib/cjs/EmployeeAbsence.d.ts +10 -0
  4. package/lib/cjs/EmployeeAbsenceFilters.d.ts +5 -0
  5. package/lib/cjs/EmployeeAbsenceInput.d.ts +2 -0
  6. package/lib/cjs/History.d.ts +1 -0
  7. package/lib/cjs/HistoryChange.d.ts +12 -0
  8. package/lib/cjs/HistorySeen.d.ts +15 -0
  9. package/lib/cjs/List.d.ts +5 -0
  10. package/lib/cjs/ListCategory.d.ts +6 -0
  11. package/lib/cjs/ListParticipantMatch.d.ts +12 -0
  12. package/lib/cjs/ListParticipantWithUser.d.ts +4 -1
  13. package/lib/cjs/ListParticipants.d.ts +5 -1
  14. package/lib/cjs/MemberProfileUpdate.d.ts +2 -0
  15. package/lib/cjs/MemberShift.d.ts +21 -0
  16. package/lib/cjs/MemberShiftFilters.d.ts +5 -0
  17. package/lib/cjs/PaymentProviderProduct.d.ts +20 -0
  18. package/lib/cjs/Shift.d.ts +19 -0
  19. package/lib/cjs/ShiftAssignment.d.ts +7 -0
  20. package/lib/cjs/ShiftAssignmentBreak.d.ts +4 -0
  21. package/lib/cjs/ShiftAssignmentInput.d.ts +6 -0
  22. package/lib/cjs/ShiftAssignmentsInput.d.ts +4 -0
  23. package/lib/cjs/ShiftCreateInput.d.ts +5 -0
  24. package/lib/cjs/ShiftInput.d.ts +12 -0
  25. package/lib/cjs/ShiftParticipant.d.ts +14 -0
  26. package/lib/cjs/ShiftPlan.d.ts +20 -0
  27. package/lib/cjs/ShiftPlanArea.d.ts +5 -0
  28. package/lib/cjs/ShiftPlanChangeInput.d.ts +14 -0
  29. package/lib/cjs/ShiftPlanCreateInput.d.ts +14 -0
  30. package/lib/cjs/ShiftPlanDay.d.ts +11 -0
  31. package/lib/cjs/ShiftPlanDayInput.d.ts +6 -0
  32. package/lib/cjs/ShiftPlanFilters.d.ts +9 -0
  33. package/lib/cjs/ShiftPlanResponse.d.ts +14 -0
  34. package/lib/cjs/ShiftPlanWorkArea.d.ts +6 -0
  35. package/lib/cjs/ShiftPlanWorkHours.d.ts +5 -0
  36. package/lib/cjs/ShiftPlanningCompanyOptions.d.ts +2 -0
  37. package/lib/cjs/ShiftPlanningFilters.d.ts +7 -0
  38. package/lib/cjs/ShiftPlanningPage.d.ts +7 -0
  39. package/lib/cjs/ShiftPlanningPolicy.d.ts +32 -0
  40. package/lib/cjs/ShiftPlanningPolicyOverrides.d.ts +2 -0
  41. package/lib/cjs/ShiftPlanningProjectOptions.d.ts +2 -0
  42. package/lib/cjs/ShiftPlanningSettings.d.ts +8 -0
  43. package/lib/cjs/ShiftPlanningSettingsInput.d.ts +4 -0
  44. package/lib/cjs/ShiftPlanningViolation.d.ts +7 -0
  45. package/lib/cjs/ShiftReportContext.d.ts +18 -0
  46. package/lib/cjs/ShiftResponse.d.ts +10 -0
  47. package/lib/cjs/ShiftWorkingTime.d.ts +6 -0
  48. package/lib/cjs/StructureCondition.d.ts +11 -0
  49. package/lib/cjs/StructureConditionConstraint.d.ts +1 -0
  50. package/lib/cjs/StructureConditionGrade.d.ts +1 -0
  51. package/lib/cjs/StructureConditionOperator.d.ts +1 -0
  52. package/lib/cjs/StructureConditionType.d.ts +1 -0
  53. package/lib/cjs/StructureMatchState.d.ts +1 -0
  54. package/lib/cjs/WithStructures.d.ts +2 -1
  55. package/lib/cjs/WorkArea.d.ts +14 -0
  56. package/lib/cjs/WorkAreaFilters.d.ts +4 -0
  57. package/lib/cjs/WorkAreaInput.d.ts +2 -0
  58. package/lib/cjs/index.d.ts +49 -0
  59. package/lib/esm/CustomersModelActions.d.ts +1 -1
  60. package/lib/esm/EmployeeAbsence.d.ts +10 -0
  61. package/lib/esm/EmployeeAbsence.js +2 -0
  62. package/lib/esm/EmployeeAbsence.js.map +1 -0
  63. package/lib/esm/EmployeeAbsenceFilters.d.ts +5 -0
  64. package/lib/esm/EmployeeAbsenceFilters.js +2 -0
  65. package/lib/esm/EmployeeAbsenceFilters.js.map +1 -0
  66. package/lib/esm/EmployeeAbsenceInput.d.ts +2 -0
  67. package/lib/esm/EmployeeAbsenceInput.js +2 -0
  68. package/lib/esm/EmployeeAbsenceInput.js.map +1 -0
  69. package/lib/esm/History.d.ts +1 -0
  70. package/lib/esm/HistoryChange.d.ts +12 -0
  71. package/lib/esm/HistoryChange.js +2 -0
  72. package/lib/esm/HistoryChange.js.map +1 -0
  73. package/lib/esm/HistorySeen.d.ts +15 -0
  74. package/lib/esm/HistorySeen.js +2 -0
  75. package/lib/esm/HistorySeen.js.map +1 -0
  76. package/lib/esm/List.d.ts +5 -0
  77. package/lib/esm/ListCategory.d.ts +6 -0
  78. package/lib/esm/ListParticipantMatch.d.ts +12 -0
  79. package/lib/esm/ListParticipantMatch.js +2 -0
  80. package/lib/esm/ListParticipantMatch.js.map +1 -0
  81. package/lib/esm/ListParticipantWithUser.d.ts +4 -1
  82. package/lib/esm/ListParticipants.d.ts +5 -1
  83. package/lib/esm/MemberProfileUpdate.d.ts +2 -0
  84. package/lib/esm/MemberProfileUpdate.js +2 -0
  85. package/lib/esm/MemberProfileUpdate.js.map +1 -0
  86. package/lib/esm/MemberShift.d.ts +21 -0
  87. package/lib/esm/MemberShift.js +2 -0
  88. package/lib/esm/MemberShift.js.map +1 -0
  89. package/lib/esm/MemberShiftFilters.d.ts +5 -0
  90. package/lib/esm/MemberShiftFilters.js +2 -0
  91. package/lib/esm/MemberShiftFilters.js.map +1 -0
  92. package/lib/esm/PaymentProviderProduct.d.ts +20 -0
  93. package/lib/esm/PaymentProviderProduct.js +2 -0
  94. package/lib/esm/PaymentProviderProduct.js.map +1 -0
  95. package/lib/esm/Shift.d.ts +19 -0
  96. package/lib/esm/Shift.js +2 -0
  97. package/lib/esm/Shift.js.map +1 -0
  98. package/lib/esm/ShiftAssignment.d.ts +7 -0
  99. package/lib/esm/ShiftAssignment.js +2 -0
  100. package/lib/esm/ShiftAssignment.js.map +1 -0
  101. package/lib/esm/ShiftAssignmentBreak.d.ts +4 -0
  102. package/lib/esm/ShiftAssignmentBreak.js +2 -0
  103. package/lib/esm/ShiftAssignmentBreak.js.map +1 -0
  104. package/lib/esm/ShiftAssignmentInput.d.ts +6 -0
  105. package/lib/esm/ShiftAssignmentInput.js +2 -0
  106. package/lib/esm/ShiftAssignmentInput.js.map +1 -0
  107. package/lib/esm/ShiftAssignmentsInput.d.ts +4 -0
  108. package/lib/esm/ShiftAssignmentsInput.js +2 -0
  109. package/lib/esm/ShiftAssignmentsInput.js.map +1 -0
  110. package/lib/esm/ShiftCreateInput.d.ts +5 -0
  111. package/lib/esm/ShiftCreateInput.js +2 -0
  112. package/lib/esm/ShiftCreateInput.js.map +1 -0
  113. package/lib/esm/ShiftInput.d.ts +12 -0
  114. package/lib/esm/ShiftInput.js +2 -0
  115. package/lib/esm/ShiftInput.js.map +1 -0
  116. package/lib/esm/ShiftParticipant.d.ts +14 -0
  117. package/lib/esm/ShiftParticipant.js +2 -0
  118. package/lib/esm/ShiftParticipant.js.map +1 -0
  119. package/lib/esm/ShiftPlan.d.ts +20 -0
  120. package/lib/esm/ShiftPlan.js +2 -0
  121. package/lib/esm/ShiftPlan.js.map +1 -0
  122. package/lib/esm/ShiftPlanArea.d.ts +5 -0
  123. package/lib/esm/ShiftPlanArea.js +2 -0
  124. package/lib/esm/ShiftPlanArea.js.map +1 -0
  125. package/lib/esm/ShiftPlanChangeInput.d.ts +14 -0
  126. package/lib/esm/ShiftPlanChangeInput.js +2 -0
  127. package/lib/esm/ShiftPlanChangeInput.js.map +1 -0
  128. package/lib/esm/ShiftPlanCreateInput.d.ts +14 -0
  129. package/lib/esm/ShiftPlanCreateInput.js +2 -0
  130. package/lib/esm/ShiftPlanCreateInput.js.map +1 -0
  131. package/lib/esm/ShiftPlanDay.d.ts +11 -0
  132. package/lib/esm/ShiftPlanDay.js +2 -0
  133. package/lib/esm/ShiftPlanDay.js.map +1 -0
  134. package/lib/esm/ShiftPlanDayInput.d.ts +6 -0
  135. package/lib/esm/ShiftPlanDayInput.js +2 -0
  136. package/lib/esm/ShiftPlanDayInput.js.map +1 -0
  137. package/lib/esm/ShiftPlanFilters.d.ts +9 -0
  138. package/lib/esm/ShiftPlanFilters.js +2 -0
  139. package/lib/esm/ShiftPlanFilters.js.map +1 -0
  140. package/lib/esm/ShiftPlanResponse.d.ts +14 -0
  141. package/lib/esm/ShiftPlanResponse.js +2 -0
  142. package/lib/esm/ShiftPlanResponse.js.map +1 -0
  143. package/lib/esm/ShiftPlanWorkArea.d.ts +6 -0
  144. package/lib/esm/ShiftPlanWorkArea.js +2 -0
  145. package/lib/esm/ShiftPlanWorkArea.js.map +1 -0
  146. package/lib/esm/ShiftPlanWorkHours.d.ts +5 -0
  147. package/lib/esm/ShiftPlanWorkHours.js +2 -0
  148. package/lib/esm/ShiftPlanWorkHours.js.map +1 -0
  149. package/lib/esm/ShiftPlanningCompanyOptions.d.ts +2 -0
  150. package/lib/esm/ShiftPlanningCompanyOptions.js +2 -0
  151. package/lib/esm/ShiftPlanningCompanyOptions.js.map +1 -0
  152. package/lib/esm/ShiftPlanningFilters.d.ts +7 -0
  153. package/lib/esm/ShiftPlanningFilters.js +2 -0
  154. package/lib/esm/ShiftPlanningFilters.js.map +1 -0
  155. package/lib/esm/ShiftPlanningPage.d.ts +7 -0
  156. package/lib/esm/ShiftPlanningPage.js +2 -0
  157. package/lib/esm/ShiftPlanningPage.js.map +1 -0
  158. package/lib/esm/ShiftPlanningPolicy.d.ts +32 -0
  159. package/lib/esm/ShiftPlanningPolicy.js +2 -0
  160. package/lib/esm/ShiftPlanningPolicy.js.map +1 -0
  161. package/lib/esm/ShiftPlanningPolicyOverrides.d.ts +2 -0
  162. package/lib/esm/ShiftPlanningPolicyOverrides.js +2 -0
  163. package/lib/esm/ShiftPlanningPolicyOverrides.js.map +1 -0
  164. package/lib/esm/ShiftPlanningProjectOptions.d.ts +2 -0
  165. package/lib/esm/ShiftPlanningProjectOptions.js +2 -0
  166. package/lib/esm/ShiftPlanningProjectOptions.js.map +1 -0
  167. package/lib/esm/ShiftPlanningSettings.d.ts +8 -0
  168. package/lib/esm/ShiftPlanningSettings.js +2 -0
  169. package/lib/esm/ShiftPlanningSettings.js.map +1 -0
  170. package/lib/esm/ShiftPlanningSettingsInput.d.ts +4 -0
  171. package/lib/esm/ShiftPlanningSettingsInput.js +2 -0
  172. package/lib/esm/ShiftPlanningSettingsInput.js.map +1 -0
  173. package/lib/esm/ShiftPlanningViolation.d.ts +7 -0
  174. package/lib/esm/ShiftPlanningViolation.js +2 -0
  175. package/lib/esm/ShiftPlanningViolation.js.map +1 -0
  176. package/lib/esm/ShiftReportContext.d.ts +18 -0
  177. package/lib/esm/ShiftReportContext.js +2 -0
  178. package/lib/esm/ShiftReportContext.js.map +1 -0
  179. package/lib/esm/ShiftResponse.d.ts +10 -0
  180. package/lib/esm/ShiftResponse.js +2 -0
  181. package/lib/esm/ShiftResponse.js.map +1 -0
  182. package/lib/esm/ShiftWorkingTime.d.ts +6 -0
  183. package/lib/esm/ShiftWorkingTime.js +2 -0
  184. package/lib/esm/ShiftWorkingTime.js.map +1 -0
  185. package/lib/esm/StructureCondition.d.ts +11 -0
  186. package/lib/esm/StructureCondition.js +2 -0
  187. package/lib/esm/StructureCondition.js.map +1 -0
  188. package/lib/esm/StructureConditionConstraint.d.ts +1 -0
  189. package/lib/esm/StructureConditionConstraint.js +2 -0
  190. package/lib/esm/StructureConditionConstraint.js.map +1 -0
  191. package/lib/esm/StructureConditionGrade.d.ts +1 -0
  192. package/lib/esm/StructureConditionGrade.js +2 -0
  193. package/lib/esm/StructureConditionGrade.js.map +1 -0
  194. package/lib/esm/StructureConditionOperator.d.ts +1 -0
  195. package/lib/esm/StructureConditionOperator.js +2 -0
  196. package/lib/esm/StructureConditionOperator.js.map +1 -0
  197. package/lib/esm/StructureConditionType.d.ts +1 -0
  198. package/lib/esm/StructureConditionType.js +2 -0
  199. package/lib/esm/StructureConditionType.js.map +1 -0
  200. package/lib/esm/StructureMatchState.d.ts +1 -0
  201. package/lib/esm/StructureMatchState.js +2 -0
  202. package/lib/esm/StructureMatchState.js.map +1 -0
  203. package/lib/esm/WithStructures.d.ts +2 -1
  204. package/lib/esm/WorkArea.d.ts +14 -0
  205. package/lib/esm/WorkArea.js +2 -0
  206. package/lib/esm/WorkArea.js.map +1 -0
  207. package/lib/esm/WorkAreaFilters.d.ts +4 -0
  208. package/lib/esm/WorkAreaFilters.js +2 -0
  209. package/lib/esm/WorkAreaFilters.js.map +1 -0
  210. package/lib/esm/WorkAreaInput.d.ts +2 -0
  211. package/lib/esm/WorkAreaInput.js +2 -0
  212. package/lib/esm/WorkAreaInput.js.map +1 -0
  213. package/lib/esm/index.d.ts +49 -0
  214. package/package.json +1 -1
  215. package/src/CustomersModelActions.ts +2 -1
  216. package/src/EmployeeAbsence.ts +11 -0
  217. package/src/EmployeeAbsenceFilters.ts +6 -0
  218. package/src/EmployeeAbsenceInput.ts +3 -0
  219. package/src/History.ts +2 -1
  220. package/src/HistoryChange.ts +16 -0
  221. package/src/HistorySeen.ts +16 -0
  222. package/src/List.ts +5 -0
  223. package/src/ListCategory.ts +6 -0
  224. package/src/ListParticipantMatch.ts +13 -0
  225. package/src/ListParticipantWithUser.ts +4 -1
  226. package/src/ListParticipants.ts +5 -1
  227. package/src/MemberProfileUpdate.ts +6 -0
  228. package/src/MemberShift.ts +15 -0
  229. package/src/MemberShiftFilters.ts +6 -0
  230. package/src/PaymentProviderProduct.ts +25 -0
  231. package/src/Shift.ts +20 -0
  232. package/src/ShiftAssignment.ts +8 -0
  233. package/src/ShiftAssignmentBreak.ts +4 -0
  234. package/src/ShiftAssignmentInput.ts +7 -0
  235. package/src/ShiftAssignmentsInput.ts +5 -0
  236. package/src/ShiftCreateInput.ts +6 -0
  237. package/src/ShiftInput.ts +13 -0
  238. package/src/ShiftParticipant.ts +15 -0
  239. package/src/ShiftPlan.ts +21 -0
  240. package/src/ShiftPlanArea.ts +6 -0
  241. package/src/ShiftPlanChangeInput.ts +15 -0
  242. package/src/ShiftPlanCreateInput.ts +15 -0
  243. package/src/ShiftPlanDay.ts +12 -0
  244. package/src/ShiftPlanDayInput.ts +7 -0
  245. package/src/ShiftPlanFilters.ts +10 -0
  246. package/src/ShiftPlanResponse.ts +15 -0
  247. package/src/ShiftPlanWorkArea.ts +7 -0
  248. package/src/ShiftPlanWorkHours.ts +5 -0
  249. package/src/ShiftPlanningCompanyOptions.ts +3 -0
  250. package/src/ShiftPlanningFilters.ts +8 -0
  251. package/src/ShiftPlanningPage.ts +8 -0
  252. package/src/ShiftPlanningPolicy.ts +14 -0
  253. package/src/ShiftPlanningPolicyOverrides.ts +4 -0
  254. package/src/ShiftPlanningProjectOptions.ts +3 -0
  255. package/src/ShiftPlanningSettings.ts +9 -0
  256. package/src/ShiftPlanningSettingsInput.ts +5 -0
  257. package/src/ShiftPlanningViolation.ts +7 -0
  258. package/src/ShiftReportContext.ts +19 -0
  259. package/src/ShiftResponse.ts +11 -0
  260. package/src/ShiftWorkingTime.ts +6 -0
  261. package/src/StructureCondition.ts +12 -0
  262. package/src/StructureConditionConstraint.ts +1 -0
  263. package/src/StructureConditionGrade.ts +1 -0
  264. package/src/StructureConditionOperator.ts +1 -0
  265. package/src/StructureConditionType.ts +1 -0
  266. package/src/StructureMatchState.ts +1 -0
  267. package/src/WithStructures.ts +2 -1
  268. package/src/WorkArea.ts +15 -0
  269. package/src/WorkAreaFilters.ts +4 -0
  270. package/src/WorkAreaInput.ts +3 -0
package/src/History.ts CHANGED
@@ -11,6 +11,7 @@ export interface History {
11
11
  app: string
12
12
  date: Date
13
13
  source: string
14
+ origin?: 'member'
14
15
  update?: Date
15
16
  branchVersion?: number
16
17
  copySource?: ObjectId
@@ -19,4 +20,4 @@ export interface History {
19
20
 
20
21
  [key: string]: any;
21
22
 
22
- }
23
+ }
@@ -0,0 +1,16 @@
1
+ export interface HistoryChange {
2
+
3
+ /**
4
+ * path of the changed field, nested objects are joined with a dot
5
+ */
6
+ field: string
7
+
8
+ /**
9
+ * human readable name of the field when the snapshot data knows it, e.g. the question of a structure
10
+ */
11
+ label?: string
12
+
13
+ from: unknown
14
+ to: unknown
15
+
16
+ }
@@ -0,0 +1,16 @@
1
+ import { ObjectId } from "mongodb";
2
+
3
+ /**
4
+ * marks the newest history entry a user has seen for one scope (e.g. the participants of a single list).
5
+ * the number of unread entries is derived from this marker instead of being stored, so it can not go stale.
6
+ */
7
+ export interface HistorySeen {
8
+ user: string
9
+ company: string
10
+ project?: string
11
+ model: string
12
+ /** identifies the watched subset of a model, e.g. the id of a list. */
13
+ scope: string
14
+ lastSeenId: ObjectId
15
+ seenAt: Date
16
+ }
package/src/List.ts CHANGED
@@ -27,6 +27,11 @@ export interface List {
27
27
  unique?: boolean
28
28
  addressRequired?: boolean
29
29
  totalPaid?: number
30
+ /**
31
+ * opt-in: when true a member may edit the structure answers of, and cancel,
32
+ * their own list entry. absent/false means disabled.
33
+ */
34
+ selfService?: boolean
30
35
  }
31
36
 
32
37
  state: 'open' | 'closed' | 'waiting'
@@ -1,5 +1,6 @@
1
1
  import { ObjectId } from "mongodb";
2
2
  import {Price} from "./Price";
3
+ import { PaymentProvider } from "./PaymentProvider";
3
4
 
4
5
  export interface ListCategory {
5
6
 
@@ -8,6 +9,11 @@ export interface ListCategory {
8
9
  name: string
9
10
  description?: string
10
11
  externalId?: string
12
+ /**
13
+ * request-only flag: creates the product at the given payment provider and stores
14
+ * its id as externalId. never persisted.
15
+ */
16
+ createExternalProduct?: PaymentProvider['type']
11
17
  amount?: number
12
18
  disabled?: boolean
13
19
  price?: Price
@@ -0,0 +1,13 @@
1
+ import { StructureMatchState } from "./StructureMatchState";
2
+
3
+ /**
4
+ * How well a list participant matches a shift's structure conditions, resolved by the planning
5
+ * query so the candidate list can be ordered across all pages rather than just the loaded one.
6
+ * The state reports the hard constraints; the score grades the preferences.
7
+ */
8
+ export interface ListParticipantMatch {
9
+ state: StructureMatchState;
10
+ score: number;
11
+ matched: number;
12
+ total: number;
13
+ }
@@ -2,13 +2,16 @@ import { ListParticipants } from "./ListParticipants";
2
2
  import { Payment } from "./Payment";
3
3
  import { BasicData } from "./BasicData";
4
4
  import { CustomerMinimal } from "./CustomerMinimal";
5
+ import { WithStructures } from "./WithStructures";
6
+ import { ListParticipantMatch } from "./ListParticipantMatch";
5
7
 
6
8
  export type ListParticipantWithCustomerAndPayment = BasicData<ListParticipants>
7
9
  &
8
10
  {
9
- user: CustomerMinimal
11
+ user: CustomerMinimal & WithStructures
10
12
  }
11
13
  &
12
14
  {
13
15
  payment?: Pick<BasicData<Payment>, '_id' | 'state' | 'items' | 'provider' | 'currency' | 'amount'>;
16
+ match?: ListParticipantMatch;
14
17
  }
@@ -61,8 +61,12 @@ export interface ListParticipants extends WithStructures {
61
61
  ```paid```
62
62
 
63
63
  payment webhook confirmed
64
+
65
+ ```canceled```
66
+
67
+ customer withdrew their own entry; the slot is freed and no email is sent
64
68
  */
65
- state: 'unchecked' | 'paid' | 'notuseful' | 'confirmed' | 'enlisted' | 'reserved' | 'waiting' | 'blocked' | 'finalized'
69
+ state: 'unchecked' | 'paid' | 'notuseful' | 'confirmed' | 'enlisted' | 'reserved' | 'waiting' | 'blocked' | 'finalized' | 'canceled'
66
70
  agreements: AgreementResponse[]
67
71
  /**
68
72
  * if the participants came from a payment webhook paid will have the amount of the whole payment
@@ -0,0 +1,6 @@
1
+ import type { CustomerPerson } from './CustomerPerson';
2
+
3
+ export type MemberProfileUpdate = Partial<Pick<CustomerPerson,
4
+ 'prename' | 'name' | 'addressAddition' | 'street' | 'streetNumber'
5
+ | 'zipcode' | 'city' | 'country' | 'osm_id' | 'phone'
6
+ >>;
@@ -0,0 +1,15 @@
1
+ import type { ObjectId } from 'mongodb';
2
+ import type { WorkArea } from './WorkArea';
3
+ import type { ShiftAssignmentBreak } from './ShiftAssignmentBreak';
4
+
5
+ export interface MemberShift {
6
+ _id: ObjectId;
7
+ day: string;
8
+ title: string;
9
+ start: string;
10
+ end: string;
11
+ plan: { _id: ObjectId; name: string; timeZone: string };
12
+ list?: { _id: ObjectId; name: string };
13
+ area: Pick<WorkArea, '_id' | 'name' | 'description' | 'location' | 'address'>;
14
+ breaks: ShiftAssignmentBreak[];
15
+ }
@@ -0,0 +1,6 @@
1
+ import type { ObjectId } from 'mongodb';
2
+ import type { ShiftPlanningFilters } from './ShiftPlanningFilters';
3
+
4
+ export interface MemberShiftFilters extends Omit<ShiftPlanningFilters, 'area'> {
5
+ list?: ObjectId;
6
+ }
@@ -0,0 +1,25 @@
1
+ export interface PaymentProviderProduct {
2
+
3
+ id: string
4
+ name: string
5
+ description?: string
6
+
7
+ /**
8
+ * false if the product is archived at the provider
9
+ */
10
+ active: boolean
11
+
12
+ /**
13
+ * major units, like the prices stored in studio. missing if the product has no (flat) default price
14
+ */
15
+ price?: {
16
+ amount: number
17
+ currency: string
18
+ }
19
+
20
+ /**
21
+ * link to the product in the provider's dashboard
22
+ */
23
+ url?: string
24
+
25
+ }
package/src/Shift.ts ADDED
@@ -0,0 +1,20 @@
1
+ import type { ObjectId } from 'mongodb';
2
+ import type { ShiftAssignment } from './ShiftAssignment';
3
+ import type { StructureCondition } from './StructureCondition';
4
+
5
+ export interface Shift {
6
+ _id?: ObjectId;
7
+ company: string;
8
+ project: string;
9
+ list?: ObjectId;
10
+ plan: ObjectId;
11
+ day: ObjectId;
12
+ area: ObjectId;
13
+ title: string;
14
+ start: string;
15
+ end: string;
16
+ structures?: StructureCondition[];
17
+ requiredPeople?: number;
18
+ matchingPeople?: number;
19
+ assignments: ShiftAssignment[];
20
+ }
@@ -0,0 +1,8 @@
1
+ import type { ObjectId } from 'mongodb';
2
+ import type { ShiftAssignmentBreak } from './ShiftAssignmentBreak';
3
+
4
+ export interface ShiftAssignment {
5
+ participant: ObjectId;
6
+ customer: ObjectId;
7
+ breaks: ShiftAssignmentBreak[];
8
+ }
@@ -0,0 +1,4 @@
1
+ export interface ShiftAssignmentBreak {
2
+ start: string;
3
+ end: string;
4
+ }
@@ -0,0 +1,7 @@
1
+ import type { ObjectId } from 'mongodb';
2
+ import type { ShiftAssignmentBreak } from './ShiftAssignmentBreak';
3
+
4
+ export interface ShiftAssignmentInput {
5
+ participant: ObjectId;
6
+ breaks?: ShiftAssignmentBreak[];
7
+ }
@@ -0,0 +1,5 @@
1
+ import type { ShiftAssignmentInput } from './ShiftAssignmentInput';
2
+
3
+ export interface ShiftAssignmentsInput {
4
+ assignments: ShiftAssignmentInput[];
5
+ }
@@ -0,0 +1,6 @@
1
+ import type { ShiftInput } from './ShiftInput';
2
+ import type { ShiftAssignmentInput } from './ShiftAssignmentInput';
3
+
4
+ export interface ShiftCreateInput extends ShiftInput {
5
+ assignments?: ShiftAssignmentInput[];
6
+ }
@@ -0,0 +1,13 @@
1
+ import type { ObjectId } from 'mongodb';
2
+ import type { StructureCondition } from './StructureCondition';
3
+
4
+ export interface ShiftInput {
5
+ day: ObjectId;
6
+ area: ObjectId;
7
+ title: string;
8
+ start: string;
9
+ end: string;
10
+ structures?: StructureCondition[];
11
+ requiredPeople?: number;
12
+ matchingPeople?: number;
13
+ }
@@ -0,0 +1,15 @@
1
+ import type { ObjectId } from 'mongodb';
2
+ import type { CustomerMinimal } from './CustomerMinimal';
3
+ import type { WithStructures } from './WithStructures';
4
+
5
+ export interface ShiftParticipant extends WithStructures {
6
+ participant: ObjectId;
7
+ customer: ObjectId;
8
+ name: string;
9
+ email: string;
10
+ /**
11
+ * The assigned customer, carrying the customer's own structure answers and definitions
12
+ * so a shift's conditions can be evaluated client-side.
13
+ */
14
+ user?: CustomerMinimal & WithStructures;
15
+ }
@@ -0,0 +1,21 @@
1
+ import type { ObjectId } from 'mongodb';
2
+ import type { ShiftPlanningPolicyOverrides } from './ShiftPlanningPolicyOverrides';
3
+ import type { ShiftPlanWorkArea } from './ShiftPlanWorkArea';
4
+ import type { ShiftPlanWorkHours } from './ShiftPlanWorkHours';
5
+ import type { ListParticipants } from './ListParticipants';
6
+
7
+ export interface ShiftPlan {
8
+ _id?: ObjectId;
9
+ company: string;
10
+ project: string;
11
+ list?: ObjectId;
12
+ name: string;
13
+ timeZone: string;
14
+ settingsOverrides: ShiftPlanningPolicyOverrides;
15
+ /** One entry per work area used by the plan; binds employee-list categories to that area's shifts. */
16
+ workAreaCategories?: ShiftPlanWorkArea[];
17
+ /** Participant state the selection filter defaults to; null means no default. */
18
+ defaultParticipantState?: ListParticipants['state'] | null;
19
+ /** Visible scheduling window for each day; absent means the full day. */
20
+ workHours?: ShiftPlanWorkHours;
21
+ }
@@ -0,0 +1,6 @@
1
+ import type { ObjectId } from 'mongodb';
2
+
3
+ /** A work area placed on a plan day; its shifts are scheduled in the resulting column. */
4
+ export interface ShiftPlanArea {
5
+ area: ObjectId;
6
+ }
@@ -0,0 +1,15 @@
1
+ import type { ObjectId } from 'mongodb';
2
+ import type { ShiftPlanningPolicyOverrides } from './ShiftPlanningPolicyOverrides';
3
+ import type { ShiftPlanWorkArea } from './ShiftPlanWorkArea';
4
+ import type { ShiftPlanWorkHours } from './ShiftPlanWorkHours';
5
+ import type { ListParticipants } from './ListParticipants';
6
+
7
+ export interface ShiftPlanChangeInput {
8
+ list?: ObjectId;
9
+ name: string;
10
+ timeZone: string;
11
+ settingsOverrides: ShiftPlanningPolicyOverrides;
12
+ workAreaCategories?: ShiftPlanWorkArea[];
13
+ defaultParticipantState?: ListParticipants['state'] | null;
14
+ workHours?: ShiftPlanWorkHours;
15
+ }
@@ -0,0 +1,15 @@
1
+ import type { ObjectId } from 'mongodb';
2
+ import type { ShiftPlanningPolicyOverrides } from './ShiftPlanningPolicyOverrides';
3
+ import type { ShiftPlanWorkArea } from './ShiftPlanWorkArea';
4
+ import type { ShiftPlanWorkHours } from './ShiftPlanWorkHours';
5
+ import type { ListParticipants } from './ListParticipants';
6
+
7
+ export interface ShiftPlanCreateInput {
8
+ list?: ObjectId;
9
+ name: string;
10
+ timeZone: string;
11
+ settingsOverrides?: ShiftPlanningPolicyOverrides;
12
+ workAreaCategories?: ShiftPlanWorkArea[];
13
+ defaultParticipantState?: ListParticipants['state'] | null;
14
+ workHours?: ShiftPlanWorkHours;
15
+ }
@@ -0,0 +1,12 @@
1
+ import type { ObjectId } from 'mongodb';
2
+ import type { ShiftPlanArea } from './ShiftPlanArea';
3
+
4
+ export interface ShiftPlanDay {
5
+ _id?: ObjectId;
6
+ company: string;
7
+ project: string;
8
+ plan: ObjectId;
9
+ date: string;
10
+ name?: string;
11
+ areas?: ShiftPlanArea[];
12
+ }
@@ -0,0 +1,7 @@
1
+ import type { ShiftPlanArea } from './ShiftPlanArea';
2
+
3
+ export interface ShiftPlanDayInput {
4
+ date: string;
5
+ name?: string;
6
+ areas?: ShiftPlanArea[];
7
+ }
@@ -0,0 +1,10 @@
1
+ import type { ObjectId } from 'mongodb';
2
+
3
+ /** Date filters are local planning dates; shift filters instead describe UTC instants. */
4
+ export interface ShiftPlanFilters {
5
+ list?: ObjectId;
6
+ from?: string;
7
+ to?: string;
8
+ search?: string;
9
+ site?: number;
10
+ }
@@ -0,0 +1,15 @@
1
+ import type { ShiftPlan } from './ShiftPlan';
2
+ import type { ShiftPlanDay } from './ShiftPlanDay';
3
+ import type { ShiftPlanningPolicy } from './ShiftPlanningPolicy';
4
+ import type { ShiftResponse } from './ShiftResponse';
5
+ import type { WorkArea } from './WorkArea';
6
+ import type { ListCategory } from './ListCategory';
7
+
8
+ export interface ShiftPlanResponse extends ShiftPlan {
9
+ days: ShiftPlanDay[];
10
+ effectiveSettings: ShiftPlanningPolicy | null;
11
+ workAreas: WorkArea[];
12
+ /** Categories of the linked employee list, for labelling the per-area category bindings. */
13
+ categories?: ListCategory[];
14
+ shifts?: ShiftResponse[];
15
+ }
@@ -0,0 +1,7 @@
1
+ import type { ObjectId } from 'mongodb';
2
+
3
+ /** A work area used by a plan, optionally bound to employee-list categories for its shifts. */
4
+ export interface ShiftPlanWorkArea {
5
+ area: ObjectId;
6
+ categoryIds?: ObjectId[];
7
+ }
@@ -0,0 +1,5 @@
1
+ /** Working hours a plan is scheduled within; rendered as the day's visible window. Absent means the full day (`0`–`24`). */
2
+ export interface ShiftPlanWorkHours {
3
+ start: number;
4
+ end: number;
5
+ }
@@ -0,0 +1,3 @@
1
+ import type { ShiftPlanningProjectOptions } from './ShiftPlanningProjectOptions';
2
+
3
+ export type ShiftPlanningCompanyOptions = Pick<ShiftPlanningProjectOptions, 'user' | 'app' | 'company'>;
@@ -0,0 +1,8 @@
1
+ import type { ObjectId } from 'mongodb';
2
+
3
+ export interface ShiftPlanningFilters {
4
+ from?: string;
5
+ to?: string;
6
+ site?: number;
7
+ area?: ObjectId;
8
+ }
@@ -0,0 +1,8 @@
1
+ import type { DatabaseQuerySites } from './DatabaseQuerySites';
2
+
3
+ export interface ShiftPlanningPage<T> {
4
+ data: T[];
5
+ all: number;
6
+ count: number;
7
+ sites: DatabaseQuerySites;
8
+ }
@@ -0,0 +1,14 @@
1
+ export interface ShiftPlanningPolicy {
2
+ daytime: { start: string; end: string };
3
+ nighttime: { start: string; end: string };
4
+ maximumConsecutiveWorkingDays: { enabled: boolean; days: number };
5
+ maximumDailyWorkMinutes: { enabled: boolean; minutes: number };
6
+ minimumRest: { enabled: boolean; minutes: number };
7
+ breaks: {
8
+ enabled: boolean;
9
+ maximumContinuousWorkMinutes: number;
10
+ minimumQualifyingBreakMinutes: number;
11
+ requirements: Array<{ afterWorkMinutes: number; minimumTotalBreakMinutes: number }>;
12
+ };
13
+ absenceEnforcement: boolean;
14
+ }
@@ -0,0 +1,4 @@
1
+ import type { ShiftPlanningPolicy } from './ShiftPlanningPolicy';
2
+
3
+ // An omitted group inherits; an explicit group replaces the company's group completely.
4
+ export type ShiftPlanningPolicyOverrides = Partial<ShiftPlanningPolicy>;
@@ -0,0 +1,3 @@
1
+ import type { UserAppWithOptions } from './UserAppWithOptions';
2
+
3
+ export type ShiftPlanningProjectOptions = Required<UserAppWithOptions>;
@@ -0,0 +1,9 @@
1
+ import type { ObjectId } from 'mongodb';
2
+ import type { ShiftPlanningPolicy } from './ShiftPlanningPolicy';
3
+
4
+ export interface ShiftPlanningSettings {
5
+ _id?: ObjectId;
6
+ company: string;
7
+ project: string;
8
+ settings: ShiftPlanningPolicy;
9
+ }
@@ -0,0 +1,5 @@
1
+ import type { ShiftPlanningPolicy } from './ShiftPlanningPolicy';
2
+
3
+ export interface ShiftPlanningSettingsInput {
4
+ settings: ShiftPlanningPolicy;
5
+ }
@@ -0,0 +1,7 @@
1
+ export interface ShiftPlanningViolation {
2
+ customer: string;
3
+ shift: string;
4
+ rule: 'absence' | 'rest' | 'consecutiveDays' | 'dailyHours' | 'breaks' | 'overlap' | 'settingsMissing';
5
+ relatedShift?: string;
6
+ absence?: string;
7
+ }
@@ -0,0 +1,19 @@
1
+ import type { WithId } from 'mongodb';
2
+ import type { CustomerPerson } from './CustomerPerson';
3
+ import type { EmployeeAbsence } from './EmployeeAbsence';
4
+ import type { ListParticipantWithCustomerAndPayment } from './ListParticipantWithUser';
5
+ import type { ListParticipants } from './ListParticipants';
6
+ import type { Shift } from './Shift';
7
+ import type { ShiftPlan } from './ShiftPlan';
8
+ import type { ShiftPlanningPolicy } from './ShiftPlanningPolicy';
9
+
10
+ /** Diagnostic snapshots contain internal data; member responses use a separate restricted projection. */
11
+ export interface ShiftReportContext {
12
+ schedules: WithId<Shift>[];
13
+ plans: WithId<ShiftPlan>[];
14
+ settings: ShiftPlanningPolicy | undefined;
15
+ absences: WithId<EmployeeAbsence>[];
16
+ participants: WithId<ListParticipants>[];
17
+ participantDetails: ListParticipantWithCustomerAndPayment[];
18
+ customers: WithId<CustomerPerson>[];
19
+ }
@@ -0,0 +1,11 @@
1
+ import type { Shift } from './Shift';
2
+ import type { ShiftParticipant } from './ShiftParticipant';
3
+ import type { ShiftPlanningViolation } from './ShiftPlanningViolation';
4
+ import type { ShiftWorkingTime } from './ShiftWorkingTime';
5
+
6
+ export interface ShiftResponse extends Shift {
7
+ participants: ShiftParticipant[];
8
+ unavailableParticipantIds: string[];
9
+ violations: ShiftPlanningViolation[];
10
+ workingTime: ShiftWorkingTime[];
11
+ }
@@ -0,0 +1,6 @@
1
+ export interface ShiftWorkingTime {
2
+ customer: string;
3
+ daytimeMinutes: number;
4
+ nighttimeMinutes: number;
5
+ breakMinutes: number;
6
+ }
@@ -0,0 +1,12 @@
1
+ import type { StructureConditionConstraint } from './StructureConditionConstraint';
2
+ import type { StructureConditionGrade } from './StructureConditionGrade';
3
+ import type { StructureConditionOperator } from './StructureConditionOperator';
4
+
5
+ export interface StructureCondition {
6
+ structure: string;
7
+ constraint?: StructureConditionConstraint;
8
+ grade?: StructureConditionGrade;
9
+ /** Comparison for a `number` structure's value; ignored for other types. */
10
+ operator?: StructureConditionOperator;
11
+ value?: string | number | boolean;
12
+ }
@@ -0,0 +1 @@
1
+ export type StructureConditionConstraint = 'required' | 'forbidden';
@@ -0,0 +1 @@
1
+ export type StructureConditionGrade = 'very-positive' | 'positive' | 'negative' | 'very-negative';
@@ -0,0 +1 @@
1
+ export type StructureConditionOperator = 'lt' | 'lte' | 'eq' | 'gt' | 'gte';
@@ -0,0 +1 @@
1
+ export type StructureConditionType = 'required' | 'forbidden' | 'very-positive' | 'positive' | 'negative' | 'very-negative';
@@ -0,0 +1 @@
1
+ export type StructureMatchState = 'fulfilled' | 'unfit';
@@ -1,10 +1,11 @@
1
+ import { BasicData } from "./BasicData";
1
2
  import { Structure } from "./Structure";
2
3
 
3
4
  /**
4
5
  * Base interface containing only the standard properties
5
6
  */
6
7
  interface BaseWithStructures {
7
- structures?: Structure[]
8
+ structures?: BasicData<Structure>[]
8
9
  }
9
10
 
10
11
  /**
@@ -0,0 +1,15 @@
1
+ import type { ObjectId } from 'mongodb';
2
+ import type { Address } from './Address';
3
+ import type { StructureCondition } from './StructureCondition';
4
+
5
+ export interface WorkArea {
6
+ _id: ObjectId;
7
+ id?: string;
8
+ company: string;
9
+ project: string;
10
+ name: string;
11
+ description?: string;
12
+ location?: string;
13
+ address?: Address;
14
+ structures?: StructureCondition[];
15
+ }
@@ -0,0 +1,4 @@
1
+ export interface WorkAreaFilters {
2
+ search?: string;
3
+ site?: number;
4
+ }
@@ -0,0 +1,3 @@
1
+ import type { WorkArea } from './WorkArea';
2
+
3
+ export type WorkAreaInput = Omit<WorkArea, '_id' | 'company' | 'project'>;