Compare commits
No commits in common. "72a50cc0b1064b3d8e59772fb3b90f12b008bde3" and "e0785a58e6037a32a5a0bcd4f3719ff4ffc53544" have entirely different histories.
72a50cc0b1
...
e0785a58e6
5
.eslintrc.js
Normal file
5
.eslintrc.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
/** @type {import("eslint").Linter.Config} */
|
||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ["@repo/eslint-config/index.js"],
|
||||||
|
};
|
||||||
3
apps/server/.eslintrc.js
Normal file
3
apps/server/.eslintrc.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module.exports = {
|
||||||
|
extends: ["@repo/eslint-config"],
|
||||||
|
};
|
||||||
@ -12,9 +12,9 @@ import {
|
|||||||
type IAccountProps,
|
type IAccountProps,
|
||||||
type IAccountService,
|
type IAccountService,
|
||||||
} from "@/contexts/accounts/domain";
|
} from "@/contexts/accounts/domain";
|
||||||
|
import { Maybe, Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { logger } from "@/core/logger";
|
import { logger } from "@/core/common/infrastructure/logger";
|
||||||
import { Maybe, Result } from "@repo/rdx-utils";
|
|
||||||
import { ICreateAccountRequestDTO } from "../presentation";
|
import { ICreateAccountRequestDTO } from "../presentation";
|
||||||
|
|
||||||
export class CreateAccountUseCase {
|
export class CreateAccountUseCase {
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { Account, IAccountService } from "@/contexts/accounts/domain";
|
import { Account, IAccountService } from "@/contexts/accounts/domain";
|
||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
|
import { Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { logger } from "@/core/logger";
|
import { logger } from "@/core/common/infrastructure/logger";
|
||||||
import { Result } from "@repo/rdx-utils";
|
|
||||||
|
|
||||||
export class GetAccountUseCase {
|
export class GetAccountUseCase {
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { Account, IAccountService } from "@/contexts/accounts/domain";
|
import { Account, IAccountService } from "@/contexts/accounts/domain";
|
||||||
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
|
||||||
|
|
||||||
export class ListAccountsUseCase {
|
export class ListAccountsUseCase {
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
|
import { Result } from "@/core/common/helpers";
|
||||||
import { TransactionManager } from "@/core/common/infrastructure/database";
|
import { TransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { Result } from "@repo/rdx-utils";
|
|
||||||
import { AccountService } from "../domain";
|
import { AccountService } from "../domain";
|
||||||
import { UpdateAccountUseCase } from "./update-account.use-case";
|
import { UpdateAccountUseCase } from "./update-account.use-case";
|
||||||
|
|
||||||
|
|||||||
@ -7,9 +7,9 @@ import {
|
|||||||
} from "@/core/common/domain";
|
} from "@/core/common/domain";
|
||||||
|
|
||||||
import { Account, IAccountProps, IAccountService } from "@/contexts/accounts/domain";
|
import { Account, IAccountProps, IAccountService } from "@/contexts/accounts/domain";
|
||||||
|
import { Maybe, Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { logger } from "@/core/logger";
|
import { logger } from "@/core/common/infrastructure/logger";
|
||||||
import { Maybe, Result } from "@repo/rdx-utils";
|
|
||||||
import { IUpdateAccountRequestDTO } from "../presentation";
|
import { IUpdateAccountRequestDTO } from "../presentation";
|
||||||
|
|
||||||
export class UpdateAccountUseCase {
|
export class UpdateAccountUseCase {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import {
|
|||||||
type TINNumber,
|
type TINNumber,
|
||||||
UniqueID,
|
UniqueID,
|
||||||
} from "@/core";
|
} from "@/core";
|
||||||
import { Maybe, Result } from "@repo/rdx-utils";
|
import { Maybe, Result } from "@/core/common/helpers";
|
||||||
import { AccountStatus } from "../value-objects";
|
import { AccountStatus } from "../value-objects";
|
||||||
|
|
||||||
export interface IAccountProps {
|
export interface IAccountProps {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { Account } from "../aggregates";
|
import { Account } from "../aggregates";
|
||||||
|
|
||||||
export interface IAccountRepository {
|
export interface IAccountRepository {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import {
|
|||||||
TINNumber,
|
TINNumber,
|
||||||
UniqueID,
|
UniqueID,
|
||||||
} from "@/core/common/domain";
|
} from "@/core/common/domain";
|
||||||
import { Maybe, Result } from "@repo/rdx-utils";
|
import { Maybe, Result } from "@/core/common/helpers";
|
||||||
import { Account, IAccountProps } from "../aggregates";
|
import { Account, IAccountProps } from "../aggregates";
|
||||||
import { IAccountRepository } from "../repositories";
|
import { IAccountRepository } from "../repositories";
|
||||||
import { AccountStatus } from "../value-objects";
|
import { AccountStatus } from "../value-objects";
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { Account, IAccountProps } from "../aggregates";
|
import { Account, IAccountProps } from "../aggregates";
|
||||||
|
|
||||||
export interface IAccountService {
|
export interface IAccountService {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { Transaction } from "sequelize";
|
import { Transaction } from "sequelize";
|
||||||
import { Account, IAccountProps } from "../aggregates";
|
import { Account, IAccountProps } from "../aggregates";
|
||||||
import { IAccountRepository } from "../repositories";
|
import { IAccountRepository } from "../repositories";
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ValueObject } from "@/core/common/domain";
|
import { ValueObject } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
|
|
||||||
interface IAccountStatusProps {
|
interface IAccountStatusProps {
|
||||||
value: string;
|
value: string;
|
||||||
|
|||||||
@ -6,12 +6,12 @@ import {
|
|||||||
TINNumber,
|
TINNumber,
|
||||||
UniqueID,
|
UniqueID,
|
||||||
} from "@/core/common/domain";
|
} from "@/core/common/domain";
|
||||||
|
import { Maybe, Result } from "@/core/common/helpers";
|
||||||
import {
|
import {
|
||||||
type ISequelizeMapper,
|
type ISequelizeMapper,
|
||||||
type MapperParamsType,
|
type MapperParamsType,
|
||||||
SequelizeMapper,
|
SequelizeMapper,
|
||||||
} from "@/core/common/infrastructure/sequelize/sequelize-mapper";
|
} from "@/core/common/infrastructure/sequelize/sequelize-mapper";
|
||||||
import { Maybe, Result } from "@repo/rdx-utils";
|
|
||||||
import { AccountCreationAttributes, AccountModel } from "../sequelize/account.model";
|
import { AccountCreationAttributes, AccountModel } from "../sequelize/account.model";
|
||||||
|
|
||||||
export interface IAccountMapper
|
export interface IAccountMapper
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { Account } from "@/contexts/accounts/domain";
|
import { Account } from "@/contexts/accounts/domain";
|
||||||
import { IAccountRepository } from "@/contexts/accounts/domain/repositories/account-repository.interface";
|
import { IAccountRepository } from "@/contexts/accounts/domain/repositories/account-repository.interface";
|
||||||
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
||||||
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { SequelizeRepository } from "@/core/common/infrastructure";
|
import { SequelizeRepository } from "@/core/common/infrastructure";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
|
||||||
import { Transaction } from "sequelize";
|
import { Transaction } from "sequelize";
|
||||||
import { IAccountMapper, accountMapper } from "../mappers/account.mapper";
|
import { IAccountMapper, accountMapper } from "../mappers/account.mapper";
|
||||||
import { AccountModel } from "./account.model";
|
import { AccountModel } from "./account.model";
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Account } from "@/contexts/accounts/domain";
|
import { Account } from "@/contexts/accounts/domain";
|
||||||
import { ensureBoolean, ensureNumber, ensureString } from "@repo/rdx-utils";
|
import { ensureBoolean, ensureNumber, ensureString } from "@/core/common/helpers";
|
||||||
import { ICreateAccountResponseDTO } from "../../dto";
|
import { ICreateAccountResponseDTO } from "../../dto";
|
||||||
|
|
||||||
export interface ICreateAccountPresenter {
|
export interface ICreateAccountPresenter {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Account } from "@/contexts/accounts/domain";
|
import { Account } from "@/contexts/accounts/domain";
|
||||||
import { ensureBoolean, ensureNumber, ensureString } from "@repo/rdx-utils";
|
import { ensureBoolean, ensureNumber, ensureString } from "@/core/common/helpers";
|
||||||
import { IGetAccountResponseDTO } from "../../dto";
|
import { IGetAccountResponseDTO } from "../../dto";
|
||||||
|
|
||||||
export interface IGetAccountPresenter {
|
export interface IGetAccountPresenter {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Account } from "@/contexts/accounts/domain";
|
import { Account } from "@/contexts/accounts/domain";
|
||||||
import { Collection, ensureBoolean, ensureNumber, ensureString } from "@repo/rdx-utils";
|
import { Collection, ensureBoolean, ensureNumber, ensureString } from "@/core/common/helpers";
|
||||||
import { IListAccountsResponseDTO } from "../../dto";
|
import { IListAccountsResponseDTO } from "../../dto";
|
||||||
|
|
||||||
export interface IListAccountsPresenter {
|
export interface IListAccountsPresenter {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Account } from "@/contexts/accounts/domain";
|
import { Account } from "@/contexts/accounts/domain";
|
||||||
import { ensureBoolean, ensureNumber, ensureString } from "@repo/rdx-utils";
|
import { ensureBoolean, ensureNumber, ensureString } from "@/core/common/helpers";
|
||||||
import { IUpdateAccountResponseDTO } from "../../dto";
|
import { IUpdateAccountResponseDTO } from "../../dto";
|
||||||
|
|
||||||
export interface IUpdateAccountPresenter {
|
export interface IUpdateAccountPresenter {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
|
||||||
import { User } from "../../domain";
|
import { User } from "../../domain";
|
||||||
import { IUserService } from "../../domain/services";
|
import { IUserService } from "../../domain/services";
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
|
import { Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { logger } from "@/core/logger";
|
import { logger } from "@/core/common/infrastructure/logger";
|
||||||
import { Result } from "@repo/rdx-utils";
|
|
||||||
import { RegisterData } from "../../domain";
|
import { RegisterData } from "../../domain";
|
||||||
import { IAuthService } from "../../domain/services";
|
import { IAuthService } from "../../domain/services";
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
|
|
||||||
import { AggregateRoot, EmailAddress, UniqueID } from "@/core/common/domain";
|
import { AggregateRoot, EmailAddress, UniqueID } from "@/core/common/domain";
|
||||||
import { UserAuthenticatedEvent } from "../events";
|
import { UserAuthenticatedEvent } from "../events";
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { AggregateRoot, UniqueID } from "@/core/common/domain";
|
import { AggregateRoot, UniqueID } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
|
|
||||||
export type IRoleProps = {};
|
export type IRoleProps = {};
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { AggregateRoot, EmailAddress, UniqueID } from "@/core/common/domain";
|
import { AggregateRoot, EmailAddress, UniqueID } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import { UserAuthenticatedEvent } from "../events";
|
import { UserAuthenticatedEvent } from "../events";
|
||||||
import { Username } from "../value-objects";
|
import { Username } from "../value-objects";
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { DomainEntity, EmailAddress, UniqueID } from "@/core/common/domain";
|
import { DomainEntity, EmailAddress, UniqueID } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
|
|
||||||
export interface IJWTPayloadProps {
|
export interface IJWTPayloadProps {
|
||||||
tabId: UniqueID;
|
tabId: UniqueID;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { DomainEntity, EmailAddress, UniqueID } from "@/core/common/domain";
|
import { DomainEntity, EmailAddress, UniqueID } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import { PlainPassword } from "../value-objects";
|
import { PlainPassword } from "../value-objects";
|
||||||
|
|
||||||
export interface ILoginDataProps {
|
export interface ILoginDataProps {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { DomainEntity, EmailAddress, UniqueID } from "@/core/common/domain";
|
import { DomainEntity, EmailAddress, UniqueID } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
|
|
||||||
export interface ILogoutDataProps {
|
export interface ILogoutDataProps {
|
||||||
email: EmailAddress;
|
email: EmailAddress;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { DomainEntity, EmailAddress } from "@/core/common/domain";
|
import { DomainEntity, EmailAddress } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import { HashPassword, Username } from "../value-objects";
|
import { HashPassword, Username } from "../value-objects";
|
||||||
|
|
||||||
export interface IRegisterDataProps {
|
export interface IRegisterDataProps {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { DomainEntity, UniqueID } from "@/core/common/domain";
|
import { DomainEntity, UniqueID } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
|
|
||||||
export interface ITabContextProps {
|
export interface ITabContextProps {
|
||||||
tabId: UniqueID;
|
tabId: UniqueID;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
|
|
||||||
import { EmailAddress } from "@/core/common/domain";
|
import { EmailAddress } from "@/core/common/domain";
|
||||||
import { AuthenticatedUser } from "../aggregates";
|
import { AuthenticatedUser } from "../aggregates";
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import { Transaction } from "sequelize";
|
import { Transaction } from "sequelize";
|
||||||
import { TabContext } from "../entities";
|
import { TabContext } from "../entities";
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { User } from "../aggregates";
|
import { User } from "../aggregates";
|
||||||
|
|
||||||
export interface IUserRepository {
|
export interface IUserRepository {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { EmailAddress } from "@/core/common/domain";
|
import { EmailAddress } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import {
|
import {
|
||||||
AuthenticatedUser,
|
AuthenticatedUser,
|
||||||
IJWTPayload,
|
IJWTPayload,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { EmailAddress } from "@/core/common/domain";
|
import { EmailAddress } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import {
|
import {
|
||||||
AuthenticatedUser,
|
AuthenticatedUser,
|
||||||
type IJWTPayload,
|
type IJWTPayload,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import { TabContext } from "../entities";
|
import { TabContext } from "../entities";
|
||||||
|
|
||||||
export interface ITabContextService {
|
export interface ITabContextService {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import { TabContext } from "../entities";
|
import { TabContext } from "../entities";
|
||||||
import { ITabContextRepository } from "../repositories";
|
import { ITabContextRepository } from "../repositories";
|
||||||
import { ITabContextService } from "./tab-context-service.interface";
|
import { ITabContextService } from "./tab-context-service.interface";
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { User } from "../aggregates";
|
import { User } from "../aggregates";
|
||||||
|
|
||||||
export interface IUserService {
|
export interface IUserService {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { IUserRepository, User } from "..";
|
import { IUserRepository, User } from "..";
|
||||||
import { IUserService } from "./user-service.interface";
|
import { IUserService } from "./user-service.interface";
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ValueObject } from "@/core/common/domain";
|
import { ValueObject } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
const RoleSchema = z.enum(["Admin", "User", "Manager", "Editor"]);
|
const RoleSchema = z.enum(["Admin", "User", "Manager", "Editor"]);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { ValueObject } from "@/core/common/domain";
|
|
||||||
import { Result } from "@repo/rdx-utils";
|
|
||||||
import bcrypt from "bcrypt";
|
import bcrypt from "bcrypt";
|
||||||
|
import { ValueObject } from "@/core/common/domain";
|
||||||
|
import { Result } from "@/core/common/helpers";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
interface HashPasswordProps {
|
interface HashPasswordProps {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ValueObject } from "@/core/common/domain";
|
import { ValueObject } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
interface PlainPasswordProps {
|
interface PlainPasswordProps {
|
||||||
@ -32,5 +32,6 @@ export class PlainPassword extends ValueObject<PlainPasswordProps> {
|
|||||||
|
|
||||||
toPrimitive() {
|
toPrimitive() {
|
||||||
return this.props.value;
|
return this.props.value;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ValueObject } from "@/core/common/domain";
|
import { ValueObject } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
interface TokenProps {
|
interface TokenProps {
|
||||||
@ -32,5 +32,6 @@ export class Token extends ValueObject<TokenProps> {
|
|||||||
|
|
||||||
toPrimitive() {
|
toPrimitive() {
|
||||||
return this.props.value;
|
return this.props.value;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ValueObject } from "@/core/common/domain";
|
import { ValueObject } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
interface UsernameProps {
|
interface UsernameProps {
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
|
import { Result } from "@/core/common/helpers";
|
||||||
import {
|
import {
|
||||||
type ISequelizeMapper,
|
type ISequelizeMapper,
|
||||||
type MapperParamsType,
|
type MapperParamsType,
|
||||||
SequelizeMapper,
|
SequelizeMapper,
|
||||||
} from "@/core/common/infrastructure";
|
} from "@/core/common/infrastructure";
|
||||||
import { Result } from "@repo/rdx-utils";
|
|
||||||
import { TabContext } from "../../domain";
|
import { TabContext } from "../../domain";
|
||||||
import { TabContextCreationAttributes, TabContextModel } from "../sequelize";
|
import { TabContextCreationAttributes, TabContextModel } from "../sequelize";
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
||||||
|
import { Result } from "@/core/common/helpers";
|
||||||
import {
|
import {
|
||||||
type ISequelizeMapper,
|
type ISequelizeMapper,
|
||||||
type MapperParamsType,
|
type MapperParamsType,
|
||||||
SequelizeMapper,
|
SequelizeMapper,
|
||||||
} from "@/core/common/infrastructure/sequelize/sequelize-mapper";
|
} from "@/core/common/infrastructure/sequelize/sequelize-mapper";
|
||||||
import { Result } from "@repo/rdx-utils";
|
|
||||||
import { User, Username } from "../../domain";
|
import { User, Username } from "../../domain";
|
||||||
import { UserCreationAttributes, UserModel } from "../sequelize";
|
import { UserCreationAttributes, UserModel } from "../sequelize";
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import { NextFunction, Response } from "express";
|
import { NextFunction, Response } from "express";
|
||||||
|
|
||||||
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
||||||
|
import { Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { logger } from "@/core/logger";
|
import { logger } from "@/core/common/infrastructure/logger";
|
||||||
import { Result } from "@repo/rdx-utils";
|
|
||||||
import passport from "passport";
|
import passport from "passport";
|
||||||
import { ExtractJwt, Strategy as JwtStrategy } from "passport-jwt";
|
import { ExtractJwt, Strategy as JwtStrategy } from "passport-jwt";
|
||||||
import { TabContext } from "../../domain";
|
import { TabContext } from "../../domain";
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { EmailAddress } from "@/core/common/domain";
|
import { EmailAddress } from "@/core/common/domain";
|
||||||
|
import { Result } from "@/core/common/helpers";
|
||||||
import { SequelizeRepository } from "@/core/common/infrastructure";
|
import { SequelizeRepository } from "@/core/common/infrastructure";
|
||||||
import { Result } from "@repo/rdx-utils";
|
|
||||||
import { Sequelize, Transaction } from "sequelize";
|
import { Sequelize, Transaction } from "sequelize";
|
||||||
import { AuthenticatedUser, IAuthenticatedUserRepository, Username } from "../../domain";
|
import { AuthenticatedUser, IAuthenticatedUserRepository, Username } from "../../domain";
|
||||||
import { IAuthenticatedUserMapper } from "../mappers";
|
import { IAuthenticatedUserMapper } from "../mappers";
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
|
import { Result } from "@/core/common/helpers";
|
||||||
import { SequelizeRepository } from "@/core/common/infrastructure";
|
import { SequelizeRepository } from "@/core/common/infrastructure";
|
||||||
import { Result } from "@repo/rdx-utils";
|
|
||||||
import { Op, Sequelize, Transaction } from "sequelize";
|
import { Op, Sequelize, Transaction } from "sequelize";
|
||||||
import { ITabContextRepository, TabContext } from "../../domain/";
|
import { ITabContextRepository, TabContext } from "../../domain/";
|
||||||
import { ITabContextMapper } from "../mappers";
|
import { ITabContextMapper } from "../mappers";
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
||||||
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { SequelizeRepository } from "@/core/common/infrastructure";
|
import { SequelizeRepository } from "@/core/common/infrastructure";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
|
||||||
import { Sequelize, Transaction } from "sequelize";
|
import { Sequelize, Transaction } from "sequelize";
|
||||||
import { IUserRepository, User } from "../../domain";
|
import { IUserRepository, User } from "../../domain";
|
||||||
import { IUserMapper } from "../mappers";
|
import { IUserMapper } from "../mappers";
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Collection, ensureString } from "@repo/rdx-utils";
|
import { Collection, ensureString } from "@/core/common/helpers";
|
||||||
import { User } from "../../domain";
|
import { User } from "../../domain";
|
||||||
import { IListUsersResponseDTO } from "../../dto";
|
import { IListUsersResponseDTO } from "../../dto";
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
|
||||||
import { Contact, IContactService } from "../domain";
|
import { Contact, IContactService } from "../domain";
|
||||||
|
|
||||||
export class ListContactsUseCase {
|
export class ListContactsUseCase {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import {
|
|||||||
type TINNumber,
|
type TINNumber,
|
||||||
UniqueID,
|
UniqueID,
|
||||||
} from "@/core/common/domain";
|
} from "@/core/common/domain";
|
||||||
import { Maybe, Result } from "@repo/rdx-utils";
|
import { Maybe, Result } from "@/core/common/helpers";
|
||||||
|
|
||||||
export interface IContactProps {
|
export interface IContactProps {
|
||||||
reference: string;
|
reference: string;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { Contact } from "../aggregates";
|
import { Contact } from "../aggregates";
|
||||||
|
|
||||||
export interface IContactRepository {
|
export interface IContactRepository {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { Contact } from "../aggregates";
|
import { Contact } from "../aggregates";
|
||||||
|
|
||||||
export interface IContactService {
|
export interface IContactService {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { Contact } from "../aggregates";
|
import { Contact } from "../aggregates";
|
||||||
import { IContactRepository } from "../repositories";
|
import { IContactRepository } from "../repositories";
|
||||||
import { IContactService } from "./contact-service.interface";
|
import { IContactService } from "./contact-service.interface";
|
||||||
|
|||||||
@ -5,12 +5,12 @@ import {
|
|||||||
TINNumber,
|
TINNumber,
|
||||||
UniqueID,
|
UniqueID,
|
||||||
} from "@/core/common/domain";
|
} from "@/core/common/domain";
|
||||||
|
import { Maybe, Result } from "@/core/common/helpers";
|
||||||
import {
|
import {
|
||||||
type ISequelizeMapper,
|
type ISequelizeMapper,
|
||||||
type MapperParamsType,
|
type MapperParamsType,
|
||||||
SequelizeMapper,
|
SequelizeMapper,
|
||||||
} from "@/core/common/infrastructure/sequelize/sequelize-mapper";
|
} from "@/core/common/infrastructure/sequelize/sequelize-mapper";
|
||||||
import { Maybe, Result } from "@repo/rdx-utils";
|
|
||||||
import { Contact } from "../../domain";
|
import { Contact } from "../../domain";
|
||||||
import { ContactCreationAttributes, ContactModel } from "../sequelize/contact.model";
|
import { ContactCreationAttributes, ContactModel } from "../sequelize/contact.model";
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
import { EmailAddress, UniqueID } from "@/core/common/domain";
|
||||||
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { SequelizeRepository } from "@/core/common/infrastructure";
|
import { SequelizeRepository } from "@/core/common/infrastructure";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
|
||||||
import { Transaction } from "sequelize";
|
import { Transaction } from "sequelize";
|
||||||
import { Contact, IContactRepository } from "../../domain";
|
import { Contact, IContactRepository } from "../../domain";
|
||||||
import { IContactMapper, contactMapper } from "../mappers";
|
import { IContactMapper, contactMapper } from "../mappers";
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Collection, ensureBoolean, ensureNumber, ensureString } from "@repo/rdx-utils";
|
import { Collection, ensureBoolean, ensureNumber, ensureString } from "@/core/common/helpers";
|
||||||
import { Contact } from "../../../domain";
|
import { Contact } from "../../../domain";
|
||||||
import { IListContactsResponseDTO } from "../../dto";
|
import { IListContactsResponseDTO } from "../../dto";
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import { ICustomerInvoiceService } from "@/contexts/customer-billing/domain";
|
import { ICustomerInvoiceService } from "@/contexts/customer-billing/domain";
|
||||||
import { CustomerInvoice } from "@/contexts/customer-billing/domain/aggregates";
|
import { CustomerInvoice } from "@/contexts/customer-billing/domain/aggregates";
|
||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
|
import { Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { Result } from "@repo/rdx-utils";
|
|
||||||
|
|
||||||
export class GetCustomerInvoiceUseCase {
|
export class GetCustomerInvoiceUseCase {
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
|
||||||
import { CustomerInvoice, ICustomerInvoiceService } from "../domain";
|
import { CustomerInvoice, ICustomerInvoiceService } from "../domain";
|
||||||
|
|
||||||
export class ListCustomerInvoicesUseCase {
|
export class ListCustomerInvoicesUseCase {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { AggregateRoot, UniqueID, UtcDate } from "@/core/common/domain";
|
import { AggregateRoot, UniqueID, UtcDate } from "@/core/common/domain";
|
||||||
import { Maybe, Result } from "@repo/rdx-utils";
|
import { Maybe, Result } from "@/core/common/helpers";
|
||||||
import { Customer, CustomerInvoiceItem } from "../entities";
|
import { Customer, CustomerInvoiceItem } from "../entities";
|
||||||
import { InvoiceStatus } from "../value-objetcs";
|
import { InvoiceStatus } from "../value-objetcs";
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { DomainEntity, MoneyValue, Percentage, UniqueID } from "@/core/common/domain";
|
import { DomainEntity, MoneyValue, Percentage, UniqueID } from "@/core/common/domain";
|
||||||
import { Quantity } from "@/core/common/domain/value-objects/quantity";
|
import { Quantity } from "@/core/common/domain/value-objects/quantity";
|
||||||
import { Maybe, Result } from "@repo/rdx-utils";
|
import { Maybe, Result } from "@/core/common/helpers";
|
||||||
|
|
||||||
export interface ICustomerInvoiceItemProps {
|
export interface ICustomerInvoiceItemProps {
|
||||||
description: Maybe<string>; // Descripción del artículo o servicio
|
description: Maybe<string>; // Descripción del artículo o servicio
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { AggregateRoot, PostalAddress, TINNumber, UniqueID } from "@/core/common/domain";
|
import { AggregateRoot, PostalAddress, TINNumber, UniqueID } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
|
|
||||||
export interface ICustomerProps {
|
export interface ICustomerProps {
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Slug } from "@/core/common/domain";
|
import { Slug } from "@/core/common/domain";
|
||||||
import { Collection } from "@repo/rdx-utils";
|
import { Collection } from "@/core/common/helpers";
|
||||||
import { Tax } from "./tax";
|
import { Tax } from "./tax";
|
||||||
|
|
||||||
export class TaxCollection extends Collection<Tax> {
|
export class TaxCollection extends Collection<Tax> {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { DomainEntity, Percentage, Slug, UniqueID } from "@/core/common/domain";
|
import { DomainEntity, Percentage, Slug, UniqueID } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
|
|
||||||
interface ITaxProps {
|
interface ITaxProps {
|
||||||
slug: Slug;
|
slug: Slug;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { CustomerInvoice } from "../aggregates";
|
import { CustomerInvoice } from "../aggregates";
|
||||||
|
|
||||||
export interface ICustomerInvoiceRepository {
|
export interface ICustomerInvoiceRepository {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { CustomerInvoice } from "../aggregates";
|
import { CustomerInvoice } from "../aggregates";
|
||||||
|
|
||||||
export interface ICustomerInvoiceService {
|
export interface ICustomerInvoiceService {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { CustomerInvoice } from "../aggregates";
|
import { CustomerInvoice } from "../aggregates";
|
||||||
import { ICustomerInvoiceRepository } from "../repositories";
|
import { ICustomerInvoiceRepository } from "../repositories";
|
||||||
import { ICustomerInvoiceService } from "./customer-invoice-service.interface";
|
import { ICustomerInvoiceService } from "./customer-invoice-service.interface";
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ValueObject } from "@/core/common/domain";
|
import { ValueObject } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
|
|
||||||
interface IInvoiceStatusProps {
|
interface IInvoiceStatusProps {
|
||||||
value: string;
|
value: string;
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
import { Customer, CustomerInvoice } from "@/contexts/customer-billing/domain";
|
import { Customer, CustomerInvoice } from "@/contexts/customer-billing/domain";
|
||||||
import { InvoiceStatus } from "@/contexts/customer-billing/domain/value-objetcs";
|
import { InvoiceStatus } from "@/contexts/customer-billing/domain/value-objetcs";
|
||||||
import { PostalAddress, TINNumber, UniqueID, UtcDate } from "@/core/common/domain";
|
import { PostalAddress, TINNumber, UniqueID, UtcDate } from "@/core/common/domain";
|
||||||
|
import { Maybe, Result } from "@/core/common/helpers";
|
||||||
import {
|
import {
|
||||||
type ISequelizeMapper,
|
type ISequelizeMapper,
|
||||||
type MapperParamsType,
|
type MapperParamsType,
|
||||||
SequelizeMapper,
|
SequelizeMapper,
|
||||||
} from "@/core/common/infrastructure/sequelize/sequelize-mapper";
|
} from "@/core/common/infrastructure/sequelize/sequelize-mapper";
|
||||||
import { Maybe, Result } from "@repo/rdx-utils";
|
|
||||||
import {
|
import {
|
||||||
CustomerInvoiceCreationAttributes,
|
CustomerInvoiceCreationAttributes,
|
||||||
CustomerInvoiceModel,
|
CustomerInvoiceModel,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { CustomerInvoice, ICustomerInvoiceRepository } from "@/contexts/customer-billing/domain";
|
import { CustomerInvoice, ICustomerInvoiceRepository } from "@/contexts/customer-billing/domain";
|
||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { SequelizeRepository } from "@/core/common/infrastructure";
|
import { SequelizeRepository } from "@/core/common/infrastructure";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
|
||||||
import { Transaction } from "sequelize";
|
import { Transaction } from "sequelize";
|
||||||
import {
|
import {
|
||||||
type ICustomerInvoiceMapper,
|
type ICustomerInvoiceMapper,
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Collection, ensureString } from "@repo/rdx-utils";
|
import { Collection, ensureString } from "@/core/common/helpers";
|
||||||
|
|
||||||
import { CustomerInvoice } from "@/contexts/customer-billing/domain";
|
import { CustomerInvoice } from "@/contexts/customer-billing/domain";
|
||||||
import { IListCustomerInvoicesResponseDTO } from "../../../dto";
|
import { IListCustomerInvoicesResponseDTO } from "../../../dto";
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
"build": "tsc && tsup",
|
"build": "tsc && tsup",
|
||||||
"start:dev": "node --import=tsx --watch src/index.ts",
|
"start:dev": "node --import=tsx --watch src/index.ts",
|
||||||
"start:prod": "node dist/index.js",
|
"start:prod": "node dist/index.js",
|
||||||
"clean": "rm -rf dist node_modules",
|
"clean": "rm -rf dist",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"test": "jest --config=./jest.config.ts --verbose",
|
"test": "jest --config=./jest.config.ts --verbose",
|
||||||
"lint": "biome lint --fix",
|
"lint": "biome lint --fix",
|
||||||
@ -27,7 +27,7 @@
|
|||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^29.5.14",
|
||||||
"@types/jsonwebtoken": "^9.0.8",
|
"@types/jsonwebtoken": "^9.0.8",
|
||||||
"@types/luxon": "^3.4.2",
|
"@types/luxon": "^3.4.2",
|
||||||
"@types/node": "^22.15.12",
|
"@types/node": "^22.10.7",
|
||||||
"@types/passport": "^1.0.16",
|
"@types/passport": "^1.0.16",
|
||||||
"@types/passport-jwt": "^4.0.1",
|
"@types/passport-jwt": "^4.0.1",
|
||||||
"@types/passport-local": "^1.0.38",
|
"@types/passport-local": "^1.0.38",
|
||||||
@ -40,14 +40,14 @@
|
|||||||
"typescript": "^5.8.3"
|
"typescript": "^5.8.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@erp/auth": "workspace:*",
|
|
||||||
"@erp/core": "workspace:*",
|
|
||||||
"bcrypt": "^5.1.1",
|
"bcrypt": "^5.1.1",
|
||||||
"cls-rtracer": "^2.6.3",
|
"cls-rtracer": "^2.6.3",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"dinero.js": "^1.9.1",
|
"dinero.js": "^1.9.1",
|
||||||
"dotenv": "^16.5.0",
|
"dotenv": "^16.5.0",
|
||||||
|
"esbuild": "^0.24.0",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
|
"glob": "^11.0.1",
|
||||||
"helmet": "^8.0.0",
|
"helmet": "^8.0.0",
|
||||||
"http": "0.0.1-security",
|
"http": "0.0.1-security",
|
||||||
"http-status": "^2.1.0",
|
"http-status": "^2.1.0",
|
||||||
@ -74,9 +74,14 @@
|
|||||||
"node": ">=22"
|
"node": ">=22"
|
||||||
},
|
},
|
||||||
"tsup": {
|
"tsup": {
|
||||||
"entry": ["src/index.ts"],
|
"entry": [
|
||||||
|
"src/index.ts"
|
||||||
|
],
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"format": ["esm", "cjs"],
|
"format": [
|
||||||
|
"esm",
|
||||||
|
"cjs"
|
||||||
|
],
|
||||||
"target": "es2020",
|
"target": "es2020",
|
||||||
"sourcemap": true,
|
"sourcemap": true,
|
||||||
"clean": true,
|
"clean": true,
|
||||||
|
|||||||
@ -3,8 +3,9 @@ import dotenv from "dotenv";
|
|||||||
import express, { Application } from "express";
|
import express, { Application } from "express";
|
||||||
import helmet from "helmet";
|
import helmet from "helmet";
|
||||||
import responseTime from "response-time";
|
import responseTime from "response-time";
|
||||||
|
import { logger } from "./core/common/infrastructure/logger";
|
||||||
import { globalErrorHandler } from "./core/common/presentation";
|
import { globalErrorHandler } from "./core/common/presentation";
|
||||||
import { logger } from "./core/logger";
|
import { v1Routes } from "./routes";
|
||||||
|
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
@ -46,8 +47,8 @@ export function createApp(): Application {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Registrar rutas de la API
|
// Registrar rutas de la API
|
||||||
// app.use("/api/v1", v1Routes());
|
app.use("/api/v1", v1Routes());
|
||||||
//initModules(app, database);
|
// initPackages(app, sequelize);
|
||||||
|
|
||||||
// Gestión global de errores.
|
// Gestión global de errores.
|
||||||
// Siempre al final de la cadena de middlewares
|
// Siempre al final de la cadena de middlewares
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { logger } from "@/core/logger";
|
import { logger } from "@/core/common/infrastructure/logger";
|
||||||
import dotenv from "dotenv";
|
import dotenv from "dotenv";
|
||||||
import { Sequelize } from "sequelize";
|
import { Sequelize } from "sequelize";
|
||||||
import { registerModels } from "./register-models";
|
import { registerModels } from "./register-models";
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import { logger } from "@/core/logger";
|
import { logger } from "@/core/common/infrastructure/logger";
|
||||||
import * as glob from "glob";
|
import * as glob from "glob";
|
||||||
import { DataTypes, Sequelize } from "sequelize";
|
import { DataTypes, Sequelize } from "sequelize";
|
||||||
|
|
||||||
|
|||||||
@ -8,9 +8,9 @@ import {
|
|||||||
InvoiceSerie,
|
InvoiceSerie,
|
||||||
InvoiceStatus,
|
InvoiceStatus,
|
||||||
} from "@/contexts/invoices/domain";
|
} from "@/contexts/invoices/domain";
|
||||||
|
import { Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { logger } from "@/core/logger";
|
import { logger } from "@/core/common/infrastructure/logger";
|
||||||
import { Result } from "@repo/rdx-utils";
|
|
||||||
import { ICreateInvoiceRequestDTO } from "../presentation/dto";
|
import { ICreateInvoiceRequestDTO } from "../presentation/dto";
|
||||||
|
|
||||||
export class CreateInvoiceUseCase {
|
export class CreateInvoiceUseCase {
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
|
import { Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { logger } from "@/core/logger";
|
import { logger } from "@/core/common/infrastructure/logger";
|
||||||
import { Result } from "@repo/rdx-utils";
|
|
||||||
import { IInvoiceService } from "../domain";
|
import { IInvoiceService } from "../domain";
|
||||||
|
|
||||||
export class DeleteInvoiceUseCase {
|
export class DeleteInvoiceUseCase {
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
|
import { Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { logger } from "@/core/logger";
|
import { logger } from "@/core/common/infrastructure/logger";
|
||||||
import { Result } from "@repo/rdx-utils";
|
|
||||||
import { IInvoiceService, Invoice } from "../domain";
|
import { IInvoiceService, Invoice } from "../domain";
|
||||||
|
|
||||||
export class GetInvoiceUseCase {
|
export class GetInvoiceUseCase {
|
||||||
@ -1,6 +1,6 @@
|
|||||||
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { logger } from "@/core/logger";
|
import { logger } from "@/core/common/infrastructure/logger";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
|
||||||
import { IInvoiceService, Invoice } from "../domain";
|
import { IInvoiceService, Invoice } from "../domain";
|
||||||
|
|
||||||
export class ListInvoicesUseCase {
|
export class ListInvoicesUseCase {
|
||||||
@ -1,6 +1,6 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
|
import { Result } from "@/core/common/helpers";
|
||||||
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
import { ITransactionManager } from "@/core/common/infrastructure/database";
|
||||||
import { Result } from "@repo/rdx-utils";
|
|
||||||
import { IInvoiceService, Invoice } from "../domain";
|
import { IInvoiceService, Invoice } from "../domain";
|
||||||
import { IUpdateInvoiceRequestDTO } from "../presentation/dto";
|
import { IUpdateInvoiceRequestDTO } from "../presentation/dto";
|
||||||
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { AggregateRoot, MoneyValue, UniqueID, UtcDate } from "@/core/common/domain";
|
import { AggregateRoot, MoneyValue, UniqueID, UtcDate } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { InvoiceCustomer, InvoiceItem, InvoiceItems } from "../entities";
|
import { InvoiceCustomer, InvoiceItem, InvoiceItems } from "../entities";
|
||||||
import { InvoiceNumber, InvoiceSerie, InvoiceStatus } from "../value-objects";
|
import { InvoiceNumber, InvoiceSerie, InvoiceStatus } from "../value-objects";
|
||||||
|
|
||||||
@ -4,7 +4,7 @@ import {
|
|||||||
type PostalAddress,
|
type PostalAddress,
|
||||||
ValueObject,
|
ValueObject,
|
||||||
} from "@/core/common/domain";
|
} from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import { PhoneNumber } from "libphonenumber-js";
|
import { PhoneNumber } from "libphonenumber-js";
|
||||||
import { InvoiceAddressType } from "../../value-objects";
|
import { InvoiceAddressType } from "../../value-objects";
|
||||||
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { DomainEntity, Name, TINNumber, UniqueID } from "@/core/common/domain";
|
import { DomainEntity, Name, TINNumber, UniqueID } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import { InvoiceAddress } from "./invoice-address";
|
import { InvoiceAddress } from "./invoice-address";
|
||||||
|
|
||||||
export interface IInvoiceCustomerProps {
|
export interface IInvoiceCustomerProps {
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { DomainEntity, MoneyValue, Percentage, Quantity, UniqueID } from "@/core/common/domain";
|
import { DomainEntity, MoneyValue, Percentage, Quantity, UniqueID } from "@/core/common/domain";
|
||||||
import { Result } from "@repo/rdx-utils";
|
import { Result } from "@/core/common/helpers";
|
||||||
import { InvoiceItemDescription } from "../../value-objects";
|
import { InvoiceItemDescription } from "../../value-objects";
|
||||||
|
|
||||||
export interface IInvoiceItemProps {
|
export interface IInvoiceItemProps {
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { Collection } from "@repo/rdx-utils";
|
import { Collection } from "@/core/common/helpers";
|
||||||
import { InvoiceItem } from "./invoice-item";
|
import { InvoiceItem } from "./invoice-item";
|
||||||
|
|
||||||
export class InvoiceItems extends Collection<InvoiceItem> {
|
export class InvoiceItems extends Collection<InvoiceItem> {
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { Invoice } from "../aggregates";
|
import { Invoice } from "../aggregates";
|
||||||
|
|
||||||
export interface IInvoiceRepository {
|
export interface IInvoiceRepository {
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { UniqueID } from "@/core/common/domain";
|
import { UniqueID } from "@/core/common/domain";
|
||||||
import { Collection, Result } from "@repo/rdx-utils";
|
import { Collection, Result } from "@/core/common/helpers";
|
||||||
import { IInvoiceProps, Invoice } from "../aggregates";
|
import { IInvoiceProps, Invoice } from "../aggregates";
|
||||||
|
|
||||||
export interface IInvoiceService {
|
export interface IInvoiceService {
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user