|
|
|
@ -220,6 +220,9 @@ export default {
|
|
|
|
|
throw new PermissionError();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
documents: (parent: any) => {
|
|
|
|
|
return (parent.documents) ? parent.documents : [];
|
|
|
|
|
},
|
|
|
|
|
isLockedByMe: (parent: any, __: any, { req }: { req: any }) => isLockedByMe(parent, { req }),
|
|
|
|
|
isLocked: (parent: any, __: any, { req }: { req: any }) => isLocked(parent, { req })
|
|
|
|
|
},
|
|
|
|
@ -227,6 +230,11 @@ export default {
|
|
|
|
|
isLockedByMe: (parent: any, __: any, { req }: { req: any }) => isLockedByMe(parent, { req }),
|
|
|
|
|
isLocked: (parent: any, __: any, { req }: { req: any }) => isLocked(parent, { req })
|
|
|
|
|
},
|
|
|
|
|
InsuranceData: {
|
|
|
|
|
projectAllowance: (parent: any): any => {
|
|
|
|
|
return (parent.projectAllowance as string)?.replace(/€\$/, '');
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
Mutation: {
|
|
|
|
|
createCargoBike: (_: any, { cargoBike }: { cargoBike: any }, { dataSources, req }: { dataSources: any, req: any }) => {
|
|
|
|
|
if (req.permissions.includes(Permission.WriteBike)) {
|
|
|
|
@ -368,9 +376,9 @@ export default {
|
|
|
|
|
throw new PermissionError();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
createBikeEventType: (_: any, { name }: { name: any }, { dataSources, req }: { dataSources: any, req: any }) => {
|
|
|
|
|
createBikeEventType: (_: any, { bikeEventType }: { bikeEventType: any }, { dataSources, req }: { dataSources: any, req: any }) => {
|
|
|
|
|
if (req.permissions.includes(Permission.WriteEventType)) {
|
|
|
|
|
return dataSources.cargoBikeAPI.createBikeEventType(name);
|
|
|
|
|
return dataSources.cargoBikeAPI.createBikeEventType(bikeEventType);
|
|
|
|
|
} else {
|
|
|
|
|
throw new PermissionError();
|
|
|
|
|
}
|
|
|
|
|