|
|
@ -137,8 +137,6 @@ export default {
|
|
|
|
return new GraphQLError('Insufficient Permissions');
|
|
|
|
return new GraphQLError('Insufficient Permissions');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
isLockedByMe: (parent: any, __: any, { req }: { req: any }) => isLockedByMe(parent, { req }),
|
|
|
|
|
|
|
|
isLocked: (parent: any, __: any, { req }: { req: any }) => isLocked(parent, { req }),
|
|
|
|
|
|
|
|
timeFrames (parent: any, __: any, { dataSources, req }: { dataSources: any, req: any }) {
|
|
|
|
timeFrames (parent: any, __: any, { dataSources, req }: { dataSources: any, req: any }) {
|
|
|
|
if (req.permissions.includes(Permission.ReadTimeFrame)) {
|
|
|
|
if (req.permissions.includes(Permission.ReadTimeFrame)) {
|
|
|
|
return dataSources.lendingStationAPI.timeFramesByCargoBikeId(parent.id);
|
|
|
|
return dataSources.lendingStationAPI.timeFramesByCargoBikeId(parent.id);
|
|
|
@ -159,8 +157,50 @@ export default {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return new GraphQLError('Insufficient Permissions');
|
|
|
|
return new GraphQLError('Insufficient Permissions');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
isLockedByMe: (parent: any, __: any, { req }: { req: any }) => isLockedByMe(parent, { req }),
|
|
|
|
|
|
|
|
isLocked: (parent: any, __: any, { req }: { req: any }) => isLocked(parent, { req })
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
DimensionsAndLoad: {
|
|
|
|
|
|
|
|
minBoxLength: (parent: any) => {
|
|
|
|
|
|
|
|
if (!parent.boxLengthRange || parent.boxLengthRange === 'empty') {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return parent.boxLengthRange ? (parent.boxLengthRange as string).split(',')[0].replace('[', '') : null;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
maxBoxLength: (parent: any) => {
|
|
|
|
|
|
|
|
if (!parent.boxLengthRange || parent.boxLengthRange === 'empty') {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const str = (parent.boxLengthRange as string).split(',')[1].replace(']', '');
|
|
|
|
|
|
|
|
return (str.length > 0) ? str : null;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
minBoxWidth: (parent: any) => {
|
|
|
|
|
|
|
|
if (!parent.boxWidthRange || parent.boxWidthRange === 'empty') {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return parent.boxWidthRange ? (parent.boxWidthRange as string).split(',')[0].replace('[', '') : null;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
maxBoxWidth: (parent: any) => {
|
|
|
|
|
|
|
|
if (!parent.boxWidthRange || parent.boxWidthRange === 'empty') {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const str = (parent.boxWidthRange as string).split(',')[1].replace(']', '');
|
|
|
|
|
|
|
|
return (str.length > 0) ? str : null;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
minBoxHeight: (parent: any) => {
|
|
|
|
|
|
|
|
if (!parent.boxHeightRange || parent.boxHeightRange === 'empty') {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return parent.boxHeightRange ? (parent.boxHeightRange as string).split(',')[0].replace('[', '') : null;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
maxBoxHeight: (parent: any) => {
|
|
|
|
|
|
|
|
if (!parent.boxHeightRange || parent.boxHeightRange === 'empty') {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const str = (parent.boxHeightRange as string).split(',')[1].replace(']', '');
|
|
|
|
|
|
|
|
return (str.length > 0) ? str : null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Equipment: {
|
|
|
|
Equipment: {
|
|
|
|
cargoBike (parent: any, __: any, { dataSources, req }: { dataSources: any, req: any }) {
|
|
|
|
cargoBike (parent: any, __: any, { dataSources, req }: { dataSources: any, req: any }) {
|
|
|
|