@opencrvs/toolkit 2.1.0-rc.4c1664c → 2.1.0-rc.4ebadf9

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 (58) hide show
  1. package/dist/application-config/index.js +3 -1
  2. package/dist/commons/api/router.d.ts +3500 -3313
  3. package/dist/commons/application-config/index.d.ts +6 -6
  4. package/dist/commons/conditionals/conditionals.d.ts +259 -2102
  5. package/dist/commons/events/ActionConfig.d.ts +105 -105
  6. package/dist/commons/events/ActionDocument.d.ts +119 -119
  7. package/dist/commons/events/ActionInput.d.ts +0 -6
  8. package/dist/commons/events/ActionType.d.ts +62 -62
  9. package/dist/commons/events/AdvancedSearchConfig.d.ts +513 -507
  10. package/dist/commons/events/AuditLog.d.ts +151 -42
  11. package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
  12. package/dist/commons/events/Conditional.d.ts +3 -3
  13. package/dist/commons/events/CountryConfigQueryInput.d.ts +590 -590
  14. package/dist/commons/events/Draft.d.ts +37 -37
  15. package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
  16. package/dist/commons/events/EventConfig.d.ts +5 -5
  17. package/dist/commons/events/EventDocument.d.ts +48 -48
  18. package/dist/commons/events/EventIndex.d.ts +62 -62
  19. package/dist/commons/events/EventMetadata.d.ts +40 -40
  20. package/dist/commons/events/FieldConfig.d.ts +341 -336
  21. package/dist/commons/events/FieldType.d.ts +51 -51
  22. package/dist/commons/events/FieldTypeMapping.d.ts +100 -100
  23. package/dist/commons/events/FieldValue.d.ts +12 -12
  24. package/dist/commons/events/Flag.d.ts +15 -15
  25. package/dist/commons/events/TemplateConfig.d.ts +1 -1
  26. package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
  27. package/dist/commons/events/WorkqueueConfig.d.ts +826 -826
  28. package/dist/commons/events/deduplication.d.ts +1 -1
  29. package/dist/commons/events/event.d.ts +2 -2
  30. package/dist/commons/events/field.d.ts +78 -895
  31. package/dist/commons/events/index.d.ts +1 -0
  32. package/dist/commons/events/locationPayloads.d.ts +95 -0
  33. package/dist/commons/events/locations.d.ts +103 -6
  34. package/dist/commons/events/mocks.test.utils.d.ts +18 -4
  35. package/dist/commons/events/scopes.d.ts +4 -4
  36. package/dist/commons/events/state/index.d.ts +17 -17
  37. package/dist/commons/events/state/utils.d.ts +7 -7
  38. package/dist/commons/events/test.utils.d.ts +40 -43
  39. package/dist/commons/events/utils.d.ts +114 -114
  40. package/dist/commons/notification/UserNotifications.d.ts +10 -10
  41. package/dist/conditionals/index.js +1 -0
  42. package/dist/environment/derived-variables.d.ts +119 -119
  43. package/dist/environment/derived-variables.d.ts.map +1 -1
  44. package/dist/environment/logger.d.ts.map +1 -1
  45. package/dist/environment/questions.d.ts +75 -74
  46. package/dist/environment/questions.d.ts.map +1 -1
  47. package/dist/environment/setup-environment.js +8 -14
  48. package/dist/environment/utils.d.ts +1 -1
  49. package/dist/events/deduplication.d.ts +1 -1
  50. package/dist/events/index.js +185 -58
  51. package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
  52. package/dist/notification/index.js +182 -82
  53. package/dist/scopes/index.d.ts +148 -146
  54. package/dist/scopes/index.js +1 -0
  55. package/opencrvs-toolkit-2.1.0-rc.4ebadf9.tgz +0 -0
  56. package/package.json +5 -5
  57. package/tsconfig.tsbuildinfo +1 -1
  58. package/opencrvs-toolkit-2.1.0-rc.4c1664c.tgz +0 -0
@@ -38,7 +38,7 @@ __export(notification_exports, {
38
38
  triggerUserEventNotification: () => triggerUserEventNotification
39
39
  });
40
40
  module.exports = __toCommonJS(notification_exports);
41
- var z45 = __toESM(require("zod/v4"));
41
+ var z46 = __toESM(require("zod/v4"));
42
42
 
43
43
  // ../commons/src/url.ts
44
44
  function joinUrl(base, path) {
@@ -96,6 +96,7 @@ var PlainScopeType = z2.enum([
96
96
  "integration.create",
97
97
  "record.import",
98
98
  "config.update-all",
99
+ "location.edit",
99
100
  "attachment.upload",
100
101
  "profile.electronic-signature",
101
102
  "user.read-only-my-audit",
@@ -530,6 +531,62 @@ var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
530
531
  requestData: z5.object({ id: z5.string() }),
531
532
  responseSummary: z5.object({ clientId: z5.string() })
532
533
  });
534
+ var createdVersionFields = {
535
+ id: z5.string(),
536
+ versionId: z5.string(),
537
+ name: z5.string(),
538
+ externalId: z5.string().nullish(),
539
+ effectiveFrom: z5.string(),
540
+ status: z5.string()
541
+ };
542
+ var LocationCreateEntrySchema = AuditLogEntryBase.extend({
543
+ operation: z5.literal("locations.create"),
544
+ requestData: z5.object({
545
+ ...createdVersionFields,
546
+ administrativeAreaId: z5.string().nullish(),
547
+ locationType: z5.string().nullish()
548
+ })
549
+ });
550
+ var AdministrativeAreaCreateEntrySchema = AuditLogEntryBase.extend({
551
+ operation: z5.literal("administrativeAreas.create"),
552
+ requestData: z5.object({
553
+ ...createdVersionFields,
554
+ parentId: z5.string().nullish()
555
+ })
556
+ });
557
+ var ChangedStringField = z5.object({ from: z5.string(), to: z5.string() });
558
+ var ChangedNullableStringField = z5.object({
559
+ from: z5.string().nullable(),
560
+ to: z5.string().nullable()
561
+ });
562
+ var updatedVersionRequestData = z5.object({
563
+ id: z5.string(),
564
+ versionId: z5.string(),
565
+ name: z5.string(),
566
+ externalId: z5.string().nullish(),
567
+ status: z5.string(),
568
+ effectiveFrom: z5.string(),
569
+ lastVersionId: z5.string()
570
+ });
571
+ var updatedVersionResponseSummary = z5.object({
572
+ previousVersionId: z5.string(),
573
+ versionId: z5.string(),
574
+ changed: z5.object({
575
+ name: ChangedStringField.optional(),
576
+ externalId: ChangedNullableStringField.optional(),
577
+ status: ChangedStringField.optional()
578
+ })
579
+ });
580
+ var LocationUpdateEntrySchema = AuditLogEntryBase.extend({
581
+ operation: z5.literal("locations.update"),
582
+ requestData: updatedVersionRequestData,
583
+ responseSummary: updatedVersionResponseSummary
584
+ });
585
+ var AdministrativeAreaUpdateEntrySchema = AuditLogEntryBase.extend({
586
+ operation: z5.literal("administrativeAreas.update"),
587
+ requestData: updatedVersionRequestData,
588
+ responseSummary: updatedVersionResponseSummary
589
+ });
533
590
  var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
534
591
  operation: z5.literal("attachments.upload"),
535
592
  requestData: z5.object({
@@ -605,6 +662,10 @@ var AuditLogEntrySchema = z5.discriminatedUnion("operation", [
605
662
  IntegrationActivateEntrySchema,
606
663
  IntegrationDeleteEntrySchema,
607
664
  IntegrationRefreshSecretEntrySchema,
665
+ LocationCreateEntrySchema,
666
+ LocationUpdateEntrySchema,
667
+ AdministrativeAreaUpdateEntrySchema,
668
+ AdministrativeAreaCreateEntrySchema,
608
669
  AttachmentUploadEntrySchema,
609
670
  UserCreateEntrySchema,
610
671
  UserReasonEntrySchema,
@@ -1216,9 +1277,10 @@ var NotifiedAction = ActionBase.extend(
1216
1277
  var EditAction = ActionBase.extend(
1217
1278
  z14.object({
1218
1279
  type: z14.literal(ActionType.EDIT),
1280
+ /** @deprecated New Edit-actions should no longer contain content. This is kept for old 2.0 edits. */
1219
1281
  content: z14.object({
1220
1282
  comment: z14.string().describe("Comment for the edit action.").optional()
1221
- })
1283
+ }).optional()
1222
1284
  }).shape
1223
1285
  );
1224
1286
  var PrintContent = z14.object({
@@ -4652,10 +4714,7 @@ var DeclareActionInput = BaseActionInput.extend(
4652
4714
  );
4653
4715
  var EditActionInput = BaseActionInput.extend(
4654
4716
  z38.object({
4655
- type: z38.literal(ActionType.EDIT).default(ActionType.EDIT),
4656
- content: z38.object({
4657
- comment: z38.string().describe("Comment for the edit action.").optional()
4658
- })
4717
+ type: z38.literal(ActionType.EDIT).default(ActionType.EDIT)
4659
4718
  }).shape
4660
4719
  );
4661
4720
  var PrintCertificateActionInput = BaseActionInput.extend(
@@ -7361,21 +7420,44 @@ var LocationTypeV1 = z43.enum([
7361
7420
  "CRVS_OFFICE",
7362
7421
  "HEALTH_FACILITY"
7363
7422
  ]);
7423
+ var LocationStatus = z43.enum(["active", "inactive"]);
7424
+ var LocationVersion = z43.object({
7425
+ versionId: UUID,
7426
+ effectiveFrom: z43.iso.date(),
7427
+ name: z43.string(),
7428
+ externalId: z43.string().nullish(),
7429
+ status: LocationStatus
7430
+ });
7364
7431
  var AdministrativeArea = z43.object({
7365
7432
  id: UUID,
7366
7433
  name: z43.string(),
7367
7434
  externalId: z43.string().nullish(),
7368
7435
  parentId: UUID.nullable(),
7369
- validUntil: z43.iso.datetime().nullable()
7436
+ status: LocationStatus,
7437
+ versions: z43.array(LocationVersion)
7370
7438
  });
7371
7439
  var Location = z43.object({
7372
7440
  id: UUID,
7373
7441
  name: z43.string(),
7374
7442
  externalId: z43.string().nullish(),
7375
7443
  administrativeAreaId: UUID.nullable(),
7376
- validUntil: z43.iso.datetime().nullable(),
7444
+ locationType: z43.string().nullable(),
7445
+ status: LocationStatus,
7446
+ versions: z43.array(LocationVersion)
7447
+ });
7448
+ var SetLocationPayload = z43.object({
7449
+ id: UUID,
7450
+ name: z43.string(),
7451
+ externalId: z43.string().nullish(),
7452
+ administrativeAreaId: UUID.nullable(),
7377
7453
  locationType: z43.string().nullable()
7378
7454
  });
7455
+ var SetAdministrativeAreaPayload = z43.object({
7456
+ id: UUID,
7457
+ name: z43.string(),
7458
+ externalId: z43.string().nullish(),
7459
+ parentId: UUID.nullable()
7460
+ });
7379
7461
 
7380
7462
  // ../commons/src/events/scopes.ts
7381
7463
  var ACTION_SCOPE_MAP = {
@@ -7474,75 +7556,80 @@ var REJECTED_ACTIONS = [
7474
7556
  var import_lodash7 = require("lodash");
7475
7557
 
7476
7558
  // ../commons/src/events/mocks.test.utils.ts
7477
- var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
7559
+ function withVersionFields(entity) {
7560
+ return {
7561
+ ...entity,
7562
+ status: "active",
7563
+ versions: [
7564
+ {
7565
+ versionId: entity.id,
7566
+ effectiveFrom: "0001-01-01",
7567
+ name: entity.name,
7568
+ externalId: entity.externalId ?? null,
7569
+ status: "active"
7570
+ }
7571
+ ]
7572
+ };
7573
+ }
7574
+ var MOCK_ADMINISTRATIVE_AREAS_BASE = [
7478
7575
  {
7479
7576
  id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7480
7577
  name: "Central",
7481
7578
  parentId: null,
7482
- validUntil: null,
7483
7579
  externalId: "ydyJb1RAy4U1"
7484
7580
  },
7485
7581
  {
7486
7582
  id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7487
7583
  name: "Sulaka",
7488
7584
  parentId: null,
7489
- validUntil: null,
7490
7585
  externalId: "pQ8nGxWmZ2Q3"
7491
7586
  },
7492
7587
  {
7493
7588
  id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
7494
7589
  name: "Pualula",
7495
7590
  parentId: null,
7496
- validUntil: null,
7497
7591
  externalId: "Aq91DweLmT8k"
7498
7592
  },
7499
7593
  {
7500
7594
  id: "6d1a59df-988c-4021-a846-ccbc021931a7",
7501
7595
  name: "Chuminga",
7502
7596
  parentId: null,
7503
- validUntil: null,
7504
7597
  externalId: "Rw0fYNh2Xk9a"
7505
7598
  },
7506
7599
  {
7507
7600
  id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7508
7601
  name: "Ibombo",
7509
7602
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7510
- validUntil: null,
7511
7603
  externalId: "k7DsP4vbN1Qe"
7512
7604
  },
7513
7605
  {
7514
7606
  id: "27160bbd-32d1-4625-812f-860226bfb92a",
7515
7607
  name: "Isango",
7516
7608
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7517
- validUntil: null,
7518
7609
  externalId: "Gm3Z9eQpHw4L"
7519
7610
  },
7520
7611
  {
7521
7612
  id: "967032fd-3f81-478a-826c-30cb8fe121bd",
7522
7613
  name: "Isamba",
7523
7614
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7524
- validUntil: null,
7525
7615
  externalId: "sT0xVu1KqJ7r"
7526
7616
  },
7527
7617
  {
7528
7618
  id: "89a33893-b17d-481d-a26d-6461e7ac1651",
7529
7619
  name: "Itambo",
7530
7620
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7531
- validUntil: null,
7532
7621
  externalId: "Nq6Bv2HpL9Te"
7533
7622
  },
7534
7623
  {
7535
7624
  id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
7536
7625
  name: "Ezhi",
7537
7626
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7538
- validUntil: null,
7539
7627
  externalId: "xK8cQ0ZRy5Wd"
7540
7628
  },
7541
7629
  {
7542
7630
  id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
7543
7631
  name: "Ilanga",
7544
7632
  parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7545
- validUntil: null,
7546
7633
  externalId: "Cq4Jm1XvN8Ls"
7547
7634
  },
7548
7635
  // Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
@@ -7550,49 +7637,42 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
7550
7637
  id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
7551
7638
  name: "Klow",
7552
7639
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7553
- validUntil: null,
7554
7640
  externalId: "IkYcYBUcyY2"
7555
7641
  },
7556
7642
  {
7557
7643
  id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
7558
7644
  name: "Mbondo",
7559
7645
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7560
- validUntil: null,
7561
7646
  externalId: "Qhvv5hvo3mY"
7562
7647
  },
7563
7648
  {
7564
7649
  id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
7565
7650
  name: "Ndara",
7566
7651
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7567
- validUntil: null,
7568
7652
  externalId: "crXh068O9TR"
7569
7653
  },
7570
7654
  {
7571
7655
  id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
7572
7656
  name: "Olani",
7573
7657
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7574
- validUntil: null,
7575
7658
  externalId: "r00It8Tvvp7"
7576
7659
  },
7577
7660
  {
7578
7661
  id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
7579
7662
  name: "Pemba",
7580
7663
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7581
- validUntil: null,
7582
7664
  externalId: "ZnUWsbONIaH"
7583
7665
  },
7584
7666
  {
7585
7667
  id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
7586
7668
  name: "Quanza",
7587
7669
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7588
- validUntil: null,
7589
7670
  externalId: "fDZycvQTa7l"
7590
7671
  },
7591
7672
  {
7592
7673
  id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
7593
7674
  name: "Rivka",
7594
7675
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7595
- validUntil: null,
7596
7676
  externalId: "KqswxCGTELa"
7597
7677
  },
7598
7678
  // Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
@@ -7600,35 +7680,30 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
7600
7680
  id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
7601
7681
  name: "Mbula",
7602
7682
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7603
- validUntil: null,
7604
7683
  externalId: "osEbKjRc9Kg"
7605
7684
  },
7606
7685
  {
7607
7686
  id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
7608
7687
  name: "Ndoki",
7609
7688
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7610
- validUntil: null,
7611
7689
  externalId: "aq4daBUAGr3"
7612
7690
  },
7613
7691
  {
7614
7692
  id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
7615
7693
  name: "Tsanga",
7616
7694
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7617
- validUntil: null,
7618
7695
  externalId: "cqis6Y8trbJ"
7619
7696
  },
7620
7697
  {
7621
7698
  id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
7622
7699
  name: "Waziri",
7623
7700
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7624
- validUntil: null,
7625
7701
  externalId: "LMijHPyyx6d"
7626
7702
  },
7627
7703
  {
7628
7704
  id: "2c5d6e7f-8a9b-4423-8def-456789012345",
7629
7705
  name: "Zimbi",
7630
7706
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7631
- validUntil: null,
7632
7707
  externalId: "pcQYbPuKGZ7"
7633
7708
  },
7634
7709
  // Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
@@ -7636,67 +7711,59 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
7636
7711
  id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
7637
7712
  name: "Felani",
7638
7713
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7639
- validUntil: null,
7640
7714
  externalId: "gSqpoCGdMXp"
7641
7715
  },
7642
7716
  {
7643
7717
  id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
7644
7718
  name: "Goroma",
7645
7719
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7646
- validUntil: null,
7647
7720
  externalId: "KvAAIaNqVrp"
7648
7721
  },
7649
7722
  {
7650
7723
  id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
7651
7724
  name: "Halifu",
7652
7725
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7653
- validUntil: null,
7654
7726
  externalId: "qe4UnEVt1hv"
7655
7727
  },
7656
7728
  {
7657
7729
  id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
7658
7730
  name: "Jabari",
7659
7731
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7660
- validUntil: null,
7661
7732
  externalId: "yHH9Nz4rLOt"
7662
7733
  },
7663
7734
  {
7664
7735
  id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
7665
7736
  name: "Kifani",
7666
7737
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7667
- validUntil: null,
7668
7738
  externalId: "eSWmXIGeu1I"
7669
7739
  },
7670
7740
  {
7671
7741
  id: "8c1d2e3f-4a5b-4089-8def-012345678901",
7672
7742
  name: "Lumela",
7673
7743
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7674
- validUntil: null,
7675
7744
  externalId: "bh0b3aI1uP3"
7676
7745
  }
7677
7746
  ];
7678
- var V2_DEFAULT_MOCK_LOCATIONS = [
7747
+ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = MOCK_ADMINISTRATIVE_AREAS_BASE.map(withVersionFields);
7748
+ var MOCK_LOCATIONS_BASE = [
7679
7749
  {
7680
7750
  id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
7681
7751
  name: "Central Provincial Office",
7682
7752
  locationType: "CRVS_OFFICE",
7683
7753
  administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7684
- validUntil: null,
7685
7754
  externalId: "Xr3Df8WpK6Ys"
7686
7755
  },
7687
7756
  {
7688
7757
  id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
7689
7758
  name: "Central Health Post",
7690
7759
  locationType: "HEALTH_FACILITY",
7691
- administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7692
- validUntil: null
7760
+ administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c"
7693
7761
  },
7694
7762
  {
7695
7763
  id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
7696
7764
  name: "Ibombo District Office",
7697
7765
  locationType: "CRVS_OFFICE",
7698
7766
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7699
- validUntil: null,
7700
7767
  externalId: "Sm4Nw7GrD2Vy"
7701
7768
  },
7702
7769
  {
@@ -7704,7 +7771,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7704
7771
  name: "Isamba District Office",
7705
7772
  locationType: "CRVS_OFFICE",
7706
7773
  administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7707
- validUntil: null,
7708
7774
  externalId: "Vg1Bq5XeH9Lt"
7709
7775
  },
7710
7776
  {
@@ -7712,7 +7778,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7712
7778
  name: "Isango District Office",
7713
7779
  locationType: "CRVS_OFFICE",
7714
7780
  administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
7715
- validUntil: null,
7716
7781
  externalId: "Je7Lm2XqN9Vz"
7717
7782
  },
7718
7783
  {
@@ -7720,7 +7785,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7720
7785
  name: "Sulaka Provincial Office",
7721
7786
  locationType: "CRVS_OFFICE",
7722
7787
  administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7723
- validUntil: null,
7724
7788
  externalId: "Ht2Wp9KcX5Qv"
7725
7789
  },
7726
7790
  {
@@ -7728,7 +7792,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7728
7792
  name: "Ilanga District Office",
7729
7793
  locationType: "CRVS_OFFICE",
7730
7794
  administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
7731
- validUntil: null,
7732
7795
  externalId: "Yp6Ds1WqN3Xz"
7733
7796
  },
7734
7797
  {
@@ -7736,7 +7799,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7736
7799
  name: "Chamakubi Health Post",
7737
7800
  locationType: "HEALTH_FACILITY",
7738
7801
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7739
- validUntil: null,
7740
7802
  externalId: "M1nFr8LbC2Qy"
7741
7803
  },
7742
7804
  {
@@ -7744,7 +7806,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7744
7806
  name: "Ibombo Rural Health Centre",
7745
7807
  locationType: "HEALTH_FACILITY",
7746
7808
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7747
- validUntil: null,
7748
7809
  externalId: "bT7pV6YrW0Xc"
7749
7810
  },
7750
7811
  {
@@ -7752,7 +7813,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7752
7813
  name: "Chikobo Rural Health Centre",
7753
7814
  locationType: "HEALTH_FACILITY",
7754
7815
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7755
- validUntil: null,
7756
7816
  externalId: "zE4qPn2SgJ5d"
7757
7817
  },
7758
7818
  {
@@ -7760,7 +7820,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7760
7820
  name: "Chilochabalenje Health Post",
7761
7821
  locationType: "HEALTH_FACILITY",
7762
7822
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7763
- validUntil: null,
7764
7823
  externalId: "H8vDs1MqR4Uf"
7765
7824
  },
7766
7825
  {
@@ -7768,7 +7827,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7768
7827
  name: "Chipeso Rural Health Centre",
7769
7828
  locationType: "HEALTH_FACILITY",
7770
7829
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7771
- validUntil: null,
7772
7830
  externalId: "Qw3uZ9KfX6Lm"
7773
7831
  },
7774
7832
  {
@@ -7776,7 +7834,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7776
7834
  name: "Chisamba Rural Health Centre",
7777
7835
  locationType: "HEALTH_FACILITY",
7778
7836
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7779
- validUntil: null,
7780
7837
  externalId: "Yr0pCg8LdM2s"
7781
7838
  },
7782
7839
  {
@@ -7784,7 +7841,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7784
7841
  name: "Chitanda Rural Health Centre",
7785
7842
  locationType: "HEALTH_FACILITY",
7786
7843
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7787
- validUntil: null,
7788
7844
  externalId: "tS9gJ4PwB1Qx"
7789
7845
  },
7790
7846
  {
@@ -7792,7 +7848,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7792
7848
  name: "Golden Valley Rural Health Centre",
7793
7849
  locationType: "HEALTH_FACILITY",
7794
7850
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7795
- validUntil: null,
7796
7851
  externalId: "Ld7Qm3XsA8Vr"
7797
7852
  },
7798
7853
  {
@@ -7800,7 +7855,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7800
7855
  name: "Ipongo Rural Health Centre",
7801
7856
  locationType: "HEALTH_FACILITY",
7802
7857
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7803
- validUntil: null,
7804
7858
  externalId: "kF2sW9DmH0Bt"
7805
7859
  },
7806
7860
  {
@@ -7808,7 +7862,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7808
7862
  name: "Itumbwe Health Post",
7809
7863
  locationType: "HEALTH_FACILITY",
7810
7864
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7811
- validUntil: null,
7812
7865
  externalId: "Ue5Xb3VaC7Pq"
7813
7866
  },
7814
7867
  {
@@ -7816,7 +7869,6 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7816
7869
  name: "Kabangalala Rural Health Centre",
7817
7870
  locationType: "HEALTH_FACILITY",
7818
7871
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7819
- validUntil: null,
7820
7872
  externalId: "Pz8Kc1TqH6Jn"
7821
7873
  },
7822
7874
  // Village offices
@@ -7825,10 +7877,10 @@ var V2_DEFAULT_MOCK_LOCATIONS = [
7825
7877
  name: "Klow Village Office",
7826
7878
  locationType: "CRVS_OFFICE",
7827
7879
  administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
7828
- validUntil: null,
7829
7880
  externalId: "PmAyxAJkxiJ"
7830
7881
  }
7831
7882
  ];
7883
+ var V2_DEFAULT_MOCK_LOCATIONS = MOCK_LOCATIONS_BASE.map(withVersionFields);
7832
7884
  var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
7833
7885
  V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
7834
7886
  );
@@ -7836,8 +7888,56 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
7836
7888
  V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
7837
7889
  );
7838
7890
 
7839
- // ../commons/src/notification/UserNotifications.ts
7891
+ // ../commons/src/events/locationPayloads.ts
7840
7892
  var z44 = __toESM(require("zod/v4"));
7893
+ var CreateLocationPayload = z44.object({
7894
+ id: UUID.optional(),
7895
+ versionId: UUID.optional(),
7896
+ name: z44.string(),
7897
+ externalId: z44.string().nullish(),
7898
+ administrativeAreaId: UUID.nullable(),
7899
+ locationType: z44.string().nullable(),
7900
+ effectiveFrom: z44.iso.date().optional(),
7901
+ status: LocationStatus.default("active")
7902
+ });
7903
+ var UpdateLocationPayload = z44.strictObject({
7904
+ id: UUID,
7905
+ versionId: UUID.optional(),
7906
+ name: z44.string(),
7907
+ externalId: z44.string().nullish(),
7908
+ status: LocationStatus,
7909
+ effectiveFrom: z44.iso.date().optional(),
7910
+ lastVersionId: UUID
7911
+ });
7912
+ var WithdrawLocationVersionPayload = z44.object({
7913
+ id: UUID,
7914
+ versionId: UUID
7915
+ });
7916
+ var CreateAdministrativeAreaPayload = z44.object({
7917
+ id: UUID.optional(),
7918
+ versionId: UUID.optional(),
7919
+ name: z44.string(),
7920
+ externalId: z44.string().nullish(),
7921
+ parentId: UUID.nullable(),
7922
+ effectiveFrom: z44.iso.date().optional(),
7923
+ status: LocationStatus.default("active")
7924
+ });
7925
+ var UpdateAdministrativeAreaPayload = z44.strictObject({
7926
+ id: UUID,
7927
+ versionId: UUID.optional(),
7928
+ name: z44.string(),
7929
+ externalId: z44.string().nullish(),
7930
+ status: LocationStatus,
7931
+ effectiveFrom: z44.iso.date().optional(),
7932
+ lastVersionId: UUID
7933
+ });
7934
+ var WithdrawAdministrativeAreaVersionPayload = z44.object({
7935
+ id: UUID,
7936
+ versionId: UUID
7937
+ });
7938
+
7939
+ // ../commons/src/notification/UserNotifications.ts
7940
+ var z45 = __toESM(require("zod/v4"));
7841
7941
  var TriggerEvent = {
7842
7942
  USER_CREATED: "user-created",
7843
7943
  USER_UPDATED: "user-updated",
@@ -7850,54 +7950,54 @@ var TriggerEvent = {
7850
7950
  CHANGE_PHONE_NUMBER: "change-phone-number",
7851
7951
  CHANGE_EMAIL_ADDRESS: "change-email-address"
7852
7952
  };
7853
- var Recipient = z44.object({
7953
+ var Recipient = z45.object({
7854
7954
  name: NameFieldValue.optional(),
7855
- mobile: z44.string().optional(),
7856
- email: z44.string().optional(),
7857
- bcc: z44.array(z44.string()).optional()
7955
+ mobile: z45.string().optional(),
7956
+ email: z45.string().optional(),
7957
+ bcc: z45.array(z45.string()).optional()
7858
7958
  });
7859
- var BasePayload = z44.object({
7959
+ var BasePayload = z45.object({
7860
7960
  recipient: Recipient
7861
7961
  });
7862
7962
  var TriggerPayload = {
7863
7963
  [TriggerEvent.USER_CREATED]: BasePayload.extend({
7864
- username: z44.string(),
7865
- temporaryPassword: z44.string()
7964
+ username: z45.string(),
7965
+ temporaryPassword: z45.string()
7866
7966
  }),
7867
7967
  [TriggerEvent.USER_UPDATED]: BasePayload.extend({
7868
- oldUsername: z44.string(),
7869
- newUsername: z44.string()
7968
+ oldUsername: z45.string(),
7969
+ newUsername: z45.string()
7870
7970
  }),
7871
7971
  [TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
7872
- username: z44.string()
7972
+ username: z45.string()
7873
7973
  }),
7874
7974
  [TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
7875
- code: z44.string()
7975
+ code: z45.string()
7876
7976
  }),
7877
7977
  [TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
7878
- temporaryPassword: z44.string(),
7879
- admin: z44.object({
7880
- id: z44.string(),
7978
+ temporaryPassword: z45.string(),
7979
+ admin: z45.object({
7980
+ id: z45.string(),
7881
7981
  name: NameFieldValue,
7882
- role: z44.string()
7982
+ role: z45.string()
7883
7983
  })
7884
7984
  }),
7885
7985
  [TriggerEvent.RESEND_INVITE]: BasePayload.extend({
7886
- username: z44.string(),
7887
- temporaryPassword: z44.string()
7986
+ username: z45.string(),
7987
+ temporaryPassword: z45.string()
7888
7988
  }),
7889
7989
  [TriggerEvent.TWO_FA]: BasePayload.extend({
7890
- code: z44.string()
7990
+ code: z45.string()
7891
7991
  }),
7892
7992
  [TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
7893
- subject: z44.string(),
7894
- body: z44.string()
7993
+ subject: z45.string(),
7994
+ body: z45.string()
7895
7995
  }),
7896
7996
  [TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
7897
- code: z44.string()
7997
+ code: z45.string()
7898
7998
  }),
7899
7999
  [TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
7900
- code: z44.string()
8000
+ code: z45.string()
7901
8001
  })
7902
8002
  };
7903
8003
  async function triggerUserEventNotification({
@@ -7921,4 +8021,4 @@ function parseUserEventTrigger(event2, body) {
7921
8021
  }
7922
8022
 
7923
8023
  // src/notification/index.ts
7924
- z45.globalRegistry.clear();
8024
+ z46.globalRegistry.clear();