Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MalpenZibo committed Sep 18, 2024
1 parent f878cd4 commit 72d58b3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/ivass-certified-attributes-importer/aws.config.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[default]
aws_access_key_id=test-aws-key
aws_secret_access_key=test-aws-secret
aws_access_key_id=testawskey
aws_secret_access_key=testawssecret
region=eu-central-1
1 change: 1 addition & 0 deletions packages/ivass-certified-attributes-importer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@zip.js/zip.js": "^2.7.31",
"axios": "^1.5.0",
"csv": "^6.3.2",
"ts-pattern": "5.2.0",
"dotenv-flow": "4.1.0",
"pagopa-interop-commons": "workspace:*",
"pagopa-interop-models": "workspace:*",
Expand Down
18 changes: 8 additions & 10 deletions packages/ivass-certified-attributes-importer/test/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { Tenant, TenantAttribute, unsafeBrandId } from "pagopa-interop-models";
import { vi } from "vitest";
import { match } from "ts-pattern";
import { IVASS_INSURANCES_ATTRIBUTE_CODE } from "../src/config/constants.js";
import { InteropContext } from "../src/model/interopContextModel.js";
import { PersistentAttribute } from "../src/model/attributeModel.js";
Expand Down Expand Up @@ -59,20 +60,17 @@ export const getTenantByIdMock = getTenantByIdMockGenerator((tenantId) => ({
export const getAttributeByExternalIdMock = (
origin: string,
code: string
): Promise<PersistentAttribute> => {
// eslint-disable-next-line sonarjs/no-small-switch
switch (code) {
case IVASS_INSURANCES_ATTRIBUTE_CODE:
return Promise.resolve({
): Promise<PersistentAttribute> =>
match(code)
.with(IVASS_INSURANCES_ATTRIBUTE_CODE, () =>
Promise.resolve({
...persistentAttribute,
id: ATTRIBUTE_IVASS_INSURANCES_ID,
origin,
code,
});
default:
return Promise.reject(new Error("Unexpected attribute code"));
}
};
})
)
.otherwise(() => Promise.reject(new Error("Unexpected attribute code")));

export const persistentTenant: Tenant = {
id: unsafeBrandId("091fbea1-0c8e-411b-988f-5098b6a33ba7"),
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 72d58b3

Please sign in to comment.