Skip to content

Commit 6f972aa

Browse files
committed
fix(adapter-openspp): use system_id instead of national_id as default identifier type for push
1 parent 7744ff1 commit 6f972aa

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

packages/adapter-openspp/src/__tests__/OpenSppV2SyncAdapter.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ describe("OpenSppV2SyncAdapter", () => {
179179
type: "Individual",
180180
identifier: expect.arrayContaining([
181181
expect.objectContaining({
182-
system: "urn:openspp:vocab:id-type#national_id",
182+
system: "urn:openspp:vocab:id-type#system_id",
183183
value: "individual-1",
184184
}),
185185
]),
@@ -228,10 +228,10 @@ describe("OpenSppV2SyncAdapter", () => {
228228
expect(result).toEqual({ pushed: 1, failed: 0, skipped: 0, errors: [] });
229229

230230
expect(mockV2ClientImplementation.getIndividual).toHaveBeenCalledWith(
231-
"urn:openspp:vocab:id-type#national_id|individual-1",
231+
"urn:openspp:vocab:id-type#system_id|individual-1",
232232
);
233233
expect(mockV2ClientImplementation.patchIndividual).toHaveBeenCalledWith(
234-
"urn:openspp:vocab:id-type#national_id|individual-1",
234+
"urn:openspp:vocab:id-type#system_id|individual-1",
235235
expect.objectContaining({
236236
name: expect.objectContaining({ family: "Smith" }),
237237
}),
@@ -399,10 +399,10 @@ describe("OpenSppV2SyncAdapter", () => {
399399
expect(result).toEqual({ pushed: 1, failed: 0, skipped: 0, errors: [] });
400400

401401
expect(mockV2ClientImplementation.getGroup).toHaveBeenCalledWith(
402-
"urn:openspp:vocab:id-type#national_id|group-1",
402+
"urn:openspp:vocab:id-type#system_id|group-1",
403403
);
404404
expect(mockV2ClientImplementation.patchGroup).toHaveBeenCalledWith(
405-
"urn:openspp:vocab:id-type#national_id|group-1",
405+
"urn:openspp:vocab:id-type#system_id|group-1",
406406
expect.objectContaining({ name: "New Name" }),
407407
undefined,
408408
);
@@ -789,7 +789,7 @@ describe("OpenSppV2SyncAdapter", () => {
789789
await adapter.pushData();
790790

791791
expect(mockV2ClientImplementation.patchIndividual).toHaveBeenCalledWith(
792-
"urn:openspp:vocab:id-type#national_id|ind-lock-1",
792+
"urn:openspp:vocab:id-type#system_id|ind-lock-1",
793793
expect.any(Object),
794794
"abc-123",
795795
);
@@ -831,7 +831,7 @@ describe("OpenSppV2SyncAdapter", () => {
831831
await adapter.pushData();
832832

833833
expect(mockV2ClientImplementation.patchGroup).toHaveBeenCalledWith(
834-
"urn:openspp:vocab:id-type#national_id|grp-lock-1",
834+
"urn:openspp:vocab:id-type#system_id|grp-lock-1",
835835
expect.any(Object),
836836
"def-456",
837837
);
@@ -919,7 +919,7 @@ describe("OpenSppV2SyncAdapter", () => {
919919

920920
expect(result).toEqual(expect.objectContaining({ pushed: 1, failed: 0, skipped: 0 }));
921921
expect(mockV2ClientImplementation.patchIndividual).toHaveBeenCalledWith(
922-
"urn:openspp:vocab:id-type#national_id|ind-nometa-1",
922+
"urn:openspp:vocab:id-type#system_id|ind-nometa-1",
923923
expect.any(Object),
924924
undefined,
925925
);

packages/adapter-openspp/src/v2/OpenSppV2SyncAdapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class OpenSppV2SyncAdapter implements ExternalSyncAdapter {
111111
this.batchDelayMs = getAdapterConfigValue<number>(config, "batchDelayMs", 1000) ?? 1000;
112112
this.maxRetries = getAdapterConfigValue<number>(config, "maxRetries", 2) ?? 2;
113113
this.identifierType =
114-
getAdapterConfigValue<string>(config, "identifierType") ?? "national_id";
114+
getAdapterConfigValue<string>(config, "identifierType") ?? "system_id";
115115
this.groupIdentifierType =
116116
getAdapterConfigValue<string>(config, "groupIdentifierType") ?? this.identifierType;
117117
}

0 commit comments

Comments
 (0)