Skip to content

Commit 57cb83e

Browse files
committed
feat(vsa): change folder structure to add vertical slice architecture
closes #413
1 parent 815c831 commit 57cb83e

File tree

175 files changed

+637
-637
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+637
-637
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ module.exports = {
246246
},
247247
overrides: [
248248
{
249-
files: ['src/!(presentation|types)/**/*.ts'],
249+
files: ['src/!(contract|types)/**/*.ts'],
250250
rules: {
251251
'hexagonal-architecture/enforce': ['error']
252252
}

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = {
3030

3131
/* Bootstrap settings */
3232
// Set initial config and enable jest-extended features
33-
setupFilesAfterEnv: ['<rootDir>/test/jest.setup.ts', 'jest-extended/all'],
33+
setupFilesAfterEnv: ['<rootDir>/test/jest.setup.ts'],
3434

3535
/* Global test settings */
3636
// Automatically clear mock calls and instances between every test

package-lock.json

Lines changed: 337 additions & 337 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,20 @@
6464
"dependencies": {
6565
"@ngneat/falso": "^7.2.0",
6666
"@prisma/client": "^5.10.2",
67-
"@tsed/ajv": "^7.62.2",
68-
"@tsed/common": "^7.62.2",
69-
"@tsed/components-scan": "^7.62.2",
70-
"@tsed/core": "^7.62.2",
71-
"@tsed/di": "^7.62.2",
72-
"@tsed/exceptions": "^7.62.2",
73-
"@tsed/ioredis": "^7.62.2",
74-
"@tsed/json-mapper": "^7.62.2",
67+
"@tsed/ajv": "^7.62.3",
68+
"@tsed/common": "^7.62.3",
69+
"@tsed/components-scan": "^7.62.3",
70+
"@tsed/core": "^7.62.3",
71+
"@tsed/di": "^7.62.3",
72+
"@tsed/exceptions": "^7.62.3",
73+
"@tsed/ioredis": "^7.62.3",
74+
"@tsed/json-mapper": "^7.62.3",
7575
"@tsed/logger": "^6.6.3",
76-
"@tsed/openspec": "^7.62.2",
77-
"@tsed/platform-express": "^7.62.2",
78-
"@tsed/prisma": "^7.62.2",
79-
"@tsed/schema": "^7.62.2",
80-
"@tsed/swagger": "^7.62.2",
76+
"@tsed/openspec": "^7.62.3",
77+
"@tsed/platform-express": "^7.62.3",
78+
"@tsed/prisma": "^7.62.3",
79+
"@tsed/schema": "^7.62.3",
80+
"@tsed/swagger": "^7.62.3",
8181
"ajv": "^8.12.0",
8282
"argon2": "^0.40.1",
8383
"body-parser": "^1.20.2",
@@ -134,18 +134,18 @@
134134
"@types/luxon": "^3.4.2",
135135
"@types/method-override": "^0.0.35",
136136
"@types/multer": "^1.4.11",
137-
"@types/node": "^20.11.24",
137+
"@types/node": "^20.11.25",
138138
"@types/node-emoji": "^1.8.2",
139139
"@types/source-map-support": "^0.5.10",
140140
"@types/supertest": "^6.0.2",
141141
"@types/swagger-schema-official": "^2.0.25",
142142
"@types/uuid": "^9.0.8",
143-
"@typescript-eslint/eslint-plugin": "^7.1.0",
144-
"@typescript-eslint/parser": "^7.1.0",
143+
"@typescript-eslint/eslint-plugin": "^7.1.1",
144+
"@typescript-eslint/parser": "^7.1.1",
145145
"commitizen": "^4.3.0",
146146
"copyfiles": "^2.4.1",
147147
"cross-env": "^7.0.3",
148-
"cspell": "^8.5.0",
148+
"cspell": "^8.6.0",
149149
"cz-conventional-changelog": "^3.3.0",
150150
"eslint": "^8.57.0",
151151
"eslint-config-airbnb-base": "^15.0.0",
@@ -159,7 +159,7 @@
159159
"eslint-plugin-jest": "^27.9.0",
160160
"eslint-plugin-jest-extended": "^2.0.0",
161161
"eslint-plugin-jsonc": "^2.13.0",
162-
"eslint-plugin-markdown": "^3.0.1",
162+
"eslint-plugin-markdown": "^4.0.1",
163163
"eslint-plugin-n": "^16.6.2",
164164
"eslint-plugin-optimize-regex": "^1.2.1",
165165
"eslint-plugin-prefer-arrow": "^1.2.3",
@@ -198,15 +198,15 @@
198198
"tsc-alias": "^1.8.8",
199199
"tsconfig-paths": "^4.2.0",
200200
"tsx": "^4.7.1",
201-
"typescript": "^5.3.3",
201+
"typescript": "^5.4.2",
202202
"yaml-eslint-parser": "^1.2.2"
203203
},
204204
"engines": {
205205
"node": ">=20.9.0",
206206
"npm": ">=6.7.0"
207207
},
208208
"prisma": {
209-
"schema": "src/infrastructure/shared/persistence/prisma/schema.prisma",
210-
"seed": "tsx src/infrastructure/shared/persistence/prisma/seed.ts"
209+
"schema": "src/shared/infrastructure/persistence/prisma/schema.prisma",
210+
"seed": "tsx src/shared/infrastructure/persistence/prisma/seed.ts"
211211
}
212212
}

src/presentation/rest/config/app.config.ts renamed to src/contract/rest/config/app.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { sync as readPackageJsonSync } from 'read-pkg';
22

3-
import { getEnvironmentNumber, getEnvironmentString } from '@infrastructure/shared/config/environment';
3+
import { getEnvironmentNumber, getEnvironmentString } from '@shared/infrastructure/config/environment';
44

55
const AppInfo = Object.freeze({
66
APP_VERSION: getEnvironmentString('APP_VERSION', readPackageJsonSync().version),
File renamed without changes.

src/presentation/rest/controllers/authentication/authenticated-user.api-response.ts renamed to src/contract/rest/controllers/authentication/authenticated-user.api-response.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Default, Email, Enum, Format, Property } from '@tsed/schema';
22

3-
import { UserResponse } from '@application/users';
4-
import { UserGenders, UserRoles } from '@domain/users';
3+
import { UserResponse } from '@modules/users/application';
4+
import { UserGenders, UserRoles } from '@modules/users/domain';
55

66
class AuthenticatedUserApiResponse {
77
@Property()

src/presentation/rest/controllers/authentication/authentication.controller.ts renamed to src/contract/rest/controllers/authentication/authentication.controller.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ import { BodyParams, Context, Req, Res } from '@tsed/common';
22
import { Delete, Description, Example, Get, Post, Returns, Status, Summary, Tags, Title } from '@tsed/schema';
33
import { StatusCodes } from 'http-status-codes';
44

5-
import { SessionResponse } from '@application/sessions';
6-
import { EndSessionRequest, EndSessionUseCase } from '@application/sessions/end';
7-
import { RefreshSessionRequest, RefreshSessionUseCase } from '@application/sessions/refresh';
8-
import { StartSessionRequest, StartSessionUseCase } from '@application/sessions/start';
9-
import { UserResponse } from '@application/users';
10-
import { AuthenticateUserRequest, AuthenticateUserUseCase } from '@application/users/authentication';
11-
import { FindUserRequest, FindUserUseCase } from '@application/users/find';
12-
import { Logger } from '@domain/shared';
13-
import { TriggeredBy, TriggeredByUser } from '@domain/shared/entities/triggered-by';
14-
import { Authentication } from '@infrastructure/shared/authentication';
15-
import { AuthenticationUtils } from '@infrastructure/shared/authentication/authentication-utils';
16-
import { AppConfig } from '@presentation/rest/config';
17-
import { NoCredentialsProvidedException } from '@presentation/rest/exceptions';
18-
import { RequestUtils } from '@presentation/rest/shared/request.utils';
19-
import { ResponseUtils } from '@presentation/rest/shared/response.utils';
20-
import { RestController } from '@presentation/rest/shared/rest-controller.decorator';
21-
import { WithAuth } from '@presentation/rest/shared/with-auth.decorator';
5+
import { AppConfig } from '@contract/rest/config';
6+
import { NoCredentialsProvidedException } from '@contract/rest/exceptions';
7+
import { RequestUtils } from '@contract/rest/shared/request.utils';
8+
import { ResponseUtils } from '@contract/rest/shared/response.utils';
9+
import { RestController } from '@contract/rest/shared/rest-controller.decorator';
10+
import { WithAuth } from '@contract/rest/shared/with-auth.decorator';
11+
import { SessionResponse } from '@modules/sessions/application';
12+
import { EndSessionRequest, EndSessionUseCase } from '@modules/sessions/application/end';
13+
import { RefreshSessionRequest, RefreshSessionUseCase } from '@modules/sessions/application/refresh';
14+
import { StartSessionRequest, StartSessionUseCase } from '@modules/sessions/application/start';
15+
import { UserResponse } from '@modules/users/application';
16+
import { AuthenticateUserRequest, AuthenticateUserUseCase } from '@modules/users/application/authentication';
17+
import { FindUserRequest, FindUserUseCase } from '@modules/users/application/find';
18+
import { Logger } from '@shared/domain';
19+
import { TriggeredBy, TriggeredByUser } from '@shared/domain/entities/triggered-by';
20+
import { Authentication } from '@shared/infrastructure/authentication';
21+
import { AuthenticationUtils } from '@shared/infrastructure/authentication/authentication-utils';
2222

2323
import { AuthenticatedUserApiResponse } from './authenticated-user.api-response';
2424
import { UserSuccessfullyAuthenticatedApiResponse } from './user-successfully-authenticated.api-response';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { CollectionOf, Email, Property } from '@tsed/schema';
22

3-
import { SessionResponse } from '@application/sessions';
3+
import { SessionResponse } from '@modules/sessions/application';
44

55
class UserSuccessfullyAuthenticatedApiResponse {
66
@Property()

src/presentation/rest/controllers/health/health-status.api-response.ts renamed to src/contract/rest/controllers/health/health-status.api-response.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Default, Property } from '@tsed/schema';
22

3-
import { HealthStatusResponse } from '@application/health';
4-
import { AppInfo } from '@presentation/rest/config';
3+
import { AppInfo } from '@contract/rest/config';
4+
import { HealthStatusResponse } from '@modules/health/application';
55

66
class HealthStatusApiResponse {
77
@Property()

0 commit comments

Comments
 (0)