Add createBike function

urls
Max Ehrlicher-Schmidt 4 years ago
parent 5fdad53150
commit e041986bc1

@ -1,5 +1,7 @@
<div #booleanInputType *ngIf="htmlInputType === 'boolean'"> <div #booleanInputType *ngIf="htmlInputType === 'boolean'">
<mat-checkbox <mat-checkbox
#input="ngModel"
[required]="required"
class="checkbox" class="checkbox"
[disabled]="!editable" [disabled]="!editable"
[ngModel]="value" [ngModel]="value"
@ -9,7 +11,12 @@
<div #enumInputType *ngIf="htmlInputType === 'enum'"> <div #enumInputType *ngIf="htmlInputType === 'enum'">
<mat-form-field *ngIf="editable; else nonEditableText"> <mat-form-field *ngIf="editable; else nonEditableText">
<mat-select [(ngModel)]="value" (ngModelChange)="change($event)"> <mat-select
[(ngModel)]="value"
(ngModelChange)="change($event)"
#input="ngModel"
[required]="required"
>
<mat-option *ngFor="let option of enumValues" [value]="option"> <mat-option *ngFor="let option of enumValues" [value]="option">
{{ option }} {{ option }}
</mat-option> </mat-option>
@ -20,13 +27,18 @@
</ng-template> </ng-template>
</div> </div>
<div #otherInputType *ngIf="htmlInputType === 'number' || htmlInputType === 'text'"> <div
#otherInputType
*ngIf="htmlInputType === 'number' || htmlInputType === 'text'"
>
<mat-form-field *ngIf="editable; else nonEditableText"> <mat-form-field *ngIf="editable; else nonEditableText">
<input <input
#input="ngModel"
matInput matInput
[type]="htmlInputType" [type]="htmlInputType"
[ngModel]="value" [ngModel]="value"
(ngModelChange)="change($event)" (ngModelChange)="change($event)"
[required]="required"
/> />
</mat-form-field> </mat-form-field>
<ng-template #nonEditableText> <ng-template #nonEditableText>

@ -4,6 +4,8 @@ import {
Output, Output,
EventEmitter, EventEmitter,
ChangeDetectionStrategy, ChangeDetectionStrategy,
ViewChild,
ChangeDetectorRef,
} from '@angular/core'; } from '@angular/core';
@Component({ @Component({
@ -17,35 +19,76 @@ export class CellComponent {
@Output() valueChange = new EventEmitter<number | string | boolean>(); @Output() valueChange = new EventEmitter<number | string | boolean>();
@Input() @Input()
editable = false; editable = false;
_inputType = 'text';
get inputType(): string {
return this._inputType;
}
@Input()
set inputType(type: string) {
this._inputType = type;
this.getHtmlInputType(type);
}
@Input() @Input()
inputType = 'text'; required: boolean = false;
@Output() validityChange = new EventEmitter<boolean>();
isValid: boolean = true;
enumValues = []; enumValues = [];
htmlInputType: string = 'string'; htmlInputType: string = 'string';
ngOnChanges() { @ViewChild('input') input: any;
this.getHtmlInputType(this.inputType);
constructor(private cdr: ChangeDetectorRef) {
}
ngAfterViewInit() {
if (this.required) {
this.input?.control?.markAsTouched();
this.checkIfValid();
this.cdr.detectChanges();
if (
this.value === undefined &&
this.inputType === 'Boolean' &&
this.editable
) {
setTimeout(()=> {
this.change(false);
}, 0);
}
}
} }
getHtmlInputType(type: string) { getHtmlInputType(type: string) {
if (this.inputType.split('//')[0] === 'Enum') { if (type.split('//')[0] === 'Enum') {
this.enumValues = this.inputType.split('//').slice(1); this.enumValues = type.split('//').slice(1);
this.htmlInputType = 'enum'; this.htmlInputType = 'enum';
} else if (this.inputType === 'Int' || this.inputType === 'Float') { } else if (type === 'Int' || type === 'Float') {
this.htmlInputType = 'number'; this.htmlInputType = 'number';
} else if (this.inputType === 'ID' || this.inputType === 'String') { } else if (type === 'ID' || type === 'String') {
this.htmlInputType = 'text'; this.htmlInputType = 'text';
} else if (this.inputType === 'Boolean') { } else if (type === 'Boolean') {
this.htmlInputType = 'boolean'; this.htmlInputType = 'boolean';
} }
} }
change(newValue) { change(newValue) {
if (this.inputType === "Int") { if (this.inputType === 'Int') {
newValue = newValue.toString().replace('.', ''); newValue = newValue.toString().replace('.', '');
} }
this.value = this.htmlInputType === 'number' ? +newValue : newValue; this.value = this.htmlInputType === 'number' ? +newValue : newValue;
if (newValue === "") {
this.value = null;
}
this.valueChange.emit(this.value); this.valueChange.emit(this.value);
this.checkIfValid();
}
checkIfValid() {
if (this.required && this.inputType !== 'Boolean') {
this.isValid = this.input?.control?.valid || false;
this.validityChange.emit(this.isValid);
}
} }
} }

@ -4,6 +4,12 @@ query GetCargoBikeById($id: ID!) {
} }
} }
mutation CreateCargoBike($bike: CargoBikeCreateInput!) {
createCargoBike(cargoBike: $bike) {
...CargoBikeFields
}
}
mutation UpdateCargoBike($bike: CargoBikeUpdateInput!) { mutation UpdateCargoBike($bike: CargoBikeUpdateInput!) {
updateCargoBike(cargoBike: $bike) { updateCargoBike(cargoBike: $bike) {
...CargoBikeFields ...CargoBikeFields

@ -1,28 +0,0 @@
import { DocumentNode } from 'graphql';
export function isPartOfGraphQLDoc(
variableName: string,
doc: DocumentNode
): boolean {
return isPartOfSelectionSet(variableName, doc.definitions[0]);
}
function isPartOfSelectionSet(
variableName: string,
selectionObject: any
): boolean {
const variablePath = variableName.split('.');
const selections = selectionObject.selectionSet?.selections;
if (selections !== undefined) {
const nextSelectionObject = selections.find(selection => selection.name.value === variablePath[0]);
if (nextSelectionObject !== undefined) {
if (variablePath.length === 1) {
return true;
}
return isPartOfSelectionSet(variablePath.slice(1).join('.'), nextSelectionObject);
} else {
return false;
}
}
return false;
}

@ -1,6 +1,6 @@
<div class="table-page-wrapper"> <div class="table-page-wrapper">
<div class="table-control"> <div class="table-control">
<button mat-raised-button color="primary" class="table-control-button" i18n> <button mat-raised-button color="primary" class="table-control-button" disabled i18n>
Alle ausgewählten Fahrräder bearbeiten Alle ausgewählten Fahrräder bearbeiten
</button> </button>
<button <button
@ -30,7 +30,7 @@
/> />
</mat-form-field> </mat-form-field>
<mat-paginator <mat-paginator
[pageSizeOptions]="[15, 25, 30, 50, 100, 500]" [pageSizeOptions]="[15, 25, 30, 50, 100]"
showFirstLastButtons showFirstLastButtons
></mat-paginator> ></mat-paginator>
</div> </div>
@ -81,7 +81,9 @@
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
<app-cell <app-cell
*ngIf="column.type === 'Boolean' || (element.newObject || !column.readonly && element.isLockedByMe); else stringValue" *ngIf="column.type === 'Boolean' || (element.newObject || !column.readonly && element.isLockedByMe); else stringValue"
[editable]="element.newObject || !column.readonly && element.isLockedByMe" [editable]="(element.newObject && column.acceptedForCreation) || !column.readonly && element.isLockedByMe"
[required]="(element.newObject && column.requiredForCreation)"
(validityChange)="validityChange(element, column.name, $event)"
[(value)]="element[column.name]" [(value)]="element[column.name]"
[inputType]="column.type" [inputType]="column.type"
></app-cell> ></app-cell>
@ -143,6 +145,15 @@
>locked</mat-icon >locked</mat-icon
> >
</div> </div>
<div class="button-wrapper" *ngIf="element.newObject" [matTooltip]="'Nicht ausgefüllte Felder: '+countUnvalidFields(element)">
<button
mat-icon-button
[disabled]="countUnvalidFields(element) > 0"
(click)="create(element)"
>
<mat-icon>save</mat-icon>
</button>
</div>
</td> </td>
</ng-container> </ng-container>

@ -4,12 +4,6 @@ import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
import { BikesService, CargoBikeResult } from 'src/app/services/bikes.service'; import { BikesService, CargoBikeResult } from 'src/app/services/bikes.service';
import { flatten } from 'src/app/helperFunctions/flattenObject'; import { flatten } from 'src/app/helperFunctions/flattenObject';
import { deepen } from 'src/app/helperFunctions/deepenObject'; import { deepen } from 'src/app/helperFunctions/deepenObject';
import { isPartOfGraphQLDoc } from 'src/app/helperFunctions/isPartOfGraphQLFunction';
import { filter } from 'graphql-anywhere';
import {
CargoBikeFieldsMutableFragmentDoc,
CargoBikeUpdateInput,
} from 'src/generated/graphql';
import { SchemaService } from 'src/app/services/schema.service'; import { SchemaService } from 'src/app/services/schema.service';
import { logArrayInColumnInfoForm } from 'src/app/helperFunctions/logArrayInColumnInfoForm'; import { logArrayInColumnInfoForm } from 'src/app/helperFunctions/logArrayInColumnInfoForm';
@ -27,6 +21,8 @@ export class BikesComponent {
columnInfo: { columnInfo: {
name: string; name: string;
header: string; header: string;
acceptedForCreation?: boolean;
requiredForCreation?: boolean;
sticky?: boolean; sticky?: boolean;
readonly?: boolean; readonly?: boolean;
type?: string; type?: string;
@ -41,9 +37,18 @@ export class BikesComponent {
{ name: 'insuranceData.name', header: 'Versicherer' }, { name: 'insuranceData.name', header: 'Versicherer' },
{ name: 'insuranceData.benefactor', header: 'Kostenträger' }, { name: 'insuranceData.benefactor', header: 'Kostenträger' },
{ name: 'insuranceData.noPnP', header: 'Nr. P&P' }, { name: 'insuranceData.noPnP', header: 'Nr. P&P' },
{ name: 'insuranceData.maintenanceResponsible', header: 'Wartung zuständig' }, {
{ name: 'insuranceData.maintenanceBenefactor', header: 'Wartung Kostenträger' }, name: 'insuranceData.maintenanceResponsible',
{ name: 'insuranceData.maintenanceAgreement', header: 'Wartungsvereinbarung' }, header: 'Wartung zuständig',
},
{
name: 'insuranceData.maintenanceBenefactor',
header: 'Wartung Kostenträger',
},
{
name: 'insuranceData.maintenanceAgreement',
header: 'Wartungsvereinbarung',
},
{ name: 'insuranceData.projectAllowance', header: 'Projektzuschuss' }, { name: 'insuranceData.projectAllowance', header: 'Projektzuschuss' },
{ name: 'insuranceData.notes', header: 'Sonstiges' }, { name: 'insuranceData.notes', header: 'Sonstiges' },
{ name: 'dimensionsAndLoad.bikeLength', header: 'Länge' }, { name: 'dimensionsAndLoad.bikeLength', header: 'Länge' },
@ -56,7 +61,10 @@ export class BikesComponent {
{ name: 'dimensionsAndLoad.hasCoverBox', header: 'Boxabdeckung j/n' }, { name: 'dimensionsAndLoad.hasCoverBox', header: 'Boxabdeckung j/n' },
{ name: 'dimensionsAndLoad.lockable', header: 'Box abschließbar' }, { name: 'dimensionsAndLoad.lockable', header: 'Box abschließbar' },
{ name: 'dimensionsAndLoad.maxWeightBox', header: 'max Zuladung Box' }, { name: 'dimensionsAndLoad.maxWeightBox', header: 'max Zuladung Box' },
{ name: 'dimensionsAndLoad.maxWeightLuggageRack', header: 'max Zuladung Gepäckträger' }, {
name: 'dimensionsAndLoad.maxWeightLuggageRack',
header: 'max Zuladung Gepäckträger',
},
{ name: 'dimensionsAndLoad.maxWeightTotal', header: 'max Gesamtgewicht' }, { name: 'dimensionsAndLoad.maxWeightTotal', header: 'max Gesamtgewicht' },
{ name: 'numberOfChildren', header: 'Anzahl Kinder' }, { name: 'numberOfChildren', header: 'Anzahl Kinder' },
{ name: 'numberOfWheels', header: 'Anzahl Räder' }, { name: 'numberOfWheels', header: 'Anzahl Räder' },
@ -64,8 +72,14 @@ export class BikesComponent {
{ name: 'forChildren', header: 'für Kinder j/n' }, { name: 'forChildren', header: 'für Kinder j/n' },
{ name: 'security.frameNumber', header: 'Rahmennummer' }, { name: 'security.frameNumber', header: 'Rahmennummer' },
{ name: 'security.adfcCoding', header: 'ADFC Codierung' }, { name: 'security.adfcCoding', header: 'ADFC Codierung' },
{ name: 'security.keyNumberAXAChain', header: 'Schlüsselnrummer Rahmenschloss' }, {
{ name: 'security.keyNumberFrameLock', header: 'Schlüsselnrummer AXA-Kette' }, name: 'security.keyNumberAXAChain',
header: 'Schlüsselnrummer Rahmenschloss',
},
{
name: 'security.keyNumberFrameLock',
header: 'Schlüsselnrummer AXA-Kette',
},
{ name: 'security.policeCoding', header: 'Polizei Codierung' }, { name: 'security.policeCoding', header: 'Polizei Codierung' },
{ name: 'technicalEquipment.bicycleShift', header: 'Schaltung' }, { name: 'technicalEquipment.bicycleShift', header: 'Schaltung' },
{ name: 'technicalEquipment.isEBike', header: 'E-Bike j/n' }, { name: 'technicalEquipment.isEBike', header: 'E-Bike j/n' },
@ -92,6 +106,10 @@ export class BikesComponent {
{ name: 'lendingStation.address.zip', header: '' }, { name: 'lendingStation.address.zip', header: '' },
]; ];
tableDataGQLType: string = 'CargoBike';
tableDataGQLCreateInputType: string = 'CargoBikeCreateInput';
tableDataGQLUpdateInputType: string = 'CargoBikeUpdateInput';
@ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort; @ViewChild(MatSort) sort: MatSort;
@ -116,9 +134,15 @@ export class BikesComponent {
) {} ) {}
ngAfterViewInit() { ngAfterViewInit() {
this.addTypesToColumnInfo(); this.addColumnPropertiesFromGQLSchemaToColumnInfo();
this.addReadOnlyPropertiesToColumnInfo();
this.data.paginator = this.paginator; this.data.paginator = this.paginator;
this.data.sortingDataAccessor = (item, columnName) => {
if (typeof item[columnName] === 'string') {
return item[columnName].toLocaleLowerCase();
}
return item[columnName];
}
this.data.sort = this.sort; this.data.sort = this.sort;
this.columnInfo.forEach((column) => this.columnInfo.forEach((column) =>
@ -162,19 +186,28 @@ export class BikesComponent {
clearInterval(this.relockingInterval); clearInterval(this.relockingInterval);
} }
addTypesToColumnInfo() { addColumnPropertiesFromGQLSchemaToColumnInfo() {
for (const column of this.columnInfo) { for (const column of this.columnInfo) {
if (!column.type) { const typeInformation = this.schemaService.getTypeInformation(
column.type = this.getType(column.name); this.tableDataGQLType,
} column.name
} );
column.type = column.type || typeInformation.type;
} }
addReadOnlyPropertiesToColumnInfo() {
for (const column of this.columnInfo) { for (const column of this.columnInfo) {
if (!column.readonly) { const typeInformation = this.schemaService.getTypeInformation(
column.readonly = this.isReadonly(column.name); this.tableDataGQLUpdateInputType,
column.name
);
column.readonly = column.readonly || !typeInformation.isPartOfType;
} }
for (const column of this.columnInfo) {
const typeInformation = this.schemaService.getTypeInformation(
this.tableDataGQLCreateInputType,
column.name
);
column.requiredForCreation = typeInformation.isRequired;
column.acceptedForCreation = typeInformation.isPartOfType;
} }
} }
@ -185,20 +218,6 @@ export class BikesComponent {
); );
} }
getType(propertyName: string) {
return this.schemaService.getPropertyTypeFromSchema(
'CargoBike',
propertyName
);
}
isReadonly(propertyName: string) {
return (
this.columnInfo.find((column) => column.name === propertyName).readonly ||
!isPartOfGraphQLDoc(propertyName, CargoBikeFieldsMutableFragmentDoc)
);
}
isStickyColumn(propertyName: string) { isStickyColumn(propertyName: string) {
return ( return (
this.columnInfo.find((column) => column.name === propertyName)?.sticky || this.columnInfo.find((column) => column.name === propertyName)?.sticky ||
@ -210,18 +229,50 @@ export class BikesComponent {
return this.loadingRowIds.includes(id); return this.loadingRowIds.includes(id);
} }
validityChange(row: any, columnName: string, isValid: Event) {
if (!row.FieldsValidity) {
row['FieldsValidity'] = {};
}
row['FieldsValidity'][columnName] = isValid;
}
countUnvalidFields(row: any) {
let unvalidFieldsCount = 0;
if (!row.FieldsValidity) {
return 99;
}
for (const prop in row.FieldsValidity) {
if (!row.FieldsValidity[prop]) {
unvalidFieldsCount++;
}
}
return unvalidFieldsCount;
}
reloadTable() { reloadTable() {
this.reloadingTable = true; this.reloadingTable = true;
this.bikesService.loadBikes(); this.bikesService.loadBikes();
} }
addEmptyRow() {
this.data.data = [{ newObject: true }, ...this.data.data];
}
create(row: any) {
const newBike = this.schemaService.filterObject(
this.tableDataGQLCreateInputType,
deepen(row)
);
this.bikesService.createBike({ bike: newBike });
}
edit(row: CargoBikeResult) { edit(row: CargoBikeResult) {
this.bikesService.lockBike({ id: row.id }); this.bikesService.lockBike({ id: row.id });
} }
save(row: CargoBikeResult) { save(row: CargoBikeResult) {
const deepenRow: CargoBikeUpdateInput = filter( const deepenRow = this.schemaService.filterObject(
CargoBikeFieldsMutableFragmentDoc, this.tableDataGQLUpdateInputType,
deepen(row) deepen(row)
); );
this.bikesService.updateBike({ bike: deepenRow }); this.bikesService.updateBike({ bike: deepenRow });

@ -67,10 +67,12 @@ export class AuthService {
) )
.pipe( .pipe(
catchError((error: any) => { catchError((error: any) => {
console.log(error);
if (error.status === 400) { if (error.status === 400) {
this.removeTokens(); this.removeTokens();
this.checkIfUserIsLoggedIn(); this.checkIfUserIsLoggedIn();
location.replace('/login'); location.replace('/login');
} }
return of(); return of();
}) })

@ -13,6 +13,8 @@ import {
LockCargoBikeMutationVariables, LockCargoBikeMutationVariables,
UnlockCargoBikeGQL, UnlockCargoBikeGQL,
UnlockCargoBikeMutationVariables, UnlockCargoBikeMutationVariables,
CreateCargoBikeGQL,
CreateCargoBikeMutationVariables,
} from 'src/generated/graphql'; } from 'src/generated/graphql';
import { DeepExtractTypeSkipArrays } from 'ts-deep-extract-types'; import { DeepExtractTypeSkipArrays } from 'ts-deep-extract-types';
@ -35,7 +37,8 @@ export class BikesService {
private getCargoBikeByIdGQL: GetCargoBikeByIdGQL, private getCargoBikeByIdGQL: GetCargoBikeByIdGQL,
private updateCargoBikeGQL: UpdateCargoBikeGQL, private updateCargoBikeGQL: UpdateCargoBikeGQL,
private lockCargoBikeGQL: LockCargoBikeGQL, private lockCargoBikeGQL: LockCargoBikeGQL,
private unlockCargoBikeGQL: UnlockCargoBikeGQL private unlockCargoBikeGQL: UnlockCargoBikeGQL,
private createCargoBikeGQL: CreateCargoBikeGQL,
) {} ) {}
addLoadingRowId(id: string) { addLoadingRowId(id: string) {
@ -80,6 +83,18 @@ export class BikesService {
}); });
} }
createBike(variables: CreateCargoBikeMutationVariables) {
console.log(variables);
this.createCargoBikeGQL
.mutate(variables)
.subscribe((result) => {
const newBike = result.data.createCargoBike;
this.bikes.next(
[newBike, ...this.bikes.value]
);
})
}
updateBike(variables: UpdateCargoBikeMutationVariables) { updateBike(variables: UpdateCargoBikeMutationVariables) {
this.addLoadingRowId(variables.bike.id); this.addLoadingRowId(variables.bike.id);
this.updateCargoBikeGQL this.updateCargoBikeGQL

@ -5,7 +5,6 @@ import jsonSchema from 'src/generated/graphql.schema.json';
providedIn: 'root', providedIn: 'root',
}) })
export class SchemaService { export class SchemaService {
/** expects startingObject and variablePath and returns its type e.g. cargoBike, security.name -> returns the type of the name variable */ /** expects startingObject and variablePath and returns its type e.g. cargoBike, security.name -> returns the type of the name variable */
getPropertyTypeFromSchema( getPropertyTypeFromSchema(
startingObjectName: string, startingObjectName: string,
@ -21,9 +20,15 @@ export class SchemaService {
); );
const type = field.type.name || field.type.ofType.name; const type = field.type.name || field.type.ofType.name;
if (variablePath.length === 1) { if (variablePath.length === 1) {
if (field.type.kind === 'ENUM') { if (
field.type.kind === 'ENUM' ||
(field.type.kind === 'NON_NULL' && field.type.ofType.kind === 'ENUM')
) {
return ( return (
'Enum//' + this.getEnumValuesFromSchema(field.type.name).join('//') 'Enum//' +
this.getEnumValuesFromSchema(
field.type.name || field.type.ofType.name
).join('//')
); );
} }
return type; return type;
@ -40,4 +45,70 @@ export class SchemaService {
const type = types.find((type) => type.name === typeName); const type = types.find((type) => type.name === typeName);
return type.enumValues.map((value) => value.name); return type.enumValues.map((value) => value.name);
} }
/** expects startingObject and variablePath and returns TypeInformation like isPartOfType, type, isRequired e.g. cargoBike, security.name -> returns {isPartOfType: true, type: "string", isRequired: false} */
getTypeInformation(
startingObjectName: string,
variable: string
): { isPartOfType: boolean; type: string; isRequired: boolean } {
const variablePath = variable.split('.');
const types = jsonSchema.__schema.types;
const startingObject = types.find(
(type) => type.name === startingObjectName
);
if (!startingObject) {
return { isPartOfType: false, type: '', isRequired: false };
}
const fields = startingObject.fields || startingObject.inputFields;
if (!fields) {
return { isPartOfType: false, type: '', isRequired: false };
}
const field = fields.find((field) => field.name === variablePath[0]);
if (!field) {
return { isPartOfType: false, type: '', isRequired: false };
}
const type = field.type.name || field.type.ofType.name;
if (variablePath.length === 1) {
const isRequired = field.type.kind === 'NON_NULL';
if (
field.type.kind === 'ENUM' ||
(isRequired && field.type.ofType.kind === 'ENUM')
) {
return {
isPartOfType: true,
type:
'Enum//' +
this.getEnumValuesFromSchema(
field.type.name || field.type.ofType.name
).join('//'),
isRequired: isRequired,
};
} else
return {
isPartOfType: true,
type: type,
isRequired: isRequired,
};
} else {
return this.getTypeInformation(type, variablePath.slice(1).join('.'));
}
}
filterObject(graphQLTypeName: string, object: object): any {
const filteredObject = {};
for (const prop in object) {
if (typeof object[prop] === 'object' && object[prop] !== null) {
const info = this.getTypeInformation(graphQLTypeName, prop);
if (info.isPartOfType) {
filteredObject[prop] = this.filterObject(info.type, object[prop]);
}
} else {
const info = this.getTypeInformation(graphQLTypeName, prop);
if (info.isPartOfType) {
filteredObject[prop] = object[prop];
}
}
}
return filteredObject;
}
} }

@ -28,6 +28,16 @@
"enumValues": null, "enumValues": null,
"possibleTypes": null "possibleTypes": null
}, },
{
"kind": "SCALAR",
"name": "Money",
"description": "is of american format [-]$[0-9]+.[0-9][0-9]\ncommas every three digits and . for decimals with 2 digits after the .\nThere can be a leading -.\nThere is a currency signe at the first position or second position if - is set.\nThe kind of currency depends on the database.",
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{ {
"kind": "OBJECT", "kind": "OBJECT",
"name": "CargoBike", "name": "CargoBike",
@ -1115,11 +1125,11 @@
}, },
{ {
"name": "projectAllowance", "name": "projectAllowance",
"description": "Projektzuschuss", "description": "Projektzuschuss:\nis of american format [-]$[0-9]+.[0-9][0-9]\ncommas every three digits and . for decimals with 2 digits after the .\nThere can be a leading -.\nThere is a currency signe at the first position or second position if - is set.\nThe kind of currency depends on the database.",
"args": [], "args": [],
"type": { "type": {
"kind": "SCALAR", "kind": "SCALAR",
"name": "Float", "name": "Money",
"ofType": null "ofType": null
}, },
"isDeprecated": false, "isDeprecated": false,
@ -1279,10 +1289,10 @@
}, },
{ {
"name": "projectAllowance", "name": "projectAllowance",
"description": "Projektzuschuss", "description": "Projektzuschuss:\nmust be of format [+|-][$][0-9]*[.[0-9]*]\ncommas are ignored, non numeric values except , and . lead to errors\nThere can be a leading + or -.\nYou can pass a currency signe at the first position or second position of + or - is set.\nThe kind of currency depends on the database.",
"type": { "type": {
"kind": "SCALAR", "kind": "SCALAR",
"name": "Float", "name": "Money",
"ofType": null "ofType": null
}, },
"defaultValue": null "defaultValue": null
@ -1400,10 +1410,10 @@
}, },
{ {
"name": "projectAllowance", "name": "projectAllowance",
"description": "Projektzuschuss", "description": "Projektzuschuss:\nmust be of format [+|-][$][0-9]*[.[0-9]*]\ncommas are ignored, non numeric values except , and . lead to errors\nThere can be a leading + or -.\nYou can pass a currency signe at the first position or second position of + or - is set.\nThe kind of currency depends on the database.",
"type": { "type": {
"kind": "SCALAR", "kind": "SCALAR",
"name": "Float", "name": "Money",
"ofType": null "ofType": null
}, },
"defaultValue": null "defaultValue": null
@ -1446,7 +1456,7 @@
}, },
{ {
"name": "lockable", "name": "lockable",
"description": null, "description": "cover box can be locked",
"args": [], "args": [],
"type": { "type": {
"kind": "NON_NULL", "kind": "NON_NULL",

@ -14,6 +14,14 @@ export type Scalars = {
Date: any; Date: any;
/** only time hh-mm-ss */ /** only time hh-mm-ss */
Time: any; Time: any;
/**
* is of american format [-]$[0-9]+.[0-9][0-9]
* commas every three digits and . for decimals with 2 digits after the .
* There can be a leading -.
* There is a currency signe at the first position or second position if - is set.
* The kind of currency depends on the database.
*/
Money: any;
/** The `Upload` scalar type represents a file upload. */ /** The `Upload` scalar type represents a file upload. */
Upload: any; Upload: any;
}; };
@ -22,6 +30,7 @@ export type Scalars = {
/** The CargoBike type is central to the graph. You could call it the root. */ /** The CargoBike type is central to the graph. You could call it the root. */
export type CargoBike = { export type CargoBike = {
__typename?: 'CargoBike'; __typename?: 'CargoBike';
@ -164,8 +173,15 @@ export type InsuranceData = {
maintenanceAgreement?: Maybe<Scalars['String']>; maintenanceAgreement?: Maybe<Scalars['String']>;
hasFixedRate: Scalars['Boolean']; hasFixedRate: Scalars['Boolean'];
fixedRate?: Maybe<Scalars['Float']>; fixedRate?: Maybe<Scalars['Float']>;
/** Projektzuschuss */ /**
projectAllowance?: Maybe<Scalars['Float']>; * Projektzuschuss:
* is of american format [-]$[0-9]+.[0-9][0-9]
* commas every three digits and . for decimals with 2 digits after the .
* There can be a leading -.
* There is a currency signe at the first position or second position if - is set.
* The kind of currency depends on the database.
*/
projectAllowance?: Maybe<Scalars['Money']>;
notes?: Maybe<Scalars['String']>; notes?: Maybe<Scalars['String']>;
}; };
@ -181,8 +197,15 @@ export type InsuranceDataCreateInput = {
maintenanceAgreement?: Maybe<Scalars['String']>; maintenanceAgreement?: Maybe<Scalars['String']>;
hasFixedRate: Scalars['Boolean']; hasFixedRate: Scalars['Boolean'];
fixedRate?: Maybe<Scalars['Float']>; fixedRate?: Maybe<Scalars['Float']>;
/** Projektzuschuss */ /**
projectAllowance?: Maybe<Scalars['Float']>; * Projektzuschuss:
* must be of format [+|-][$][0-9]*[.[0-9]*]
* commas are ignored, non numeric values except , and . lead to errors
* There can be a leading + or -.
* You can pass a currency signe at the first position or second position of + or - is set.
* The kind of currency depends on the database.
*/
projectAllowance?: Maybe<Scalars['Money']>;
notes?: Maybe<Scalars['String']>; notes?: Maybe<Scalars['String']>;
}; };
@ -198,8 +221,15 @@ export type InsuranceDataUpdateInput = {
maintenanceAgreement?: Maybe<Scalars['String']>; maintenanceAgreement?: Maybe<Scalars['String']>;
hasFixedRate?: Maybe<Scalars['Boolean']>; hasFixedRate?: Maybe<Scalars['Boolean']>;
fixedRate?: Maybe<Scalars['Float']>; fixedRate?: Maybe<Scalars['Float']>;
/** Projektzuschuss */ /**
projectAllowance?: Maybe<Scalars['Float']>; * Projektzuschuss:
* must be of format [+|-][$][0-9]*[.[0-9]*]
* commas are ignored, non numeric values except , and . lead to errors
* There can be a leading + or -.
* You can pass a currency signe at the first position or second position of + or - is set.
* The kind of currency depends on the database.
*/
projectAllowance?: Maybe<Scalars['Money']>;
notes?: Maybe<Scalars['String']>; notes?: Maybe<Scalars['String']>;
}; };
@ -207,6 +237,7 @@ export type InsuranceDataUpdateInput = {
export type DimensionsAndLoad = { export type DimensionsAndLoad = {
__typename?: 'DimensionsAndLoad'; __typename?: 'DimensionsAndLoad';
hasCoverBox: Scalars['Boolean']; hasCoverBox: Scalars['Boolean'];
/** cover box can be locked */
lockable: Scalars['Boolean']; lockable: Scalars['Boolean'];
boxLength: Scalars['Float']; boxLength: Scalars['Float'];
boxWidth: Scalars['Float']; boxWidth: Scalars['Float'];
@ -1681,6 +1712,19 @@ export type GetCargoBikeByIdQuery = (
)> } )> }
); );
export type CreateCargoBikeMutationVariables = Exact<{
bike: CargoBikeCreateInput;
}>;
export type CreateCargoBikeMutation = (
{ __typename?: 'Mutation' }
& { createCargoBike: (
{ __typename?: 'CargoBike' }
& CargoBikeFieldsFragment
) }
);
export type UpdateCargoBikeMutationVariables = Exact<{ export type UpdateCargoBikeMutationVariables = Exact<{
bike: CargoBikeUpdateInput; bike: CargoBikeUpdateInput;
}>; }>;
@ -1962,6 +2006,24 @@ export const GetCargoBikeByIdDocument = gql`
export class GetCargoBikeByIdGQL extends Apollo.Query<GetCargoBikeByIdQuery, GetCargoBikeByIdQueryVariables> { export class GetCargoBikeByIdGQL extends Apollo.Query<GetCargoBikeByIdQuery, GetCargoBikeByIdQueryVariables> {
document = GetCargoBikeByIdDocument; document = GetCargoBikeByIdDocument;
constructor(apollo: Apollo.Apollo) {
super(apollo);
}
}
export const CreateCargoBikeDocument = gql`
mutation CreateCargoBike($bike: CargoBikeCreateInput!) {
createCargoBike(cargoBike: $bike) {
...CargoBikeFields
}
}
${CargoBikeFieldsFragmentDoc}`;
@Injectable({
providedIn: 'root'
})
export class CreateCargoBikeGQL extends Apollo.Mutation<CreateCargoBikeMutation, CreateCargoBikeMutationVariables> {
document = CreateCargoBikeDocument;
constructor(apollo: Apollo.Apollo) { constructor(apollo: Apollo.Apollo) {
super(apollo); super(apollo);
} }

Loading…
Cancel
Save