@opencrvs/toolkit 1.9.2-rc.c76ff3e → 1.9.2-rc.f1d7235

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.
@@ -51,7 +51,7 @@ var TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
51
51
  var CHILD_ONBOARDING_EVENT = "child-onboarding";
52
52
 
53
53
  // ../commons/src/events/ActionConfig.ts
54
- var z20 = __toESM(require("zod/v4"));
54
+ var z21 = __toESM(require("zod/v4"));
55
55
 
56
56
  // ../commons/src/events/TranslationConfig.ts
57
57
  var z = __toESM(require("zod/v4"));
@@ -266,7 +266,8 @@ var FieldType = {
266
266
  QUERY_PARAM_READER: "QUERY_PARAM_READER",
267
267
  QR_READER: "QR_READER",
268
268
  ID_READER: "ID_READER",
269
- LOADER: "LOADER"
269
+ LOADER: "LOADER",
270
+ HIDDEN: "HIDDEN"
270
271
  };
271
272
  var FileFieldType = z4.enum([
272
273
  FieldType.FILE,
@@ -396,6 +397,7 @@ var IdReaderFieldValue = ReadDataValue;
396
397
 
397
398
  // ../commons/src/events/FieldValue.ts
398
399
  var TextValue = z7.string();
400
+ var HiddenFieldValue = z7.string();
399
401
  var NonEmptyTextValue = TextValue.min(1);
400
402
  var DateValue = z7.iso.date().describe("Date in the format YYYY-MM-DD");
401
403
  var AgeValue = z7.object({
@@ -521,7 +523,8 @@ var FieldUpdateValue = safeUnion([
521
523
  DataFieldValue.describe("DataFieldValue"),
522
524
  NameFieldUpdateValue.describe("NameFieldUpdateValue"),
523
525
  HttpFieldUpdateValue.describe("HttpFieldUpdateValue"),
524
- QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue")
526
+ QueryParamReaderFieldUpdateValue.describe("QueryParamReaderFieldUpdateValue"),
527
+ HiddenFieldValue.describe("HiddenFieldValue")
525
528
  ]);
526
529
 
527
530
  // ../commons/src/uuid.ts
@@ -815,6 +818,11 @@ var ConfigurableRawScopes = z10.discriminatedUnion("type", [
815
818
  RecordScope,
816
819
  CustomActionScope
817
820
  ]);
821
+ var ConfigurableActionScopes = z10.discriminatedUnion("type", [
822
+ // @TODO - Record scope holds non-action scopes as well e.g., `record.read`
823
+ RecordScope,
824
+ CustomActionScope
825
+ ]);
818
826
  var scopes = Object.values(SCOPES);
819
827
  var ActionScopes = z10.union([
820
828
  DeclareScopes,
@@ -1186,7 +1194,7 @@ var FlagConfig = z13.object({
1186
1194
  label: TranslationConfig.describe("Human readable label of the flag.")
1187
1195
  });
1188
1196
  var ActionFlagConfig = z13.object({
1189
- id: CustomFlag,
1197
+ id: Flag,
1190
1198
  operation: z13.enum(["add", "remove"]).describe("Operation to perform on the flag."),
1191
1199
  conditional: Conditional.optional().describe(
1192
1200
  "When conditional is met, the operation is performed on the flag. If not provided, the operation is performed unconditionally."
@@ -1231,6 +1239,7 @@ var EventMetadata = z14.object({
1231
1239
  ),
1232
1240
  createdAt: z14.iso.datetime().describe("The timestamp when the event was first created and saved."),
1233
1241
  dateOfEvent: ZodDate.nullish(),
1242
+ placeOfEvent: CreatedAtLocation,
1234
1243
  createdBy: z14.string().describe("ID of the user who created the event."),
1235
1244
  createdByUserType: z14.enum(["user", "system"]).nullish().describe("Whether the user is a normal user or a system."),
1236
1245
  updatedByUserRole: z14.string().describe("Role of the user who last changed the status."),
@@ -1260,6 +1269,7 @@ var EventMetadataKeysArray = [
1260
1269
  "status",
1261
1270
  "createdAt",
1262
1271
  "dateOfEvent",
1272
+ "placeOfEvent",
1263
1273
  "createdBy",
1264
1274
  "createdByUserType",
1265
1275
  "updatedByUserRole",
@@ -1953,6 +1963,13 @@ var LoaderField = BaseField.extend({
1953
1963
  }).describe(
1954
1964
  "A non-interactive field that indicates an in progress operation in form"
1955
1965
  );
1966
+ var HiddenField = BaseField.extend({
1967
+ type: z16.literal(FieldType.HIDDEN),
1968
+ required: z16.literal(false).optional()
1969
+ // Hidden fields cannot be required
1970
+ }).describe(
1971
+ "A non-interactive, hidden field that only hold a value in the form"
1972
+ );
1956
1973
  var FieldConfig = z16.discriminatedUnion("type", [
1957
1974
  Address,
1958
1975
  TextField,
@@ -1992,7 +2009,8 @@ var FieldConfig = z16.discriminatedUnion("type", [
1992
2009
  IdReaderField,
1993
2010
  QueryParamReaderField,
1994
2011
  LoaderField,
1995
- SearchField
2012
+ SearchField,
2013
+ HiddenField
1996
2014
  ]).meta({
1997
2015
  description: "Form field configuration",
1998
2016
  id: "FieldConfig"
@@ -2147,82 +2165,188 @@ var DeduplicationConfig = z19.object({
2147
2165
  query: Clause
2148
2166
  });
2149
2167
 
2168
+ // ../commons/src/icons.ts
2169
+ var z20 = __toESM(require("zod/v4"));
2170
+ var AvailableIcons = z20.enum([
2171
+ "Archived",
2172
+ "Assigned",
2173
+ "Certified",
2174
+ "Close",
2175
+ "Collapse",
2176
+ "Draft",
2177
+ "DuplicateYellow",
2178
+ "Expand",
2179
+ "ExternalValidate",
2180
+ "FilledCheck",
2181
+ "InReview",
2182
+ "Offline",
2183
+ "Registered",
2184
+ "RequiresUpdates",
2185
+ "Sent",
2186
+ "Validated",
2187
+ "WaitingApproval",
2188
+ "ChartActivity",
2189
+ "Activity",
2190
+ "Archive",
2191
+ "ArchiveTray",
2192
+ "ArrowLeft",
2193
+ "ArrowRight",
2194
+ "Buildings",
2195
+ "Circle",
2196
+ "CaretDown",
2197
+ "CaretLeft",
2198
+ "CaretRight",
2199
+ "ChartBar",
2200
+ "ChartLine",
2201
+ "ChatCircle",
2202
+ "CheckSquare",
2203
+ "Compass",
2204
+ "Check",
2205
+ "Copy",
2206
+ "Database",
2207
+ "DotsThreeVertical",
2208
+ "ArrowCounterClockwise",
2209
+ "MagnifyingGlassMinus",
2210
+ "MagnifyingGlassPlus",
2211
+ "Export",
2212
+ "Eye",
2213
+ "EyeSlash",
2214
+ "Envelope",
2215
+ "File",
2216
+ "FileSearch",
2217
+ "FileMinus",
2218
+ "FilePlus",
2219
+ "FileText",
2220
+ "FileX",
2221
+ "Handshake",
2222
+ "Gear",
2223
+ "GitBranch",
2224
+ "IdentificationCard",
2225
+ "List",
2226
+ "ListBullets",
2227
+ "Lock",
2228
+ "MagnifyingGlass",
2229
+ "MapPin",
2230
+ "Medal",
2231
+ "NotePencil",
2232
+ "Paperclip",
2233
+ "PaperPlaneTilt",
2234
+ "Pen",
2235
+ "Pencil",
2236
+ "PencilSimpleLine",
2237
+ "Phone",
2238
+ "Plus",
2239
+ "Printer",
2240
+ "SignOut",
2241
+ "Stamp",
2242
+ "Star",
2243
+ "Target",
2244
+ "TextT",
2245
+ "Trash",
2246
+ "UploadSimple",
2247
+ "User",
2248
+ "UserPlus",
2249
+ "Users",
2250
+ "WarningCircle",
2251
+ "X",
2252
+ "CircleWavyCheck",
2253
+ "CircleWavyQuestion",
2254
+ "ArchiveBox",
2255
+ "ArrowCircleDown",
2256
+ "FileArrowUp",
2257
+ "FileDotted",
2258
+ "Files",
2259
+ "PencilLine",
2260
+ "PencilCircle",
2261
+ "UserCircle",
2262
+ "Clock",
2263
+ "QrCode",
2264
+ "Webcam",
2265
+ "Sun",
2266
+ "DeviceTabletCamera",
2267
+ "Globe",
2268
+ "Fingerprint",
2269
+ "PushPin",
2270
+ "Timer"
2271
+ ]);
2272
+
2150
2273
  // ../commons/src/events/ActionConfig.ts
2151
- var DeclarationReviewConfig = z20.object({
2274
+ var DeclarationReviewConfig = z21.object({
2152
2275
  title: TranslationConfig.describe("Title of the review page"),
2153
- fields: z20.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
2276
+ fields: z21.array(FieldConfig).describe("Fields displayed on the review page for annotations.")
2154
2277
  }).describe(
2155
2278
  "Configuration of the declaration review page for collecting event-related metadata."
2156
2279
  );
2157
- var ActionConfigBase = z20.object({
2280
+ var ActionConfigBase = z21.object({
2158
2281
  label: TranslationConfig.describe("Human readable description of the action"),
2159
- flags: z20.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
2282
+ flags: z21.array(ActionFlagConfig).optional().default([]).describe("Flag actions which are executed when the action is performed."),
2160
2283
  auditHistoryLabel: TranslationConfig.describe(
2161
2284
  'The label to show in audit history for this action. For example "Approved".'
2162
2285
  ).optional(),
2163
2286
  supportingCopy: TranslationConfig.optional().describe(
2164
2287
  "Text displayed on the confirmation"
2165
2288
  ),
2166
- conditionals: z20.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
2289
+ icon: AvailableIcons.describe("Icon representing the action").optional(),
2290
+ conditionals: z21.array(ActionConditional).optional().describe("Conditionals which can disable or hide actions.")
2167
2291
  });
2168
2292
  var DeclarationActionBase = ActionConfigBase.extend({
2169
2293
  deduplication: DeduplicationConfig.optional()
2170
2294
  });
2171
2295
  var ReadActionConfig = ActionConfigBase.extend(
2172
- z20.object({
2173
- type: z20.literal(ActionType.READ),
2296
+ z21.object({
2297
+ type: z21.literal(ActionType.READ),
2174
2298
  review: DeclarationReviewConfig.describe(
2175
2299
  "Configuration of the review page for read-only view."
2176
2300
  ),
2177
- conditionals: z20.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
2301
+ conditionals: z21.never().optional().describe("Read-action can not be disabled or hidden with conditionals.")
2178
2302
  }).shape
2179
2303
  );
2180
2304
  var DeclareConfig = DeclarationActionBase.extend(
2181
- z20.object({
2182
- type: z20.literal(ActionType.DECLARE),
2305
+ z21.object({
2306
+ type: z21.literal(ActionType.DECLARE),
2183
2307
  review: DeclarationReviewConfig.describe(
2184
2308
  "Configuration of the review page fields."
2185
2309
  )
2186
2310
  }).shape
2187
2311
  );
2188
2312
  var RejectConfig = ActionConfigBase.extend(
2189
- z20.object({
2190
- type: z20.literal(ActionType.REJECT)
2313
+ z21.object({
2314
+ type: z21.literal(ActionType.REJECT)
2191
2315
  }).shape
2192
2316
  );
2193
2317
  var ValidateConfig = DeclarationActionBase.extend(
2194
- z20.object({
2195
- type: z20.literal(ActionType.VALIDATE)
2318
+ z21.object({
2319
+ type: z21.literal(ActionType.VALIDATE)
2196
2320
  }).shape
2197
2321
  );
2198
2322
  var RegisterConfig = DeclarationActionBase.extend(
2199
- z20.object({
2200
- type: z20.literal(ActionType.REGISTER)
2323
+ z21.object({
2324
+ type: z21.literal(ActionType.REGISTER)
2201
2325
  }).shape
2202
2326
  );
2203
2327
  var PrintCertificateActionConfig = ActionConfigBase.extend(
2204
- z20.object({
2205
- type: z20.literal(ActionType.PRINT_CERTIFICATE),
2328
+ z21.object({
2329
+ type: z21.literal(ActionType.PRINT_CERTIFICATE),
2206
2330
  printForm: ActionFormConfig
2207
2331
  }).shape
2208
2332
  );
2209
2333
  var RequestCorrectionConfig = ActionConfigBase.extend(
2210
- z20.object({
2211
- type: z20.literal(ActionType.REQUEST_CORRECTION),
2334
+ z21.object({
2335
+ type: z21.literal(ActionType.REQUEST_CORRECTION),
2212
2336
  correctionForm: ActionFormConfig
2213
2337
  }).shape
2214
2338
  );
2215
2339
  var CustomActionConfig = ActionConfigBase.merge(
2216
- z20.object({
2217
- type: z20.literal(ActionType.CUSTOM),
2218
- customActionType: z20.string().describe("Type identifier of the custom action."),
2340
+ z21.object({
2341
+ type: z21.literal(ActionType.CUSTOM),
2342
+ customActionType: z21.string().describe("Type identifier of the custom action."),
2219
2343
  /** Custom action form configuration supports a simple array of field configs, which should be rendered on the action modal. In the future, we might add support for pages etc. */
2220
- form: z20.array(FieldConfig).describe(
2344
+ form: z21.array(FieldConfig).describe(
2221
2345
  "Form configuration for the custom action. The form configured here will be used on the custom action confirmation modal."
2222
2346
  )
2223
2347
  })
2224
2348
  );
2225
- var ActionConfig = z20.discriminatedUnion("type", [
2349
+ var ActionConfig = z21.discriminatedUnion("type", [
2226
2350
  /*
2227
2351
  * OpenAPI references are defined here so our generated OpenAPI spec knows to reuse the models
2228
2352
  * and treat them as "models" instead of duplicating the data structure in each endpoint.
@@ -2243,87 +2367,87 @@ var ActionConfig = z20.discriminatedUnion("type", [
2243
2367
  var actionConfigTypes = new Set(
2244
2368
  ActionConfig.options.map((opt) => opt.shape.type.value)
2245
2369
  );
2246
- var DeclarationActionConfig = z20.discriminatedUnion("type", [
2370
+ var DeclarationActionConfig = z21.discriminatedUnion("type", [
2247
2371
  DeclareConfig,
2248
2372
  ValidateConfig,
2249
2373
  RegisterConfig
2250
2374
  ]);
2251
2375
 
2252
2376
  // ../commons/src/events/offline/CertificateConfig.ts
2253
- var z21 = __toESM(require("zod/v4"));
2254
- var FontFamily = z21.object({
2255
- normal: z21.string(),
2256
- bold: z21.string(),
2257
- italics: z21.string(),
2258
- bolditalics: z21.string()
2377
+ var z22 = __toESM(require("zod/v4"));
2378
+ var FontFamily = z22.object({
2379
+ normal: z22.string(),
2380
+ bold: z22.string(),
2381
+ italics: z22.string(),
2382
+ bolditalics: z22.string()
2259
2383
  });
2260
- var CertificateConfig = z21.object({
2261
- id: z21.string(),
2262
- event: z21.string(),
2263
- isV2Template: z21.boolean().optional(),
2384
+ var CertificateConfig = z22.object({
2385
+ id: z22.string(),
2386
+ event: z22.string(),
2387
+ isV2Template: z22.boolean().optional(),
2264
2388
  label: TranslationConfig,
2265
- isDefault: z21.boolean(),
2266
- fee: z21.object({
2267
- onTime: z21.number(),
2268
- late: z21.number(),
2269
- delayed: z21.number()
2389
+ isDefault: z22.boolean(),
2390
+ fee: z22.object({
2391
+ onTime: z22.number(),
2392
+ late: z22.number(),
2393
+ delayed: z22.number()
2270
2394
  }),
2271
- svgUrl: z21.string(),
2272
- fonts: z21.record(z21.string(), FontFamily).optional(),
2273
- conditionals: z21.array(ShowConditional).optional()
2395
+ svgUrl: z22.string(),
2396
+ fonts: z22.record(z22.string(), FontFamily).optional(),
2397
+ conditionals: z22.array(ShowConditional).optional()
2274
2398
  });
2275
2399
  var CertificateTemplateConfig = CertificateConfig.extend({
2276
- hash: z21.string().optional(),
2277
- svg: z21.string()
2400
+ hash: z22.string().optional(),
2401
+ svg: z22.string()
2278
2402
  });
2279
2403
 
2280
2404
  // ../commons/src/events/offline/LanguageConfig.ts
2281
- var z22 = __toESM(require("zod/v4"));
2282
- var LanguageConfig = z22.object({
2283
- lang: z22.string(),
2405
+ var z23 = __toESM(require("zod/v4"));
2406
+ var LanguageConfig = z23.object({
2407
+ lang: z23.string(),
2284
2408
  /**
2285
2409
  * client.csv contents
2286
2410
  */
2287
- messages: z22.record(z22.string(), z22.string())
2411
+ messages: z23.record(z23.string(), z23.string())
2288
2412
  });
2289
2413
 
2290
2414
  // ../commons/src/events/EventConfig.ts
2291
- var z28 = __toESM(require("zod/v4"));
2415
+ var z29 = __toESM(require("zod/v4"));
2292
2416
 
2293
2417
  // ../commons/src/events/SummaryConfig.ts
2294
- var z23 = __toESM(require("zod/v4"));
2295
- var BaseField2 = z23.object({
2418
+ var z24 = __toESM(require("zod/v4"));
2419
+ var BaseField2 = z24.object({
2296
2420
  emptyValueMessage: TranslationConfig.optional().describe(
2297
2421
  "Default message displayed when the field value is empty."
2298
2422
  ),
2299
- conditionals: z23.array(ShowConditional).default([]).optional()
2423
+ conditionals: z24.array(ShowConditional).default([]).optional()
2300
2424
  });
2301
2425
  var ReferenceField = BaseField2.extend({
2302
- fieldId: z23.string(),
2426
+ fieldId: z24.string(),
2303
2427
  label: TranslationConfig.optional().describe(
2304
2428
  "Overrides the default label from the referenced field when provided."
2305
2429
  )
2306
2430
  }).describe("Field referencing existing event data by field ID.");
2307
2431
  var Field = BaseField2.extend({
2308
- id: z23.string().describe("Identifier of the summary field."),
2432
+ id: z24.string().describe("Identifier of the summary field."),
2309
2433
  value: TranslationConfig.describe(
2310
2434
  'Field value template supporting variables from configuration and EventMetadata (e.g. "{informant.phoneNo} {informant.email}").'
2311
2435
  ),
2312
2436
  label: TranslationConfig
2313
2437
  }).describe("Custom field defined for the summary view.");
2314
- var SummaryConfig = z23.object({
2315
- fields: z23.array(z23.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
2438
+ var SummaryConfig = z24.object({
2439
+ fields: z24.array(z24.union([Field, ReferenceField])).describe("Fields displayed in the event summary view.")
2316
2440
  }).describe("Configuration of the event summary section.");
2317
2441
 
2318
2442
  // ../commons/src/events/AdvancedSearchConfig.ts
2319
- var z24 = __toESM(require("zod/v4"));
2320
- var MatchType = z24.enum(["fuzzy", "exact", "range", "within"]);
2321
- var BaseField3 = z24.object({
2322
- config: z24.object({
2443
+ var z25 = __toESM(require("zod/v4"));
2444
+ var MatchType = z25.enum(["fuzzy", "exact", "range", "within"]);
2445
+ var BaseField3 = z25.object({
2446
+ config: z25.object({
2323
2447
  type: MatchType.describe(
2324
2448
  "Determines the search type of field. How to match value."
2325
2449
  ),
2326
- searchFields: z24.array(z24.string()).optional().describe(
2450
+ searchFields: z25.array(z25.string()).optional().describe(
2327
2451
  `
2328
2452
  Defines multiple form fields that should be searched when this field has a value.
2329
2453
  All specified fields will be combined using OR logic.
@@ -2333,7 +2457,7 @@ var BaseField3 = z24.object({
2333
2457
  `
2334
2458
  )
2335
2459
  }),
2336
- type: z24.nativeEnum(FieldType).optional().describe(
2460
+ type: z25.nativeEnum(FieldType).optional().describe(
2337
2461
  `
2338
2462
  Explicitly specify the field type for searchFields.
2339
2463
  This is required when searchFields is defined, to show the correct control in the UI.
@@ -2347,7 +2471,7 @@ var BaseField3 = z24.object({
2347
2471
  This is required when searchFields is defined.
2348
2472
  `
2349
2473
  ),
2350
- options: z24.array(SelectOption).optional(),
2474
+ options: z25.array(SelectOption).optional(),
2351
2475
  searchCriteriaLabelPrefix: TranslationConfig.optional().describe(
2352
2476
  `
2353
2477
  This property determines whether to add a prefix (such as "Child" or "Applicant") before the field label
@@ -2368,7 +2492,7 @@ var BaseField3 = z24.object({
2368
2492
  in the country-config > event.advancedSearch configuration. For example: field("child.dob", { searchCriteriaLabelPrefix: TranslationConfig }).
2369
2493
  `
2370
2494
  ),
2371
- conditionals: z24.array(FieldConditional).optional().describe(
2495
+ conditionals: z25.array(FieldConditional).optional().describe(
2372
2496
  `
2373
2497
  In advanced search, we sometimes need to override the default field visibility conditionals.
2374
2498
 
@@ -2382,59 +2506,61 @@ var BaseField3 = z24.object({
2382
2506
  are always rendered in the advanced search form.
2383
2507
  `
2384
2508
  ),
2385
- validations: z24.array(ValidationConfig).optional().describe(
2509
+ validations: z25.array(ValidationConfig).optional().describe(
2386
2510
  `Option for overriding the field validations specifically for advanced search form.`
2387
2511
  )
2388
2512
  });
2389
- var SearchQueryParams = z24.object({
2390
- eventType: z24.string().optional().describe(
2513
+ var SearchQueryParams = z25.object({
2514
+ eventType: z25.string().optional().describe(
2391
2515
  "Defines type of event so that when redirecting to Advanced Search page, appropriate tab can be selected"
2392
2516
  )
2393
2517
  }).catchall(FieldValue);
2394
2518
  var FieldConfigSchema = BaseField3.extend({
2395
- fieldId: z24.string(),
2396
- fieldType: z24.literal("field")
2519
+ fieldId: z25.string(),
2520
+ fieldType: z25.literal("field")
2397
2521
  });
2398
- var EventFieldIdInput = z24.enum([
2522
+ var EventFieldIdInput = z25.enum([
2399
2523
  "trackingId",
2400
2524
  "status",
2401
2525
  "legalStatuses.REGISTERED.acceptedAt",
2402
2526
  "legalStatuses.REGISTERED.createdAtLocation",
2527
+ "legalStatuses.REGISTERED.registrationNumber",
2403
2528
  "updatedAt"
2404
2529
  ]);
2405
2530
  var METADATA_FIELD_PREFIX = "event.";
2406
- var EventFieldId = z24.enum([
2531
+ var EventFieldId = z25.enum([
2407
2532
  `${METADATA_FIELD_PREFIX}trackingId`,
2408
2533
  `${METADATA_FIELD_PREFIX}status`,
2409
2534
  `${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
2410
2535
  `${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.createdAtLocation`,
2536
+ `${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.registrationNumber`,
2411
2537
  `${METADATA_FIELD_PREFIX}updatedAt`
2412
2538
  ]);
2413
2539
  var EventFieldConfigSchema = BaseField3.extend({
2414
2540
  fieldId: EventFieldId,
2415
- fieldType: z24.literal("event")
2541
+ fieldType: z25.literal("event")
2416
2542
  });
2417
- var AdvancedSearchField = z24.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
2543
+ var AdvancedSearchField = z25.discriminatedUnion("fieldType", [FieldConfigSchema, EventFieldConfigSchema]).superRefine((data, ctx) => {
2418
2544
  if (data.config.searchFields && data.config.searchFields.length > 0) {
2419
2545
  if (!data.label) {
2420
2546
  ctx.addIssue({
2421
- code: z24.ZodIssueCode.custom,
2547
+ code: z25.ZodIssueCode.custom,
2422
2548
  message: "label is required when config.searchFields is defined.",
2423
2549
  path: ["label"]
2424
2550
  });
2425
2551
  }
2426
2552
  if (!data.type) {
2427
2553
  ctx.addIssue({
2428
- code: z24.ZodIssueCode.custom,
2554
+ code: z25.ZodIssueCode.custom,
2429
2555
  message: "type is required when config.searchFields is defined.",
2430
2556
  path: ["type"]
2431
2557
  });
2432
2558
  }
2433
2559
  }
2434
2560
  });
2435
- var AdvancedSearchConfig = z24.object({
2561
+ var AdvancedSearchConfig = z25.object({
2436
2562
  title: TranslationConfig.describe("Advanced search tab title"),
2437
- fields: z24.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
2563
+ fields: z25.array(AdvancedSearchField).describe("Advanced search fields within the tab.")
2438
2564
  });
2439
2565
 
2440
2566
  // ../commons/src/events/utils.ts
@@ -2443,11 +2569,11 @@ var import_lodash = require("lodash");
2443
2569
  // ../commons/src/conditionals/validate.ts
2444
2570
  var import__ = __toESM(require("ajv/dist/2019"));
2445
2571
  var import_ajv_formats = __toESM(require("ajv-formats"));
2446
- var z26 = __toESM(require("zod/v4"));
2572
+ var z27 = __toESM(require("zod/v4"));
2447
2573
  var import_date_fns = require("date-fns");
2448
2574
 
2449
2575
  // ../commons/src/events/DynamicFieldValue.ts
2450
- var z25 = __toESM(require("zod/v4"));
2576
+ var z26 = __toESM(require("zod/v4"));
2451
2577
 
2452
2578
  // ../commons/src/conditionals/validate.ts
2453
2579
  var ajv = new import__.default({
@@ -2456,9 +2582,9 @@ var ajv = new import__.default({
2456
2582
  strict: false
2457
2583
  // Allow minContains and other newer features
2458
2584
  });
2459
- var DataContext = z26.object({
2460
- rootData: z26.object({
2461
- $leafAdminStructureLocationIds: z26.array(z26.object({ id: UUID }))
2585
+ var DataContext = z27.object({
2586
+ rootData: z27.object({
2587
+ $leafAdminStructureLocationIds: z27.array(z27.object({ id: UUID }))
2462
2588
  })
2463
2589
  });
2464
2590
  (0, import_ajv_formats.default)(ajv);
@@ -2500,12 +2626,12 @@ ajv.addKeyword({
2500
2626
  });
2501
2627
 
2502
2628
  // ../commons/src/utils.ts
2503
- var z27 = __toESM(require("zod/v4"));
2504
- var FullNameV1 = z27.array(
2505
- z27.object({
2506
- use: z27.string(),
2507
- family: z27.string(),
2508
- given: z27.array(z27.string())
2629
+ var z28 = __toESM(require("zod/v4"));
2630
+ var FullNameV1 = z28.array(
2631
+ z28.object({
2632
+ use: z28.string(),
2633
+ family: z28.string(),
2634
+ given: z28.array(z28.string())
2509
2635
  })
2510
2636
  );
2511
2637
  function omitKeyDeep(obj, keyToRemove) {
@@ -2557,13 +2683,16 @@ var EXCLUDED_ACTIONS = [
2557
2683
  ];
2558
2684
 
2559
2685
  // ../commons/src/events/EventConfig.ts
2560
- var EventConfig = z28.object({
2561
- id: z28.string().describe(
2686
+ var EventConfig = z29.object({
2687
+ id: z29.string().describe(
2562
2688
  'Machine-readable identifier of the event (e.g. "birth", "death").'
2563
2689
  ),
2564
2690
  dateOfEvent: FieldReference.optional().describe(
2565
2691
  "Reference to the field capturing the date of the event (e.g. date of birth). Defaults to the event creation date if unspecified."
2566
2692
  ),
2693
+ placeOfEvent: FieldReference.optional().describe(
2694
+ "Reference to the field capturing the place of the event (e.g. place of birth). Defaults to the meta.createdAtLocation if unspecified."
2695
+ ),
2567
2696
  title: TranslationConfig.describe(
2568
2697
  'Title template for the singular event, supporting variables (e.g. "{applicant.name.firstname} {applicant.name.surname}").'
2569
2698
  ),
@@ -2576,16 +2705,16 @@ var EventConfig = z28.object({
2576
2705
  label: TranslationConfig.describe(
2577
2706
  "Human-readable label for the event type."
2578
2707
  ),
2579
- actions: z28.array(ActionConfig).describe(
2708
+ actions: z29.array(ActionConfig).describe(
2580
2709
  "Configuration of system-defined actions associated with the event."
2581
2710
  ),
2582
2711
  declaration: DeclarationFormConfig.describe(
2583
2712
  "Configuration of the form used to gather event data."
2584
2713
  ),
2585
- advancedSearch: z28.array(AdvancedSearchConfig).optional().default([]).describe(
2714
+ advancedSearch: z29.array(AdvancedSearchConfig).optional().default([]).describe(
2586
2715
  "Configuration of fields available in the advanced search feature."
2587
2716
  ),
2588
- flags: z28.array(FlagConfig).optional().default([]).describe(
2717
+ flags: z29.array(FlagConfig).optional().default([]).describe(
2589
2718
  "Configuration of flags associated with the actions of this event type."
2590
2719
  )
2591
2720
  }).superRefine((event2, ctx) => {
@@ -2638,15 +2767,31 @@ var EventConfig = z28.object({
2638
2767
  });
2639
2768
  }
2640
2769
  }
2770
+ if (event2.placeOfEvent) {
2771
+ const eventPlaceFieldId = getDeclarationFields(event2).find(
2772
+ ({ id }) => id === event2.placeOfEvent?.$$field
2773
+ );
2774
+ if (!eventPlaceFieldId) {
2775
+ ctx.addIssue({
2776
+ code: "custom",
2777
+ message: `Place of event field id must match a field id in the event.declaration fields.
2778
+ Invalid place of event field ID for event ${event2.id}: ${event2.placeOfEvent.$$field}`,
2779
+ path: ["placeOfEvent"]
2780
+ });
2781
+ }
2782
+ }
2783
+ const isInherentFlag = (value) => Object.values(InherentFlags).includes(value);
2641
2784
  const configuredFlagIds = event2.flags.map((flag2) => flag2.id);
2642
2785
  const actionFlagIds = event2.actions.flatMap(
2643
2786
  (action) => action.flags.map((flag2) => flag2.id)
2644
2787
  );
2645
2788
  for (const actionFlagId of actionFlagIds) {
2646
- if (!configuredFlagIds.includes(actionFlagId)) {
2789
+ const isConfigured = configuredFlagIds.includes(actionFlagId);
2790
+ const isInherent = isInherentFlag(actionFlagId);
2791
+ if (!isConfigured && !isInherent) {
2647
2792
  ctx.addIssue({
2648
2793
  code: "custom",
2649
- message: `Action flag id must match a configured flag in the flags array. Invalid action flag ID for event '${event2.id}': '${actionFlagId}'`,
2794
+ message: `Action flag id must match an inherent flag or a configured flag in the flags array. Invalid action flag ID for event '${event2.id}': '${actionFlagId}'`,
2650
2795
  path: ["actions"]
2651
2796
  });
2652
2797
  }
@@ -3363,17 +3508,17 @@ var event = Object.assign(eventFn, {
3363
3508
  });
3364
3509
 
3365
3510
  // ../commons/src/events/WorkqueueColumnConfig.ts
3366
- var z29 = __toESM(require("zod/v4"));
3511
+ var z30 = __toESM(require("zod/v4"));
3367
3512
  var WorkqueueColumnKeysArray = [
3368
3513
  ...EventMetadataKeysArray,
3369
3514
  "title",
3370
3515
  "outbox"
3371
3516
  ];
3372
- var WorkqueueColumnKeys = z29.enum(WorkqueueColumnKeysArray);
3373
- var WorkqueueColumnValue = z29.object({
3517
+ var WorkqueueColumnKeys = z30.enum(WorkqueueColumnKeysArray);
3518
+ var WorkqueueColumnValue = z30.object({
3374
3519
  $event: WorkqueueColumnKeys
3375
3520
  });
3376
- var WorkqueueColumn = z29.object({
3521
+ var WorkqueueColumn = z30.object({
3377
3522
  label: TranslationConfig,
3378
3523
  value: WorkqueueColumnValue
3379
3524
  });
@@ -3384,158 +3529,54 @@ function defineWorkqueuesColumns(workqueueColumns) {
3384
3529
  }
3385
3530
 
3386
3531
  // ../commons/src/events/CountryConfigQueryInput.ts
3387
- var z30 = __toESM(require("zod/v4"));
3388
- var SerializableExact = z30.object({
3389
- type: z30.literal("exact"),
3390
- term: z30.union([z30.string(), SerializedUserField])
3532
+ var z31 = __toESM(require("zod/v4"));
3533
+ var SerializableExact = z31.object({
3534
+ type: z31.literal("exact"),
3535
+ term: z31.union([z31.string(), SerializedUserField])
3391
3536
  });
3392
- var SerializableWithin = z30.object({
3393
- type: z30.literal("within"),
3394
- location: z30.union([z30.string(), SerializedUserField])
3537
+ var SerializableWithin = z31.object({
3538
+ type: z31.literal("within"),
3539
+ location: z31.union([z31.string(), SerializedUserField])
3395
3540
  });
3396
- var SerializedQueryExpression = z30.object({
3397
- eventType: z30.string(),
3398
- status: z30.optional(z30.union([AnyOfStatus, ExactStatus])),
3399
- createdAt: z30.optional(DateCondition),
3400
- updatedAt: z30.optional(DateCondition),
3401
- "legalStatuses.REGISTERED.createdAt": z30.optional(DateCondition),
3402
- "legalStatuses.REGISTERED.createdAtLocation": z30.optional(
3403
- z30.union([Within, Exact])
3541
+ var SerializedQueryExpression = z31.object({
3542
+ eventType: z31.string(),
3543
+ status: z31.optional(z31.union([AnyOfStatus, ExactStatus])),
3544
+ createdAt: z31.optional(DateCondition),
3545
+ updatedAt: z31.optional(DateCondition),
3546
+ "legalStatuses.REGISTERED.createdAt": z31.optional(DateCondition),
3547
+ "legalStatuses.REGISTERED.createdAtLocation": z31.optional(
3548
+ z31.union([Within, Exact])
3404
3549
  ),
3405
- "legalStatuses.REGISTERED.registrationNumber": z30.optional(Exact),
3406
- createdAtLocation: z30.optional(
3407
- z30.union([SerializableWithin, SerializableExact])
3550
+ "legalStatuses.REGISTERED.registrationNumber": z31.optional(Exact),
3551
+ createdAtLocation: z31.optional(
3552
+ z31.union([SerializableWithin, SerializableExact])
3408
3553
  ),
3409
- updatedAtLocation: z30.optional(
3410
- z30.union([SerializableWithin, SerializableExact])
3554
+ updatedAtLocation: z31.optional(
3555
+ z31.union([SerializableWithin, SerializableExact])
3411
3556
  ),
3412
- assignedTo: z30.optional(SerializableExact),
3413
- createdBy: z30.optional(SerializableExact),
3557
+ assignedTo: z31.optional(SerializableExact),
3558
+ createdBy: z31.optional(SerializableExact),
3414
3559
  createdByUserType: ExactUserType,
3415
- updatedBy: z30.optional(SerializableExact),
3416
- trackingId: z30.optional(Exact),
3417
- flags: z30.optional(ContainsFlags),
3560
+ updatedBy: z31.optional(SerializableExact),
3561
+ trackingId: z31.optional(Exact),
3562
+ flags: z31.optional(ContainsFlags),
3418
3563
  data: QueryInput
3419
3564
  }).partial();
3420
- var Or2 = z30.object({
3421
- type: z30.literal("or"),
3422
- clauses: z30.array(SerializedQueryExpression)
3565
+ var Or2 = z31.object({
3566
+ type: z31.literal("or"),
3567
+ clauses: z31.array(SerializedQueryExpression)
3423
3568
  });
3424
- var And2 = z30.object({
3425
- type: z30.literal("and"),
3426
- clauses: z30.array(SerializedQueryExpression)
3569
+ var And2 = z31.object({
3570
+ type: z31.literal("and"),
3571
+ clauses: z31.array(SerializedQueryExpression)
3427
3572
  });
3428
- var CountryConfigQueryType = z30.discriminatedUnion("type", [And2, Or2]);
3429
- var CountryConfigQueryInputType = z30.union([
3573
+ var CountryConfigQueryType = z31.discriminatedUnion("type", [And2, Or2]);
3574
+ var CountryConfigQueryInputType = z31.union([
3430
3575
  SerializedQueryExpression,
3431
3576
  And2,
3432
3577
  Or2
3433
3578
  ]);
3434
3579
 
3435
- // ../commons/src/icons.ts
3436
- var z31 = __toESM(require("zod/v4"));
3437
- var AvailableIcons = z31.enum([
3438
- "Archived",
3439
- "Assigned",
3440
- "Certified",
3441
- "Close",
3442
- "Collapse",
3443
- "Draft",
3444
- "DuplicateYellow",
3445
- "Expand",
3446
- "ExternalValidate",
3447
- "FilledCheck",
3448
- "InReview",
3449
- "Offline",
3450
- "Registered",
3451
- "RequiresUpdates",
3452
- "Sent",
3453
- "Validated",
3454
- "WaitingApproval",
3455
- "ChartActivity",
3456
- "Activity",
3457
- "Archive",
3458
- "ArchiveTray",
3459
- "ArrowLeft",
3460
- "ArrowRight",
3461
- "Buildings",
3462
- "Circle",
3463
- "CaretDown",
3464
- "CaretLeft",
3465
- "CaretRight",
3466
- "ChartBar",
3467
- "ChartLine",
3468
- "ChatCircle",
3469
- "CheckSquare",
3470
- "Compass",
3471
- "Check",
3472
- "Copy",
3473
- "Database",
3474
- "DotsThreeVertical",
3475
- "ArrowCounterClockwise",
3476
- "MagnifyingGlassMinus",
3477
- "MagnifyingGlassPlus",
3478
- "Export",
3479
- "Eye",
3480
- "EyeSlash",
3481
- "Envelope",
3482
- "File",
3483
- "FileSearch",
3484
- "FileMinus",
3485
- "FilePlus",
3486
- "FileText",
3487
- "FileX",
3488
- "Handshake",
3489
- "Gear",
3490
- "GitBranch",
3491
- "IdentificationCard",
3492
- "List",
3493
- "ListBullets",
3494
- "Lock",
3495
- "MagnifyingGlass",
3496
- "MapPin",
3497
- "Medal",
3498
- "NotePencil",
3499
- "Paperclip",
3500
- "PaperPlaneTilt",
3501
- "Pen",
3502
- "Pencil",
3503
- "PencilSimpleLine",
3504
- "Phone",
3505
- "Plus",
3506
- "Printer",
3507
- "SignOut",
3508
- "Star",
3509
- "Target",
3510
- "TextT",
3511
- "Trash",
3512
- "UploadSimple",
3513
- "User",
3514
- "UserPlus",
3515
- "Users",
3516
- "WarningCircle",
3517
- "X",
3518
- "CircleWavyCheck",
3519
- "CircleWavyQuestion",
3520
- "ArchiveBox",
3521
- "ArrowCircleDown",
3522
- "FileArrowUp",
3523
- "FileDotted",
3524
- "Files",
3525
- "PencilLine",
3526
- "PencilCircle",
3527
- "UserCircle",
3528
- "Clock",
3529
- "QrCode",
3530
- "Webcam",
3531
- "Sun",
3532
- "DeviceTabletCamera",
3533
- "Globe",
3534
- "Fingerprint",
3535
- "PushPin",
3536
- "Timer"
3537
- ]);
3538
-
3539
3580
  // ../commons/src/events/WorkqueueConfig.ts
3540
3581
  var mandatoryColumns = defineWorkqueuesColumns([
3541
3582
  {
@@ -3848,7 +3889,8 @@ var updateActions = ActionTypes.extract([
3848
3889
  ActionType.REJECT,
3849
3890
  ActionType.ARCHIVE,
3850
3891
  ActionType.PRINT_CERTIFICATE,
3851
- ActionType.REQUEST_CORRECTION
3892
+ ActionType.REQUEST_CORRECTION,
3893
+ ActionType.CUSTOM
3852
3894
  ]);
3853
3895
 
3854
3896
  // ../commons/src/events/state/flags.ts