Skip to content

Commit

Permalink
Merge pull request #324 from ladesa-ro/dev/gabriel
Browse files Browse the repository at this point in the history
chore(api-service): refactor infrastructure
  • Loading branch information
guesant authored Oct 10, 2024
2 parents 578f665 + 696cbea commit d803026
Show file tree
Hide file tree
Showing 280 changed files with 243 additions and 259 deletions.
12 changes: 7 additions & 5 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/.github @ladesa-ro/security
CODEOWNERS @ladesa-ro/security
/package.json @ladesa-ro/security
**/*.sh @ladesa-ro/security
.husky/**/* @ladesa-ro/security
/.github @ladesa-ro/security
CODEOWNERS @ladesa-ro/security
package.json @ladesa-ro/security
pnpm-lock.yaml @ladesa-ro/security
pnpm-workspace.yaml @ladesa-ro/security
**/*.sh @ladesa-ro/security
.husky/**/* @ladesa-ro/security
3 changes: 0 additions & 3 deletions api-service/src/access-context/adapters/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion api-service/src/access-context/core/index.ts

This file was deleted.

3 changes: 0 additions & 3 deletions api-service/src/access-context/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion api-service/src/access-context/typings/index.ts

This file was deleted.

5 changes: 2 additions & 3 deletions api-service/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AppModulesModule } from "@/business-logic/resources/app-modules.module";
import { AdaptersModule } from "@/infrastructure/adapters";
import { AuthenticationModule } from "@/infrastructure/authentication";
import { AppConfigModule } from "@/infrastructure/config";
import { IntegrationsModule } from "@/infrastructure/integrations";
import { Module } from "@nestjs/common";
import { AppController } from "./app.controller";
import { AppResolver } from "./app.resolver";
Expand All @@ -11,9 +11,8 @@ import { AppService } from "./app.service";
imports: [
//
AppConfigModule,
AdaptersModule,
IntegrationsModule,
AuthenticationModule,
AdaptersModule,
AppModulesModule,
],
controllers: [AppController],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AccessContext } from "@/access-context";
import type { AccessContext } from "@/infrastructure/access-context";
import { Promisable } from "type-fest";
import { SelectQueryBuilder } from "typeorm";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextHttp } from "@/access-context";
import { CombinedInput, Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextHttp } from "@/infrastructure/access-context";
import LadesaTypings from "@ladesa-ro/especificacao";
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile } from "@nestjs/common";
import { ApiTags } from "@nestjs/swagger";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextGraphQl } from "@/access-context";
import { CombinedInput, Operation, graphqlExtractSelection } from "@/business-logic/standards";
import { type AccessContext, AccessContextGraphQl } from "@/infrastructure/access-context";
import LadesaTypings from "@ladesa-ro/especificacao";
import { Info as GqlInfo, Resolver as GqlResolver } from "@nestjs/graphql";
import type { GraphQLResolveInfo } from "graphql";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { AccessContext } from "@/access-context";
import { QbEfficientLoad } from "@/business-logic/standards/ladesa-spec/QbEfficientLoad";
import { LadesaPaginatedResultDto, LadesaSearch } from "@/business-logic/standards/ladesa-spec/search/search-strategies";
import { DatabaseContextService } from "@/infrastructure/adapters/adapter-database";
import type { AmbienteEntity } from "@/infrastructure/adapters/adapter-database/typeorm/entities";
import type { AccessContext } from "@/infrastructure/access-context";
import { paginateConfig } from "@/infrastructure/fixtures/utils/paginateConfig";
import { DatabaseContextService } from "@/infrastructure/integrations/database";
import type { AmbienteEntity } from "@/infrastructure/integrations/database/typeorm/entities";
import * as LadesaTypings from "@ladesa-ro/especificacao";
import { Injectable, NotFoundException } from "@nestjs/common";
import { map, pick } from "lodash";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextHttp } from "@/access-context";
import { CombinedInput, Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextHttp } from "@/infrastructure/access-context";
import LadesaTypings from "@ladesa-ro/especificacao";
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile } from "@nestjs/common";
import { ApiTags } from "@nestjs/swagger";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextGraphQl } from "@/access-context";
import { CombinedInput, Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextGraphQl } from "@/infrastructure/access-context";
import LadesaTypings from "@ladesa-ro/especificacao";
import { Resolver } from "@nestjs/graphql";
import { BlocoService } from "./bloco.service";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { AccessContext } from "@/access-context";
import { QbEfficientLoad } from "@/business-logic/standards/ladesa-spec/QbEfficientLoad";
import { LadesaPaginatedResultDto, LadesaSearch } from "@/business-logic/standards/ladesa-spec/search/search-strategies";
import { DatabaseContextService } from "@/infrastructure/adapters/adapter-database";
import type { BlocoEntity } from "@/infrastructure/adapters/adapter-database/typeorm/entities";
import type { AccessContext } from "@/infrastructure/access-context";
import { paginateConfig } from "@/infrastructure/fixtures";
import { DatabaseContextService } from "@/infrastructure/integrations/database";
import type { BlocoEntity } from "@/infrastructure/integrations/database/typeorm/entities";
import * as LadesaTypings from "@ladesa-ro/especificacao";
import { Injectable, NotFoundException } from "@nestjs/common";
import { map, pick } from "lodash";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextHttp } from "@/access-context";
import { CombinedInput, Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextHttp } from "@/infrastructure/access-context";
import LadesaTypings from "@ladesa-ro/especificacao";
import { Controller, Delete, Get, Patch, Post } from "@nestjs/common";
import { ApiTags } from "@nestjs/swagger";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextGraphQl } from "@/access-context";
import { CombinedInput, Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextGraphQl } from "@/infrastructure/access-context";
import LadesaTypings from "@ladesa-ro/especificacao";
import { Resolver } from "@nestjs/graphql";
import { CampusService } from "./campus.service";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { AccessContext } from "@/access-context";
import { QbEfficientLoad } from "@/business-logic/standards/ladesa-spec/QbEfficientLoad";
import { LadesaPaginatedResultDto, LadesaSearch } from "@/business-logic/standards/ladesa-spec/search/search-strategies";
import { DatabaseContextService } from "@/infrastructure/adapters/adapter-database";
import type { CampusEntity } from "@/infrastructure/adapters/adapter-database/typeorm/entities";
import type { AccessContext } from "@/infrastructure/access-context";
import { paginateConfig } from "@/infrastructure/fixtures";
import { DatabaseContextService } from "@/infrastructure/integrations/database";
import type { CampusEntity } from "@/infrastructure/integrations/database/typeorm/entities";
import * as LadesaTypings from "@ladesa-ro/especificacao";
import { Injectable, NotFoundException } from "@nestjs/common";
import { get, map, pick } from "lodash";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextHttp } from "@/access-context";
import { CombinedInput, Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextHttp } from "@/infrastructure/access-context";
import * as LadesaTypings from "@ladesa-ro/especificacao";
import { Controller, Get } from "@nestjs/common";
import { ApiTags } from "@nestjs/swagger";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextGraphQl } from "@/access-context";
import { CombinedInput, Operation, graphqlExtractSelection } from "@/business-logic/standards";
import { type AccessContext, AccessContextGraphQl } from "@/infrastructure/access-context";
import LadesaTypings from "@ladesa-ro/especificacao";
import { Info, Resolver } from "@nestjs/graphql";
import type { GraphQLResolveInfo } from "graphql";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { AccessContext } from "@/access-context";
import { QbEfficientLoad } from "@/business-logic/standards/ladesa-spec/QbEfficientLoad";
import { LadesaPaginatedResultDto, LadesaSearch } from "@/business-logic/standards/ladesa-spec/search/search-strategies";
import { DatabaseContextService } from "@/infrastructure/adapters/adapter-database";
import type { AccessContext } from "@/infrastructure/access-context";
import { paginateConfig } from "@/infrastructure/fixtures";
import { DatabaseContextService } from "@/infrastructure/integrations/database";
import * as LadesaTypings from "@ladesa-ro/especificacao";
import { Injectable, NotFoundException } from "@nestjs/common";
import { map } from "lodash";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AccessContext } from "@/access-context";
import { QbEfficientLoad } from "@/business-logic/standards/ladesa-spec/QbEfficientLoad";
import { DatabaseContextService } from "@/infrastructure/adapters/adapter-database";
import type { AccessContext } from "@/infrastructure/access-context";
import { DatabaseContextService } from "@/infrastructure/integrations/database";
import * as LadesaTypings from "@ladesa-ro/especificacao";
import { Injectable, NotFoundException } from "@nestjs/common";
import { pick } from "lodash";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextHttp } from "@/access-context";
import { CombinedInput, Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextHttp } from "@/infrastructure/access-context";
import LadesaTypings from "@ladesa-ro/especificacao";
import { Controller, Get } from "@nestjs/common";
import { ApiTags } from "@nestjs/swagger";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextGraphQl } from "@/access-context";
import { CombinedInput, Operation, graphqlExtractSelection } from "@/business-logic/standards";
import { type AccessContext, AccessContextGraphQl } from "@/infrastructure/access-context";
import * as LadesaTypings from "@ladesa-ro/especificacao";
import { Info, Resolver } from "@nestjs/graphql";
import type { GraphQLResolveInfo } from "graphql";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { AccessContext } from "@/access-context";
import { QbEfficientLoad } from "@/business-logic/standards/ladesa-spec/QbEfficientLoad";
import { LadesaPaginatedResultDto, LadesaSearch } from "@/business-logic/standards/ladesa-spec/search/search-strategies";
import { DatabaseContextService } from "@/infrastructure/adapters/adapter-database";
import type { AccessContext } from "@/infrastructure/access-context";
import { paginateConfig } from "@/infrastructure/fixtures";
import { DatabaseContextService } from "@/infrastructure/integrations/database";
import * as LadesaTypings from "@ladesa-ro/especificacao";
import { Injectable, NotFoundException } from "@nestjs/common";
import { map } from "lodash";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextHttp } from "@/access-context";
import { CombinedInput, Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextHttp } from "@/infrastructure/access-context";
import LadesaTypings from "@ladesa-ro/especificacao";
import { Controller, Delete, Get, Patch, Post } from "@nestjs/common";
import { ApiTags } from "@nestjs/swagger";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextGraphQl } from "@/access-context";
import { CombinedInput, Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextGraphQl } from "@/infrastructure/access-context";
import LadesaTypings from "@ladesa-ro/especificacao";
import { Resolver } from "@nestjs/graphql";
import { ReservaService } from "./reserva.service";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { AccessContext } from "@/access-context";
import { QbEfficientLoad } from "@/business-logic/standards/ladesa-spec/QbEfficientLoad";
import { LadesaPaginatedResultDto, LadesaSearch } from "@/business-logic/standards/ladesa-spec/search/search-strategies";
import { DatabaseContextService } from "@/infrastructure/adapters/adapter-database";
import type { ReservaEntity } from "@/infrastructure/adapters/adapter-database/typeorm/entities";
import type { AccessContext } from "@/infrastructure/access-context";
import { paginateConfig } from "@/infrastructure/fixtures";
import { DatabaseContextService } from "@/infrastructure/integrations/database";
import type { ReservaEntity } from "@/infrastructure/integrations/database/typeorm/entities";
import * as LadesaTypings from "@ladesa-ro/especificacao";
import { Injectable, NotFoundException } from "@nestjs/common";
import { has, map, pick } from "lodash";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextHttp } from "@/access-context";
import { CombinedInput, Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextHttp } from "@/infrastructure/access-context";
import { Public } from "@/infrastructure/authentication";
import LadesaTypings from "@ladesa-ro/especificacao";
import { Controller, Get, Post } from "@nestjs/common";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KeycloakModule, OpenidConnectModule } from "@/infrastructure/adapters/adapter-identity-and-access";
import { KeycloakModule, OpenidConnectModule } from "@/infrastructure/integrations/identity-provider";
import { Module } from "@nestjs/common";
import { AutenticacaoController } from "./autenticacao.controller";
import { AutenticacaoResolver } from "./autenticacao.resolver";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AccessContext } from "@/access-context";
import { DatabaseContextService } from "@/infrastructure/adapters/adapter-database";
import { KeycloakService, OpenidConnectService } from "@/infrastructure/adapters/adapter-identity-and-access";
import type { AccessContext } from "@/infrastructure/access-context";
import { DatabaseContextService } from "@/infrastructure/integrations/database";
import { KeycloakService, OpenidConnectService } from "@/infrastructure/integrations/identity-provider";
import type LadesaTypings from "@ladesa-ro/especificacao";
import { BadRequestException, ForbiddenException, HttpException, Injectable, ServiceUnavailableException } from "@nestjs/common";
import type { BaseClient, TokenSet } from "openid-client";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextHttp } from "@/access-context";
import { CombinedInput, Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextHttp } from "@/infrastructure/access-context";
import LadesaTypings from "@ladesa-ro/especificacao";
import { Controller, Delete, Get, Param, ParseUUIDPipe, Patch, Post, Put, UploadedFile } from "@nestjs/common";
import { ApiTags } from "@nestjs/swagger";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KeycloakModule } from "@/infrastructure/adapters/adapter-identity-and-access";
import { KeycloakModule } from "@/infrastructure/integrations/identity-provider";
import { Module } from "@nestjs/common";
import { UsuarioController } from "./usuario.controller";
import { UsuarioResolver } from "./usuario.resolver";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextGraphQl } from "@/access-context";
import { CombinedInput, Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextGraphQl } from "@/infrastructure/access-context";
import * as LadesaTypings from "@ladesa-ro/especificacao";
import { Resolver } from "@nestjs/graphql";
import { UsuarioService } from "./usuario.service";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { AccessContext } from "@/access-context";
import { ValidationFailedException } from "@/business-logic/standards";
import { QbEfficientLoad } from "@/business-logic/standards/ladesa-spec/QbEfficientLoad";
import { LadesaPaginatedResultDto, LadesaSearch } from "@/business-logic/standards/ladesa-spec/search/search-strategies";
import { DatabaseContextService } from "@/infrastructure/adapters/adapter-database";
import type { UsuarioEntity } from "@/infrastructure/adapters/adapter-database/typeorm/entities";
import { KeycloakService } from "@/infrastructure/adapters/adapter-identity-and-access";
import type { AccessContext } from "@/infrastructure/access-context";
import { paginateConfig } from "@/infrastructure/fixtures";
import { DatabaseContextService } from "@/infrastructure/integrations/database";
import type { UsuarioEntity } from "@/infrastructure/integrations/database/typeorm/entities";
import { KeycloakService } from "@/infrastructure/integrations/identity-provider";
import * as LadesaTypings from "@ladesa-ro/especificacao";
import { Injectable, InternalServerErrorException, NotFoundException, ServiceUnavailableException } from "@nestjs/common";
import { has, map, pick } from "lodash";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextHttp } from "@/access-context";
import { CombinedInput, Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextHttp } from "@/infrastructure/access-context";
import LadesaTypings from "@ladesa-ro/especificacao";
import { Controller, Get, Post } from "@nestjs/common";
import { ApiTags } from "@nestjs/swagger";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextGraphQl } from "@/access-context";
import { CombinedInput, Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextGraphQl } from "@/infrastructure/access-context";
import LadesaTypings from "@ladesa-ro/especificacao";
import { Resolver as GqlResolver } from "@nestjs/graphql";
import { VinculoService } from "./vinculo.service";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { AccessContext } from "@/access-context";
import { QbEfficientLoad } from "@/business-logic/standards/ladesa-spec/QbEfficientLoad";
import { LadesaSearch } from "@/business-logic/standards/ladesa-spec/search/search-strategies";
import { DatabaseContextService } from "@/infrastructure/adapters/adapter-database";
import type { UsuarioEntity } from "@/infrastructure/adapters/adapter-database/typeorm/entities";
import type { AccessContext } from "@/infrastructure/access-context";
import { paginateConfig } from "@/infrastructure/fixtures";
import { DatabaseContextService } from "@/infrastructure/integrations/database";
import type { UsuarioEntity } from "@/infrastructure/integrations/database/typeorm/entities";
import * as LadesaTypings from "@ladesa-ro/especificacao";
import { Injectable, NotFoundException } from "@nestjs/common";
import { FilterOperator } from "nestjs-paginate";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type AccessContext, AccessContextHttp } from "@/access-context";
import { Operation } from "@/business-logic/standards";
import { type AccessContext, AccessContextHttp } from "@/infrastructure/access-context";
import * as LadesaTypings from "@ladesa-ro/especificacao";
import { Controller, Get, Param, Query, type StreamableFile } from "@nestjs/common";
import { ApiTags } from "@nestjs/swagger";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { writeFile } from "node:fs/promises";
import type { Readable } from "node:stream";
import type { AccessContext } from "@/access-context";
import { DatabaseContextService } from "@/infrastructure/adapters/adapter-database";
import { type ArquivoEntity, UsuarioEntity } from "@/infrastructure/adapters/adapter-database/typeorm/entities";
import type { AccessContext } from "@/infrastructure/access-context";
import { AppConfigService } from "@/infrastructure/config";
import { ValidationContractUuid } from "@/infrastructure/fixtures";
import { DatabaseContextService } from "@/infrastructure/integrations/database";
import { type ArquivoEntity, UsuarioEntity } from "@/infrastructure/integrations/database/typeorm/entities";
import type * as LadesaTypings from "@ladesa-ro/especificacao";
import { ForbiddenException, Inject, Injectable, NotFoundException, ServiceUnavailableException, StreamableFile } from "@nestjs/common";
import jetpack, { createReadStream } from "fs-jetpack";
Expand Down
Loading

0 comments on commit d803026

Please sign in to comment.