diff --git a/docs/attachments/attachment.yaml b/docs/attachments/attachment.yaml index e54f6408..9f1ca0e1 100644 --- a/docs/attachments/attachment.yaml +++ b/docs/attachments/attachment.yaml @@ -44,7 +44,7 @@ paths: schema: $ref: '#/definitions/attachments' example: - count: 1 + count: 2 items: - _id: 63ec1cd51e9d781cdb6f4b14 author: 648afee884936e09a37deaaa @@ -54,6 +54,17 @@ paths: category: { _id: 6477007a6fa4d05e1a800ce1, name: Science } createdAt: 2023-02-14T23:44:21.334Z updatedAt: 2023-02-14T23:44:21.334Z + resourceType: attachment + - _id: 64c9b03d7ea4d07f1b802ff3 + author: 648afee884936e09a37deaaa + fileName: Guitar + link: 'https://guitar-play-test.com' + description: It is file to check your playing success on guitar + size: 187 + category: { _id: 64b8a20c6fa4d05e1a901de2, name: Music } + createdAt: 2023-01-14T23:44:21.334Z + updatedAt: 2023-01-14T23:44:21.334Z + resourceType: attachment 401: description: Unauthorized content: @@ -106,11 +117,11 @@ paths: author: 6255bc080a75adf9223df100 fileName: attachment1.pdf link: '154867-attachment1.pdf' - category: [{ _id: 6502ec2060ec37be943353e2, name: 'New Category 1' }] - description: This is an example attachment description. + category: null size: 1024 createdAt: '2023-08-13T12:34:56.789Z' updatedAt: '2023-08-13T12:34:56.789Z' + resourceType: attachment 400: description: Bad Request content: diff --git a/docs/attachments/attachments-schema.yaml b/docs/attachments/attachments-schema.yaml index 191cd46d..b9c49085 100644 --- a/docs/attachments/attachments-schema.yaml +++ b/docs/attachments/attachments-schema.yaml @@ -4,6 +4,8 @@ definitions: items: type: object properties: + author: + type: string _id: type: string fileName: @@ -15,28 +17,31 @@ definitions: size: type: number category: - type: string - ref: '#/definitions/resourcesCategory' + $ref: '#/definitions/resourcesCategoryAttachment' createdAt: type: string format: date-time updatedAt: type: string format: date-time + resourceType: + type: string + enum: + - attachment + - lesson + - quiz + isDublicate: + type: boolean attachmentBody: type: object properties: fileName: type: string - link: - type: string description: type: string - size: - type: number category: type: string - ref: '#/definitions/resourcesCategory' + description: 'This id related to resourcesCategory' attachment: type: object properties: @@ -51,11 +56,16 @@ definitions: size: type: number category: - type: string - ref: '#/definitions/resourcesCategory' + $ref: '#/definitions/resourcesCategoryAttachment' createdAt: type: string format: date-time updatedAt: type: string format: date-time + resourceType: + type: string + enum: + - attachment + - lesson + - quiz diff --git a/docs/resourcesCategory/resourcesCategory.schema.yaml b/docs/resourcesCategory/resourcesCategory.schema.yaml index 50fb78f1..2c6e1f5f 100644 --- a/docs/resourcesCategory/resourcesCategory.schema.yaml +++ b/docs/resourcesCategory/resourcesCategory.schema.yaml @@ -19,3 +19,10 @@ definitions: updatedAt: type: string format: date-time + resourcesCategoryAttachment: + type: object + properties: + _id: + type: string + name: + type: string