From 84661b06dda3f3853f9ec4071a08beaad9be00ea Mon Sep 17 00:00:00 2001 From: david Date: Sun, 4 May 2025 22:06:57 +0200 Subject: [PATCH] . --- .prettierrc | 13 - .vscode/extensions.json | 3 + .vscode/launch.json | 17 + .vscode/settings.json | 15 +- .../application/create-account.use-case.ts | 7 +- .../application/get-account.use-case.ts | 0 .../contexts/accounts/application/index.ts | 0 .../application/list-accounts.use-case.ts | 1 - .../update-account.use-case.test.ts | 0 .../application/update-account.use-case.ts | 0 .../accounts/domain/aggregates/account.ts | 9 +- .../accounts/domain/aggregates/index.ts | 0 .../contexts/accounts/domain/index.ts | 0 .../account-repository.interface.ts | 0 .../accounts/domain/repositories/index.ts | 0 .../account-service.integration.test.ts | 0 .../services/account-service.interface.ts | 0 .../domain/services/account-service.test.ts | 0 .../domain/services/account.service.ts | 0 .../accounts/domain/services/index.ts | 0 .../value-objects/account-status.test.ts | 0 .../domain/value-objects/account-status.ts | 0 .../accounts/domain/value-objects/index.ts | 0 .../accounts/infraestructure/index.ts | 0 .../infraestructure/mappers/account.mapper.ts | 4 +- .../accounts/infraestructure/mappers/index.ts | 0 .../sequelize/account.model.ts | 0 .../sequelize/account.repository.ts | 2 +- .../infraestructure/sequelize/index.ts | 0 .../create-account.controller.ts | 0 .../create-account.presenter.ts | 0 .../controllers/create-account/index.ts | 0 .../get-account/get-account.controller.ts | 0 .../get-account/get-account.presenter.ts | 0 .../controllers/get-account/index.ts | 0 .../presentation/controllers/index.ts | 0 .../controllers/list-accounts/index.ts | 0 .../list-accounts/list-accounts.controller.ts | 0 .../list-accounts/list-accounts.presenter.ts | 0 .../controllers/update-account/index.ts | 0 .../update-account.controller.ts | 0 .../update-account.presenter.ts | 0 .../presentation/dto/accounts.request.dto.ts | 2 +- .../presentation/dto/accounts.response.dto.ts | 0 .../presentation/dto/accounts.schemas.ts | 0 .../accounts/presentation/dto/index.ts | 0 .../contexts/accounts/presentation/index.ts | 0 .../contexts/auth/application/index.ts | 0 .../auth/application/list-users/index.ts | 0 .../list-users/list-users.use-case.ts | 0 .../contexts/auth/application/login/index.ts | 0 .../auth/application/login/login.use-case.ts | 0 .../contexts/auth/application/logout/index.ts | 0 .../application/logout/logout.use-case.ts | 0 .../auth/application/refresh-token/index.ts | 0 .../refresh-token/refresh-token.use-case.ts | 0 .../auth/application/register/index.ts | 0 .../application/register/register.use-case.ts | 0 .../domain/aggregates/authenticated-user.ts | 4 +- .../contexts/auth/domain/aggregates/index.ts | 0 .../contexts/auth/domain/aggregates/role.ts | 4 +- .../auth/domain/aggregates/user-permission.ts | 0 .../contexts/auth/domain/aggregates/user.ts | 0 .../contexts/auth/domain/entities/index.ts | 0 .../auth/domain/entities/jwt-payload.ts | 0 .../auth/domain/entities/login-data.ts | 0 .../auth/domain/entities/logout-data.ts | 0 .../auth/domain/entities/register-data.ts | 0 .../auth/domain/entities/tab-context.ts | 0 .../contexts/auth/domain/events/index.ts | 0 .../domain/events/user-authenticated.event.ts | 0 .../contexts/auth/domain/index.ts | 0 ...authenticated-user-repository.interface.ts | 0 .../auth/domain/repositories/index.ts | 0 .../tab-context-repository.interface.ts | 0 .../user-permission-repository.interface.ts | 1 + .../repositories/user-repository.interface.ts | 0 .../domain/services/auth-service.interface.ts | 0 .../auth/domain/services/auth.service.ts | 9 +- .../contexts/auth/domain/services/index.ts | 0 .../services/tab-context-service.interface.ts | 0 .../domain/services/tab-context.service.ts | 0 .../domain/services/user-service.interface.ts | 0 .../auth/domain/services/user.service.ts | 0 .../domain/value-objects/auth-user-roles.ts | 4 + .../value-objects/hash-password.spec.ts | 0 .../domain/value-objects/hash-password.ts | 1 + .../auth/domain/value-objects/index.ts | 0 .../domain/value-objects/plain-password.ts | 5 + .../auth/domain/value-objects/token.ts | 5 + .../auth/domain/value-objects/username.ts | 0 .../auth/infraestructure/express/types.ts | 0 .../contexts/auth/infraestructure/index.ts | 0 .../mappers/authenticated-user.mapper.ts | 10 +- .../auth/infraestructure/mappers/index.ts | 0 .../mappers/tab-context.mapper.ts | 12 +- .../infraestructure/mappers/user.mapper.ts | 13 +- .../auth/infraestructure/middleware/index.ts | 0 .../middleware/passport-auth.middleware.ts | 2 +- .../middleware/tab-context.middleware.ts | 0 .../auth/infraestructure/passport/index.ts | 8 +- .../infraestructure/passport/jwt.helper.ts | 0 .../passport/passport-auth-provider.ts | 0 .../sequelize/auth-user.model.ts | 0 .../authenticated-user.repository.ts | 29 +- .../auth/infraestructure/sequelize/index.ts | 8 + .../sequelize/tab-context.model.ts | 0 .../sequelize/tab-context.repository.ts | 37 +- .../infraestructure/sequelize/user.model.ts | 0 .../sequelize/user.repository.ts | 25 +- .../auth/presentation/controllers/index.ts | 0 .../controllers/listUsers/index.ts | 0 .../listUsers/list-users.controller.ts | 0 .../listUsers/list-users.presenter.ts | 0 .../presentation/controllers/login/index.ts | 0 .../controllers/login/login.controller.ts | 0 .../controllers/login/login.presenter.ts | 0 .../presentation/controllers/logout/index.ts | 0 .../controllers/logout/logout.controller.ts | 0 .../controllers/refreshToken/index.ts | 0 .../refreshToken/refresh-token.controller.ts | 0 .../refreshToken/refresh-token.presenter.ts | 0 .../controllers/register/index.ts | 0 .../register/register.controller.ts | 0 .../register/register.presenter.ts | 0 .../auth/presentation/dto/auth.request.dto.ts | 0 .../presentation/dto/auth.response.dto.ts | 2 +- .../presentation/dto/auth.validation.dto.ts | 0 .../contexts/auth/presentation/dto/index.ts | 0 .../auth/presentation/dto/user.request.dto.ts | 1 + .../presentation/dto/user.response.dto.ts | 0 .../presentation/dto/user.validation.dto.ts | 0 .../contexts/auth/presentation/index.ts | 0 .../contexts/contacts/application/index.ts | 0 .../application/list-contacts.use-case.ts | 0 .../contacts/domain/aggregates/contact.ts | 8 +- .../contacts/domain/aggregates/index.ts | 0 .../contexts/contacts/domain/index.ts | 0 .../contact-repository.interface.ts | 0 .../contacts/domain/repositories/index.ts | 0 .../services/contact-service.interface.ts | 0 .../domain/services/contact.service.ts | 0 .../contacts/domain/services/index.ts | 0 .../contacts/infraestructure/index.ts | 0 .../infraestructure/mappers/contact.mapper.ts | 4 +- .../contacts/infraestructure/mappers/index.ts | 0 .../sequelize/contact.model.ts | 0 .../sequelize/contact.repository.ts | 2 +- .../infraestructure/sequelize/index.ts | 0 .../presentation/controllers/index.ts | 0 .../presentation/controllers/list/index.ts | 0 .../list/list-contacts.controller.ts | 0 .../list/list-contacts.presenter.ts | 0 .../presentation/dto/contacts.request.dto.ts | 1 + .../presentation/dto/contacts.response.dto.ts | 0 .../dto/contacts.validation.dto.ts | 0 .../contacts/presentation/dto/index.ts | 0 .../contexts/contacts/presentation/index.ts | 0 .../get-customer-invoice.use-case.ts | 0 .../customer-billing/application/index.ts | 0 .../list-customer-invoices-use-case.ts | 0 .../domain/aggregates/customer-invoice.ts | 1 + .../domain/aggregates/index.ts | 0 .../domain/entities/customer-invoice-item.ts | 2 +- .../domain/entities/customer.ts | 1 + .../customer-billing/domain/entities/index.ts | 0 .../domain/entities/tax-collection.ts | 0 .../customer-billing/domain/entities/tax.ts | 0 .../contexts/customer-billing/domain/index.ts | 0 .../customer-invoice-repository.interface.ts | 0 .../domain/repositories/index.ts | 0 .../customer-invoice-service.interface.ts | 0 .../services/customer-invoice.service.ts | 0 .../customer-billing/domain/services/index.ts | 0 .../domain/value-objetcs/index.ts | 0 .../value-objetcs/invoice-status.spec.ts | 0 .../domain/value-objetcs/invoice-status.ts | 0 .../customer-billing/infraestructure/index.ts | 0 .../mappers/customer-invoice.mapper.ts | 4 +- .../infraestructure/mappers/index.ts | 0 .../sequelize/customer-invoice-item.model.ts | 0 .../sequelize/customer-invoice.model.ts | 0 .../sequelize/customer-invoice.repository.ts | 5 +- .../sequelize/customer.model.ts | 0 .../infraestructure/sequelize/index.ts | 0 .../get/get-customer-invoice.controller.ts | 0 .../get/get-customer-invoice.presenter.ts | 0 .../customer-invoices/get/index.ts | 0 .../controllers/customer-invoices/index.ts | 0 .../customer-invoices/list/index.ts | 0 .../list/list-customer-invoices.controller.ts | 0 .../list/list-customer-invoices.presenter.ts | 0 .../presentation/controllers/index.ts | 0 .../customer-invoices.request.dto.ts | 1 + .../customer-invoices.response.dto.ts | 2 +- .../customer-invoices.validation.dto.ts | 0 .../dto/customer-invoices/index.ts | 0 .../presentation/dto/customers.request.dto.ts | 1 + .../dto/customers.response.dto.ts | 0 .../dto/customers.validation.dto.ts | 0 .../presentation/dto/index.ts | 0 .../customer-billing/presentation/index.ts | 0 apps/server/jest.config.js | 7 - apps/server/package.json | 40 +- apps/server/src/app.ts | 3 +- apps/server/src/config/database.ts | 2 +- apps/server/src/config/register-models.ts | 14 +- .../user-permission-repository.interface.ts | 1 - .../auth/infraestructure/sequelize/index.ts | 25 -- .../auth/presentation/dto/user.request.dto.ts | 1 - .../presentation/dto/contacts.request.dto.ts | 1 - .../customer-invoices.request.dto.ts | 1 - .../presentation/dto/customers.request.dto.ts | 1 - .../application/create-invoice.use-case.ts | 8 +- .../application/delete-invoice.use-case.ts | 4 +- .../contexts/invoices/application/index.ts | 6 +- .../invoices/application/services/index.ts | 4 +- .../services/participantAddressFinder.ts | 36 +- .../application/services/participantFinder.ts | 3 +- .../application/update-invoice.use-case.ts | 17 +- .../invoice-customer/invoice-address.ts | 7 +- apps/server/src/contexts/invoices/index.ts | 27 ++ ...epository.ts => Contact.repository.ts.bak} | 19 +- .../invoices/intrastructure/express/index.ts | 1 + .../intrastructure/express/invoices.routes.ts | 64 +++ .../contexts/invoices/intrastructure/index.ts | 1 + .../mappers/invoice-item.mapper.ts | 4 +- .../intrastructure/mappers/invoice.mapper.ts | 4 +- .../intrastructure/sequelize/index.ts | 6 + .../create-invoice.controller.ts | 2 +- .../controllers/create-invoice/index.ts | 4 +- .../presenter/create-invoice.presenter.ts | 4 +- .../controllers/get-invoice/index.ts | 2 +- .../presenter/get-invoice.presenter.ts | 2 +- .../controllers/list-invoices/index.ts | 2 +- .../presenter/list-invoices.presenter.ts | 6 +- .../presentation/dto/invoices.request.dto.ts | 2 +- .../aggregate-root-repository.interface.ts | 2 +- .../src/core/common/domain/aggregate-root.ts | 1 + .../core/common/domain/events/domain-event.ts | 4 +- .../domain/value-objects/money-value.ts | 6 +- .../common/domain/value-objects/percentage.ts | 6 +- .../common/domain/value-objects/quantity.ts | 10 +- .../common/domain/value-objects/unique-id.ts | 2 +- apps/server/src/core/common/helpers/index.ts | 1 + .../src/core/common/helpers/modules/index.ts | 2 + .../modules/module-server.interface.ts | 9 + .../src/core/common/helpers/modules/types.ts | 26 ++ .../src/core/common/infrastructure/index.ts | 4 + .../common/infrastructure/passport/index.ts | 2 +- .../infrastructure/passport/passport.ts | 3 +- .../sequelize/sequelize-repository.ts | 2 +- .../express/express-controller.ts | 8 +- apps/server/src/core/helpers/index.ts | 2 + apps/server/src/core/helpers/model-loader.ts | 60 +++ apps/server/src/core/helpers/module-loader.ts | 52 +++ .../src/core/helpers/service-registry.ts | 36 ++ apps/server/src/routes/accounts.routes.ts | 3 +- apps/server/src/routes/auth.routes.ts | 93 ++-- apps/server/src/routes/invoices.routes.ts | 9 +- apps/server/src/routes/users.routes.ts | 5 +- apps/server/tsconfig.json | 22 +- biome.json | 47 ++ modules.bak/invoices/package.json | 2 +- package.json | 9 +- packages.bak/client/package.json | 2 +- packages.bak/rdx-criteria/package.json | 2 +- packages.bak/rdx-ddd-domain/package.json | 2 +- packages.bak/rdx-module/package.json | 2 +- packages/typescript-config/express.json | 65 +-- packages/ui/eslint.config.mjs | 4 - packages/ui/src/components/button.tsx | 2 +- packages/ui/src/lib/utils.ts | 2 +- packages/ui/tsconfig.lint.json | 8 - pnpm-lock.yaml | 423 ++++++++++++++++-- pnpm-workspace.yaml | 1 + turbo.json | 5 +- 277 files changed, 1101 insertions(+), 461 deletions(-) delete mode 100644 .prettierrc create mode 100644 .vscode/extensions.json rename apps/server/{src => archive}/contexts/accounts/application/create-account.use-case.ts (97%) rename apps/server/{src => archive}/contexts/accounts/application/get-account.use-case.ts (100%) rename apps/server/{src => archive}/contexts/accounts/application/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/application/list-accounts.use-case.ts (92%) rename apps/server/{src => archive}/contexts/accounts/application/update-account.use-case.test.ts (100%) rename apps/server/{src => archive}/contexts/accounts/application/update-account.use-case.ts (100%) rename apps/server/{src => archive}/contexts/accounts/domain/aggregates/account.ts (97%) rename apps/server/{src => archive}/contexts/accounts/domain/aggregates/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/domain/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/domain/repositories/account-repository.interface.ts (100%) rename apps/server/{src => archive}/contexts/accounts/domain/repositories/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/domain/services/account-service.integration.test.ts (100%) rename apps/server/{src => archive}/contexts/accounts/domain/services/account-service.interface.ts (100%) rename apps/server/{src => archive}/contexts/accounts/domain/services/account-service.test.ts (100%) rename apps/server/{src => archive}/contexts/accounts/domain/services/account.service.ts (100%) rename apps/server/{src => archive}/contexts/accounts/domain/services/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/domain/value-objects/account-status.test.ts (100%) rename apps/server/{src => archive}/contexts/accounts/domain/value-objects/account-status.ts (100%) rename apps/server/{src => archive}/contexts/accounts/domain/value-objects/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/infraestructure/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/infraestructure/mappers/account.mapper.ts (98%) rename apps/server/{src => archive}/contexts/accounts/infraestructure/mappers/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/infraestructure/sequelize/account.model.ts (100%) rename apps/server/{src => archive}/contexts/accounts/infraestructure/sequelize/account.repository.ts (98%) rename apps/server/{src => archive}/contexts/accounts/infraestructure/sequelize/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/controllers/create-account/create-account.controller.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/controllers/create-account/create-account.presenter.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/controllers/create-account/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/controllers/get-account/get-account.controller.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/controllers/get-account/get-account.presenter.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/controllers/get-account/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/controllers/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/controllers/list-accounts/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/controllers/list-accounts/list-accounts.controller.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/controllers/list-accounts/list-accounts.presenter.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/controllers/update-account/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/controllers/update-account/update-account.controller.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/controllers/update-account/update-account.presenter.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/dto/accounts.request.dto.ts (94%) rename apps/server/{src => archive}/contexts/accounts/presentation/dto/accounts.response.dto.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/dto/accounts.schemas.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/dto/index.ts (100%) rename apps/server/{src => archive}/contexts/accounts/presentation/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/application/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/application/list-users/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/application/list-users/list-users.use-case.ts (100%) rename apps/server/{src => archive}/contexts/auth/application/login/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/application/login/login.use-case.ts (100%) rename apps/server/{src => archive}/contexts/auth/application/logout/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/application/logout/logout.use-case.ts (100%) rename apps/server/{src => archive}/contexts/auth/application/refresh-token/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/application/refresh-token/refresh-token.use-case.ts (100%) rename apps/server/{src => archive}/contexts/auth/application/register/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/application/register/register.use-case.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/aggregates/authenticated-user.ts (96%) rename apps/server/{src => archive}/contexts/auth/domain/aggregates/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/aggregates/role.ts (86%) rename apps/server/{src => archive}/contexts/auth/domain/aggregates/user-permission.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/aggregates/user.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/entities/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/entities/jwt-payload.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/entities/login-data.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/entities/logout-data.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/entities/register-data.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/entities/tab-context.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/events/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/events/user-authenticated.event.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/repositories/authenticated-user-repository.interface.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/repositories/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/repositories/tab-context-repository.interface.ts (100%) create mode 100644 apps/server/archive/contexts/auth/domain/repositories/user-permission-repository.interface.ts rename apps/server/{src => archive}/contexts/auth/domain/repositories/user-repository.interface.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/services/auth-service.interface.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/services/auth.service.ts (97%) rename apps/server/{src => archive}/contexts/auth/domain/services/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/services/tab-context-service.interface.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/services/tab-context.service.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/services/user-service.interface.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/services/user.service.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/value-objects/auth-user-roles.ts (93%) rename apps/server/{src => archive}/contexts/auth/domain/value-objects/hash-password.spec.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/value-objects/hash-password.ts (97%) rename apps/server/{src => archive}/contexts/auth/domain/value-objects/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/domain/value-objects/plain-password.ts (94%) rename apps/server/{src => archive}/contexts/auth/domain/value-objects/token.ts (93%) rename apps/server/{src => archive}/contexts/auth/domain/value-objects/username.ts (100%) rename apps/server/{src => archive}/contexts/auth/infraestructure/express/types.ts (100%) rename apps/server/{src => archive}/contexts/auth/infraestructure/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/infraestructure/mappers/authenticated-user.mapper.ts (89%) rename apps/server/{src => archive}/contexts/auth/infraestructure/mappers/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/infraestructure/mappers/tab-context.mapper.ts (91%) rename apps/server/{src => archive}/contexts/auth/infraestructure/mappers/user.mapper.ts (89%) rename apps/server/{src => archive}/contexts/auth/infraestructure/middleware/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/infraestructure/middleware/passport-auth.middleware.ts (100%) rename apps/server/{src => archive}/contexts/auth/infraestructure/middleware/tab-context.middleware.ts (100%) rename apps/server/{src => archive}/contexts/auth/infraestructure/passport/index.ts (66%) rename apps/server/{src => archive}/contexts/auth/infraestructure/passport/jwt.helper.ts (100%) rename apps/server/{src => archive}/contexts/auth/infraestructure/passport/passport-auth-provider.ts (100%) rename apps/server/{src => archive}/contexts/auth/infraestructure/sequelize/auth-user.model.ts (100%) rename apps/server/{src => archive}/contexts/auth/infraestructure/sequelize/authenticated-user.repository.ts (75%) create mode 100644 apps/server/archive/contexts/auth/infraestructure/sequelize/index.ts rename apps/server/{src => archive}/contexts/auth/infraestructure/sequelize/tab-context.model.ts (100%) rename apps/server/{src => archive}/contexts/auth/infraestructure/sequelize/tab-context.repository.ts (78%) rename apps/server/{src => archive}/contexts/auth/infraestructure/sequelize/user.model.ts (100%) rename apps/server/{src => archive}/contexts/auth/infraestructure/sequelize/user.repository.ts (72%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/listUsers/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/listUsers/list-users.controller.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/listUsers/list-users.presenter.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/login/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/login/login.controller.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/login/login.presenter.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/logout/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/logout/logout.controller.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/refreshToken/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/refreshToken/refresh-token.controller.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/refreshToken/refresh-token.presenter.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/register/index.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/register/register.controller.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/controllers/register/register.presenter.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/dto/auth.request.dto.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/dto/auth.response.dto.ts (90%) rename apps/server/{src => archive}/contexts/auth/presentation/dto/auth.validation.dto.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/dto/index.ts (100%) create mode 100644 apps/server/archive/contexts/auth/presentation/dto/user.request.dto.ts rename apps/server/{src => archive}/contexts/auth/presentation/dto/user.response.dto.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/dto/user.validation.dto.ts (100%) rename apps/server/{src => archive}/contexts/auth/presentation/index.ts (100%) rename apps/server/{src => archive}/contexts/contacts/application/index.ts (100%) rename apps/server/{src => archive}/contexts/contacts/application/list-contacts.use-case.ts (100%) rename apps/server/{src => archive}/contexts/contacts/domain/aggregates/contact.ts (96%) rename apps/server/{src => archive}/contexts/contacts/domain/aggregates/index.ts (100%) rename apps/server/{src => archive}/contexts/contacts/domain/index.ts (100%) rename apps/server/{src => archive}/contexts/contacts/domain/repositories/contact-repository.interface.ts (100%) rename apps/server/{src => archive}/contexts/contacts/domain/repositories/index.ts (100%) rename apps/server/{src => archive}/contexts/contacts/domain/services/contact-service.interface.ts (100%) rename apps/server/{src => archive}/contexts/contacts/domain/services/contact.service.ts (100%) rename apps/server/{src => archive}/contexts/contacts/domain/services/index.ts (100%) rename apps/server/{src => archive}/contexts/contacts/infraestructure/index.ts (100%) rename apps/server/{src => archive}/contexts/contacts/infraestructure/mappers/contact.mapper.ts (98%) rename apps/server/{src => archive}/contexts/contacts/infraestructure/mappers/index.ts (100%) rename apps/server/{src => archive}/contexts/contacts/infraestructure/sequelize/contact.model.ts (100%) rename apps/server/{src => archive}/contexts/contacts/infraestructure/sequelize/contact.repository.ts (97%) rename apps/server/{src => archive}/contexts/contacts/infraestructure/sequelize/index.ts (100%) rename apps/server/{src => archive}/contexts/contacts/presentation/controllers/index.ts (100%) rename apps/server/{src => archive}/contexts/contacts/presentation/controllers/list/index.ts (100%) rename apps/server/{src => archive}/contexts/contacts/presentation/controllers/list/list-contacts.controller.ts (100%) rename apps/server/{src => archive}/contexts/contacts/presentation/controllers/list/list-contacts.presenter.ts (100%) create mode 100644 apps/server/archive/contexts/contacts/presentation/dto/contacts.request.dto.ts rename apps/server/{src => archive}/contexts/contacts/presentation/dto/contacts.response.dto.ts (100%) rename apps/server/{src => archive}/contexts/contacts/presentation/dto/contacts.validation.dto.ts (100%) rename apps/server/{src => archive}/contexts/contacts/presentation/dto/index.ts (100%) rename apps/server/{src => archive}/contexts/contacts/presentation/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/application/get-customer-invoice.use-case.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/application/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/application/list-customer-invoices-use-case.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/domain/aggregates/customer-invoice.ts (99%) rename apps/server/{src => archive}/contexts/customer-billing/domain/aggregates/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/domain/entities/customer-invoice-item.ts (99%) rename apps/server/{src => archive}/contexts/customer-billing/domain/entities/customer.ts (98%) rename apps/server/{src => archive}/contexts/customer-billing/domain/entities/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/domain/entities/tax-collection.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/domain/entities/tax.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/domain/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/domain/repositories/customer-invoice-repository.interface.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/domain/repositories/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/domain/services/customer-invoice-service.interface.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/domain/services/customer-invoice.service.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/domain/services/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/domain/value-objetcs/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/domain/value-objetcs/invoice-status.spec.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/domain/value-objetcs/invoice-status.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/infraestructure/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/infraestructure/mappers/customer-invoice.mapper.ts (98%) rename apps/server/{src => archive}/contexts/customer-billing/infraestructure/mappers/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/infraestructure/sequelize/customer-invoice-item.model.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/infraestructure/sequelize/customer-invoice.model.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/infraestructure/sequelize/customer-invoice.repository.ts (95%) rename apps/server/{src => archive}/contexts/customer-billing/infraestructure/sequelize/customer.model.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/infraestructure/sequelize/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/presentation/controllers/customer-invoices/get/get-customer-invoice.controller.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/presentation/controllers/customer-invoices/get/get-customer-invoice.presenter.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/presentation/controllers/customer-invoices/get/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/presentation/controllers/customer-invoices/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/presentation/controllers/customer-invoices/list/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/presentation/controllers/customer-invoices/list/list-customer-invoices.controller.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/presentation/controllers/customer-invoices/list/list-customer-invoices.presenter.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/presentation/controllers/index.ts (100%) create mode 100644 apps/server/archive/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.request.dto.ts rename apps/server/{src => archive}/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.response.dto.ts (89%) rename apps/server/{src => archive}/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.validation.dto.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/presentation/dto/customer-invoices/index.ts (100%) create mode 100644 apps/server/archive/contexts/customer-billing/presentation/dto/customers.request.dto.ts rename apps/server/{src => archive}/contexts/customer-billing/presentation/dto/customers.response.dto.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/presentation/dto/customers.validation.dto.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/presentation/dto/index.ts (100%) rename apps/server/{src => archive}/contexts/customer-billing/presentation/index.ts (100%) delete mode 100644 apps/server/jest.config.js delete mode 100644 apps/server/src/contexts/auth/domain/repositories/user-permission-repository.interface.ts delete mode 100644 apps/server/src/contexts/auth/infraestructure/sequelize/index.ts delete mode 100644 apps/server/src/contexts/auth/presentation/dto/user.request.dto.ts delete mode 100644 apps/server/src/contexts/contacts/presentation/dto/contacts.request.dto.ts delete mode 100644 apps/server/src/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.request.dto.ts delete mode 100644 apps/server/src/contexts/customer-billing/presentation/dto/customers.request.dto.ts create mode 100644 apps/server/src/contexts/invoices/index.ts rename apps/server/src/contexts/invoices/intrastructure/{Contact.repository.ts => Contact.repository.ts.bak} (75%) create mode 100644 apps/server/src/contexts/invoices/intrastructure/express/index.ts create mode 100644 apps/server/src/contexts/invoices/intrastructure/express/invoices.routes.ts create mode 100644 apps/server/src/core/common/helpers/modules/index.ts create mode 100644 apps/server/src/core/common/helpers/modules/module-server.interface.ts create mode 100644 apps/server/src/core/common/helpers/modules/types.ts create mode 100644 apps/server/src/core/helpers/index.ts create mode 100644 apps/server/src/core/helpers/model-loader.ts create mode 100644 apps/server/src/core/helpers/module-loader.ts create mode 100644 apps/server/src/core/helpers/service-registry.ts create mode 100644 biome.json delete mode 100644 packages/ui/eslint.config.mjs delete mode 100644 packages/ui/tsconfig.lint.json diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 91a4315c..00000000 --- a/.prettierrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "bracketSpacing": true, - "useTabs": false, - "printWidth": 100, - "tabWidth": 2, - "semi": true, - "singleQuote": false, - "trailingComma": "es5", - "jsxSingleQuote": true, - "jsxBracketSameLine": false, - "arrowParens": "always", - "rcVerbose": true -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..9069b50c --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["esbenp.prettier-vscode", "biomejs.biome"] +} diff --git a/.vscode/launch.json b/.vscode/launch.json index 438befe9..ca8478f4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,6 +1,23 @@ { "version": "0.2.0", "configurations": [ + { + "name": "SERVER: Run in Development Mode", + "type": "node", + "request": "launch", + "runtimeExecutable": "npm", + "runtimeArgs": ["run", "dev"], + "console": "integratedTerminal" + }, + { + "name": "SERVER: Run in Production Mode", + "type": "node", + "request": "launch", + "runtimeExecutable": "npm", + "runtimeArgs": ["run", "start"], + "console": "integratedTerminal", + "preLaunchTask": "npm: build" + }, { "name": "Attach to Turbo Server API (ts-node-dev)", "type": "node", diff --git a/.vscode/settings.json b/.vscode/settings.json index 036f1df1..69d087fc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,15 +17,18 @@ "typescript.preferences.importModuleSpecifier": "shortest", "editor.codeActionsOnSave": { - "source.organizeImports": "explicit", - "source.fixAll.eslint": "explicit" + "source.fixAll": "explicit", + "source.fixAll.biome": "explicit", + "source.organizeImports.biome": "explicit", + "source.removeUnusedImports": "explicit" }, - "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.defaultFormatter": "biomejs.biome", "editor.formatOnSave": true, "editor.formatOnPaste": false, - "prettier.useEditorConfig": false, - "prettier.useTabs": false, - "prettier.configPath": ".prettierrc", + + "[javascript][typescript][json][jsonc]": { + "editor.defaultFormatter": "biomejs.biome" + }, // other vscode settings "[handlebars]": { diff --git a/apps/server/src/contexts/accounts/application/create-account.use-case.ts b/apps/server/archive/contexts/accounts/application/create-account.use-case.ts similarity index 97% rename from apps/server/src/contexts/accounts/application/create-account.use-case.ts rename to apps/server/archive/contexts/accounts/application/create-account.use-case.ts index 17c7df73..4ecb3a94 100644 --- a/apps/server/src/contexts/accounts/application/create-account.use-case.ts +++ b/apps/server/archive/contexts/accounts/application/create-account.use-case.ts @@ -6,7 +6,12 @@ import { UniqueID, } from "@/core/common/domain"; -import { Account, AccountStatus, IAccountProps, IAccountService } from "@/contexts/accounts/domain"; +import { + type Account, + AccountStatus, + type IAccountProps, + type 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"; diff --git a/apps/server/src/contexts/accounts/application/get-account.use-case.ts b/apps/server/archive/contexts/accounts/application/get-account.use-case.ts similarity index 100% rename from apps/server/src/contexts/accounts/application/get-account.use-case.ts rename to apps/server/archive/contexts/accounts/application/get-account.use-case.ts diff --git a/apps/server/src/contexts/accounts/application/index.ts b/apps/server/archive/contexts/accounts/application/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/application/index.ts rename to apps/server/archive/contexts/accounts/application/index.ts diff --git a/apps/server/src/contexts/accounts/application/list-accounts.use-case.ts b/apps/server/archive/contexts/accounts/application/list-accounts.use-case.ts similarity index 92% rename from apps/server/src/contexts/accounts/application/list-accounts.use-case.ts rename to apps/server/archive/contexts/accounts/application/list-accounts.use-case.ts index 61ff6abe..2a8af294 100644 --- a/apps/server/src/contexts/accounts/application/list-accounts.use-case.ts +++ b/apps/server/archive/contexts/accounts/application/list-accounts.use-case.ts @@ -1,7 +1,6 @@ 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( diff --git a/apps/server/src/contexts/accounts/application/update-account.use-case.test.ts b/apps/server/archive/contexts/accounts/application/update-account.use-case.test.ts similarity index 100% rename from apps/server/src/contexts/accounts/application/update-account.use-case.test.ts rename to apps/server/archive/contexts/accounts/application/update-account.use-case.test.ts diff --git a/apps/server/src/contexts/accounts/application/update-account.use-case.ts b/apps/server/archive/contexts/accounts/application/update-account.use-case.ts similarity index 100% rename from apps/server/src/contexts/accounts/application/update-account.use-case.ts rename to apps/server/archive/contexts/accounts/application/update-account.use-case.ts diff --git a/apps/server/src/contexts/accounts/domain/aggregates/account.ts b/apps/server/archive/contexts/accounts/domain/aggregates/account.ts similarity index 97% rename from apps/server/src/contexts/accounts/domain/aggregates/account.ts rename to apps/server/archive/contexts/accounts/domain/aggregates/account.ts index f01a9324..2ef6d129 100644 --- a/apps/server/src/contexts/accounts/domain/aggregates/account.ts +++ b/apps/server/archive/contexts/accounts/domain/aggregates/account.ts @@ -1,11 +1,11 @@ import { AggregateRoot, - EmailAddress, - PhoneNumber, + type EmailAddress, + type PhoneNumber, PostalAddress, - TINNumber, + type TINNumber, UniqueID, -} from "@/core/common/domain"; +} from "@/core"; import { Maybe, Result } from "@/core/common/helpers"; import { AccountStatus } from "../value-objects"; @@ -58,6 +58,7 @@ export interface IAccount { } export class Account extends AggregateRoot implements IAccount { + id: UniqueID; static create(props: IAccountProps, id?: UniqueID): Result { const account = new Account(props, id); diff --git a/apps/server/src/contexts/accounts/domain/aggregates/index.ts b/apps/server/archive/contexts/accounts/domain/aggregates/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/domain/aggregates/index.ts rename to apps/server/archive/contexts/accounts/domain/aggregates/index.ts diff --git a/apps/server/src/contexts/accounts/domain/index.ts b/apps/server/archive/contexts/accounts/domain/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/domain/index.ts rename to apps/server/archive/contexts/accounts/domain/index.ts diff --git a/apps/server/src/contexts/accounts/domain/repositories/account-repository.interface.ts b/apps/server/archive/contexts/accounts/domain/repositories/account-repository.interface.ts similarity index 100% rename from apps/server/src/contexts/accounts/domain/repositories/account-repository.interface.ts rename to apps/server/archive/contexts/accounts/domain/repositories/account-repository.interface.ts diff --git a/apps/server/src/contexts/accounts/domain/repositories/index.ts b/apps/server/archive/contexts/accounts/domain/repositories/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/domain/repositories/index.ts rename to apps/server/archive/contexts/accounts/domain/repositories/index.ts diff --git a/apps/server/src/contexts/accounts/domain/services/account-service.integration.test.ts b/apps/server/archive/contexts/accounts/domain/services/account-service.integration.test.ts similarity index 100% rename from apps/server/src/contexts/accounts/domain/services/account-service.integration.test.ts rename to apps/server/archive/contexts/accounts/domain/services/account-service.integration.test.ts diff --git a/apps/server/src/contexts/accounts/domain/services/account-service.interface.ts b/apps/server/archive/contexts/accounts/domain/services/account-service.interface.ts similarity index 100% rename from apps/server/src/contexts/accounts/domain/services/account-service.interface.ts rename to apps/server/archive/contexts/accounts/domain/services/account-service.interface.ts diff --git a/apps/server/src/contexts/accounts/domain/services/account-service.test.ts b/apps/server/archive/contexts/accounts/domain/services/account-service.test.ts similarity index 100% rename from apps/server/src/contexts/accounts/domain/services/account-service.test.ts rename to apps/server/archive/contexts/accounts/domain/services/account-service.test.ts diff --git a/apps/server/src/contexts/accounts/domain/services/account.service.ts b/apps/server/archive/contexts/accounts/domain/services/account.service.ts similarity index 100% rename from apps/server/src/contexts/accounts/domain/services/account.service.ts rename to apps/server/archive/contexts/accounts/domain/services/account.service.ts diff --git a/apps/server/src/contexts/accounts/domain/services/index.ts b/apps/server/archive/contexts/accounts/domain/services/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/domain/services/index.ts rename to apps/server/archive/contexts/accounts/domain/services/index.ts diff --git a/apps/server/src/contexts/accounts/domain/value-objects/account-status.test.ts b/apps/server/archive/contexts/accounts/domain/value-objects/account-status.test.ts similarity index 100% rename from apps/server/src/contexts/accounts/domain/value-objects/account-status.test.ts rename to apps/server/archive/contexts/accounts/domain/value-objects/account-status.test.ts diff --git a/apps/server/src/contexts/accounts/domain/value-objects/account-status.ts b/apps/server/archive/contexts/accounts/domain/value-objects/account-status.ts similarity index 100% rename from apps/server/src/contexts/accounts/domain/value-objects/account-status.ts rename to apps/server/archive/contexts/accounts/domain/value-objects/account-status.ts diff --git a/apps/server/src/contexts/accounts/domain/value-objects/index.ts b/apps/server/archive/contexts/accounts/domain/value-objects/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/domain/value-objects/index.ts rename to apps/server/archive/contexts/accounts/domain/value-objects/index.ts diff --git a/apps/server/src/contexts/accounts/infraestructure/index.ts b/apps/server/archive/contexts/accounts/infraestructure/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/infraestructure/index.ts rename to apps/server/archive/contexts/accounts/infraestructure/index.ts diff --git a/apps/server/src/contexts/accounts/infraestructure/mappers/account.mapper.ts b/apps/server/archive/contexts/accounts/infraestructure/mappers/account.mapper.ts similarity index 98% rename from apps/server/src/contexts/accounts/infraestructure/mappers/account.mapper.ts rename to apps/server/archive/contexts/accounts/infraestructure/mappers/account.mapper.ts index 2011d7f2..e3eec91a 100644 --- a/apps/server/src/contexts/accounts/infraestructure/mappers/account.mapper.ts +++ b/apps/server/archive/contexts/accounts/infraestructure/mappers/account.mapper.ts @@ -8,8 +8,8 @@ import { } from "@/core/common/domain"; import { Maybe, Result } from "@/core/common/helpers"; import { - ISequelizeMapper, - MapperParamsType, + type ISequelizeMapper, + type MapperParamsType, SequelizeMapper, } from "@/core/common/infrastructure/sequelize/sequelize-mapper"; import { AccountCreationAttributes, AccountModel } from "../sequelize/account.model"; diff --git a/apps/server/src/contexts/accounts/infraestructure/mappers/index.ts b/apps/server/archive/contexts/accounts/infraestructure/mappers/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/infraestructure/mappers/index.ts rename to apps/server/archive/contexts/accounts/infraestructure/mappers/index.ts diff --git a/apps/server/src/contexts/accounts/infraestructure/sequelize/account.model.ts b/apps/server/archive/contexts/accounts/infraestructure/sequelize/account.model.ts similarity index 100% rename from apps/server/src/contexts/accounts/infraestructure/sequelize/account.model.ts rename to apps/server/archive/contexts/accounts/infraestructure/sequelize/account.model.ts diff --git a/apps/server/src/contexts/accounts/infraestructure/sequelize/account.repository.ts b/apps/server/archive/contexts/accounts/infraestructure/sequelize/account.repository.ts similarity index 98% rename from apps/server/src/contexts/accounts/infraestructure/sequelize/account.repository.ts rename to apps/server/archive/contexts/accounts/infraestructure/sequelize/account.repository.ts index d45d1020..4f43c77c 100644 --- a/apps/server/src/contexts/accounts/infraestructure/sequelize/account.repository.ts +++ b/apps/server/archive/contexts/accounts/infraestructure/sequelize/account.repository.ts @@ -4,7 +4,7 @@ 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 { IAccountMapper, accountMapper } from "../mappers/account.mapper"; import { AccountModel } from "./account.model"; class AccountRepository extends SequelizeRepository implements IAccountRepository { diff --git a/apps/server/src/contexts/accounts/infraestructure/sequelize/index.ts b/apps/server/archive/contexts/accounts/infraestructure/sequelize/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/infraestructure/sequelize/index.ts rename to apps/server/archive/contexts/accounts/infraestructure/sequelize/index.ts diff --git a/apps/server/src/contexts/accounts/presentation/controllers/create-account/create-account.controller.ts b/apps/server/archive/contexts/accounts/presentation/controllers/create-account/create-account.controller.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/controllers/create-account/create-account.controller.ts rename to apps/server/archive/contexts/accounts/presentation/controllers/create-account/create-account.controller.ts diff --git a/apps/server/src/contexts/accounts/presentation/controllers/create-account/create-account.presenter.ts b/apps/server/archive/contexts/accounts/presentation/controllers/create-account/create-account.presenter.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/controllers/create-account/create-account.presenter.ts rename to apps/server/archive/contexts/accounts/presentation/controllers/create-account/create-account.presenter.ts diff --git a/apps/server/src/contexts/accounts/presentation/controllers/create-account/index.ts b/apps/server/archive/contexts/accounts/presentation/controllers/create-account/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/controllers/create-account/index.ts rename to apps/server/archive/contexts/accounts/presentation/controllers/create-account/index.ts diff --git a/apps/server/src/contexts/accounts/presentation/controllers/get-account/get-account.controller.ts b/apps/server/archive/contexts/accounts/presentation/controllers/get-account/get-account.controller.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/controllers/get-account/get-account.controller.ts rename to apps/server/archive/contexts/accounts/presentation/controllers/get-account/get-account.controller.ts diff --git a/apps/server/src/contexts/accounts/presentation/controllers/get-account/get-account.presenter.ts b/apps/server/archive/contexts/accounts/presentation/controllers/get-account/get-account.presenter.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/controllers/get-account/get-account.presenter.ts rename to apps/server/archive/contexts/accounts/presentation/controllers/get-account/get-account.presenter.ts diff --git a/apps/server/src/contexts/accounts/presentation/controllers/get-account/index.ts b/apps/server/archive/contexts/accounts/presentation/controllers/get-account/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/controllers/get-account/index.ts rename to apps/server/archive/contexts/accounts/presentation/controllers/get-account/index.ts diff --git a/apps/server/src/contexts/accounts/presentation/controllers/index.ts b/apps/server/archive/contexts/accounts/presentation/controllers/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/controllers/index.ts rename to apps/server/archive/contexts/accounts/presentation/controllers/index.ts diff --git a/apps/server/src/contexts/accounts/presentation/controllers/list-accounts/index.ts b/apps/server/archive/contexts/accounts/presentation/controllers/list-accounts/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/controllers/list-accounts/index.ts rename to apps/server/archive/contexts/accounts/presentation/controllers/list-accounts/index.ts diff --git a/apps/server/src/contexts/accounts/presentation/controllers/list-accounts/list-accounts.controller.ts b/apps/server/archive/contexts/accounts/presentation/controllers/list-accounts/list-accounts.controller.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/controllers/list-accounts/list-accounts.controller.ts rename to apps/server/archive/contexts/accounts/presentation/controllers/list-accounts/list-accounts.controller.ts diff --git a/apps/server/src/contexts/accounts/presentation/controllers/list-accounts/list-accounts.presenter.ts b/apps/server/archive/contexts/accounts/presentation/controllers/list-accounts/list-accounts.presenter.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/controllers/list-accounts/list-accounts.presenter.ts rename to apps/server/archive/contexts/accounts/presentation/controllers/list-accounts/list-accounts.presenter.ts diff --git a/apps/server/src/contexts/accounts/presentation/controllers/update-account/index.ts b/apps/server/archive/contexts/accounts/presentation/controllers/update-account/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/controllers/update-account/index.ts rename to apps/server/archive/contexts/accounts/presentation/controllers/update-account/index.ts diff --git a/apps/server/src/contexts/accounts/presentation/controllers/update-account/update-account.controller.ts b/apps/server/archive/contexts/accounts/presentation/controllers/update-account/update-account.controller.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/controllers/update-account/update-account.controller.ts rename to apps/server/archive/contexts/accounts/presentation/controllers/update-account/update-account.controller.ts diff --git a/apps/server/src/contexts/accounts/presentation/controllers/update-account/update-account.presenter.ts b/apps/server/archive/contexts/accounts/presentation/controllers/update-account/update-account.presenter.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/controllers/update-account/update-account.presenter.ts rename to apps/server/archive/contexts/accounts/presentation/controllers/update-account/update-account.presenter.ts diff --git a/apps/server/src/contexts/accounts/presentation/dto/accounts.request.dto.ts b/apps/server/archive/contexts/accounts/presentation/dto/accounts.request.dto.ts similarity index 94% rename from apps/server/src/contexts/accounts/presentation/dto/accounts.request.dto.ts rename to apps/server/archive/contexts/accounts/presentation/dto/accounts.request.dto.ts index 4bef8b3f..6731d9d5 100644 --- a/apps/server/src/contexts/accounts/presentation/dto/accounts.request.dto.ts +++ b/apps/server/archive/contexts/accounts/presentation/dto/accounts.request.dto.ts @@ -1,4 +1,4 @@ -export interface IListAccountsRequestDTO {} +export type IListAccountsRequestDTO = {} export interface ICreateAccountRequestDTO { id: string; diff --git a/apps/server/src/contexts/accounts/presentation/dto/accounts.response.dto.ts b/apps/server/archive/contexts/accounts/presentation/dto/accounts.response.dto.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/dto/accounts.response.dto.ts rename to apps/server/archive/contexts/accounts/presentation/dto/accounts.response.dto.ts diff --git a/apps/server/src/contexts/accounts/presentation/dto/accounts.schemas.ts b/apps/server/archive/contexts/accounts/presentation/dto/accounts.schemas.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/dto/accounts.schemas.ts rename to apps/server/archive/contexts/accounts/presentation/dto/accounts.schemas.ts diff --git a/apps/server/src/contexts/accounts/presentation/dto/index.ts b/apps/server/archive/contexts/accounts/presentation/dto/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/dto/index.ts rename to apps/server/archive/contexts/accounts/presentation/dto/index.ts diff --git a/apps/server/src/contexts/accounts/presentation/index.ts b/apps/server/archive/contexts/accounts/presentation/index.ts similarity index 100% rename from apps/server/src/contexts/accounts/presentation/index.ts rename to apps/server/archive/contexts/accounts/presentation/index.ts diff --git a/apps/server/src/contexts/auth/application/index.ts b/apps/server/archive/contexts/auth/application/index.ts similarity index 100% rename from apps/server/src/contexts/auth/application/index.ts rename to apps/server/archive/contexts/auth/application/index.ts diff --git a/apps/server/src/contexts/auth/application/list-users/index.ts b/apps/server/archive/contexts/auth/application/list-users/index.ts similarity index 100% rename from apps/server/src/contexts/auth/application/list-users/index.ts rename to apps/server/archive/contexts/auth/application/list-users/index.ts diff --git a/apps/server/src/contexts/auth/application/list-users/list-users.use-case.ts b/apps/server/archive/contexts/auth/application/list-users/list-users.use-case.ts similarity index 100% rename from apps/server/src/contexts/auth/application/list-users/list-users.use-case.ts rename to apps/server/archive/contexts/auth/application/list-users/list-users.use-case.ts diff --git a/apps/server/src/contexts/auth/application/login/index.ts b/apps/server/archive/contexts/auth/application/login/index.ts similarity index 100% rename from apps/server/src/contexts/auth/application/login/index.ts rename to apps/server/archive/contexts/auth/application/login/index.ts diff --git a/apps/server/src/contexts/auth/application/login/login.use-case.ts b/apps/server/archive/contexts/auth/application/login/login.use-case.ts similarity index 100% rename from apps/server/src/contexts/auth/application/login/login.use-case.ts rename to apps/server/archive/contexts/auth/application/login/login.use-case.ts diff --git a/apps/server/src/contexts/auth/application/logout/index.ts b/apps/server/archive/contexts/auth/application/logout/index.ts similarity index 100% rename from apps/server/src/contexts/auth/application/logout/index.ts rename to apps/server/archive/contexts/auth/application/logout/index.ts diff --git a/apps/server/src/contexts/auth/application/logout/logout.use-case.ts b/apps/server/archive/contexts/auth/application/logout/logout.use-case.ts similarity index 100% rename from apps/server/src/contexts/auth/application/logout/logout.use-case.ts rename to apps/server/archive/contexts/auth/application/logout/logout.use-case.ts diff --git a/apps/server/src/contexts/auth/application/refresh-token/index.ts b/apps/server/archive/contexts/auth/application/refresh-token/index.ts similarity index 100% rename from apps/server/src/contexts/auth/application/refresh-token/index.ts rename to apps/server/archive/contexts/auth/application/refresh-token/index.ts diff --git a/apps/server/src/contexts/auth/application/refresh-token/refresh-token.use-case.ts b/apps/server/archive/contexts/auth/application/refresh-token/refresh-token.use-case.ts similarity index 100% rename from apps/server/src/contexts/auth/application/refresh-token/refresh-token.use-case.ts rename to apps/server/archive/contexts/auth/application/refresh-token/refresh-token.use-case.ts diff --git a/apps/server/src/contexts/auth/application/register/index.ts b/apps/server/archive/contexts/auth/application/register/index.ts similarity index 100% rename from apps/server/src/contexts/auth/application/register/index.ts rename to apps/server/archive/contexts/auth/application/register/index.ts diff --git a/apps/server/src/contexts/auth/application/register/register.use-case.ts b/apps/server/archive/contexts/auth/application/register/register.use-case.ts similarity index 100% rename from apps/server/src/contexts/auth/application/register/register.use-case.ts rename to apps/server/archive/contexts/auth/application/register/register.use-case.ts diff --git a/apps/server/src/contexts/auth/domain/aggregates/authenticated-user.ts b/apps/server/archive/contexts/auth/domain/aggregates/authenticated-user.ts similarity index 96% rename from apps/server/src/contexts/auth/domain/aggregates/authenticated-user.ts rename to apps/server/archive/contexts/auth/domain/aggregates/authenticated-user.ts index ee1129f2..8de1b27e 100644 --- a/apps/server/src/contexts/auth/domain/aggregates/authenticated-user.ts +++ b/apps/server/archive/contexts/auth/domain/aggregates/authenticated-user.ts @@ -33,8 +33,8 @@ export class AuthenticatedUser extends AggregateRoot implements IAuthenticatedUser { - public accessToken: string = ""; - public refreshToken: string = ""; + public accessToken = ""; + public refreshToken = ""; static create(props: IAuthenticatedUserProps, id: UniqueID): Result { const user = new AuthenticatedUser(props, id); diff --git a/apps/server/src/contexts/auth/domain/aggregates/index.ts b/apps/server/archive/contexts/auth/domain/aggregates/index.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/aggregates/index.ts rename to apps/server/archive/contexts/auth/domain/aggregates/index.ts diff --git a/apps/server/src/contexts/auth/domain/aggregates/role.ts b/apps/server/archive/contexts/auth/domain/aggregates/role.ts similarity index 86% rename from apps/server/src/contexts/auth/domain/aggregates/role.ts rename to apps/server/archive/contexts/auth/domain/aggregates/role.ts index f12ea914..9d407d1c 100644 --- a/apps/server/src/contexts/auth/domain/aggregates/role.ts +++ b/apps/server/archive/contexts/auth/domain/aggregates/role.ts @@ -1,9 +1,9 @@ import { AggregateRoot, UniqueID } from "@/core/common/domain"; import { Result } from "@/core/common/helpers"; -export interface IRoleProps {} +export type IRoleProps = {}; -export interface IRole {} +export type IRole = {}; export class Role extends AggregateRoot implements IRole { static create(props: IRoleProps, id: UniqueID): Result { diff --git a/apps/server/src/contexts/auth/domain/aggregates/user-permission.ts b/apps/server/archive/contexts/auth/domain/aggregates/user-permission.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/aggregates/user-permission.ts rename to apps/server/archive/contexts/auth/domain/aggregates/user-permission.ts diff --git a/apps/server/src/contexts/auth/domain/aggregates/user.ts b/apps/server/archive/contexts/auth/domain/aggregates/user.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/aggregates/user.ts rename to apps/server/archive/contexts/auth/domain/aggregates/user.ts diff --git a/apps/server/src/contexts/auth/domain/entities/index.ts b/apps/server/archive/contexts/auth/domain/entities/index.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/entities/index.ts rename to apps/server/archive/contexts/auth/domain/entities/index.ts diff --git a/apps/server/src/contexts/auth/domain/entities/jwt-payload.ts b/apps/server/archive/contexts/auth/domain/entities/jwt-payload.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/entities/jwt-payload.ts rename to apps/server/archive/contexts/auth/domain/entities/jwt-payload.ts diff --git a/apps/server/src/contexts/auth/domain/entities/login-data.ts b/apps/server/archive/contexts/auth/domain/entities/login-data.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/entities/login-data.ts rename to apps/server/archive/contexts/auth/domain/entities/login-data.ts diff --git a/apps/server/src/contexts/auth/domain/entities/logout-data.ts b/apps/server/archive/contexts/auth/domain/entities/logout-data.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/entities/logout-data.ts rename to apps/server/archive/contexts/auth/domain/entities/logout-data.ts diff --git a/apps/server/src/contexts/auth/domain/entities/register-data.ts b/apps/server/archive/contexts/auth/domain/entities/register-data.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/entities/register-data.ts rename to apps/server/archive/contexts/auth/domain/entities/register-data.ts diff --git a/apps/server/src/contexts/auth/domain/entities/tab-context.ts b/apps/server/archive/contexts/auth/domain/entities/tab-context.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/entities/tab-context.ts rename to apps/server/archive/contexts/auth/domain/entities/tab-context.ts diff --git a/apps/server/src/contexts/auth/domain/events/index.ts b/apps/server/archive/contexts/auth/domain/events/index.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/events/index.ts rename to apps/server/archive/contexts/auth/domain/events/index.ts diff --git a/apps/server/src/contexts/auth/domain/events/user-authenticated.event.ts b/apps/server/archive/contexts/auth/domain/events/user-authenticated.event.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/events/user-authenticated.event.ts rename to apps/server/archive/contexts/auth/domain/events/user-authenticated.event.ts diff --git a/apps/server/src/contexts/auth/domain/index.ts b/apps/server/archive/contexts/auth/domain/index.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/index.ts rename to apps/server/archive/contexts/auth/domain/index.ts diff --git a/apps/server/src/contexts/auth/domain/repositories/authenticated-user-repository.interface.ts b/apps/server/archive/contexts/auth/domain/repositories/authenticated-user-repository.interface.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/repositories/authenticated-user-repository.interface.ts rename to apps/server/archive/contexts/auth/domain/repositories/authenticated-user-repository.interface.ts diff --git a/apps/server/src/contexts/auth/domain/repositories/index.ts b/apps/server/archive/contexts/auth/domain/repositories/index.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/repositories/index.ts rename to apps/server/archive/contexts/auth/domain/repositories/index.ts diff --git a/apps/server/src/contexts/auth/domain/repositories/tab-context-repository.interface.ts b/apps/server/archive/contexts/auth/domain/repositories/tab-context-repository.interface.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/repositories/tab-context-repository.interface.ts rename to apps/server/archive/contexts/auth/domain/repositories/tab-context-repository.interface.ts diff --git a/apps/server/archive/contexts/auth/domain/repositories/user-permission-repository.interface.ts b/apps/server/archive/contexts/auth/domain/repositories/user-permission-repository.interface.ts new file mode 100644 index 00000000..dcb36c54 --- /dev/null +++ b/apps/server/archive/contexts/auth/domain/repositories/user-permission-repository.interface.ts @@ -0,0 +1 @@ +export type IUserPermissionRepository = {} diff --git a/apps/server/src/contexts/auth/domain/repositories/user-repository.interface.ts b/apps/server/archive/contexts/auth/domain/repositories/user-repository.interface.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/repositories/user-repository.interface.ts rename to apps/server/archive/contexts/auth/domain/repositories/user-repository.interface.ts diff --git a/apps/server/src/contexts/auth/domain/services/auth-service.interface.ts b/apps/server/archive/contexts/auth/domain/services/auth-service.interface.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/services/auth-service.interface.ts rename to apps/server/archive/contexts/auth/domain/services/auth-service.interface.ts diff --git a/apps/server/src/contexts/auth/domain/services/auth.service.ts b/apps/server/archive/contexts/auth/domain/services/auth.service.ts similarity index 97% rename from apps/server/src/contexts/auth/domain/services/auth.service.ts rename to apps/server/archive/contexts/auth/domain/services/auth.service.ts index 75db06fc..86ac7005 100644 --- a/apps/server/src/contexts/auth/domain/services/auth.service.ts +++ b/apps/server/archive/contexts/auth/domain/services/auth.service.ts @@ -1,6 +1,13 @@ import { EmailAddress } from "@/core/common/domain"; import { Result } from "@/core/common/helpers"; -import { AuthenticatedUser, IJWTPayload, LoginData, RegisterData, TabContext, Token } from ".."; +import { + AuthenticatedUser, + type IJWTPayload, + type LoginData, + type RegisterData, + TabContext, + Token, +} from ".."; import { UniqueID } from "@/core/common/domain"; import { IAuthenticatedUserRepository, JWTPayload } from ".."; diff --git a/apps/server/src/contexts/auth/domain/services/index.ts b/apps/server/archive/contexts/auth/domain/services/index.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/services/index.ts rename to apps/server/archive/contexts/auth/domain/services/index.ts diff --git a/apps/server/src/contexts/auth/domain/services/tab-context-service.interface.ts b/apps/server/archive/contexts/auth/domain/services/tab-context-service.interface.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/services/tab-context-service.interface.ts rename to apps/server/archive/contexts/auth/domain/services/tab-context-service.interface.ts diff --git a/apps/server/src/contexts/auth/domain/services/tab-context.service.ts b/apps/server/archive/contexts/auth/domain/services/tab-context.service.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/services/tab-context.service.ts rename to apps/server/archive/contexts/auth/domain/services/tab-context.service.ts diff --git a/apps/server/src/contexts/auth/domain/services/user-service.interface.ts b/apps/server/archive/contexts/auth/domain/services/user-service.interface.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/services/user-service.interface.ts rename to apps/server/archive/contexts/auth/domain/services/user-service.interface.ts diff --git a/apps/server/src/contexts/auth/domain/services/user.service.ts b/apps/server/archive/contexts/auth/domain/services/user.service.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/services/user.service.ts rename to apps/server/archive/contexts/auth/domain/services/user.service.ts diff --git a/apps/server/src/contexts/auth/domain/value-objects/auth-user-roles.ts b/apps/server/archive/contexts/auth/domain/value-objects/auth-user-roles.ts similarity index 93% rename from apps/server/src/contexts/auth/domain/value-objects/auth-user-roles.ts rename to apps/server/archive/contexts/auth/domain/value-objects/auth-user-roles.ts index 8a3efe19..24fbf4c2 100644 --- a/apps/server/src/contexts/auth/domain/value-objects/auth-user-roles.ts +++ b/apps/server/archive/contexts/auth/domain/value-objects/auth-user-roles.ts @@ -28,4 +28,8 @@ export class UserRoles extends ValueObject { getValue() { return this.props.value; } + + toPrimitive() { + return this.props.value; + } } diff --git a/apps/server/src/contexts/auth/domain/value-objects/hash-password.spec.ts b/apps/server/archive/contexts/auth/domain/value-objects/hash-password.spec.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/value-objects/hash-password.spec.ts rename to apps/server/archive/contexts/auth/domain/value-objects/hash-password.spec.ts diff --git a/apps/server/src/contexts/auth/domain/value-objects/hash-password.ts b/apps/server/archive/contexts/auth/domain/value-objects/hash-password.ts similarity index 97% rename from apps/server/src/contexts/auth/domain/value-objects/hash-password.ts rename to apps/server/archive/contexts/auth/domain/value-objects/hash-password.ts index 0a1201cc..827723b1 100644 --- a/apps/server/src/contexts/auth/domain/value-objects/hash-password.ts +++ b/apps/server/archive/contexts/auth/domain/value-objects/hash-password.ts @@ -1,3 +1,4 @@ +import bcrypt from "bcrypt"; import { ValueObject } from "@/core/common/domain"; import { Result } from "@/core/common/helpers"; import { z } from "zod"; diff --git a/apps/server/src/contexts/auth/domain/value-objects/index.ts b/apps/server/archive/contexts/auth/domain/value-objects/index.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/value-objects/index.ts rename to apps/server/archive/contexts/auth/domain/value-objects/index.ts diff --git a/apps/server/src/contexts/auth/domain/value-objects/plain-password.ts b/apps/server/archive/contexts/auth/domain/value-objects/plain-password.ts similarity index 94% rename from apps/server/src/contexts/auth/domain/value-objects/plain-password.ts rename to apps/server/archive/contexts/auth/domain/value-objects/plain-password.ts index 7b51b2cd..f1913a93 100644 --- a/apps/server/src/contexts/auth/domain/value-objects/plain-password.ts +++ b/apps/server/archive/contexts/auth/domain/value-objects/plain-password.ts @@ -29,4 +29,9 @@ export class PlainPassword extends ValueObject { toString() { return this.props.value; } + + toPrimitive() { + return this.props.value; + + } } diff --git a/apps/server/src/contexts/auth/domain/value-objects/token.ts b/apps/server/archive/contexts/auth/domain/value-objects/token.ts similarity index 93% rename from apps/server/src/contexts/auth/domain/value-objects/token.ts rename to apps/server/archive/contexts/auth/domain/value-objects/token.ts index fe66ec76..ff193540 100644 --- a/apps/server/src/contexts/auth/domain/value-objects/token.ts +++ b/apps/server/archive/contexts/auth/domain/value-objects/token.ts @@ -29,4 +29,9 @@ export class Token extends ValueObject { toString() { return this.props.value; } + + toPrimitive() { + return this.props.value; + + } } diff --git a/apps/server/src/contexts/auth/domain/value-objects/username.ts b/apps/server/archive/contexts/auth/domain/value-objects/username.ts similarity index 100% rename from apps/server/src/contexts/auth/domain/value-objects/username.ts rename to apps/server/archive/contexts/auth/domain/value-objects/username.ts diff --git a/apps/server/src/contexts/auth/infraestructure/express/types.ts b/apps/server/archive/contexts/auth/infraestructure/express/types.ts similarity index 100% rename from apps/server/src/contexts/auth/infraestructure/express/types.ts rename to apps/server/archive/contexts/auth/infraestructure/express/types.ts diff --git a/apps/server/src/contexts/auth/infraestructure/index.ts b/apps/server/archive/contexts/auth/infraestructure/index.ts similarity index 100% rename from apps/server/src/contexts/auth/infraestructure/index.ts rename to apps/server/archive/contexts/auth/infraestructure/index.ts diff --git a/apps/server/src/contexts/auth/infraestructure/mappers/authenticated-user.mapper.ts b/apps/server/archive/contexts/auth/infraestructure/mappers/authenticated-user.mapper.ts similarity index 89% rename from apps/server/src/contexts/auth/infraestructure/mappers/authenticated-user.mapper.ts rename to apps/server/archive/contexts/auth/infraestructure/mappers/authenticated-user.mapper.ts index 38c80d70..4ab87ae2 100644 --- a/apps/server/src/contexts/auth/infraestructure/mappers/authenticated-user.mapper.ts +++ b/apps/server/archive/contexts/auth/infraestructure/mappers/authenticated-user.mapper.ts @@ -6,8 +6,8 @@ import { SequelizeMapper, UniqueID, } from "@/core"; -import { AuthenticatedUser, HashPassword, Username } from "../../domain"; -import { AuthUserCreationAttributes, AuthUserModel } from "../sequelize"; +import { AuthUserCreationAttributes, AuthUserModel } from '../sequelize'; +import { AuthenticatedUser, HashPassword, Username } from '../../domain'; export interface IAuthenticatedUserMapper extends ISequelizeMapper {} @@ -52,8 +52,8 @@ export class AuthenticatedUserMapper public mapToPersistence( source: AuthenticatedUser, params?: MapperParamsType - ): Result { - return Result.ok({ + ): AuthUserCreationAttributes { + return { id: source.id.toString(), username: source.username.toString(), email: source.email.toString(), @@ -61,7 +61,7 @@ export class AuthenticatedUserMapper roles: source.getRoles().map((role) => role.toString()), //access_token: source.accessToken, //refresh_token: source.refreshToken, - }); + }; } } diff --git a/apps/server/src/contexts/auth/infraestructure/mappers/index.ts b/apps/server/archive/contexts/auth/infraestructure/mappers/index.ts similarity index 100% rename from apps/server/src/contexts/auth/infraestructure/mappers/index.ts rename to apps/server/archive/contexts/auth/infraestructure/mappers/index.ts diff --git a/apps/server/src/contexts/auth/infraestructure/mappers/tab-context.mapper.ts b/apps/server/archive/contexts/auth/infraestructure/mappers/tab-context.mapper.ts similarity index 91% rename from apps/server/src/contexts/auth/infraestructure/mappers/tab-context.mapper.ts rename to apps/server/archive/contexts/auth/infraestructure/mappers/tab-context.mapper.ts index fef38413..8659f9ea 100644 --- a/apps/server/src/contexts/auth/infraestructure/mappers/tab-context.mapper.ts +++ b/apps/server/archive/contexts/auth/infraestructure/mappers/tab-context.mapper.ts @@ -1,6 +1,10 @@ import { UniqueID } from "@/core/common/domain"; import { Result } from "@/core/common/helpers"; -import { ISequelizeMapper, MapperParamsType, SequelizeMapper } from "@/core/common/infrastructure"; +import { + type ISequelizeMapper, + type MapperParamsType, + SequelizeMapper, +} from "@/core/common/infrastructure"; import { TabContext } from "../../domain"; import { TabContextCreationAttributes, TabContextModel } from "../sequelize"; @@ -49,12 +53,12 @@ export class TabContextMapper public mapToPersistence( source: TabContext, params?: MapperParamsType - ): Result { - return Result.ok({ + ): TabContextCreationAttributes { + return { id: source.id.toString(), tab_id: source.tabId.toString(), user_id: source.userId.toString(), - }); + }; } } diff --git a/apps/server/src/contexts/auth/infraestructure/mappers/user.mapper.ts b/apps/server/archive/contexts/auth/infraestructure/mappers/user.mapper.ts similarity index 89% rename from apps/server/src/contexts/auth/infraestructure/mappers/user.mapper.ts rename to apps/server/archive/contexts/auth/infraestructure/mappers/user.mapper.ts index 39060fa8..8ec3dee8 100644 --- a/apps/server/src/contexts/auth/infraestructure/mappers/user.mapper.ts +++ b/apps/server/archive/contexts/auth/infraestructure/mappers/user.mapper.ts @@ -1,8 +1,8 @@ import { EmailAddress, UniqueID } from "@/core/common/domain"; import { Result } from "@/core/common/helpers"; import { - ISequelizeMapper, - MapperParamsType, + type ISequelizeMapper, + type MapperParamsType, SequelizeMapper, } from "@/core/common/infrastructure/sequelize/sequelize-mapper"; import { User, Username } from "../../domain"; @@ -38,16 +38,13 @@ class UserMapper ); } - public mapToPersistence( - source: User, - params?: MapperParamsType - ): Result { - return Result.ok({ + public mapToPersistence(source: User, params?: MapperParamsType): UserCreationAttributes { + return { id: source.id.toString(), username: source.username.toString(), email: source.email.toString(), //roles: source.getRoles().map((role) => role.toString()), - }); + }; } } diff --git a/apps/server/src/contexts/auth/infraestructure/middleware/index.ts b/apps/server/archive/contexts/auth/infraestructure/middleware/index.ts similarity index 100% rename from apps/server/src/contexts/auth/infraestructure/middleware/index.ts rename to apps/server/archive/contexts/auth/infraestructure/middleware/index.ts diff --git a/apps/server/src/contexts/auth/infraestructure/middleware/passport-auth.middleware.ts b/apps/server/archive/contexts/auth/infraestructure/middleware/passport-auth.middleware.ts similarity index 100% rename from apps/server/src/contexts/auth/infraestructure/middleware/passport-auth.middleware.ts rename to apps/server/archive/contexts/auth/infraestructure/middleware/passport-auth.middleware.ts index e871ecd4..09859bdf 100644 --- a/apps/server/src/contexts/auth/infraestructure/middleware/passport-auth.middleware.ts +++ b/apps/server/archive/contexts/auth/infraestructure/middleware/passport-auth.middleware.ts @@ -1,8 +1,8 @@ import { UniqueID } from "@/core/common/domain"; import { ApiError, ExpressController } from "@/core/common/presentation"; -import { AuthenticatedUser } from "../../domain"; //import { authProvider } from "@/contexts/auth/infraestructure"; import { NextFunction, Response } from "express"; +import { AuthenticatedUser } from "../../domain"; import { AuthenticatedRequest } from "../express/types"; import { authProvider } from "../passport"; diff --git a/apps/server/src/contexts/auth/infraestructure/middleware/tab-context.middleware.ts b/apps/server/archive/contexts/auth/infraestructure/middleware/tab-context.middleware.ts similarity index 100% rename from apps/server/src/contexts/auth/infraestructure/middleware/tab-context.middleware.ts rename to apps/server/archive/contexts/auth/infraestructure/middleware/tab-context.middleware.ts diff --git a/apps/server/src/contexts/auth/infraestructure/passport/index.ts b/apps/server/archive/contexts/auth/infraestructure/passport/index.ts similarity index 66% rename from apps/server/src/contexts/auth/infraestructure/passport/index.ts rename to apps/server/archive/contexts/auth/infraestructure/passport/index.ts index 28cfdedd..b92534d5 100644 --- a/apps/server/src/contexts/auth/infraestructure/passport/index.ts +++ b/apps/server/archive/contexts/auth/infraestructure/passport/index.ts @@ -1,11 +1,17 @@ import { getDatabase } from "@/config"; import { SequelizeTransactionManager } from "@/core/common/infrastructure"; import { AuthService, TabContextService } from "../../domain/services"; -import { authenticatedUserRepository, tabContextRepository } from "../sequelize"; +import { authenticatedUserMapper, tabContextMapper } from "../mappers"; +import { AuthenticatedUserRepository, TabContextRepository } from "../sequelize"; import { PassportAuthProvider } from "./passport-auth-provider"; const database = getDatabase(); +const authenticatedUserRepository = new AuthenticatedUserRepository( + database, + authenticatedUserMapper +); +const tabContextRepository = new TabContextRepository(database, tabContextMapper); const transactionManager = new SequelizeTransactionManager(database); const authService = new AuthService(authenticatedUserRepository, tabContextRepository); const tabContextService = new TabContextService(tabContextRepository); diff --git a/apps/server/src/contexts/auth/infraestructure/passport/jwt.helper.ts b/apps/server/archive/contexts/auth/infraestructure/passport/jwt.helper.ts similarity index 100% rename from apps/server/src/contexts/auth/infraestructure/passport/jwt.helper.ts rename to apps/server/archive/contexts/auth/infraestructure/passport/jwt.helper.ts diff --git a/apps/server/src/contexts/auth/infraestructure/passport/passport-auth-provider.ts b/apps/server/archive/contexts/auth/infraestructure/passport/passport-auth-provider.ts similarity index 100% rename from apps/server/src/contexts/auth/infraestructure/passport/passport-auth-provider.ts rename to apps/server/archive/contexts/auth/infraestructure/passport/passport-auth-provider.ts diff --git a/apps/server/src/contexts/auth/infraestructure/sequelize/auth-user.model.ts b/apps/server/archive/contexts/auth/infraestructure/sequelize/auth-user.model.ts similarity index 100% rename from apps/server/src/contexts/auth/infraestructure/sequelize/auth-user.model.ts rename to apps/server/archive/contexts/auth/infraestructure/sequelize/auth-user.model.ts diff --git a/apps/server/src/contexts/auth/infraestructure/sequelize/authenticated-user.repository.ts b/apps/server/archive/contexts/auth/infraestructure/sequelize/authenticated-user.repository.ts similarity index 75% rename from apps/server/src/contexts/auth/infraestructure/sequelize/authenticated-user.repository.ts rename to apps/server/archive/contexts/auth/infraestructure/sequelize/authenticated-user.repository.ts index 19444e56..8c2d616c 100644 --- a/apps/server/src/contexts/auth/infraestructure/sequelize/authenticated-user.repository.ts +++ b/apps/server/archive/contexts/auth/infraestructure/sequelize/authenticated-user.repository.ts @@ -1,12 +1,12 @@ import { EmailAddress } from "@/core/common/domain"; import { Result } from "@/core/common/helpers"; import { SequelizeRepository } from "@/core/common/infrastructure"; -import { Transaction } from "sequelize"; +import { Sequelize, Transaction } from "sequelize"; import { AuthenticatedUser, IAuthenticatedUserRepository, Username } from "../../domain"; -import { authenticatedUserMapper, IAuthenticatedUserMapper } from "../mappers"; +import { IAuthenticatedUserMapper } from "../mappers"; import { AuthUserModel } from "./auth-user.model"; -class AuthenticatedUserRepository +export class AuthenticatedUserRepository extends SequelizeRepository implements IAuthenticatedUserRepository { @@ -23,8 +23,8 @@ class AuthenticatedUserRepository return null; } - constructor(mapper: IAuthenticatedUserMapper) { - super(); + constructor(database: Sequelize, mapper: IAuthenticatedUserMapper) { + super(database); this._mapper = mapper; } @@ -49,7 +49,7 @@ class AuthenticatedUserRepository ); return Result.ok(Boolean(userWithEmail || userWithUsername)); - } catch (error: any) { + } catch (error: unknown) { return this._handleDatabaseError(error, this._customErrorMapper); } } @@ -59,20 +59,14 @@ class AuthenticatedUserRepository transaction?: Transaction ): Promise> { try { - const rawUser: any = await this._getBy( - AuthUserModel, - "email", - email.toString(), - {}, - transaction - ); + const rawUser = await this._getBy(AuthUserModel, "email", email.toString(), {}, transaction); if (!rawUser === true) { return Result.fail(new Error("User with email not exists")); } return this._mapper.mapToDomain(rawUser); - } catch (error: any) { + } catch (error: unknown) { return this._handleDatabaseError(error, this._customErrorMapper); } } @@ -83,13 +77,10 @@ class AuthenticatedUserRepository ): Promise> { try { const persistenceData = this._mapper.mapToPersistence(user); - await AuthUserModel.create(persistenceData.data, { transaction }); + await AuthUserModel.create(persistenceData, { transaction }); return Result.ok(); - } catch (error: any) { + } catch (error: unknown) { return this._handleDatabaseError(error, this._customErrorMapper); } } } - -const authenticatedUserRepository = new AuthenticatedUserRepository(authenticatedUserMapper); -export { authenticatedUserRepository }; diff --git a/apps/server/archive/contexts/auth/infraestructure/sequelize/index.ts b/apps/server/archive/contexts/auth/infraestructure/sequelize/index.ts new file mode 100644 index 00000000..a1153680 --- /dev/null +++ b/apps/server/archive/contexts/auth/infraestructure/sequelize/index.ts @@ -0,0 +1,8 @@ +export * from "./auth-user.model"; +export * from "./authenticated-user.repository"; + +export * from "./tab-context.model"; +export * from "./tab-context.repository"; + +export * from "./user.model"; +export * from "./user.repository"; diff --git a/apps/server/src/contexts/auth/infraestructure/sequelize/tab-context.model.ts b/apps/server/archive/contexts/auth/infraestructure/sequelize/tab-context.model.ts similarity index 100% rename from apps/server/src/contexts/auth/infraestructure/sequelize/tab-context.model.ts rename to apps/server/archive/contexts/auth/infraestructure/sequelize/tab-context.model.ts diff --git a/apps/server/src/contexts/auth/infraestructure/sequelize/tab-context.repository.ts b/apps/server/archive/contexts/auth/infraestructure/sequelize/tab-context.repository.ts similarity index 78% rename from apps/server/src/contexts/auth/infraestructure/sequelize/tab-context.repository.ts rename to apps/server/archive/contexts/auth/infraestructure/sequelize/tab-context.repository.ts index 9df72afc..fc610f75 100644 --- a/apps/server/src/contexts/auth/infraestructure/sequelize/tab-context.repository.ts +++ b/apps/server/archive/contexts/auth/infraestructure/sequelize/tab-context.repository.ts @@ -1,12 +1,12 @@ import { UniqueID } from "@/core/common/domain"; import { Result } from "@/core/common/helpers"; import { SequelizeRepository } from "@/core/common/infrastructure"; -import { Op, Transaction } from "sequelize"; +import { Op, Sequelize, Transaction } from "sequelize"; import { ITabContextRepository, TabContext } from "../../domain/"; -import { ITabContextMapper, tabContextMapper } from "../mappers"; +import { ITabContextMapper } from "../mappers"; import { TabContextModel } from "./tab-context.model"; -class TabContextRepository +export class TabContextRepository extends SequelizeRepository implements ITabContextRepository { @@ -23,8 +23,8 @@ class TabContextRepository return null; } - constructor(mapper: ITabContextMapper) { - super(); + constructor(database: Sequelize, mapper: ITabContextMapper) { + super(database); this._mapper = mapper; } @@ -46,22 +46,20 @@ class TabContextRepository } return this._mapper.mapToDomain(rawContext); - } catch (error: any) { + } catch (error: unknown) { return this._handleDatabaseError(error, this._customErrorMapper); } } - async contextExistsByTabId(tabId: UniqueID, transaction?: any): Promise> { + async contextExistsByTabId( + tabId: UniqueID, + transaction?: Transaction + ): Promise> { try { - const result: any = await this._exists( - TabContextModel, - "tab_id", - tabId.toString(), - transaction - ); + const result = await this._exists(TabContextModel, "tab_id", tabId.toString(), transaction); return Result.ok(Boolean(result)); - } catch (error: any) { + } catch (error: unknown) { return this._handleDatabaseError(error, this._customErrorMapper); } } @@ -84,19 +82,19 @@ class TabContextRepository // Si existe el contexto de ese tabId, lo actualizo. if (await this._exists(TabContextModel, "tab_id", tabId.toString())) { - await TabContextModel.update(persistenceData.data, { + await TabContextModel.update(persistenceData, { where: { [Op.and]: [{ tab_id: tabId.toString() }, { user_id: userId.toString() }] }, transaction, }); } else { - await TabContextModel.create(persistenceData.data, { + await TabContextModel.create(persistenceData, { include: [{ all: true }], transaction, }); } return Result.ok(); - } catch (error: any) { + } catch (error: unknown) { return this._handleDatabaseError(error, this._customErrorMapper); } } @@ -120,11 +118,8 @@ class TabContextRepository transaction, }); return Result.ok(); - } catch (error: any) { + } catch (error: unknown) { return this._handleDatabaseError(error, this._customErrorMapper); } } } - -const tabContextRepository = new TabContextRepository(tabContextMapper); -export { tabContextRepository }; diff --git a/apps/server/src/contexts/auth/infraestructure/sequelize/user.model.ts b/apps/server/archive/contexts/auth/infraestructure/sequelize/user.model.ts similarity index 100% rename from apps/server/src/contexts/auth/infraestructure/sequelize/user.model.ts rename to apps/server/archive/contexts/auth/infraestructure/sequelize/user.model.ts diff --git a/apps/server/src/contexts/auth/infraestructure/sequelize/user.repository.ts b/apps/server/archive/contexts/auth/infraestructure/sequelize/user.repository.ts similarity index 72% rename from apps/server/src/contexts/auth/infraestructure/sequelize/user.repository.ts rename to apps/server/archive/contexts/auth/infraestructure/sequelize/user.repository.ts index 33f3d64b..9420ea08 100644 --- a/apps/server/src/contexts/auth/infraestructure/sequelize/user.repository.ts +++ b/apps/server/archive/contexts/auth/infraestructure/sequelize/user.repository.ts @@ -1,12 +1,12 @@ 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 { Sequelize, Transaction } from "sequelize"; import { IUserRepository, User } from "../../domain"; -import { IUserMapper, userMapper } from "../mappers"; +import { IUserMapper } from "../mappers"; import { UserModel } from "./user.model"; -class UserRepository extends SequelizeRepository implements IUserRepository { +export class UserRepository extends SequelizeRepository implements IUserRepository { private readonly _mapper!: IUserMapper; /** @@ -20,53 +20,50 @@ class UserRepository extends SequelizeRepository implements IUserRepositor return null; } - constructor(mapper: IUserMapper) { - super(); + constructor(database: Sequelize, mapper: IUserMapper) { + super(database); this._mapper = mapper; } async findAll(transaction?: Transaction): Promise, Error>> { try { - const rawUsers: any = await this._findAll(UserModel, {}, transaction); + const rawUsers = await this._findAll(UserModel, {}, transaction); if (!rawUsers === true) { return Result.fail(new Error("User with email not exists")); } return this._mapper.mapArrayToDomain(rawUsers); - } catch (error: any) { + } catch (error: unknown) { return this._handleDatabaseError(error, this._customErrorMapper); } } async findById(id: UniqueID, transaction?: Transaction): Promise> { try { - const rawUser: any = await this._getById(UserModel, id, {}, transaction); + const rawUser = await this._getById(UserModel, id, {}, transaction); if (!rawUser === true) { return Result.fail(new Error(`User with id ${id.toString()} not exists`)); } return this._mapper.mapToDomain(rawUser); - } catch (error: any) { + } catch (error: unknown) { return this._handleDatabaseError(error, this._customErrorMapper); } } async findByEmail(email: EmailAddress, transaction?: Transaction): Promise> { try { - const rawUser: any = await this._getBy(UserModel, "email", email.toString(), {}, transaction); + const rawUser = await this._getBy(UserModel, "email", email.toString(), {}, transaction); if (!rawUser === true) { return Result.fail(new Error(`User with email ${email.toString()} not exists`)); } return this._mapper.mapToDomain(rawUser); - } catch (error: any) { + } catch (error: unknown) { return this._handleDatabaseError(error, this._customErrorMapper); } } } - -const userRepository = new UserRepository(userMapper); -export { userRepository }; diff --git a/apps/server/src/contexts/auth/presentation/controllers/index.ts b/apps/server/archive/contexts/auth/presentation/controllers/index.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/index.ts rename to apps/server/archive/contexts/auth/presentation/controllers/index.ts diff --git a/apps/server/src/contexts/auth/presentation/controllers/listUsers/index.ts b/apps/server/archive/contexts/auth/presentation/controllers/listUsers/index.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/listUsers/index.ts rename to apps/server/archive/contexts/auth/presentation/controllers/listUsers/index.ts diff --git a/apps/server/src/contexts/auth/presentation/controllers/listUsers/list-users.controller.ts b/apps/server/archive/contexts/auth/presentation/controllers/listUsers/list-users.controller.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/listUsers/list-users.controller.ts rename to apps/server/archive/contexts/auth/presentation/controllers/listUsers/list-users.controller.ts diff --git a/apps/server/src/contexts/auth/presentation/controllers/listUsers/list-users.presenter.ts b/apps/server/archive/contexts/auth/presentation/controllers/listUsers/list-users.presenter.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/listUsers/list-users.presenter.ts rename to apps/server/archive/contexts/auth/presentation/controllers/listUsers/list-users.presenter.ts diff --git a/apps/server/src/contexts/auth/presentation/controllers/login/index.ts b/apps/server/archive/contexts/auth/presentation/controllers/login/index.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/login/index.ts rename to apps/server/archive/contexts/auth/presentation/controllers/login/index.ts diff --git a/apps/server/src/contexts/auth/presentation/controllers/login/login.controller.ts b/apps/server/archive/contexts/auth/presentation/controllers/login/login.controller.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/login/login.controller.ts rename to apps/server/archive/contexts/auth/presentation/controllers/login/login.controller.ts diff --git a/apps/server/src/contexts/auth/presentation/controllers/login/login.presenter.ts b/apps/server/archive/contexts/auth/presentation/controllers/login/login.presenter.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/login/login.presenter.ts rename to apps/server/archive/contexts/auth/presentation/controllers/login/login.presenter.ts diff --git a/apps/server/src/contexts/auth/presentation/controllers/logout/index.ts b/apps/server/archive/contexts/auth/presentation/controllers/logout/index.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/logout/index.ts rename to apps/server/archive/contexts/auth/presentation/controllers/logout/index.ts diff --git a/apps/server/src/contexts/auth/presentation/controllers/logout/logout.controller.ts b/apps/server/archive/contexts/auth/presentation/controllers/logout/logout.controller.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/logout/logout.controller.ts rename to apps/server/archive/contexts/auth/presentation/controllers/logout/logout.controller.ts diff --git a/apps/server/src/contexts/auth/presentation/controllers/refreshToken/index.ts b/apps/server/archive/contexts/auth/presentation/controllers/refreshToken/index.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/refreshToken/index.ts rename to apps/server/archive/contexts/auth/presentation/controllers/refreshToken/index.ts diff --git a/apps/server/src/contexts/auth/presentation/controllers/refreshToken/refresh-token.controller.ts b/apps/server/archive/contexts/auth/presentation/controllers/refreshToken/refresh-token.controller.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/refreshToken/refresh-token.controller.ts rename to apps/server/archive/contexts/auth/presentation/controllers/refreshToken/refresh-token.controller.ts diff --git a/apps/server/src/contexts/auth/presentation/controllers/refreshToken/refresh-token.presenter.ts b/apps/server/archive/contexts/auth/presentation/controllers/refreshToken/refresh-token.presenter.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/refreshToken/refresh-token.presenter.ts rename to apps/server/archive/contexts/auth/presentation/controllers/refreshToken/refresh-token.presenter.ts diff --git a/apps/server/src/contexts/auth/presentation/controllers/register/index.ts b/apps/server/archive/contexts/auth/presentation/controllers/register/index.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/register/index.ts rename to apps/server/archive/contexts/auth/presentation/controllers/register/index.ts diff --git a/apps/server/src/contexts/auth/presentation/controllers/register/register.controller.ts b/apps/server/archive/contexts/auth/presentation/controllers/register/register.controller.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/register/register.controller.ts rename to apps/server/archive/contexts/auth/presentation/controllers/register/register.controller.ts diff --git a/apps/server/src/contexts/auth/presentation/controllers/register/register.presenter.ts b/apps/server/archive/contexts/auth/presentation/controllers/register/register.presenter.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/controllers/register/register.presenter.ts rename to apps/server/archive/contexts/auth/presentation/controllers/register/register.presenter.ts diff --git a/apps/server/src/contexts/auth/presentation/dto/auth.request.dto.ts b/apps/server/archive/contexts/auth/presentation/dto/auth.request.dto.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/dto/auth.request.dto.ts rename to apps/server/archive/contexts/auth/presentation/dto/auth.request.dto.ts diff --git a/apps/server/src/contexts/auth/presentation/dto/auth.response.dto.ts b/apps/server/archive/contexts/auth/presentation/dto/auth.response.dto.ts similarity index 90% rename from apps/server/src/contexts/auth/presentation/dto/auth.response.dto.ts rename to apps/server/archive/contexts/auth/presentation/dto/auth.response.dto.ts index 6b4aeee3..28ff0dc0 100644 --- a/apps/server/src/contexts/auth/presentation/dto/auth.response.dto.ts +++ b/apps/server/archive/contexts/auth/presentation/dto/auth.response.dto.ts @@ -17,7 +17,7 @@ export interface ILoginUserResponseDTO { }; } -export interface ILogoutResponseDTO {} +export type ILogoutResponseDTO = {} export interface IRefreshTokenResponseDTO { refresh_token: string; diff --git a/apps/server/src/contexts/auth/presentation/dto/auth.validation.dto.ts b/apps/server/archive/contexts/auth/presentation/dto/auth.validation.dto.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/dto/auth.validation.dto.ts rename to apps/server/archive/contexts/auth/presentation/dto/auth.validation.dto.ts diff --git a/apps/server/src/contexts/auth/presentation/dto/index.ts b/apps/server/archive/contexts/auth/presentation/dto/index.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/dto/index.ts rename to apps/server/archive/contexts/auth/presentation/dto/index.ts diff --git a/apps/server/archive/contexts/auth/presentation/dto/user.request.dto.ts b/apps/server/archive/contexts/auth/presentation/dto/user.request.dto.ts new file mode 100644 index 00000000..c5e2a01e --- /dev/null +++ b/apps/server/archive/contexts/auth/presentation/dto/user.request.dto.ts @@ -0,0 +1 @@ +export type IListUsersRequestDTO = {} diff --git a/apps/server/src/contexts/auth/presentation/dto/user.response.dto.ts b/apps/server/archive/contexts/auth/presentation/dto/user.response.dto.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/dto/user.response.dto.ts rename to apps/server/archive/contexts/auth/presentation/dto/user.response.dto.ts diff --git a/apps/server/src/contexts/auth/presentation/dto/user.validation.dto.ts b/apps/server/archive/contexts/auth/presentation/dto/user.validation.dto.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/dto/user.validation.dto.ts rename to apps/server/archive/contexts/auth/presentation/dto/user.validation.dto.ts diff --git a/apps/server/src/contexts/auth/presentation/index.ts b/apps/server/archive/contexts/auth/presentation/index.ts similarity index 100% rename from apps/server/src/contexts/auth/presentation/index.ts rename to apps/server/archive/contexts/auth/presentation/index.ts diff --git a/apps/server/src/contexts/contacts/application/index.ts b/apps/server/archive/contexts/contacts/application/index.ts similarity index 100% rename from apps/server/src/contexts/contacts/application/index.ts rename to apps/server/archive/contexts/contacts/application/index.ts diff --git a/apps/server/src/contexts/contacts/application/list-contacts.use-case.ts b/apps/server/archive/contexts/contacts/application/list-contacts.use-case.ts similarity index 100% rename from apps/server/src/contexts/contacts/application/list-contacts.use-case.ts rename to apps/server/archive/contexts/contacts/application/list-contacts.use-case.ts diff --git a/apps/server/src/contexts/contacts/domain/aggregates/contact.ts b/apps/server/archive/contexts/contacts/domain/aggregates/contact.ts similarity index 96% rename from apps/server/src/contexts/contacts/domain/aggregates/contact.ts rename to apps/server/archive/contexts/contacts/domain/aggregates/contact.ts index 824ab26b..ac5b9e98 100644 --- a/apps/server/src/contexts/contacts/domain/aggregates/contact.ts +++ b/apps/server/archive/contexts/contacts/domain/aggregates/contact.ts @@ -1,9 +1,9 @@ import { AggregateRoot, - EmailAddress, - PhoneNumber, - PostalAddress, - TINNumber, + type EmailAddress, + type PhoneNumber, + type PostalAddress, + type TINNumber, UniqueID, } from "@/core/common/domain"; import { Maybe, Result } from "@/core/common/helpers"; diff --git a/apps/server/src/contexts/contacts/domain/aggregates/index.ts b/apps/server/archive/contexts/contacts/domain/aggregates/index.ts similarity index 100% rename from apps/server/src/contexts/contacts/domain/aggregates/index.ts rename to apps/server/archive/contexts/contacts/domain/aggregates/index.ts diff --git a/apps/server/src/contexts/contacts/domain/index.ts b/apps/server/archive/contexts/contacts/domain/index.ts similarity index 100% rename from apps/server/src/contexts/contacts/domain/index.ts rename to apps/server/archive/contexts/contacts/domain/index.ts diff --git a/apps/server/src/contexts/contacts/domain/repositories/contact-repository.interface.ts b/apps/server/archive/contexts/contacts/domain/repositories/contact-repository.interface.ts similarity index 100% rename from apps/server/src/contexts/contacts/domain/repositories/contact-repository.interface.ts rename to apps/server/archive/contexts/contacts/domain/repositories/contact-repository.interface.ts diff --git a/apps/server/src/contexts/contacts/domain/repositories/index.ts b/apps/server/archive/contexts/contacts/domain/repositories/index.ts similarity index 100% rename from apps/server/src/contexts/contacts/domain/repositories/index.ts rename to apps/server/archive/contexts/contacts/domain/repositories/index.ts diff --git a/apps/server/src/contexts/contacts/domain/services/contact-service.interface.ts b/apps/server/archive/contexts/contacts/domain/services/contact-service.interface.ts similarity index 100% rename from apps/server/src/contexts/contacts/domain/services/contact-service.interface.ts rename to apps/server/archive/contexts/contacts/domain/services/contact-service.interface.ts diff --git a/apps/server/src/contexts/contacts/domain/services/contact.service.ts b/apps/server/archive/contexts/contacts/domain/services/contact.service.ts similarity index 100% rename from apps/server/src/contexts/contacts/domain/services/contact.service.ts rename to apps/server/archive/contexts/contacts/domain/services/contact.service.ts diff --git a/apps/server/src/contexts/contacts/domain/services/index.ts b/apps/server/archive/contexts/contacts/domain/services/index.ts similarity index 100% rename from apps/server/src/contexts/contacts/domain/services/index.ts rename to apps/server/archive/contexts/contacts/domain/services/index.ts diff --git a/apps/server/src/contexts/contacts/infraestructure/index.ts b/apps/server/archive/contexts/contacts/infraestructure/index.ts similarity index 100% rename from apps/server/src/contexts/contacts/infraestructure/index.ts rename to apps/server/archive/contexts/contacts/infraestructure/index.ts diff --git a/apps/server/src/contexts/contacts/infraestructure/mappers/contact.mapper.ts b/apps/server/archive/contexts/contacts/infraestructure/mappers/contact.mapper.ts similarity index 98% rename from apps/server/src/contexts/contacts/infraestructure/mappers/contact.mapper.ts rename to apps/server/archive/contexts/contacts/infraestructure/mappers/contact.mapper.ts index 2fc9a5ec..2d2949a3 100644 --- a/apps/server/src/contexts/contacts/infraestructure/mappers/contact.mapper.ts +++ b/apps/server/archive/contexts/contacts/infraestructure/mappers/contact.mapper.ts @@ -7,8 +7,8 @@ import { } from "@/core/common/domain"; import { Maybe, Result } from "@/core/common/helpers"; import { - ISequelizeMapper, - MapperParamsType, + type ISequelizeMapper, + type MapperParamsType, SequelizeMapper, } from "@/core/common/infrastructure/sequelize/sequelize-mapper"; import { Contact } from "../../domain"; diff --git a/apps/server/src/contexts/contacts/infraestructure/mappers/index.ts b/apps/server/archive/contexts/contacts/infraestructure/mappers/index.ts similarity index 100% rename from apps/server/src/contexts/contacts/infraestructure/mappers/index.ts rename to apps/server/archive/contexts/contacts/infraestructure/mappers/index.ts diff --git a/apps/server/src/contexts/contacts/infraestructure/sequelize/contact.model.ts b/apps/server/archive/contexts/contacts/infraestructure/sequelize/contact.model.ts similarity index 100% rename from apps/server/src/contexts/contacts/infraestructure/sequelize/contact.model.ts rename to apps/server/archive/contexts/contacts/infraestructure/sequelize/contact.model.ts diff --git a/apps/server/src/contexts/contacts/infraestructure/sequelize/contact.repository.ts b/apps/server/archive/contexts/contacts/infraestructure/sequelize/contact.repository.ts similarity index 97% rename from apps/server/src/contexts/contacts/infraestructure/sequelize/contact.repository.ts rename to apps/server/archive/contexts/contacts/infraestructure/sequelize/contact.repository.ts index 8c03fb51..c45e7910 100644 --- a/apps/server/src/contexts/contacts/infraestructure/sequelize/contact.repository.ts +++ b/apps/server/archive/contexts/contacts/infraestructure/sequelize/contact.repository.ts @@ -3,7 +3,7 @@ import { Collection, Result } from "@/core/common/helpers"; import { SequelizeRepository } from "@/core/common/infrastructure"; import { Transaction } from "sequelize"; import { Contact, IContactRepository } from "../../domain"; -import { contactMapper, IContactMapper } from "../mappers"; +import { IContactMapper, contactMapper } from "../mappers"; import { ContactModel } from "./contact.model"; class ContactRepository extends SequelizeRepository implements IContactRepository { diff --git a/apps/server/src/contexts/contacts/infraestructure/sequelize/index.ts b/apps/server/archive/contexts/contacts/infraestructure/sequelize/index.ts similarity index 100% rename from apps/server/src/contexts/contacts/infraestructure/sequelize/index.ts rename to apps/server/archive/contexts/contacts/infraestructure/sequelize/index.ts diff --git a/apps/server/src/contexts/contacts/presentation/controllers/index.ts b/apps/server/archive/contexts/contacts/presentation/controllers/index.ts similarity index 100% rename from apps/server/src/contexts/contacts/presentation/controllers/index.ts rename to apps/server/archive/contexts/contacts/presentation/controllers/index.ts diff --git a/apps/server/src/contexts/contacts/presentation/controllers/list/index.ts b/apps/server/archive/contexts/contacts/presentation/controllers/list/index.ts similarity index 100% rename from apps/server/src/contexts/contacts/presentation/controllers/list/index.ts rename to apps/server/archive/contexts/contacts/presentation/controllers/list/index.ts diff --git a/apps/server/src/contexts/contacts/presentation/controllers/list/list-contacts.controller.ts b/apps/server/archive/contexts/contacts/presentation/controllers/list/list-contacts.controller.ts similarity index 100% rename from apps/server/src/contexts/contacts/presentation/controllers/list/list-contacts.controller.ts rename to apps/server/archive/contexts/contacts/presentation/controllers/list/list-contacts.controller.ts diff --git a/apps/server/src/contexts/contacts/presentation/controllers/list/list-contacts.presenter.ts b/apps/server/archive/contexts/contacts/presentation/controllers/list/list-contacts.presenter.ts similarity index 100% rename from apps/server/src/contexts/contacts/presentation/controllers/list/list-contacts.presenter.ts rename to apps/server/archive/contexts/contacts/presentation/controllers/list/list-contacts.presenter.ts diff --git a/apps/server/archive/contexts/contacts/presentation/dto/contacts.request.dto.ts b/apps/server/archive/contexts/contacts/presentation/dto/contacts.request.dto.ts new file mode 100644 index 00000000..7db50854 --- /dev/null +++ b/apps/server/archive/contexts/contacts/presentation/dto/contacts.request.dto.ts @@ -0,0 +1 @@ +export type IListContactsRequestDTO = {} diff --git a/apps/server/src/contexts/contacts/presentation/dto/contacts.response.dto.ts b/apps/server/archive/contexts/contacts/presentation/dto/contacts.response.dto.ts similarity index 100% rename from apps/server/src/contexts/contacts/presentation/dto/contacts.response.dto.ts rename to apps/server/archive/contexts/contacts/presentation/dto/contacts.response.dto.ts diff --git a/apps/server/src/contexts/contacts/presentation/dto/contacts.validation.dto.ts b/apps/server/archive/contexts/contacts/presentation/dto/contacts.validation.dto.ts similarity index 100% rename from apps/server/src/contexts/contacts/presentation/dto/contacts.validation.dto.ts rename to apps/server/archive/contexts/contacts/presentation/dto/contacts.validation.dto.ts diff --git a/apps/server/src/contexts/contacts/presentation/dto/index.ts b/apps/server/archive/contexts/contacts/presentation/dto/index.ts similarity index 100% rename from apps/server/src/contexts/contacts/presentation/dto/index.ts rename to apps/server/archive/contexts/contacts/presentation/dto/index.ts diff --git a/apps/server/src/contexts/contacts/presentation/index.ts b/apps/server/archive/contexts/contacts/presentation/index.ts similarity index 100% rename from apps/server/src/contexts/contacts/presentation/index.ts rename to apps/server/archive/contexts/contacts/presentation/index.ts diff --git a/apps/server/src/contexts/customer-billing/application/get-customer-invoice.use-case.ts b/apps/server/archive/contexts/customer-billing/application/get-customer-invoice.use-case.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/application/get-customer-invoice.use-case.ts rename to apps/server/archive/contexts/customer-billing/application/get-customer-invoice.use-case.ts diff --git a/apps/server/src/contexts/customer-billing/application/index.ts b/apps/server/archive/contexts/customer-billing/application/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/application/index.ts rename to apps/server/archive/contexts/customer-billing/application/index.ts diff --git a/apps/server/src/contexts/customer-billing/application/list-customer-invoices-use-case.ts b/apps/server/archive/contexts/customer-billing/application/list-customer-invoices-use-case.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/application/list-customer-invoices-use-case.ts rename to apps/server/archive/contexts/customer-billing/application/list-customer-invoices-use-case.ts diff --git a/apps/server/src/contexts/customer-billing/domain/aggregates/customer-invoice.ts b/apps/server/archive/contexts/customer-billing/domain/aggregates/customer-invoice.ts similarity index 99% rename from apps/server/src/contexts/customer-billing/domain/aggregates/customer-invoice.ts rename to apps/server/archive/contexts/customer-billing/domain/aggregates/customer-invoice.ts index fdbf15db..74969583 100644 --- a/apps/server/src/contexts/customer-billing/domain/aggregates/customer-invoice.ts +++ b/apps/server/archive/contexts/customer-billing/domain/aggregates/customer-invoice.ts @@ -33,6 +33,7 @@ export class CustomerInvoice extends AggregateRoot implements ICustomerInvoice { + id: UniqueID; static create(props: ICustomerInvoiceProps, id?: UniqueID): Result { const invoice = new CustomerInvoice(props, id); diff --git a/apps/server/src/contexts/customer-billing/domain/aggregates/index.ts b/apps/server/archive/contexts/customer-billing/domain/aggregates/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/domain/aggregates/index.ts rename to apps/server/archive/contexts/customer-billing/domain/aggregates/index.ts diff --git a/apps/server/src/contexts/customer-billing/domain/entities/customer-invoice-item.ts b/apps/server/archive/contexts/customer-billing/domain/entities/customer-invoice-item.ts similarity index 99% rename from apps/server/src/contexts/customer-billing/domain/entities/customer-invoice-item.ts rename to apps/server/archive/contexts/customer-billing/domain/entities/customer-invoice-item.ts index 38ebfaf8..bc06cc80 100644 --- a/apps/server/src/contexts/customer-billing/domain/entities/customer-invoice-item.ts +++ b/apps/server/archive/contexts/customer-billing/domain/entities/customer-invoice-item.ts @@ -19,7 +19,7 @@ export interface ICustomerInvoiceItem { discount: Maybe; totalPrice: Maybe; - isEmptyLine(): Boolean; + isEmptyLine(): boolean; } export class CustomerInvoiceItem diff --git a/apps/server/src/contexts/customer-billing/domain/entities/customer.ts b/apps/server/archive/contexts/customer-billing/domain/entities/customer.ts similarity index 98% rename from apps/server/src/contexts/customer-billing/domain/entities/customer.ts rename to apps/server/archive/contexts/customer-billing/domain/entities/customer.ts index 50a41423..430bbb5e 100644 --- a/apps/server/src/contexts/customer-billing/domain/entities/customer.ts +++ b/apps/server/archive/contexts/customer-billing/domain/entities/customer.ts @@ -16,6 +16,7 @@ export interface ICustomer { } export class Customer extends AggregateRoot implements ICustomer { + id: UniqueID; static create(props: ICustomerProps, id?: UniqueID): Result { const customer = new Customer(props, id); diff --git a/apps/server/src/contexts/customer-billing/domain/entities/index.ts b/apps/server/archive/contexts/customer-billing/domain/entities/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/domain/entities/index.ts rename to apps/server/archive/contexts/customer-billing/domain/entities/index.ts diff --git a/apps/server/src/contexts/customer-billing/domain/entities/tax-collection.ts b/apps/server/archive/contexts/customer-billing/domain/entities/tax-collection.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/domain/entities/tax-collection.ts rename to apps/server/archive/contexts/customer-billing/domain/entities/tax-collection.ts diff --git a/apps/server/src/contexts/customer-billing/domain/entities/tax.ts b/apps/server/archive/contexts/customer-billing/domain/entities/tax.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/domain/entities/tax.ts rename to apps/server/archive/contexts/customer-billing/domain/entities/tax.ts diff --git a/apps/server/src/contexts/customer-billing/domain/index.ts b/apps/server/archive/contexts/customer-billing/domain/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/domain/index.ts rename to apps/server/archive/contexts/customer-billing/domain/index.ts diff --git a/apps/server/src/contexts/customer-billing/domain/repositories/customer-invoice-repository.interface.ts b/apps/server/archive/contexts/customer-billing/domain/repositories/customer-invoice-repository.interface.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/domain/repositories/customer-invoice-repository.interface.ts rename to apps/server/archive/contexts/customer-billing/domain/repositories/customer-invoice-repository.interface.ts diff --git a/apps/server/src/contexts/customer-billing/domain/repositories/index.ts b/apps/server/archive/contexts/customer-billing/domain/repositories/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/domain/repositories/index.ts rename to apps/server/archive/contexts/customer-billing/domain/repositories/index.ts diff --git a/apps/server/src/contexts/customer-billing/domain/services/customer-invoice-service.interface.ts b/apps/server/archive/contexts/customer-billing/domain/services/customer-invoice-service.interface.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/domain/services/customer-invoice-service.interface.ts rename to apps/server/archive/contexts/customer-billing/domain/services/customer-invoice-service.interface.ts diff --git a/apps/server/src/contexts/customer-billing/domain/services/customer-invoice.service.ts b/apps/server/archive/contexts/customer-billing/domain/services/customer-invoice.service.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/domain/services/customer-invoice.service.ts rename to apps/server/archive/contexts/customer-billing/domain/services/customer-invoice.service.ts diff --git a/apps/server/src/contexts/customer-billing/domain/services/index.ts b/apps/server/archive/contexts/customer-billing/domain/services/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/domain/services/index.ts rename to apps/server/archive/contexts/customer-billing/domain/services/index.ts diff --git a/apps/server/src/contexts/customer-billing/domain/value-objetcs/index.ts b/apps/server/archive/contexts/customer-billing/domain/value-objetcs/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/domain/value-objetcs/index.ts rename to apps/server/archive/contexts/customer-billing/domain/value-objetcs/index.ts diff --git a/apps/server/src/contexts/customer-billing/domain/value-objetcs/invoice-status.spec.ts b/apps/server/archive/contexts/customer-billing/domain/value-objetcs/invoice-status.spec.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/domain/value-objetcs/invoice-status.spec.ts rename to apps/server/archive/contexts/customer-billing/domain/value-objetcs/invoice-status.spec.ts diff --git a/apps/server/src/contexts/customer-billing/domain/value-objetcs/invoice-status.ts b/apps/server/archive/contexts/customer-billing/domain/value-objetcs/invoice-status.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/domain/value-objetcs/invoice-status.ts rename to apps/server/archive/contexts/customer-billing/domain/value-objetcs/invoice-status.ts diff --git a/apps/server/src/contexts/customer-billing/infraestructure/index.ts b/apps/server/archive/contexts/customer-billing/infraestructure/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/infraestructure/index.ts rename to apps/server/archive/contexts/customer-billing/infraestructure/index.ts diff --git a/apps/server/src/contexts/customer-billing/infraestructure/mappers/customer-invoice.mapper.ts b/apps/server/archive/contexts/customer-billing/infraestructure/mappers/customer-invoice.mapper.ts similarity index 98% rename from apps/server/src/contexts/customer-billing/infraestructure/mappers/customer-invoice.mapper.ts rename to apps/server/archive/contexts/customer-billing/infraestructure/mappers/customer-invoice.mapper.ts index ae247959..49119e06 100644 --- a/apps/server/src/contexts/customer-billing/infraestructure/mappers/customer-invoice.mapper.ts +++ b/apps/server/archive/contexts/customer-billing/infraestructure/mappers/customer-invoice.mapper.ts @@ -3,8 +3,8 @@ import { InvoiceStatus } from "@/contexts/customer-billing/domain/value-objetcs" import { PostalAddress, TINNumber, UniqueID, UtcDate } from "@/core/common/domain"; import { Maybe, Result } from "@/core/common/helpers"; import { - ISequelizeMapper, - MapperParamsType, + type ISequelizeMapper, + type MapperParamsType, SequelizeMapper, } from "@/core/common/infrastructure/sequelize/sequelize-mapper"; import { diff --git a/apps/server/src/contexts/customer-billing/infraestructure/mappers/index.ts b/apps/server/archive/contexts/customer-billing/infraestructure/mappers/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/infraestructure/mappers/index.ts rename to apps/server/archive/contexts/customer-billing/infraestructure/mappers/index.ts diff --git a/apps/server/src/contexts/customer-billing/infraestructure/sequelize/customer-invoice-item.model.ts b/apps/server/archive/contexts/customer-billing/infraestructure/sequelize/customer-invoice-item.model.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/infraestructure/sequelize/customer-invoice-item.model.ts rename to apps/server/archive/contexts/customer-billing/infraestructure/sequelize/customer-invoice-item.model.ts diff --git a/apps/server/src/contexts/customer-billing/infraestructure/sequelize/customer-invoice.model.ts b/apps/server/archive/contexts/customer-billing/infraestructure/sequelize/customer-invoice.model.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/infraestructure/sequelize/customer-invoice.model.ts rename to apps/server/archive/contexts/customer-billing/infraestructure/sequelize/customer-invoice.model.ts diff --git a/apps/server/src/contexts/customer-billing/infraestructure/sequelize/customer-invoice.repository.ts b/apps/server/archive/contexts/customer-billing/infraestructure/sequelize/customer-invoice.repository.ts similarity index 95% rename from apps/server/src/contexts/customer-billing/infraestructure/sequelize/customer-invoice.repository.ts rename to apps/server/archive/contexts/customer-billing/infraestructure/sequelize/customer-invoice.repository.ts index 783f6dca..ad7c54dd 100644 --- a/apps/server/src/contexts/customer-billing/infraestructure/sequelize/customer-invoice.repository.ts +++ b/apps/server/archive/contexts/customer-billing/infraestructure/sequelize/customer-invoice.repository.ts @@ -3,7 +3,10 @@ import { UniqueID } from "@/core/common/domain"; import { Collection, Result } from "@/core/common/helpers"; import { SequelizeRepository } from "@/core/common/infrastructure"; import { Transaction } from "sequelize"; -import { customerInvoiceMapper, ICustomerInvoiceMapper } from "../mappers/customer-invoice.mapper"; +import { + type ICustomerInvoiceMapper, + customerInvoiceMapper, +} from "../mappers/customer-invoice.mapper"; import { CustomerInvoiceModel } from "./customer-invoice.model"; class CustomerInvoiceRepository diff --git a/apps/server/src/contexts/customer-billing/infraestructure/sequelize/customer.model.ts b/apps/server/archive/contexts/customer-billing/infraestructure/sequelize/customer.model.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/infraestructure/sequelize/customer.model.ts rename to apps/server/archive/contexts/customer-billing/infraestructure/sequelize/customer.model.ts diff --git a/apps/server/src/contexts/customer-billing/infraestructure/sequelize/index.ts b/apps/server/archive/contexts/customer-billing/infraestructure/sequelize/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/infraestructure/sequelize/index.ts rename to apps/server/archive/contexts/customer-billing/infraestructure/sequelize/index.ts diff --git a/apps/server/src/contexts/customer-billing/presentation/controllers/customer-invoices/get/get-customer-invoice.controller.ts b/apps/server/archive/contexts/customer-billing/presentation/controllers/customer-invoices/get/get-customer-invoice.controller.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/presentation/controllers/customer-invoices/get/get-customer-invoice.controller.ts rename to apps/server/archive/contexts/customer-billing/presentation/controllers/customer-invoices/get/get-customer-invoice.controller.ts diff --git a/apps/server/src/contexts/customer-billing/presentation/controllers/customer-invoices/get/get-customer-invoice.presenter.ts b/apps/server/archive/contexts/customer-billing/presentation/controllers/customer-invoices/get/get-customer-invoice.presenter.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/presentation/controllers/customer-invoices/get/get-customer-invoice.presenter.ts rename to apps/server/archive/contexts/customer-billing/presentation/controllers/customer-invoices/get/get-customer-invoice.presenter.ts diff --git a/apps/server/src/contexts/customer-billing/presentation/controllers/customer-invoices/get/index.ts b/apps/server/archive/contexts/customer-billing/presentation/controllers/customer-invoices/get/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/presentation/controllers/customer-invoices/get/index.ts rename to apps/server/archive/contexts/customer-billing/presentation/controllers/customer-invoices/get/index.ts diff --git a/apps/server/src/contexts/customer-billing/presentation/controllers/customer-invoices/index.ts b/apps/server/archive/contexts/customer-billing/presentation/controllers/customer-invoices/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/presentation/controllers/customer-invoices/index.ts rename to apps/server/archive/contexts/customer-billing/presentation/controllers/customer-invoices/index.ts diff --git a/apps/server/src/contexts/customer-billing/presentation/controllers/customer-invoices/list/index.ts b/apps/server/archive/contexts/customer-billing/presentation/controllers/customer-invoices/list/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/presentation/controllers/customer-invoices/list/index.ts rename to apps/server/archive/contexts/customer-billing/presentation/controllers/customer-invoices/list/index.ts diff --git a/apps/server/src/contexts/customer-billing/presentation/controllers/customer-invoices/list/list-customer-invoices.controller.ts b/apps/server/archive/contexts/customer-billing/presentation/controllers/customer-invoices/list/list-customer-invoices.controller.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/presentation/controllers/customer-invoices/list/list-customer-invoices.controller.ts rename to apps/server/archive/contexts/customer-billing/presentation/controllers/customer-invoices/list/list-customer-invoices.controller.ts diff --git a/apps/server/src/contexts/customer-billing/presentation/controllers/customer-invoices/list/list-customer-invoices.presenter.ts b/apps/server/archive/contexts/customer-billing/presentation/controllers/customer-invoices/list/list-customer-invoices.presenter.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/presentation/controllers/customer-invoices/list/list-customer-invoices.presenter.ts rename to apps/server/archive/contexts/customer-billing/presentation/controllers/customer-invoices/list/list-customer-invoices.presenter.ts diff --git a/apps/server/src/contexts/customer-billing/presentation/controllers/index.ts b/apps/server/archive/contexts/customer-billing/presentation/controllers/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/presentation/controllers/index.ts rename to apps/server/archive/contexts/customer-billing/presentation/controllers/index.ts diff --git a/apps/server/archive/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.request.dto.ts b/apps/server/archive/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.request.dto.ts new file mode 100644 index 00000000..632527e2 --- /dev/null +++ b/apps/server/archive/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.request.dto.ts @@ -0,0 +1 @@ +export type IListCustomerInvoicesRequestDTO = {} diff --git a/apps/server/src/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.response.dto.ts b/apps/server/archive/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.response.dto.ts similarity index 89% rename from apps/server/src/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.response.dto.ts rename to apps/server/archive/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.response.dto.ts index 53d54391..784aa0e8 100644 --- a/apps/server/src/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.response.dto.ts +++ b/apps/server/archive/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.response.dto.ts @@ -26,4 +26,4 @@ export interface IListCustomerInvoicesResponseDTO { currency_code: string;*/ } -export interface IGetCustomerInvoiceResponseDTO {} +export type IGetCustomerInvoiceResponseDTO = {} diff --git a/apps/server/src/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.validation.dto.ts b/apps/server/archive/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.validation.dto.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.validation.dto.ts rename to apps/server/archive/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.validation.dto.ts diff --git a/apps/server/src/contexts/customer-billing/presentation/dto/customer-invoices/index.ts b/apps/server/archive/contexts/customer-billing/presentation/dto/customer-invoices/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/presentation/dto/customer-invoices/index.ts rename to apps/server/archive/contexts/customer-billing/presentation/dto/customer-invoices/index.ts diff --git a/apps/server/archive/contexts/customer-billing/presentation/dto/customers.request.dto.ts b/apps/server/archive/contexts/customer-billing/presentation/dto/customers.request.dto.ts new file mode 100644 index 00000000..89fe10bc --- /dev/null +++ b/apps/server/archive/contexts/customer-billing/presentation/dto/customers.request.dto.ts @@ -0,0 +1 @@ +export type IListCustomersRequestDTO = {} diff --git a/apps/server/src/contexts/customer-billing/presentation/dto/customers.response.dto.ts b/apps/server/archive/contexts/customer-billing/presentation/dto/customers.response.dto.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/presentation/dto/customers.response.dto.ts rename to apps/server/archive/contexts/customer-billing/presentation/dto/customers.response.dto.ts diff --git a/apps/server/src/contexts/customer-billing/presentation/dto/customers.validation.dto.ts b/apps/server/archive/contexts/customer-billing/presentation/dto/customers.validation.dto.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/presentation/dto/customers.validation.dto.ts rename to apps/server/archive/contexts/customer-billing/presentation/dto/customers.validation.dto.ts diff --git a/apps/server/src/contexts/customer-billing/presentation/dto/index.ts b/apps/server/archive/contexts/customer-billing/presentation/dto/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/presentation/dto/index.ts rename to apps/server/archive/contexts/customer-billing/presentation/dto/index.ts diff --git a/apps/server/src/contexts/customer-billing/presentation/index.ts b/apps/server/archive/contexts/customer-billing/presentation/index.ts similarity index 100% rename from apps/server/src/contexts/customer-billing/presentation/index.ts rename to apps/server/archive/contexts/customer-billing/presentation/index.ts diff --git a/apps/server/jest.config.js b/apps/server/jest.config.js deleted file mode 100644 index f5d30d13..00000000 --- a/apps/server/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -/** @type {import('ts-jest').JestConfigWithTsJest} **/ -module.exports = { - testEnvironment: "node", - transform: { - "^.+.tsx?$": ["ts-jest",{}], - }, -}; \ No newline at end of file diff --git a/apps/server/package.json b/apps/server/package.json index bdef389f..ba7408cf 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -2,22 +2,22 @@ "name": "server", "version": "1.0.0", "description": "", - "main": "index.js", + "main": "index.ts", "scripts": { - "dev:nodebug": "ts-node-dev -r tsconfig-paths/register ./src/index.ts", - "dev": "ts-node-dev --rs --transpile-only --respawn --inspect=9229 -r tsconfig-paths/register ./src/index.ts", + "build": "tsc && tsup", + "start:dev": "node --import=tsx --watch src/index.ts", + "start:prod": "node dist/index.js", "clean": "rm -rf dist", "typecheck": "tsc --noEmit", - "build": "npm run clean && npm run typecheck && esbuild src/index.ts --platform=node --format=cjs --bundle --sourcemap --minify --outdir=dist", - "start": "node dist/index.js", "test": "jest --config=./jest.config.ts --verbose", - "lint": "eslint src --ext .ts" + "lint": "biome lint --fix", + "format": "biome format --write" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { - "@repo/eslint-config": "workspace:*", + "@biomejs/biome": "1.9.4", "@repo/typescript-config": "workspace:*", "@types/bcrypt": "^5.0.2", "@types/dinero.js": "^1.9.4", @@ -32,14 +32,12 @@ "@types/passport-jwt": "^4.0.1", "@types/passport-local": "^1.0.38", "@types/response-time": "^2.3.8", - "@typescript-eslint/eslint-plugin": "^8.22.0", - "@typescript-eslint/parser": "^8.22.0", "jest": "^29.7.0", - "nodemon": "^3.1.9", "ts-jest": "^29.2.5", - "ts-node-dev": "^2.0.0", "tsconfig-paths": "^4.2.0", - "typescript": "^5.7.3" + "tsup": "8.4.0", + "tsx": "4.19.4", + "typescript": "^5.8.3" }, "dependencies": { "bcrypt": "^5.1.1", @@ -75,8 +73,20 @@ "engines": { "node": ">=22" }, - "_moduleAliases": { - "@common": "./src/common", - "@config": "./src/config" + "tsup": { + "entry": [ + "src/index.ts" + ], + "outDir": "dist", + "format": [ + "esm", + "cjs" + ], + "target": "es2020", + "sourcemap": true, + "clean": true, + "dts": true, + "splitting": false, + "skipNodeModulesBundle": true } } diff --git a/apps/server/src/app.ts b/apps/server/src/app.ts index 59477e1e..ef6ed90a 100644 --- a/apps/server/src/app.ts +++ b/apps/server/src/app.ts @@ -3,7 +3,6 @@ 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"; @@ -38,7 +37,7 @@ export function createApp(): Application { // Inicializar Auth Provider app.use((req, res, next) => { - authProvider.initialize(); + //authProvider.initialize(); next(); }); diff --git a/apps/server/src/config/database.ts b/apps/server/src/config/database.ts index e448ee4b..981b3754 100644 --- a/apps/server/src/config/database.ts +++ b/apps/server/src/config/database.ts @@ -19,7 +19,7 @@ export function getDatabase(): Sequelize { { host: process.env.DB_HOST as string, dialect: "mysql", - port: parseInt(process.env.DB_PORT || "3306", 10), + port: Number.parseInt(process.env.DB_PORT || "3306", 10), dialectOptions: { multipleStatements: true, dateStrings: true, diff --git a/apps/server/src/config/register-models.ts b/apps/server/src/config/register-models.ts index 95bd5a44..fc784419 100644 --- a/apps/server/src/config/register-models.ts +++ b/apps/server/src/config/register-models.ts @@ -1,6 +1,6 @@ +import * as path from "path"; import { logger } from "@/core/common/infrastructure/logger"; import * as glob from "glob"; -import * as path from "path"; import { DataTypes, Sequelize } from "sequelize"; /** @@ -31,8 +31,8 @@ export const registerModels = async (database: Sequelize) => { logger.info(`🔎 Searching models in: ${cwd}`); // Buscamos los ficheros que terminen en .model.js o .model.ts - glob.sync("**/*.model.{js,ts}", globOptions).forEach((file) => { - //logger.info(`📄 File >> ${file}...`); + for (const file of glob.sync("**/*.model.{js,ts}", globOptions)) { + logger.info({ message: `📄 File >> ${file}...`, label: "registerModels" }); const modelFile = require(path.resolve(cwd, file)); const modelDef = modelFile.default; const model = typeof modelDef === "function" ? modelDef(database, DataTypes) : false; @@ -44,20 +44,20 @@ export const registerModels = async (database: Sequelize) => { label: "registerModels", }); } else { - logger.info({ message: `🚫 No model`, label: "registerModels" }); + logger.info({ message: "🚫 No model", label: "registerModels" }); } - }); + } } catch (error) { logger.error("❌ Error registering models:", error); process.exit(1); } // Configurar asociaciones - Object.values(models).forEach((model) => { + for (const model of Object.values(models)) { if (typeof model.associate === "function") { model.associate(database); } - }); + } try { // Sincronizamos DB en modo desarrollo diff --git a/apps/server/src/contexts/auth/domain/repositories/user-permission-repository.interface.ts b/apps/server/src/contexts/auth/domain/repositories/user-permission-repository.interface.ts deleted file mode 100644 index b64bffb8..00000000 --- a/apps/server/src/contexts/auth/domain/repositories/user-permission-repository.interface.ts +++ /dev/null @@ -1 +0,0 @@ -export interface IUserPermissionRepository {} diff --git a/apps/server/src/contexts/auth/infraestructure/sequelize/index.ts b/apps/server/src/contexts/auth/infraestructure/sequelize/index.ts deleted file mode 100644 index 0fc90355..00000000 --- a/apps/server/src/contexts/auth/infraestructure/sequelize/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { IAuthenticatedUserRepository, ITabContextRepository, IUserRepository } from "../../domain"; -import { authenticatedUserRepository } from "./authenticated-user.repository"; -import { tabContextRepository } from "./tab-context.repository"; -import { userRepository } from "./user.repository"; - -export * from "./auth-user.model"; -export * from "./authenticated-user.repository"; - -export * from "./tab-context.model"; -export * from "./tab-context.repository"; - -export * from "./user.model"; -export * from "./user.repository"; - -export const createAuthenticatedUserRepository = (): IAuthenticatedUserRepository => { - return authenticatedUserRepository; -}; - -export const createTabContextRepository = (): ITabContextRepository => { - return tabContextRepository; -}; - -export const createUserRepository = (): IUserRepository => { - return userRepository; -}; diff --git a/apps/server/src/contexts/auth/presentation/dto/user.request.dto.ts b/apps/server/src/contexts/auth/presentation/dto/user.request.dto.ts deleted file mode 100644 index bcb6ea3c..00000000 --- a/apps/server/src/contexts/auth/presentation/dto/user.request.dto.ts +++ /dev/null @@ -1 +0,0 @@ -export interface IListUsersRequestDTO {} diff --git a/apps/server/src/contexts/contacts/presentation/dto/contacts.request.dto.ts b/apps/server/src/contexts/contacts/presentation/dto/contacts.request.dto.ts deleted file mode 100644 index 8fcb5080..00000000 --- a/apps/server/src/contexts/contacts/presentation/dto/contacts.request.dto.ts +++ /dev/null @@ -1 +0,0 @@ -export interface IListContactsRequestDTO {} diff --git a/apps/server/src/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.request.dto.ts b/apps/server/src/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.request.dto.ts deleted file mode 100644 index a5c9a563..00000000 --- a/apps/server/src/contexts/customer-billing/presentation/dto/customer-invoices/customer-invoices.request.dto.ts +++ /dev/null @@ -1 +0,0 @@ -export interface IListCustomerInvoicesRequestDTO {} diff --git a/apps/server/src/contexts/customer-billing/presentation/dto/customers.request.dto.ts b/apps/server/src/contexts/customer-billing/presentation/dto/customers.request.dto.ts deleted file mode 100644 index 06640216..00000000 --- a/apps/server/src/contexts/customer-billing/presentation/dto/customers.request.dto.ts +++ /dev/null @@ -1 +0,0 @@ -export interface IListCustomersRequestDTO {} diff --git a/apps/server/src/contexts/invoices/application/create-invoice.use-case.ts b/apps/server/src/contexts/invoices/application/create-invoice.use-case.ts index d4cd8310..c422034c 100644 --- a/apps/server/src/contexts/invoices/application/create-invoice.use-case.ts +++ b/apps/server/src/contexts/invoices/application/create-invoice.use-case.ts @@ -1,9 +1,9 @@ import { UniqueID, UtcDate } from "@/core/common/domain"; import { - IInvoiceProps, - IInvoiceService, - Invoice, + type IInvoiceProps, + type IInvoiceService, + type Invoice, InvoiceNumber, InvoiceSerie, InvoiceStatus, @@ -66,7 +66,7 @@ export class CreateInvoiceUseCase { invoiceSeries: invoiceSeriesOrError.data, issueDate: issueDateOrError.data, operationDate: operationDateOrError.data, - invoiceCurrency: dto.currency_code, + invoiceCurrency: dto.currency, }; /*if (errors.length > 0) { diff --git a/apps/server/src/contexts/invoices/application/delete-invoice.use-case.ts b/apps/server/src/contexts/invoices/application/delete-invoice.use-case.ts index 22ea2bc9..dc98f726 100644 --- a/apps/server/src/contexts/invoices/application/delete-invoice.use-case.ts +++ b/apps/server/src/contexts/invoices/application/delete-invoice.use-case.ts @@ -2,7 +2,7 @@ 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"; -import { IInvoiceService, Invoice } from "../domain"; +import { IInvoiceService } from "../domain"; export class DeleteInvoiceUseCase { constructor( @@ -10,7 +10,7 @@ export class DeleteInvoiceUseCase { private readonly transactionManager: ITransactionManager ) {} - public execute(invoiceID: UniqueID): Promise> { + public execute(invoiceID: UniqueID): Promise> { return this.transactionManager.complete(async (transaction) => { try { return await this.invoiceService.deleteInvoiceById(invoiceID, transaction); diff --git a/apps/server/src/contexts/invoices/application/index.ts b/apps/server/src/contexts/invoices/application/index.ts index 83e308e7..030c0c5a 100644 --- a/apps/server/src/contexts/invoices/application/index.ts +++ b/apps/server/src/contexts/invoices/application/index.ts @@ -1,5 +1,5 @@ -export * from "./create-invoice.use-case"; -export * from "./delete-invoice.use-case"; +//export * from "./create-invoice.use-case"; +//export * from "./delete-invoice.use-case"; export * from "./get-invoice.use-case"; export * from "./list-invoices.use-case"; -export * from "./update-invoice.use-case"; +//export * from "./update-invoice.use-case"; diff --git a/apps/server/src/contexts/invoices/application/services/index.ts b/apps/server/src/contexts/invoices/application/services/index.ts index b79a7a12..4510ef9a 100644 --- a/apps/server/src/contexts/invoices/application/services/index.ts +++ b/apps/server/src/contexts/invoices/application/services/index.ts @@ -1,2 +1,2 @@ -export * from "./participantAddressFinder"; -export * from "./participantFinder"; +//export * from "./participantAddressFinder"; +//export * from "./participantFinder"; diff --git a/apps/server/src/contexts/invoices/application/services/participantAddressFinder.ts b/apps/server/src/contexts/invoices/application/services/participantAddressFinder.ts index 7a85cfaf..1f81875b 100644 --- a/apps/server/src/contexts/invoices/application/services/participantAddressFinder.ts +++ b/apps/server/src/contexts/invoices/application/services/participantAddressFinder.ts @@ -1,26 +1,23 @@ -import { +/* import { ApplicationServiceError, - IApplicationServiceError, + type IApplicationServiceError, } from "@/contexts/common/application/services/ApplicationServiceError"; import { IAdapter, RepositoryBuilder } from "@/contexts/common/domain"; import { Result, UniqueID } from "@shared/contexts"; import { NullOr } from "@shared/utilities"; -import { - IInvoiceParticipantAddress, - IInvoiceParticipantAddressRepository, -} from "../../domain"; +import { IInvoiceParticipantAddress, IInvoiceParticipantAddressRepository } from "../../domain"; export const participantAddressFinder = async ( addressId: UniqueID, adapter: IAdapter, - repository: RepositoryBuilder, + repository: RepositoryBuilder ) => { if (addressId.isNull()) { return Result.fail( ApplicationServiceError.create( ApplicationServiceError.INVALID_REQUEST_PARAM, - `Participant address ID required`, - ), + `Participant address ID required` + ) ); } @@ -34,14 +31,10 @@ export const participantAddressFinder = async ( if (address === null) { return Result.fail( - ApplicationServiceError.create( - ApplicationServiceError.NOT_FOUND_ERROR, - "", - { - id: addressId.toString(), - entity: "participant address", - }, - ), + ApplicationServiceError.create(ApplicationServiceError.NOT_FOUND_ERROR, "", { + id: addressId.toString(), + entity: "participant address", + }) ); } @@ -54,8 +47,8 @@ export const participantAddressFinder = async ( ApplicationServiceError.create( ApplicationServiceError.REPOSITORY_ERROR, _error.message, - _error, - ), + _error + ) ); } @@ -63,8 +56,9 @@ export const participantAddressFinder = async ( ApplicationServiceError.create( ApplicationServiceError.UNEXCEPTED_ERROR, _error.message, - _error, - ), + _error + ) ); } }; + */ diff --git a/apps/server/src/contexts/invoices/application/services/participantFinder.ts b/apps/server/src/contexts/invoices/application/services/participantFinder.ts index b73ad1c2..16fb7ac7 100644 --- a/apps/server/src/contexts/invoices/application/services/participantFinder.ts +++ b/apps/server/src/contexts/invoices/application/services/participantFinder.ts @@ -1,4 +1,4 @@ -import { IAdapter, RepositoryBuilder } from "@/contexts/common/domain"; +/* import { IAdapter, RepositoryBuilder } from "@/contexts/common/domain"; import { UniqueID } from "@shared/contexts"; import { IInvoiceParticipantRepository } from "../../domain"; import { InvoiceCustomer } from "../../domain/entities/invoice-customer/invoice-customer"; @@ -18,3 +18,4 @@ export const participantFinder = async ( return Promise.resolve(participant ? participant : undefined); }; + */ diff --git a/apps/server/src/contexts/invoices/application/update-invoice.use-case.ts b/apps/server/src/contexts/invoices/application/update-invoice.use-case.ts index 72a6ccb7..a9d49ef9 100644 --- a/apps/server/src/contexts/invoices/application/update-invoice.use-case.ts +++ b/apps/server/src/contexts/invoices/application/update-invoice.use-case.ts @@ -1,8 +1,7 @@ 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"; +import { IInvoiceService, Invoice } from "../domain"; import { IUpdateInvoiceRequestDTO } from "../presentation/dto"; export class CreateInvoiceUseCase { @@ -16,6 +15,8 @@ export class CreateInvoiceUseCase { dto: Partial ): Promise> { return this.transactionManager.complete(async (transaction) => { + return Result.fail(new Error("No implementado")); + /* try { const validOrErrors = this.validateInvoiceData(dto); if (validOrErrors.isFailure) { @@ -30,10 +31,11 @@ export class CreateInvoiceUseCase { logger.error(error as Error); return Result.fail(error as Error); } + */ }); } - private validateInvoiceData( + /* private validateInvoiceData( dto: Partial ): Result, Error> { const errors: Error[] = []; @@ -108,10 +110,10 @@ export class CreateInvoiceUseCase { }, invoiceId ); - } + } */ } -export type UpdateInvoiceResponseOrError = +/* export type UpdateInvoiceResponseOrError = | Result // Misc errors (value objects) | Result; // Success! @@ -189,7 +191,7 @@ export class UpdateInvoiceUseCase2 } // Recipient validations - /*const recipientIdOrError = ensureParticipantIdIsValid( + const recipientIdOrError = ensureParticipantIdIsValid( invoiceDTO?.recipient?.id, ); if (recipientIdOrError.isFailure) { @@ -268,7 +270,7 @@ export class UpdateInvoiceUseCase2 } return this.saveInvoice(invoiceOrError.object); - */ + } private async tryUpdateInvoiceInstance(invoiceDTO, invoiceId, recipient) { @@ -396,3 +398,4 @@ export class UpdateInvoiceUseCase2 ); } } + */ diff --git a/apps/server/src/contexts/invoices/domain/entities/invoice-customer/invoice-address.ts b/apps/server/src/contexts/invoices/domain/entities/invoice-customer/invoice-address.ts index c3766d24..13c06219 100644 --- a/apps/server/src/contexts/invoices/domain/entities/invoice-customer/invoice-address.ts +++ b/apps/server/src/contexts/invoices/domain/entities/invoice-customer/invoice-address.ts @@ -1,4 +1,9 @@ -import { EmailAddress, Name, PostalAddress, ValueObject } from "@/core/common/domain"; +import { + type EmailAddress, + type Name, + type PostalAddress, + ValueObject, +} from "@/core/common/domain"; import { Result } from "@/core/common/helpers"; import { PhoneNumber } from "libphonenumber-js"; import { InvoiceAddressType } from "../../value-objects"; diff --git a/apps/server/src/contexts/invoices/index.ts b/apps/server/src/contexts/invoices/index.ts new file mode 100644 index 00000000..38781116 --- /dev/null +++ b/apps/server/src/contexts/invoices/index.ts @@ -0,0 +1,27 @@ +import { IModuleServer, ModuleParams } from "@/core"; +import { logger } from "@/core/common/infrastructure/logger"; +import { invoicesRouter, models } from "./intrastructure"; + +export const invoicesModule: IModuleServer = { + metadata: { + name: "invoices", + version: "1.0.0", + dependencies: [], + }, + init(params: ModuleParams) { + // const contacts = getService("contacts"); + invoicesRouter(params); + logger.info({ message: "🚀 Invoices module initialized", label: "invoices" }); + }, + registerDependencies(params) { + const { database } = params; + logger.info({ message: "🚀 Invoices module dependencies registered", label: "invoices" }); + return { + models, + services: { + getInvoice: () => {}, + /*...*/ + }, + }; + }, +}; diff --git a/apps/server/src/contexts/invoices/intrastructure/Contact.repository.ts b/apps/server/src/contexts/invoices/intrastructure/Contact.repository.ts.bak similarity index 75% rename from apps/server/src/contexts/invoices/intrastructure/Contact.repository.ts rename to apps/server/src/contexts/invoices/intrastructure/Contact.repository.ts.bak index 9ccd432a..f85f57c7 100644 --- a/apps/server/src/contexts/invoices/intrastructure/Contact.repository.ts +++ b/apps/server/src/contexts/invoices/intrastructure/Contact.repository.ts.bak @@ -1,16 +1,7 @@ -import { - ISequelizeAdapter, - SequelizeRepository, -} from "@/contexts/common/infrastructure/sequelize"; -import { UniqueID } from "@shared/contexts"; +import { SequelizeRepository } from "@/core"; import { Transaction } from "sequelize"; -import { Contact, IContactRepository } from "../domain/Contact"; -import { IContactMapper } from "./mappers/contact.mapper"; -export class ContactRepository - extends SequelizeRepository - implements IContactRepository -{ +export class ContactRepository extends SequelizeRepository implements IContactRepository { protected mapper: IContactMapper; public constructor(props: { @@ -23,11 +14,7 @@ export class ContactRepository this.mapper = mapper; } - public async getById2( - id: UniqueID, - billingAddressId: UniqueID, - shippingAddressId: UniqueID, - ) { + public async getById2(id: UniqueID, billingAddressId: UniqueID, shippingAddressId: UniqueID) { const Contact_Model = this.adapter.getModel("Contact_Model"); const ContactAddress_Model = this.adapter.getModel("ContactAddress_Model"); diff --git a/apps/server/src/contexts/invoices/intrastructure/express/index.ts b/apps/server/src/contexts/invoices/intrastructure/express/index.ts new file mode 100644 index 00000000..af28f816 --- /dev/null +++ b/apps/server/src/contexts/invoices/intrastructure/express/index.ts @@ -0,0 +1 @@ +export * from "./invoices.routes"; diff --git a/apps/server/src/contexts/invoices/intrastructure/express/invoices.routes.ts b/apps/server/src/contexts/invoices/intrastructure/express/invoices.routes.ts new file mode 100644 index 00000000..6dc3a09a --- /dev/null +++ b/apps/server/src/contexts/invoices/intrastructure/express/invoices.routes.ts @@ -0,0 +1,64 @@ +import { ModuleParams } from "@/core"; +import { Application, NextFunction, Request, Response, Router } from "express"; +import { Sequelize } from "sequelize"; +import { buildGetInvoiceController, buildListInvoicesController } from "../../presentation"; + +export const invoicesRouter = (params: ModuleParams) => { + const { app, database, baseRoutePath } = params as { + app: Application; + database: Sequelize; + baseRoutePath: string; + }; + + const routes: Router = Router({ mergeParams: true }); + + routes.get( + "/", + //checkTabContext, + //checkUser, + (req: Request, res: Response, next: NextFunction) => { + buildListInvoicesController(database).execute(req, res, next); + } + ); + + routes.get( + "/:invoiceId", + //checkTabContext, + //checkUser, + (req: Request, res: Response, next: NextFunction) => { + buildGetInvoiceController(database).execute(req, res, next); + } + ); + + /*routes.post( + "/", + validateAndParseBody(ICreateInvoiceRequestSchema, { sanitize: false }), + //checkTabContext, + //checkUser, + (req: Request, res: Response, next: NextFunction) => { + buildCreateInvoiceController(database).execute(req, res, next); + } + ); + + routes.put( + "/:invoiceId", + validateAndParseBody(IUpdateInvoiceRequestSchema), + checkTabContext, + //checkUser, + (req: Request, res: Response, next: NextFunction) => { + buildUpdateInvoiceController().execute(req, res, next); + } + ); + + routes.delete( + "/:invoiceId", + validateAndParseBody(IDeleteInvoiceRequestSchema), + checkTabContext, + //checkUser, + (req: Request, res: Response, next: NextFunction) => { + buildDeleteInvoiceController().execute(req, res, next); + } + );*/ + + app.use(`${baseRoutePath}/invoices`, routes); +}; diff --git a/apps/server/src/contexts/invoices/intrastructure/index.ts b/apps/server/src/contexts/invoices/intrastructure/index.ts index 7ccefa3a..cfb15542 100644 --- a/apps/server/src/contexts/invoices/intrastructure/index.ts +++ b/apps/server/src/contexts/invoices/intrastructure/index.ts @@ -1,2 +1,3 @@ export * from "./mappers"; export * from "./sequelize"; +export * from "./express"; diff --git a/apps/server/src/contexts/invoices/intrastructure/mappers/invoice-item.mapper.ts b/apps/server/src/contexts/invoices/intrastructure/mappers/invoice-item.mapper.ts index c3f6ceca..44ff1bf5 100644 --- a/apps/server/src/contexts/invoices/intrastructure/mappers/invoice-item.mapper.ts +++ b/apps/server/src/contexts/invoices/intrastructure/mappers/invoice-item.mapper.ts @@ -1,7 +1,7 @@ import { Invoice, InvoiceItem, InvoiceItemDescription } from "@/contexts/invoices/domain"; import { - ISequelizeMapper, - MapperParamsType, + type ISequelizeMapper, + type MapperParamsType, MoneyValue, Percentage, Quantity, diff --git a/apps/server/src/contexts/invoices/intrastructure/mappers/invoice.mapper.ts b/apps/server/src/contexts/invoices/intrastructure/mappers/invoice.mapper.ts index 4d475006..8c594331 100644 --- a/apps/server/src/contexts/invoices/intrastructure/mappers/invoice.mapper.ts +++ b/apps/server/src/contexts/invoices/intrastructure/mappers/invoice.mapper.ts @@ -1,7 +1,7 @@ import { Invoice, InvoiceNumber, InvoiceSerie, InvoiceStatus } from "@/contexts/invoices/domain"; import { - ISequelizeMapper, - MapperParamsType, + type ISequelizeMapper, + type MapperParamsType, Result, SequelizeMapper, UniqueID, diff --git a/apps/server/src/contexts/invoices/intrastructure/sequelize/index.ts b/apps/server/src/contexts/invoices/intrastructure/sequelize/index.ts index 6c291d98..7503273b 100644 --- a/apps/server/src/contexts/invoices/intrastructure/sequelize/index.ts +++ b/apps/server/src/contexts/invoices/intrastructure/sequelize/index.ts @@ -1,3 +1,9 @@ +import invoiceItemModelInit from "./invoice-item.model"; +import invoiceModelInit from "./invoice.model"; + export * from "./invoice-item.model"; // exporta las clases, tipos export * from "./invoice.model"; export * from "./invoice.repository"; + +// Array de inicializadores para que registerModels() lo use +export const models = [invoiceItemModelInit, invoiceModelInit]; diff --git a/apps/server/src/contexts/invoices/presentation/controllers/create-invoice/create-invoice.controller.ts b/apps/server/src/contexts/invoices/presentation/controllers/create-invoice/create-invoice.controller.ts index b84a1461..56f5116f 100644 --- a/apps/server/src/contexts/invoices/presentation/controllers/create-invoice/create-invoice.controller.ts +++ b/apps/server/src/contexts/invoices/presentation/controllers/create-invoice/create-invoice.controller.ts @@ -1,5 +1,5 @@ +import { CreateInvoiceUseCase } from "@/contexts/invoices/application/create-invoice.use-case"; import { ExpressController, UniqueID } from "@/core"; -import { CreateInvoiceUseCase } from "../../../application"; import { ICreateInvoiceRequestDTO } from "../../dto"; import { ICreateInvoicePresenter } from "./presenter"; diff --git a/apps/server/src/contexts/invoices/presentation/controllers/create-invoice/index.ts b/apps/server/src/contexts/invoices/presentation/controllers/create-invoice/index.ts index fa19c3a4..2b0798f0 100644 --- a/apps/server/src/contexts/invoices/presentation/controllers/create-invoice/index.ts +++ b/apps/server/src/contexts/invoices/presentation/controllers/create-invoice/index.ts @@ -1,8 +1,8 @@ +import { CreateInvoiceUseCase } from "@/contexts/invoices/application/create-invoice.use-case"; import { InvoiceService } from "@/contexts/invoices/domain"; -import { invoiceMapper, InvoiceRepository } from "@/contexts/invoices/intrastructure"; +import { InvoiceRepository, invoiceMapper } from "@/contexts/invoices/intrastructure"; import { SequelizeTransactionManager } from "@/core"; import { Sequelize } from "sequelize"; -import { CreateInvoiceUseCase } from "../../../application"; import { CreateInvoiceController } from "./create-invoice.controller"; import { createInvoicePresenter } from "./presenter"; diff --git a/apps/server/src/contexts/invoices/presentation/controllers/create-invoice/presenter/create-invoice.presenter.ts b/apps/server/src/contexts/invoices/presentation/controllers/create-invoice/presenter/create-invoice.presenter.ts index 1ba9b0ab..24f7846d 100644 --- a/apps/server/src/contexts/invoices/presentation/controllers/create-invoice/presenter/create-invoice.presenter.ts +++ b/apps/server/src/contexts/invoices/presentation/controllers/create-invoice/presenter/create-invoice.presenter.ts @@ -1,5 +1,5 @@ -import { Invoice } from "#/server/domain"; -import { ICreateInvoiceResponseDTO } from "#/server/presentation/dto"; +import { Invoice } from "@/contexts/invoices/domain"; +import { ICreateInvoiceResponseDTO } from "../../../dto"; export interface ICreateInvoicePresenter { toDTO: (invoice: Invoice) => ICreateInvoiceResponseDTO; diff --git a/apps/server/src/contexts/invoices/presentation/controllers/get-invoice/index.ts b/apps/server/src/contexts/invoices/presentation/controllers/get-invoice/index.ts index 0e7a69ac..5e91c118 100644 --- a/apps/server/src/contexts/invoices/presentation/controllers/get-invoice/index.ts +++ b/apps/server/src/contexts/invoices/presentation/controllers/get-invoice/index.ts @@ -1,6 +1,6 @@ import { GetInvoiceUseCase } from "@/contexts/invoices/application"; import { InvoiceService } from "@/contexts/invoices/domain"; -import { invoiceMapper, InvoiceRepository } from "@/contexts/invoices/intrastructure"; +import { InvoiceRepository, invoiceMapper } from "@/contexts/invoices/intrastructure"; import { SequelizeTransactionManager } from "@/core"; import { Sequelize } from "sequelize"; import { GetInvoiceController } from "./get-invoice.controller"; diff --git a/apps/server/src/contexts/invoices/presentation/controllers/get-invoice/presenter/get-invoice.presenter.ts b/apps/server/src/contexts/invoices/presentation/controllers/get-invoice/presenter/get-invoice.presenter.ts index 1496f6cd..d11cb74f 100644 --- a/apps/server/src/contexts/invoices/presentation/controllers/get-invoice/presenter/get-invoice.presenter.ts +++ b/apps/server/src/contexts/invoices/presentation/controllers/get-invoice/presenter/get-invoice.presenter.ts @@ -1,4 +1,4 @@ -import { Invoice, InvoiceItem } from "#/server/domain"; +import { Invoice, InvoiceItem } from "../../../../domain"; import { IGetInvoiceResponseDTO } from "../../../dto"; export interface IGetInvoicePresenter { diff --git a/apps/server/src/contexts/invoices/presentation/controllers/list-invoices/index.ts b/apps/server/src/contexts/invoices/presentation/controllers/list-invoices/index.ts index 116e394c..7081f9b5 100644 --- a/apps/server/src/contexts/invoices/presentation/controllers/list-invoices/index.ts +++ b/apps/server/src/contexts/invoices/presentation/controllers/list-invoices/index.ts @@ -1,6 +1,6 @@ import { ListInvoicesUseCase } from "@/contexts/invoices/application"; import { InvoiceService } from "@/contexts/invoices/domain"; -import { invoiceMapper, InvoiceRepository } from "@/contexts/invoices/intrastructure"; +import { InvoiceRepository, invoiceMapper } from "@/contexts/invoices/intrastructure"; import { SequelizeTransactionManager } from "@/core"; import { Sequelize } from "sequelize"; import { ListInvoicesController } from "./list-invoices.controller"; diff --git a/apps/server/src/contexts/invoices/presentation/controllers/list-invoices/presenter/list-invoices.presenter.ts b/apps/server/src/contexts/invoices/presentation/controllers/list-invoices/presenter/list-invoices.presenter.ts index d61c3274..57f7f57a 100644 --- a/apps/server/src/contexts/invoices/presentation/controllers/list-invoices/presenter/list-invoices.presenter.ts +++ b/apps/server/src/contexts/invoices/presentation/controllers/list-invoices/presenter/list-invoices.presenter.ts @@ -1,6 +1,6 @@ -import { Invoice } from "#/server/domain"; -import { IListInvoicesResponseDTO } from "#/server/presentation/dto"; -import { Collection } from "@rdx/core"; +import { Invoice } from "@/contexts/invoices/domain"; +import { Collection } from "@/core"; +import { IListInvoicesResponseDTO } from "../../../dto"; export interface IListInvoicesPresenter { toDTO: (invoices: Collection) => IListInvoicesResponseDTO[]; diff --git a/apps/server/src/contexts/invoices/presentation/dto/invoices.request.dto.ts b/apps/server/src/contexts/invoices/presentation/dto/invoices.request.dto.ts index 6964685d..c37b3f7c 100644 --- a/apps/server/src/contexts/invoices/presentation/dto/invoices.request.dto.ts +++ b/apps/server/src/contexts/invoices/presentation/dto/invoices.request.dto.ts @@ -1,4 +1,4 @@ -export interface IListInvoicesRequestDTO {} +export type IListInvoicesRequestDTO = {} export interface ICreateInvoiceRequestDTO { id: string; diff --git a/apps/server/src/core/common/domain/aggregate-root-repository.interface.ts b/apps/server/src/core/common/domain/aggregate-root-repository.interface.ts index 845c7ae7..b086120c 100644 --- a/apps/server/src/core/common/domain/aggregate-root-repository.interface.ts +++ b/apps/server/src/core/common/domain/aggregate-root-repository.interface.ts @@ -1 +1 @@ -export interface IAggregateRootRepository {} +export type IAggregateRootRepository = {} diff --git a/apps/server/src/core/common/domain/aggregate-root.ts b/apps/server/src/core/common/domain/aggregate-root.ts index 3255fcd1..9dd652eb 100644 --- a/apps/server/src/core/common/domain/aggregate-root.ts +++ b/apps/server/src/core/common/domain/aggregate-root.ts @@ -1,3 +1,4 @@ +import { logger } from "../infrastructure/logger"; import { DomainEntity } from "./domain-entity"; import { IDomainEvent } from "./events"; diff --git a/apps/server/src/core/common/domain/events/domain-event.ts b/apps/server/src/core/common/domain/events/domain-event.ts index cb989292..c95d61d9 100644 --- a/apps/server/src/core/common/domain/events/domain-event.ts +++ b/apps/server/src/core/common/domain/events/domain-event.ts @@ -56,7 +56,7 @@ export class DomainEvents { private static findMarkedAggregateByID(id: UniqueID): AggregateRoot { let found!: AggregateRoot; - for (let aggregate of this.markedAggregates) { + for (const aggregate of this.markedAggregates) { if (aggregate.id.equals(id)) { found = aggregate; } @@ -127,7 +127,7 @@ export class DomainEvents { if (this.handlersMap.hasOwnProperty(eventClassName)) { const handlers: any[] = this.handlersMap[eventClassName]; - for (let handler of handlers) { + for (const handler of handlers) { handler(event); } } diff --git a/apps/server/src/core/common/domain/value-objects/money-value.ts b/apps/server/src/core/common/domain/value-objects/money-value.ts index 476471e5..26dab433 100644 --- a/apps/server/src/core/common/domain/value-objects/money-value.ts +++ b/apps/server/src/core/common/domain/value-objects/money-value.ts @@ -67,7 +67,7 @@ export class MoneyValue extends ValueObject implements IMoneyV } get amount(): number { - return this.dinero.getAmount() / Math.pow(10, this.dinero.getPrecision()); + return this.dinero.getAmount() / 10 ** this.dinero.getPrecision(); // ** => Math.pow } get currency(): CurrencyData { @@ -90,8 +90,8 @@ export class MoneyValue extends ValueObject implements IMoneyV /** Reconstruye el VO desde la cadena persistida */ static fromPersistence(value: string): MoneyValue { const [currencyCode, amountStr, scaleStr] = value.split(":"); - const amount = parseInt(amountStr, 10); - const scale = parseInt(scaleStr, 10); + const amount = Number.parseInt(amountStr, 10); + const scale = Number.parseInt(scaleStr, 10); const currency = currencyCode; return new MoneyValue({ amount, scale, currency_code: currency }); } diff --git a/apps/server/src/core/common/domain/value-objects/percentage.ts b/apps/server/src/core/common/domain/value-objects/percentage.ts index 72a3d82c..9f6dfbfb 100644 --- a/apps/server/src/core/common/domain/value-objects/percentage.ts +++ b/apps/server/src/core/common/domain/value-objects/percentage.ts @@ -4,7 +4,7 @@ import { ValueObject } from "./value-object"; const DEFAULT_SCALE = 2; -interface IPercentageProps { +export interface IPercentageProps { amount: number; scale: number; } @@ -51,7 +51,7 @@ export class Percentage extends ValueObject implements IPercen } // Cálculo del valor real del porcentaje - const realValue = amount / Math.pow(10, scale); + const realValue = amount / 10 ** scale; // ** => Math.pow // Validación de rango if (realValue > Percentage.MAX_VALUE) { @@ -78,7 +78,7 @@ export class Percentage extends ValueObject implements IPercen } toNumber(): number { - return this.amount / Math.pow(10, this.scale); + return this.amount / 10 ** this.scale; // ** => Math.pow } toString(): string { diff --git a/apps/server/src/core/common/domain/value-objects/quantity.ts b/apps/server/src/core/common/domain/value-objects/quantity.ts index 37aaf4c5..faaf19d2 100644 --- a/apps/server/src/core/common/domain/value-objects/quantity.ts +++ b/apps/server/src/core/common/domain/value-objects/quantity.ts @@ -4,7 +4,7 @@ import { ValueObject } from "./value-object"; const DEFAULT_SCALE = 2; -interface IQuantityProps { +export interface IQuantityProps { amount: number; scale: number; } @@ -47,7 +47,7 @@ export class Quantity extends ValueObject implements IQuantity { if (!checkProps.success) { return Result.fail(new Error(checkProps.error.errors[0].message)); } - return Result.ok(new Quantity({ ...checkProps.data! })); + return Result.ok(new Quantity({ ...(checkProps.data as IQuantityProps) })); } get amount(): number { @@ -67,7 +67,7 @@ export class Quantity extends ValueObject implements IQuantity { } toNumber(): number { - return this.amount / Math.pow(10, this.scale); + return this.amount / 10 ** this.scale; // ** => Math.pow } toString(): string { @@ -131,10 +131,10 @@ export class Quantity extends ValueObject implements IQuantity { return Result.fail(new Error(`Scale out of range: ${newScale}`)); } - const oldFactor = Math.pow(10, this.scale); + const oldFactor = 10 ** this.scale; // ** => Math.pow const value = Number(this.amount) / oldFactor; - const newFactor = Math.pow(10, newScale); + const newFactor = 10 ** newScale; // ** => Math.pow const newValue = Math.round(value * newFactor); return Quantity.create({ amount: newValue, scale: newScale }); diff --git a/apps/server/src/core/common/domain/value-objects/unique-id.ts b/apps/server/src/core/common/domain/value-objects/unique-id.ts index 1343fc2f..281de175 100644 --- a/apps/server/src/core/common/domain/value-objects/unique-id.ts +++ b/apps/server/src/core/common/domain/value-objects/unique-id.ts @@ -4,7 +4,7 @@ import { Result } from "../../helpers/result"; import { ValueObject } from "./value-object"; export class UniqueID extends ValueObject { - static create(id?: string, generateOnEmpty: boolean = false): Result { + static create(id?: string, generateOnEmpty = false): Result { if (!id || id?.trim() === "") { if (!generateOnEmpty) { return Result.fail(new Error("ID cannot be undefined or null")); diff --git a/apps/server/src/core/common/helpers/index.ts b/apps/server/src/core/common/helpers/index.ts index 5d1da0b4..b7f8a1cc 100644 --- a/apps/server/src/core/common/helpers/index.ts +++ b/apps/server/src/core/common/helpers/index.ts @@ -2,3 +2,4 @@ export * from "./collection"; export * from "./maybe"; export * from "./result"; export * from "./utils"; +export * from "./modules"; diff --git a/apps/server/src/core/common/helpers/modules/index.ts b/apps/server/src/core/common/helpers/modules/index.ts new file mode 100644 index 00000000..24f3693a --- /dev/null +++ b/apps/server/src/core/common/helpers/modules/index.ts @@ -0,0 +1,2 @@ +export * from "./module-server.interface"; +export * from "./types"; diff --git a/apps/server/src/core/common/helpers/modules/module-server.interface.ts b/apps/server/src/core/common/helpers/modules/module-server.interface.ts new file mode 100644 index 00000000..f22e6c75 --- /dev/null +++ b/apps/server/src/core/common/helpers/modules/module-server.interface.ts @@ -0,0 +1,9 @@ +//Contrato para los Modules backend (Node.js) + +import { ModuleDependencies, ModuleMetadata, ModuleParams } from "./types"; + +export interface IModuleServer { + metadata: ModuleMetadata; + init(params: ModuleParams): void; + registerDependencies?(params: ModuleParams): ModuleDependencies; +} diff --git a/apps/server/src/core/common/helpers/modules/types.ts b/apps/server/src/core/common/helpers/modules/types.ts new file mode 100644 index 00000000..733af538 --- /dev/null +++ b/apps/server/src/core/common/helpers/modules/types.ts @@ -0,0 +1,26 @@ +// Contiene tipos comunes entre cliente y servidor + +import { Model, ModelStatic, Sequelize } from "sequelize"; + +export interface SequelizeModel extends Model { + initialize: (sequelize: Sequelize) => void; + associate?: (models: { [key: string]: ModelStatic }) => void; +} + +export type ModuleParams = { + [key: string]: any; +}; + +//export type ModelInitializer = typeof SequelizeModel; + +export interface ModuleMetadata { + name: string; + version: string; + description?: string; + dependencies?: string[]; +} + +export interface ModuleDependencies { + models?: any[]; + services?: { [key: string]: any }; +} diff --git a/apps/server/src/core/common/infrastructure/index.ts b/apps/server/src/core/common/infrastructure/index.ts index 62f8ac11..7db08f75 100644 --- a/apps/server/src/core/common/infrastructure/index.ts +++ b/apps/server/src/core/common/infrastructure/index.ts @@ -1 +1,5 @@ export * from "./sequelize"; +export * from "./logger"; +export * from "./database"; +//export * from "./passport"; +export * from "./sequelize"; diff --git a/apps/server/src/core/common/infrastructure/passport/index.ts b/apps/server/src/core/common/infrastructure/passport/index.ts index cee3a0f8..ffd50ad9 100644 --- a/apps/server/src/core/common/infrastructure/passport/index.ts +++ b/apps/server/src/core/common/infrastructure/passport/index.ts @@ -1 +1 @@ -export * from "./passport"; +//export * from "./passport"; diff --git a/apps/server/src/core/common/infrastructure/passport/passport.ts b/apps/server/src/core/common/infrastructure/passport/passport.ts index b3f85c1d..6cf23dbc 100644 --- a/apps/server/src/core/common/infrastructure/passport/passport.ts +++ b/apps/server/src/core/common/infrastructure/passport/passport.ts @@ -1,4 +1,4 @@ -import { authenticatedUserRepository } from "@/contexts/auth/infraestructure"; +/* import { authenticatedUserRepository } from "@/contexts/auth/infraestructure"; import passport from "passport"; import { ExtractJwt, Strategy as JwtStrategy } from "passport-jwt"; @@ -25,3 +25,4 @@ passport.use( ); export default passport; + */ diff --git a/apps/server/src/core/common/infrastructure/sequelize/sequelize-repository.ts b/apps/server/src/core/common/infrastructure/sequelize/sequelize-repository.ts index b680f19f..cefd6cbb 100644 --- a/apps/server/src/core/common/infrastructure/sequelize/sequelize-repository.ts +++ b/apps/server/src/core/common/infrastructure/sequelize/sequelize-repository.ts @@ -118,7 +118,7 @@ export abstract class SequelizeRepository implements IAggregateRootRepository protected async _deleteById( model: ModelDefined, id: UniqueID, - force: boolean = false, + force = false, transaction?: Transaction ) { await model.destroy({ diff --git a/apps/server/src/core/common/presentation/express/express-controller.ts b/apps/server/src/core/common/presentation/express/express-controller.ts index 3d1e536f..5dc9db75 100644 --- a/apps/server/src/core/common/presentation/express/express-controller.ts +++ b/apps/server/src/core/common/presentation/express/express-controller.ts @@ -1,14 +1,10 @@ -import { - AuthenticatedRequest, - TabContextRequest, -} from "@/contexts/auth/infraestructure/express/types"; import { logger } from "@/core/common/infrastructure/logger"; import { NextFunction, Request, Response } from "express"; import httpStatus from "http-status"; import { ApiError } from "./api-error"; export abstract class ExpressController { - protected req!: Request | AuthenticatedRequest | TabContextRequest; + protected req!: Request; //| AuthenticatedRequest | TabContextRequest; protected res!: Response; protected next!: NextFunction; @@ -17,7 +13,7 @@ export abstract class ExpressController { return res.status(apiError.status).json(apiError); } - protected abstract executeImpl(): Promise; + protected abstract executeImpl(): Promise; protected ok(dto?: T) { return dto ? this.res.status(httpStatus.OK).json(dto) : this.res.status(httpStatus.OK).send(); diff --git a/apps/server/src/core/helpers/index.ts b/apps/server/src/core/helpers/index.ts new file mode 100644 index 00000000..5cdba46e --- /dev/null +++ b/apps/server/src/core/helpers/index.ts @@ -0,0 +1,2 @@ +export * from "./module-loader"; +export * from "./service-registry"; diff --git a/apps/server/src/core/helpers/model-loader.ts b/apps/server/src/core/helpers/model-loader.ts new file mode 100644 index 00000000..72623736 --- /dev/null +++ b/apps/server/src/core/helpers/model-loader.ts @@ -0,0 +1,60 @@ +import { ModuleParams } from "../common"; +import { logger } from "../common/infrastructure/logger"; + +const allModelInitializers: any[] = []; +const registeredModels: { [key: string]: any } = {}; + +/** + * 🔹 Registra todos los modelos en Sequelize + */ +export const registerModels = (models: any[], params?: ModuleParams) => { + allModelInitializers.push(...models); +}; + +export const initModels = async (params: ModuleParams) => { + logger.info({ message: "Init models...", label: "initModels" }); + + const { database } = params; + if (!database) { + const error = new Error("❌ Database not found."); + logger.error({ + message: error.message, + label: "initModels", + }); + throw error; + } + + // Inicializar modelos + for (const initializer of allModelInitializers) { + const model = initializer(database); + registeredModels[model.name] = model; + logger.info({ + message: `🔸 Model "${model.name}" registered (sequelize)`, + label: "registerModel", + }); + } + + // Configurar asociaciones + for (const model of Object.values(registeredModels)) { + if (typeof model.associate === "function") { + model.associate(database); + } + } + + try { + // Sincronizamos DB en modo desarrollo + if (process.env.NODE_ENV !== "production") { + await database.sync({ force: false, alter: true }); + logger.info({ message: `✔️${" "}Database synchronized successfully.`, label: "initModels" }); + } else { + logger.warning({ + message: "⚠️ Running in production mode - Skipping database sync.", + label: "initModels", + }); + } + } catch (err) { + const error = err as Error; + logger.error({ message: "❌ Error synchronizing database:", error, label: "initModels" }); + throw error; + } +}; diff --git a/apps/server/src/core/helpers/module-loader.ts b/apps/server/src/core/helpers/module-loader.ts new file mode 100644 index 00000000..9165716b --- /dev/null +++ b/apps/server/src/core/helpers/module-loader.ts @@ -0,0 +1,52 @@ +import { IModuleServer, ModuleParams, logger } from "../common"; +import { initModels, registerModels } from "./model-loader"; +import { registerService } from "./service-registry"; + +const registeredModules: Map = new Map(); +const initializedModules = new Set(); + +export function registerModule(pkg: IModuleServer) { + if (registeredModules.has(pkg.metadata.name)) { + throw new Error(`❌ Paquete "${pkg.metadata.name}" ya registrado.`); + } + registeredModules.set(pkg.metadata.name, pkg); +} + +export async function initModules(params: ModuleParams) { + registeredModules.forEach((_, name) => { + loadModule(name, params); + }); + await initModels(params); +} + +const loadModule = (name: string, params: ModuleParams) => { + if (initializedModules.has(name)) return; + + const pkg = registeredModules.get(name); + if (!pkg) throw new Error(`❌ Paquete "${name}" no encontrado.`); + + // Resolver dependencias primero + const deps = pkg.metadata.dependencies || []; + deps.forEach((dep) => loadModule(dep, params)); + + // Inicializar el module + pkg.init(params); + + const pkgApi = pkg.registerDependencies?.(params); + + // Registrar modelos de Sequelize, si los expone + if (pkgApi?.models) { + registerModels(pkgApi.models, params); + } + + // Registrar sus servicios, si los expone + if (pkgApi?.services) { + const services = pkgApi.services; + if (services && typeof services === "object") { + registerService(pkg.metadata.name, services); + } + } + + initializedModules.add(name); + logger.info({ message: `✅ Module "${name}" registered`, label: "loadModule" }); +}; diff --git a/apps/server/src/core/helpers/service-registry.ts b/apps/server/src/core/helpers/service-registry.ts new file mode 100644 index 00000000..133b92db --- /dev/null +++ b/apps/server/src/core/helpers/service-registry.ts @@ -0,0 +1,36 @@ +const services: Record = {}; + +/** + * Registra un objeto de servicio (API) bajo un nombre. + */ +export function registerService(name: string, api: any) { + if (services[name]) { + throw new Error(`❌ Servicio "${name}" ya fue registrado.`); + } + services[name] = api; +} + +/** + * Recupera un servicio registrado, con tipado opcional. + */ +export function getService(name: string): T { + const service = services[name]; + if (!service) { + throw new Error(`❌ Servicio "${name}" no encontrado.`); + } + return service; +} + +/** + * Permite saber si un servicio fue registrado. + */ +export function hasService(name: string): boolean { + return !!services[name]; +} + +/** + * Devuelve todos los servicios (para depuración o tests). + */ +export function listServices(): string[] { + return Object.keys(services); +} diff --git a/apps/server/src/routes/accounts.routes.ts b/apps/server/src/routes/accounts.routes.ts index 7f35f289..8145a43e 100644 --- a/apps/server/src/routes/accounts.routes.ts +++ b/apps/server/src/routes/accounts.routes.ts @@ -1,4 +1,4 @@ -import { +/* import { ICreateAccountRequestSchema, IGetAccountRequestSchema, IUpdateAccountRequestSchema, @@ -59,3 +59,4 @@ export const accountsRouter = (appRouter: Router) => { appRouter.use("/accounts", routes); }; + */ diff --git a/apps/server/src/routes/auth.routes.ts b/apps/server/src/routes/auth.routes.ts index 9aaf7dc9..c32012d0 100644 --- a/apps/server/src/routes/auth.routes.ts +++ b/apps/server/src/routes/auth.routes.ts @@ -1,4 +1,4 @@ -import { checkTabContext, checkUser } from "@/contexts/auth/infraestructure"; +/*import { checkTabContext, checkUser } from "@/contexts/auth/infraestructure"; import { buildLoginController, buildLogoutController, @@ -15,59 +15,61 @@ import { NextFunction, Request, Response, Router } from "express"; export const authRouter = (appRouter: Router) => { const routes: Router = Router({ mergeParams: true }); - /** - * @api {post} /api/auth/register Register a new user - * @apiName RegisterUser - * @apiGroup Authentication - * @apiVersion 1.0.0 - * - * @apiBody {String} username User's unique username. - * @apiBody {String} email User's email address. - * @apiBody {String} password User's password (minimum 8 characters). - * - * @apiSuccess (201) {String} userId The unique ID of the created user. - * - * @apiError (400) {String} message Error message. - */ - routes.post("/register", validateAndParseBody(RegisterUserSchema), (req, res, next) => { + */ +/** + * @api {post} /api/auth/register Register a new user + * @apiName RegisterUser + * @apiGroup Authentication + * @apiVersion 1.0.0 + * + * @apiBody {String} username User's unique username. + * @apiBody {String} email User's email address. + * @apiBody {String} password User's password (minimum 8 characters). + * + * @apiSuccess (201) {String} userId The unique ID of the created user. + * + * @apiError (400) {String} message Error message. + */ +/* routes.post("/register", validateAndParseBody(RegisterUserSchema), (req, res, next) => { buildRegisterController().execute(req, res, next); - }); + }); */ - /** - * @api {post} /api/auth/login Authenticate a user - * @apiName LoginUser - * @apiGroup Authentication - * @apiVersion 1.0.0 - * - * @apiHeader {String} Tab ID (x-tab-id) - * @apiBody {String} email User's email address. - * @apiBody {String} password User's password. - * - * @apiSuccess (200) {String} token JWT authentication token. - * @apiSuccess (200) {String} userId The unique ID of the authenticated user. - * - * @apiError (401) {String} message Invalid email or password. - */ - routes.post( +/** + * @api {post} /api/auth/login Authenticate a user + * @apiName LoginUser + * @apiGroup Authentication + * @apiVersion 1.0.0 + * + * @apiHeader {String} Tab ID (x-tab-id) + * @apiBody {String} email User's email address. + * @apiBody {String} password User's password. + * + * @apiSuccess (200) {String} token JWT authentication token. + * @apiSuccess (200) {String} userId The unique ID of the authenticated user. + * + * @apiError (401) {String} message Invalid email or password. + */ +/* routes.post( "/login", validateAndParseBody(LoginUserSchema), checkTabContext, (req: Request, res: Response, next: NextFunction) => { buildLoginController().execute(req, res, next); } - ); + ); */ - /** - * @api {post} /api/auth/logout Logout user - * @apiName LogoutUser - * @apiGroup Authentication - * @apiVersion 1.0.0 - * - * @apiHeader {String} Tab ID (x-tab-id) - * @apiHeader {String} Authorization Bearer token. - * - * @apiSuccess (200) {String} message Success message. - */ +/** + * @api {post} /api/auth/logout Logout user + * @apiName LogoutUser + * @apiGroup Authentication + * @apiVersion 1.0.0 + * + * @apiHeader {String} Tab ID (x-tab-id) + * @apiHeader {String} Authorization Bearer token. + * + * @apiSuccess (200) {String} message Success message. + */ +/* routes.post( "/logout", checkTabContext, @@ -88,3 +90,4 @@ export const authRouter = (appRouter: Router) => { appRouter.use("/auth", routes); }; +*/ diff --git a/apps/server/src/routes/invoices.routes.ts b/apps/server/src/routes/invoices.routes.ts index dedc8e3b..f947b732 100644 --- a/apps/server/src/routes/invoices.routes.ts +++ b/apps/server/src/routes/invoices.routes.ts @@ -1,12 +1,9 @@ import { getDatabase } from "@/config"; -import { validateAndParseBody } from "@/core/common/presentation"; import { - ICreateInvoiceRequestSchema, buildGetInvoiceController, buildListInvoicesController, } from "@/contexts/invoices/presentation"; -import { buildCreateInvoiceController } from "@/contexts/invoices/presentation/controllers/create-invoice"; import { NextFunction, Request, Response, Router } from "express"; export const invoicesRouter = (appRouter: Router) => { @@ -31,15 +28,15 @@ export const invoicesRouter = (appRouter: Router) => { } ); - routes.post( + /*routes.post( "/", validateAndParseBody(ICreateInvoiceRequestSchema, { sanitize: false }), //checkTabContext, //checkUser, (req: Request, res: Response, next: NextFunction) => { - buildCreateInvoiceController().execute(req, res, next); + buildCreateInvoiceController(database).execute(req, res, next); } - ); + );*/ /* routes.put( diff --git a/apps/server/src/routes/users.routes.ts b/apps/server/src/routes/users.routes.ts index 673e905e..f558892e 100644 --- a/apps/server/src/routes/users.routes.ts +++ b/apps/server/src/routes/users.routes.ts @@ -1,5 +1,5 @@ -import { checkTabContext, checkUserIsAdmin } from "@/contexts/auth/infraestructure"; -import { buildListUsersController, ListUsersSchema } from "@/contexts/auth/presentation"; +/*import { checkTabContext, checkUserIsAdmin } from "@/contexts/auth/infraestructure"; +import { ListUsersSchema, buildListUsersController } from "@/contexts/auth/presentation"; import { validateAndParseBody } from "@/core/common/presentation"; import { NextFunction, Request, Response, Router } from "express"; @@ -18,3 +18,4 @@ export const usersRouter = (appRouter: Router) => { appRouter.use("/users", routes); }; +*/ diff --git a/apps/server/tsconfig.json b/apps/server/tsconfig.json index 557d7d6a..31fa112a 100644 --- a/apps/server/tsconfig.json +++ b/apps/server/tsconfig.json @@ -2,25 +2,13 @@ "extends": "@repo/typescript-config/express.json", "compilerOptions": { - //"rootDir": "./src", // Define que el código fuente vive en "src/" - - "module": "CommonJS", - "moduleResolution": "node", - - "composite": true, // Para builds encadenados (si se usa references) - "declaration": true, // Genera archivos .d.ts - "emitDeclarationOnly": false, // También genera .js - "noEmitOnError": false, // Falla si hay errores de tipos - "preserveSymlinks": true, // Opcional: útil si usas symlinks entre workspaces - - //"baseUrl": "./src", + "baseUrl": "./src", "paths": { - /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - "@/*": ["./src/*"] + "@/*": ["*"] }, - "resolveJsonModule": true + "outDir": "dist" }, - - "include": ["src/**/*.ts"], + //"files": ["src/index.ts"], // Esta opción compila sólo los archivos listados (y sus dependencias importadas). + "include": ["src/**/*.ts", "src/contexts/invoices/intrastructure/Contact.repository.ts.bak"], "exclude": ["src/**/__tests__/*", "src/**/*.mock.*", "src/**/*.test.*", "node_modules", "dist"] } diff --git a/biome.json b/biome.json new file mode 100644 index 00000000..1d468571 --- /dev/null +++ b/biome.json @@ -0,0 +1,47 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false }, + "files": { "ignoreUnknown": false, "ignore": ["dist"] }, + "formatter": { + "enabled": true, + "useEditorconfig": true, + "formatWithErrors": false, + "indentStyle": "space", + "indentWidth": 2, + "lineEnding": "lf", + "lineWidth": 100, + "attributePosition": "auto", + "bracketSpacing": true + }, + "organizeImports": { "enabled": true }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "complexity": { + "noForEach": "info", + "noBannedTypes": "info", + "useOptionalChain": "info" + }, + "suspicious": { + "noExplicitAny": "info" + }, + "style": { + "useImportType": "off" + } + } + }, + "javascript": { + "formatter": { + "jsxQuoteStyle": "single", + "quoteProperties": "asNeeded", + "trailingCommas": "es5", + "semicolons": "always", + "arrowParentheses": "always", + "bracketSameLine": false, + "quoteStyle": "double", + "attributePosition": "auto", + "bracketSpacing": true + } + } +} diff --git a/modules.bak/invoices/package.json b/modules.bak/invoices/package.json index bce4acf0..85c5dd5f 100644 --- a/modules.bak/invoices/package.json +++ b/modules.bak/invoices/package.json @@ -26,7 +26,7 @@ "@repo/typescript-config": "workspace:*", "@types/dinero.js": "^1.9.4", "jest": "^29.7.0", - "typescript": "^5.7.3" + "typescript": "^5.8.3" }, "dependencies": {} } diff --git a/package.json b/package.json index e38fbc4b..d6fa0413 100644 --- a/package.json +++ b/package.json @@ -6,21 +6,18 @@ "dev": "turbo dev", "dev:server": "turbo dev --filter=server", "dev:client": "turbo dev --filter=client", - "lint": "turbo lint", - "format": "prettier --write \"**/*.{ts,tsx,md}\"", + "format-and-lint": "biome check .", + "format-and-lint:fix": "biome check . --write", "ui:add": "pnpm --filter @repo/ui ui:add", "create:package": "ts-node scripts/create-package.ts", "volta:install": "curl https://get.volta.sh | bash" }, "devDependencies": { + "@biomejs/biome": "1.9.4", "@types/node": "^22.14.1", - "@typescript-eslint/eslint-plugin": "^8.31.0", - "@typescript-eslint/parser": "^8.31.0", - "eslint": "^9.25.1", "fs": "0.0.1-security", "inquirer": "^12.5.2", "path": "^0.12.7", - "prettier": "^3.5.3", "ts-node": "^10.9.2", "turbo": "^2.5.1", "typescript": "5.8.3" diff --git a/packages.bak/client/package.json b/packages.bak/client/package.json index aff5125a..2db77d7b 100644 --- a/packages.bak/client/package.json +++ b/packages.bak/client/package.json @@ -24,7 +24,7 @@ "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-refresh": "^0.4.16", "globals": "^15.14.0", - "typescript": "^5.7.3", + "typescript": "^5.8.3", "typescript-eslint": "^8.18.2", "vite": "^6.0.5" } diff --git a/packages.bak/rdx-criteria/package.json b/packages.bak/rdx-criteria/package.json index ceb6578c..9649c591 100644 --- a/packages.bak/rdx-criteria/package.json +++ b/packages.bak/rdx-criteria/package.json @@ -13,6 +13,6 @@ "@types/node": "^22.10.7", "eslint-config-codely": "^3.1.4", "tsx": "^4.13.2", - "typescript": "^5.7.3" + "typescript": "^5.8.3" } } diff --git a/packages.bak/rdx-ddd-domain/package.json b/packages.bak/rdx-ddd-domain/package.json index ce254390..e5cd34fe 100644 --- a/packages.bak/rdx-ddd-domain/package.json +++ b/packages.bak/rdx-ddd-domain/package.json @@ -26,7 +26,7 @@ "@repo/typescript-config": "workspace:*", "@types/dinero.js": "^1.9.4", "jest": "^29.7.0", - "typescript": "^5.7.3" + "typescript": "^5.8.3" }, "dependencies": { "dinero.js": "^1.9.1", diff --git a/packages.bak/rdx-module/package.json b/packages.bak/rdx-module/package.json index 5dd8b688..c013843e 100644 --- a/packages.bak/rdx-module/package.json +++ b/packages.bak/rdx-module/package.json @@ -28,7 +28,7 @@ "@types/node": "^22.14.0", "@types/react": "^19.1.2", "jest": "^29.7.0", - "typescript": "^5.7.3" + "typescript": "^5.8.3" }, "dependencies": { "express": "^4.21.2", diff --git a/packages/typescript-config/express.json b/packages/typescript-config/express.json index 379b7940..944bbe72 100644 --- a/packages/typescript-config/express.json +++ b/packages/typescript-config/express.json @@ -2,60 +2,13 @@ "$schema": "https://json.schemastore.org/tsconfig", "display": "ExpressJS Server", - "extends": "./base.json", // Extiende la configuración base definida en base.json. - - /*"ts-node": { - "compilerOptions": { - "module": "commonjs", - "moduleResolution": "Node10" - } - },*/ - - "compilerOptions": { - /* Basic Options */ - "target": "ES2022" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */, - "module": "NodeNext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, - - "allowJs": false /* Allow javascript files to be compiled. */, - "pretty": true, - - "jsx": "preserve" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */, - - "sourceMap": false /* Generates corresponding '.map' file. */, - "removeComments": true /* Do not emit comments to output. */, - - /* Strict Type-Checking Options */ - "skipLibCheck": true /* Skip type checking of declaration files. */, - "strict": true /* Enable all strict type-checking options. */, - "noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */, - "strictNullChecks": true /* Enable strict null checks. */, - "strictFunctionTypes": true /* Enable strict checking of function types. */, - "strictPropertyInitialization": false /* Enable strict checking of property initialization in classes. */, - "noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */, - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - "noUnusedLocals": false /* Report errors on unused locals. */, - "noUnusedParameters": false /* Report errors on unused parameters. */, - "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, - "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, - - /* Module Resolution Options */ - "moduleResolution": "nodenext" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, - - "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */, - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, - "forceConsistentCasingInFileNames": false, // Obliga a que los nombres de archivo sean consistentes en cuanto a mayúsculas y minúsculas. - - /* Experimental Options */ - "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */, - "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */, - - /* Advanced Options */ - "resolveJsonModule": true, // Permite importar archivos JSON como módulos. - "suppressImplicitAnyIndexErrors": false, - "verbatimModuleSyntax": false // Mantiene la sintaxis de los módulos tal como está escrita en el código fuente. - - //"baseUrl": "./" /* Base directory to resolve non-absolute module names. */, - } +"compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "moduleResolution": "Node", + "importsNotUsedAsValues": "remove", + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": false, + }, } diff --git a/packages/ui/eslint.config.mjs b/packages/ui/eslint.config.mjs deleted file mode 100644 index abf0fd0e..00000000 --- a/packages/ui/eslint.config.mjs +++ /dev/null @@ -1,4 +0,0 @@ -import reactInternalConfig from "@repo/eslint-config/react-internal"; - -/** @type {import("eslint").Linter.Config[]} */ -export default [...reactInternalConfig]; diff --git a/packages/ui/src/components/button.tsx b/packages/ui/src/components/button.tsx index f9c6fc34..997791fd 100644 --- a/packages/ui/src/components/button.tsx +++ b/packages/ui/src/components/button.tsx @@ -1,5 +1,5 @@ import { Slot } from "@radix-ui/react-slot"; -import { cva, type VariantProps } from "class-variance-authority"; +import { type VariantProps, cva } from "class-variance-authority"; import * as React from "react"; import { cn } from "@repo/ui/lib/utils"; diff --git a/packages/ui/src/lib/utils.ts b/packages/ui/src/lib/utils.ts index a5ef1935..365058ce 100644 --- a/packages/ui/src/lib/utils.ts +++ b/packages/ui/src/lib/utils.ts @@ -1,4 +1,4 @@ -import { clsx, type ClassValue } from "clsx"; +import { type ClassValue, clsx } from "clsx"; import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { diff --git a/packages/ui/tsconfig.lint.json b/packages/ui/tsconfig.lint.json deleted file mode 100644 index df2762ee..00000000 --- a/packages/ui/tsconfig.lint.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "@repo/typescript-config/react-library.json", - "compilerOptions": { - "outDir": "dist" - }, - "include": ["src", "turbo"], - "exclude": ["node_modules", "dist"] -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 038b5c5f..e430e96e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,18 +8,12 @@ importers: .: devDependencies: + '@biomejs/biome': + specifier: 1.9.4 + version: 1.9.4 '@types/node': specifier: ^22.14.1 version: 22.15.3 - '@typescript-eslint/eslint-plugin': - specifier: ^8.31.0 - version: 8.31.1(@typescript-eslint/parser@8.31.1(eslint@9.25.1(jiti@2.4.2))(typescript@5.8.3))(eslint@9.25.1(jiti@2.4.2))(typescript@5.8.3) - '@typescript-eslint/parser': - specifier: ^8.31.0 - version: 8.31.1(eslint@9.25.1(jiti@2.4.2))(typescript@5.8.3) - eslint: - specifier: ^9.25.1 - version: 9.25.1(jiti@2.4.2) fs: specifier: 0.0.1-security version: 0.0.1-security @@ -29,9 +23,6 @@ importers: path: specifier: ^0.12.7 version: 0.12.7 - prettier: - specifier: ^3.5.3 - version: 3.5.3 ts-node: specifier: ^10.9.2 version: 10.9.2(@types/node@22.15.3)(typescript@5.8.3) @@ -132,9 +123,9 @@ importers: specifier: ^3.24.1 version: 3.24.3 devDependencies: - '@repo/eslint-config': - specifier: workspace:* - version: link:../../packages/eslint-config + '@biomejs/biome': + specifier: 1.9.4 + version: 1.9.4 '@repo/typescript-config': specifier: workspace:* version: link:../../packages/typescript-config @@ -198,8 +189,14 @@ importers: tsconfig-paths: specifier: ^4.2.0 version: 4.2.0 + tsup: + specifier: 8.4.0 + version: 8.4.0(jiti@2.4.2)(postcss@8.5.3)(tsx@4.19.4)(typescript@5.8.3) + tsx: + specifier: 4.19.4 + version: 4.19.4 typescript: - specifier: ^5.7.3 + specifier: ^5.8.3 version: 5.8.3 apps/web: @@ -228,7 +225,7 @@ importers: version: 19.1.3(@types/react@19.1.2) '@vitejs/plugin-react': specifier: ^4.4.1 - version: 4.4.1(vite@6.3.4(@types/node@22.15.3)(jiti@2.4.2)(lightningcss@1.29.2)) + version: 4.4.1(vite@6.3.4(@types/node@22.15.3)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.4)) globals: specifier: ^16.0.0 version: 16.0.0 @@ -240,7 +237,7 @@ importers: version: 8.31.1(eslint@9.25.1(jiti@2.4.2))(typescript@5.8.3) vite: specifier: ^6.3.4 - version: 6.3.4(@types/node@22.15.3)(jiti@2.4.2)(lightningcss@1.29.2) + version: 6.3.4(@types/node@22.15.3)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.4) packages/eslint-config: devDependencies: @@ -532,6 +529,59 @@ packages: '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + '@biomejs/biome@1.9.4': + resolution: {integrity: sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==} + engines: {node: '>=14.21.3'} + hasBin: true + + '@biomejs/cli-darwin-arm64@1.9.4': + resolution: {integrity: sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [darwin] + + '@biomejs/cli-darwin-x64@1.9.4': + resolution: {integrity: sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [darwin] + + '@biomejs/cli-linux-arm64-musl@1.9.4': + resolution: {integrity: sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + + '@biomejs/cli-linux-arm64@1.9.4': + resolution: {integrity: sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + + '@biomejs/cli-linux-x64-musl@1.9.4': + resolution: {integrity: sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + + '@biomejs/cli-linux-x64@1.9.4': + resolution: {integrity: sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + + '@biomejs/cli-win32-arm64@1.9.4': + resolution: {integrity: sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [win32] + + '@biomejs/cli-win32-x64@1.9.4': + resolution: {integrity: sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [win32] + '@colors/colors@1.6.0': resolution: {integrity: sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==} engines: {node: '>=0.1.90'} @@ -1140,6 +1190,10 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} + '@pkgjs/parseargs@0.11.0': + resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} + engines: {node: '>=14'} + '@radix-ui/react-compose-refs@1.1.2': resolution: {integrity: sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==} peerDependencies: @@ -1645,6 +1699,9 @@ packages: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} + any-promise@1.3.0: + resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} + anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -1801,10 +1858,20 @@ packages: buffer@5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + bundle-require@5.1.0: + resolution: {integrity: sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + peerDependencies: + esbuild: '>=0.18' + bytes@3.1.2: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} + cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + call-bind-apply-helpers@1.0.2: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} engines: {node: '>= 0.4'} @@ -1861,6 +1928,10 @@ packages: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} + chokidar@4.0.3: + resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} + engines: {node: '>= 14.16.0'} + chownr@2.0.0: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} engines: {node: '>=10'} @@ -1948,9 +2019,17 @@ packages: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} engines: {node: '>=14'} + commander@4.1.1: + resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} + engines: {node: '>= 6'} + concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + consola@3.4.2: + resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} + engines: {node: ^14.18.0 || >=16.10.0} + console-control-strings@1.1.0: resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} @@ -2496,6 +2575,9 @@ packages: resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} engines: {node: '>= 0.4'} + get-tsconfig@4.10.0: + resolution: {integrity: sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==} + get-uri@6.0.4: resolution: {integrity: sha512-E1b1lFFLvLgak2whF2xDBcOy6NLVGZBqqjJjsIhvopKfWWEi64pLVTWWehV8KlLerZkfNTA95sTe2OdJKm1OzQ==} engines: {node: '>= 14'} @@ -2508,6 +2590,10 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} + glob@10.4.5: + resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} + hasBin: true + glob@11.0.2: resolution: {integrity: sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==} engines: {node: 20 || >=22} @@ -2889,6 +2975,9 @@ packages: resolution: {integrity: sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==} engines: {node: '>= 0.4'} + jackspeak@3.4.3: + resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + jackspeak@4.1.0: resolution: {integrity: sha512-9DDdhb5j6cpeitCbvLO7n7J4IxnbM6hoF6O1g4HQ5TfhvvKN8ywDM7668ZhMHRqVmxqhps/F6syWK2KcPxYlkw==} engines: {node: 20 || >=22} @@ -3031,6 +3120,10 @@ packages: resolution: {integrity: sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==} hasBin: true + joycon@3.1.1: + resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} + engines: {node: '>=10'} + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -3169,9 +3262,17 @@ packages: resolution: {integrity: sha512-6b6gd/RUXKaw5keVdSEtqFVdzWnU5jMxTUjA2bVcMNPLwSQ08Sv/UodBVtETLCn7k4S1Ibxwh7k68IwLZPgKaA==} engines: {node: '>= 12.0.0'} + lilconfig@3.1.3: + resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} + engines: {node: '>=14'} + lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + load-tsconfig@0.2.5: + resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -3211,6 +3312,9 @@ packages: lodash.once@4.1.1: resolution: {integrity: sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==} + lodash.sortby@4.7.0: + resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} + lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} @@ -3239,6 +3343,9 @@ packages: lower-case@1.1.4: resolution: {integrity: sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==} + lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + lru-cache@11.1.0: resolution: {integrity: sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==} engines: {node: 20 || >=22} @@ -3389,6 +3496,9 @@ packages: resolution: {integrity: sha512-7ytuPQJjQB8TNAYX/H2yhL+iQOnIBjAMam361R7UAL0lOVXWjtdrmoL9HYKqKoLp/8UUTRcvo1QPvK9KL7wA8w==} engines: {node: '>= 8.0'} + mz@2.7.0: + resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + named-placeholders@1.1.3: resolution: {integrity: sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==} engines: {node: '>=12.0.0'} @@ -3621,6 +3731,10 @@ packages: path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + path-scurry@1.11.1: + resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} + engines: {node: '>=16 || 14 >=14.18'} + path-scurry@2.0.0: resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==} engines: {node: 20 || >=22} @@ -3667,6 +3781,24 @@ packages: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} + postcss-load-config@6.0.1: + resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==} + engines: {node: '>= 18'} + peerDependencies: + jiti: '>=1.21.0' + postcss: '>=8.0.9' + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + jiti: + optional: true + postcss: + optional: true + tsx: + optional: true + yaml: + optional: true + postcss@8.5.3: resolution: {integrity: sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==} engines: {node: ^10 || ^12 || >=14} @@ -3675,11 +3807,6 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - prettier@3.5.3: - resolution: {integrity: sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==} - engines: {node: '>=14'} - hasBin: true - pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -3762,6 +3889,10 @@ packages: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} + readdirp@4.1.2: + resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} + engines: {node: '>= 14.18.0'} + reflect-metadata@0.2.2: resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==} @@ -3796,6 +3927,9 @@ packages: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + resolve.exports@2.0.3: resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} engines: {node: '>=10'} @@ -4039,6 +4173,10 @@ packages: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + source-map@0.8.0-beta.0: + resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} + engines: {node: '>= 8'} + sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} @@ -4122,6 +4260,11 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + sucrase@3.35.0: + resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} + engines: {node: '>=16 || 14 >=14.17'} + hasBin: true + supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -4162,12 +4305,22 @@ packages: text-hex@1.0.0: resolution: {integrity: sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==} + thenify-all@1.6.0: + resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} + engines: {node: '>=0.8'} + + thenify@3.3.1: + resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} tinycolor2@1.6.0: resolution: {integrity: sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==} + tinyexec@0.3.2: + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + tinyglobby@0.2.13: resolution: {integrity: sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==} engines: {node: '>=12.0.0'} @@ -4203,6 +4356,9 @@ packages: tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + tr46@1.0.1: + resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} + tree-kill@1.2.2: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} hasBin: true @@ -4217,6 +4373,9 @@ packages: peerDependencies: typescript: '>=4.8.4' + ts-interface-checker@0.1.13: + resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + ts-jest@29.3.2: resolution: {integrity: sha512-bJJkrWc6PjFVz5g2DGCNUo8z7oFEYaz1xP1NpeDU7KNLMWPpEyV8Chbpkn8xjzgRDpQhnGMyvyldoL7h8JXyug==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} @@ -4279,6 +4438,30 @@ packages: tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + tsup@8.4.0: + resolution: {integrity: sha512-b+eZbPCjz10fRryaAA7C8xlIHnf8VnsaRqydheLIqwG/Mcpfk8Z5zp3HayX7GaTygkigHl5cBUs+IhcySiIexQ==} + engines: {node: '>=18'} + hasBin: true + peerDependencies: + '@microsoft/api-extractor': ^7.36.0 + '@swc/core': ^1 + postcss: ^8.4.12 + typescript: '>=4.5.0' + peerDependenciesMeta: + '@microsoft/api-extractor': + optional: true + '@swc/core': + optional: true + postcss: + optional: true + typescript: + optional: true + + tsx@4.19.4: + resolution: {integrity: sha512-gK5GVzDkJK1SI1zwHf32Mqxf2tSJkNx+eYcNly5+nHvWqXUJYUkWBQtKauoESz3ymezAI++ZwT855x5p5eop+Q==} + engines: {node: '>=18.0.0'} + hasBin: true + turbo-darwin-64@2.5.1: resolution: {integrity: sha512-U9lT1rZ20PQjEYDiNE0aZrU6K+StAE8rood9xn3pV1w+CSby56HkdR2AffzMdFf8iPTeZfcY1qL62rDcCeRPTw==} cpu: [x64] @@ -4495,9 +4678,15 @@ packages: webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + webidl-conversions@4.0.2: + resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} + whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + whatwg-url@7.1.0: + resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} + which-boxed-primitive@1.1.1: resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==} engines: {node: '>= 0.4'} @@ -4814,6 +5003,41 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} + '@biomejs/biome@1.9.4': + optionalDependencies: + '@biomejs/cli-darwin-arm64': 1.9.4 + '@biomejs/cli-darwin-x64': 1.9.4 + '@biomejs/cli-linux-arm64': 1.9.4 + '@biomejs/cli-linux-arm64-musl': 1.9.4 + '@biomejs/cli-linux-x64': 1.9.4 + '@biomejs/cli-linux-x64-musl': 1.9.4 + '@biomejs/cli-win32-arm64': 1.9.4 + '@biomejs/cli-win32-x64': 1.9.4 + + '@biomejs/cli-darwin-arm64@1.9.4': + optional: true + + '@biomejs/cli-darwin-x64@1.9.4': + optional: true + + '@biomejs/cli-linux-arm64-musl@1.9.4': + optional: true + + '@biomejs/cli-linux-arm64@1.9.4': + optional: true + + '@biomejs/cli-linux-x64-musl@1.9.4': + optional: true + + '@biomejs/cli-linux-x64@1.9.4': + optional: true + + '@biomejs/cli-win32-arm64@1.9.4': + optional: true + + '@biomejs/cli-win32-x64@1.9.4': + optional: true + '@colors/colors@1.6.0': {} '@cspotcode/source-map-support@0.8.1': @@ -5383,6 +5607,9 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.19.1 + '@pkgjs/parseargs@0.11.0': + optional: true + '@radix-ui/react-compose-refs@1.1.2(@types/react@19.1.2)(react@19.1.0)': dependencies: react: 19.1.0 @@ -5838,14 +6065,14 @@ snapshots: '@typescript-eslint/types': 8.31.1 eslint-visitor-keys: 4.2.0 - '@vitejs/plugin-react@4.4.1(vite@6.3.4(@types/node@22.15.3)(jiti@2.4.2)(lightningcss@1.29.2))': + '@vitejs/plugin-react@4.4.1(vite@6.3.4(@types/node@22.15.3)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.4))': dependencies: '@babel/core': 7.26.10 '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.26.10) '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/core@7.26.10) '@types/babel__core': 7.20.5 react-refresh: 0.17.0 - vite: 6.3.4(@types/node@22.15.3)(jiti@2.4.2)(lightningcss@1.29.2) + vite: 6.3.4(@types/node@22.15.3)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.4) transitivePeerDependencies: - supports-color @@ -5906,6 +6133,8 @@ snapshots: ansi-styles@6.2.1: {} + any-promise@1.3.0: {} + anymatch@3.1.3: dependencies: normalize-path: 3.0.0 @@ -6130,8 +6359,15 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 + bundle-require@5.1.0(esbuild@0.25.3): + dependencies: + esbuild: 0.25.3 + load-tsconfig: 0.2.5 + bytes@3.1.2: {} + cac@6.7.14: {} + call-bind-apply-helpers@1.0.2: dependencies: es-errors: 1.3.0 @@ -6215,6 +6451,10 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + chokidar@4.0.3: + dependencies: + readdirp: 4.1.2 + chownr@2.0.0: {} ci-info@3.9.0: {} @@ -6286,8 +6526,12 @@ snapshots: commander@10.0.1: {} + commander@4.1.1: {} + concat-map@0.0.1: {} + consola@3.4.2: {} + console-control-strings@1.1.0: {} constant-case@2.0.0: @@ -7016,6 +7260,10 @@ snapshots: es-errors: 1.3.0 get-intrinsic: 1.3.0 + get-tsconfig@4.10.0: + dependencies: + resolve-pkg-maps: 1.0.0 + get-uri@6.0.4: dependencies: basic-ftp: 5.0.5 @@ -7032,6 +7280,15 @@ snapshots: dependencies: is-glob: 4.0.3 + glob@10.4.5: + dependencies: + foreground-child: 3.3.1 + jackspeak: 3.4.3 + minimatch: 9.0.5 + minipass: 7.1.2 + package-json-from-dist: 1.0.1 + path-scurry: 1.11.1 + glob@11.0.2: dependencies: foreground-child: 3.3.1 @@ -7455,6 +7712,12 @@ snapshots: has-symbols: 1.1.0 set-function-name: 2.0.2 + jackspeak@3.4.3: + dependencies: + '@isaacs/cliui': 8.0.2 + optionalDependencies: + '@pkgjs/parseargs': 0.11.0 + jackspeak@4.1.0: dependencies: '@isaacs/cliui': 8.0.2 @@ -7777,6 +8040,8 @@ snapshots: jiti@2.4.2: {} + joycon@3.1.1: {} + js-tokens@4.0.0: {} js-yaml@3.14.1: @@ -7901,8 +8166,12 @@ snapshots: lightningcss-win32-arm64-msvc: 1.29.2 lightningcss-win32-x64-msvc: 1.29.2 + lilconfig@3.1.3: {} + lines-and-columns@1.2.4: {} + load-tsconfig@0.2.5: {} + locate-path@5.0.0: dependencies: p-locate: 4.1.0 @@ -7931,6 +8200,8 @@ snapshots: lodash.once@4.1.1: {} + lodash.sortby@4.7.0: {} + lodash@4.17.21: {} log-symbols@3.0.0: @@ -7963,6 +8234,8 @@ snapshots: lower-case@1.1.4: {} + lru-cache@10.4.3: {} + lru-cache@11.1.0: {} lru-cache@5.1.1: @@ -8085,6 +8358,12 @@ snapshots: seq-queue: 0.0.5 sqlstring: 2.3.3 + mz@2.7.0: + dependencies: + any-promise: 1.3.0 + object-assign: 4.1.1 + thenify-all: 1.6.0 + named-placeholders@1.1.3: dependencies: lru-cache: 7.18.3 @@ -8351,6 +8630,11 @@ snapshots: path-parse@1.0.7: {} + path-scurry@1.11.1: + dependencies: + lru-cache: 10.4.3 + minipass: 7.1.2 + path-scurry@2.0.0: dependencies: lru-cache: 11.1.0 @@ -8385,6 +8669,14 @@ snapshots: possible-typed-array-names@1.1.0: {} + postcss-load-config@6.0.1(jiti@2.4.2)(postcss@8.5.3)(tsx@4.19.4): + dependencies: + lilconfig: 3.1.3 + optionalDependencies: + jiti: 2.4.2 + postcss: 8.5.3 + tsx: 4.19.4 + postcss@8.5.3: dependencies: nanoid: 3.3.11 @@ -8393,8 +8685,6 @@ snapshots: prelude-ls@1.2.1: {} - prettier@3.5.3: {} - pretty-format@29.7.0: dependencies: '@jest/schemas': 29.6.3 @@ -8485,6 +8775,8 @@ snapshots: dependencies: picomatch: 2.3.1 + readdirp@4.1.2: {} + reflect-metadata@0.2.2: {} reflect.getprototypeof@1.0.10: @@ -8526,6 +8818,8 @@ snapshots: resolve-from@5.0.0: {} + resolve-pkg-maps@1.0.0: {} + resolve.exports@2.0.3: {} resolve@1.22.10: @@ -8802,6 +9096,10 @@ snapshots: source-map@0.6.1: {} + source-map@0.8.0-beta.0: + dependencies: + whatwg-url: 7.1.0 + sprintf-js@1.0.3: {} sprintf-js@1.1.3: {} @@ -8899,6 +9197,16 @@ snapshots: strip-json-comments@3.1.1: {} + sucrase@3.35.0: + dependencies: + '@jridgewell/gen-mapping': 0.3.8 + commander: 4.1.1 + glob: 10.4.5 + lines-and-columns: 1.2.4 + mz: 2.7.0 + pirates: 4.0.7 + ts-interface-checker: 0.1.13 + supports-color@5.5.0: dependencies: has-flag: 3.0.0 @@ -8941,10 +9249,20 @@ snapshots: text-hex@1.0.0: {} + thenify-all@1.6.0: + dependencies: + thenify: 3.3.1 + + thenify@3.3.1: + dependencies: + any-promise: 1.3.0 + through@2.3.8: {} tinycolor2@1.6.0: {} + tinyexec@0.3.2: {} + tinyglobby@0.2.13: dependencies: fdir: 6.4.4(picomatch@4.0.2) @@ -8978,6 +9296,10 @@ snapshots: tr46@0.0.3: {} + tr46@1.0.1: + dependencies: + punycode: 2.3.1 + tree-kill@1.2.2: {} triple-beam@1.4.1: {} @@ -8986,6 +9308,8 @@ snapshots: dependencies: typescript: 5.8.3 + ts-interface-checker@0.1.13: {} + ts-jest@29.3.2(@babel/core@7.26.10)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.10))(esbuild@0.24.2)(jest@29.7.0(@types/node@22.15.3)(ts-node@10.9.2(@types/node@22.15.3)(typescript@5.8.3)))(typescript@5.8.3): dependencies: bs-logger: 0.2.6 @@ -9060,6 +9384,40 @@ snapshots: tslib@2.8.1: {} + tsup@8.4.0(jiti@2.4.2)(postcss@8.5.3)(tsx@4.19.4)(typescript@5.8.3): + dependencies: + bundle-require: 5.1.0(esbuild@0.25.3) + cac: 6.7.14 + chokidar: 4.0.3 + consola: 3.4.2 + debug: 4.4.0(supports-color@5.5.0) + esbuild: 0.25.3 + joycon: 3.1.1 + picocolors: 1.1.1 + postcss-load-config: 6.0.1(jiti@2.4.2)(postcss@8.5.3)(tsx@4.19.4) + resolve-from: 5.0.0 + rollup: 4.40.1 + source-map: 0.8.0-beta.0 + sucrase: 3.35.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.13 + tree-kill: 1.2.2 + optionalDependencies: + postcss: 8.5.3 + typescript: 5.8.3 + transitivePeerDependencies: + - jiti + - supports-color + - tsx + - yaml + + tsx@4.19.4: + dependencies: + esbuild: 0.25.3 + get-tsconfig: 4.10.0 + optionalDependencies: + fsevents: 2.3.3 + turbo-darwin-64@2.5.1: optional: true @@ -9216,7 +9574,7 @@ snapshots: vary@1.1.2: {} - vite@6.3.4(@types/node@22.15.3)(jiti@2.4.2)(lightningcss@1.29.2): + vite@6.3.4(@types/node@22.15.3)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.4): dependencies: esbuild: 0.25.3 fdir: 6.4.4(picomatch@4.0.2) @@ -9229,6 +9587,7 @@ snapshots: fsevents: 2.3.3 jiti: 2.4.2 lightningcss: 1.29.2 + tsx: 4.19.4 walker@1.0.8: dependencies: @@ -9240,11 +9599,19 @@ snapshots: webidl-conversions@3.0.1: {} + webidl-conversions@4.0.2: {} + whatwg-url@5.0.0: dependencies: tr46: 0.0.3 webidl-conversions: 3.0.1 + whatwg-url@7.1.0: + dependencies: + lodash.sortby: 4.7.0 + tr46: 1.0.1 + webidl-conversions: 4.0.2 + which-boxed-primitive@1.1.1: dependencies: is-bigint: 1.1.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 26289377..089d23bc 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -4,6 +4,7 @@ packages: - packages/* onlyBuiltDependencies: + - '@biomejs/biome' - bcrypt - core-js-pure - esbuild diff --git a/turbo.json b/turbo.json index fef65f42..940a7fbd 100644 --- a/turbo.json +++ b/turbo.json @@ -7,8 +7,9 @@ "cache": false, "persistent": true }, - "lint": { - "dependsOn": ["^lint"] + "//#format-and-lint": {}, + "//#format-and-lint:fix": { + "cache": false }, "build": { "cache": false,