Skip to content

Commit

Permalink
feat: Added attachment dtos
Browse files Browse the repository at this point in the history
  • Loading branch information
Nino van Galen committed Jun 26, 2020
1 parent ff03b92 commit 002155d
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 0 deletions.
32 changes: 32 additions & 0 deletions lib/domain/dtos/GetAllLogAttachmentsDto.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* @license
* Copyright CERN and copyright holders of ALICE O2. This software is
* distributed under the terms of the GNU General Public License v3 (GPL
* Version 3), copied verbatim in the file "COPYING".
*
* See http://alice-o2.web.cern.ch/license for full licensing information.
*
* In applying this license CERN does not waive the privileges and immunities
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/

const Joi = require('@hapi/joi');
const EntityIdDto = require('./EntityIdDto');

const QueryDto = Joi.object({
mimetype: Joi.string(),
token: Joi.string(),
});

const ParamsDto = Joi.object({
logId: EntityIdDto,
});

const GetAllLogAttachmentsDto = Joi.object({
body: Joi.object({}),
query: QueryDto,
params: ParamsDto,
});

module.exports = GetAllLogAttachmentsDto;
31 changes: 31 additions & 0 deletions lib/domain/dtos/GetAttachmentDto.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* @license
* Copyright CERN and copyright holders of ALICE O2. This software is
* distributed under the terms of the GNU General Public License v3 (GPL
* Version 3), copied verbatim in the file "COPYING".
*
* See http://alice-o2.web.cern.ch/license for full licensing information.
*
* In applying this license CERN does not waive the privileges and immunities
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/

const Joi = require('@hapi/joi');
const EntityIdDto = require('./EntityIdDto');

const QueryDto = Joi.object({
token: Joi.string(),
});

const ParamsDto = Joi.object({
id: EntityIdDto,
});

const GetLogAttachmentDto = Joi.object({
body: Joi.object({}),
query: QueryDto,
params: ParamsDto,
});

module.exports = GetLogAttachmentDto;
33 changes: 33 additions & 0 deletions lib/domain/dtos/GetLogAttachmentDto.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* @license
* Copyright CERN and copyright holders of ALICE O2. This software is
* distributed under the terms of the GNU General Public License v3 (GPL
* Version 3), copied verbatim in the file "COPYING".
*
* See http://alice-o2.web.cern.ch/license for full licensing information.
*
* In applying this license CERN does not waive the privileges and immunities
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/

const Joi = require('@hapi/joi');
const EntityIdDto = require('./EntityIdDto');

const ParamsDto = Joi.object({
logId: EntityIdDto.required(),
attachmentId: EntityIdDto.required(),
});

const QueryDto = Joi.object({
mimetype: Joi.string(),
token: Joi.string(),
});

const GetLogAttachmentDto = Joi.object({
body: Joi.object({}),
params: ParamsDto,
query: QueryDto,
});

module.exports = GetLogAttachmentDto;
6 changes: 6 additions & 0 deletions lib/domain/dtos/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ const CreateLogDto = require('./CreateLogDto');
const CreateSubsystemDto = require('./CreateSubsystemDto');
const CreateTagDto = require('./CreateTagDto');
const EntityIdDto = require('./EntityIdDto');
const GetAllLogAttachmentsDto = require('./GetAllLogAttachmentsDto');
const GetAllLogsDto = require('./GetAllLogsDto');
const GetAllSubsystemsDto = require('./GetAllSubsystemsDto');
const GetAllTagsDto = require('./GetAllTagsDto');
const GetAttachmentDto = require('./GetAttachmentDto');
const GetLogDto = require('./GetLogDto');
const GetLogAttachmentDto = require('./GetLogAttachmentDto');
const GetSubsystemDto = require('./GetSubsystemDto');
const GetTagDto = require('./GetTagDto');
const PaginationDto = require('./PaginationDto');
Expand All @@ -32,10 +35,13 @@ module.exports = {
CreateSubsystemDto,
CreateTagDto,
EntityIdDto,
GetAllLogAttachmentsDto,
GetAllLogsDto,
GetAllSubsystemsDto,
GetAllTagsDto,
GetAttachmentDto,
GetLogDto,
GetLogAttachmentDto,
GetSubsystemDto,
GetTagDto,
PaginationDto,
Expand Down

0 comments on commit 002155d

Please sign in to comment.