From bc2271fa8301719fae59857ef339bd2513f4bca0 Mon Sep 17 00:00:00 2001 From: wolfganggreschus Date: Thu, 2 Nov 2023 15:33:42 +0100 Subject: [PATCH] CopyFileDomainObjectProps, FileDomainObjectProps, CopyFilesRequestInfo, FileRequestInfo --- .../files-storage-client/dto/copy-file.dto.ts | 4 ++-- .../src/modules/files-storage-client/dto/file.dto.ts | 4 ++-- .../interfaces/copy-file-domain-object-props.ts | 2 +- .../interfaces/copy-file-request-info.ts | 8 ++++---- .../interfaces/file-domain-object-props.ts | 2 +- .../interfaces/file-request-info.ts | 2 +- .../mapper/copy-files-of-parent-param.builder.ts | 6 +++--- .../mapper/files-storage-client.mapper.ts | 12 ++++++------ .../mapper/files-storage-param.builder.ts | 4 ++-- .../service/files-storage-client.service.ts | 8 ++++---- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/apps/server/src/modules/files-storage-client/dto/copy-file.dto.ts b/apps/server/src/modules/files-storage-client/dto/copy-file.dto.ts index eaddf253791..8c6936f33fa 100644 --- a/apps/server/src/modules/files-storage-client/dto/copy-file.dto.ts +++ b/apps/server/src/modules/files-storage-client/dto/copy-file.dto.ts @@ -1,5 +1,5 @@ import { EntityId } from '@shared/domain'; -import { ICopyFileDomainObjectProps } from '../interfaces'; +import { CopyFileDomainObjectProps } from '../interfaces'; export class CopyFileDto { id?: EntityId | undefined; @@ -8,7 +8,7 @@ export class CopyFileDto { name: string; - constructor(data: ICopyFileDomainObjectProps) { + constructor(data: CopyFileDomainObjectProps) { this.id = data.id; this.sourceId = data.sourceId; this.name = data.name; diff --git a/apps/server/src/modules/files-storage-client/dto/file.dto.ts b/apps/server/src/modules/files-storage-client/dto/file.dto.ts index 5ac6e76181f..bbb2217f85b 100644 --- a/apps/server/src/modules/files-storage-client/dto/file.dto.ts +++ b/apps/server/src/modules/files-storage-client/dto/file.dto.ts @@ -1,6 +1,6 @@ import { EntityId } from '@shared/domain'; import { FileRecordParentType } from '@shared/infra/rabbitmq'; -import { IFileDomainObjectProps } from '../interfaces'; +import { FileDomainObjectProps } from '../interfaces'; export class FileDto { id: EntityId; @@ -11,7 +11,7 @@ export class FileDto { parentId: EntityId; - constructor(props: IFileDomainObjectProps) { + constructor(props: FileDomainObjectProps) { this.id = props.id; this.name = props.name; this.parentType = props.parentType; diff --git a/apps/server/src/modules/files-storage-client/interfaces/copy-file-domain-object-props.ts b/apps/server/src/modules/files-storage-client/interfaces/copy-file-domain-object-props.ts index 89348ea8c68..0dfa8455094 100644 --- a/apps/server/src/modules/files-storage-client/interfaces/copy-file-domain-object-props.ts +++ b/apps/server/src/modules/files-storage-client/interfaces/copy-file-domain-object-props.ts @@ -1,6 +1,6 @@ import { EntityId } from '@shared/domain'; -export interface ICopyFileDomainObjectProps { +export interface CopyFileDomainObjectProps { id?: EntityId | undefined; sourceId: EntityId; name: string; diff --git a/apps/server/src/modules/files-storage-client/interfaces/copy-file-request-info.ts b/apps/server/src/modules/files-storage-client/interfaces/copy-file-request-info.ts index e52bbce9b1a..42c971d9a0d 100644 --- a/apps/server/src/modules/files-storage-client/interfaces/copy-file-request-info.ts +++ b/apps/server/src/modules/files-storage-client/interfaces/copy-file-request-info.ts @@ -1,8 +1,8 @@ import { EntityId } from '@shared/domain'; -import { IFileRequestInfo } from './file-request-info'; +import { FileRequestInfo } from './file-request-info'; -export interface ICopyFilesRequestInfo { +export interface CopyFilesRequestInfo { userId: EntityId; - source: IFileRequestInfo; - target: IFileRequestInfo; + source: FileRequestInfo; + target: FileRequestInfo; } diff --git a/apps/server/src/modules/files-storage-client/interfaces/file-domain-object-props.ts b/apps/server/src/modules/files-storage-client/interfaces/file-domain-object-props.ts index 35513f27b02..4e14025609d 100644 --- a/apps/server/src/modules/files-storage-client/interfaces/file-domain-object-props.ts +++ b/apps/server/src/modules/files-storage-client/interfaces/file-domain-object-props.ts @@ -1,7 +1,7 @@ import { EntityId } from '@shared/domain'; import { FileRecordParentType } from '@shared/infra/rabbitmq'; -export interface IFileDomainObjectProps { +export interface FileDomainObjectProps { id: EntityId; name: string; parentType: FileRecordParentType; diff --git a/apps/server/src/modules/files-storage-client/interfaces/file-request-info.ts b/apps/server/src/modules/files-storage-client/interfaces/file-request-info.ts index d45df0aef3d..8f45e237cfa 100644 --- a/apps/server/src/modules/files-storage-client/interfaces/file-request-info.ts +++ b/apps/server/src/modules/files-storage-client/interfaces/file-request-info.ts @@ -1,7 +1,7 @@ import { EntityId } from '@shared/domain'; import { FileRecordParentType } from '@shared/infra/rabbitmq'; -export interface IFileRequestInfo { +export interface FileRequestInfo { schoolId: EntityId; parentType: FileRecordParentType; parentId: EntityId; diff --git a/apps/server/src/modules/files-storage-client/mapper/copy-files-of-parent-param.builder.ts b/apps/server/src/modules/files-storage-client/mapper/copy-files-of-parent-param.builder.ts index 9edee50870a..fe1bbf09c08 100644 --- a/apps/server/src/modules/files-storage-client/mapper/copy-files-of-parent-param.builder.ts +++ b/apps/server/src/modules/files-storage-client/mapper/copy-files-of-parent-param.builder.ts @@ -1,9 +1,9 @@ import { EntityId } from '@shared/domain'; -import { IFileRequestInfo } from '../interfaces'; -import { ICopyFilesRequestInfo } from '../interfaces/copy-file-request-info'; +import { FileRequestInfo } from '../interfaces'; +import { CopyFilesRequestInfo } from '../interfaces/copy-file-request-info'; export class CopyFilesOfParentParamBuilder { - static build(userId: EntityId, source: IFileRequestInfo, target: IFileRequestInfo): ICopyFilesRequestInfo { + static build(userId: EntityId, source: FileRequestInfo, target: FileRequestInfo): CopyFilesRequestInfo { const fileRequestInfo = { userId, source, diff --git a/apps/server/src/modules/files-storage-client/mapper/files-storage-client.mapper.ts b/apps/server/src/modules/files-storage-client/mapper/files-storage-client.mapper.ts index 2c73ec3824e..2378890481f 100644 --- a/apps/server/src/modules/files-storage-client/mapper/files-storage-client.mapper.ts +++ b/apps/server/src/modules/files-storage-client/mapper/files-storage-client.mapper.ts @@ -1,11 +1,11 @@ import { LessonEntity, Submission, Task } from '@shared/domain'; import { FileRecordParentType } from '@shared/infra/rabbitmq'; import { CopyFileDto, FileDto } from '../dto'; -import { EntitiesWithFiles, ICopyFileDomainObjectProps, IFileDomainObjectProps } from '../interfaces'; +import { CopyFileDomainObjectProps, EntitiesWithFiles, FileDomainObjectProps } from '../interfaces'; export class FilesStorageClientMapper { - static mapfileRecordListResponseToDomainFilesDto(fileRecordListResponse: IFileDomainObjectProps[]): FileDto[] { - const filesDto = fileRecordListResponse.map((record: IFileDomainObjectProps) => { + static mapfileRecordListResponseToDomainFilesDto(fileRecordListResponse: FileDomainObjectProps[]): FileDto[] { + const filesDto = fileRecordListResponse.map((record: FileDomainObjectProps) => { const fileDto = FilesStorageClientMapper.mapFileRecordResponseToFileDto(record); return fileDto; @@ -14,7 +14,7 @@ export class FilesStorageClientMapper { return filesDto; } - static mapCopyFileListResponseToCopyFilesDto(copyFileListResponse: ICopyFileDomainObjectProps[]): CopyFileDto[] { + static mapCopyFileListResponseToCopyFilesDto(copyFileListResponse: CopyFileDomainObjectProps[]): CopyFileDto[] { const filesDto = copyFileListResponse.map((response) => { const fileDto = FilesStorageClientMapper.mapCopyFileResponseToCopyFileDto(response); @@ -24,7 +24,7 @@ export class FilesStorageClientMapper { return filesDto; } - static mapFileRecordResponseToFileDto(fileRecordResponse: IFileDomainObjectProps) { + static mapFileRecordResponseToFileDto(fileRecordResponse: FileDomainObjectProps) { const parentType = FilesStorageClientMapper.mapStringToParentType(fileRecordResponse.parentType); const fileDto = new FileDto({ id: fileRecordResponse.id, @@ -36,7 +36,7 @@ export class FilesStorageClientMapper { return fileDto; } - static mapCopyFileResponseToCopyFileDto(response: ICopyFileDomainObjectProps) { + static mapCopyFileResponseToCopyFileDto(response: CopyFileDomainObjectProps) { const dto = new CopyFileDto({ id: response.id, sourceId: response.sourceId, diff --git a/apps/server/src/modules/files-storage-client/mapper/files-storage-param.builder.ts b/apps/server/src/modules/files-storage-client/mapper/files-storage-param.builder.ts index bd37c97ceb5..08ae8552bf0 100644 --- a/apps/server/src/modules/files-storage-client/mapper/files-storage-param.builder.ts +++ b/apps/server/src/modules/files-storage-client/mapper/files-storage-param.builder.ts @@ -1,9 +1,9 @@ import { EntityId } from '@shared/domain'; -import { EntitiesWithFiles, IFileRequestInfo } from '../interfaces'; +import { EntitiesWithFiles, FileRequestInfo } from '../interfaces'; import { FilesStorageClientMapper } from './files-storage-client.mapper'; export class FileParamBuilder { - static build(schoolId: EntityId, parent: EntitiesWithFiles): IFileRequestInfo { + static build(schoolId: EntityId, parent: EntitiesWithFiles): FileRequestInfo { const parentType = FilesStorageClientMapper.mapEntityToParentType(parent); const fileRequestInfo = { parentType, diff --git a/apps/server/src/modules/files-storage-client/service/files-storage-client.service.ts b/apps/server/src/modules/files-storage-client/service/files-storage-client.service.ts index c632631b884..6cb47305248 100644 --- a/apps/server/src/modules/files-storage-client/service/files-storage-client.service.ts +++ b/apps/server/src/modules/files-storage-client/service/files-storage-client.service.ts @@ -2,8 +2,8 @@ import { Injectable } from '@nestjs/common'; import { EntityId } from '@shared/domain'; import { LegacyLogger } from '@src/core/logger'; import { CopyFileDto, FileDto } from '../dto'; -import { IFileRequestInfo } from '../interfaces'; -import { ICopyFilesRequestInfo } from '../interfaces/copy-file-request-info'; +import { FileRequestInfo } from '../interfaces'; +import { CopyFilesRequestInfo } from '../interfaces/copy-file-request-info'; import { FilesStorageClientMapper } from '../mapper'; import { FilesStorageProducer } from './files-storage.producer'; @@ -13,14 +13,14 @@ export class FilesStorageClientAdapterService { this.logger.setContext(FilesStorageClientAdapterService.name); } - async copyFilesOfParent(param: ICopyFilesRequestInfo): Promise { + async copyFilesOfParent(param: CopyFilesRequestInfo): Promise { const response = await this.fileStorageMQProducer.copyFilesOfParent(param); const fileInfos = FilesStorageClientMapper.mapCopyFileListResponseToCopyFilesDto(response); return fileInfos; } - async listFilesOfParent(param: IFileRequestInfo): Promise { + async listFilesOfParent(param: FileRequestInfo): Promise { const response = await this.fileStorageMQProducer.listFilesOfParent(param); const fileInfos = FilesStorageClientMapper.mapfileRecordListResponseToDomainFilesDto(response);