@opencrvs/toolkit 1.9.6-rc.751e422 → 1.9.6-rc.766edd7

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.
@@ -26718,6 +26718,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
26718
26718
  input: {
26719
26719
  transactionId: string;
26720
26720
  type: string;
26721
+ createdAtLocation?: string | null | undefined;
26721
26722
  };
26722
26723
  output: {
26723
26724
  id: string & import("zod").$brand<"UUID">;
@@ -31023,7 +31024,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
31023
31024
  }[];
31024
31025
  };
31025
31026
  actions: {
31026
- type: "DELETE" | "READ" | "DECLARE" | "REJECT" | "REGISTER" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "EDIT" | "ARCHIVE" | "MARK_AS_DUPLICATE" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
31027
+ type: "DELETE" | "READ" | "DECLARE" | "REJECT" | "REGISTER" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "EDIT" | "ARCHIVE" | "MARK_AS_DUPLICATE" | "ASSIGN" | "UNASSIGN";
31027
31028
  }[];
31028
31029
  columns: {
31029
31030
  label: {
@@ -27,8 +27,8 @@ export declare const NotifyActionInput: z.ZodObject<{
27
27
  annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
28
28
  originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID">>;
29
29
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
30
- createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID">>>;
31
30
  type: z.ZodDefault<z.ZodLiteral<"NOTIFY">>;
31
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID">>>;
32
32
  }, z.core.$strip>;
33
33
  export type NotifyActionInput = z.infer<typeof NotifyActionInput>;
34
34
  export declare const DeclareActionInput: z.ZodObject<{
@@ -261,8 +261,8 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
261
261
  annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
262
262
  originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID">>;
263
263
  keepAssignment: z.ZodOptional<z.ZodBoolean>;
264
- createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID">>>;
265
264
  type: z.ZodDefault<z.ZodLiteral<"NOTIFY">>;
265
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID">>>;
266
266
  }, z.core.$strip>, z.ZodObject<{
267
267
  eventId: z.core.$ZodBranded<z.ZodUUID, "UUID">;
268
268
  transactionId: z.ZodString;
@@ -2,6 +2,7 @@ import * as z from 'zod/v4';
2
2
  export declare const EventInput: z.ZodObject<{
3
3
  transactionId: z.ZodString;
4
4
  type: z.ZodString;
5
+ createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID">>>;
5
6
  }, z.core.$strip>;
6
7
  export type EventInput = z.infer<typeof EventInput>;
7
8
  //# sourceMappingURL=EventInput.d.ts.map
@@ -148,9 +148,9 @@ export declare const EventMetadataKeys: z.ZodEnum<{
148
148
  createdAtLocation: "createdAtLocation";
149
149
  assignedTo: "assignedTo";
150
150
  trackingId: "trackingId";
151
- placeOfEvent: "placeOfEvent";
152
151
  legalStatuses: "legalStatuses";
153
152
  dateOfEvent: "dateOfEvent";
153
+ placeOfEvent: "placeOfEvent";
154
154
  updatedByUserRole: "updatedByUserRole";
155
155
  updatedAtLocation: "updatedAtLocation";
156
156
  updatedAt: "updatedAt";
@@ -11,9 +11,9 @@ export declare const WorkqueueColumnKeys: z.ZodEnum<{
11
11
  createdAtLocation: "createdAtLocation";
12
12
  assignedTo: "assignedTo";
13
13
  trackingId: "trackingId";
14
- placeOfEvent: "placeOfEvent";
15
14
  legalStatuses: "legalStatuses";
16
15
  dateOfEvent: "dateOfEvent";
16
+ placeOfEvent: "placeOfEvent";
17
17
  updatedByUserRole: "updatedByUserRole";
18
18
  updatedAtLocation: "updatedAtLocation";
19
19
  updatedAt: "updatedAt";
@@ -34,9 +34,9 @@ export declare const WorkqueueColumnValue: z.ZodObject<{
34
34
  createdAtLocation: "createdAtLocation";
35
35
  assignedTo: "assignedTo";
36
36
  trackingId: "trackingId";
37
- placeOfEvent: "placeOfEvent";
38
37
  legalStatuses: "legalStatuses";
39
38
  dateOfEvent: "dateOfEvent";
39
+ placeOfEvent: "placeOfEvent";
40
40
  updatedByUserRole: "updatedByUserRole";
41
41
  updatedAtLocation: "updatedAtLocation";
42
42
  updatedAt: "updatedAt";
@@ -63,9 +63,9 @@ export declare const WorkqueueColumn: z.ZodObject<{
63
63
  createdAtLocation: "createdAtLocation";
64
64
  assignedTo: "assignedTo";
65
65
  trackingId: "trackingId";
66
- placeOfEvent: "placeOfEvent";
67
66
  legalStatuses: "legalStatuses";
68
67
  dateOfEvent: "dateOfEvent";
68
+ placeOfEvent: "placeOfEvent";
69
69
  updatedByUserRole: "updatedByUserRole";
70
70
  updatedAtLocation: "updatedAtLocation";
71
71
  updatedAt: "updatedAt";
@@ -84,7 +84,7 @@ export declare function defineWorkqueuesColumns(workqueueColumns: WorkqueueColum
84
84
  description: string;
85
85
  };
86
86
  value: {
87
- $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "placeOfEvent" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedAt" | "updatedBy" | "flags" | "outbox";
87
+ $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "legalStatuses" | "dateOfEvent" | "placeOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedAt" | "updatedBy" | "flags" | "outbox";
88
88
  };
89
89
  }[];
90
90
  //# sourceMappingURL=WorkqueueColumnConfig.d.ts.map
@@ -6,10 +6,11 @@ export declare const mandatoryColumns: {
6
6
  description: string;
7
7
  };
8
8
  value: {
9
- $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "placeOfEvent" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedAt" | "updatedBy" | "flags" | "outbox";
9
+ $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "legalStatuses" | "dateOfEvent" | "placeOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedAt" | "updatedBy" | "flags" | "outbox";
10
10
  };
11
11
  }[];
12
- export declare const WorkqueueActionsWithDefault: z.ZodEnum<{
12
+ /** Workqueue Call-to-action -button action type */
13
+ export declare const CtaActionType: z.ZodEnum<{
13
14
  DELETE: "DELETE";
14
15
  DECLARE: "DECLARE";
15
16
  REGISTER: "REGISTER";
@@ -22,9 +23,8 @@ export declare const WorkqueueActionsWithDefault: z.ZodEnum<{
22
23
  READ: "READ";
23
24
  ASSIGN: "ASSIGN";
24
25
  UNASSIGN: "UNASSIGN";
25
- DEFAULT: "DEFAULT";
26
26
  }>;
27
- export type WorkqueueActionsWithDefault = z.infer<typeof WorkqueueActionsWithDefault>;
27
+ export type CtaActionType = z.infer<typeof CtaActionType>;
28
28
  /**
29
29
  * Configuration for workqueue. Workqueues are used to display a list of events.
30
30
  */
@@ -534,7 +534,6 @@ export declare const WorkqueueConfig: z.ZodObject<{
534
534
  READ: "READ";
535
535
  ASSIGN: "ASSIGN";
536
536
  UNASSIGN: "UNASSIGN";
537
- DEFAULT: "DEFAULT";
538
537
  }>;
539
538
  }, z.core.$strip>>;
540
539
  columns: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -551,9 +550,9 @@ export declare const WorkqueueConfig: z.ZodObject<{
551
550
  createdAtLocation: "createdAtLocation";
552
551
  assignedTo: "assignedTo";
553
552
  trackingId: "trackingId";
554
- placeOfEvent: "placeOfEvent";
555
553
  legalStatuses: "legalStatuses";
556
554
  dateOfEvent: "dateOfEvent";
555
+ placeOfEvent: "placeOfEvent";
557
556
  updatedByUserRole: "updatedByUserRole";
558
557
  updatedAtLocation: "updatedAtLocation";
559
558
  updatedAt: "updatedAt";
@@ -791,7 +790,6 @@ export declare const WorkqueueConfigWithoutQuery: z.ZodObject<{
791
790
  READ: "READ";
792
791
  ASSIGN: "ASSIGN";
793
792
  UNASSIGN: "UNASSIGN";
794
- DEFAULT: "DEFAULT";
795
793
  }>;
796
794
  }, z.core.$strip>>;
797
795
  slug: z.ZodString;
@@ -1544,7 +1542,6 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1544
1542
  READ: "READ";
1545
1543
  ASSIGN: "ASSIGN";
1546
1544
  UNASSIGN: "UNASSIGN";
1547
- DEFAULT: "DEFAULT";
1548
1545
  }>;
1549
1546
  }, z.core.$strip>>;
1550
1547
  columns: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1561,9 +1558,9 @@ export declare const WorkqueueConfigInput: z.ZodObject<{
1561
1558
  createdAtLocation: "createdAtLocation";
1562
1559
  assignedTo: "assignedTo";
1563
1560
  trackingId: "trackingId";
1564
- placeOfEvent: "placeOfEvent";
1565
1561
  legalStatuses: "legalStatuses";
1566
1562
  dateOfEvent: "dateOfEvent";
1563
+ placeOfEvent: "placeOfEvent";
1567
1564
  updatedByUserRole: "updatedByUserRole";
1568
1565
  updatedAtLocation: "updatedAtLocation";
1569
1566
  updatedAt: "updatedAt";
@@ -1914,7 +1911,7 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
1914
1911
  }[];
1915
1912
  };
1916
1913
  actions: {
1917
- type: "DELETE" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "MARK_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
1914
+ type: "DELETE" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "MARK_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
1918
1915
  }[];
1919
1916
  columns: {
1920
1917
  label: {
@@ -1923,7 +1920,7 @@ export declare function defineWorkqueue(workqueueInput: WorkqueueConfigInput): {
1923
1920
  description: string;
1924
1921
  };
1925
1922
  value: {
1926
- $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "placeOfEvent" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedAt" | "updatedBy" | "flags" | "outbox";
1923
+ $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "legalStatuses" | "dateOfEvent" | "placeOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedAt" | "updatedBy" | "flags" | "outbox";
1927
1924
  };
1928
1925
  }[];
1929
1926
  icon: "Validated" | "Registered" | "Certified" | "Archived" | "List" | "Assigned" | "Briefcase" | "Close" | "Collapse" | "Draft" | "DuplicateYellow" | "Expand" | "ExternalValidate" | "FilledCheck" | "InReview" | "Offline" | "RequiresUpdates" | "Sent" | "WaitingApproval" | "ChartActivity" | "Activity" | "Archive" | "ArchiveTray" | "ArrowLeft" | "ArrowRight" | "Buildings" | "Circle" | "CaretDown" | "CaretLeft" | "CaretRight" | "ChartBar" | "ChartLine" | "ChatCircle" | "CheckSquare" | "Compass" | "Check" | "Copy" | "Database" | "DotsThreeVertical" | "ArrowCounterClockwise" | "MagnifyingGlassMinus" | "MagnifyingGlassPlus" | "Export" | "Eye" | "EyeSlash" | "Envelope" | "File" | "FileSearch" | "FileMinus" | "FilePlus" | "FileText" | "FileX" | "Handshake" | "Gear" | "GitBranch" | "IdentificationCard" | "ListBullets" | "Lock" | "MagnifyingGlass" | "MapPin" | "Medal" | "NotePencil" | "Paperclip" | "PaperPlaneTilt" | "Pen" | "PenNib" | "Pencil" | "PencilSimpleLine" | "Phone" | "Plus" | "Printer" | "SignOut" | "Stamp" | "Star" | "Target" | "TextT" | "Trash" | "UploadSimple" | "User" | "UserPlus" | "Users" | "WarningCircle" | "X" | "ChatText" | "CircleWavyCheck" | "CircleWavyQuestion" | "ArchiveBox" | "ArrowCircleDown" | "FileArrowUp" | "FileDotted" | "Files" | "PencilLine" | "PencilCircle" | "UserCircle" | "Clock" | "QrCode" | "Webcam" | "Sun" | "DeviceTabletCamera" | "Globe" | "Fingerprint" | "PushPin" | "Timer";
@@ -2164,7 +2161,7 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInput[]): {
2164
2161
  }[];
2165
2162
  };
2166
2163
  actions: {
2167
- type: "DELETE" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "MARK_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN" | "DEFAULT";
2164
+ type: "DELETE" | "DECLARE" | "REGISTER" | "EDIT" | "REJECT" | "MARK_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
2168
2165
  }[];
2169
2166
  columns: {
2170
2167
  label: {
@@ -2173,7 +2170,7 @@ export declare function defineWorkqueues(workqueues: WorkqueueConfigInput[]): {
2173
2170
  description: string;
2174
2171
  };
2175
2172
  value: {
2176
- $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "placeOfEvent" | "legalStatuses" | "dateOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedAt" | "updatedBy" | "flags" | "outbox";
2173
+ $event: "type" | "id" | "status" | "title" | "createdByUserType" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "trackingId" | "legalStatuses" | "dateOfEvent" | "placeOfEvent" | "updatedByUserRole" | "updatedAtLocation" | "updatedAt" | "updatedBy" | "flags" | "outbox";
2177
2174
  };
2178
2175
  }[];
2179
2176
  icon: "Validated" | "Registered" | "Certified" | "Archived" | "List" | "Assigned" | "Briefcase" | "Close" | "Collapse" | "Draft" | "DuplicateYellow" | "Expand" | "ExternalValidate" | "FilledCheck" | "InReview" | "Offline" | "RequiresUpdates" | "Sent" | "WaitingApproval" | "ChartActivity" | "Activity" | "Archive" | "ArchiveTray" | "ArrowLeft" | "ArrowRight" | "Buildings" | "Circle" | "CaretDown" | "CaretLeft" | "CaretRight" | "ChartBar" | "ChartLine" | "ChatCircle" | "CheckSquare" | "Compass" | "Check" | "Copy" | "Database" | "DotsThreeVertical" | "ArrowCounterClockwise" | "MagnifyingGlassMinus" | "MagnifyingGlassPlus" | "Export" | "Eye" | "EyeSlash" | "Envelope" | "File" | "FileSearch" | "FileMinus" | "FilePlus" | "FileText" | "FileX" | "Handshake" | "Gear" | "GitBranch" | "IdentificationCard" | "ListBullets" | "Lock" | "MagnifyingGlass" | "MapPin" | "Medal" | "NotePencil" | "Paperclip" | "PaperPlaneTilt" | "Pen" | "PenNib" | "Pencil" | "PencilSimpleLine" | "Phone" | "Plus" | "Printer" | "SignOut" | "Stamp" | "Star" | "Target" | "TextT" | "Trash" | "UploadSimple" | "User" | "UserPlus" | "Users" | "WarningCircle" | "X" | "ChatText" | "CircleWavyCheck" | "CircleWavyQuestion" | "ArchiveBox" | "ArrowCircleDown" | "FileArrowUp" | "FileDotted" | "Files" | "PencilLine" | "PencilCircle" | "UserCircle" | "Clock" | "QrCode" | "Webcam" | "Sun" | "DeviceTabletCamera" | "Globe" | "Fingerprint" | "PushPin" | "Timer";
@@ -35,7 +35,6 @@ export declare function resolvePlaceOfEvent(eventMetadata: {
35
35
  export declare function extractPotentialDuplicatesFromActions(actions: Action[]): PotentialDuplicate[];
36
36
  /**
37
37
  * NOTE: This function should not run field validations. It should return the state based on the actions, without considering context (users, roles, permissions, etc).
38
- createdAtLocation: CreatedAtLocation
39
38
  *
40
39
  * If you update this function, please ensure @EventIndex type is updated accordingly.
41
40
  * In most cases, you won't need to add new parameters to this function. Discuss with the team before doing so.
@@ -75,6 +75,7 @@ __export(events_exports, {
75
75
  ConditionalType: () => ConditionalType,
76
76
  ConfirmableActions: () => ConfirmableActions,
77
77
  ContainsFlags: () => ContainsFlags,
78
+ CtaActionType: () => CtaActionType,
78
79
  CustomActionInput: () => CustomActionInput,
79
80
  CustomFieldValue: () => CustomFieldValue,
80
81
  CustomFlag: () => CustomFlag,
@@ -210,7 +211,6 @@ __export(events_exports, {
210
211
  VerificationPageConfig: () => VerificationPageConfig,
211
212
  VerificationStatusValue: () => VerificationStatusValue,
212
213
  Within: () => Within,
213
- WorkqueueActionsWithDefault: () => WorkqueueActionsWithDefault,
214
214
  WorkqueueColumn: () => WorkqueueColumn,
215
215
  WorkqueueColumnKeys: () => WorkqueueColumnKeys,
216
216
  WorkqueueColumnKeysArray: () => WorkqueueColumnKeysArray,
@@ -972,9 +972,6 @@ var z14 = __toESM(require("zod/v4"));
972
972
  // ../commons/src/events/ActionDocument.ts
973
973
  var z12 = __toESM(require("zod/v4"));
974
974
 
975
- // ../commons/src/events/CreatedAtLocation.ts
976
- var CreatedAtLocation = UUID.nullish();
977
-
978
975
  // ../commons/src/authentication.ts
979
976
  var import_jwt_decode = __toESM(require("jwt-decode"));
980
977
  var z11 = __toESM(require("zod/v4"));
@@ -1439,7 +1436,8 @@ var ActionBase = z12.object({
1439
1436
  createdBy: z12.string().describe("Identifier of the user who created the action."),
1440
1437
  createdByRole: z12.string().describe("Role of the user who created the action."),
1441
1438
  createdBySignature: z12.string().nullish().describe("Reference to the signature of the user who created the action."),
1442
- createdAtLocation: CreatedAtLocation.describe(
1439
+ // @TODO: createdAtLocation should be non-nullable in the future once all actions have this field populated.
1440
+ createdAtLocation: UUID.nullish().describe(
1443
1441
  "Reference to the location of the user who created the action."
1444
1442
  ),
1445
1443
  declaration: ActionUpdate.describe(
@@ -1674,7 +1672,8 @@ var ZodDate = z14.iso.date();
1674
1672
  var ActionCreationMetadata = z14.object({
1675
1673
  createdAt: z14.iso.datetime().describe("The timestamp when the action request was created."),
1676
1674
  createdBy: z14.string().describe("ID of the user who created the action request."),
1677
- createdAtLocation: CreatedAtLocation.describe(
1675
+ // @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
1676
+ createdAtLocation: UUID.nullish().describe(
1678
1677
  "Location of the user who created the action request."
1679
1678
  ),
1680
1679
  createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
@@ -1700,11 +1699,12 @@ var EventMetadata = z14.object({
1700
1699
  ),
1701
1700
  createdAt: z14.iso.datetime().describe("The timestamp when the event was first created and saved."),
1702
1701
  dateOfEvent: ZodDate.nullish(),
1703
- placeOfEvent: CreatedAtLocation,
1702
+ placeOfEvent: UUID.nullish(),
1704
1703
  createdBy: z14.string().describe("ID of the user who created the event."),
1705
1704
  createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1706
1705
  updatedByUserRole: z14.string().describe("Role of the user who last changed the status."),
1707
- createdAtLocation: CreatedAtLocation.describe(
1706
+ // @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
1707
+ createdAtLocation: UUID.nullish().describe(
1708
1708
  "Location of the user who created the event."
1709
1709
  ),
1710
1710
  createdBySignature: z14.string().nullish().describe("Signature of the user who created the event."),
@@ -5345,11 +5345,7 @@ var mandatoryColumns = defineWorkqueuesColumns([
5345
5345
  value: event.field("updatedAt")
5346
5346
  }
5347
5347
  ]);
5348
- var WorkqueueActionsWithDefault = z33.enum([
5349
- ...workqueueActions.options,
5350
- "DEFAULT",
5351
- ActionType.READ
5352
- ]);
5348
+ var CtaActionType = z33.enum([...workqueueActions.options, ActionType.READ]);
5353
5349
  var WorkqueueConfig = z33.object({
5354
5350
  slug: z33.string().describe("Determines the url of the workqueue."),
5355
5351
  name: TranslationConfig.describe(
@@ -5358,7 +5354,7 @@ var WorkqueueConfig = z33.object({
5358
5354
  query: CountryConfigQueryType,
5359
5355
  /** This action object used to contain a conditionals option, but it was not used anywhere.
5360
5356
  * It's also debatable whether it should be an array, or just a single action. */
5361
- actions: z33.array(z33.object({ type: WorkqueueActionsWithDefault })).describe("Workqueue call-to-action button configuration."),
5357
+ actions: z33.array(z33.object({ type: CtaActionType })).describe("Workqueue call-to-action button configuration."),
5362
5358
  columns: z33.array(WorkqueueColumn).default(mandatoryColumns),
5363
5359
  icon: AvailableIcons,
5364
5360
  emptyMessage: TranslationConfig.optional()
@@ -5373,7 +5369,7 @@ var WorkqueueConfigInput = z33.object({
5373
5369
  "Title of the workflow (both in navigation and on the page)"
5374
5370
  ),
5375
5371
  query: CountryConfigQueryInputType,
5376
- actions: z33.array(z33.object({ type: WorkqueueActionsWithDefault })).describe("Workqueue call-to-action button configuration."),
5372
+ actions: z33.array(z33.object({ type: CtaActionType })).describe("Workqueue call-to-action button configuration."),
5377
5373
  columns: z33.array(WorkqueueColumn).default(mandatoryColumns),
5378
5374
  icon: AvailableIcons,
5379
5375
  emptyMessage: TranslationConfig.optional()
@@ -5425,14 +5421,18 @@ var BaseActionInput = z34.object({
5425
5421
  // should not be part of base action.
5426
5422
  keepAssignment: z34.boolean().optional(),
5427
5423
  // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
5428
- createdAtLocation: CreatedAtLocation.describe(
5424
+ // @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
5425
+ createdAtLocation: UUID.nullish().describe(
5429
5426
  "A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
5430
5427
  )
5431
5428
  });
5432
5429
  var CreateActionInput = BaseActionInput.extend(
5433
5430
  z34.object({
5434
5431
  type: z34.literal(ActionType.CREATE).default(ActionType.CREATE),
5435
- createdAtLocation: CreatedAtLocation
5432
+ // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
5433
+ createdAtLocation: UUID.nullish().describe(
5434
+ "A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
5435
+ )
5436
5436
  }).shape
5437
5437
  );
5438
5438
  var RegisterActionInput = BaseActionInput.extend(
@@ -5443,7 +5443,11 @@ var RegisterActionInput = BaseActionInput.extend(
5443
5443
  );
5444
5444
  var NotifyActionInput = BaseActionInput.extend(
5445
5445
  z34.object({
5446
- type: z34.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
5446
+ type: z34.literal(ActionType.NOTIFY).default(ActionType.NOTIFY),
5447
+ // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
5448
+ createdAtLocation: UUID.nullish().describe(
5449
+ "A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
5450
+ )
5447
5451
  }).shape
5448
5452
  ).meta({
5449
5453
  default: {
@@ -5606,11 +5610,14 @@ var DraftInput = BaseActionInput.extend({
5606
5610
 
5607
5611
  // ../commons/src/events/EventInput.ts
5608
5612
  var z36 = __toESM(require("zod/v4"));
5609
- var import_uuid10 = require("uuid");
5613
+ var import_uuid9 = require("uuid");
5610
5614
  var EventInput = z36.object({
5611
5615
  transactionId: z36.string(),
5612
- type: z36.string()
5613
- }).meta({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
5616
+ type: z36.string(),
5617
+ createdAtLocation: UUID.nullish().describe(
5618
+ "Location where the event occurred. Required for system users."
5619
+ )
5620
+ }).meta({ default: { transactionId: (0, import_uuid9.v4)(), type: "birth" } });
5614
5621
 
5615
5622
  // ../commons/src/events/EventDocument.ts
5616
5623
  var z37 = __toESM(require("zod/v4"));
@@ -9163,7 +9170,7 @@ var generateWorkqueues = (slug = "all-events") => defineWorkqueues([
9163
9170
  type: "and",
9164
9171
  clauses: [{ eventType: tennisClubMembershipEvent.id }]
9165
9172
  },
9166
- actions: [{ type: "DEFAULT" }],
9173
+ actions: [{ type: ActionType.READ }],
9167
9174
  icon: "Draft"
9168
9175
  }
9169
9176
  ]);
@@ -609,9 +609,6 @@ var z14 = __toESM(require("zod/v4"));
609
609
  // ../commons/src/events/ActionDocument.ts
610
610
  var z12 = __toESM(require("zod/v4"));
611
611
 
612
- // ../commons/src/events/CreatedAtLocation.ts
613
- var CreatedAtLocation = UUID.nullish();
614
-
615
612
  // ../commons/src/authentication.ts
616
613
  var import_jwt_decode = __toESM(require("jwt-decode"));
617
614
  var z11 = __toESM(require("zod/v4"));
@@ -1022,7 +1019,8 @@ var ActionBase = z12.object({
1022
1019
  createdBy: z12.string().describe("Identifier of the user who created the action."),
1023
1020
  createdByRole: z12.string().describe("Role of the user who created the action."),
1024
1021
  createdBySignature: z12.string().nullish().describe("Reference to the signature of the user who created the action."),
1025
- createdAtLocation: CreatedAtLocation.describe(
1022
+ // @TODO: createdAtLocation should be non-nullable in the future once all actions have this field populated.
1023
+ createdAtLocation: UUID.nullish().describe(
1026
1024
  "Reference to the location of the user who created the action."
1027
1025
  ),
1028
1026
  declaration: ActionUpdate.describe(
@@ -1257,7 +1255,8 @@ var ZodDate = z14.iso.date();
1257
1255
  var ActionCreationMetadata = z14.object({
1258
1256
  createdAt: z14.iso.datetime().describe("The timestamp when the action request was created."),
1259
1257
  createdBy: z14.string().describe("ID of the user who created the action request."),
1260
- createdAtLocation: CreatedAtLocation.describe(
1258
+ // @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
1259
+ createdAtLocation: UUID.nullish().describe(
1261
1260
  "Location of the user who created the action request."
1262
1261
  ),
1263
1262
  createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
@@ -1283,11 +1282,12 @@ var EventMetadata = z14.object({
1283
1282
  ),
1284
1283
  createdAt: z14.iso.datetime().describe("The timestamp when the event was first created and saved."),
1285
1284
  dateOfEvent: ZodDate.nullish(),
1286
- placeOfEvent: CreatedAtLocation,
1285
+ placeOfEvent: UUID.nullish(),
1287
1286
  createdBy: z14.string().describe("ID of the user who created the event."),
1288
1287
  createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1289
1288
  updatedByUserRole: z14.string().describe("Role of the user who last changed the status."),
1290
- createdAtLocation: CreatedAtLocation.describe(
1289
+ // @TODO: createdAtLocation should be non-nullable in the future once all action requests have this field populated.
1290
+ createdAtLocation: UUID.nullish().describe(
1291
1291
  "Location of the user who created the event."
1292
1292
  ),
1293
1293
  createdBySignature: z14.string().nullish().describe("Signature of the user who created the event."),
@@ -3819,11 +3819,7 @@ var mandatoryColumns = defineWorkqueuesColumns([
3819
3819
  value: event.field("updatedAt")
3820
3820
  }
3821
3821
  ]);
3822
- var WorkqueueActionsWithDefault = z33.enum([
3823
- ...workqueueActions.options,
3824
- "DEFAULT",
3825
- ActionType.READ
3826
- ]);
3822
+ var CtaActionType = z33.enum([...workqueueActions.options, ActionType.READ]);
3827
3823
  var WorkqueueConfig = z33.object({
3828
3824
  slug: z33.string().describe("Determines the url of the workqueue."),
3829
3825
  name: TranslationConfig.describe(
@@ -3832,7 +3828,7 @@ var WorkqueueConfig = z33.object({
3832
3828
  query: CountryConfigQueryType,
3833
3829
  /** This action object used to contain a conditionals option, but it was not used anywhere.
3834
3830
  * It's also debatable whether it should be an array, or just a single action. */
3835
- actions: z33.array(z33.object({ type: WorkqueueActionsWithDefault })).describe("Workqueue call-to-action button configuration."),
3831
+ actions: z33.array(z33.object({ type: CtaActionType })).describe("Workqueue call-to-action button configuration."),
3836
3832
  columns: z33.array(WorkqueueColumn).default(mandatoryColumns),
3837
3833
  icon: AvailableIcons,
3838
3834
  emptyMessage: TranslationConfig.optional()
@@ -3847,7 +3843,7 @@ var WorkqueueConfigInput = z33.object({
3847
3843
  "Title of the workflow (both in navigation and on the page)"
3848
3844
  ),
3849
3845
  query: CountryConfigQueryInputType,
3850
- actions: z33.array(z33.object({ type: WorkqueueActionsWithDefault })).describe("Workqueue call-to-action button configuration."),
3846
+ actions: z33.array(z33.object({ type: CtaActionType })).describe("Workqueue call-to-action button configuration."),
3851
3847
  columns: z33.array(WorkqueueColumn).default(mandatoryColumns),
3852
3848
  icon: AvailableIcons,
3853
3849
  emptyMessage: TranslationConfig.optional()
@@ -3891,14 +3887,18 @@ var BaseActionInput = z34.object({
3891
3887
  // should not be part of base action.
3892
3888
  keepAssignment: z34.boolean().optional(),
3893
3889
  // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
3894
- createdAtLocation: CreatedAtLocation.describe(
3890
+ // @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
3891
+ createdAtLocation: UUID.nullish().describe(
3895
3892
  "A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
3896
3893
  )
3897
3894
  });
3898
3895
  var CreateActionInput = BaseActionInput.extend(
3899
3896
  z34.object({
3900
3897
  type: z34.literal(ActionType.CREATE).default(ActionType.CREATE),
3901
- createdAtLocation: CreatedAtLocation
3898
+ // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
3899
+ createdAtLocation: UUID.nullish().describe(
3900
+ "A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
3901
+ )
3902
3902
  }).shape
3903
3903
  );
3904
3904
  var RegisterActionInput = BaseActionInput.extend(
@@ -3909,7 +3909,11 @@ var RegisterActionInput = BaseActionInput.extend(
3909
3909
  );
3910
3910
  var NotifyActionInput = BaseActionInput.extend(
3911
3911
  z34.object({
3912
- type: z34.literal(ActionType.NOTIFY).default(ActionType.NOTIFY)
3912
+ type: z34.literal(ActionType.NOTIFY).default(ActionType.NOTIFY),
3913
+ // For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
3914
+ createdAtLocation: UUID.nullish().describe(
3915
+ "A valid office location ID. This is required for system users performing actions. The provided location must be a leaf-location, i.e. it must not have any children locations."
3916
+ )
3913
3917
  }).shape
3914
3918
  ).meta({
3915
3919
  default: {
@@ -4072,11 +4076,14 @@ var DraftInput = BaseActionInput.extend({
4072
4076
 
4073
4077
  // ../commons/src/events/EventInput.ts
4074
4078
  var z36 = __toESM(require("zod/v4"));
4075
- var import_uuid10 = require("uuid");
4079
+ var import_uuid9 = require("uuid");
4076
4080
  var EventInput = z36.object({
4077
4081
  transactionId: z36.string(),
4078
- type: z36.string()
4079
- }).meta({ default: { transactionId: (0, import_uuid10.v4)(), type: "birth" } });
4082
+ type: z36.string(),
4083
+ createdAtLocation: UUID.nullish().describe(
4084
+ "Location where the event occurred. Required for system users."
4085
+ )
4086
+ }).meta({ default: { transactionId: (0, import_uuid9.v4)(), type: "birth" } });
4080
4087
 
4081
4088
  // ../commons/src/events/EventDocument.ts
4082
4089
  var z37 = __toESM(require("zod/v4"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.9.6-rc.751e422",
3
+ "version": "1.9.6-rc.766edd7",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {
@@ -1,2 +0,0 @@
1
- export declare const CreatedAtLocation: import("zod").ZodOptional<import("zod").ZodNullable<import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "UUID">>>;
2
- //# sourceMappingURL=CreatedAtLocation.d.ts.map