Skip to content

Commit 867ef68

Browse files
committed
CCM-7465: move template-schems to backend-client in preperation to use in the web-ui
CCM-7465: Create Template specific DTOs from Zod schemas
1 parent cf001a3 commit 867ef68

File tree

18 files changed

+157
-143
lines changed

18 files changed

+157
-143
lines changed

lambdas/backend-api/src/__tests__/templates/app/template-client.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@ import {
33
TemplateStatus,
44
TemplateType,
55
UpdateTemplate,
6-
} from 'nhs-notify-backend-client';
7-
import {
86
$CreateTemplateSchema,
97
$UpdateTemplateSchema,
10-
Template,
11-
templateRepository,
12-
} from '@backend-api/templates/domain/template';
8+
} from 'nhs-notify-backend-client';
9+
import { Template, templateRepository } from '@backend-api/templates/infra';
1310
import { validate } from '@backend-api/utils/validate';
1411
import { TemplateClient } from '@backend-api/templates/app/template-client';
1512

16-
jest.mock('@backend-api/templates/domain/template/template-repository');
13+
jest.mock('@backend-api/templates/infra');
1714
jest.mock('@backend-api/utils/validate');
1815

1916
const createMock = jest.mocked(templateRepository.create);

lambdas/backend-api/src/__tests__/templates/domain/template/template-repository.test.ts renamed to lambdas/backend-api/src/__tests__/templates/infra/template-repository.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ import {
1313
UpdateTemplate,
1414
} from 'nhs-notify-backend-client';
1515
import { ConditionalCheckFailedException } from '@aws-sdk/client-dynamodb';
16-
import {
17-
Template,
18-
templateRepository,
19-
} from '@backend-api/templates/domain/template';
16+
import { Template, templateRepository } from '@backend-api/templates/infra';
2017

2118
jest.mock('node:crypto');
2219

lambdas/backend-api/src/templates/app/template-client.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ import {
55
Result,
66
TemplateDTO,
77
UpdateTemplate,
8-
} from 'nhs-notify-backend-client';
9-
import {
108
$CreateTemplateSchema,
119
$UpdateTemplateSchema,
12-
templateRepository,
13-
} from '@backend-api/templates/domain/template';
10+
} from 'nhs-notify-backend-client';
11+
import { templateRepository } from '@backend-api/templates/infra';
1412

1513
export class TemplateClient implements ITemplateClient {
1614
constructor(private readonly _owner: string) {}

lambdas/backend-api/src/templates/domain/template/index.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

lambdas/backend-api/src/templates/domain/template/template-schema.ts

Lines changed: 0 additions & 69 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './template';
2+
export * from './template-repository';

lambdas/backend-api/src/templates/domain/template/template-repository.ts renamed to lambdas/backend-api/src/templates/infra/template-repository.ts

File renamed without changes.

lambdas/backend-api/src/templates/domain/template/template.ts renamed to lambdas/backend-api/src/templates/infra/template.ts

File renamed without changes.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
export * from './logger';
22
export * from './validate';
3-
export * from './schema-for';
43
export * from './result';

lambdas/backend-client/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"types": "src/index.ts",
1818
"dependencies": {
1919
"axios": "^1.7.9",
20-
"axios-retry": "^4.5.0"
20+
"axios-retry": "^4.5.0",
21+
"zod": "^3.24.1"
2122
},
2223
"devDependencies": {
2324
"@swc/core": "^1.9.2",

0 commit comments

Comments
 (0)