@opencrvs/toolkit 2.1.0-rc.d13869e → 2.1.0-rc.d2ebb60

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.
@@ -7834,8 +7834,8 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
7834
7834
  email?: string | undefined;
7835
7835
  status?: string | undefined;
7836
7836
  primaryOfficeId?: string | undefined;
7837
- count?: number | undefined;
7838
- skip?: number | undefined;
7837
+ count: number;
7838
+ skip: number;
7839
7839
  sortBy?: "createdAt" | "email" | "firstname" | "role" | "status" | "surname" | "username" | undefined;
7840
7840
  sortOrder: "asc" | "desc";
7841
7841
  };
@@ -8351,15 +8351,8 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
8351
8351
  name: string;
8352
8352
  externalId?: string | null | undefined;
8353
8353
  administrativeAreaId: (string & import("zod").$brand<"UUID">) | null;
8354
+ validUntil: string | null;
8354
8355
  locationType: string | null;
8355
- status: "active" | "inactive";
8356
- versions: {
8357
- versionId: string & import("zod").$brand<"UUID">;
8358
- effectiveFrom: string;
8359
- name: string;
8360
- externalId?: string | null | undefined;
8361
- status: "active" | "inactive";
8362
- }[];
8363
8356
  }[];
8364
8357
  meta: object;
8365
8358
  }>;
@@ -8369,6 +8362,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
8369
8362
  name: string;
8370
8363
  externalId?: string | null | undefined;
8371
8364
  administrativeAreaId: string | null;
8365
+ validUntil: string | null;
8372
8366
  locationType: string | null;
8373
8367
  }[];
8374
8368
  output: void;
@@ -8383,15 +8377,8 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
8383
8377
  name: string;
8384
8378
  externalId?: string | null | undefined;
8385
8379
  administrativeAreaId: (string & import("zod").$brand<"UUID">) | null;
8380
+ validUntil: string | null;
8386
8381
  locationType: string | null;
8387
- status: "active" | "inactive";
8388
- versions: {
8389
- versionId: string & import("zod").$brand<"UUID">;
8390
- effectiveFrom: string;
8391
- name: string;
8392
- externalId?: string | null | undefined;
8393
- status: "active" | "inactive";
8394
- }[];
8395
8382
  };
8396
8383
  meta: import("trpc-to-openapi").OpenApiMeta;
8397
8384
  }>;
@@ -8799,14 +8786,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
8799
8786
  name: string;
8800
8787
  externalId?: string | null | undefined;
8801
8788
  parentId: (string & import("zod").$brand<"UUID">) | null;
8802
- status: "active" | "inactive";
8803
- versions: {
8804
- versionId: string & import("zod").$brand<"UUID">;
8805
- effectiveFrom: string;
8806
- name: string;
8807
- externalId?: string | null | undefined;
8808
- status: "active" | "inactive";
8809
- }[];
8789
+ validUntil: string | null;
8810
8790
  }[];
8811
8791
  meta: import("trpc-to-openapi").OpenApiMeta;
8812
8792
  }>;
@@ -8816,6 +8796,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
8816
8796
  name: string;
8817
8797
  externalId?: string | null | undefined;
8818
8798
  parentId: string | null;
8799
+ validUntil: string | null;
8819
8800
  }[];
8820
8801
  output: void;
8821
8802
  meta: object;
@@ -11,46 +11,12 @@ export declare const LocationTypeV1: z.ZodEnum<{
11
11
  HEALTH_FACILITY: "HEALTH_FACILITY";
12
12
  }>;
13
13
  export type LocationTypeV1 = z.infer<typeof LocationTypeV1>;
14
- export declare const LocationStatus: z.ZodEnum<{
15
- active: "active";
16
- inactive: "inactive";
17
- }>;
18
- export type LocationStatus = z.infer<typeof LocationStatus>;
19
- /**
20
- * A single element of the append-only `versions` history of a location or
21
- * administrative area. Versions are sorted ascending by `effectiveFrom`
22
- * ('0001-01-01' is used as the beginning-of-time sentinel).
23
- */
24
- export declare const LocationVersion: z.ZodObject<{
25
- versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
26
- effectiveFrom: z.ZodISODate;
27
- name: z.ZodString;
28
- externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
- status: z.ZodEnum<{
30
- active: "active";
31
- inactive: "inactive";
32
- }>;
33
- }, z.core.$strip>;
34
- export type LocationVersion = z.infer<typeof LocationVersion>;
35
14
  export declare const AdministrativeArea: z.ZodObject<{
36
15
  id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
37
16
  name: z.ZodString;
38
17
  externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
18
  parentId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
40
- status: z.ZodEnum<{
41
- active: "active";
42
- inactive: "inactive";
43
- }>;
44
- versions: z.ZodArray<z.ZodObject<{
45
- versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
46
- effectiveFrom: z.ZodISODate;
47
- name: z.ZodString;
48
- externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
- status: z.ZodEnum<{
50
- active: "active";
51
- inactive: "inactive";
52
- }>;
53
- }, z.core.$strip>>;
19
+ validUntil: z.ZodNullable<z.ZodISODateTime>;
54
20
  }, z.core.$strip>;
55
21
  export type AdministrativeArea = z.infer<typeof AdministrativeArea>;
56
22
  export declare const Location: z.ZodObject<{
@@ -58,59 +24,10 @@ export declare const Location: z.ZodObject<{
58
24
  name: z.ZodString;
59
25
  externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
26
  administrativeAreaId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
27
+ validUntil: z.ZodNullable<z.ZodISODateTime>;
61
28
  locationType: z.ZodNullable<z.ZodString>;
62
- status: z.ZodEnum<{
63
- active: "active";
64
- inactive: "inactive";
65
- }>;
66
- versions: z.ZodArray<z.ZodObject<{
67
- versionId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
68
- effectiveFrom: z.ZodISODate;
69
- name: z.ZodString;
70
- externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
- status: z.ZodEnum<{
72
- active: "active";
73
- inactive: "inactive";
74
- }>;
75
- }, z.core.$strip>>;
76
29
  }, z.core.$strip>;
77
30
  export type Location = z.infer<typeof Location>;
78
- /**
79
- * Input payload for the locations `set` mutation. Carries only the seedable
80
- * identity and hierarchy fields — version history is managed by the server.
81
- */
82
- export declare const SetLocationPayload: z.ZodObject<{
83
- id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
84
- name: z.ZodString;
85
- externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
- administrativeAreaId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
87
- locationType: z.ZodNullable<z.ZodString>;
88
- }, z.core.$strip>;
89
- export type SetLocationPayload = z.infer<typeof SetLocationPayload>;
90
- /**
91
- * Input payload for the administrative areas `set` mutation. Carries only the
92
- * seedable identity and hierarchy fields — version history is managed by the
93
- * server.
94
- */
95
- export declare const SetAdministrativeAreaPayload: z.ZodObject<{
96
- id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
97
- name: z.ZodString;
98
- externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
99
- parentId: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
100
- }, z.core.$strip>;
101
- export type SetAdministrativeAreaPayload = z.infer<typeof SetAdministrativeAreaPayload>;
102
- /**
103
- * Resolves the version in effect at the given anchor date.
104
- *
105
- * Returns the element with the greatest `effectiveFrom` that is less than or
106
- * equal to `anchor`, falling back to the earliest element when the anchor
107
- * precedes all versions. Assumes `versions` is sorted ascending by
108
- * `effectiveFrom`. Both `effectiveFrom` and `anchor` are 'YYYY-MM-DD' strings,
109
- * so plain string comparison is correct.
110
- */
111
- export declare function resolveVersion<T extends {
112
- effectiveFrom: string;
113
- }>(versions: T[], anchor: string): T;
114
31
  type WrapArrayPreserveNullish<V> = V extends readonly any[] ? V : NonNullable<V>[] | Extract<V, null | undefined>;
115
32
  /**
116
33
  * For type T, convert fields K to arrays. If field is string, convert to string[].
@@ -162,14 +79,7 @@ export declare function getAdministrativeAreaHierarchy(administrativeAreaId: str
162
79
  name: string;
163
80
  externalId?: string | null | undefined;
164
81
  parentId: (string & z.$brand<"UUID">) | null;
165
- status: "active" | "inactive";
166
- versions: {
167
- versionId: string & z.$brand<"UUID">;
168
- effectiveFrom: string;
169
- name: string;
170
- externalId?: string | null | undefined;
171
- status: "active" | "inactive";
172
- }[];
82
+ validUntil: string | null;
173
83
  }[];
174
84
  /**
175
85
  * Resolves a location or administrative area UUID into a root-first hierarchy of UUIDs.
@@ -6,28 +6,14 @@ export declare const V2_DEFAULT_MOCK_LOCATIONS_MAP: Map<string & import("zod").$
6
6
  name: string;
7
7
  externalId?: string | null | undefined;
8
8
  administrativeAreaId: (string & import("zod").$brand<"UUID">) | null;
9
+ validUntil: string | null;
9
10
  locationType: string | null;
10
- status: "active" | "inactive";
11
- versions: {
12
- versionId: string & import("zod").$brand<"UUID">;
13
- effectiveFrom: string;
14
- name: string;
15
- externalId?: string | null | undefined;
16
- status: "active" | "inactive";
17
- }[];
18
11
  }>;
19
12
  export declare const V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP: Map<string & import("zod").$brand<"UUID">, {
20
13
  id: string & import("zod").$brand<"UUID">;
21
14
  name: string;
22
15
  externalId?: string | null | undefined;
23
16
  parentId: (string & import("zod").$brand<"UUID">) | null;
24
- status: "active" | "inactive";
25
- versions: {
26
- versionId: string & import("zod").$brand<"UUID">;
27
- effectiveFrom: string;
28
- name: string;
29
- externalId?: string | null | undefined;
30
- status: "active" | "inactive";
31
- }[];
17
+ validUntil: string | null;
32
18
  }>;
33
19
  //# sourceMappingURL=mocks.test.utils.d.ts.map
@@ -9,7 +9,7 @@ import { EventIndex } from './EventIndex';
9
9
  import { EventInput } from './EventInput';
10
10
  import { TranslationConfig } from './TranslationConfig';
11
11
  import { FieldConfig } from './FieldConfig';
12
- import { SetLocationPayload, SetAdministrativeAreaPayload } from './locations';
12
+ import { Location, AdministrativeArea } from './locations';
13
13
  import { WorkqueueConfig } from './WorkqueueConfig';
14
14
  import * as z from 'zod/v4';
15
15
  import { DocumentPath } from '../documents';
@@ -48,16 +48,16 @@ export declare function fieldConfigsToActionPayload(fields: FieldConfig[], rng:
48
48
  * Given hierarchy, ensures that related fields (e.g. location and administrative area) have valid values based on the hierarchy.
49
49
  */
50
50
  administrativeHierarchy?: {
51
- administrativeAreas: SetAdministrativeAreaPayload[];
52
- locations: SetLocationPayload[];
51
+ administrativeAreas: AdministrativeArea[];
52
+ locations: Location[];
53
53
  }): ActionUpdate;
54
54
  export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType, rng: () => number, overrides?: ActionUpdate,
55
55
  /**
56
56
  * Given hierarchy, ensures that related fields (e.g. location and administrative area) have valid values based on the hierarchy.
57
57
  */
58
58
  administrativeHierarchy?: {
59
- administrativeAreas: SetAdministrativeAreaPayload[];
60
- locations: SetLocationPayload[];
59
+ administrativeAreas: AdministrativeArea[];
60
+ locations: Location[];
61
61
  }): ActionUpdate;
62
62
  export declare function generateActionDuplicateDeclarationInput(...args: Parameters<typeof generateActionDeclarationInput>): ReturnType<typeof generateActionDeclarationInput>;
63
63
  export declare function eventPayloadGenerator(rng: () => number, configuration?: EventConfig): {