@opencrvs/toolkit 2.1.0-rc.3e7e77b → 2.1.0-rc.40789ee

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.
@@ -80,8 +80,6 @@ __export(events_exports, {
80
80
  ConditionalType: () => ConditionalType,
81
81
  ConfirmableActions: () => ConfirmableActions,
82
82
  ContainsFlags: () => ContainsFlags,
83
- CreateAdministrativeAreaPayload: () => CreateAdministrativeAreaPayload,
84
- CreateLocationPayload: () => CreateLocationPayload,
85
83
  CustomActionInput: () => CustomActionInput,
86
84
  CustomFieldValue: () => CustomFieldValue,
87
85
  CustomFlag: () => CustomFlag,
@@ -163,9 +161,7 @@ __export(events_exports, {
163
161
  LanguageConfig: () => LanguageConfig,
164
162
  LegalStatuses: () => LegalStatuses,
165
163
  Location: () => Location,
166
- LocationStatus: () => LocationStatus,
167
164
  LocationTypeV1: () => LocationTypeV1,
168
- LocationVersion: () => LocationVersion,
169
165
  METADATA_FIELD_PREFIX: () => METADATA_FIELD_PREFIX,
170
166
  MarkAsDuplicateActionInput: () => MarkAsDuplicateActionInput,
171
167
  MarkNotDuplicateActionInput: () => MarkNotDuplicateActionInput,
@@ -205,8 +201,6 @@ __export(events_exports, {
205
201
  SelectDateRangeOption: () => SelectDateRangeOption,
206
202
  SelectDateRangeValue: () => SelectDateRangeValue,
207
203
  SelectOption: () => SelectOption,
208
- SetAdministrativeAreaPayload: () => SetAdministrativeAreaPayload,
209
- SetLocationPayload: () => SetLocationPayload,
210
204
  ShowConditional: () => ShowConditional,
211
205
  SignatureFieldValue: () => SignatureFieldValue,
212
206
  StaticDataEntry: () => StaticDataEntry,
@@ -222,8 +216,6 @@ __export(events_exports, {
222
216
  UUID: () => UUID,
223
217
  UnarchiveActionInput: () => UnarchiveActionInput,
224
218
  UnassignActionInput: () => UnassignActionInput,
225
- UpdateAdministrativeAreaPayload: () => UpdateAdministrativeAreaPayload,
226
- UpdateLocationPayload: () => UpdateLocationPayload,
227
219
  UserAuditRecordInput: () => UserAuditRecordInput,
228
220
  V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS: () => V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS,
229
221
  V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP: () => V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP,
@@ -233,8 +225,6 @@ __export(events_exports, {
233
225
  VerificationActionConfig: () => VerificationActionConfig,
234
226
  VerificationPageConfig: () => VerificationPageConfig,
235
227
  VerificationStatusValue: () => VerificationStatusValue,
236
- WithdrawAdministrativeAreaVersionPayload: () => WithdrawAdministrativeAreaVersionPayload,
237
- WithdrawLocationVersionPayload: () => WithdrawLocationVersionPayload,
238
228
  Within: () => Within,
239
229
  WorkqueueActionType: () => WorkqueueActionType,
240
230
  WorkqueueColumn: () => WorkqueueColumn,
@@ -353,7 +343,6 @@ __export(events_exports, {
353
343
  getStatusFromActions: () => getStatusFromActions,
354
344
  getValidatorsForField: () => getValidatorsForField,
355
345
  getVisibleVerificationPageIds: () => getVisibleVerificationPageIds,
356
- hasActiveExternalIdOnOrAfter: () => hasActiveExternalIdOnOrAfter,
357
346
  hasAnyOfScopes: () => hasAnyOfScopes,
358
347
  isActionAvailable: () => isActionAvailable,
359
348
  isActionConfigType: () => isActionConfigType,
@@ -444,7 +433,6 @@ __export(events_exports, {
444
433
  resolveDateOfEvent: () => resolveDateOfEvent,
445
434
  resolveEventCustomFlags: () => resolveEventCustomFlags,
446
435
  resolvePlaceOfEvent: () => resolvePlaceOfEvent,
447
- resolveVersion: () => resolveVersion,
448
436
  runClientFunction: () => runClientFunction,
449
437
  runFieldValidations: () => runFieldValidations,
450
438
  runStructuralValidations: () => runStructuralValidations,
@@ -512,7 +500,6 @@ var PlainScopeType = z2.enum([
512
500
  "integration.create",
513
501
  "record.import",
514
502
  "config.update-all",
515
- "location.edit",
516
503
  "attachment.upload",
517
504
  "profile.electronic-signature",
518
505
  "user.read-only-my-audit",
@@ -995,29 +982,6 @@ var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
995
982
  requestData: z5.object({ id: z5.string() }),
996
983
  responseSummary: z5.object({ clientId: z5.string() })
997
984
  });
998
- var createdVersionFields = {
999
- id: z5.string(),
1000
- versionId: z5.string(),
1001
- name: z5.string(),
1002
- externalId: z5.string().nullish(),
1003
- effectiveFrom: z5.string(),
1004
- status: z5.string()
1005
- };
1006
- var LocationCreateEntrySchema = AuditLogEntryBase.extend({
1007
- operation: z5.literal("locations.create"),
1008
- requestData: z5.object({
1009
- ...createdVersionFields,
1010
- administrativeAreaId: z5.string().nullish(),
1011
- locationType: z5.string().nullish()
1012
- })
1013
- });
1014
- var AdministrativeAreaCreateEntrySchema = AuditLogEntryBase.extend({
1015
- operation: z5.literal("administrativeAreas.create"),
1016
- requestData: z5.object({
1017
- ...createdVersionFields,
1018
- parentId: z5.string().nullish()
1019
- })
1020
- });
1021
985
  var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
1022
986
  operation: z5.literal("attachments.upload"),
1023
987
  requestData: z5.object({
@@ -1093,8 +1057,6 @@ var AuditLogEntrySchema = z5.discriminatedUnion("operation", [
1093
1057
  IntegrationActivateEntrySchema,
1094
1058
  IntegrationDeleteEntrySchema,
1095
1059
  IntegrationRefreshSecretEntrySchema,
1096
- LocationCreateEntrySchema,
1097
- AdministrativeAreaCreateEntrySchema,
1098
1060
  AttachmentUploadEntrySchema,
1099
1061
  UserCreateEntrySchema,
1100
1062
  UserReasonEntrySchema,
@@ -10504,60 +10466,21 @@ var LocationTypeV1 = z43.enum([
10504
10466
  "CRVS_OFFICE",
10505
10467
  "HEALTH_FACILITY"
10506
10468
  ]);
10507
- var LocationStatus = z43.enum(["active", "inactive"]);
10508
- var LocationVersion = z43.object({
10509
- versionId: UUID,
10510
- effectiveFrom: z43.iso.date(),
10511
- name: z43.string(),
10512
- externalId: z43.string().nullish(),
10513
- status: LocationStatus
10514
- });
10515
10469
  var AdministrativeArea = z43.object({
10516
10470
  id: UUID,
10517
10471
  name: z43.string(),
10518
10472
  externalId: z43.string().nullish(),
10519
10473
  parentId: UUID.nullable(),
10520
- status: LocationStatus,
10521
- versions: z43.array(LocationVersion)
10474
+ validUntil: z43.iso.datetime().nullable()
10522
10475
  });
10523
10476
  var Location = z43.object({
10524
10477
  id: UUID,
10525
10478
  name: z43.string(),
10526
10479
  externalId: z43.string().nullish(),
10527
10480
  administrativeAreaId: UUID.nullable(),
10528
- locationType: z43.string().nullable(),
10529
- status: LocationStatus,
10530
- versions: z43.array(LocationVersion)
10531
- });
10532
- var SetLocationPayload = z43.object({
10533
- id: UUID,
10534
- name: z43.string(),
10535
- externalId: z43.string().nullish(),
10536
- administrativeAreaId: UUID.nullable(),
10481
+ validUntil: z43.iso.datetime().nullable(),
10537
10482
  locationType: z43.string().nullable()
10538
10483
  });
10539
- var SetAdministrativeAreaPayload = z43.object({
10540
- id: UUID,
10541
- name: z43.string(),
10542
- externalId: z43.string().nullish(),
10543
- parentId: UUID.nullable()
10544
- });
10545
- function resolveVersion(versions, anchor) {
10546
- let resolved = versions[0];
10547
- for (const version of versions) {
10548
- if (version.effectiveFrom <= anchor) {
10549
- resolved = version;
10550
- }
10551
- }
10552
- return resolved;
10553
- }
10554
- function hasActiveExternalIdOnOrAfter(versions, externalId, anchor) {
10555
- const inEffectAtAnchor = resolveVersion(versions, anchor);
10556
- const laterVersions = versions.filter((v) => v.effectiveFrom > anchor);
10557
- return [inEffectAtAnchor, ...laterVersions].some(
10558
- (v) => v.externalId === externalId && v.status === "active"
10559
- );
10560
- }
10561
10484
  function matchesJurisdictionFilter(locationIds, filter, user2) {
10562
10485
  if (!locationIds) {
10563
10486
  return false;
@@ -11037,80 +10960,75 @@ function getFilePathsFromEvent(event2) {
11037
10960
  }
11038
10961
 
11039
10962
  // ../commons/src/events/mocks.test.utils.ts
11040
- function withVersionFields(entity) {
11041
- return {
11042
- ...entity,
11043
- status: "active",
11044
- versions: [
11045
- {
11046
- versionId: entity.id,
11047
- effectiveFrom: "0001-01-01",
11048
- name: entity.name,
11049
- externalId: entity.externalId ?? null,
11050
- status: "active"
11051
- }
11052
- ]
11053
- };
11054
- }
11055
- var MOCK_ADMINISTRATIVE_AREAS_BASE = [
10963
+ var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = [
11056
10964
  {
11057
10965
  id: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
11058
10966
  name: "Central",
11059
10967
  parentId: null,
10968
+ validUntil: null,
11060
10969
  externalId: "ydyJb1RAy4U1"
11061
10970
  },
11062
10971
  {
11063
10972
  id: "c599b691-fd2d-45e1-abf4-d185de727fb5",
11064
10973
  name: "Sulaka",
11065
10974
  parentId: null,
10975
+ validUntil: null,
11066
10976
  externalId: "pQ8nGxWmZ2Q3"
11067
10977
  },
11068
10978
  {
11069
10979
  id: "7ef2b9c7-5e6d-49f6-ae05-656207d0fc64",
11070
10980
  name: "Pualula",
11071
10981
  parentId: null,
10982
+ validUntil: null,
11072
10983
  externalId: "Aq91DweLmT8k"
11073
10984
  },
11074
10985
  {
11075
10986
  id: "6d1a59df-988c-4021-a846-ccbc021931a7",
11076
10987
  name: "Chuminga",
11077
10988
  parentId: null,
10989
+ validUntil: null,
11078
10990
  externalId: "Rw0fYNh2Xk9a"
11079
10991
  },
11080
10992
  {
11081
10993
  id: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11082
10994
  name: "Ibombo",
11083
10995
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
10996
+ validUntil: null,
11084
10997
  externalId: "k7DsP4vbN1Qe"
11085
10998
  },
11086
10999
  {
11087
11000
  id: "27160bbd-32d1-4625-812f-860226bfb92a",
11088
11001
  name: "Isango",
11089
11002
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
11003
+ validUntil: null,
11090
11004
  externalId: "Gm3Z9eQpHw4L"
11091
11005
  },
11092
11006
  {
11093
11007
  id: "967032fd-3f81-478a-826c-30cb8fe121bd",
11094
11008
  name: "Isamba",
11095
11009
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
11010
+ validUntil: null,
11096
11011
  externalId: "sT0xVu1KqJ7r"
11097
11012
  },
11098
11013
  {
11099
11014
  id: "89a33893-b17d-481d-a26d-6461e7ac1651",
11100
11015
  name: "Itambo",
11101
11016
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
11017
+ validUntil: null,
11102
11018
  externalId: "Nq6Bv2HpL9Te"
11103
11019
  },
11104
11020
  {
11105
11021
  id: "d42ab2fe-e7ed-470e-8b31-4fb27f9b8250",
11106
11022
  name: "Ezhi",
11107
11023
  parentId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
11024
+ validUntil: null,
11108
11025
  externalId: "xK8cQ0ZRy5Wd"
11109
11026
  },
11110
11027
  {
11111
11028
  id: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
11112
11029
  name: "Ilanga",
11113
11030
  parentId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
11031
+ validUntil: null,
11114
11032
  externalId: "Cq4Jm1XvN8Ls"
11115
11033
  },
11116
11034
  // Villages under Ibombo (62a0ccb4-880d-4f30-8882-f256007dfff9)
@@ -11118,42 +11036,49 @@ var MOCK_ADMINISTRATIVE_AREAS_BASE = [
11118
11036
  id: "1d4e5f6a-7b8c-4912-8efa-345678901234",
11119
11037
  name: "Klow",
11120
11038
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11039
+ validUntil: null,
11121
11040
  externalId: "IkYcYBUcyY2"
11122
11041
  },
11123
11042
  {
11124
11043
  id: "2e5f6a7b-8c9d-4a23-8fab-456789012345",
11125
11044
  name: "Mbondo",
11126
11045
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11046
+ validUntil: null,
11127
11047
  externalId: "Qhvv5hvo3mY"
11128
11048
  },
11129
11049
  {
11130
11050
  id: "3f6a7b8c-9d0e-4b34-8abc-567890123456",
11131
11051
  name: "Ndara",
11132
11052
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11053
+ validUntil: null,
11133
11054
  externalId: "crXh068O9TR"
11134
11055
  },
11135
11056
  {
11136
11057
  id: "4a7b8c9d-0e1f-4c45-abcd-678901234567",
11137
11058
  name: "Olani",
11138
11059
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11060
+ validUntil: null,
11139
11061
  externalId: "r00It8Tvvp7"
11140
11062
  },
11141
11063
  {
11142
11064
  id: "5b8c9d0e-1f2a-4d56-bcde-789012345678",
11143
11065
  name: "Pemba",
11144
11066
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11067
+ validUntil: null,
11145
11068
  externalId: "ZnUWsbONIaH"
11146
11069
  },
11147
11070
  {
11148
11071
  id: "6c9d0e1f-2a3b-4e67-8def-890123456789",
11149
11072
  name: "Quanza",
11150
11073
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11074
+ validUntil: null,
11151
11075
  externalId: "fDZycvQTa7l"
11152
11076
  },
11153
11077
  {
11154
11078
  id: "7d0e1f2a-3b4c-4f78-8efa-901234567890",
11155
11079
  name: "Rivka",
11156
11080
  parentId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11081
+ validUntil: null,
11157
11082
  externalId: "KqswxCGTELa"
11158
11083
  },
11159
11084
  // Villages under Isamba (967032fd-3f81-478a-826c-30cb8fe121bd)
@@ -11161,30 +11086,35 @@ var MOCK_ADMINISTRATIVE_AREAS_BASE = [
11161
11086
  id: "8e1f2a3b-4c5d-4089-8fab-012345678901",
11162
11087
  name: "Mbula",
11163
11088
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
11089
+ validUntil: null,
11164
11090
  externalId: "osEbKjRc9Kg"
11165
11091
  },
11166
11092
  {
11167
11093
  id: "9f2a3b4c-5d6e-4190-8abf-123456789012",
11168
11094
  name: "Ndoki",
11169
11095
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
11096
+ validUntil: null,
11170
11097
  externalId: "aq4daBUAGr3"
11171
11098
  },
11172
11099
  {
11173
11100
  id: "0a3b4c5d-6e7f-4201-abcd-234567890123",
11174
11101
  name: "Tsanga",
11175
11102
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
11103
+ validUntil: null,
11176
11104
  externalId: "cqis6Y8trbJ"
11177
11105
  },
11178
11106
  {
11179
11107
  id: "1b4c5d6e-7f8a-4312-bcde-345678901234",
11180
11108
  name: "Waziri",
11181
11109
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
11110
+ validUntil: null,
11182
11111
  externalId: "LMijHPyyx6d"
11183
11112
  },
11184
11113
  {
11185
11114
  id: "2c5d6e7f-8a9b-4423-8def-456789012345",
11186
11115
  name: "Zimbi",
11187
11116
  parentId: "967032fd-3f81-478a-826c-30cb8fe121bd",
11117
+ validUntil: null,
11188
11118
  externalId: "pcQYbPuKGZ7"
11189
11119
  },
11190
11120
  // Villages under Itambo (89a33893-b17d-481d-a26d-6461e7ac1651)
@@ -11192,59 +11122,67 @@ var MOCK_ADMINISTRATIVE_AREAS_BASE = [
11192
11122
  id: "3d6e7f8a-9b0c-4534-8efa-567890123456",
11193
11123
  name: "Felani",
11194
11124
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
11125
+ validUntil: null,
11195
11126
  externalId: "gSqpoCGdMXp"
11196
11127
  },
11197
11128
  {
11198
11129
  id: "4e7f8a9b-0c1d-4645-8fab-678901234567",
11199
11130
  name: "Goroma",
11200
11131
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
11132
+ validUntil: null,
11201
11133
  externalId: "KvAAIaNqVrp"
11202
11134
  },
11203
11135
  {
11204
11136
  id: "5f8a9b0c-1d2e-4756-8abc-789012345678",
11205
11137
  name: "Halifu",
11206
11138
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
11139
+ validUntil: null,
11207
11140
  externalId: "qe4UnEVt1hv"
11208
11141
  },
11209
11142
  {
11210
11143
  id: "6a9b0c1d-2e3f-4867-abcd-890123456789",
11211
11144
  name: "Jabari",
11212
11145
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
11146
+ validUntil: null,
11213
11147
  externalId: "yHH9Nz4rLOt"
11214
11148
  },
11215
11149
  {
11216
11150
  id: "7b0c1d2e-3f4a-4978-bcde-901234567890",
11217
11151
  name: "Kifani",
11218
11152
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
11153
+ validUntil: null,
11219
11154
  externalId: "eSWmXIGeu1I"
11220
11155
  },
11221
11156
  {
11222
11157
  id: "8c1d2e3f-4a5b-4089-8def-012345678901",
11223
11158
  name: "Lumela",
11224
11159
  parentId: "89a33893-b17d-481d-a26d-6461e7ac1651",
11160
+ validUntil: null,
11225
11161
  externalId: "bh0b3aI1uP3"
11226
11162
  }
11227
11163
  ];
11228
- var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS = MOCK_ADMINISTRATIVE_AREAS_BASE.map(withVersionFields);
11229
- var MOCK_LOCATIONS_BASE = [
11164
+ var V2_DEFAULT_MOCK_LOCATIONS = [
11230
11165
  {
11231
11166
  id: "6f6186ce-cd5f-4a5f-810a-2d99e7c4ba12",
11232
11167
  name: "Central Provincial Office",
11233
11168
  locationType: "CRVS_OFFICE",
11234
11169
  administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
11170
+ validUntil: null,
11235
11171
  externalId: "Xr3Df8WpK6Ys"
11236
11172
  },
11237
11173
  {
11238
11174
  id: "b1c2d3e4-f5a6-7890-bcde-f12345678901",
11239
11175
  name: "Central Health Post",
11240
11176
  locationType: "HEALTH_FACILITY",
11241
- administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c"
11177
+ administrativeAreaId: "a45b982a-5c7b-4bd9-8fd8-a42d0994054c",
11178
+ validUntil: null
11242
11179
  },
11243
11180
  {
11244
11181
  id: "028d2c85-ca31-426d-b5d1-2cef545a4902",
11245
11182
  name: "Ibombo District Office",
11246
11183
  locationType: "CRVS_OFFICE",
11247
11184
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11185
+ validUntil: null,
11248
11186
  externalId: "Sm4Nw7GrD2Vy"
11249
11187
  },
11250
11188
  {
@@ -11252,6 +11190,7 @@ var MOCK_LOCATIONS_BASE = [
11252
11190
  name: "Isamba District Office",
11253
11191
  locationType: "CRVS_OFFICE",
11254
11192
  administrativeAreaId: "967032fd-3f81-478a-826c-30cb8fe121bd",
11193
+ validUntil: null,
11255
11194
  externalId: "Vg1Bq5XeH9Lt"
11256
11195
  },
11257
11196
  {
@@ -11259,6 +11198,7 @@ var MOCK_LOCATIONS_BASE = [
11259
11198
  name: "Isango District Office",
11260
11199
  locationType: "CRVS_OFFICE",
11261
11200
  administrativeAreaId: "27160bbd-32d1-4625-812f-860226bfb92a",
11201
+ validUntil: null,
11262
11202
  externalId: "Je7Lm2XqN9Vz"
11263
11203
  },
11264
11204
  {
@@ -11266,6 +11206,7 @@ var MOCK_LOCATIONS_BASE = [
11266
11206
  name: "Sulaka Provincial Office",
11267
11207
  locationType: "CRVS_OFFICE",
11268
11208
  administrativeAreaId: "c599b691-fd2d-45e1-abf4-d185de727fb5",
11209
+ validUntil: null,
11269
11210
  externalId: "Ht2Wp9KcX5Qv"
11270
11211
  },
11271
11212
  {
@@ -11273,6 +11214,7 @@ var MOCK_LOCATIONS_BASE = [
11273
11214
  name: "Ilanga District Office",
11274
11215
  locationType: "CRVS_OFFICE",
11275
11216
  administrativeAreaId: "8fbd09d2-212b-47f4-beb3-5e1694931d9f",
11217
+ validUntil: null,
11276
11218
  externalId: "Yp6Ds1WqN3Xz"
11277
11219
  },
11278
11220
  {
@@ -11280,6 +11222,7 @@ var MOCK_LOCATIONS_BASE = [
11280
11222
  name: "Chamakubi Health Post",
11281
11223
  locationType: "HEALTH_FACILITY",
11282
11224
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11225
+ validUntil: null,
11283
11226
  externalId: "M1nFr8LbC2Qy"
11284
11227
  },
11285
11228
  {
@@ -11287,6 +11230,7 @@ var MOCK_LOCATIONS_BASE = [
11287
11230
  name: "Ibombo Rural Health Centre",
11288
11231
  locationType: "HEALTH_FACILITY",
11289
11232
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11233
+ validUntil: null,
11290
11234
  externalId: "bT7pV6YrW0Xc"
11291
11235
  },
11292
11236
  {
@@ -11294,6 +11238,7 @@ var MOCK_LOCATIONS_BASE = [
11294
11238
  name: "Chikobo Rural Health Centre",
11295
11239
  locationType: "HEALTH_FACILITY",
11296
11240
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11241
+ validUntil: null,
11297
11242
  externalId: "zE4qPn2SgJ5d"
11298
11243
  },
11299
11244
  {
@@ -11301,6 +11246,7 @@ var MOCK_LOCATIONS_BASE = [
11301
11246
  name: "Chilochabalenje Health Post",
11302
11247
  locationType: "HEALTH_FACILITY",
11303
11248
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11249
+ validUntil: null,
11304
11250
  externalId: "H8vDs1MqR4Uf"
11305
11251
  },
11306
11252
  {
@@ -11308,6 +11254,7 @@ var MOCK_LOCATIONS_BASE = [
11308
11254
  name: "Chipeso Rural Health Centre",
11309
11255
  locationType: "HEALTH_FACILITY",
11310
11256
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11257
+ validUntil: null,
11311
11258
  externalId: "Qw3uZ9KfX6Lm"
11312
11259
  },
11313
11260
  {
@@ -11315,6 +11262,7 @@ var MOCK_LOCATIONS_BASE = [
11315
11262
  name: "Chisamba Rural Health Centre",
11316
11263
  locationType: "HEALTH_FACILITY",
11317
11264
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11265
+ validUntil: null,
11318
11266
  externalId: "Yr0pCg8LdM2s"
11319
11267
  },
11320
11268
  {
@@ -11322,6 +11270,7 @@ var MOCK_LOCATIONS_BASE = [
11322
11270
  name: "Chitanda Rural Health Centre",
11323
11271
  locationType: "HEALTH_FACILITY",
11324
11272
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11273
+ validUntil: null,
11325
11274
  externalId: "tS9gJ4PwB1Qx"
11326
11275
  },
11327
11276
  {
@@ -11329,6 +11278,7 @@ var MOCK_LOCATIONS_BASE = [
11329
11278
  name: "Golden Valley Rural Health Centre",
11330
11279
  locationType: "HEALTH_FACILITY",
11331
11280
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11281
+ validUntil: null,
11332
11282
  externalId: "Ld7Qm3XsA8Vr"
11333
11283
  },
11334
11284
  {
@@ -11336,6 +11286,7 @@ var MOCK_LOCATIONS_BASE = [
11336
11286
  name: "Ipongo Rural Health Centre",
11337
11287
  locationType: "HEALTH_FACILITY",
11338
11288
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11289
+ validUntil: null,
11339
11290
  externalId: "kF2sW9DmH0Bt"
11340
11291
  },
11341
11292
  {
@@ -11343,6 +11294,7 @@ var MOCK_LOCATIONS_BASE = [
11343
11294
  name: "Itumbwe Health Post",
11344
11295
  locationType: "HEALTH_FACILITY",
11345
11296
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11297
+ validUntil: null,
11346
11298
  externalId: "Ue5Xb3VaC7Pq"
11347
11299
  },
11348
11300
  {
@@ -11350,6 +11302,7 @@ var MOCK_LOCATIONS_BASE = [
11350
11302
  name: "Kabangalala Rural Health Centre",
11351
11303
  locationType: "HEALTH_FACILITY",
11352
11304
  administrativeAreaId: "62a0ccb4-880d-4f30-8882-f256007dfff9",
11305
+ validUntil: null,
11353
11306
  externalId: "Pz8Kc1TqH6Jn"
11354
11307
  },
11355
11308
  // Village offices
@@ -11358,61 +11311,13 @@ var MOCK_LOCATIONS_BASE = [
11358
11311
  name: "Klow Village Office",
11359
11312
  locationType: "CRVS_OFFICE",
11360
11313
  administrativeAreaId: "1d4e5f6a-7b8c-4912-8efa-345678901234",
11314
+ validUntil: null,
11361
11315
  externalId: "PmAyxAJkxiJ"
11362
11316
  }
11363
11317
  ];
11364
- var V2_DEFAULT_MOCK_LOCATIONS = MOCK_LOCATIONS_BASE.map(withVersionFields);
11365
11318
  var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
11366
11319
  V2_DEFAULT_MOCK_LOCATIONS.map((l) => [l.id, l])
11367
11320
  );
11368
11321
  var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
11369
11322
  V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
11370
11323
  );
11371
-
11372
- // ../commons/src/events/locationPayloads.ts
11373
- var z44 = __toESM(require("zod/v4"));
11374
- var CreateLocationPayload = z44.object({
11375
- id: UUID.optional(),
11376
- versionId: UUID.optional(),
11377
- name: z44.string(),
11378
- externalId: z44.string().nullish(),
11379
- administrativeAreaId: UUID.nullable(),
11380
- locationType: z44.string().nullable(),
11381
- effectiveFrom: z44.iso.date().optional(),
11382
- status: LocationStatus.default("active")
11383
- });
11384
- var UpdateLocationPayload = z44.strictObject({
11385
- id: UUID,
11386
- versionId: UUID.optional(),
11387
- name: z44.string(),
11388
- externalId: z44.string().nullish(),
11389
- status: LocationStatus,
11390
- effectiveFrom: z44.iso.date().optional(),
11391
- lastVersionId: UUID
11392
- });
11393
- var WithdrawLocationVersionPayload = z44.object({
11394
- id: UUID,
11395
- versionId: UUID
11396
- });
11397
- var CreateAdministrativeAreaPayload = z44.object({
11398
- id: UUID.optional(),
11399
- versionId: UUID.optional(),
11400
- name: z44.string(),
11401
- externalId: z44.string().nullish(),
11402
- parentId: UUID.nullable(),
11403
- effectiveFrom: z44.iso.date().optional(),
11404
- status: LocationStatus.default("active")
11405
- });
11406
- var UpdateAdministrativeAreaPayload = z44.strictObject({
11407
- id: UUID,
11408
- versionId: UUID.optional(),
11409
- name: z44.string(),
11410
- externalId: z44.string().nullish(),
11411
- status: LocationStatus,
11412
- effectiveFrom: z44.iso.date().optional(),
11413
- lastVersionId: UUID
11414
- });
11415
- var WithdrawAdministrativeAreaVersionPayload = z44.object({
11416
- id: UUID,
11417
- versionId: UUID
11418
- });