diff --git a/packages/common/src/data/attachment.ts b/packages/common/src/data/attachment.ts new file mode 100644 index 00000000..9f301bbf --- /dev/null +++ b/packages/common/src/data/attachment.ts @@ -0,0 +1,30 @@ +import { ApiProperty } from '@nestjs/swagger' + +export class AttachmentUpdateData { + @ApiProperty() + name: string + @ApiProperty() + type: string +} + +export class AttachmentAddData extends AttachmentUpdateData { + +} + +export class Attachment extends AttachmentAddData { + @ApiProperty() + productId: string + @ApiProperty() + issueId: string + @ApiProperty() + commentId: string + @ApiProperty() + attachmentId: string + + @ApiProperty() + created: number + @ApiProperty() + updated: number + @ApiProperty() + deleted: number +} \ No newline at end of file diff --git a/packages/common/src/rest.ts b/packages/common/src/rest.ts index abd2b8e6..ee7afa4e 100644 --- a/packages/common/src/rest.ts +++ b/packages/common/src/rest.ts @@ -1,5 +1,6 @@ import { JWK } from 'jose' +import { Attachment } from './data/attachment' import { Comment, CommentAddData, CommentUpdateData } from './data/comment' import { Issue, IssueAddData, IssueUpdateData } from './data/issue' import { Member, MemberAddData, MemberUpdateData } from './data/member' @@ -58,6 +59,14 @@ export interface CommentREST { deleteComment(productId: string, issueId: string, commentId: string): Promise } +export interface AttachmentREST { + findAttachments(productId: string, issueId: string, commentId: string): Promise + addAttachment(productId: string, issueId: string, commentId: string, data: AA, file: F): Promise + getAttachment(productId: string, issueId: string, commentId: string, attachmentId: string): Promise + updateAttachment(productId: string, issueId: string, commentId: string, attachmentId: string, data: AU, file?: F): Promise + deleteAttachment(productId: string, issueId: string, commentId: string, attachmentId: string): Promise +} + export interface MilestoneREST { findMilestones(productId: string): Promise addMilestone(productId: string, data: MilestoneAddData): Promise