-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #956 from ChuckMoe/openapi-dependency-inversion
Dependencies inverted for DTO's
- Loading branch information
Showing
52 changed files
with
1,060 additions
and
1,050 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
import { IsOptional, IsString } from "class-validator"; | ||
import { OwnableDto } from "../../common/dto/ownable.dto"; | ||
import { PartialType } from "@nestjs/swagger"; | ||
import { Exclude } from "class-transformer"; | ||
import { IsOptional } from "class-validator"; | ||
import { CreateAttachmentDto } from "./create-attachment.dto"; | ||
|
||
export class UpdateAttachmentDto extends PartialType(CreateAttachmentDto) { | ||
export class UpdateAttachmentDto extends OwnableDto { | ||
@IsOptional() | ||
@Exclude() | ||
readonly id?: string; | ||
@IsString() | ||
readonly thumbnail?: string; | ||
|
||
@IsOptional() | ||
@Exclude() | ||
readonly datasetId?: string; | ||
|
||
@IsOptional() | ||
@Exclude() | ||
readonly proposalId?: string; | ||
|
||
@IsOptional() | ||
@Exclude() | ||
readonly sampleId?: string; | ||
@IsString() | ||
readonly caption: string; | ||
} | ||
|
||
export class PartialUpdateAttachmentDto extends PartialType( | ||
UpdateAttachmentDto, | ||
) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,73 @@ | ||
import { PartialType } from "@nestjs/swagger"; | ||
import { CreateDatablockDto } from "./create-datablock.dto"; | ||
import { ApiProperty, PartialType } from "@nestjs/swagger"; | ||
import { | ||
ArrayNotEmpty, | ||
IsArray, | ||
IsInt, | ||
IsNotEmpty, | ||
IsOptional, | ||
IsString, | ||
ValidateNested, | ||
} from "class-validator"; | ||
import { Type } from "class-transformer"; | ||
import { DataFileDto } from "../../common/dto/datafile.dto"; | ||
import { DataFile } from "../../common/schemas/datafile.schema"; | ||
import { OwnableDto } from "../../common/dto/ownable.dto"; | ||
|
||
export class UpdateDatablockDto extends PartialType(CreateDatablockDto) {} | ||
export class UpdateDatablockDto extends OwnableDto { | ||
@ApiProperty({ | ||
type: String, | ||
required: true, | ||
description: | ||
"Unique identifier given by the archive system to the stored datablock. This id is used when data is retrieved back.", | ||
}) | ||
@IsString() | ||
readonly archiveId: string; | ||
|
||
@ApiProperty({ | ||
type: Number, | ||
required: true, | ||
description: | ||
"Total size in bytes of all files in the datablock when on accessible.", | ||
}) | ||
@IsInt() | ||
readonly size: number; | ||
|
||
@ApiProperty({ | ||
type: Number, | ||
required: true, | ||
description: | ||
"Total size in bytes of all files in the datablock when on archived.", | ||
}) | ||
@IsInt() | ||
readonly packedSize: number; | ||
|
||
@ApiProperty({ | ||
type: String, | ||
required: false, | ||
description: | ||
"Name of the hashing algorithm used to compute the hash for each file.", | ||
}) | ||
@IsOptional() | ||
@IsString() | ||
@IsNotEmpty() | ||
readonly chkAlg: string; | ||
|
||
@ApiProperty({ | ||
type: String, | ||
required: true, | ||
description: | ||
"Version string defining the format of how data is packed and stored in archive.", | ||
}) | ||
@IsString() | ||
readonly version: string; | ||
|
||
@IsArray() | ||
@ArrayNotEmpty() | ||
@ValidateNested({ each: true }) | ||
@Type(() => DataFileDto) | ||
readonly dataFileList: DataFile[]; | ||
} | ||
|
||
export class PartialUpdateDatablockDto extends PartialType( | ||
UpdateDatablockDto, | ||
) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.