@opencrvs/toolkit 2.1.0-rc.6a144d4 → 2.1.0-rc.6ca6244

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.
@@ -38,7 +38,7 @@ __export(notification_exports, {
38
38
  triggerUserEventNotification: () => triggerUserEventNotification
39
39
  });
40
40
  module.exports = __toCommonJS(notification_exports);
41
- var z46 = __toESM(require("zod/v4"));
41
+ var z45 = __toESM(require("zod/v4"));
42
42
 
43
43
  // ../commons/src/url.ts
44
44
  function joinUrl(base, path) {
@@ -96,7 +96,6 @@ var PlainScopeType = z2.enum([
96
96
  "integration.create",
97
97
  "record.import",
98
98
  "config.update-all",
99
- "location.edit",
100
99
  "attachment.upload",
101
100
  "profile.electronic-signature",
102
101
  "user.read-only-my-audit",
@@ -531,62 +530,6 @@ var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
531
530
  requestData: z5.object({ id: z5.string() }),
532
531
  responseSummary: z5.object({ clientId: z5.string() })
533
532
  });
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
- });
590
533
  var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
591
534
  operation: z5.literal("attachments.upload"),
592
535
  requestData: z5.object({
@@ -662,10 +605,6 @@ var AuditLogEntrySchema = z5.discriminatedUnion("operation", [
662
605
  IntegrationActivateEntrySchema,
663
606
  IntegrationDeleteEntrySchema,
664
607
  IntegrationRefreshSecretEntrySchema,
665
- LocationCreateEntrySchema,
666
- LocationUpdateEntrySchema,
667
- AdministrativeAreaUpdateEntrySchema,
668
- AdministrativeAreaCreateEntrySchema,
669
608
  AttachmentUploadEntrySchema,
670
609
  UserCreateEntrySchema,
671
610
  UserReasonEntrySchema,
@@ -7420,44 +7359,21 @@ var LocationTypeV1 = z43.enum([
7420
7359
  "CRVS_OFFICE",
7421
7360
  "HEALTH_FACILITY"
7422
7361
  ]);
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
- });
7431
7362
  var AdministrativeArea = z43.object({
7432
7363
  id: UUID,
7433
7364
  name: z43.string(),
7434
7365
  externalId: z43.string().nullish(),
7435
7366
  parentId: UUID.nullable(),
7436
- status: LocationStatus,
7437
- versions: z43.array(LocationVersion)
7367
+ validUntil: z43.iso.datetime().nullable()
7438
7368
  });
7439
7369
  var Location = z43.object({
7440
7370
  id: UUID,
7441
7371
  name: z43.string(),
7442
7372
  externalId: z43.string().nullish(),
7443
7373
  administrativeAreaId: UUID.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(),
7374
+ validUntil: z43.iso.datetime().nullable(),
7453
7375
  locationType: z43.string().nullable()
7454
7376
  });
7455
- var SetAdministrativeAreaPayload = z43.object({
7456
- id: UUID,
7457
- name: z43.string(),
7458
- externalId: z43.string().nullish(),
7459
- parentId: UUID.nullable()
7460
- });
7461
7377
 
7462
7378
  // ../commons/src/events/scopes.ts
7463
7379
  var ACTION_SCOPE_MAP = {
@@ -7556,80 +7472,75 @@ var REJECTED_ACTIONS = [
7556
7472
  var import_lodash7 = require("lodash");
7557
7473
 
7558
7474
  // ../commons/src/events/mocks.test.utils.ts
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 = [
7475
+ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
7575
7476
  {
7576
7477
  id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7577
7478
  name: "Central",
7578
7479
  parentId: null,
7480
+ validUntil: null,
7579
7481
  externalId: "ydyJb1RAy4U1"
7580
7482
  },
7581
7483
  {
7582
7484
  id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7583
7485
  name: "Sulaka",
7584
7486
  parentId: null,
7487
+ validUntil: null,
7585
7488
  externalId: "pQ8nGxWmZ2Q3"
7586
7489
  },
7587
7490
  {
7588
7491
  id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
7589
7492
  name: "Pualula",
7590
7493
  parentId: null,
7494
+ validUntil: null,
7591
7495
  externalId: "Aq91DweLmT8k"
7592
7496
  },
7593
7497
  {
7594
7498
  id: "6d1a59df-988c-4021-a846-ccbc021931a7",
7595
7499
  name: "Chuminga",
7596
7500
  parentId: null,
7501
+ validUntil: null,
7597
7502
  externalId: "Rw0fYNh2Xk9a"
7598
7503
  },
7599
7504
  {
7600
7505
  id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7601
7506
  name: "Ibombo",
7602
7507
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7508
+ validUntil: null,
7603
7509
  externalId: "k7DsP4vbN1Qe"
7604
7510
  },
7605
7511
  {
7606
7512
  id: "27160bbd-32d1-4625-812f-860226bfb92a",
7607
7513
  name: "Isango",
7608
7514
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7515
+ validUntil: null,
7609
7516
  externalId: "Gm3Z9eQpHw4L"
7610
7517
  },
7611
7518
  {
7612
7519
  id: "967032fd-3f81-478a-826c-30cb8fe121bd",
7613
7520
  name: "Isamba",
7614
7521
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7522
+ validUntil: null,
7615
7523
  externalId: "sT0xVu1KqJ7r"
7616
7524
  },
7617
7525
  {
7618
7526
  id: "89a33893-b17d-481d-a26d-6461e7ac1651",
7619
7527
  name: "Itambo",
7620
7528
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7529
+ validUntil: null,
7621
7530
  externalId: "Nq6Bv2HpL9Te"
7622
7531
  },
7623
7532
  {
7624
7533
  id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
7625
7534
  name: "Ezhi",
7626
7535
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7536
+ validUntil: null,
7627
7537
  externalId: "xK8cQ0ZRy5Wd"
7628
7538
  },
7629
7539
  {
7630
7540
  id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
7631
7541
  name: "Ilanga",
7632
7542
  parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7543
+ validUntil: null,
7633
7544
  externalId: "Cq4Jm1XvN8Ls"
7634
7545
  },
7635
7546
  // Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
@@ -7637,42 +7548,49 @@ var MOCK_ADMINISTRATIVE_AREAS_BASE = [
7637
7548
  id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
7638
7549
  name: "Klow",
7639
7550
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7551
+ validUntil: null,
7640
7552
  externalId: "IkYcYBUcyY2"
7641
7553
  },
7642
7554
  {
7643
7555
  id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
7644
7556
  name: "Mbondo",
7645
7557
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7558
+ validUntil: null,
7646
7559
  externalId: "Qhvv5hvo3mY"
7647
7560
  },
7648
7561
  {
7649
7562
  id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
7650
7563
  name: "Ndara",
7651
7564
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7565
+ validUntil: null,
7652
7566
  externalId: "crXh068O9TR"
7653
7567
  },
7654
7568
  {
7655
7569
  id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
7656
7570
  name: "Olani",
7657
7571
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7572
+ validUntil: null,
7658
7573
  externalId: "r00It8Tvvp7"
7659
7574
  },
7660
7575
  {
7661
7576
  id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
7662
7577
  name: "Pemba",
7663
7578
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7579
+ validUntil: null,
7664
7580
  externalId: "ZnUWsbONIaH"
7665
7581
  },
7666
7582
  {
7667
7583
  id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
7668
7584
  name: "Quanza",
7669
7585
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7586
+ validUntil: null,
7670
7587
  externalId: "fDZycvQTa7l"
7671
7588
  },
7672
7589
  {
7673
7590
  id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
7674
7591
  name: "Rivka",
7675
7592
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7593
+ validUntil: null,
7676
7594
  externalId: "KqswxCGTELa"
7677
7595
  },
7678
7596
  // Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
@@ -7680,30 +7598,35 @@ var MOCK_ADMINISTRATIVE_AREAS_BASE = [
7680
7598
  id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
7681
7599
  name: "Mbula",
7682
7600
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7601
+ validUntil: null,
7683
7602
  externalId: "osEbKjRc9Kg"
7684
7603
  },
7685
7604
  {
7686
7605
  id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
7687
7606
  name: "Ndoki",
7688
7607
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7608
+ validUntil: null,
7689
7609
  externalId: "aq4daBUAGr3"
7690
7610
  },
7691
7611
  {
7692
7612
  id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
7693
7613
  name: "Tsanga",
7694
7614
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7615
+ validUntil: null,
7695
7616
  externalId: "cqis6Y8trbJ"
7696
7617
  },
7697
7618
  {
7698
7619
  id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
7699
7620
  name: "Waziri",
7700
7621
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7622
+ validUntil: null,
7701
7623
  externalId: "LMijHPyyx6d"
7702
7624
  },
7703
7625
  {
7704
7626
  id: "2c5d6e7f-8a9b-4423-8def-456789012345",
7705
7627
  name: "Zimbi",
7706
7628
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7629
+ validUntil: null,
7707
7630
  externalId: "pcQYbPuKGZ7"
7708
7631
  },
7709
7632
  // Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
@@ -7711,59 +7634,67 @@ var MOCK_ADMINISTRATIVE_AREAS_BASE = [
7711
7634
  id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
7712
7635
  name: "Felani",
7713
7636
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7637
+ validUntil: null,
7714
7638
  externalId: "gSqpoCGdMXp"
7715
7639
  },
7716
7640
  {
7717
7641
  id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
7718
7642
  name: "Goroma",
7719
7643
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7644
+ validUntil: null,
7720
7645
  externalId: "KvAAIaNqVrp"
7721
7646
  },
7722
7647
  {
7723
7648
  id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
7724
7649
  name: "Halifu",
7725
7650
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7651
+ validUntil: null,
7726
7652
  externalId: "qe4UnEVt1hv"
7727
7653
  },
7728
7654
  {
7729
7655
  id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
7730
7656
  name: "Jabari",
7731
7657
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7658
+ validUntil: null,
7732
7659
  externalId: "yHH9Nz4rLOt"
7733
7660
  },
7734
7661
  {
7735
7662
  id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
7736
7663
  name: "Kifani",
7737
7664
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7665
+ validUntil: null,
7738
7666
  externalId: "eSWmXIGeu1I"
7739
7667
  },
7740
7668
  {
7741
7669
  id: "8c1d2e3f-4a5b-4089-8def-012345678901",
7742
7670
  name: "Lumela",
7743
7671
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
7672
+ validUntil: null,
7744
7673
  externalId: "bh0b3aI1uP3"
7745
7674
  }
7746
7675
  ];
7747
- var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = MOCK_ADMINISTRATIVE_AREAS_BASE.map(withVersionFields);
7748
- var MOCK_LOCATIONS_BASE = [
7676
+ var V2_DEFAULT_MOCK_LOCATIONS = [
7749
7677
  {
7750
7678
  id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
7751
7679
  name: "Central Provincial Office",
7752
7680
  locationType: "CRVS_OFFICE",
7753
7681
  administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7682
+ validUntil: null,
7754
7683
  externalId: "Xr3Df8WpK6Ys"
7755
7684
  },
7756
7685
  {
7757
7686
  id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
7758
7687
  name: "Central Health Post",
7759
7688
  locationType: "HEALTH_FACILITY",
7760
- administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c"
7689
+ administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
7690
+ validUntil: null
7761
7691
  },
7762
7692
  {
7763
7693
  id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
7764
7694
  name: "Ibombo District Office",
7765
7695
  locationType: "CRVS_OFFICE",
7766
7696
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7697
+ validUntil: null,
7767
7698
  externalId: "Sm4Nw7GrD2Vy"
7768
7699
  },
7769
7700
  {
@@ -7771,6 +7702,7 @@ var MOCK_LOCATIONS_BASE = [
7771
7702
  name: "Isamba District Office",
7772
7703
  locationType: "CRVS_OFFICE",
7773
7704
  administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
7705
+ validUntil: null,
7774
7706
  externalId: "Vg1Bq5XeH9Lt"
7775
7707
  },
7776
7708
  {
@@ -7778,6 +7710,7 @@ var MOCK_LOCATIONS_BASE = [
7778
7710
  name: "Isango District Office",
7779
7711
  locationType: "CRVS_OFFICE",
7780
7712
  administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
7713
+ validUntil: null,
7781
7714
  externalId: "Je7Lm2XqN9Vz"
7782
7715
  },
7783
7716
  {
@@ -7785,6 +7718,7 @@ var MOCK_LOCATIONS_BASE = [
7785
7718
  name: "Sulaka Provincial Office",
7786
7719
  locationType: "CRVS_OFFICE",
7787
7720
  administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
7721
+ validUntil: null,
7788
7722
  externalId: "Ht2Wp9KcX5Qv"
7789
7723
  },
7790
7724
  {
@@ -7792,6 +7726,7 @@ var MOCK_LOCATIONS_BASE = [
7792
7726
  name: "Ilanga District Office",
7793
7727
  locationType: "CRVS_OFFICE",
7794
7728
  administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
7729
+ validUntil: null,
7795
7730
  externalId: "Yp6Ds1WqN3Xz"
7796
7731
  },
7797
7732
  {
@@ -7799,6 +7734,7 @@ var MOCK_LOCATIONS_BASE = [
7799
7734
  name: "Chamakubi Health Post",
7800
7735
  locationType: "HEALTH_FACILITY",
7801
7736
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7737
+ validUntil: null,
7802
7738
  externalId: "M1nFr8LbC2Qy"
7803
7739
  },
7804
7740
  {
@@ -7806,6 +7742,7 @@ var MOCK_LOCATIONS_BASE = [
7806
7742
  name: "Ibombo Rural Health Centre",
7807
7743
  locationType: "HEALTH_FACILITY",
7808
7744
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7745
+ validUntil: null,
7809
7746
  externalId: "bT7pV6YrW0Xc"
7810
7747
  },
7811
7748
  {
@@ -7813,6 +7750,7 @@ var MOCK_LOCATIONS_BASE = [
7813
7750
  name: "Chikobo Rural Health Centre",
7814
7751
  locationType: "HEALTH_FACILITY",
7815
7752
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7753
+ validUntil: null,
7816
7754
  externalId: "zE4qPn2SgJ5d"
7817
7755
  },
7818
7756
  {
@@ -7820,6 +7758,7 @@ var MOCK_LOCATIONS_BASE = [
7820
7758
  name: "Chilochabalenje Health Post",
7821
7759
  locationType: "HEALTH_FACILITY",
7822
7760
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7761
+ validUntil: null,
7823
7762
  externalId: "H8vDs1MqR4Uf"
7824
7763
  },
7825
7764
  {
@@ -7827,6 +7766,7 @@ var MOCK_LOCATIONS_BASE = [
7827
7766
  name: "Chipeso Rural Health Centre",
7828
7767
  locationType: "HEALTH_FACILITY",
7829
7768
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7769
+ validUntil: null,
7830
7770
  externalId: "Qw3uZ9KfX6Lm"
7831
7771
  },
7832
7772
  {
@@ -7834,6 +7774,7 @@ var MOCK_LOCATIONS_BASE = [
7834
7774
  name: "Chisamba Rural Health Centre",
7835
7775
  locationType: "HEALTH_FACILITY",
7836
7776
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7777
+ validUntil: null,
7837
7778
  externalId: "Yr0pCg8LdM2s"
7838
7779
  },
7839
7780
  {
@@ -7841,6 +7782,7 @@ var MOCK_LOCATIONS_BASE = [
7841
7782
  name: "Chitanda Rural Health Centre",
7842
7783
  locationType: "HEALTH_FACILITY",
7843
7784
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7785
+ validUntil: null,
7844
7786
  externalId: "tS9gJ4PwB1Qx"
7845
7787
  },
7846
7788
  {
@@ -7848,6 +7790,7 @@ var MOCK_LOCATIONS_BASE = [
7848
7790
  name: "Golden Valley Rural Health Centre",
7849
7791
  locationType: "HEALTH_FACILITY",
7850
7792
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7793
+ validUntil: null,
7851
7794
  externalId: "Ld7Qm3XsA8Vr"
7852
7795
  },
7853
7796
  {
@@ -7855,6 +7798,7 @@ var MOCK_LOCATIONS_BASE = [
7855
7798
  name: "Ipongo Rural Health Centre",
7856
7799
  locationType: "HEALTH_FACILITY",
7857
7800
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7801
+ validUntil: null,
7858
7802
  externalId: "kF2sW9DmH0Bt"
7859
7803
  },
7860
7804
  {
@@ -7862,6 +7806,7 @@ var MOCK_LOCATIONS_BASE = [
7862
7806
  name: "Itumbwe Health Post",
7863
7807
  locationType: "HEALTH_FACILITY",
7864
7808
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7809
+ validUntil: null,
7865
7810
  externalId: "Ue5Xb3VaC7Pq"
7866
7811
  },
7867
7812
  {
@@ -7869,6 +7814,7 @@ var MOCK_LOCATIONS_BASE = [
7869
7814
  name: "Kabangalala Rural Health Centre",
7870
7815
  locationType: "HEALTH_FACILITY",
7871
7816
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
7817
+ validUntil: null,
7872
7818
  externalId: "Pz8Kc1TqH6Jn"
7873
7819
  },
7874
7820
  // Village offices
@@ -7877,10 +7823,10 @@ var MOCK_LOCATIONS_BASE = [
7877
7823
  name: "Klow Village Office",
7878
7824
  locationType: "CRVS_OFFICE",
7879
7825
  administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
7826
+ validUntil: null,
7880
7827
  externalId: "PmAyxAJkxiJ"
7881
7828
  }
7882
7829
  ];
7883
- var V2_DEFAULT_MOCK_LOCATIONS = MOCK_LOCATIONS_BASE.map(withVersionFields);
7884
7830
  var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
7885
7831
  V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
7886
7832
  );
@@ -7888,56 +7834,8 @@ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
7888
7834
  V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
7889
7835
  );
7890
7836
 
7891
- // ../commons/src/events/locationPayloads.ts
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
7837
  // ../commons/src/notification/UserNotifications.ts
7940
- var z45 = __toESM(require("zod/v4"));
7838
+ var z44 = __toESM(require("zod/v4"));
7941
7839
  var TriggerEvent = {
7942
7840
  USER_CREATED: "user-created",
7943
7841
  USER_UPDATED: "user-updated",
@@ -7950,54 +7848,54 @@ var TriggerEvent = {
7950
7848
  CHANGE_PHONE_NUMBER: "change-phone-number",
7951
7849
  CHANGE_EMAIL_ADDRESS: "change-email-address"
7952
7850
  };
7953
- var Recipient = z45.object({
7851
+ var Recipient = z44.object({
7954
7852
  name: NameFieldValue.optional(),
7955
- mobile: z45.string().optional(),
7956
- email: z45.string().optional(),
7957
- bcc: z45.array(z45.string()).optional()
7853
+ mobile: z44.string().optional(),
7854
+ email: z44.string().optional(),
7855
+ bcc: z44.array(z44.string()).optional()
7958
7856
  });
7959
- var BasePayload = z45.object({
7857
+ var BasePayload = z44.object({
7960
7858
  recipient: Recipient
7961
7859
  });
7962
7860
  var TriggerPayload = {
7963
7861
  [TriggerEvent.USER_CREATED]: BasePayload.extend({
7964
- username: z45.string(),
7965
- temporaryPassword: z45.string()
7862
+ username: z44.string(),
7863
+ temporaryPassword: z44.string()
7966
7864
  }),
7967
7865
  [TriggerEvent.USER_UPDATED]: BasePayload.extend({
7968
- oldUsername: z45.string(),
7969
- newUsername: z45.string()
7866
+ oldUsername: z44.string(),
7867
+ newUsername: z44.string()
7970
7868
  }),
7971
7869
  [TriggerEvent.USERNAME_REMINDER]: BasePayload.extend({
7972
- username: z45.string()
7870
+ username: z44.string()
7973
7871
  }),
7974
7872
  [TriggerEvent.RESET_PASSWORD]: BasePayload.extend({
7975
- code: z45.string()
7873
+ code: z44.string()
7976
7874
  }),
7977
7875
  [TriggerEvent.RESET_PASSWORD_BY_ADMIN]: BasePayload.extend({
7978
- temporaryPassword: z45.string(),
7979
- admin: z45.object({
7980
- id: z45.string(),
7876
+ temporaryPassword: z44.string(),
7877
+ admin: z44.object({
7878
+ id: z44.string(),
7981
7879
  name: NameFieldValue,
7982
- role: z45.string()
7880
+ role: z44.string()
7983
7881
  })
7984
7882
  }),
7985
7883
  [TriggerEvent.RESEND_INVITE]: BasePayload.extend({
7986
- username: z45.string(),
7987
- temporaryPassword: z45.string()
7884
+ username: z44.string(),
7885
+ temporaryPassword: z44.string()
7988
7886
  }),
7989
7887
  [TriggerEvent.TWO_FA]: BasePayload.extend({
7990
- code: z45.string()
7888
+ code: z44.string()
7991
7889
  }),
7992
7890
  [TriggerEvent.ALL_USER_NOTIFICATION]: BasePayload.extend({
7993
- subject: z45.string(),
7994
- body: z45.string()
7891
+ subject: z44.string(),
7892
+ body: z44.string()
7995
7893
  }),
7996
7894
  [TriggerEvent.CHANGE_PHONE_NUMBER]: BasePayload.extend({
7997
- code: z45.string()
7895
+ code: z44.string()
7998
7896
  }),
7999
7897
  [TriggerEvent.CHANGE_EMAIL_ADDRESS]: BasePayload.extend({
8000
- code: z45.string()
7898
+ code: z44.string()
8001
7899
  })
8002
7900
  };
8003
7901
  async function triggerUserEventNotification({
@@ -8021,4 +7919,4 @@ function parseUserEventTrigger(event2, body) {
8021
7919
  }
8022
7920
 
8023
7921
  // src/notification/index.ts
8024
- z46.globalRegistry.clear();
7922
+ z45.globalRegistry.clear();
@@ -397,7 +397,6 @@ export declare const Scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
397
397
  bypassratelimit: "bypassratelimit";
398
398
  "config.update-all": "config.update-all";
399
399
  "integration.create": "integration.create";
400
- "location.edit": "location.edit";
401
400
  "performance.read": "performance.read";
402
401
  "performance.read-dashboards": "performance.read-dashboards";
403
402
  "performance.vital-statistics-export": "performance.vital-statistics-export";
@@ -618,7 +617,6 @@ export declare const ScopeType: z.ZodEnum<{
618
617
  "config.update-all": "config.update-all";
619
618
  "dashboard.view": "dashboard.view";
620
619
  "integration.create": "integration.create";
621
- "location.edit": "location.edit";
622
620
  "organisation.read-locations": "organisation.read-locations";
623
621
  "performance.read": "performance.read";
624
622
  "performance.read-dashboards": "performance.read-dashboards";
@@ -739,7 +737,7 @@ export declare const decodeScope: (encodedScope: EncodedScope) => {
739
737
  accessLevel?: "administrativeArea" | "all" | "location" | undefined;
740
738
  } | undefined;
741
739
  } | {
742
- type: "attachment.upload" | "bypassratelimit" | "config.update-all" | "integration.create" | "location.edit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "profile.electronic-signature" | "record.confirm-registration" | "record.import" | "record.reindex" | "record.reject-registration" | "user.data-seeding" | "user.read-only-my-audit";
740
+ type: "attachment.upload" | "bypassratelimit" | "config.update-all" | "integration.create" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "profile.electronic-signature" | "record.confirm-registration" | "record.import" | "record.reindex" | "record.reject-registration" | "user.data-seeding" | "user.read-only-my-audit";
743
741
  } | {
744
742
  type: "organisation.read-locations";
745
743
  options?: {
@@ -127,7 +127,6 @@ var PlainScopeType = z3.enum([
127
127
  "integration.create",
128
128
  "record.import",
129
129
  "config.update-all",
130
- "location.edit",
131
130
  "attachment.upload",
132
131
  "profile.electronic-signature",
133
132
  "user.read-only-my-audit",