diff --git a/luna-backend/.prettierrc b/luna-backend/.prettierrc index dcb72794..b7fdccac 100644 --- a/luna-backend/.prettierrc +++ b/luna-backend/.prettierrc @@ -1,4 +1,5 @@ { "singleQuote": true, - "trailingComma": "all" -} \ No newline at end of file + "trailingComma": "all", + "printWidth": 200 +} diff --git a/luna-backend/src/application/authz/AuthzPublicProvider.ts b/luna-backend/src/application/authz/AuthzPublicProvider.ts index d0c03124..2f7f1c78 100644 --- a/luna-backend/src/application/authz/AuthzPublicProvider.ts +++ b/luna-backend/src/application/authz/AuthzPublicProvider.ts @@ -4,13 +4,16 @@ import { BaseAuthzProvider } from '../../infrastructure/authz/authz-provider/Bas export class AuthzPublicProvider extends BaseAuthzProvider { getStatements() { return [ - // ... + // this.estadoFind, + // this.cidadeFind, + // this.campusFind, this.campusCreate, this.campusUpdate, this.campusDelete, + // ]; } diff --git a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-delete/ICampusDeleteOneByIdInputDto.ts b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-delete/ICampusDeleteOneByIdInputDto.ts index 76c507e4..27f72fcf 100644 --- a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-delete/ICampusDeleteOneByIdInputDto.ts +++ b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-delete/ICampusDeleteOneByIdInputDto.ts @@ -1,5 +1,6 @@ import { ICampusFindOneByIdInputDto } from '../campus-find-one'; -export interface ICampusDeleteOneByIdInputDto extends ICampusFindOneByIdInputDto { +export interface ICampusDeleteOneByIdInputDto + extends ICampusFindOneByIdInputDto { id: string; } diff --git a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-find-one/campus-find-one-by-id/ICampusFindOneByIdInputDto.ts b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-find-one/ICampusFindOneByIdInputDto.ts similarity index 60% rename from luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-find-one/campus-find-one-by-id/ICampusFindOneByIdInputDto.ts rename to luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-find-one/ICampusFindOneByIdInputDto.ts index fbbb0d96..4151502b 100644 --- a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-find-one/campus-find-one-by-id/ICampusFindOneByIdInputDto.ts +++ b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-find-one/ICampusFindOneByIdInputDto.ts @@ -1,4 +1,4 @@ -import { ICampusModel } from '../../../(models)/ICampusModel'; +import { ICampusModel } from '../../(models)/ICampusModel'; export interface ICampusFindOneByIdInputDto extends Pick { id: string; diff --git a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-find-one/campus-find-one-by-id/index.ts b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-find-one/campus-find-one-by-id/index.ts deleted file mode 100644 index 7dffbcd9..00000000 --- a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-find-one/campus-find-one-by-id/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './ICampusFindOneByIdInputDto'; diff --git a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-find-one/index.ts b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-find-one/index.ts index cceaa509..8f4e765d 100644 --- a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-find-one/index.ts +++ b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-find-one/index.ts @@ -1,2 +1,2 @@ +export * from './ICampusFindOneByIdInputDto'; export * from './ICampusFindOneResultDto'; -export * from './campus-find-one-by-id'; diff --git a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/campus-create/ICampusCreateDto.ts b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/ICampusCreateDto.ts similarity index 53% rename from luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/campus-create/ICampusCreateDto.ts rename to luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/ICampusCreateDto.ts index 8666d45a..a941c760 100644 --- a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/campus-create/ICampusCreateDto.ts +++ b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/ICampusCreateDto.ts @@ -1,3 +1,3 @@ -import { ICampusInputDto } from '../ICampusInputDto'; +import { ICampusInputDto } from './ICampusInputDto'; export interface ICampusCreateDto extends ICampusInputDto {} diff --git a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/campus-update/ICampusUpdateDto.ts b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/ICampusUpdateDto.ts similarity index 54% rename from luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/campus-update/ICampusUpdateDto.ts rename to luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/ICampusUpdateDto.ts index 3f2be342..7b236928 100644 --- a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/campus-update/ICampusUpdateDto.ts +++ b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/ICampusUpdateDto.ts @@ -1,16 +1,24 @@ -import { IEnderecoInputDto } from '../../../../endereco'; -import { ICampusFindOneByIdInputDto } from '../../campus-find-one'; -import { ICampusInputDto } from '../ICampusInputDto'; +import { IEnderecoInputDto } from '../../../endereco'; +import { ICampusFindOneByIdInputDto } from '../campus-find-one'; +import { ICampusInputDto } from './ICampusInputDto'; export interface ICampusUpdateDto extends ICampusFindOneByIdInputDto, Partial { + // + id: string; + // + razaoSocial?: string; nomeFantasia?: string; apelido?: string; cnpj?: string; + // + endereco?: IEnderecoInputDto; + + // } diff --git a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/campus-create/index.ts b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/campus-create/index.ts deleted file mode 100644 index bb076347..00000000 --- a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/campus-create/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './ICampusCreateDto'; diff --git a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/campus-update/index.ts b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/campus-update/index.ts deleted file mode 100644 index caaff36e..00000000 --- a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/campus-update/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './ICampusUpdateDto'; diff --git a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/index.ts b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/index.ts index 7fdca6ab..491f4001 100644 --- a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/index.ts +++ b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(dtos)/campus-input/index.ts @@ -1,3 +1,3 @@ +export * from './ICampusCreateDto'; export * from './ICampusInputDto'; -export * from './campus-create'; -export * from './campus-update'; +export * from './ICampusUpdateDto'; diff --git a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(models)/ICampusModel.ts b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(models)/ICampusModel.ts index 68e967cf..55db9cb1 100644 --- a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(models)/ICampusModel.ts +++ b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/campus/(models)/ICampusModel.ts @@ -1,9 +1,13 @@ -import { IDatedObject, IObjectUuid } from '../../../(core)'; +import { IDatedObject, IEntityDate, IObjectUuid } from '../../../(core)'; import { IEnderecoModel } from '../../endereco'; export interface ICampusModel extends IObjectUuid, IDatedObject { // + id: string; + + // + razaoSocial: string; nomeFantasia: string; apelido: string; @@ -12,4 +16,12 @@ export interface ICampusModel extends IObjectUuid, IDatedObject { // endereco: IEnderecoModel; + + // + + dateCreated: IEntityDate; + dateUpdated: IEntityDate; + dateDeleted: null | IEntityDate; + + // } diff --git a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(dtos)/endereco-find-one/endereco-find-one-by-id/IEnderecoFindOneByIdInputDto.ts b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(dtos)/endereco-find-one/IEnderecoFindOneByIdInputDto.ts similarity index 60% rename from luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(dtos)/endereco-find-one/endereco-find-one-by-id/IEnderecoFindOneByIdInputDto.ts rename to luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(dtos)/endereco-find-one/IEnderecoFindOneByIdInputDto.ts index 31e10a5d..98f92408 100644 --- a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(dtos)/endereco-find-one/endereco-find-one-by-id/IEnderecoFindOneByIdInputDto.ts +++ b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(dtos)/endereco-find-one/IEnderecoFindOneByIdInputDto.ts @@ -1,4 +1,4 @@ -import { IEnderecoModel } from '../../../(models)'; +import { IEnderecoModel } from '../../(models)'; export interface IEnderecoFindOneByIdInputDto { id: IEnderecoModel['id']; diff --git a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(dtos)/endereco-find-one/endereco-find-one-by-id/index.ts b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(dtos)/endereco-find-one/endereco-find-one-by-id/index.ts deleted file mode 100644 index 6145cb97..00000000 --- a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(dtos)/endereco-find-one/endereco-find-one-by-id/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './IEnderecoFindOneByIdInputDto'; diff --git a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(dtos)/endereco-find-one/index.ts b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(dtos)/endereco-find-one/index.ts index 9ef2b854..c45c9006 100644 --- a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(dtos)/endereco-find-one/index.ts +++ b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(dtos)/endereco-find-one/index.ts @@ -1,2 +1,2 @@ +export * from './IEnderecoFindOneByIdInputDto'; export * from './IEnderecoFindOneResultDto'; -export * from './endereco-find-one-by-id'; diff --git a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(models)/IEnderecoModel.ts b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(models)/IEnderecoModel.ts index 8404b758..79295458 100644 --- a/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(models)/IEnderecoModel.ts +++ b/luna-backend/src/application/core-business/(dtos)/interfaces/ambientes/endereco/(models)/IEnderecoModel.ts @@ -1,9 +1,13 @@ -import { IDatedObject, IObjectUuid } from '../../../(core)'; +import { IDatedObject, IEntityDate, IObjectUuid } from '../../../(core)'; import { ICidadeModel } from '../../base-cidade'; export interface IEnderecoModel extends IObjectUuid, IDatedObject { // + id: string; + + // + cep: string; logradouro: string; @@ -18,4 +22,10 @@ export interface IEnderecoModel extends IObjectUuid, IDatedObject { cidade: ICidadeModel; // + + dateCreated: IEntityDate; + dateUpdated: IEntityDate; + dateDeleted: null | IEntityDate; + + // } diff --git a/luna-backend/src/application/core-business/ambientes/campus/campus.controller.ts b/luna-backend/src/application/core-business/ambientes/campus/campus.controller.ts index ec262dbb..b9690c8e 100644 --- a/luna-backend/src/application/core-business/ambientes/campus/campus.controller.ts +++ b/luna-backend/src/application/core-business/ambientes/campus/campus.controller.ts @@ -68,7 +68,7 @@ export class CampusController { @HttpDtoBody(CampusOperations.CAMPUS_UPDATE) dto: Omit, ) { - const dtoUpdate = { + const dtoUpdate: ICampusUpdateDto = { ...dto, id, };