Uploadfile parameters are now required + fixed date filters

This commit is contained in:
Joan Sanchez 2019-10-21 08:31:14 +02:00
parent 43a2c2e939
commit 47d689ae50
6 changed files with 74 additions and 68 deletions

View File

@ -9,25 +9,31 @@ module.exports = Self => {
{
arg: 'warehouseId',
type: 'Number',
description: 'The warehouse id'
description: 'The warehouse id',
required: true
}, {
arg: 'companyId',
type: 'Number',
description: 'The company id'
description: 'The company id',
required: true
}, {
arg: 'dmsTypeId',
type: 'Number',
description: 'The dms type id'
description: 'The dms type id',
required: true
}, {
arg: 'reference',
type: 'String'
type: 'String',
required: true
}, {
arg: 'description',
type: 'String'
type: 'String',
required: true
}, {
arg: 'hasFile',
type: 'Boolean',
description: 'True if has an attached file'
description: 'True if has an attached file',
required: true
}],
returns: {
type: 'Object',

View File

@ -120,16 +120,19 @@ module.exports = Self => {
}
async function getTicketId(params, options) {
const currentDate = new Date();
currentDate.setHours(null, null, null);
const minDate = new Date();
minDate.setHours(0, 0, 0, 0);
const maxDate = new Date();
maxDate.setHours(23, 59, 59, 59);
let ticket = await Self.app.models.Ticket.findOne({
where: {
addressFk: params.addressFk,
companyFk: params.companyFk,
warehouseFk: params.warehouseFk,
shipped: currentDate,
landed: currentDate
shipped: {between: [minDate, maxDate]},
landed: {between: [minDate, maxDate]}
}
}, options);

View File

@ -7,36 +7,34 @@ module.exports = Self => {
type: 'Number',
description: 'The claim id',
http: {source: 'path'}
},
{
}, {
arg: 'warehouseId',
type: 'Number',
description: ''
},
{
description: 'The warehouse id',
required: true
}, {
arg: 'companyId',
type: 'Number',
description: ''
},
{
description: 'The company id',
required: true
}, {
arg: 'dmsTypeId',
type: 'Number',
description: ''
},
{
description: 'The dms type id',
required: true
}, {
arg: 'reference',
type: 'String',
description: ''
},
{
required: true
}, {
arg: 'description',
type: 'String',
description: ''
},
{
required: true
}, {
arg: 'hasFile',
type: 'Boolean',
description: ''
description: 'True if has an attached file',
required: true
}],
returns: {
type: 'Object',

View File

@ -7,36 +7,34 @@ module.exports = Self => {
type: 'Number',
description: 'The client id',
http: {source: 'path'}
},
{
}, {
arg: 'warehouseId',
type: 'Number',
description: ''
},
{
description: 'The warehouse id',
required: true
}, {
arg: 'companyId',
type: 'Number',
description: ''
},
{
description: 'The company id',
required: true
}, {
arg: 'dmsTypeId',
type: 'Number',
description: ''
},
{
description: 'The dms type id',
required: true
}, {
arg: 'reference',
type: 'String',
description: ''
},
{
required: true
}, {
arg: 'description',
type: 'String',
description: ''
},
{
required: true
}, {
arg: 'hasFile',
type: 'Boolean',
description: ''
description: 'True if has an attached file',
required: true
}],
returns: {
type: 'Object',

View File

@ -105,15 +105,18 @@ module.exports = Self => {
async function getTicketId(params, options) {
const currentDate = new Date();
currentDate.setHours(null, null, null);
const minDate = new Date();
minDate.setHours(0, 0, 0, 0);
const maxDate = new Date();
maxDate.setHours(23, 59, 59, 59);
let ticket = await Self.app.models.Ticket.findOne({
where: {
addressFk: params.addressFk,
warehouseFk: params.warehouseFk,
shipped: currentDate,
landed: currentDate
shipped: {between: [minDate, maxDate]},
landed: {between: [minDate, maxDate]}
}
}, options);

View File

@ -7,36 +7,34 @@ module.exports = Self => {
type: 'Number',
description: 'The ticket id',
http: {source: 'path'}
},
{
}, {
arg: 'warehouseId',
type: 'Number',
description: ''
},
{
description: 'The warehouse id',
required: true
}, {
arg: 'companyId',
type: 'Number',
description: ''
},
{
description: 'The company id',
required: true
}, {
arg: 'dmsTypeId',
type: 'Number',
description: ''
},
{
description: 'The dms type id',
required: true
}, {
arg: 'reference',
type: 'String',
description: ''
},
{
required: true
}, {
arg: 'description',
type: 'String',
description: ''
},
{
required: true
}, {
arg: 'hasFile',
type: 'Boolean',
description: ''
description: 'True if has an attached file',
required: true
}],
returns: {
type: 'Object',