.
This commit is contained in:
parent
8455ae43db
commit
6a674a60ec
@ -1,8 +1,8 @@
|
||||
// This configuration only applies to the package manager root.
|
||||
/** @type {import("eslint").Linter.Config} */
|
||||
module.exports = {
|
||||
ignorePatterns: ["apps/**", "packages/**"],
|
||||
extends: ["@repo/eslint-config/library.js"],
|
||||
ignorePatterns: ["apps/**", "packages/**", "libs/**"],
|
||||
extends: ["@repo/eslint-config"],
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: {
|
||||
project: true,
|
||||
|
||||
85
README.md
85
README.md
@ -1,84 +1 @@
|
||||
# Turborepo starter
|
||||
|
||||
This Turborepo starter is maintained by the Turborepo core team.
|
||||
|
||||
## Using this example
|
||||
|
||||
Run the following command:
|
||||
|
||||
```sh
|
||||
npx create-turbo@latest
|
||||
```
|
||||
|
||||
## What's inside?
|
||||
|
||||
This Turborepo includes the following packages/apps:
|
||||
|
||||
### Apps and Packages
|
||||
|
||||
- `docs`: a [Next.js](https://nextjs.org/) app
|
||||
- `web`: another [Next.js](https://nextjs.org/) app
|
||||
- `@repo/ui`: a stub React component library shared by both `web` and `docs` applications
|
||||
- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
|
||||
- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo
|
||||
|
||||
Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
|
||||
|
||||
### Utilities
|
||||
|
||||
This Turborepo has some additional tools already setup for you:
|
||||
|
||||
- [TypeScript](https://www.typescriptlang.org/) for static type checking
|
||||
- [ESLint](https://eslint.org/) for code linting
|
||||
- [Prettier](https://prettier.io) for code formatting
|
||||
|
||||
### Build
|
||||
|
||||
To build all apps and packages, run the following command:
|
||||
|
||||
```
|
||||
cd my-turborepo
|
||||
pnpm build
|
||||
```
|
||||
|
||||
### Develop
|
||||
|
||||
To develop all apps and packages, run the following command:
|
||||
|
||||
```
|
||||
cd my-turborepo
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
### Remote Caching
|
||||
|
||||
> [!TIP]
|
||||
> Vercel Remote Cache is free for all plans. Get started today at [vercel.com](https://vercel.com/signup?/signup?utm_source=remote-cache-sdk&utm_campaign=free_remote_cache).
|
||||
|
||||
Turborepo can use a technique known as [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
|
||||
|
||||
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup?utm_source=turborepo-examples), then enter the following commands:
|
||||
|
||||
```
|
||||
cd my-turborepo
|
||||
npx turbo login
|
||||
```
|
||||
|
||||
This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).
|
||||
|
||||
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
|
||||
|
||||
```
|
||||
npx turbo link
|
||||
```
|
||||
|
||||
## Useful Links
|
||||
|
||||
Learn more about the power of Turborepo:
|
||||
|
||||
- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks)
|
||||
- [Caching](https://turbo.build/repo/docs/core-concepts/caching)
|
||||
- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching)
|
||||
- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering)
|
||||
- [Configuration Options](https://turbo.build/repo/docs/reference/configuration)
|
||||
- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)
|
||||
Monorepo con cliente, servidor y packages modulares.
|
||||
|
||||
3
apps/client/.eslintrc.js
Normal file
3
apps/client/.eslintrc.js
Normal file
@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
extends: ["@repo/eslint-config"],
|
||||
};
|
||||
@ -14,6 +14,8 @@
|
||||
"react-dom": "^18.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@repo/eslint-config": "workspace:*",
|
||||
"@repo/tsconfig": "workspace:*",
|
||||
"@eslint/js": "^9.17.0",
|
||||
"@types/react": "^18.3.18",
|
||||
"@types/react-dom": "^18.3.5",
|
||||
@ -22,7 +24,7 @@
|
||||
"eslint-plugin-react-hooks": "^5.0.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.16",
|
||||
"globals": "^15.14.0",
|
||||
"typescript": "~5.6.2",
|
||||
"typescript": "^5.7.3",
|
||||
"typescript-eslint": "^8.18.2",
|
||||
"vite": "^6.0.5"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
@ -1,6 +1,5 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
@ -22,5 +21,6 @@
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
},
|
||||
"include": ["src"]
|
||||
"include": ["src"],
|
||||
"extends": "@repo/tsconfig/react"
|
||||
}
|
||||
4
apps/client/tsconfig.json
Normal file
4
apps/client/tsconfig.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"files": [],
|
||||
"references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||
"target": "ES2022",
|
||||
"lib": ["ES2023"],
|
||||
"module": "ESNext",
|
||||
@ -20,5 +19,6 @@
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
"include": ["vite.config.ts"],
|
||||
"extends": "@repo/tsconfig/node"
|
||||
}
|
||||
3
apps/server/.eslintrc.js
Normal file
3
apps/server/.eslintrc.js
Normal file
@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
extends: ["@repo/eslint-config"],
|
||||
};
|
||||
@ -1,50 +0,0 @@
|
||||
{
|
||||
"root": true,
|
||||
"env": {
|
||||
"browser": false,
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:jest/recommended",
|
||||
"prettier"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": ["@typescript-eslint", "sort-class-members", "hexagonal-architecture"],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-inferrable-types": "off",
|
||||
"@typescript-eslint/no-empty-interface": "off",
|
||||
"@typescript-eslint/recommended-requiring-type-checking": "off",
|
||||
"@typescript-eslint/no-unused-vars": "warn",
|
||||
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
|
||||
|
||||
"sort-class-members/sort-class-members": [
|
||||
2,
|
||||
{
|
||||
"order": [
|
||||
"[static-properties]",
|
||||
"[static-methods]",
|
||||
"[conventional-private-properties]",
|
||||
"[properties]",
|
||||
"constructor",
|
||||
"[methods]",
|
||||
"[conventional-private-methods]"
|
||||
],
|
||||
"accessorPairPositioning": "getThenSet"
|
||||
}
|
||||
]
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["**/*.test.ts"],
|
||||
"env": { "jest": true, "node": true }
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -18,7 +18,7 @@
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@repo/eslint-config": "workspace:*",
|
||||
"@repo/typescript-config": "workspace:*",
|
||||
"@repo/tsconfig": "workspace:*",
|
||||
"@types/bcrypt": "^5.0.2",
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/glob": "^8.1.0",
|
||||
@ -32,15 +32,6 @@
|
||||
"@types/response-time": "^2.3.8",
|
||||
"@typescript-eslint/eslint-plugin": "^8.22.0",
|
||||
"@typescript-eslint/parser": "^8.22.0",
|
||||
"eslint": "^9.19.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-hexagonal-architecture": "^1.0.3",
|
||||
"eslint-plugin-import": "^2.28.0",
|
||||
"eslint-plugin-jest": "^27.4.2",
|
||||
"eslint-plugin-prettier": "^5.0.0",
|
||||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||
"eslint-plugin-sort-class-members": "^1.19.0",
|
||||
"eslint-plugin-unused-imports": "^3.0.0",
|
||||
"jest": "^29.7.0",
|
||||
"nodemon": "^3.1.9",
|
||||
"ts-jest": "^29.2.5",
|
||||
@ -84,7 +75,7 @@
|
||||
"node": ">=22"
|
||||
},
|
||||
"_moduleAliases": {
|
||||
"@common": "./dist/common",
|
||||
"@config": "./dist/config"
|
||||
"@common": "./src/common",
|
||||
"@config": "./src/config"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { logger } from "@common/infrastructure/logger";
|
||||
import { globalErrorHandler } from "@common/presentation";
|
||||
import { authProvider } from "@contexts/auth/infraestructure";
|
||||
import dotenv from "dotenv";
|
||||
import express, { Application } from "express";
|
||||
import helmet from "helmet";
|
||||
import responseTime from "response-time";
|
||||
import { authProvider } from "./contexts/auth/infraestructure";
|
||||
import { logger } from "./core/common/infrastructure/logger";
|
||||
import { globalErrorHandler } from "./core/common/presentation";
|
||||
import { v1Routes } from "./routes";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
@ -1,82 +0,0 @@
|
||||
// Interfaz para definir las operaciones básicas de una colección
|
||||
/*interface ICollection<T> {
|
||||
reset(): void;
|
||||
add(item: T): void;
|
||||
remove(item: T): boolean;
|
||||
getAll(): T[];
|
||||
size(): number;
|
||||
total(): number | null;
|
||||
}*/
|
||||
|
||||
export class Collection<T> /*implements ICollection<T>*/ {
|
||||
private items: T[];
|
||||
private totalItems: number | null;
|
||||
|
||||
constructor(items: T[] = [], totalItems: number | null = null) {
|
||||
this.items = [...items];
|
||||
this.totalItems = totalItems ?? items.length;
|
||||
}
|
||||
|
||||
// Resetea la colección
|
||||
reset(): void {
|
||||
this.items = [];
|
||||
this.totalItems = 0;
|
||||
}
|
||||
|
||||
// Agrega un elemento a la colección
|
||||
add(item: T): void {
|
||||
this.items.push(item);
|
||||
if (this.totalItems !== null) {
|
||||
this.totalItems++;
|
||||
}
|
||||
}
|
||||
|
||||
// Elimina un elemento de la colección
|
||||
remove(item: T): boolean {
|
||||
const index = this.items.indexOf(item);
|
||||
if (index !== -1) {
|
||||
this.items.splice(index, 1);
|
||||
if (this.totalItems !== null) {
|
||||
this.totalItems--;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Devuelve todos los elementos
|
||||
getAll(): T[] {
|
||||
return [...this.items];
|
||||
}
|
||||
|
||||
// Devuelve el número de elementos en la colección
|
||||
size(): number {
|
||||
return this.items.length;
|
||||
}
|
||||
|
||||
// Devuelve el total de elementos esperados en la colección
|
||||
total(): number | null {
|
||||
return this.totalItems;
|
||||
}
|
||||
|
||||
// Implementación de operaciones nativas de array
|
||||
map<U>(callback: (item: T, index: number, array: T[]) => U): U[] {
|
||||
return this.items.map(callback);
|
||||
}
|
||||
|
||||
filter(callback: (item: T, index: number, array: T[]) => boolean): T[] {
|
||||
return this.items.filter(callback);
|
||||
}
|
||||
|
||||
find(callback: (item: T, index: number, array: T[]) => boolean): T | undefined {
|
||||
return this.items.find(callback);
|
||||
}
|
||||
|
||||
some(callback: (item: T, index: number, array: T[]) => boolean): boolean {
|
||||
return this.items.some(callback);
|
||||
}
|
||||
|
||||
every(callback: (item: T, index: number, array: T[]) => boolean): boolean {
|
||||
return this.items.every(callback);
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
import { logger } from "@common/infrastructure/logger";
|
||||
import { logger } from "core/common/infrastructure/logger";
|
||||
import dotenv from "dotenv";
|
||||
import { Sequelize } from "sequelize";
|
||||
import { registerModels } from "./register-models";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { logger } from "@common/infrastructure/logger";
|
||||
import { logger } from "core/common/infrastructure/logger";
|
||||
import * as glob from "glob";
|
||||
import * as path from "path";
|
||||
import { DataTypes } from "sequelize";
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { EmailAddress, PhoneNumber, PostalAddress, TINNumber, UniqueID } from "@common/domain";
|
||||
import { EmailAddress, PhoneNumber, PostalAddress, TINNumber, UniqueID } from "core/common/domain";
|
||||
|
||||
import { Maybe, Result } from "@common/helpers";
|
||||
import { ITransactionManager } from "@common/infrastructure/database";
|
||||
import { logger } from "@common/infrastructure/logger";
|
||||
import { Account, AccountStatus, IAccountProps, IAccountService } from "@contexts/accounts/domain";
|
||||
import { Maybe, Result } from "core/common/helpers";
|
||||
import { ITransactionManager } from "core/common/infrastructure/database";
|
||||
import { logger } from "core/common/infrastructure/logger";
|
||||
import { ICreateAccountRequestDTO } from "../presentation";
|
||||
|
||||
export class CreateAccountUseCase {
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { ITransactionManager } from "@common/infrastructure/database";
|
||||
import { logger } from "@common/infrastructure/logger";
|
||||
import { Account, IAccountService } from "@contexts/accounts/domain";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { ITransactionManager } from "core/common/infrastructure/database";
|
||||
import { logger } from "core/common/infrastructure/logger";
|
||||
|
||||
export class GetAccountUseCase {
|
||||
constructor(
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Collection, Result } from "@common/helpers";
|
||||
import { ITransactionManager } from "@common/infrastructure/database";
|
||||
import { logger } from "@common/infrastructure/logger";
|
||||
import { Account, IAccountService } from "@contexts/accounts/domain";
|
||||
import { Collection, Result } from "core/common/helpers";
|
||||
import { ITransactionManager } from "core/common/infrastructure/database";
|
||||
import { logger } from "core/common/infrastructure/logger";
|
||||
|
||||
export class ListAccountsUseCase {
|
||||
constructor(
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { TransactionManager } from "@common/infrastructure/database";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { TransactionManager } from "core/common/infrastructure/database";
|
||||
import { AccountService } from "../domain";
|
||||
import { UpdateAccountUseCase } from "./update-account.use-case";
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { EmailAddress, PhoneNumber, PostalAddress, TINNumber, UniqueID } from "@common/domain";
|
||||
import { EmailAddress, PhoneNumber, PostalAddress, TINNumber, UniqueID } from "core/common/domain";
|
||||
|
||||
import { Maybe, Result } from "@common/helpers";
|
||||
import { ITransactionManager } from "@common/infrastructure/database";
|
||||
import { logger } from "@common/infrastructure/logger";
|
||||
import { Account, IAccountProps, IAccountService } from "@contexts/accounts/domain";
|
||||
import { Maybe, Result } from "core/common/helpers";
|
||||
import { ITransactionManager } from "core/common/infrastructure/database";
|
||||
import { logger } from "core/common/infrastructure/logger";
|
||||
import { IUpdateAccountRequestDTO } from "../presentation";
|
||||
|
||||
export class UpdateAccountUseCase {
|
||||
|
||||
@ -5,8 +5,8 @@ import {
|
||||
PostalAddress,
|
||||
TINNumber,
|
||||
UniqueID,
|
||||
} from "@common/domain";
|
||||
import { Maybe, Result } from "@common/helpers";
|
||||
} from "core/common/domain";
|
||||
import { Maybe, Result } from "core/common/helpers";
|
||||
import { AccountStatus } from "../value-objects";
|
||||
|
||||
export interface IAccountProps {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { EmailAddress, UniqueID } from "@common/domain";
|
||||
import { Collection, Result } from "@common/helpers";
|
||||
import { EmailAddress, UniqueID } from "core/common/domain";
|
||||
import { Collection, Result } from "core/common/helpers";
|
||||
import { Account } from "../aggregates";
|
||||
|
||||
export interface IAccountRepository {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { EmailAddress, PhoneNumber, PostalAddress, TINNumber, UniqueID } from "@common/domain";
|
||||
import { Maybe, Result } from "@common/helpers";
|
||||
import { EmailAddress, PhoneNumber, PostalAddress, TINNumber, UniqueID } from "core/common/domain";
|
||||
import { Maybe, Result } from "core/common/helpers";
|
||||
import { Account, IAccountProps } from "../aggregates";
|
||||
import { IAccountRepository } from "../repositories";
|
||||
import { AccountStatus } from "../value-objects";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { Collection, Result } from "@common/helpers";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { Collection, Result } from "core/common/helpers";
|
||||
import { Account, IAccountProps } from "../aggregates";
|
||||
|
||||
export interface IAccountService {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { Account } from "../aggregates";
|
||||
import { IAccountRepository } from "../repositories";
|
||||
import { AccountService } from "./account.service";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { Collection, Result } from "@common/helpers";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { Collection, Result } from "core/common/helpers";
|
||||
import { Transaction } from "sequelize";
|
||||
import { Account, IAccountProps } from "../aggregates";
|
||||
import { IAccountRepository } from "../repositories";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ValueObject } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { ValueObject } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
|
||||
interface IAccountStatusProps {
|
||||
value: string;
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { EmailAddress, PhoneNumber, PostalAddress, TINNumber, UniqueID } from "@common/domain";
|
||||
import { Maybe, Result } from "@common/helpers";
|
||||
import { Account, AccountStatus } from "@contexts/accounts/domain/";
|
||||
import { EmailAddress, PhoneNumber, PostalAddress, TINNumber, UniqueID } from "core/common/domain";
|
||||
import { Maybe, Result } from "core/common/helpers";
|
||||
import {
|
||||
ISequelizeMapper,
|
||||
MapperParamsType,
|
||||
SequelizeMapper,
|
||||
} from "@common/infrastructure/sequelize/sequelize-mapper";
|
||||
import { Account, AccountStatus } from "@contexts/accounts/domain/";
|
||||
} from "core/common/infrastructure/sequelize/sequelize-mapper";
|
||||
import { AccountCreationAttributes, AccountModel } from "../sequelize/account.model";
|
||||
|
||||
export interface IAccountMapper
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { EmailAddress, UniqueID } from "@common/domain";
|
||||
import { Collection, Result } from "@common/helpers";
|
||||
import { SequelizeRepository } from "@common/infrastructure";
|
||||
import { Account } from "@contexts/accounts/domain";
|
||||
import { IAccountRepository } from "@contexts/accounts/domain/repositories/account-repository.interface";
|
||||
import { EmailAddress, UniqueID } from "core/common/domain";
|
||||
import { Collection, Result } from "core/common/helpers";
|
||||
import { SequelizeRepository } from "core/common/infrastructure";
|
||||
import { Transaction } from "sequelize";
|
||||
import { accountMapper, IAccountMapper } from "../mappers/account.mapper";
|
||||
import { AccountModel } from "./account.model";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { ExpressController } from "@common/presentation";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { ExpressController } from "core/common/presentation";
|
||||
import { CreateAccountUseCase } from "../../../application";
|
||||
import { ICreateAccountRequestDTO } from "../../dto";
|
||||
import { ICreateAccountPresenter } from "./create-account.presenter";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ensureBoolean, ensureNumber, ensureString } from "@common/helpers";
|
||||
import { Account } from "@contexts/accounts/domain";
|
||||
import { ensureBoolean, ensureNumber, ensureString } from "core/common/helpers";
|
||||
import { ICreateAccountResponseDTO } from "../../dto";
|
||||
|
||||
export interface ICreateAccountPresenter {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { SequelizeTransactionManager } from "@common/infrastructure";
|
||||
import { CreateAccountUseCase } from "@contexts/accounts/application/create-account.use-case";
|
||||
import { AccountService } from "@contexts/accounts/domain";
|
||||
import { accountRepository } from "@contexts/accounts/infraestructure";
|
||||
import { SequelizeTransactionManager } from "core/common/infrastructure";
|
||||
import { CreateAccountController } from "./create-account.controller";
|
||||
import { createAccountPresenter } from "./create-account.presenter";
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { ExpressController } from "@common/presentation";
|
||||
import { GetAccountUseCase } from "@contexts/accounts/application";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { ExpressController } from "core/common/presentation";
|
||||
import { IGetAccountPresenter } from "./get-account.presenter";
|
||||
|
||||
export class GetAccountController extends ExpressController {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ensureBoolean, ensureNumber, ensureString } from "@common/helpers";
|
||||
import { Account } from "@contexts/accounts/domain";
|
||||
import { ensureBoolean, ensureNumber, ensureString } from "core/common/helpers";
|
||||
import { IGetAccountResponseDTO } from "../../dto";
|
||||
|
||||
export interface IGetAccountPresenter {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { SequelizeTransactionManager } from "@common/infrastructure";
|
||||
import { GetAccountUseCase } from "@contexts/accounts/application";
|
||||
import { AccountService } from "@contexts/accounts/domain";
|
||||
import { accountRepository } from "@contexts/accounts/infraestructure";
|
||||
import { SequelizeTransactionManager } from "core/common/infrastructure";
|
||||
import { GetAccountController } from "./get-account.controller";
|
||||
import { getAccountPresenter } from "./get-account.presenter";
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { SequelizeTransactionManager } from "@common/infrastructure";
|
||||
import { ListAccountsUseCase } from "@contexts/accounts/application";
|
||||
import { AccountService } from "@contexts/accounts/domain";
|
||||
import { accountRepository } from "@contexts/accounts/infraestructure";
|
||||
import { SequelizeTransactionManager } from "core/common/infrastructure";
|
||||
import { ListAccountsController } from "./list-accounts.controller";
|
||||
import { listAccountsPresenter } from "./list-accounts.presenter";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ExpressController } from "@common/presentation";
|
||||
import { ListAccountsUseCase } from "@contexts/accounts/application";
|
||||
import { ExpressController } from "core/common/presentation";
|
||||
import { IListAccountsPresenter } from "./list-accounts.presenter";
|
||||
|
||||
export class ListAccountsController extends ExpressController {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Collection, ensureBoolean, ensureNumber, ensureString } from "@common/helpers";
|
||||
import { Account } from "@contexts/accounts/domain";
|
||||
import { Collection, ensureBoolean, ensureNumber, ensureString } from "core/common/helpers";
|
||||
import { IListAccountsResponseDTO } from "../../dto";
|
||||
|
||||
export interface IListAccountsPresenter {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { SequelizeTransactionManager } from "@common/infrastructure";
|
||||
import { UpdateAccountUseCase } from "@contexts/accounts/application";
|
||||
import { AccountService } from "@contexts/accounts/domain";
|
||||
import { accountRepository } from "@contexts/accounts/infraestructure";
|
||||
import { SequelizeTransactionManager } from "core/common/infrastructure";
|
||||
import { UpdateAccountController } from "./update-account.controller";
|
||||
import { updateAccountPresenter } from "./update-account.presenter";
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { ExpressController } from "@common/presentation";
|
||||
import { UpdateAccountUseCase } from "@contexts/accounts/application/update-account.use-case";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { ExpressController } from "core/common/presentation";
|
||||
import { IUpdateAccountRequestDTO } from "../../dto";
|
||||
import { IUpdateAccountPresenter } from "./update-account.presenter";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ensureBoolean, ensureNumber, ensureString } from "@common/helpers";
|
||||
import { Account } from "@contexts/accounts/domain";
|
||||
import { ensureBoolean, ensureNumber, ensureString } from "core/common/helpers";
|
||||
import { IUpdateAccountResponseDTO } from "../../dto";
|
||||
|
||||
export interface IUpdateAccountPresenter {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Collection, Result } from "@common/helpers";
|
||||
import { ITransactionManager } from "@common/infrastructure/database";
|
||||
import { User } from "@contexts/auth/domain";
|
||||
import { IUserService } from "@contexts/auth/domain/services";
|
||||
import { Collection, Result } from "core/common/helpers";
|
||||
import { ITransactionManager } from "core/common/infrastructure/database";
|
||||
|
||||
export class ListUsersUseCase {
|
||||
constructor(
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ITransactionManager } from "@common/infrastructure/database";
|
||||
import { LoginData } from "@contexts/auth/domain";
|
||||
import { IAuthService } from "@contexts/auth/domain/services";
|
||||
import { ITransactionManager } from "core/common/infrastructure/database";
|
||||
|
||||
export class LoginUseCase {
|
||||
constructor(
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ITransactionManager } from "@common/infrastructure/database";
|
||||
import { LogoutData } from "@contexts/auth/domain";
|
||||
import { IAuthService } from "@contexts/auth/domain/services";
|
||||
import { ITransactionManager } from "core/common/infrastructure/database";
|
||||
|
||||
export class LogoutUseCase {
|
||||
constructor(
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ITransactionManager } from "@common/infrastructure/database";
|
||||
import { Token } from "@contexts/auth/domain";
|
||||
import { IAuthService } from "@contexts/auth/domain/services";
|
||||
import { ITransactionManager } from "core/common/infrastructure/database";
|
||||
|
||||
export class RefreshTokenUseCase {
|
||||
constructor(
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { Result } from "@common/helpers";
|
||||
import { ITransactionManager } from "@common/infrastructure/database";
|
||||
import { logger } from "@common/infrastructure/logger";
|
||||
import { RegisterData } from "@contexts/auth/domain";
|
||||
import { IAuthService } from "@contexts/auth/domain/services";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { ITransactionManager } from "core/common/infrastructure/database";
|
||||
import { logger } from "core/common/infrastructure/logger";
|
||||
|
||||
export class RegisterUseCase {
|
||||
constructor(
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Result } from "@common/helpers";
|
||||
import { Result } from "core/common/helpers";
|
||||
|
||||
import { AggregateRoot, EmailAddress, UniqueID } from "@common/domain";
|
||||
import { AggregateRoot, EmailAddress, UniqueID } from "core/common/domain";
|
||||
import { UserAuthenticatedEvent } from "../events";
|
||||
import { HashPassword, PlainPassword, Username } from "../value-objects";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { AggregateRoot, UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { AggregateRoot, UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
|
||||
export interface IRoleProps {}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { AggregateRoot, EmailAddress, UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { AggregateRoot, EmailAddress, UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { UserAuthenticatedEvent } from "../events";
|
||||
import { Username } from "../value-objects";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { DomainEntity, EmailAddress, UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { DomainEntity, EmailAddress, UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
|
||||
export interface IJWTPayloadProps {
|
||||
tabId: UniqueID;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { DomainEntity, EmailAddress, UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { DomainEntity, EmailAddress, UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { PlainPassword } from "../value-objects";
|
||||
|
||||
export interface ILoginDataProps {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { DomainEntity, EmailAddress, UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { DomainEntity, EmailAddress, UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
|
||||
export interface ILogoutDataProps {
|
||||
email: EmailAddress;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { DomainEntity, EmailAddress } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { DomainEntity, EmailAddress } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { HashPassword, Username } from "../value-objects";
|
||||
|
||||
export interface IRegisterDataProps {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { DomainEntity, UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { DomainEntity, UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
|
||||
export interface ITabContextProps {
|
||||
tabId: UniqueID;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { IDomainEvent, UniqueID } from "@common/domain";
|
||||
import { IDomainEvent, UniqueID } from "core/common/domain";
|
||||
|
||||
export class UserAuthenticatedEvent implements IDomainEvent {
|
||||
public readonly eventName = "UserAuthenticated";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Result } from "@common/helpers";
|
||||
import { Result } from "core/common/helpers";
|
||||
|
||||
import { EmailAddress } from "@common/domain";
|
||||
import { EmailAddress } from "core/common/domain";
|
||||
import { AuthenticatedUser } from "../aggregates";
|
||||
import { Username } from "../value-objects";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { Transaction } from "sequelize";
|
||||
import { TabContext } from "../entities";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { EmailAddress, UniqueID } from "@common/domain";
|
||||
import { Collection, Result } from "@common/helpers";
|
||||
import { EmailAddress, UniqueID } from "core/common/domain";
|
||||
import { Collection, Result } from "core/common/helpers";
|
||||
import { User } from "../aggregates";
|
||||
|
||||
export interface IUserRepository {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { EmailAddress } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { EmailAddress } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import {
|
||||
AuthenticatedUser,
|
||||
IJWTPayload,
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { EmailAddress } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { EmailAddress } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { AuthenticatedUser, IJWTPayload, LoginData, RegisterData, TabContext, Token } from "..";
|
||||
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { IAuthenticatedUserRepository, JWTPayload } from "..";
|
||||
import { JwtHelper } from "../../infraestructure/passport/jwt.helper";
|
||||
import { ITabContextRepository } from "../repositories/tab-context-repository.interface";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { TabContext } from "../entities";
|
||||
|
||||
export interface ITabContextService {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { TabContext } from "../entities";
|
||||
import { ITabContextRepository } from "../repositories";
|
||||
import { ITabContextService } from "./tab-context-service.interface";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { Collection, Result } from "@common/helpers";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { Collection, Result } from "core/common/helpers";
|
||||
import { User } from "../aggregates";
|
||||
|
||||
export interface IUserService {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { Collection, Result } from "@common/helpers";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { Collection, Result } from "core/common/helpers";
|
||||
import { IUserRepository, User } from "..";
|
||||
import { IUserService } from "./user-service.interface";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ValueObject } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { ValueObject } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { z } from "zod";
|
||||
|
||||
const RoleSchema = z.enum(["Admin", "User", "Manager", "Editor"]);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ValueObject } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import bcrypt from "bcrypt";
|
||||
import { ValueObject } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { z } from "zod";
|
||||
|
||||
interface HashPasswordProps {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ValueObject } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { ValueObject } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { z } from "zod";
|
||||
|
||||
interface PlainPasswordProps {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ValueObject } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { ValueObject } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { z } from "zod";
|
||||
|
||||
interface TokenProps {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ValueObject } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { ValueObject } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { z } from "zod";
|
||||
|
||||
interface UsernameProps {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { EmailAddress, UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { ISequelizeMapper, MapperParamsType, SequelizeMapper } from "@common/infrastructure";
|
||||
import { AuthenticatedUser, HashPassword, Username } from "@contexts/auth/domain";
|
||||
import { EmailAddress, UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { ISequelizeMapper, MapperParamsType, SequelizeMapper } from "core/common/infrastructure";
|
||||
import { AuthUserCreationAttributes, AuthUserModel } from "../sequelize";
|
||||
|
||||
export interface IAuthenticatedUserMapper
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { ISequelizeMapper, MapperParamsType, SequelizeMapper } from "@common/infrastructure";
|
||||
import { TabContext } from "@contexts/auth/domain";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { ISequelizeMapper, MapperParamsType, SequelizeMapper } from "core/common/infrastructure";
|
||||
import { TabContextCreationAttributes, TabContextModel } from "../sequelize";
|
||||
|
||||
export interface ITabContextMapper
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { EmailAddress, UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { User, Username } from "@contexts/auth/domain";
|
||||
import { EmailAddress, UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import {
|
||||
ISequelizeMapper,
|
||||
MapperParamsType,
|
||||
SequelizeMapper,
|
||||
} from "@common/infrastructure/sequelize/sequelize-mapper";
|
||||
import { User, Username } from "@contexts/auth/domain";
|
||||
} from "core/common/infrastructure/sequelize/sequelize-mapper";
|
||||
import { UserCreationAttributes, UserModel } from "../sequelize";
|
||||
|
||||
export interface IUserMapper extends ISequelizeMapper<UserModel, UserCreationAttributes, User> {}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { ApiError, ExpressController } from "@common/presentation";
|
||||
import { AuthenticatedUser } from "@contexts/auth/domain";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { ApiError, ExpressController } from "core/common/presentation";
|
||||
//import { authProvider } from "@contexts/auth/infraestructure";
|
||||
import { NextFunction, Response } from "express";
|
||||
import { AuthenticatedRequest } from "../express/types";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { SequelizeTransactionManager } from "@common/infrastructure";
|
||||
import { AuthService, TabContextService } from "@contexts/auth/domain/services";
|
||||
import { SequelizeTransactionManager } from "core/common/infrastructure";
|
||||
import { authenticatedUserRepository, tabContextRepository } from "../sequelize";
|
||||
import { PassportAuthProvider } from "./passport-auth-provider";
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { NextFunction, Response } from "express";
|
||||
|
||||
import { EmailAddress, UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { ITransactionManager } from "@common/infrastructure/database";
|
||||
import { logger } from "@common/infrastructure/logger";
|
||||
import { TabContext } from "@contexts/auth/domain";
|
||||
import { IAuthService, ITabContextService } from "@contexts/auth/domain/services";
|
||||
import { EmailAddress, UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { ITransactionManager } from "core/common/infrastructure/database";
|
||||
import { logger } from "core/common/infrastructure/logger";
|
||||
import passport from "passport";
|
||||
import { ExtractJwt, Strategy as JwtStrategy } from "passport-jwt";
|
||||
import { TabContextRequest } from "../express/types";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { EmailAddress } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { SequelizeRepository } from "@common/infrastructure";
|
||||
import { AuthenticatedUser, IAuthenticatedUserRepository, Username } from "@contexts/auth/domain";
|
||||
import { EmailAddress } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { SequelizeRepository } from "core/common/infrastructure";
|
||||
import { Transaction } from "sequelize";
|
||||
import { authenticatedUserMapper, IAuthenticatedUserMapper } from "../mappers";
|
||||
import { AuthUserModel } from "./auth-user.model";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { UniqueID } from "@common/domain";
|
||||
import { Result } from "@common/helpers";
|
||||
import { SequelizeRepository } from "@common/infrastructure";
|
||||
import { ITabContextRepository, TabContext } from "@contexts/auth/domain/";
|
||||
import { UniqueID } from "core/common/domain";
|
||||
import { Result } from "core/common/helpers";
|
||||
import { SequelizeRepository } from "core/common/infrastructure";
|
||||
import { Op, Transaction } from "sequelize";
|
||||
import { ITabContextMapper, tabContextMapper } from "../mappers";
|
||||
import { TabContextModel } from "./tab-context.model";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { EmailAddress, UniqueID } from "@common/domain";
|
||||
import { Collection, Result } from "@common/helpers";
|
||||
import { SequelizeRepository } from "@common/infrastructure";
|
||||
import { IUserRepository, User } from "@contexts/auth/domain";
|
||||
import { EmailAddress, UniqueID } from "core/common/domain";
|
||||
import { Collection, Result } from "core/common/helpers";
|
||||
import { SequelizeRepository } from "core/common/infrastructure";
|
||||
import { Transaction } from "sequelize";
|
||||
import { IUserMapper, userMapper } from "../mappers";
|
||||
import { UserModel } from "./user.model";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { SequelizeTransactionManager } from "@common/infrastructure";
|
||||
import { ListUsersUseCase } from "@contexts/auth/application/list-users/list-users.use-case";
|
||||
import { UserService } from "@contexts/auth/domain/services/user.service";
|
||||
import { userRepository } from "@contexts/auth/infraestructure";
|
||||
import { SequelizeTransactionManager } from "core/common/infrastructure";
|
||||
import { ListUsersController } from "./list-users.controller";
|
||||
import { listUsersPresenter } from "./list-users.presenter";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ExpressController } from "@common/presentation";
|
||||
import { ListUsersUseCase } from "@contexts/auth/application";
|
||||
import { ExpressController } from "core/common/presentation";
|
||||
import { IListUsersPresenter } from "./list-users.presenter";
|
||||
|
||||
export class ListUsersController extends ExpressController {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Collection, ensureString } from "@common/helpers";
|
||||
import { User } from "@contexts/auth/domain";
|
||||
import { Collection, ensureString } from "core/common/helpers";
|
||||
import { IListUsersResponseDTO } from "../../dto";
|
||||
|
||||
export interface IListUsersPresenter {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { SequelizeTransactionManager } from "@common/infrastructure";
|
||||
import { LoginUseCase } from "@contexts/auth/application";
|
||||
import { AuthService } from "@contexts/auth/domain/services";
|
||||
import { authenticatedUserRepository, tabContextRepository } from "@contexts/auth/infraestructure";
|
||||
import { SequelizeTransactionManager } from "core/common/infrastructure";
|
||||
import { LoginController } from "./login.controller";
|
||||
import { loginPresenter } from "./login.presenter";
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ExpressController } from "@common/presentation";
|
||||
import { LoginUseCase } from "@contexts/auth/application";
|
||||
import { LoginData } from "@contexts/auth/domain";
|
||||
import { ExpressController } from "core/common/presentation";
|
||||
import { ILoginPresenter } from "./login.presenter";
|
||||
|
||||
export class LoginController extends ExpressController {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { SequelizeTransactionManager } from "@common/infrastructure";
|
||||
import { LogoutUseCase } from "@contexts/auth/application";
|
||||
import { AuthService } from "@contexts/auth/domain/services";
|
||||
import { authenticatedUserRepository, tabContextRepository } from "@contexts/auth/infraestructure";
|
||||
import { SequelizeTransactionManager } from "core/common/infrastructure";
|
||||
import { LogoutController } from "./logout.controller";
|
||||
|
||||
export const buildLogoutController = () => {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ExpressController } from "@common/presentation";
|
||||
import { LogoutUseCase } from "@contexts/auth/application/logout";
|
||||
import { AuthenticatedUser, LogoutData, TabContext } from "@contexts/auth/domain";
|
||||
import { TabContextRequest } from "@contexts/auth/infraestructure/express/types";
|
||||
import { ExpressController } from "core/common/presentation";
|
||||
|
||||
export class LogoutController extends ExpressController {
|
||||
public constructor(private readonly logout: LogoutUseCase) {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { SequelizeTransactionManager } from "@common/infrastructure";
|
||||
import { RefreshTokenUseCase } from "@contexts/auth/application";
|
||||
import { AuthService } from "@contexts/auth/domain/services";
|
||||
import { authenticatedUserRepository, tabContextRepository } from "@contexts/auth/infraestructure";
|
||||
import { SequelizeTransactionManager } from "core/common/infrastructure";
|
||||
import { RefreshTokenController } from "./refresh-token.controller";
|
||||
import { refreshTokenPresenter } from "./refresh-token.presenter";
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ExpressController } from "@common/presentation";
|
||||
import { RefreshTokenUseCase } from "@contexts/auth/application";
|
||||
import { Token } from "@contexts/auth/domain";
|
||||
import { ExpressController } from "core/common/presentation";
|
||||
import { IRefreshTokenPresenter } from "./refresh-token.presenter";
|
||||
|
||||
export class RefreshTokenController extends ExpressController {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { SequelizeTransactionManager } from "@common/infrastructure";
|
||||
import { RegisterUseCase } from "@contexts/auth/application/register";
|
||||
import { AuthService } from "@contexts/auth/domain/services";
|
||||
import { authenticatedUserRepository, tabContextRepository } from "@contexts/auth/infraestructure";
|
||||
import { SequelizeTransactionManager } from "core/common/infrastructure";
|
||||
import { RegisterController } from "./register.controller";
|
||||
import { registerPresenter } from "./register.presenter";
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ExpressController } from "@common/presentation";
|
||||
import { RegisterUseCase } from "@contexts/auth/application";
|
||||
import { RegisterData } from "@contexts/auth/domain";
|
||||
import { ExpressController } from "core/common/presentation";
|
||||
import { IRegisterPresenter } from "./register.presenter";
|
||||
|
||||
export class RegisterController extends ExpressController {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user