| @@ -100,6 +100,12 @@ export abstract class AbstractDataFormComponent<T extends { [key: string]: any } | |||||
| }); | }); | ||||
| } | } | ||||
| onDateChange(newDate: any, fieldName: string) { | |||||
| if (typeof newDate === 'string' || newDate === null) { | |||||
| this.form.patchValue({ [fieldName]: newDate }); | |||||
| } | |||||
| } | |||||
| isEditMode(): boolean { | isEditMode(): boolean { | ||||
| return this.mode === FormMode.Edit; | return this.mode === FormMode.Edit; | ||||
| } | } | ||||
| @@ -60,10 +60,10 @@ export class DatetimePickerComponent implements OnInit { | |||||
| // Format the date to match the loaded format | // Format the date to match the loaded format | ||||
| const formattedDate = dateTime.toLocaleString('sv-SE', { timeZone: 'Europe/Berlin' }).replace(' ', 'T') + '+02:00'; | const formattedDate = dateTime.toLocaleString('sv-SE', { timeZone: 'Europe/Berlin' }).replace(' ', 'T') + '+02:00'; | ||||
| console.log('Emitting datetime:', formattedDate); | |||||
| //console.log('Emitting datetime:', formattedDate); | |||||
| this.dateTimeChange.emit(formattedDate); | this.dateTimeChange.emit(formattedDate); | ||||
| } else { | } else { | ||||
| console.log('Emitting null datetime'); | |||||
| //console.log('Emitting null datetime'); | |||||
| this.dateTimeChange.emit(null); | this.dateTimeChange.emit(null); | ||||
| } | } | ||||
| } | } | ||||
| @@ -19,14 +19,14 @@ | |||||
| <li class="nav-item mb-3"> | <li class="nav-item mb-3"> | ||||
| <a class="card" routerLink="/trips" routerLinkActive="active"> | <a class="card" routerLink="/trips" routerLinkActive="active"> | ||||
| <div class="card-body position-relative" data-cat="dashboard"> | <div class="card-body position-relative" data-cat="dashboard"> | ||||
| <h3 class="position-absolute m-0">{{'trips.view' | translate}}</h3> | |||||
| <h3 class="position-absolute m-0">{{'trip.view' | translate}}</h3> | |||||
| </div> | </div> | ||||
| </a> | </a> | ||||
| </li> | </li> | ||||
| <li class="nav-item mb-3"> | <li class="nav-item mb-3"> | ||||
| <a class="card" routerLink="/user-trips" routerLinkActive="active"> | <a class="card" routerLink="/user-trips" routerLinkActive="active"> | ||||
| <div class="card-body position-relative" data-cat="dashboard"> | <div class="card-body position-relative" data-cat="dashboard"> | ||||
| <h3 class="position-absolute m-0">{{'user_trips.view' | translate}}</h3> | |||||
| <h3 class="position-absolute m-0">{{'user_trip.view' | translate}}</h3> | |||||
| </div> | </div> | ||||
| </a> | </a> | ||||
| </li> | </li> | ||||
| @@ -47,6 +47,8 @@ export class SearchSelectComponent implements OnInit, AfterViewInit { | |||||
| if (this.dataSet !== undefined) { | if (this.dataSet !== undefined) { | ||||
| this.searchBoxFilled = true; | this.searchBoxFilled = true; | ||||
| } | } | ||||
| // Add this line to create a deep copy of the listColDefinitions | |||||
| this.listColDefinitions = JSON.parse(JSON.stringify(this.listColDefinitions)); | |||||
| } | } | ||||
| ngAfterViewInit(): void { | ngAfterViewInit(): void { | ||||
| @@ -95,6 +97,36 @@ export class SearchSelectComponent implements OnInit, AfterViewInit { | |||||
| return this.listComponent.getPageSize(); | return this.listComponent.getPageSize(); | ||||
| } | } | ||||
| public static getDefaultColDefLocations(subResource?: string): ListColDefinition[] { | |||||
| return [ | |||||
| { | |||||
| name: 'name', | |||||
| text: 'common.name', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| field: 'name', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'code', | |||||
| text: 'common.code', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| field: 'code', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'zone', | |||||
| text: 'model.zone', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| subResource: 'zone', | |||||
| field: 'name', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| ]; | |||||
| } | |||||
| public static getDefaultColDefZones(subResource?: string): ListColDefinition[] { | public static getDefaultColDefZones(subResource?: string): ListColDefinition[] { | ||||
| return [ | return [ | ||||
| { | { | ||||
| @@ -144,4 +176,42 @@ export class SearchSelectComponent implements OnInit, AfterViewInit { | |||||
| } as ListColDefinition, | } as ListColDefinition, | ||||
| ]; | ]; | ||||
| } | } | ||||
| public static getDefaultColDefVessels(subResource?: string): ListColDefinition[] { | |||||
| return [ | |||||
| { | |||||
| name: 'name', | |||||
| text: 'common.name', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| field: 'name', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'code', | |||||
| text: 'common.code', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| field: 'code', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'shippingCompanyName', | |||||
| text: 'model.shipping_company', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| subResource: 'company', | |||||
| field: 'name', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'createdAt', | |||||
| text: 'common.created_at', | |||||
| type: ListComponent.COLUMN_TYPE_DATE, | |||||
| field: 'createdAt', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_DATE, | |||||
| } as ListColDefinition, | |||||
| ]; | |||||
| } | |||||
| } | } | ||||
| @@ -1,10 +1,22 @@ | |||||
| import { FormGroup, FormControl, Validators } from '@angular/forms'; | import { FormGroup, FormControl, Validators } from '@angular/forms'; | ||||
| export const eventJsonldForm = new FormGroup({ | |||||
| dbId: new FormControl(null, []), | |||||
| name: new FormControl(null, []), | |||||
| identifier: new FormControl(null, []), | |||||
| sequence: new FormControl(null, []), | |||||
| mandatory: new FormControl(null, []), | |||||
| createdAt: new FormControl(null, []) | |||||
| }); | |||||
| export const locationForm = new FormGroup({ | export const locationForm = new FormGroup({ | ||||
| dbId: new FormControl(null, []), | dbId: new FormControl(null, []), | ||||
| zone: new FormControl(null, []), | zone: new FormControl(null, []), | ||||
| name: new FormControl(null, [Validators.required]), | name: new FormControl(null, [Validators.required]), | ||||
| code: new FormControl(null, [Validators.required]), | code: new FormControl(null, [Validators.required]), | ||||
| isZone: new FormControl(null, []), | |||||
| isPlace: new FormControl(null, []), | |||||
| isPort: new FormControl(null, []), | |||||
| createdAt: new FormControl(null, []) | createdAt: new FormControl(null, []) | ||||
| }); | }); | ||||
| @@ -13,6 +25,9 @@ export const locationJsonldForm = new FormGroup({ | |||||
| zone: new FormControl(null, []), | zone: new FormControl(null, []), | ||||
| name: new FormControl(null, [Validators.required]), | name: new FormControl(null, [Validators.required]), | ||||
| code: new FormControl(null, [Validators.required]), | code: new FormControl(null, [Validators.required]), | ||||
| isZone: new FormControl(null, []), | |||||
| isPlace: new FormControl(null, []), | |||||
| isPort: new FormControl(null, []), | |||||
| createdAt: new FormControl(null, []) | createdAt: new FormControl(null, []) | ||||
| }); | }); | ||||
| @@ -40,24 +55,28 @@ export const shippingCompanyJsonldForm = new FormGroup({ | |||||
| export const tripForm = new FormGroup({ | export const tripForm = new FormGroup({ | ||||
| dbId: new FormControl(null, []), | dbId: new FormControl(null, []), | ||||
| vessel: new FormControl(null, []), | vessel: new FormControl(null, []), | ||||
| pilotReference: new FormControl(null, [Validators.required]), | |||||
| pilotageReference: new FormControl(null, []), | |||||
| customerReference: new FormControl(null, []), | |||||
| captainName: new FormControl(null, []), | captainName: new FormControl(null, []), | ||||
| startLocation: new FormControl(null, []), | startLocation: new FormControl(null, []), | ||||
| endLocation: new FormControl(null, []), | endLocation: new FormControl(null, []), | ||||
| startDate: new FormControl(null, [Validators.required]), | startDate: new FormControl(null, [Validators.required]), | ||||
| endDate: new FormControl(null, [Validators.required]), | endDate: new FormControl(null, [Validators.required]), | ||||
| note: new FormControl(null, []), | |||||
| createdAt: new FormControl(null, []) | createdAt: new FormControl(null, []) | ||||
| }); | }); | ||||
| export const tripJsonldForm = new FormGroup({ | export const tripJsonldForm = new FormGroup({ | ||||
| dbId: new FormControl(null, []), | dbId: new FormControl(null, []), | ||||
| vessel: new FormControl(null, []), | vessel: new FormControl(null, []), | ||||
| pilotReference: new FormControl(null, [Validators.required]), | |||||
| pilotageReference: new FormControl(null, []), | |||||
| customerReference: new FormControl(null, []), | |||||
| captainName: new FormControl(null, []), | captainName: new FormControl(null, []), | ||||
| startLocation: new FormControl(null, []), | startLocation: new FormControl(null, []), | ||||
| endLocation: new FormControl(null, []), | endLocation: new FormControl(null, []), | ||||
| startDate: new FormControl(null, [Validators.required]), | startDate: new FormControl(null, [Validators.required]), | ||||
| endDate: new FormControl(null, [Validators.required]), | endDate: new FormControl(null, [Validators.required]), | ||||
| note: new FormControl(null, []), | |||||
| createdAt: new FormControl(null, []) | createdAt: new FormControl(null, []) | ||||
| }); | }); | ||||
| @@ -65,6 +84,7 @@ export const tripLocationForm = new FormGroup({ | |||||
| dbId: new FormControl(null, []), | dbId: new FormControl(null, []), | ||||
| trip: new FormControl(null, []), | trip: new FormControl(null, []), | ||||
| location: new FormControl(null, []), | location: new FormControl(null, []), | ||||
| isArrival: new FormControl(null, []), | |||||
| date: new FormControl(null, [Validators.required]), | date: new FormControl(null, [Validators.required]), | ||||
| createdAt: new FormControl(null, []) | createdAt: new FormControl(null, []) | ||||
| }); | }); | ||||
| @@ -73,6 +93,7 @@ export const tripLocationJsonldForm = new FormGroup({ | |||||
| dbId: new FormControl(null, []), | dbId: new FormControl(null, []), | ||||
| trip: new FormControl(null, []), | trip: new FormControl(null, []), | ||||
| location: new FormControl(null, []), | location: new FormControl(null, []), | ||||
| isArrival: new FormControl(null, []), | |||||
| date: new FormControl(null, [Validators.required]), | date: new FormControl(null, [Validators.required]), | ||||
| createdAt: new FormControl(null, []) | createdAt: new FormControl(null, []) | ||||
| }); | }); | ||||
| @@ -81,6 +102,7 @@ export const userForm = new FormGroup({ | |||||
| dbId: new FormControl(null, []), | dbId: new FormControl(null, []), | ||||
| email: new FormControl(null, [Validators.required, Validators.email]), | email: new FormControl(null, [Validators.required, Validators.email]), | ||||
| firstName: new FormControl(null, [Validators.required]), | firstName: new FormControl(null, [Validators.required]), | ||||
| referenceId: new FormControl(null, [Validators.required]), | |||||
| lastName: new FormControl(null, [Validators.required]), | lastName: new FormControl(null, [Validators.required]), | ||||
| image: new FormControl(null, []), | image: new FormControl(null, []), | ||||
| imageUrl: new FormControl(null, []), | imageUrl: new FormControl(null, []), | ||||
| @@ -88,7 +110,6 @@ export const userForm = new FormGroup({ | |||||
| password: new FormControl(null, []), | password: new FormControl(null, []), | ||||
| active: new FormControl(null, []), | active: new FormControl(null, []), | ||||
| roles: new FormControl(null, []), | roles: new FormControl(null, []), | ||||
| token: new FormControl(null, []), | |||||
| createdAt: new FormControl(null, []) | createdAt: new FormControl(null, []) | ||||
| }); | }); | ||||
| @@ -96,6 +117,7 @@ export const userJsonldForm = new FormGroup({ | |||||
| dbId: new FormControl(null, []), | dbId: new FormControl(null, []), | ||||
| email: new FormControl(null, [Validators.required, Validators.email]), | email: new FormControl(null, [Validators.required, Validators.email]), | ||||
| firstName: new FormControl(null, [Validators.required]), | firstName: new FormControl(null, [Validators.required]), | ||||
| referenceId: new FormControl(null, [Validators.required]), | |||||
| lastName: new FormControl(null, [Validators.required]), | lastName: new FormControl(null, [Validators.required]), | ||||
| image: new FormControl(null, []), | image: new FormControl(null, []), | ||||
| imageUrl: new FormControl(null, []), | imageUrl: new FormControl(null, []), | ||||
| @@ -103,7 +125,6 @@ export const userJsonldForm = new FormGroup({ | |||||
| password: new FormControl(null, []), | password: new FormControl(null, []), | ||||
| active: new FormControl(null, []), | active: new FormControl(null, []), | ||||
| roles: new FormControl(null, []), | roles: new FormControl(null, []), | ||||
| token: new FormControl(null, []), | |||||
| createdAt: new FormControl(null, []) | createdAt: new FormControl(null, []) | ||||
| }); | }); | ||||
| @@ -127,42 +148,6 @@ export const userTripJsonldForm = new FormGroup({ | |||||
| createdAt: new FormControl(null, []) | createdAt: new FormControl(null, []) | ||||
| }); | }); | ||||
| export const userTripLocationForm = new FormGroup({ | |||||
| dbId: new FormControl(null, []), | |||||
| userTrip: new FormControl(null, []), | |||||
| location: new FormControl(null, []), | |||||
| plannedDate: new FormControl(null, [Validators.required]), | |||||
| createdAt: new FormControl(null, []) | |||||
| }); | |||||
| export const userTripLocationJsonldForm = new FormGroup({ | |||||
| dbId: new FormControl(null, []), | |||||
| userTrip: new FormControl(null, []), | |||||
| location: new FormControl(null, []), | |||||
| plannedDate: new FormControl(null, [Validators.required]), | |||||
| createdAt: new FormControl(null, []) | |||||
| }); | |||||
| export const userTripWorkLogForm = new FormGroup({ | |||||
| dbId: new FormControl(null, []), | |||||
| userTrip: new FormControl(null, []), | |||||
| startLocation: new FormControl(null, []), | |||||
| endLocation: new FormControl(null, []), | |||||
| startDate: new FormControl(null, [Validators.required]), | |||||
| endDate: new FormControl(null, [Validators.required]), | |||||
| createdAt: new FormControl(null, []) | |||||
| }); | |||||
| export const userTripWorkLogJsonldForm = new FormGroup({ | |||||
| dbId: new FormControl(null, []), | |||||
| userTrip: new FormControl(null, []), | |||||
| startLocation: new FormControl(null, []), | |||||
| endLocation: new FormControl(null, []), | |||||
| startDate: new FormControl(null, [Validators.required]), | |||||
| endDate: new FormControl(null, [Validators.required]), | |||||
| createdAt: new FormControl(null, []) | |||||
| }); | |||||
| export const vesselForm = new FormGroup({ | export const vesselForm = new FormGroup({ | ||||
| dbId: new FormControl(null, []), | dbId: new FormControl(null, []), | ||||
| name: new FormControl(null, [Validators.required]), | name: new FormControl(null, [Validators.required]), | ||||
| @@ -12,12 +12,13 @@ export class JwtInterceptor implements HttpInterceptor { | |||||
| intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { | intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { | ||||
| // add auth header with jwt if user is logged in and request is to the api url | // add auth header with jwt if user is logged in and request is to the api url | ||||
| const user = this.accountService.userValue; | const user = this.accountService.userValue; | ||||
| const isLoggedIn = user && user.token; | |||||
| const token = localStorage.getItem('token'); | |||||
| const isLoggedIn = user && token; | |||||
| const isApiUrl = request.url.startsWith(environment.apiUrl); | const isApiUrl = request.url.startsWith(environment.apiUrl); | ||||
| if (isLoggedIn && isApiUrl) { | if (isLoggedIn && isApiUrl) { | ||||
| request = request.clone({ | request = request.clone({ | ||||
| setHeaders: { | setHeaders: { | ||||
| Authorization: `Bearer ${user.token}` | |||||
| Authorization: `Bearer ${token}` | |||||
| } | } | ||||
| }); | }); | ||||
| } | } | ||||
| @@ -3,7 +3,7 @@ | |||||
| <h2>{{ (isEditMode() ? 'basic.edit' : 'basic.new') | translate }} {{ 'model.location' | translate }}</h2> | <h2>{{ (isEditMode() ? 'basic.edit' : 'basic.new') | translate }} {{ 'model.location' | translate }}</h2> | ||||
| </div> | </div> | ||||
| <div class="spt-form"> | <div class="spt-form"> | ||||
| <form [formGroup]="form" (ngSubmit)="onSubmit()"> | |||||
| <form [formGroup]="locationForm" (ngSubmit)="onSubmit()"> | |||||
| <div class="mb-3"> | <div class="mb-3"> | ||||
| <label for="name" class="form-label">{{ 'common.name' | translate }}*:</label> | <label for="name" class="form-label">{{ 'common.name' | translate }}*:</label> | ||||
| <input type="text" class="form-control" id="name" formControlName="name" required/> | <input type="text" class="form-control" id="name" formControlName="name" required/> | ||||
| @@ -27,6 +27,30 @@ | |||||
| <input id="zone" type="hidden" formControlName="zone"/> | <input id="zone" type="hidden" formControlName="zone"/> | ||||
| </div> | </div> | ||||
| <div class="col-12 col-sm-6 col-md-4 col-lg-3 mb-3 switch-widget"> | |||||
| <p class="form-label">{{ 'location.is_zone' | translate }}:</p> | |||||
| <label class="switch"> | |||||
| <input type="checkbox" formControlName="isZone"> | |||||
| <span class="slider round"></span> | |||||
| </label> | |||||
| </div> | |||||
| <div class="col-12 col-sm-6 col-md-4 col-lg-3 mb-3 switch-widget"> | |||||
| <p class="form-label">{{ 'location.is_place' | translate }}:</p> | |||||
| <label class="switch"> | |||||
| <input type="checkbox" formControlName="isPlace"> | |||||
| <span class="slider round"></span> | |||||
| </label> | |||||
| </div> | |||||
| <div class="col-12 col-sm-6 col-md-4 col-lg-3 mb-3 switch-widget"> | |||||
| <p class="form-label">{{ 'location.is_port' | translate }}:</p> | |||||
| <label class="switch"> | |||||
| <input type="checkbox" formControlName="isPort"> | |||||
| <span class="slider round"></span> | |||||
| </label> | |||||
| </div> | |||||
| <div class="flex gap-2"> | <div class="flex gap-2"> | ||||
| <button type="submit" class="btn btn-primary" [disabled]="form.invalid"> | <button type="submit" class="btn btn-primary" [disabled]="form.invalid"> | ||||
| {{ 'basic.save' | translate }} | {{ 'basic.save' | translate }} | ||||
| @@ -16,6 +16,7 @@ import { ROUTE_BASE_DATA } from "@app/app-routing.module"; | |||||
| export class LocationFormComponent extends AbstractDataFormComponent<LocationJsonld> { | export class LocationFormComponent extends AbstractDataFormComponent<LocationJsonld> { | ||||
| protected readonly SearchSelectComponent = SearchSelectComponent; | protected readonly SearchSelectComponent = SearchSelectComponent; | ||||
| protected zoneColDefinitions: ListColDefinition[]; | protected zoneColDefinitions: ListColDefinition[]; | ||||
| protected readonly locationForm = locationForm; | |||||
| constructor( | constructor( | ||||
| private locationService: LocationService, | private locationService: LocationService, | ||||
| @@ -39,4 +40,5 @@ export class LocationFormComponent extends AbstractDataFormComponent<LocationJso | |||||
| getZones: ListGetDataFunctionType = (index: number, pageSize: number, term?: string) => { | getZones: ListGetDataFunctionType = (index: number, pageSize: number, term?: string) => { | ||||
| return this.zoneService.zonesGetCollection(index, pageSize, term); | return this.zoneService.zonesGetCollection(index, pageSize, term); | ||||
| } | } | ||||
| } | } | ||||
| @@ -52,6 +52,30 @@ export class LocationListComponent implements OnInit, AfterViewInit { | |||||
| sortable: true, | sortable: true, | ||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | filterType: FilterBarComponent.FILTER_TYPE_TEXT, | ||||
| } as ListColDefinition, | } as ListColDefinition, | ||||
| { | |||||
| name: 'is_zone', | |||||
| text: 'location.is_zone', | |||||
| type: ListComponent.COLUMN_TYPE_BOOLEAN, | |||||
| field: 'isZone', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_BOOLEAN, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'is_place', | |||||
| text: 'location.is_place', | |||||
| type: ListComponent.COLUMN_TYPE_BOOLEAN, | |||||
| field: 'isPlace', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_BOOLEAN, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'is_port', | |||||
| text: 'location.is_port', | |||||
| type: ListComponent.COLUMN_TYPE_BOOLEAN, | |||||
| field: 'isPort', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_BOOLEAN, | |||||
| } as ListColDefinition, | |||||
| { | { | ||||
| name: 'createdAt', | name: 'createdAt', | ||||
| text: 'common.created_at', | text: 'common.created_at', | ||||
| @@ -0,0 +1,99 @@ | |||||
| @if (trip) { | |||||
| <div class="spt-container"> | |||||
| <div class="spt-headline d-flex justify-content-between align-items-start"> | |||||
| <h2>{{ ('basic.edit') | translate }} {{ 'model.trip' | translate }}</h2> | |||||
| </div> | |||||
| </div> | |||||
| <mat-tab-group> | |||||
| <mat-tab label="{{ 'trip.view_single' | translate }}"> | |||||
| <app-trip-form | |||||
| [data]="trip" | |||||
| [mode]="FormMode.Edit" | |||||
| [id]="appHelperService.extractId(trip.id!)" | |||||
| (submit)="onFormUpdate($event)" | |||||
| ></app-trip-form> | |||||
| </mat-tab> | |||||
| <mat-tab label="{{ 'trip.itinerary' | translate }}"> | |||||
| <div class="container-fluid p-4 bg-dark text-white"> | |||||
| <h4 class="mb-4">trip.locations</h4> | |||||
| <div *ngFor="let tripLocation of tripLocations; let i = index" class="mb-4"> | |||||
| <div class="row"> | |||||
| <div class="col-12 col-md-4 mb-3"> | |||||
| <label [for]="'location_' + i" class="form-label">Location*:</label> | |||||
| <app-search-select | |||||
| [formId]="'location'" | |||||
| [formLabelLangKey]="'model.location'" | |||||
| [documentForm]="locationForms[i]" | |||||
| [getDataFunction]="getLocations" | |||||
| [displayedDataField]="'name'" | |||||
| [listColDefinitions]="locationColDefinitions" | |||||
| [dataSet]="tripLocation.location" | |||||
| > | |||||
| </app-search-select> | |||||
| <input [id]="'location_' + i" type="hidden" formControlName="location"/> | |||||
| </div> | |||||
| <div class="col-12 col-md-2 mb-3"> | |||||
| <label class="form-label">trip.date (Date):</label> | |||||
| <div> | |||||
| <input | |||||
| type="date" | |||||
| class="form-control" | |||||
| [value]="formatDateForInput(tripLocation.date)" | |||||
| (change)="onDateInputChange($event, i)" | |||||
| /> | |||||
| </div> | |||||
| </div> | |||||
| <div class="col-12 col-md-2 mb-3"> | |||||
| <label class="form-label">trip.date (Time):</label> | |||||
| <div> | |||||
| <input | |||||
| type="time" | |||||
| class="form-control" | |||||
| [value]="formatTimeForInput(tripLocation.date)" | |||||
| (change)="onTimeInputChange($event, i)" | |||||
| /> | |||||
| </div> | |||||
| </div> | |||||
| <div class="col-12 col-md-2 mb-3 d-flex align-items-end"> | |||||
| <div class="form-check"> | |||||
| <input | |||||
| class="form-check-input" | |||||
| type="checkbox" | |||||
| [id]="'isArrival_' + i" | |||||
| [checked]="tripLocation.isArrival" | |||||
| (change)="onIsArrivalChange($event, i)" | |||||
| > | |||||
| <label class="form-check-label text-white" [for]="'isArrival_' + i"> | |||||
| trip.is_arrival | |||||
| </label> | |||||
| </div> | |||||
| </div> | |||||
| <div class="col-12 col-md-2 mb-3 d-flex align-items-end"> | |||||
| <button type="button" class="btn btn-danger" (click)="removeTripLocation(i)"> | |||||
| basic.remove | |||||
| </button> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| <div class="my-3"> | |||||
| <button type="button" class="btn btn-primary" (click)="addNewTripLocation()"> | |||||
| basic.add | |||||
| </button> | |||||
| </div> | |||||
| <div class="mt-4"> | |||||
| <button type="button" class="btn btn-success" (click)="saveAllTripLocations()"> | |||||
| Save | |||||
| </button> | |||||
| </div> | |||||
| </div> | |||||
| </mat-tab> | |||||
| </mat-tab-group> | |||||
| } | |||||
| @@ -0,0 +1,23 @@ | |||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { TripDetailComponent } from './trip-detail.component'; | |||||
| describe('TripDetailComponent', () => { | |||||
| let component: TripDetailComponent; | |||||
| let fixture: ComponentFixture<TripDetailComponent>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [TripDetailComponent] | |||||
| }) | |||||
| .compileComponents(); | |||||
| fixture = TestBed.createComponent(TripDetailComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -0,0 +1,218 @@ | |||||
| import { Component, OnInit, ViewChild, AfterViewInit, QueryList, ViewChildren } from '@angular/core'; | |||||
| import { FormBuilder, FormGroup } from '@angular/forms'; | |||||
| import { TripJsonld, TripLocationJsonld, TripLocationService, TripService, LocationService, LocationJsonld } from "@app/core/api/v1"; | |||||
| import { AppHelperService } from "@app/_helpers/app-helper.service"; | |||||
| import { ActivatedRoute } from "@angular/router"; | |||||
| import { FormMode, FormSubmitEvent } from "@app/_components/_abstract/abstract-data-form-component"; | |||||
| import { ModalStatus } from "@app/_helpers/modal.states"; | |||||
| import { Observable } from 'rxjs'; | |||||
| import { ListColDefinition } from '@app/_components/list/list-col-definition'; | |||||
| import { SearchSelectComponent } from '@app/_components/search-select/search-select.component'; | |||||
| import { ListComponent } from '@app/_components/list/list.component'; | |||||
| @Component({ | |||||
| selector: 'app-trip-detail', | |||||
| templateUrl: './trip-detail.component.html', | |||||
| styleUrl: './trip-detail.component.scss' | |||||
| }) | |||||
| export class TripDetailComponent implements OnInit, AfterViewInit { | |||||
| protected trip!: TripJsonld; | |||||
| protected readonly FormMode = FormMode; | |||||
| protected tripLocations: TripLocationJsonld[] = []; | |||||
| protected locationForms: FormGroup[] = []; | |||||
| protected locationColDefinitions: ListColDefinition[] = SearchSelectComponent.getDefaultColDefLocations(); | |||||
| @ViewChildren(SearchSelectComponent) searchSelects!: QueryList<SearchSelectComponent>; | |||||
| constructor( | |||||
| private tripService: TripService, | |||||
| private tripLocationService: TripLocationService, | |||||
| private locationService: LocationService, | |||||
| protected appHelperService: AppHelperService, | |||||
| private route: ActivatedRoute, | |||||
| private fb: FormBuilder | |||||
| ) {} | |||||
| ngOnInit() { | |||||
| this.route.params.subscribe(params => { | |||||
| this.tripService.tripsIdGet(params['id']).subscribe( | |||||
| data => { | |||||
| this.trip = data; | |||||
| this.loadTripLocations(); | |||||
| } | |||||
| ); | |||||
| }); | |||||
| } | |||||
| ngAfterViewInit() { | |||||
| // Reinitialize search selects when they change | |||||
| this.searchSelects.changes.subscribe(components => { | |||||
| components.forEach((component: SearchSelectComponent) => { | |||||
| // Force search selects to initialize | |||||
| if (component.dataSet) { | |||||
| component.ngAfterViewInit(); | |||||
| } | |||||
| }); | |||||
| }); | |||||
| } | |||||
| loadTripLocations() { | |||||
| this.tripLocationService.tripLocationsGetCollection( | |||||
| 1, | |||||
| 200, | |||||
| this.trip !== undefined ? this.trip.id : undefined, | |||||
| ).subscribe( | |||||
| data => { | |||||
| this.tripLocations = data.member; | |||||
| // Create a form for each trip location | |||||
| this.locationForms = []; | |||||
| this.tripLocations.forEach(() => { | |||||
| this.locationForms.push(this.createLocationForm()); | |||||
| }); | |||||
| } | |||||
| ); | |||||
| } | |||||
| createLocationForm(): FormGroup { | |||||
| return this.fb.group({ | |||||
| location: [null] | |||||
| }); | |||||
| } | |||||
| getLocations = (page: number, pageSize: number, term?: string): Observable<any> => { | |||||
| return this.locationService.locationsGetCollection(page, pageSize, undefined, term); | |||||
| } | |||||
| onFormUpdate(event: FormSubmitEvent<TripJsonld>) { | |||||
| if (event.status === ModalStatus.Submitted && event.data) { | |||||
| this.trip = event.data; | |||||
| } | |||||
| } | |||||
| formatDateForInput(dateString: string): string { | |||||
| if (!dateString) return ''; | |||||
| const date = new Date(dateString); | |||||
| return date.toISOString().split('T')[0]; | |||||
| } | |||||
| formatTimeForInput(dateString: string): string { | |||||
| if (!dateString) return ''; | |||||
| const date = new Date(dateString); | |||||
| return date.toTimeString().slice(0, 5); | |||||
| } | |||||
| onDateInputChange(event: Event, index: number) { | |||||
| const input = event.target as HTMLInputElement; | |||||
| const currentDate = new Date(this.tripLocations[index].date || new Date()); | |||||
| const [year, month, day] = input.value.split('-').map(Number); | |||||
| currentDate.setFullYear(year, month - 1, day); | |||||
| this.tripLocations[index].date = currentDate.toISOString(); | |||||
| } | |||||
| onTimeInputChange(event: Event, index: number) { | |||||
| const input = event.target as HTMLInputElement; | |||||
| const currentDate = new Date(this.tripLocations[index].date || new Date()); | |||||
| const [hours, minutes] = input.value.split(':').map(Number); | |||||
| currentDate.setHours(hours, minutes); | |||||
| this.tripLocations[index].date = currentDate.toISOString(); | |||||
| } | |||||
| onIsArrivalChange(event: Event, index: number) { | |||||
| const checkbox = event.target as HTMLInputElement; | |||||
| this.tripLocations[index].isArrival = checkbox.checked; | |||||
| } | |||||
| addNewTripLocation() { | |||||
| // Create a new empty trip location | |||||
| const newTripLocation: TripLocationJsonld = { | |||||
| trip: { | |||||
| 'id': this.trip.id // Ensure we send the trip ID in the correct format | |||||
| } as TripJsonld, | |||||
| date: new Date().toISOString(), | |||||
| isArrival: false | |||||
| }; | |||||
| this.tripLocations.push(newTripLocation); | |||||
| this.locationForms.push(this.createLocationForm()); | |||||
| // Force update in the next event loop to properly initialize the search-select | |||||
| setTimeout(() => { | |||||
| if (this.searchSelects) { | |||||
| const lastSelect = this.searchSelects.last; | |||||
| if (lastSelect) { | |||||
| lastSelect.ngAfterViewInit(); | |||||
| } | |||||
| } | |||||
| }); | |||||
| } | |||||
| removeTripLocation(index: number) { | |||||
| const tripLocationId = this.tripLocations[index].id; | |||||
| if (tripLocationId) { | |||||
| // If it exists on the server, delete it | |||||
| this.tripLocationService.tripLocationsIdDelete(this.appHelperService.extractId(tripLocationId)).subscribe( | |||||
| () => { | |||||
| this.tripLocations.splice(index, 1); | |||||
| this.locationForms.splice(index, 1); | |||||
| } | |||||
| ); | |||||
| } else { | |||||
| // If it's only local, just remove it from the array | |||||
| this.tripLocations.splice(index, 1); | |||||
| this.locationForms.splice(index, 1); | |||||
| } | |||||
| } | |||||
| saveAllTripLocations() { | |||||
| // First update the location objects in our tripLocations array | |||||
| this.tripLocations.forEach((tripLocation, index) => { | |||||
| const locationFormValue = this.locationForms[index].get('location')?.value; | |||||
| // Ensure we have a location | |||||
| if (locationFormValue) { | |||||
| // If just an ID was set, create a proper location object | |||||
| if (typeof locationFormValue === 'string') { | |||||
| tripLocation.location = { | |||||
| 'id': locationFormValue | |||||
| } as LocationJsonld; | |||||
| } | |||||
| } else { | |||||
| // If no location is set, show an error | |||||
| return; | |||||
| } | |||||
| }); | |||||
| // Filter out trip locations that have no location set | |||||
| const validTripLocations = this.tripLocations.filter(tl => tl.location); | |||||
| if (validTripLocations.length === 0) { | |||||
| return; | |||||
| } | |||||
| // Save all trip locations | |||||
| const savePromises = validTripLocations.map(tripLocation => { | |||||
| if (tripLocation.id) { | |||||
| // Update existing | |||||
| return this.tripLocationService.tripLocationsIdPatch( | |||||
| this.appHelperService.extractId(tripLocation.id), | |||||
| tripLocation | |||||
| ).toPromise(); | |||||
| } else { | |||||
| // Create new | |||||
| return this.tripLocationService.tripLocationsPost(tripLocation).toPromise(); | |||||
| } | |||||
| }); | |||||
| Promise.all(savePromises) | |||||
| .then(() => { | |||||
| // Reload trip locations to get updated data | |||||
| this.loadTripLocations(); | |||||
| }) | |||||
| .catch(error => { | |||||
| console.error('Error saving trip locations:', error); | |||||
| }); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,93 @@ | |||||
| <div class="spt-container"> | |||||
| @if (!isEditMode()) { | |||||
| <div class="spt-headline d-flex justify-content-between align-items-start"> | |||||
| <h2>{{ ('basic.new') | translate }} {{ 'model.trip' | translate }}</h2> | |||||
| </div> | |||||
| } | |||||
| <div class="spt-form"> | |||||
| <form [formGroup]="tripForm" (ngSubmit)="onSubmit()"> | |||||
| <div class="mb-3"> | |||||
| <label for="vessel" class="form-label">{{ 'trip.vessel' | translate }}*:</label> | |||||
| <app-search-select #vesselSearchSelect | |||||
| [formId]="'vessel'" | |||||
| [formLabelLangKey]="'model.vessel'" | |||||
| [documentForm]="form" | |||||
| [getDataFunction]="getVessels" | |||||
| [displayedDataField]="'name'" | |||||
| [listColDefinitions]="vesselColDefinitions" | |||||
| [dataSet]="data?.vessel" | |||||
| > | |||||
| </app-search-select> | |||||
| <input id="vessel" type="hidden" formControlName="vessel" required/> | |||||
| </div> | |||||
| <div class="mb-3"> | |||||
| <label for="startLocation" class="form-label">{{ 'trip.start_location' | translate }}*:</label> | |||||
| <app-search-select #startLocationSearchSelect | |||||
| [formId]="'startLocation'" | |||||
| [formLabelLangKey]="'model.location'" | |||||
| [documentForm]="form" | |||||
| [getDataFunction]="getLocations" | |||||
| [displayedDataField]="'name'" | |||||
| [listColDefinitions]="locationColDefinitions" | |||||
| [dataSet]="data?.startLocation" | |||||
| > | |||||
| </app-search-select> | |||||
| <input id="startLocation" type="hidden" formControlName="startLocation" required/> | |||||
| </div> | |||||
| <div class="mb-3"> | |||||
| <label for="endLocation" class="form-label">{{ 'trip.end_location' | translate }}*:</label> | |||||
| <app-search-select #endLocationSearchSelect | |||||
| [formId]="'endLocation'" | |||||
| [formLabelLangKey]="'model.location'" | |||||
| [documentForm]="form" | |||||
| [getDataFunction]="getLocations" | |||||
| [displayedDataField]="'name'" | |||||
| [listColDefinitions]="locationColDefinitions" | |||||
| [dataSet]="data?.endLocation" | |||||
| > | |||||
| </app-search-select> | |||||
| <input id="endLocation" type="hidden" formControlName="endLocation" required/> | |||||
| </div> | |||||
| <div class="mb-3"> | |||||
| <label for="customerReference" class="form-label">{{ 'trip.customer_reference' | translate }}:</label> | |||||
| <input type="text" class="form-control" id="customerReference" formControlName="customerReference"/> | |||||
| </div> | |||||
| <div class="mb-3"> | |||||
| <label for="captainName" class="form-label">{{ 'trip.captain_name' | translate }}:</label> | |||||
| <input type="text" class="form-control" id="captainName" formControlName="captainName"/> | |||||
| </div> | |||||
| <div class="col-12 col-sm-6 col-md-4 col-lg-3 mb-3"> | |||||
| <app-datetime-picker | |||||
| [label]="'trip.start_date' | translate" | |||||
| [inputId]="'startDate'" | |||||
| [initialValue]="tripForm.get('startDate')?.value ?? null" | |||||
| (dateTimeChange)="onDateChange($event, 'startDate')" | |||||
| ></app-datetime-picker> | |||||
| </div> | |||||
| <div class="col-12 col-sm-6 col-md-4 col-lg-3 mb-3"> | |||||
| <app-datetime-picker | |||||
| [label]="'trip.end_date' | translate" | |||||
| [inputId]="'startDate'" | |||||
| [initialValue]="tripForm.get('endDate')?.value ?? null" | |||||
| (dateTimeChange)="onDateChange($event, 'endDate')" | |||||
| ></app-datetime-picker> | |||||
| </div> | |||||
| <div class="flex gap-2"> | |||||
| <button type="submit" class="btn btn-primary" [disabled]="form.invalid"> | |||||
| {{ 'basic.save' | translate }} | |||||
| </button> | |||||
| @if (isEditMode()) { | |||||
| <button type="button" class="ms-3 btn btn-primary" (click)="onDelete()"> | |||||
| {{ 'basic.delete' | translate }} {{ 'model.trip' | translate }} | |||||
| </button> | |||||
| } | |||||
| </div> | |||||
| </form> | |||||
| </div> | |||||
| </div> | |||||
| @@ -0,0 +1,23 @@ | |||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { TripFormComponent } from './trip-form.component'; | |||||
| describe('TripFormComponent', () => { | |||||
| let component: TripFormComponent; | |||||
| let fixture: ComponentFixture<TripFormComponent>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [TripFormComponent] | |||||
| }) | |||||
| .compileComponents(); | |||||
| fixture = TestBed.createComponent(TripFormComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -0,0 +1,64 @@ | |||||
| import { Component } from '@angular/core'; | |||||
| import { | |||||
| AbstractDataFormComponent, DeleteFunction, | |||||
| SaveFunction, | |||||
| UpdateFunction | |||||
| } from "@app/_components/_abstract/abstract-data-form-component"; | |||||
| import { | |||||
| LocationJsonld, LocationService, | |||||
| ShippingCompanyService, | |||||
| TripJsonld, | |||||
| TripService, | |||||
| VesselJsonld, | |||||
| VesselService | |||||
| } from "@app/core/api/v1"; | |||||
| import {SearchSelectComponent} from "@app/_components/search-select/search-select.component"; | |||||
| import {tripForm, vesselForm} from "@app/_forms/apiForms"; | |||||
| import {FormGroup} from "@angular/forms"; | |||||
| import {TranslateService} from "@ngx-translate/core"; | |||||
| import {Router} from "@angular/router"; | |||||
| import {ROUTE_BASE_DATA} from "@app/app-routing.module"; | |||||
| import {ListColDefinition} from "@app/_components/list/list-col-definition"; | |||||
| import {ListGetDataFunctionType} from "@app/_components/list/list-get-data-function-type"; | |||||
| @Component({ | |||||
| selector: 'app-trip-form', | |||||
| templateUrl: './trip-form.component.html', | |||||
| styleUrl: './trip-form.component.scss' | |||||
| }) | |||||
| export class TripFormComponent extends AbstractDataFormComponent<TripJsonld> { | |||||
| protected readonly SearchSelectComponent = SearchSelectComponent; | |||||
| protected vesselColDefinitions: ListColDefinition[]; | |||||
| protected locationColDefinitions: ListColDefinition[]; | |||||
| protected readonly tripForm = tripForm; | |||||
| constructor( | |||||
| private tripService: TripService, | |||||
| private vesselService: VesselService, | |||||
| private locationService: LocationService, | |||||
| translateService: TranslateService, | |||||
| router: Router | |||||
| ) { | |||||
| super( | |||||
| tripForm, | |||||
| (data: TripJsonld) => this.tripService.tripsPost(data), | |||||
| (id: string | number, data: TripJsonld) => this.tripService.tripsIdPatch(id.toString(), data), | |||||
| (id: string | number) => this.tripService.tripsIdDelete(id.toString()), | |||||
| translateService, | |||||
| router | |||||
| ); | |||||
| this.redirectAfterDelete = '/' + ROUTE_BASE_DATA; | |||||
| this.vesselColDefinitions = SearchSelectComponent.getDefaultColDefVessels(); | |||||
| this.locationColDefinitions = SearchSelectComponent.getDefaultColDefLocations(); | |||||
| } | |||||
| getVessels: ListGetDataFunctionType = (index: number, pageSize: number, term?: string) => { | |||||
| return this.vesselService.vesselsGetCollection(index, pageSize, term); | |||||
| } | |||||
| getLocations: ListGetDataFunctionType = (index: number, pageSize: number, term?: string) => { | |||||
| return this.locationService.locationsGetCollection(index, pageSize, term); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,8 @@ | |||||
| <div class="spt-container"> | |||||
| <app-list #listComponent | |||||
| [listId]="'tripList'" | |||||
| [getDataFunction]="getData" | |||||
| [listColDefinitions]="listColDefinitions" | |||||
| [dataFormComponent]="tripFormComponent" | |||||
| ></app-list> | |||||
| </div> | |||||
| @@ -0,0 +1,23 @@ | |||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { TripListComponent } from './trip-list.component'; | |||||
| describe('TripListComponent', () => { | |||||
| let component: TripListComponent; | |||||
| let fixture: ComponentFixture<TripListComponent>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [TripListComponent] | |||||
| }) | |||||
| .compileComponents(); | |||||
| fixture = TestBed.createComponent(TripListComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -0,0 +1,127 @@ | |||||
| import {Component, ViewChild} from '@angular/core'; | |||||
| import {ListComponent} from "@app/_components/list/list.component"; | |||||
| import {ListColDefinition} from "@app/_components/list/list-col-definition"; | |||||
| import {TripFormComponent} from "@app/_views/trip/trip-form/trip-form.component"; | |||||
| import {TripService} from "@app/core/api/v1"; | |||||
| import {AppHelperService} from "@app/_helpers/app-helper.service"; | |||||
| import {FilterBarComponent} from "@app/_components/filter-bar/filter-bar.component"; | |||||
| import {ListGetDataFunctionType} from "@app/_components/list/list-get-data-function-type"; | |||||
| @Component({ | |||||
| selector: 'app-trip-list', | |||||
| templateUrl: './trip-list.component.html', | |||||
| styleUrl: './trip-list.component.scss' | |||||
| }) | |||||
| export class TripListComponent { | |||||
| @ViewChild("listComponent", {static: false}) listComponent!: ListComponent; | |||||
| protected readonly tripFormComponent = TripFormComponent; | |||||
| protected listColDefinitions!: ListColDefinition[]; | |||||
| constructor( | |||||
| private tripService: TripService, | |||||
| protected appHelperService: AppHelperService, | |||||
| ) { | |||||
| this.listColDefinitions = [ | |||||
| { | |||||
| name: 'pilotageReference', | |||||
| text: 'trip.pilot_reference', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT_BOLD, | |||||
| field: 'pilotageReference', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'customerReference', | |||||
| text: 'trip.customer_reference', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| field: 'customerReference', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'vessel', | |||||
| text: 'trip.vessel', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| subResource: 'vessel', | |||||
| field: 'name', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'captainName', | |||||
| text: 'trip.captain_name', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| field: 'captainName', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'startLocation', | |||||
| text: 'trip.start_location', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| subResource: 'startLocation', | |||||
| field: 'name', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'endLocation', | |||||
| text: 'trip.end_location', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| subResource: 'endLocation', | |||||
| field: 'name', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'startDate', | |||||
| text: 'trip.start_date', | |||||
| type: ListComponent.COLUMN_TYPE_DATE, | |||||
| field: 'startDate', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_DATE, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'endDate', | |||||
| text: 'trip.end_date', | |||||
| type: ListComponent.COLUMN_TYPE_DATE, | |||||
| field: 'endDate', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_DATE, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'createdAt', | |||||
| text: 'common.created_at', | |||||
| type: ListComponent.COLUMN_TYPE_DATE, | |||||
| field: 'createdAt', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_DATE, | |||||
| } as ListColDefinition, | |||||
| ]; | |||||
| } | |||||
| ngOnInit() { | |||||
| } | |||||
| ngAfterViewInit(): void { | |||||
| this.listComponent.getData(); | |||||
| } | |||||
| getData: ListGetDataFunctionType = ( | |||||
| index: number, | |||||
| pageSize: number, | |||||
| term?: string, | |||||
| ) => { | |||||
| return this.tripService.tripsGetCollection( | |||||
| index, | |||||
| pageSize, | |||||
| term ? Number(term) : undefined, | |||||
| this.listComponent.getFilterJsonString(), | |||||
| this.listComponent.getSortingJsonString() | |||||
| ); | |||||
| } | |||||
| } | |||||
| @@ -1 +1,6 @@ | |||||
| <p>trip works!</p> | |||||
| <div class="spt-container"> | |||||
| <div class="spt-headline d-flex justify-content-between align-items-start"> | |||||
| <h2>{{ 'trip.view' | translate }}</h2> | |||||
| </div> | |||||
| <app-trip-list></app-trip-list> | |||||
| </div> | |||||
| @@ -9,6 +9,7 @@ import {ListGetDataFunctionType} from "@app/_components/list/list-get-data-funct | |||||
| import {Sort} from "@angular/material/sort"; | import {Sort} from "@angular/material/sort"; | ||||
| import {ROUTE_VESSELS, ROUTE_ZONES} from "@app/app-routing.module"; | import {ROUTE_VESSELS, ROUTE_ZONES} from "@app/app-routing.module"; | ||||
| import {VesselFormComponent} from "@app/_views/vessel/vessel-form/vessel-form.component"; | import {VesselFormComponent} from "@app/_views/vessel/vessel-form/vessel-form.component"; | ||||
| import {SearchSelectComponent} from "@app/_components/search-select/search-select.component"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-vessel-list', | selector: 'app-vessel-list', | ||||
| @@ -27,41 +28,7 @@ export class VesselListComponent { | |||||
| protected appHelperService: AppHelperService, | protected appHelperService: AppHelperService, | ||||
| ) { | ) { | ||||
| this.listColDefinitions = [ | |||||
| { | |||||
| name: 'name', | |||||
| text: 'common.name', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| field: 'name', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'code', | |||||
| text: 'common.code', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| field: 'code', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'shippingCompanyName', | |||||
| text: 'model.shipping_company', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| subResource: 'company', | |||||
| field: 'name', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| } as ListColDefinition, | |||||
| { | |||||
| name: 'createdAt', | |||||
| text: 'common.created_at', | |||||
| type: ListComponent.COLUMN_TYPE_DATE, | |||||
| field: 'createdAt', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_DATE, | |||||
| } as ListColDefinition, | |||||
| ]; | |||||
| this.listColDefinitions = SearchSelectComponent.getDefaultColDefVessels(); | |||||
| } | } | ||||
| ngOnInit() { | ngOnInit() { | ||||
| @@ -14,6 +14,8 @@ import {VesselDetailComponent} from "@app/_views/vessel/vessel-detail/vessel-det | |||||
| import { | import { | ||||
| ShippingCompanyDetailComponent | ShippingCompanyDetailComponent | ||||
| } from "@app/_views/shipping-company/shipping-company-detail/shipping-company-detail.component"; | } from "@app/_views/shipping-company/shipping-company-detail/shipping-company-detail.component"; | ||||
| import {TripComponent} from "@app/_views/trip/trip.component"; | |||||
| import {TripDetailComponent} from "@app/_views/trip/trip-detail/trip-detail.component"; | |||||
| const accountModule = () => import('@app/_views/account/account.module').then(x => x.AccountModule); | const accountModule = () => import('@app/_views/account/account.module').then(x => x.AccountModule); | ||||
| @@ -57,6 +59,22 @@ const routes: Routes = [ | |||||
| {path: ':id', component: LocationDetailComponent}, | {path: ':id', component: LocationDetailComponent}, | ||||
| ] | ] | ||||
| }, | }, | ||||
| { | |||||
| path: ROUTE_TRIPS, | |||||
| component: TwoColumnComponent, | |||||
| canActivate: [userGuard], | |||||
| children: [ | |||||
| {path: '', component: TripComponent}, | |||||
| ] | |||||
| }, | |||||
| { | |||||
| path: ROUTE_TRIPS, | |||||
| component: TwoColumnComponent, | |||||
| canActivate: [userGuard], | |||||
| children: [ | |||||
| {path: ':id', component: TripDetailComponent}, | |||||
| ] | |||||
| }, | |||||
| { | { | ||||
| path: ROUTE_ZONES, | path: ROUTE_ZONES, | ||||
| component: TwoColumnComponent, | component: TwoColumnComponent, | ||||
| @@ -55,7 +55,8 @@ export class AppComponent implements OnInit { | |||||
| // TODO: Hilfsfunktion - entfernen | // TODO: Hilfsfunktion - entfernen | ||||
| copyTokenToClipboard() { | copyTokenToClipboard() { | ||||
| const el = document.createElement('textarea'); | const el = document.createElement('textarea'); | ||||
| el.value = this.user?.token || ""; | |||||
| const token = localStorage.getItem('token'); | |||||
| el.value = token || ""; | |||||
| document.body.appendChild(el); | document.body.appendChild(el); | ||||
| el.select(); | el.select(); | ||||
| document.execCommand('copy'); | document.execCommand('copy'); | ||||
| @@ -61,6 +61,10 @@ import { LocationFormComponent } from './_views/location/location-form/location- | |||||
| import { ZoneFormComponent } from './_views/zone/zone-form/zone-form.component'; | import { ZoneFormComponent } from './_views/zone/zone-form/zone-form.component'; | ||||
| import { VesselFormComponent } from './_views/vessel/vessel-form/vessel-form.component'; | import { VesselFormComponent } from './_views/vessel/vessel-form/vessel-form.component'; | ||||
| import { ShippingCompanyFormComponent } from './_views/shipping-company/shipping-company-form/shipping-company-form.component'; | import { ShippingCompanyFormComponent } from './_views/shipping-company/shipping-company-form/shipping-company-form.component'; | ||||
| import { TripListComponent } from './_views/trip/trip-list/trip-list.component'; | |||||
| import { TripDetailComponent } from './_views/trip/trip-detail/trip-detail.component'; | |||||
| import { TripFormComponent } from './_views/trip/trip-form/trip-form.component'; | |||||
| import {DatetimePickerComponent} from "@app/_components/datetime-picker/datetime-picker.component"; | |||||
| registerLocaleData(localeDe, 'de-DE'); | registerLocaleData(localeDe, 'de-DE'); | ||||
| @@ -119,6 +123,7 @@ export function HttpLoaderFactory(http: HttpClient) { | |||||
| ProfileComponent, | ProfileComponent, | ||||
| SearchInputComponent, | SearchInputComponent, | ||||
| PagingComponent, | PagingComponent, | ||||
| DatetimePickerComponent, | |||||
| UsersComponent, | UsersComponent, | ||||
| UserDetailComponent, | UserDetailComponent, | ||||
| UserListComponent, | UserListComponent, | ||||
| @@ -147,6 +152,9 @@ export function HttpLoaderFactory(http: HttpClient) { | |||||
| ZoneFormComponent, | ZoneFormComponent, | ||||
| VesselFormComponent, | VesselFormComponent, | ||||
| ShippingCompanyFormComponent, | ShippingCompanyFormComponent, | ||||
| TripListComponent, | |||||
| TripDetailComponent, | |||||
| TripFormComponent, | |||||
| ], | ], | ||||
| providers: [ | providers: [ | ||||
| {provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true}, | {provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true}, | ||||
| @@ -1,9 +1,9 @@ | |||||
| .gitignore | .gitignore | ||||
| .openapi-generator-ignore | |||||
| README.md | README.md | ||||
| api.module.ts | api.module.ts | ||||
| api/api.ts | api/api.ts | ||||
| api/auth.service.ts | api/auth.service.ts | ||||
| api/event.service.ts | |||||
| api/location.service.ts | api/location.service.ts | ||||
| api/mediaObject.service.ts | api/mediaObject.service.ts | ||||
| api/shippingCompany.service.ts | api/shippingCompany.service.ts | ||||
| @@ -11,34 +11,32 @@ api/trip.service.ts | |||||
| api/tripLocation.service.ts | api/tripLocation.service.ts | ||||
| api/user.service.ts | api/user.service.ts | ||||
| api/userTrip.service.ts | api/userTrip.service.ts | ||||
| api/userTripLocation.service.ts | |||||
| api/userTripWorkLog.service.ts | |||||
| api/vessel.service.ts | api/vessel.service.ts | ||||
| api/zone.service.ts | api/zone.service.ts | ||||
| configuration.ts | configuration.ts | ||||
| encoder.ts | encoder.ts | ||||
| git_push.sh | git_push.sh | ||||
| index.ts | index.ts | ||||
| model/apiEventsGetCollection200Response.ts | |||||
| model/apiEventsGetCollection200ResponseSearch.ts | |||||
| model/apiEventsGetCollection200ResponseSearchMappingInner.ts | |||||
| model/apiEventsGetCollection200ResponseView.ts | |||||
| model/apiLocationsGetCollection200Response.ts | model/apiLocationsGetCollection200Response.ts | ||||
| model/apiLocationsGetCollection200ResponseSearch.ts | |||||
| model/apiLocationsGetCollection200ResponseSearchMappingInner.ts | |||||
| model/apiLocationsGetCollection200ResponseView.ts | |||||
| model/apiMediaObjectsGetCollection200Response.ts | model/apiMediaObjectsGetCollection200Response.ts | ||||
| model/apiShippingCompaniesGetCollection200Response.ts | model/apiShippingCompaniesGetCollection200Response.ts | ||||
| model/apiTripLocationsGetCollection200Response.ts | model/apiTripLocationsGetCollection200Response.ts | ||||
| model/apiTripsGetCollection200Response.ts | model/apiTripsGetCollection200Response.ts | ||||
| model/apiUserTripLocationsGetCollection200Response.ts | |||||
| model/apiUserTripWorkLogsGetCollection200Response.ts | |||||
| model/apiUserTripsGetCollection200Response.ts | model/apiUserTripsGetCollection200Response.ts | ||||
| model/apiUsersGetCollection200Response.ts | model/apiUsersGetCollection200Response.ts | ||||
| model/apiVesselsGetCollection200Response.ts | model/apiVesselsGetCollection200Response.ts | ||||
| model/apiZonesGetCollection200Response.ts | model/apiZonesGetCollection200Response.ts | ||||
| model/authResponse.ts | model/authResponse.ts | ||||
| model/credentials.ts | model/credentials.ts | ||||
| model/eventJsonld.ts | |||||
| model/eventJsonldContext.ts | |||||
| model/eventJsonldContextOneOf.ts | |||||
| model/location.ts | model/location.ts | ||||
| model/locationJsonld.ts | model/locationJsonld.ts | ||||
| model/locationJsonldContext.ts | |||||
| model/locationJsonldContextOneOf.ts | |||||
| model/mediaObjectJsonld.ts | model/mediaObjectJsonld.ts | ||||
| model/models.ts | model/models.ts | ||||
| model/shippingCompany.ts | model/shippingCompany.ts | ||||
| @@ -51,10 +49,6 @@ model/user.ts | |||||
| model/userJsonld.ts | model/userJsonld.ts | ||||
| model/userTrip.ts | model/userTrip.ts | ||||
| model/userTripJsonld.ts | model/userTripJsonld.ts | ||||
| model/userTripLocation.ts | |||||
| model/userTripLocationJsonld.ts | |||||
| model/userTripWorkLog.ts | |||||
| model/userTripWorkLogJsonld.ts | |||||
| model/vessel.ts | model/vessel.ts | ||||
| model/vesselJsonld.ts | model/vesselJsonld.ts | ||||
| model/zone.ts | model/zone.ts | ||||
| @@ -1,5 +1,7 @@ | |||||
| export * from './auth.service'; | export * from './auth.service'; | ||||
| import { AuthService } from './auth.service'; | import { AuthService } from './auth.service'; | ||||
| export * from './event.service'; | |||||
| import { EventService } from './event.service'; | |||||
| export * from './location.service'; | export * from './location.service'; | ||||
| import { LocationService } from './location.service'; | import { LocationService } from './location.service'; | ||||
| export * from './mediaObject.service'; | export * from './mediaObject.service'; | ||||
| @@ -14,12 +16,8 @@ export * from './user.service'; | |||||
| import { UserService } from './user.service'; | import { UserService } from './user.service'; | ||||
| export * from './userTrip.service'; | export * from './userTrip.service'; | ||||
| import { UserTripService } from './userTrip.service'; | import { UserTripService } from './userTrip.service'; | ||||
| export * from './userTripLocation.service'; | |||||
| import { UserTripLocationService } from './userTripLocation.service'; | |||||
| export * from './userTripWorkLog.service'; | |||||
| import { UserTripWorkLogService } from './userTripWorkLog.service'; | |||||
| export * from './vessel.service'; | export * from './vessel.service'; | ||||
| import { VesselService } from './vessel.service'; | import { VesselService } from './vessel.service'; | ||||
| export * from './zone.service'; | export * from './zone.service'; | ||||
| import { ZoneService } from './zone.service'; | import { ZoneService } from './zone.service'; | ||||
| export const APIS = [AuthService, LocationService, MediaObjectService, ShippingCompanyService, TripService, TripLocationService, UserService, UserTripService, UserTripLocationService, UserTripWorkLogService, VesselService, ZoneService]; | |||||
| export const APIS = [AuthService, EventService, LocationService, MediaObjectService, ShippingCompanyService, TripService, TripLocationService, UserService, UserTripService, VesselService, ZoneService]; | |||||
| @@ -0,0 +1,264 @@ | |||||
| /** | |||||
| * Imaq Platform | |||||
| * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | |||||
| * | |||||
| * The version of the OpenAPI document: 1.0.0 | |||||
| * | |||||
| * | |||||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | |||||
| * https://openapi-generator.tech | |||||
| * Do not edit the class manually. | |||||
| */ | |||||
| /* tslint:disable:no-unused-variable member-ordering */ | |||||
| import { Inject, Injectable, Optional } from '@angular/core'; | |||||
| import { HttpClient, HttpHeaders, HttpParams, | |||||
| HttpResponse, HttpEvent, HttpParameterCodec, HttpContext | |||||
| } from '@angular/common/http'; | |||||
| import { CustomHttpParameterCodec } from '../encoder'; | |||||
| import { Observable } from 'rxjs'; | |||||
| // @ts-ignore | |||||
| import { ApiEventsGetCollection200Response } from '../model/apiEventsGetCollection200Response'; | |||||
| // @ts-ignore | |||||
| import { EventJsonld } from '../model/eventJsonld'; | |||||
| // @ts-ignore | |||||
| import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; | |||||
| import { Configuration } from '../configuration'; | |||||
| @Injectable({ | |||||
| providedIn: 'root' | |||||
| }) | |||||
| export class EventService { | |||||
| protected basePath = 'http://localhost'; | |||||
| public defaultHeaders = new HttpHeaders(); | |||||
| public configuration = new Configuration(); | |||||
| public encoder: HttpParameterCodec; | |||||
| constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { | |||||
| if (configuration) { | |||||
| this.configuration = configuration; | |||||
| } | |||||
| if (typeof this.configuration.basePath !== 'string') { | |||||
| if (Array.isArray(basePath) && basePath.length > 0) { | |||||
| basePath = basePath[0]; | |||||
| } | |||||
| if (typeof basePath !== 'string') { | |||||
| basePath = this.basePath; | |||||
| } | |||||
| this.configuration.basePath = basePath; | |||||
| } | |||||
| this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); | |||||
| } | |||||
| // @ts-ignore | |||||
| private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { | |||||
| if (typeof value === "object" && value instanceof Date === false) { | |||||
| httpParams = this.addToHttpParamsRecursive(httpParams, value); | |||||
| } else { | |||||
| httpParams = this.addToHttpParamsRecursive(httpParams, value, key); | |||||
| } | |||||
| return httpParams; | |||||
| } | |||||
| private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { | |||||
| if (value == null) { | |||||
| return httpParams; | |||||
| } | |||||
| if (typeof value === "object") { | |||||
| if (Array.isArray(value)) { | |||||
| (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); | |||||
| } else if (value instanceof Date) { | |||||
| if (key != null) { | |||||
| httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); | |||||
| } else { | |||||
| throw Error("key may not be null if value is Date"); | |||||
| } | |||||
| } else { | |||||
| Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( | |||||
| httpParams, value[k], key != null ? `${key}.${k}` : k)); | |||||
| } | |||||
| } else if (key != null) { | |||||
| httpParams = httpParams.append(key, value); | |||||
| } else { | |||||
| throw Error("key may not be null if value is not object or array"); | |||||
| } | |||||
| return httpParams; | |||||
| } | |||||
| /** | |||||
| * Retrieves the collection of Event resources. | |||||
| * Retrieves the collection of Event resources. | |||||
| * @param page The collection page number | |||||
| * @param itemsPerPage The number of items per page | |||||
| * @param name | |||||
| * @param customJsonFilter | |||||
| * @param customJsonOrder | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | |||||
| * @param reportProgress flag to report request and response progress. | |||||
| */ | |||||
| public eventsGetCollection(page?: number, itemsPerPage?: number, name?: string, customJsonFilter?: string, customJsonOrder?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiEventsGetCollection200Response>; | |||||
| public eventsGetCollection(page?: number, itemsPerPage?: number, name?: string, customJsonFilter?: string, customJsonOrder?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiEventsGetCollection200Response>>; | |||||
| public eventsGetCollection(page?: number, itemsPerPage?: number, name?: string, customJsonFilter?: string, customJsonOrder?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiEventsGetCollection200Response>>; | |||||
| public eventsGetCollection(page?: number, itemsPerPage?: number, name?: string, customJsonFilter?: string, customJsonOrder?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | |||||
| if (page !== undefined && page !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>page, 'page'); | |||||
| } | |||||
| if (itemsPerPage !== undefined && itemsPerPage !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>itemsPerPage, 'itemsPerPage'); | |||||
| } | |||||
| if (name !== undefined && name !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>name, 'name'); | |||||
| } | |||||
| if (customJsonFilter !== undefined && customJsonFilter !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>customJsonFilter, 'custom_json_filter'); | |||||
| } | |||||
| if (customJsonOrder !== undefined && customJsonOrder !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>customJsonOrder, 'custom_json_order'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | |||||
| let localVarCredential: string | undefined; | |||||
| // authentication (JWT) required | |||||
| localVarCredential = this.configuration.lookupCredential('JWT'); | |||||
| if (localVarCredential) { | |||||
| localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); | |||||
| } | |||||
| let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; | |||||
| if (localVarHttpHeaderAcceptSelected === undefined) { | |||||
| // to determine the Accept header | |||||
| const httpHeaderAccepts: string[] = [ | |||||
| 'application/ld+json' | |||||
| ]; | |||||
| localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); | |||||
| } | |||||
| if (localVarHttpHeaderAcceptSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); | |||||
| } | |||||
| let localVarHttpContext: HttpContext | undefined = options && options.context; | |||||
| if (localVarHttpContext === undefined) { | |||||
| localVarHttpContext = new HttpContext(); | |||||
| } | |||||
| let localVarTransferCache: boolean | undefined = options && options.transferCache; | |||||
| if (localVarTransferCache === undefined) { | |||||
| localVarTransferCache = true; | |||||
| } | |||||
| let responseType_: 'text' | 'json' | 'blob' = 'json'; | |||||
| if (localVarHttpHeaderAcceptSelected) { | |||||
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { | |||||
| responseType_ = 'text'; | |||||
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { | |||||
| responseType_ = 'json'; | |||||
| } else { | |||||
| responseType_ = 'blob'; | |||||
| } | |||||
| } | |||||
| let localVarPath = `/api/events`; | |||||
| return this.httpClient.request<ApiEventsGetCollection200Response>('get', `${this.configuration.basePath}${localVarPath}`, | |||||
| { | |||||
| context: localVarHttpContext, | |||||
| params: localVarQueryParameters, | |||||
| responseType: <any>responseType_, | |||||
| withCredentials: this.configuration.withCredentials, | |||||
| headers: localVarHeaders, | |||||
| observe: observe, | |||||
| transferCache: localVarTransferCache, | |||||
| reportProgress: reportProgress | |||||
| } | |||||
| ); | |||||
| } | |||||
| /** | |||||
| * Retrieves a Event resource. | |||||
| * Retrieves a Event resource. | |||||
| * @param id Event identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | |||||
| * @param reportProgress flag to report request and response progress. | |||||
| */ | |||||
| public eventsIdGet(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<EventJsonld>; | |||||
| public eventsIdGet(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<EventJsonld>>; | |||||
| public eventsIdGet(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<EventJsonld>>; | |||||
| public eventsIdGet(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| if (id === null || id === undefined) { | |||||
| throw new Error('Required parameter id was null or undefined when calling eventsIdGet.'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | |||||
| let localVarCredential: string | undefined; | |||||
| // authentication (JWT) required | |||||
| localVarCredential = this.configuration.lookupCredential('JWT'); | |||||
| if (localVarCredential) { | |||||
| localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); | |||||
| } | |||||
| let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; | |||||
| if (localVarHttpHeaderAcceptSelected === undefined) { | |||||
| // to determine the Accept header | |||||
| const httpHeaderAccepts: string[] = [ | |||||
| 'application/ld+json' | |||||
| ]; | |||||
| localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); | |||||
| } | |||||
| if (localVarHttpHeaderAcceptSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); | |||||
| } | |||||
| let localVarHttpContext: HttpContext | undefined = options && options.context; | |||||
| if (localVarHttpContext === undefined) { | |||||
| localVarHttpContext = new HttpContext(); | |||||
| } | |||||
| let localVarTransferCache: boolean | undefined = options && options.transferCache; | |||||
| if (localVarTransferCache === undefined) { | |||||
| localVarTransferCache = true; | |||||
| } | |||||
| let responseType_: 'text' | 'json' | 'blob' = 'json'; | |||||
| if (localVarHttpHeaderAcceptSelected) { | |||||
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { | |||||
| responseType_ = 'text'; | |||||
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { | |||||
| responseType_ = 'json'; | |||||
| } else { | |||||
| responseType_ = 'blob'; | |||||
| } | |||||
| } | |||||
| let localVarPath = `/api/events/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; | |||||
| return this.httpClient.request<EventJsonld>('get', `${this.configuration.basePath}${localVarPath}`, | |||||
| { | |||||
| context: localVarHttpContext, | |||||
| responseType: <any>responseType_, | |||||
| withCredentials: this.configuration.withCredentials, | |||||
| headers: localVarHeaders, | |||||
| observe: observe, | |||||
| transferCache: localVarTransferCache, | |||||
| reportProgress: reportProgress | |||||
| } | |||||
| ); | |||||
| } | |||||
| } | |||||
| @@ -100,13 +100,16 @@ export class TripService { | |||||
| * Retrieves the collection of Trip resources. | * Retrieves the collection of Trip resources. | ||||
| * @param page The collection page number | * @param page The collection page number | ||||
| * @param itemsPerPage The number of items per page | * @param itemsPerPage The number of items per page | ||||
| * @param id | |||||
| * @param customJsonFilter | |||||
| * @param customJsonOrder | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| public tripsGetCollection(page?: number, itemsPerPage?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiTripsGetCollection200Response>; | |||||
| public tripsGetCollection(page?: number, itemsPerPage?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiTripsGetCollection200Response>>; | |||||
| public tripsGetCollection(page?: number, itemsPerPage?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiTripsGetCollection200Response>>; | |||||
| public tripsGetCollection(page?: number, itemsPerPage?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| public tripsGetCollection(page?: number, itemsPerPage?: number, id?: number, customJsonFilter?: string, customJsonOrder?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiTripsGetCollection200Response>; | |||||
| public tripsGetCollection(page?: number, itemsPerPage?: number, id?: number, customJsonFilter?: string, customJsonOrder?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiTripsGetCollection200Response>>; | |||||
| public tripsGetCollection(page?: number, itemsPerPage?: number, id?: number, customJsonFilter?: string, customJsonOrder?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiTripsGetCollection200Response>>; | |||||
| public tripsGetCollection(page?: number, itemsPerPage?: number, id?: number, customJsonFilter?: string, customJsonOrder?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | ||||
| if (page !== undefined && page !== null) { | if (page !== undefined && page !== null) { | ||||
| @@ -117,6 +120,18 @@ export class TripService { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | ||||
| <any>itemsPerPage, 'itemsPerPage'); | <any>itemsPerPage, 'itemsPerPage'); | ||||
| } | } | ||||
| if (id !== undefined && id !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>id, 'id'); | |||||
| } | |||||
| if (customJsonFilter !== undefined && customJsonFilter !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>customJsonFilter, 'custom_json_filter'); | |||||
| } | |||||
| if (customJsonOrder !== undefined && customJsonOrder !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>customJsonOrder, 'custom_json_order'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | let localVarHeaders = this.defaultHeaders; | ||||
| @@ -176,6 +191,77 @@ export class TripService { | |||||
| ); | ); | ||||
| } | } | ||||
| /** | |||||
| * Removes the Trip resource. | |||||
| * Removes the Trip resource. | |||||
| * @param id Trip identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | |||||
| * @param reportProgress flag to report request and response progress. | |||||
| */ | |||||
| public tripsIdDelete(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>; | |||||
| public tripsIdDelete(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>; | |||||
| public tripsIdDelete(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>; | |||||
| public tripsIdDelete(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| if (id === null || id === undefined) { | |||||
| throw new Error('Required parameter id was null or undefined when calling tripsIdDelete.'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | |||||
| let localVarCredential: string | undefined; | |||||
| // authentication (JWT) required | |||||
| localVarCredential = this.configuration.lookupCredential('JWT'); | |||||
| if (localVarCredential) { | |||||
| localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); | |||||
| } | |||||
| let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; | |||||
| if (localVarHttpHeaderAcceptSelected === undefined) { | |||||
| // to determine the Accept header | |||||
| const httpHeaderAccepts: string[] = [ | |||||
| ]; | |||||
| localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); | |||||
| } | |||||
| if (localVarHttpHeaderAcceptSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); | |||||
| } | |||||
| let localVarHttpContext: HttpContext | undefined = options && options.context; | |||||
| if (localVarHttpContext === undefined) { | |||||
| localVarHttpContext = new HttpContext(); | |||||
| } | |||||
| let localVarTransferCache: boolean | undefined = options && options.transferCache; | |||||
| if (localVarTransferCache === undefined) { | |||||
| localVarTransferCache = true; | |||||
| } | |||||
| let responseType_: 'text' | 'json' | 'blob' = 'json'; | |||||
| if (localVarHttpHeaderAcceptSelected) { | |||||
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { | |||||
| responseType_ = 'text'; | |||||
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { | |||||
| responseType_ = 'json'; | |||||
| } else { | |||||
| responseType_ = 'blob'; | |||||
| } | |||||
| } | |||||
| let localVarPath = `/api/trips/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; | |||||
| return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`, | |||||
| { | |||||
| context: localVarHttpContext, | |||||
| responseType: <any>responseType_, | |||||
| withCredentials: this.configuration.withCredentials, | |||||
| headers: localVarHeaders, | |||||
| observe: observe, | |||||
| transferCache: localVarTransferCache, | |||||
| reportProgress: reportProgress | |||||
| } | |||||
| ); | |||||
| } | |||||
| /** | /** | ||||
| * Retrieves a Trip resource. | * Retrieves a Trip resource. | ||||
| * Retrieves a Trip resource. | * Retrieves a Trip resource. | ||||
| @@ -100,13 +100,17 @@ export class TripLocationService { | |||||
| * Retrieves the collection of TripLocation resources. | * Retrieves the collection of TripLocation resources. | ||||
| * @param page The collection page number | * @param page The collection page number | ||||
| * @param itemsPerPage The number of items per page | * @param itemsPerPage The number of items per page | ||||
| * @param trip | |||||
| * @param trip2 | |||||
| * @param customJsonFilter | |||||
| * @param customJsonOrder | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | ||||
| * @param reportProgress flag to report request and response progress. | * @param reportProgress flag to report request and response progress. | ||||
| */ | */ | ||||
| public tripLocationsGetCollection(page?: number, itemsPerPage?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiTripLocationsGetCollection200Response>; | |||||
| public tripLocationsGetCollection(page?: number, itemsPerPage?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiTripLocationsGetCollection200Response>>; | |||||
| public tripLocationsGetCollection(page?: number, itemsPerPage?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiTripLocationsGetCollection200Response>>; | |||||
| public tripLocationsGetCollection(page?: number, itemsPerPage?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| public tripLocationsGetCollection(page?: number, itemsPerPage?: number, trip?: string, trip2?: Array<string>, customJsonFilter?: string, customJsonOrder?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiTripLocationsGetCollection200Response>; | |||||
| public tripLocationsGetCollection(page?: number, itemsPerPage?: number, trip?: string, trip2?: Array<string>, customJsonFilter?: string, customJsonOrder?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiTripLocationsGetCollection200Response>>; | |||||
| public tripLocationsGetCollection(page?: number, itemsPerPage?: number, trip?: string, trip2?: Array<string>, customJsonFilter?: string, customJsonOrder?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiTripLocationsGetCollection200Response>>; | |||||
| public tripLocationsGetCollection(page?: number, itemsPerPage?: number, trip?: string, trip2?: Array<string>, customJsonFilter?: string, customJsonOrder?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | ||||
| if (page !== undefined && page !== null) { | if (page !== undefined && page !== null) { | ||||
| @@ -117,6 +121,24 @@ export class TripLocationService { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | ||||
| <any>itemsPerPage, 'itemsPerPage'); | <any>itemsPerPage, 'itemsPerPage'); | ||||
| } | } | ||||
| if (trip !== undefined && trip !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>trip, 'trip'); | |||||
| } | |||||
| if (trip2) { | |||||
| trip2.forEach((element) => { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>element, 'trip[]'); | |||||
| }) | |||||
| } | |||||
| if (customJsonFilter !== undefined && customJsonFilter !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>customJsonFilter, 'custom_json_filter'); | |||||
| } | |||||
| if (customJsonOrder !== undefined && customJsonOrder !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>customJsonOrder, 'custom_json_order'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | let localVarHeaders = this.defaultHeaders; | ||||
| @@ -176,6 +198,77 @@ export class TripLocationService { | |||||
| ); | ); | ||||
| } | } | ||||
| /** | |||||
| * Removes the TripLocation resource. | |||||
| * Removes the TripLocation resource. | |||||
| * @param id TripLocation identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | |||||
| * @param reportProgress flag to report request and response progress. | |||||
| */ | |||||
| public tripLocationsIdDelete(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>; | |||||
| public tripLocationsIdDelete(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>; | |||||
| public tripLocationsIdDelete(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>; | |||||
| public tripLocationsIdDelete(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| if (id === null || id === undefined) { | |||||
| throw new Error('Required parameter id was null or undefined when calling tripLocationsIdDelete.'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | |||||
| let localVarCredential: string | undefined; | |||||
| // authentication (JWT) required | |||||
| localVarCredential = this.configuration.lookupCredential('JWT'); | |||||
| if (localVarCredential) { | |||||
| localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); | |||||
| } | |||||
| let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; | |||||
| if (localVarHttpHeaderAcceptSelected === undefined) { | |||||
| // to determine the Accept header | |||||
| const httpHeaderAccepts: string[] = [ | |||||
| ]; | |||||
| localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); | |||||
| } | |||||
| if (localVarHttpHeaderAcceptSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); | |||||
| } | |||||
| let localVarHttpContext: HttpContext | undefined = options && options.context; | |||||
| if (localVarHttpContext === undefined) { | |||||
| localVarHttpContext = new HttpContext(); | |||||
| } | |||||
| let localVarTransferCache: boolean | undefined = options && options.transferCache; | |||||
| if (localVarTransferCache === undefined) { | |||||
| localVarTransferCache = true; | |||||
| } | |||||
| let responseType_: 'text' | 'json' | 'blob' = 'json'; | |||||
| if (localVarHttpHeaderAcceptSelected) { | |||||
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { | |||||
| responseType_ = 'text'; | |||||
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { | |||||
| responseType_ = 'json'; | |||||
| } else { | |||||
| responseType_ = 'blob'; | |||||
| } | |||||
| } | |||||
| let localVarPath = `/api/trip_locations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; | |||||
| return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`, | |||||
| { | |||||
| context: localVarHttpContext, | |||||
| responseType: <any>responseType_, | |||||
| withCredentials: this.configuration.withCredentials, | |||||
| headers: localVarHeaders, | |||||
| observe: observe, | |||||
| transferCache: localVarTransferCache, | |||||
| reportProgress: reportProgress | |||||
| } | |||||
| ); | |||||
| } | |||||
| /** | /** | ||||
| * Retrieves a TripLocation resource. | * Retrieves a TripLocation resource. | ||||
| * Retrieves a TripLocation resource. | * Retrieves a TripLocation resource. | ||||
| @@ -1,419 +0,0 @@ | |||||
| /** | |||||
| * Imaq Platform | |||||
| * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | |||||
| * | |||||
| * The version of the OpenAPI document: 1.0.0 | |||||
| * | |||||
| * | |||||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | |||||
| * https://openapi-generator.tech | |||||
| * Do not edit the class manually. | |||||
| */ | |||||
| /* tslint:disable:no-unused-variable member-ordering */ | |||||
| import { Inject, Injectable, Optional } from '@angular/core'; | |||||
| import { HttpClient, HttpHeaders, HttpParams, | |||||
| HttpResponse, HttpEvent, HttpParameterCodec, HttpContext | |||||
| } from '@angular/common/http'; | |||||
| import { CustomHttpParameterCodec } from '../encoder'; | |||||
| import { Observable } from 'rxjs'; | |||||
| // @ts-ignore | |||||
| import { ApiUserTripLocationsGetCollection200Response } from '../model/apiUserTripLocationsGetCollection200Response'; | |||||
| // @ts-ignore | |||||
| import { UserTripLocation } from '../model/userTripLocation'; | |||||
| // @ts-ignore | |||||
| import { UserTripLocationJsonld } from '../model/userTripLocationJsonld'; | |||||
| // @ts-ignore | |||||
| import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; | |||||
| import { Configuration } from '../configuration'; | |||||
| @Injectable({ | |||||
| providedIn: 'root' | |||||
| }) | |||||
| export class UserTripLocationService { | |||||
| protected basePath = 'http://localhost'; | |||||
| public defaultHeaders = new HttpHeaders(); | |||||
| public configuration = new Configuration(); | |||||
| public encoder: HttpParameterCodec; | |||||
| constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { | |||||
| if (configuration) { | |||||
| this.configuration = configuration; | |||||
| } | |||||
| if (typeof this.configuration.basePath !== 'string') { | |||||
| if (Array.isArray(basePath) && basePath.length > 0) { | |||||
| basePath = basePath[0]; | |||||
| } | |||||
| if (typeof basePath !== 'string') { | |||||
| basePath = this.basePath; | |||||
| } | |||||
| this.configuration.basePath = basePath; | |||||
| } | |||||
| this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); | |||||
| } | |||||
| // @ts-ignore | |||||
| private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { | |||||
| if (typeof value === "object" && value instanceof Date === false) { | |||||
| httpParams = this.addToHttpParamsRecursive(httpParams, value); | |||||
| } else { | |||||
| httpParams = this.addToHttpParamsRecursive(httpParams, value, key); | |||||
| } | |||||
| return httpParams; | |||||
| } | |||||
| private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { | |||||
| if (value == null) { | |||||
| return httpParams; | |||||
| } | |||||
| if (typeof value === "object") { | |||||
| if (Array.isArray(value)) { | |||||
| (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); | |||||
| } else if (value instanceof Date) { | |||||
| if (key != null) { | |||||
| httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); | |||||
| } else { | |||||
| throw Error("key may not be null if value is Date"); | |||||
| } | |||||
| } else { | |||||
| Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( | |||||
| httpParams, value[k], key != null ? `${key}.${k}` : k)); | |||||
| } | |||||
| } else if (key != null) { | |||||
| httpParams = httpParams.append(key, value); | |||||
| } else { | |||||
| throw Error("key may not be null if value is not object or array"); | |||||
| } | |||||
| return httpParams; | |||||
| } | |||||
| /** | |||||
| * Retrieves the collection of UserTripLocation resources. | |||||
| * Retrieves the collection of UserTripLocation resources. | |||||
| * @param page The collection page number | |||||
| * @param itemsPerPage The number of items per page | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | |||||
| * @param reportProgress flag to report request and response progress. | |||||
| */ | |||||
| public userTripLocationsGetCollection(page?: number, itemsPerPage?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiUserTripLocationsGetCollection200Response>; | |||||
| public userTripLocationsGetCollection(page?: number, itemsPerPage?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiUserTripLocationsGetCollection200Response>>; | |||||
| public userTripLocationsGetCollection(page?: number, itemsPerPage?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiUserTripLocationsGetCollection200Response>>; | |||||
| public userTripLocationsGetCollection(page?: number, itemsPerPage?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | |||||
| if (page !== undefined && page !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>page, 'page'); | |||||
| } | |||||
| if (itemsPerPage !== undefined && itemsPerPage !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>itemsPerPage, 'itemsPerPage'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | |||||
| let localVarCredential: string | undefined; | |||||
| // authentication (JWT) required | |||||
| localVarCredential = this.configuration.lookupCredential('JWT'); | |||||
| if (localVarCredential) { | |||||
| localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); | |||||
| } | |||||
| let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; | |||||
| if (localVarHttpHeaderAcceptSelected === undefined) { | |||||
| // to determine the Accept header | |||||
| const httpHeaderAccepts: string[] = [ | |||||
| 'application/ld+json' | |||||
| ]; | |||||
| localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); | |||||
| } | |||||
| if (localVarHttpHeaderAcceptSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); | |||||
| } | |||||
| let localVarHttpContext: HttpContext | undefined = options && options.context; | |||||
| if (localVarHttpContext === undefined) { | |||||
| localVarHttpContext = new HttpContext(); | |||||
| } | |||||
| let localVarTransferCache: boolean | undefined = options && options.transferCache; | |||||
| if (localVarTransferCache === undefined) { | |||||
| localVarTransferCache = true; | |||||
| } | |||||
| let responseType_: 'text' | 'json' | 'blob' = 'json'; | |||||
| if (localVarHttpHeaderAcceptSelected) { | |||||
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { | |||||
| responseType_ = 'text'; | |||||
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { | |||||
| responseType_ = 'json'; | |||||
| } else { | |||||
| responseType_ = 'blob'; | |||||
| } | |||||
| } | |||||
| let localVarPath = `/api/user_trip_locations`; | |||||
| return this.httpClient.request<ApiUserTripLocationsGetCollection200Response>('get', `${this.configuration.basePath}${localVarPath}`, | |||||
| { | |||||
| context: localVarHttpContext, | |||||
| params: localVarQueryParameters, | |||||
| responseType: <any>responseType_, | |||||
| withCredentials: this.configuration.withCredentials, | |||||
| headers: localVarHeaders, | |||||
| observe: observe, | |||||
| transferCache: localVarTransferCache, | |||||
| reportProgress: reportProgress | |||||
| } | |||||
| ); | |||||
| } | |||||
| /** | |||||
| * Retrieves a UserTripLocation resource. | |||||
| * Retrieves a UserTripLocation resource. | |||||
| * @param id UserTripLocation identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | |||||
| * @param reportProgress flag to report request and response progress. | |||||
| */ | |||||
| public userTripLocationsIdGet(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<UserTripLocationJsonld>; | |||||
| public userTripLocationsIdGet(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<UserTripLocationJsonld>>; | |||||
| public userTripLocationsIdGet(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<UserTripLocationJsonld>>; | |||||
| public userTripLocationsIdGet(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| if (id === null || id === undefined) { | |||||
| throw new Error('Required parameter id was null or undefined when calling userTripLocationsIdGet.'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | |||||
| let localVarCredential: string | undefined; | |||||
| // authentication (JWT) required | |||||
| localVarCredential = this.configuration.lookupCredential('JWT'); | |||||
| if (localVarCredential) { | |||||
| localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); | |||||
| } | |||||
| let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; | |||||
| if (localVarHttpHeaderAcceptSelected === undefined) { | |||||
| // to determine the Accept header | |||||
| const httpHeaderAccepts: string[] = [ | |||||
| 'application/ld+json' | |||||
| ]; | |||||
| localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); | |||||
| } | |||||
| if (localVarHttpHeaderAcceptSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); | |||||
| } | |||||
| let localVarHttpContext: HttpContext | undefined = options && options.context; | |||||
| if (localVarHttpContext === undefined) { | |||||
| localVarHttpContext = new HttpContext(); | |||||
| } | |||||
| let localVarTransferCache: boolean | undefined = options && options.transferCache; | |||||
| if (localVarTransferCache === undefined) { | |||||
| localVarTransferCache = true; | |||||
| } | |||||
| let responseType_: 'text' | 'json' | 'blob' = 'json'; | |||||
| if (localVarHttpHeaderAcceptSelected) { | |||||
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { | |||||
| responseType_ = 'text'; | |||||
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { | |||||
| responseType_ = 'json'; | |||||
| } else { | |||||
| responseType_ = 'blob'; | |||||
| } | |||||
| } | |||||
| let localVarPath = `/api/user_trip_locations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; | |||||
| return this.httpClient.request<UserTripLocationJsonld>('get', `${this.configuration.basePath}${localVarPath}`, | |||||
| { | |||||
| context: localVarHttpContext, | |||||
| responseType: <any>responseType_, | |||||
| withCredentials: this.configuration.withCredentials, | |||||
| headers: localVarHeaders, | |||||
| observe: observe, | |||||
| transferCache: localVarTransferCache, | |||||
| reportProgress: reportProgress | |||||
| } | |||||
| ); | |||||
| } | |||||
| /** | |||||
| * Updates the UserTripLocation resource. | |||||
| * Updates the UserTripLocation resource. | |||||
| * @param id UserTripLocation identifier | |||||
| * @param userTripLocation The updated UserTripLocation resource | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | |||||
| * @param reportProgress flag to report request and response progress. | |||||
| */ | |||||
| public userTripLocationsIdPatch(id: string, userTripLocation: UserTripLocation, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<UserTripLocationJsonld>; | |||||
| public userTripLocationsIdPatch(id: string, userTripLocation: UserTripLocation, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<UserTripLocationJsonld>>; | |||||
| public userTripLocationsIdPatch(id: string, userTripLocation: UserTripLocation, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<UserTripLocationJsonld>>; | |||||
| public userTripLocationsIdPatch(id: string, userTripLocation: UserTripLocation, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| if (id === null || id === undefined) { | |||||
| throw new Error('Required parameter id was null or undefined when calling userTripLocationsIdPatch.'); | |||||
| } | |||||
| if (userTripLocation === null || userTripLocation === undefined) { | |||||
| throw new Error('Required parameter userTripLocation was null or undefined when calling userTripLocationsIdPatch.'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | |||||
| let localVarCredential: string | undefined; | |||||
| // authentication (JWT) required | |||||
| localVarCredential = this.configuration.lookupCredential('JWT'); | |||||
| if (localVarCredential) { | |||||
| localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); | |||||
| } | |||||
| let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; | |||||
| if (localVarHttpHeaderAcceptSelected === undefined) { | |||||
| // to determine the Accept header | |||||
| const httpHeaderAccepts: string[] = [ | |||||
| 'application/ld+json' | |||||
| ]; | |||||
| localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); | |||||
| } | |||||
| if (localVarHttpHeaderAcceptSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); | |||||
| } | |||||
| let localVarHttpContext: HttpContext | undefined = options && options.context; | |||||
| if (localVarHttpContext === undefined) { | |||||
| localVarHttpContext = new HttpContext(); | |||||
| } | |||||
| let localVarTransferCache: boolean | undefined = options && options.transferCache; | |||||
| if (localVarTransferCache === undefined) { | |||||
| localVarTransferCache = true; | |||||
| } | |||||
| // to determine the Content-Type header | |||||
| const consumes: string[] = [ | |||||
| 'application/merge-patch+json' | |||||
| ]; | |||||
| const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); | |||||
| if (httpContentTypeSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); | |||||
| } | |||||
| let responseType_: 'text' | 'json' | 'blob' = 'json'; | |||||
| if (localVarHttpHeaderAcceptSelected) { | |||||
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { | |||||
| responseType_ = 'text'; | |||||
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { | |||||
| responseType_ = 'json'; | |||||
| } else { | |||||
| responseType_ = 'blob'; | |||||
| } | |||||
| } | |||||
| let localVarPath = `/api/user_trip_locations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; | |||||
| return this.httpClient.request<UserTripLocationJsonld>('patch', `${this.configuration.basePath}${localVarPath}`, | |||||
| { | |||||
| context: localVarHttpContext, | |||||
| body: userTripLocation, | |||||
| responseType: <any>responseType_, | |||||
| withCredentials: this.configuration.withCredentials, | |||||
| headers: localVarHeaders, | |||||
| observe: observe, | |||||
| transferCache: localVarTransferCache, | |||||
| reportProgress: reportProgress | |||||
| } | |||||
| ); | |||||
| } | |||||
| /** | |||||
| * Creates a UserTripLocation resource. | |||||
| * Creates a UserTripLocation resource. | |||||
| * @param userTripLocationJsonld The new UserTripLocation resource | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | |||||
| * @param reportProgress flag to report request and response progress. | |||||
| */ | |||||
| public userTripLocationsPost(userTripLocationJsonld: UserTripLocationJsonld, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<UserTripLocationJsonld>; | |||||
| public userTripLocationsPost(userTripLocationJsonld: UserTripLocationJsonld, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<UserTripLocationJsonld>>; | |||||
| public userTripLocationsPost(userTripLocationJsonld: UserTripLocationJsonld, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<UserTripLocationJsonld>>; | |||||
| public userTripLocationsPost(userTripLocationJsonld: UserTripLocationJsonld, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| if (userTripLocationJsonld === null || userTripLocationJsonld === undefined) { | |||||
| throw new Error('Required parameter userTripLocationJsonld was null or undefined when calling userTripLocationsPost.'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | |||||
| let localVarCredential: string | undefined; | |||||
| // authentication (JWT) required | |||||
| localVarCredential = this.configuration.lookupCredential('JWT'); | |||||
| if (localVarCredential) { | |||||
| localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); | |||||
| } | |||||
| let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; | |||||
| if (localVarHttpHeaderAcceptSelected === undefined) { | |||||
| // to determine the Accept header | |||||
| const httpHeaderAccepts: string[] = [ | |||||
| 'application/ld+json' | |||||
| ]; | |||||
| localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); | |||||
| } | |||||
| if (localVarHttpHeaderAcceptSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); | |||||
| } | |||||
| let localVarHttpContext: HttpContext | undefined = options && options.context; | |||||
| if (localVarHttpContext === undefined) { | |||||
| localVarHttpContext = new HttpContext(); | |||||
| } | |||||
| let localVarTransferCache: boolean | undefined = options && options.transferCache; | |||||
| if (localVarTransferCache === undefined) { | |||||
| localVarTransferCache = true; | |||||
| } | |||||
| // to determine the Content-Type header | |||||
| const consumes: string[] = [ | |||||
| 'application/ld+json' | |||||
| ]; | |||||
| const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); | |||||
| if (httpContentTypeSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); | |||||
| } | |||||
| let responseType_: 'text' | 'json' | 'blob' = 'json'; | |||||
| if (localVarHttpHeaderAcceptSelected) { | |||||
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { | |||||
| responseType_ = 'text'; | |||||
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { | |||||
| responseType_ = 'json'; | |||||
| } else { | |||||
| responseType_ = 'blob'; | |||||
| } | |||||
| } | |||||
| let localVarPath = `/api/user_trip_locations`; | |||||
| return this.httpClient.request<UserTripLocationJsonld>('post', `${this.configuration.basePath}${localVarPath}`, | |||||
| { | |||||
| context: localVarHttpContext, | |||||
| body: userTripLocationJsonld, | |||||
| responseType: <any>responseType_, | |||||
| withCredentials: this.configuration.withCredentials, | |||||
| headers: localVarHeaders, | |||||
| observe: observe, | |||||
| transferCache: localVarTransferCache, | |||||
| reportProgress: reportProgress | |||||
| } | |||||
| ); | |||||
| } | |||||
| } | |||||
| @@ -1,419 +0,0 @@ | |||||
| /** | |||||
| * Imaq Platform | |||||
| * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | |||||
| * | |||||
| * The version of the OpenAPI document: 1.0.0 | |||||
| * | |||||
| * | |||||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | |||||
| * https://openapi-generator.tech | |||||
| * Do not edit the class manually. | |||||
| */ | |||||
| /* tslint:disable:no-unused-variable member-ordering */ | |||||
| import { Inject, Injectable, Optional } from '@angular/core'; | |||||
| import { HttpClient, HttpHeaders, HttpParams, | |||||
| HttpResponse, HttpEvent, HttpParameterCodec, HttpContext | |||||
| } from '@angular/common/http'; | |||||
| import { CustomHttpParameterCodec } from '../encoder'; | |||||
| import { Observable } from 'rxjs'; | |||||
| // @ts-ignore | |||||
| import { ApiUserTripWorkLogsGetCollection200Response } from '../model/apiUserTripWorkLogsGetCollection200Response'; | |||||
| // @ts-ignore | |||||
| import { UserTripWorkLog } from '../model/userTripWorkLog'; | |||||
| // @ts-ignore | |||||
| import { UserTripWorkLogJsonld } from '../model/userTripWorkLogJsonld'; | |||||
| // @ts-ignore | |||||
| import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; | |||||
| import { Configuration } from '../configuration'; | |||||
| @Injectable({ | |||||
| providedIn: 'root' | |||||
| }) | |||||
| export class UserTripWorkLogService { | |||||
| protected basePath = 'http://localhost'; | |||||
| public defaultHeaders = new HttpHeaders(); | |||||
| public configuration = new Configuration(); | |||||
| public encoder: HttpParameterCodec; | |||||
| constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { | |||||
| if (configuration) { | |||||
| this.configuration = configuration; | |||||
| } | |||||
| if (typeof this.configuration.basePath !== 'string') { | |||||
| if (Array.isArray(basePath) && basePath.length > 0) { | |||||
| basePath = basePath[0]; | |||||
| } | |||||
| if (typeof basePath !== 'string') { | |||||
| basePath = this.basePath; | |||||
| } | |||||
| this.configuration.basePath = basePath; | |||||
| } | |||||
| this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); | |||||
| } | |||||
| // @ts-ignore | |||||
| private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { | |||||
| if (typeof value === "object" && value instanceof Date === false) { | |||||
| httpParams = this.addToHttpParamsRecursive(httpParams, value); | |||||
| } else { | |||||
| httpParams = this.addToHttpParamsRecursive(httpParams, value, key); | |||||
| } | |||||
| return httpParams; | |||||
| } | |||||
| private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { | |||||
| if (value == null) { | |||||
| return httpParams; | |||||
| } | |||||
| if (typeof value === "object") { | |||||
| if (Array.isArray(value)) { | |||||
| (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); | |||||
| } else if (value instanceof Date) { | |||||
| if (key != null) { | |||||
| httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); | |||||
| } else { | |||||
| throw Error("key may not be null if value is Date"); | |||||
| } | |||||
| } else { | |||||
| Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( | |||||
| httpParams, value[k], key != null ? `${key}.${k}` : k)); | |||||
| } | |||||
| } else if (key != null) { | |||||
| httpParams = httpParams.append(key, value); | |||||
| } else { | |||||
| throw Error("key may not be null if value is not object or array"); | |||||
| } | |||||
| return httpParams; | |||||
| } | |||||
| /** | |||||
| * Retrieves the collection of UserTripWorkLog resources. | |||||
| * Retrieves the collection of UserTripWorkLog resources. | |||||
| * @param page The collection page number | |||||
| * @param itemsPerPage The number of items per page | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | |||||
| * @param reportProgress flag to report request and response progress. | |||||
| */ | |||||
| public userTripWorkLogsGetCollection(page?: number, itemsPerPage?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiUserTripWorkLogsGetCollection200Response>; | |||||
| public userTripWorkLogsGetCollection(page?: number, itemsPerPage?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiUserTripWorkLogsGetCollection200Response>>; | |||||
| public userTripWorkLogsGetCollection(page?: number, itemsPerPage?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiUserTripWorkLogsGetCollection200Response>>; | |||||
| public userTripWorkLogsGetCollection(page?: number, itemsPerPage?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| let localVarQueryParameters = new HttpParams({encoder: this.encoder}); | |||||
| if (page !== undefined && page !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>page, 'page'); | |||||
| } | |||||
| if (itemsPerPage !== undefined && itemsPerPage !== null) { | |||||
| localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, | |||||
| <any>itemsPerPage, 'itemsPerPage'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | |||||
| let localVarCredential: string | undefined; | |||||
| // authentication (JWT) required | |||||
| localVarCredential = this.configuration.lookupCredential('JWT'); | |||||
| if (localVarCredential) { | |||||
| localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); | |||||
| } | |||||
| let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; | |||||
| if (localVarHttpHeaderAcceptSelected === undefined) { | |||||
| // to determine the Accept header | |||||
| const httpHeaderAccepts: string[] = [ | |||||
| 'application/ld+json' | |||||
| ]; | |||||
| localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); | |||||
| } | |||||
| if (localVarHttpHeaderAcceptSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); | |||||
| } | |||||
| let localVarHttpContext: HttpContext | undefined = options && options.context; | |||||
| if (localVarHttpContext === undefined) { | |||||
| localVarHttpContext = new HttpContext(); | |||||
| } | |||||
| let localVarTransferCache: boolean | undefined = options && options.transferCache; | |||||
| if (localVarTransferCache === undefined) { | |||||
| localVarTransferCache = true; | |||||
| } | |||||
| let responseType_: 'text' | 'json' | 'blob' = 'json'; | |||||
| if (localVarHttpHeaderAcceptSelected) { | |||||
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { | |||||
| responseType_ = 'text'; | |||||
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { | |||||
| responseType_ = 'json'; | |||||
| } else { | |||||
| responseType_ = 'blob'; | |||||
| } | |||||
| } | |||||
| let localVarPath = `/api/user_trip_work_logs`; | |||||
| return this.httpClient.request<ApiUserTripWorkLogsGetCollection200Response>('get', `${this.configuration.basePath}${localVarPath}`, | |||||
| { | |||||
| context: localVarHttpContext, | |||||
| params: localVarQueryParameters, | |||||
| responseType: <any>responseType_, | |||||
| withCredentials: this.configuration.withCredentials, | |||||
| headers: localVarHeaders, | |||||
| observe: observe, | |||||
| transferCache: localVarTransferCache, | |||||
| reportProgress: reportProgress | |||||
| } | |||||
| ); | |||||
| } | |||||
| /** | |||||
| * Retrieves a UserTripWorkLog resource. | |||||
| * Retrieves a UserTripWorkLog resource. | |||||
| * @param id UserTripWorkLog identifier | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | |||||
| * @param reportProgress flag to report request and response progress. | |||||
| */ | |||||
| public userTripWorkLogsIdGet(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<UserTripWorkLogJsonld>; | |||||
| public userTripWorkLogsIdGet(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<UserTripWorkLogJsonld>>; | |||||
| public userTripWorkLogsIdGet(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<UserTripWorkLogJsonld>>; | |||||
| public userTripWorkLogsIdGet(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| if (id === null || id === undefined) { | |||||
| throw new Error('Required parameter id was null or undefined when calling userTripWorkLogsIdGet.'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | |||||
| let localVarCredential: string | undefined; | |||||
| // authentication (JWT) required | |||||
| localVarCredential = this.configuration.lookupCredential('JWT'); | |||||
| if (localVarCredential) { | |||||
| localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); | |||||
| } | |||||
| let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; | |||||
| if (localVarHttpHeaderAcceptSelected === undefined) { | |||||
| // to determine the Accept header | |||||
| const httpHeaderAccepts: string[] = [ | |||||
| 'application/ld+json' | |||||
| ]; | |||||
| localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); | |||||
| } | |||||
| if (localVarHttpHeaderAcceptSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); | |||||
| } | |||||
| let localVarHttpContext: HttpContext | undefined = options && options.context; | |||||
| if (localVarHttpContext === undefined) { | |||||
| localVarHttpContext = new HttpContext(); | |||||
| } | |||||
| let localVarTransferCache: boolean | undefined = options && options.transferCache; | |||||
| if (localVarTransferCache === undefined) { | |||||
| localVarTransferCache = true; | |||||
| } | |||||
| let responseType_: 'text' | 'json' | 'blob' = 'json'; | |||||
| if (localVarHttpHeaderAcceptSelected) { | |||||
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { | |||||
| responseType_ = 'text'; | |||||
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { | |||||
| responseType_ = 'json'; | |||||
| } else { | |||||
| responseType_ = 'blob'; | |||||
| } | |||||
| } | |||||
| let localVarPath = `/api/user_trip_work_logs/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; | |||||
| return this.httpClient.request<UserTripWorkLogJsonld>('get', `${this.configuration.basePath}${localVarPath}`, | |||||
| { | |||||
| context: localVarHttpContext, | |||||
| responseType: <any>responseType_, | |||||
| withCredentials: this.configuration.withCredentials, | |||||
| headers: localVarHeaders, | |||||
| observe: observe, | |||||
| transferCache: localVarTransferCache, | |||||
| reportProgress: reportProgress | |||||
| } | |||||
| ); | |||||
| } | |||||
| /** | |||||
| * Updates the UserTripWorkLog resource. | |||||
| * Updates the UserTripWorkLog resource. | |||||
| * @param id UserTripWorkLog identifier | |||||
| * @param userTripWorkLog The updated UserTripWorkLog resource | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | |||||
| * @param reportProgress flag to report request and response progress. | |||||
| */ | |||||
| public userTripWorkLogsIdPatch(id: string, userTripWorkLog: UserTripWorkLog, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<UserTripWorkLogJsonld>; | |||||
| public userTripWorkLogsIdPatch(id: string, userTripWorkLog: UserTripWorkLog, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<UserTripWorkLogJsonld>>; | |||||
| public userTripWorkLogsIdPatch(id: string, userTripWorkLog: UserTripWorkLog, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<UserTripWorkLogJsonld>>; | |||||
| public userTripWorkLogsIdPatch(id: string, userTripWorkLog: UserTripWorkLog, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| if (id === null || id === undefined) { | |||||
| throw new Error('Required parameter id was null or undefined when calling userTripWorkLogsIdPatch.'); | |||||
| } | |||||
| if (userTripWorkLog === null || userTripWorkLog === undefined) { | |||||
| throw new Error('Required parameter userTripWorkLog was null or undefined when calling userTripWorkLogsIdPatch.'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | |||||
| let localVarCredential: string | undefined; | |||||
| // authentication (JWT) required | |||||
| localVarCredential = this.configuration.lookupCredential('JWT'); | |||||
| if (localVarCredential) { | |||||
| localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); | |||||
| } | |||||
| let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; | |||||
| if (localVarHttpHeaderAcceptSelected === undefined) { | |||||
| // to determine the Accept header | |||||
| const httpHeaderAccepts: string[] = [ | |||||
| 'application/ld+json' | |||||
| ]; | |||||
| localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); | |||||
| } | |||||
| if (localVarHttpHeaderAcceptSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); | |||||
| } | |||||
| let localVarHttpContext: HttpContext | undefined = options && options.context; | |||||
| if (localVarHttpContext === undefined) { | |||||
| localVarHttpContext = new HttpContext(); | |||||
| } | |||||
| let localVarTransferCache: boolean | undefined = options && options.transferCache; | |||||
| if (localVarTransferCache === undefined) { | |||||
| localVarTransferCache = true; | |||||
| } | |||||
| // to determine the Content-Type header | |||||
| const consumes: string[] = [ | |||||
| 'application/merge-patch+json' | |||||
| ]; | |||||
| const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); | |||||
| if (httpContentTypeSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); | |||||
| } | |||||
| let responseType_: 'text' | 'json' | 'blob' = 'json'; | |||||
| if (localVarHttpHeaderAcceptSelected) { | |||||
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { | |||||
| responseType_ = 'text'; | |||||
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { | |||||
| responseType_ = 'json'; | |||||
| } else { | |||||
| responseType_ = 'blob'; | |||||
| } | |||||
| } | |||||
| let localVarPath = `/api/user_trip_work_logs/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; | |||||
| return this.httpClient.request<UserTripWorkLogJsonld>('patch', `${this.configuration.basePath}${localVarPath}`, | |||||
| { | |||||
| context: localVarHttpContext, | |||||
| body: userTripWorkLog, | |||||
| responseType: <any>responseType_, | |||||
| withCredentials: this.configuration.withCredentials, | |||||
| headers: localVarHeaders, | |||||
| observe: observe, | |||||
| transferCache: localVarTransferCache, | |||||
| reportProgress: reportProgress | |||||
| } | |||||
| ); | |||||
| } | |||||
| /** | |||||
| * Creates a UserTripWorkLog resource. | |||||
| * Creates a UserTripWorkLog resource. | |||||
| * @param userTripWorkLogJsonld The new UserTripWorkLog resource | |||||
| * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. | |||||
| * @param reportProgress flag to report request and response progress. | |||||
| */ | |||||
| public userTripWorkLogsPost(userTripWorkLogJsonld: UserTripWorkLogJsonld, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<UserTripWorkLogJsonld>; | |||||
| public userTripWorkLogsPost(userTripWorkLogJsonld: UserTripWorkLogJsonld, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<UserTripWorkLogJsonld>>; | |||||
| public userTripWorkLogsPost(userTripWorkLogJsonld: UserTripWorkLogJsonld, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<UserTripWorkLogJsonld>>; | |||||
| public userTripWorkLogsPost(userTripWorkLogJsonld: UserTripWorkLogJsonld, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json', context?: HttpContext, transferCache?: boolean}): Observable<any> { | |||||
| if (userTripWorkLogJsonld === null || userTripWorkLogJsonld === undefined) { | |||||
| throw new Error('Required parameter userTripWorkLogJsonld was null or undefined when calling userTripWorkLogsPost.'); | |||||
| } | |||||
| let localVarHeaders = this.defaultHeaders; | |||||
| let localVarCredential: string | undefined; | |||||
| // authentication (JWT) required | |||||
| localVarCredential = this.configuration.lookupCredential('JWT'); | |||||
| if (localVarCredential) { | |||||
| localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); | |||||
| } | |||||
| let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; | |||||
| if (localVarHttpHeaderAcceptSelected === undefined) { | |||||
| // to determine the Accept header | |||||
| const httpHeaderAccepts: string[] = [ | |||||
| 'application/ld+json' | |||||
| ]; | |||||
| localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); | |||||
| } | |||||
| if (localVarHttpHeaderAcceptSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); | |||||
| } | |||||
| let localVarHttpContext: HttpContext | undefined = options && options.context; | |||||
| if (localVarHttpContext === undefined) { | |||||
| localVarHttpContext = new HttpContext(); | |||||
| } | |||||
| let localVarTransferCache: boolean | undefined = options && options.transferCache; | |||||
| if (localVarTransferCache === undefined) { | |||||
| localVarTransferCache = true; | |||||
| } | |||||
| // to determine the Content-Type header | |||||
| const consumes: string[] = [ | |||||
| 'application/ld+json' | |||||
| ]; | |||||
| const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); | |||||
| if (httpContentTypeSelected !== undefined) { | |||||
| localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); | |||||
| } | |||||
| let responseType_: 'text' | 'json' | 'blob' = 'json'; | |||||
| if (localVarHttpHeaderAcceptSelected) { | |||||
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { | |||||
| responseType_ = 'text'; | |||||
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { | |||||
| responseType_ = 'json'; | |||||
| } else { | |||||
| responseType_ = 'blob'; | |||||
| } | |||||
| } | |||||
| let localVarPath = `/api/user_trip_work_logs`; | |||||
| return this.httpClient.request<UserTripWorkLogJsonld>('post', `${this.configuration.basePath}${localVarPath}`, | |||||
| { | |||||
| context: localVarHttpContext, | |||||
| body: userTripWorkLogJsonld, | |||||
| responseType: <any>responseType_, | |||||
| withCredentials: this.configuration.withCredentials, | |||||
| headers: localVarHeaders, | |||||
| observe: observe, | |||||
| transferCache: localVarTransferCache, | |||||
| reportProgress: reportProgress | |||||
| } | |||||
| ); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,23 @@ | |||||
| /** | |||||
| * Imaq Platform | |||||
| * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | |||||
| * | |||||
| * The version of the OpenAPI document: 1.0.0 | |||||
| * | |||||
| * | |||||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | |||||
| * https://openapi-generator.tech | |||||
| * Do not edit the class manually. | |||||
| */ | |||||
| import { EventJsonld } from './eventJsonld'; | |||||
| import { ApiEventsGetCollection200ResponseSearch } from './apiEventsGetCollection200ResponseSearch'; | |||||
| import { ApiEventsGetCollection200ResponseView } from './apiEventsGetCollection200ResponseView'; | |||||
| export interface ApiEventsGetCollection200Response { | |||||
| member: Array<EventJsonld>; | |||||
| totalItems?: number; | |||||
| view?: ApiEventsGetCollection200ResponseView; | |||||
| search?: ApiEventsGetCollection200ResponseSearch; | |||||
| } | |||||
| @@ -9,13 +9,13 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { ApiLocationsGetCollection200ResponseSearchMappingInner } from './apiLocationsGetCollection200ResponseSearchMappingInner'; | |||||
| import { ApiEventsGetCollection200ResponseSearchMappingInner } from './apiEventsGetCollection200ResponseSearchMappingInner'; | |||||
| export interface ApiLocationsGetCollection200ResponseSearch { | |||||
| export interface ApiEventsGetCollection200ResponseSearch { | |||||
| type?: string; | type?: string; | ||||
| template?: string; | template?: string; | ||||
| variableRepresentation?: string; | variableRepresentation?: string; | ||||
| mapping?: Array<ApiLocationsGetCollection200ResponseSearchMappingInner>; | |||||
| mapping?: Array<ApiEventsGetCollection200ResponseSearchMappingInner>; | |||||
| } | } | ||||
| @@ -11,7 +11,7 @@ | |||||
| */ | */ | ||||
| export interface ApiLocationsGetCollection200ResponseSearchMappingInner { | |||||
| export interface ApiEventsGetCollection200ResponseSearchMappingInner { | |||||
| type?: string; | type?: string; | ||||
| variable?: string; | variable?: string; | ||||
| property?: string | null; | property?: string | null; | ||||
| @@ -11,7 +11,7 @@ | |||||
| */ | */ | ||||
| export interface ApiLocationsGetCollection200ResponseView { | |||||
| export interface ApiEventsGetCollection200ResponseView { | |||||
| id?: string; | id?: string; | ||||
| type?: string; | type?: string; | ||||
| first?: string; | first?: string; | ||||
| @@ -9,15 +9,15 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { ApiLocationsGetCollection200ResponseSearch } from './apiLocationsGetCollection200ResponseSearch'; | |||||
| import { ApiLocationsGetCollection200ResponseView } from './apiLocationsGetCollection200ResponseView'; | |||||
| import { ApiEventsGetCollection200ResponseSearch } from './apiEventsGetCollection200ResponseSearch'; | |||||
| import { ApiEventsGetCollection200ResponseView } from './apiEventsGetCollection200ResponseView'; | |||||
| import { LocationJsonld } from './locationJsonld'; | import { LocationJsonld } from './locationJsonld'; | ||||
| export interface ApiLocationsGetCollection200Response { | export interface ApiLocationsGetCollection200Response { | ||||
| member: Array<LocationJsonld>; | member: Array<LocationJsonld>; | ||||
| totalItems?: number; | totalItems?: number; | ||||
| view?: ApiLocationsGetCollection200ResponseView; | |||||
| search?: ApiLocationsGetCollection200ResponseSearch; | |||||
| view?: ApiEventsGetCollection200ResponseView; | |||||
| search?: ApiEventsGetCollection200ResponseSearch; | |||||
| } | } | ||||
| @@ -9,15 +9,15 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { ApiLocationsGetCollection200ResponseSearch } from './apiLocationsGetCollection200ResponseSearch'; | |||||
| import { ApiLocationsGetCollection200ResponseView } from './apiLocationsGetCollection200ResponseView'; | |||||
| import { MediaObjectJsonld } from './mediaObjectJsonld'; | import { MediaObjectJsonld } from './mediaObjectJsonld'; | ||||
| import { ApiEventsGetCollection200ResponseSearch } from './apiEventsGetCollection200ResponseSearch'; | |||||
| import { ApiEventsGetCollection200ResponseView } from './apiEventsGetCollection200ResponseView'; | |||||
| export interface ApiMediaObjectsGetCollection200Response { | export interface ApiMediaObjectsGetCollection200Response { | ||||
| member: Array<MediaObjectJsonld>; | member: Array<MediaObjectJsonld>; | ||||
| totalItems?: number; | totalItems?: number; | ||||
| view?: ApiLocationsGetCollection200ResponseView; | |||||
| search?: ApiLocationsGetCollection200ResponseSearch; | |||||
| view?: ApiEventsGetCollection200ResponseView; | |||||
| search?: ApiEventsGetCollection200ResponseSearch; | |||||
| } | } | ||||
| @@ -9,15 +9,15 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { ApiLocationsGetCollection200ResponseSearch } from './apiLocationsGetCollection200ResponseSearch'; | |||||
| import { ApiLocationsGetCollection200ResponseView } from './apiLocationsGetCollection200ResponseView'; | |||||
| import { ShippingCompanyJsonld } from './shippingCompanyJsonld'; | import { ShippingCompanyJsonld } from './shippingCompanyJsonld'; | ||||
| import { ApiEventsGetCollection200ResponseSearch } from './apiEventsGetCollection200ResponseSearch'; | |||||
| import { ApiEventsGetCollection200ResponseView } from './apiEventsGetCollection200ResponseView'; | |||||
| export interface ApiShippingCompaniesGetCollection200Response { | export interface ApiShippingCompaniesGetCollection200Response { | ||||
| member: Array<ShippingCompanyJsonld>; | member: Array<ShippingCompanyJsonld>; | ||||
| totalItems?: number; | totalItems?: number; | ||||
| view?: ApiLocationsGetCollection200ResponseView; | |||||
| search?: ApiLocationsGetCollection200ResponseSearch; | |||||
| view?: ApiEventsGetCollection200ResponseView; | |||||
| search?: ApiEventsGetCollection200ResponseSearch; | |||||
| } | } | ||||
| @@ -9,15 +9,15 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { ApiLocationsGetCollection200ResponseSearch } from './apiLocationsGetCollection200ResponseSearch'; | |||||
| import { ApiLocationsGetCollection200ResponseView } from './apiLocationsGetCollection200ResponseView'; | |||||
| import { TripLocationJsonld } from './tripLocationJsonld'; | import { TripLocationJsonld } from './tripLocationJsonld'; | ||||
| import { ApiEventsGetCollection200ResponseSearch } from './apiEventsGetCollection200ResponseSearch'; | |||||
| import { ApiEventsGetCollection200ResponseView } from './apiEventsGetCollection200ResponseView'; | |||||
| export interface ApiTripLocationsGetCollection200Response { | export interface ApiTripLocationsGetCollection200Response { | ||||
| member: Array<TripLocationJsonld>; | member: Array<TripLocationJsonld>; | ||||
| totalItems?: number; | totalItems?: number; | ||||
| view?: ApiLocationsGetCollection200ResponseView; | |||||
| search?: ApiLocationsGetCollection200ResponseSearch; | |||||
| view?: ApiEventsGetCollection200ResponseView; | |||||
| search?: ApiEventsGetCollection200ResponseSearch; | |||||
| } | } | ||||
| @@ -9,15 +9,15 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { ApiLocationsGetCollection200ResponseSearch } from './apiLocationsGetCollection200ResponseSearch'; | |||||
| import { ApiLocationsGetCollection200ResponseView } from './apiLocationsGetCollection200ResponseView'; | |||||
| import { TripJsonld } from './tripJsonld'; | import { TripJsonld } from './tripJsonld'; | ||||
| import { ApiEventsGetCollection200ResponseSearch } from './apiEventsGetCollection200ResponseSearch'; | |||||
| import { ApiEventsGetCollection200ResponseView } from './apiEventsGetCollection200ResponseView'; | |||||
| export interface ApiTripsGetCollection200Response { | export interface ApiTripsGetCollection200Response { | ||||
| member: Array<TripJsonld>; | member: Array<TripJsonld>; | ||||
| totalItems?: number; | totalItems?: number; | ||||
| view?: ApiLocationsGetCollection200ResponseView; | |||||
| search?: ApiLocationsGetCollection200ResponseSearch; | |||||
| view?: ApiEventsGetCollection200ResponseView; | |||||
| search?: ApiEventsGetCollection200ResponseSearch; | |||||
| } | } | ||||
| @@ -1,23 +0,0 @@ | |||||
| /** | |||||
| * Imaq Platform | |||||
| * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | |||||
| * | |||||
| * The version of the OpenAPI document: 1.0.0 | |||||
| * | |||||
| * | |||||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | |||||
| * https://openapi-generator.tech | |||||
| * Do not edit the class manually. | |||||
| */ | |||||
| import { ApiLocationsGetCollection200ResponseSearch } from './apiLocationsGetCollection200ResponseSearch'; | |||||
| import { ApiLocationsGetCollection200ResponseView } from './apiLocationsGetCollection200ResponseView'; | |||||
| import { UserTripLocationJsonld } from './userTripLocationJsonld'; | |||||
| export interface ApiUserTripLocationsGetCollection200Response { | |||||
| member: Array<UserTripLocationJsonld>; | |||||
| totalItems?: number; | |||||
| view?: ApiLocationsGetCollection200ResponseView; | |||||
| search?: ApiLocationsGetCollection200ResponseSearch; | |||||
| } | |||||
| @@ -1,23 +0,0 @@ | |||||
| /** | |||||
| * Imaq Platform | |||||
| * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | |||||
| * | |||||
| * The version of the OpenAPI document: 1.0.0 | |||||
| * | |||||
| * | |||||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | |||||
| * https://openapi-generator.tech | |||||
| * Do not edit the class manually. | |||||
| */ | |||||
| import { ApiLocationsGetCollection200ResponseSearch } from './apiLocationsGetCollection200ResponseSearch'; | |||||
| import { ApiLocationsGetCollection200ResponseView } from './apiLocationsGetCollection200ResponseView'; | |||||
| import { UserTripWorkLogJsonld } from './userTripWorkLogJsonld'; | |||||
| export interface ApiUserTripWorkLogsGetCollection200Response { | |||||
| member: Array<UserTripWorkLogJsonld>; | |||||
| totalItems?: number; | |||||
| view?: ApiLocationsGetCollection200ResponseView; | |||||
| search?: ApiLocationsGetCollection200ResponseSearch; | |||||
| } | |||||
| @@ -9,15 +9,15 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { ApiLocationsGetCollection200ResponseSearch } from './apiLocationsGetCollection200ResponseSearch'; | |||||
| import { ApiLocationsGetCollection200ResponseView } from './apiLocationsGetCollection200ResponseView'; | |||||
| import { UserTripJsonld } from './userTripJsonld'; | import { UserTripJsonld } from './userTripJsonld'; | ||||
| import { ApiEventsGetCollection200ResponseSearch } from './apiEventsGetCollection200ResponseSearch'; | |||||
| import { ApiEventsGetCollection200ResponseView } from './apiEventsGetCollection200ResponseView'; | |||||
| export interface ApiUserTripsGetCollection200Response { | export interface ApiUserTripsGetCollection200Response { | ||||
| member: Array<UserTripJsonld>; | member: Array<UserTripJsonld>; | ||||
| totalItems?: number; | totalItems?: number; | ||||
| view?: ApiLocationsGetCollection200ResponseView; | |||||
| search?: ApiLocationsGetCollection200ResponseSearch; | |||||
| view?: ApiEventsGetCollection200ResponseView; | |||||
| search?: ApiEventsGetCollection200ResponseSearch; | |||||
| } | } | ||||
| @@ -9,15 +9,15 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { ApiLocationsGetCollection200ResponseSearch } from './apiLocationsGetCollection200ResponseSearch'; | |||||
| import { ApiLocationsGetCollection200ResponseView } from './apiLocationsGetCollection200ResponseView'; | |||||
| import { UserJsonld } from './userJsonld'; | import { UserJsonld } from './userJsonld'; | ||||
| import { ApiEventsGetCollection200ResponseSearch } from './apiEventsGetCollection200ResponseSearch'; | |||||
| import { ApiEventsGetCollection200ResponseView } from './apiEventsGetCollection200ResponseView'; | |||||
| export interface ApiUsersGetCollection200Response { | export interface ApiUsersGetCollection200Response { | ||||
| member: Array<UserJsonld>; | member: Array<UserJsonld>; | ||||
| totalItems?: number; | totalItems?: number; | ||||
| view?: ApiLocationsGetCollection200ResponseView; | |||||
| search?: ApiLocationsGetCollection200ResponseSearch; | |||||
| view?: ApiEventsGetCollection200ResponseView; | |||||
| search?: ApiEventsGetCollection200ResponseSearch; | |||||
| } | } | ||||
| @@ -9,15 +9,15 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { ApiLocationsGetCollection200ResponseSearch } from './apiLocationsGetCollection200ResponseSearch'; | |||||
| import { ApiLocationsGetCollection200ResponseView } from './apiLocationsGetCollection200ResponseView'; | |||||
| import { VesselJsonld } from './vesselJsonld'; | import { VesselJsonld } from './vesselJsonld'; | ||||
| import { ApiEventsGetCollection200ResponseSearch } from './apiEventsGetCollection200ResponseSearch'; | |||||
| import { ApiEventsGetCollection200ResponseView } from './apiEventsGetCollection200ResponseView'; | |||||
| export interface ApiVesselsGetCollection200Response { | export interface ApiVesselsGetCollection200Response { | ||||
| member: Array<VesselJsonld>; | member: Array<VesselJsonld>; | ||||
| totalItems?: number; | totalItems?: number; | ||||
| view?: ApiLocationsGetCollection200ResponseView; | |||||
| search?: ApiLocationsGetCollection200ResponseSearch; | |||||
| view?: ApiEventsGetCollection200ResponseView; | |||||
| search?: ApiEventsGetCollection200ResponseSearch; | |||||
| } | } | ||||
| @@ -9,15 +9,15 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { ApiLocationsGetCollection200ResponseSearch } from './apiLocationsGetCollection200ResponseSearch'; | |||||
| import { ApiLocationsGetCollection200ResponseView } from './apiLocationsGetCollection200ResponseView'; | |||||
| import { ApiEventsGetCollection200ResponseSearch } from './apiEventsGetCollection200ResponseSearch'; | |||||
| import { ApiEventsGetCollection200ResponseView } from './apiEventsGetCollection200ResponseView'; | |||||
| import { ZoneJsonld } from './zoneJsonld'; | import { ZoneJsonld } from './zoneJsonld'; | ||||
| export interface ApiZonesGetCollection200Response { | export interface ApiZonesGetCollection200Response { | ||||
| member: Array<ZoneJsonld>; | member: Array<ZoneJsonld>; | ||||
| totalItems?: number; | totalItems?: number; | ||||
| view?: ApiLocationsGetCollection200ResponseView; | |||||
| search?: ApiLocationsGetCollection200ResponseSearch; | |||||
| view?: ApiEventsGetCollection200ResponseView; | |||||
| search?: ApiEventsGetCollection200ResponseSearch; | |||||
| } | } | ||||
| @@ -9,16 +9,21 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { EventJsonldContext } from './eventJsonldContext'; | |||||
| /** | /** | ||||
| * | * | ||||
| */ | */ | ||||
| export interface UserTripLocation { | |||||
| export interface EventJsonld { | |||||
| readonly id?: string; | |||||
| readonly type?: string; | |||||
| context?: EventJsonldContext; | |||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| readonly userTrip?: string; | |||||
| readonly location?: string; | |||||
| plannedDate: string; | |||||
| name?: string; | |||||
| identifier?: string; | |||||
| sequence?: number; | |||||
| mandatory?: boolean; | |||||
| readonly createdAt?: string | null; | readonly createdAt?: string | null; | ||||
| } | } | ||||
| @@ -9,12 +9,12 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { LocationJsonldContextOneOf } from './locationJsonldContextOneOf'; | |||||
| import { EventJsonldContextOneOf } from './eventJsonldContextOneOf'; | |||||
| /** | /** | ||||
| * @type LocationJsonldContext | |||||
| * @type EventJsonldContext | |||||
| * @export | * @export | ||||
| */ | */ | ||||
| export type LocationJsonldContext = LocationJsonldContextOneOf | string; | |||||
| export type EventJsonldContext = EventJsonldContextOneOf | string; | |||||
| @@ -11,14 +11,14 @@ | |||||
| */ | */ | ||||
| export interface LocationJsonldContextOneOf { | |||||
| export interface EventJsonldContextOneOf { | |||||
| [key: string]: any | any; | [key: string]: any | any; | ||||
| vocab: string; | vocab: string; | ||||
| hydra: LocationJsonldContextOneOf.HydraEnum; | |||||
| hydra: EventJsonldContextOneOf.HydraEnum; | |||||
| } | } | ||||
| export namespace LocationJsonldContextOneOf { | |||||
| export namespace EventJsonldContextOneOf { | |||||
| export type HydraEnum = 'http://www.w3.org/ns/hydra/core#'; | export type HydraEnum = 'http://www.w3.org/ns/hydra/core#'; | ||||
| export const HydraEnum = { | export const HydraEnum = { | ||||
| HttpWwwW3OrgNsHydraCore: 'http://www.w3.org/ns/hydra/core#' as HydraEnum | HttpWwwW3OrgNsHydraCore: 'http://www.w3.org/ns/hydra/core#' as HydraEnum | ||||
| @@ -20,6 +20,9 @@ export interface Location { | |||||
| zone?: Zone; | zone?: Zone; | ||||
| name: string; | name: string; | ||||
| code: string; | code: string; | ||||
| isZone?: boolean; | |||||
| isPlace?: boolean; | |||||
| isPort?: boolean; | |||||
| readonly createdAt?: string | null; | readonly createdAt?: string | null; | ||||
| } | } | ||||
| @@ -9,7 +9,7 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { LocationJsonldContext } from './locationJsonldContext'; | |||||
| import { EventJsonldContext } from './eventJsonldContext'; | |||||
| import { ZoneJsonld } from './zoneJsonld'; | import { ZoneJsonld } from './zoneJsonld'; | ||||
| @@ -17,13 +17,16 @@ import { ZoneJsonld } from './zoneJsonld'; | |||||
| * | * | ||||
| */ | */ | ||||
| export interface LocationJsonld { | export interface LocationJsonld { | ||||
| context?: LocationJsonldContext; | |||||
| context?: EventJsonldContext; | |||||
| readonly id?: string; | readonly id?: string; | ||||
| readonly type?: string; | readonly type?: string; | ||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| zone?: ZoneJsonld; | zone?: ZoneJsonld; | ||||
| name: string; | name: string; | ||||
| code: string; | code: string; | ||||
| isZone?: boolean; | |||||
| isPlace?: boolean; | |||||
| isPort?: boolean; | |||||
| readonly createdAt?: string | null; | readonly createdAt?: string | null; | ||||
| } | } | ||||
| @@ -9,14 +9,14 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { LocationJsonldContext } from './locationJsonldContext'; | |||||
| import { EventJsonldContext } from './eventJsonldContext'; | |||||
| /** | /** | ||||
| * | * | ||||
| */ | */ | ||||
| export interface MediaObjectJsonld { | export interface MediaObjectJsonld { | ||||
| context?: LocationJsonldContext; | |||||
| context?: EventJsonldContext; | |||||
| readonly id?: string; | readonly id?: string; | ||||
| readonly type?: string; | readonly type?: string; | ||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| @@ -1,23 +1,23 @@ | |||||
| export * from './apiEventsGetCollection200Response'; | |||||
| export * from './apiEventsGetCollection200ResponseSearch'; | |||||
| export * from './apiEventsGetCollection200ResponseSearchMappingInner'; | |||||
| export * from './apiEventsGetCollection200ResponseView'; | |||||
| export * from './apiLocationsGetCollection200Response'; | export * from './apiLocationsGetCollection200Response'; | ||||
| export * from './apiLocationsGetCollection200ResponseSearch'; | |||||
| export * from './apiLocationsGetCollection200ResponseSearchMappingInner'; | |||||
| export * from './apiLocationsGetCollection200ResponseView'; | |||||
| export * from './apiMediaObjectsGetCollection200Response'; | export * from './apiMediaObjectsGetCollection200Response'; | ||||
| export * from './apiShippingCompaniesGetCollection200Response'; | export * from './apiShippingCompaniesGetCollection200Response'; | ||||
| export * from './apiTripLocationsGetCollection200Response'; | export * from './apiTripLocationsGetCollection200Response'; | ||||
| export * from './apiTripsGetCollection200Response'; | export * from './apiTripsGetCollection200Response'; | ||||
| export * from './apiUserTripLocationsGetCollection200Response'; | |||||
| export * from './apiUserTripWorkLogsGetCollection200Response'; | |||||
| export * from './apiUserTripsGetCollection200Response'; | export * from './apiUserTripsGetCollection200Response'; | ||||
| export * from './apiUsersGetCollection200Response'; | export * from './apiUsersGetCollection200Response'; | ||||
| export * from './apiVesselsGetCollection200Response'; | export * from './apiVesselsGetCollection200Response'; | ||||
| export * from './apiZonesGetCollection200Response'; | export * from './apiZonesGetCollection200Response'; | ||||
| export * from './authResponse'; | export * from './authResponse'; | ||||
| export * from './credentials'; | export * from './credentials'; | ||||
| export * from './eventJsonld'; | |||||
| export * from './eventJsonldContext'; | |||||
| export * from './eventJsonldContextOneOf'; | |||||
| export * from './location'; | export * from './location'; | ||||
| export * from './locationJsonld'; | export * from './locationJsonld'; | ||||
| export * from './locationJsonldContext'; | |||||
| export * from './locationJsonldContextOneOf'; | |||||
| export * from './mediaObjectJsonld'; | export * from './mediaObjectJsonld'; | ||||
| export * from './shippingCompany'; | export * from './shippingCompany'; | ||||
| export * from './shippingCompanyJsonld'; | export * from './shippingCompanyJsonld'; | ||||
| @@ -29,10 +29,6 @@ export * from './user'; | |||||
| export * from './userJsonld'; | export * from './userJsonld'; | ||||
| export * from './userTrip'; | export * from './userTrip'; | ||||
| export * from './userTripJsonld'; | export * from './userTripJsonld'; | ||||
| export * from './userTripLocation'; | |||||
| export * from './userTripLocationJsonld'; | |||||
| export * from './userTripWorkLog'; | |||||
| export * from './userTripWorkLogJsonld'; | |||||
| export * from './vessel'; | export * from './vessel'; | ||||
| export * from './vesselJsonld'; | export * from './vesselJsonld'; | ||||
| export * from './zone'; | export * from './zone'; | ||||
| @@ -9,14 +9,14 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { LocationJsonldContext } from './locationJsonldContext'; | |||||
| import { EventJsonldContext } from './eventJsonldContext'; | |||||
| /** | /** | ||||
| * | * | ||||
| */ | */ | ||||
| export interface ShippingCompanyJsonld { | export interface ShippingCompanyJsonld { | ||||
| context?: LocationJsonldContext; | |||||
| context?: EventJsonldContext; | |||||
| readonly id?: string; | readonly id?: string; | ||||
| readonly type?: string; | readonly type?: string; | ||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| @@ -9,6 +9,8 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { Vessel } from './vessel'; | |||||
| import { Location } from './location'; | |||||
| /** | /** | ||||
| @@ -16,13 +18,15 @@ | |||||
| */ | */ | ||||
| export interface Trip { | export interface Trip { | ||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| readonly vessel?: string; | |||||
| pilotReference: string; | |||||
| vessel?: Vessel; | |||||
| readonly pilotageReference?: string | null; | |||||
| customerReference?: string | null; | |||||
| captainName?: string | null; | captainName?: string | null; | ||||
| readonly startLocation?: string; | |||||
| readonly endLocation?: string; | |||||
| startLocation?: Location; | |||||
| endLocation?: Location; | |||||
| startDate: string; | startDate: string; | ||||
| endDate: string; | endDate: string; | ||||
| note?: string | null; | |||||
| readonly createdAt?: string | null; | readonly createdAt?: string | null; | ||||
| } | } | ||||
| @@ -10,25 +10,27 @@ | |||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { VesselJsonld } from './vesselJsonld'; | import { VesselJsonld } from './vesselJsonld'; | ||||
| import { EventJsonldContext } from './eventJsonldContext'; | |||||
| import { LocationJsonld } from './locationJsonld'; | import { LocationJsonld } from './locationJsonld'; | ||||
| import { LocationJsonldContext } from './locationJsonldContext'; | |||||
| /** | /** | ||||
| * | * | ||||
| */ | */ | ||||
| export interface TripJsonld { | export interface TripJsonld { | ||||
| context?: LocationJsonldContext; | |||||
| context?: EventJsonldContext; | |||||
| readonly id?: string; | readonly id?: string; | ||||
| readonly type?: string; | readonly type?: string; | ||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| readonly vessel?: VesselJsonld; | |||||
| pilotReference: string; | |||||
| vessel?: VesselJsonld; | |||||
| readonly pilotageReference?: string | null; | |||||
| customerReference?: string | null; | |||||
| captainName?: string | null; | captainName?: string | null; | ||||
| readonly startLocation?: LocationJsonld; | |||||
| readonly endLocation?: LocationJsonld; | |||||
| startLocation?: LocationJsonld; | |||||
| endLocation?: LocationJsonld; | |||||
| startDate: string; | startDate: string; | ||||
| endDate: string; | endDate: string; | ||||
| note?: string | null; | |||||
| readonly createdAt?: string | null; | readonly createdAt?: string | null; | ||||
| } | } | ||||
| @@ -9,6 +9,8 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { Trip } from './trip'; | |||||
| import { Location } from './location'; | |||||
| /** | /** | ||||
| @@ -16,8 +18,9 @@ | |||||
| */ | */ | ||||
| export interface TripLocation { | export interface TripLocation { | ||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| readonly trip?: string; | |||||
| readonly location?: string; | |||||
| trip?: Trip; | |||||
| location?: Location; | |||||
| isArrival?: boolean; | |||||
| date: string; | date: string; | ||||
| readonly createdAt?: string | null; | readonly createdAt?: string | null; | ||||
| } | } | ||||
| @@ -10,20 +10,21 @@ | |||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { TripJsonld } from './tripJsonld'; | import { TripJsonld } from './tripJsonld'; | ||||
| import { EventJsonldContext } from './eventJsonldContext'; | |||||
| import { LocationJsonld } from './locationJsonld'; | import { LocationJsonld } from './locationJsonld'; | ||||
| import { LocationJsonldContext } from './locationJsonldContext'; | |||||
| /** | /** | ||||
| * | * | ||||
| */ | */ | ||||
| export interface TripLocationJsonld { | export interface TripLocationJsonld { | ||||
| context?: LocationJsonldContext; | |||||
| context?: EventJsonldContext; | |||||
| readonly id?: string; | readonly id?: string; | ||||
| readonly type?: string; | readonly type?: string; | ||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| readonly trip?: TripJsonld; | |||||
| readonly location?: LocationJsonld; | |||||
| trip?: TripJsonld; | |||||
| location?: LocationJsonld; | |||||
| isArrival?: boolean; | |||||
| date: string; | date: string; | ||||
| readonly createdAt?: string | null; | readonly createdAt?: string | null; | ||||
| } | } | ||||
| @@ -18,6 +18,7 @@ export interface User { | |||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| email: string; | email: string; | ||||
| firstName: string; | firstName: string; | ||||
| referenceId: string; | |||||
| lastName: string; | lastName: string; | ||||
| image?: string | null; | image?: string | null; | ||||
| readonly imageUrl?: string | null; | readonly imageUrl?: string | null; | ||||
| @@ -28,7 +29,6 @@ export interface User { | |||||
| password?: string; | password?: string; | ||||
| active?: boolean; | active?: boolean; | ||||
| roles?: Array<string>; | roles?: Array<string>; | ||||
| readonly token?: string | null; | |||||
| readonly createdAt?: string | null; | readonly createdAt?: string | null; | ||||
| } | } | ||||
| @@ -9,19 +9,20 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { LocationJsonldContext } from './locationJsonldContext'; | |||||
| import { EventJsonldContext } from './eventJsonldContext'; | |||||
| /** | /** | ||||
| * | * | ||||
| */ | */ | ||||
| export interface UserJsonld { | export interface UserJsonld { | ||||
| context?: LocationJsonldContext; | |||||
| context?: EventJsonldContext; | |||||
| readonly id?: string; | readonly id?: string; | ||||
| readonly type?: string; | readonly type?: string; | ||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| email: string; | email: string; | ||||
| firstName: string; | firstName: string; | ||||
| referenceId: string; | |||||
| lastName: string; | lastName: string; | ||||
| image?: string | null; | image?: string | null; | ||||
| readonly imageUrl?: string | null; | readonly imageUrl?: string | null; | ||||
| @@ -32,7 +33,6 @@ export interface UserJsonld { | |||||
| password?: string; | password?: string; | ||||
| active?: boolean; | active?: boolean; | ||||
| roles?: Array<string>; | roles?: Array<string>; | ||||
| readonly token?: string | null; | |||||
| readonly createdAt?: string | null; | readonly createdAt?: string | null; | ||||
| } | } | ||||
| @@ -11,14 +11,14 @@ | |||||
| */ | */ | ||||
| import { TripJsonld } from './tripJsonld'; | import { TripJsonld } from './tripJsonld'; | ||||
| import { UserJsonld } from './userJsonld'; | import { UserJsonld } from './userJsonld'; | ||||
| import { LocationJsonldContext } from './locationJsonldContext'; | |||||
| import { EventJsonldContext } from './eventJsonldContext'; | |||||
| /** | /** | ||||
| * | * | ||||
| */ | */ | ||||
| export interface UserTripJsonld { | export interface UserTripJsonld { | ||||
| context?: LocationJsonldContext; | |||||
| context?: EventJsonldContext; | |||||
| readonly id?: string; | readonly id?: string; | ||||
| readonly type?: string; | readonly type?: string; | ||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| @@ -1,30 +0,0 @@ | |||||
| /** | |||||
| * Imaq Platform | |||||
| * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | |||||
| * | |||||
| * The version of the OpenAPI document: 1.0.0 | |||||
| * | |||||
| * | |||||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | |||||
| * https://openapi-generator.tech | |||||
| * Do not edit the class manually. | |||||
| */ | |||||
| import { UserTripJsonld } from './userTripJsonld'; | |||||
| import { LocationJsonld } from './locationJsonld'; | |||||
| import { LocationJsonldContext } from './locationJsonldContext'; | |||||
| /** | |||||
| * | |||||
| */ | |||||
| export interface UserTripLocationJsonld { | |||||
| context?: LocationJsonldContext; | |||||
| readonly id?: string; | |||||
| readonly type?: string; | |||||
| readonly dbId?: number | null; | |||||
| readonly userTrip?: UserTripJsonld; | |||||
| readonly location?: LocationJsonld; | |||||
| plannedDate: string; | |||||
| readonly createdAt?: string | null; | |||||
| } | |||||
| @@ -1,26 +0,0 @@ | |||||
| /** | |||||
| * Imaq Platform | |||||
| * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | |||||
| * | |||||
| * The version of the OpenAPI document: 1.0.0 | |||||
| * | |||||
| * | |||||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | |||||
| * https://openapi-generator.tech | |||||
| * Do not edit the class manually. | |||||
| */ | |||||
| /** | |||||
| * | |||||
| */ | |||||
| export interface UserTripWorkLog { | |||||
| readonly dbId?: number | null; | |||||
| readonly userTrip?: string; | |||||
| readonly startLocation?: string; | |||||
| readonly endLocation?: string; | |||||
| startDate: string; | |||||
| endDate: string; | |||||
| readonly createdAt?: string | null; | |||||
| } | |||||
| @@ -1,32 +0,0 @@ | |||||
| /** | |||||
| * Imaq Platform | |||||
| * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | |||||
| * | |||||
| * The version of the OpenAPI document: 1.0.0 | |||||
| * | |||||
| * | |||||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | |||||
| * https://openapi-generator.tech | |||||
| * Do not edit the class manually. | |||||
| */ | |||||
| import { UserTripJsonld } from './userTripJsonld'; | |||||
| import { LocationJsonld } from './locationJsonld'; | |||||
| import { LocationJsonldContext } from './locationJsonldContext'; | |||||
| /** | |||||
| * | |||||
| */ | |||||
| export interface UserTripWorkLogJsonld { | |||||
| context?: LocationJsonldContext; | |||||
| readonly id?: string; | |||||
| readonly type?: string; | |||||
| readonly dbId?: number | null; | |||||
| readonly userTrip?: UserTripJsonld; | |||||
| readonly startLocation?: LocationJsonld; | |||||
| readonly endLocation?: LocationJsonld; | |||||
| startDate: string; | |||||
| endDate: string; | |||||
| readonly createdAt?: string | null; | |||||
| } | |||||
| @@ -10,14 +10,14 @@ | |||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { ShippingCompanyJsonld } from './shippingCompanyJsonld'; | import { ShippingCompanyJsonld } from './shippingCompanyJsonld'; | ||||
| import { LocationJsonldContext } from './locationJsonldContext'; | |||||
| import { EventJsonldContext } from './eventJsonldContext'; | |||||
| /** | /** | ||||
| * | * | ||||
| */ | */ | ||||
| export interface VesselJsonld { | export interface VesselJsonld { | ||||
| context?: LocationJsonldContext; | |||||
| context?: EventJsonldContext; | |||||
| readonly id?: string; | readonly id?: string; | ||||
| readonly type?: string; | readonly type?: string; | ||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| @@ -9,14 +9,14 @@ | |||||
| * https://openapi-generator.tech | * https://openapi-generator.tech | ||||
| * Do not edit the class manually. | * Do not edit the class manually. | ||||
| */ | */ | ||||
| import { LocationJsonldContext } from './locationJsonldContext'; | |||||
| import { EventJsonldContext } from './eventJsonldContext'; | |||||
| /** | /** | ||||
| * | * | ||||
| */ | */ | ||||
| export interface ZoneJsonld { | export interface ZoneJsonld { | ||||
| context?: LocationJsonldContext; | |||||
| context?: EventJsonldContext; | |||||
| readonly id?: string; | readonly id?: string; | ||||
| readonly type?: string; | readonly type?: string; | ||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| @@ -15,11 +15,21 @@ | |||||
| "code": "Code", | "code": "Code", | ||||
| "created_at": "Created at" | "created_at": "Created at" | ||||
| }, | }, | ||||
| "trips": | |||||
| "trip": | |||||
| { | { | ||||
| "view": "Trips" | |||||
| "view": "Trips", | |||||
| "view_single": "Trip", | |||||
| "pilot_reference": "Pilotage reference", | |||||
| "customer_reference": "Customer reference", | |||||
| "captain_name": "Captain name", | |||||
| "vessel": "Vessel", | |||||
| "start_location": "Start location", | |||||
| "end_location": "End location", | |||||
| "start_date": "Start date", | |||||
| "end_date": "End date", | |||||
| "itinerary": "Itinerary" | |||||
| }, | }, | ||||
| "user_trips": | |||||
| "user_trip": | |||||
| { | { | ||||
| "view": "User Trips" | "view": "User Trips" | ||||
| }, | }, | ||||
| @@ -35,12 +45,14 @@ | |||||
| "location": "Location", | "location": "Location", | ||||
| "zone": "Zone", | "zone": "Zone", | ||||
| "vessel": "Vessel", | "vessel": "Vessel", | ||||
| "shipping_company": "Shipping Company" | |||||
| "shipping_company": "Shipping Company", | |||||
| "trip": "Trip" | |||||
| }, | }, | ||||
| "location": | "location": | ||||
| { | { | ||||
| "is_zone": "Is zone", | |||||
| "is_place": "Is place", | |||||
| "is_port": "Is port" | |||||
| }, | }, | ||||
| "zone": | "zone": | ||||
| { | { | ||||
| @@ -15,7 +15,7 @@ api_platform: | |||||
| standard_put: true | standard_put: true | ||||
| pagination_client_items_per_page: true | pagination_client_items_per_page: true | ||||
| pagination_items_per_page: 50 | pagination_items_per_page: 50 | ||||
| pagination_maximum_items_per_page: 100 | |||||
| pagination_maximum_items_per_page: 200 | |||||
| swagger: | swagger: | ||||
| api_keys: | api_keys: | ||||
| @@ -0,0 +1,31 @@ | |||||
| <?php | |||||
| declare(strict_types=1); | |||||
| namespace DoctrineMigrations; | |||||
| use Doctrine\DBAL\Schema\Schema; | |||||
| use Doctrine\Migrations\AbstractMigration; | |||||
| /** | |||||
| * Auto-generated Migration: Please modify to your needs! | |||||
| */ | |||||
| final class Version20250228112455 extends AbstractMigration | |||||
| { | |||||
| public function getDescription(): string | |||||
| { | |||||
| return ''; | |||||
| } | |||||
| public function up(Schema $schema): void | |||||
| { | |||||
| // this up() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE location ADD is_area TINYINT(1) NOT NULL, ADD is_place TINYINT(1) NOT NULL, ADD is_port TINYINT(1) NOT NULL'); | |||||
| } | |||||
| public function down(Schema $schema): void | |||||
| { | |||||
| // this down() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE location DROP is_area, DROP is_place, DROP is_port'); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,31 @@ | |||||
| <?php | |||||
| declare(strict_types=1); | |||||
| namespace DoctrineMigrations; | |||||
| use Doctrine\DBAL\Schema\Schema; | |||||
| use Doctrine\Migrations\AbstractMigration; | |||||
| /** | |||||
| * Auto-generated Migration: Please modify to your needs! | |||||
| */ | |||||
| final class Version20250228113640 extends AbstractMigration | |||||
| { | |||||
| public function getDescription(): string | |||||
| { | |||||
| return ''; | |||||
| } | |||||
| public function up(Schema $schema): void | |||||
| { | |||||
| // this up() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE location CHANGE is_area is_zone TINYINT(1) NOT NULL'); | |||||
| } | |||||
| public function down(Schema $schema): void | |||||
| { | |||||
| // this down() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE location CHANGE is_zone is_area TINYINT(1) NOT NULL'); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,53 @@ | |||||
| <?php | |||||
| declare(strict_types=1); | |||||
| namespace DoctrineMigrations; | |||||
| use Doctrine\DBAL\Schema\Schema; | |||||
| use Doctrine\Migrations\AbstractMigration; | |||||
| /** | |||||
| * Auto-generated Migration: Please modify to your needs! | |||||
| */ | |||||
| final class Version20250303144554 extends AbstractMigration | |||||
| { | |||||
| public function getDescription(): string | |||||
| { | |||||
| return ''; | |||||
| } | |||||
| public function up(Schema $schema): void | |||||
| { | |||||
| // this up() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('CREATE TABLE event (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, identifier VARCHAR(255) NOT NULL, `order` INT UNSIGNED NOT NULL, mandatory TINYINT(1) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', UNIQUE INDEX UNIQ_3BAE0AA75E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | |||||
| $this->addSql('CREATE TABLE user_trip_event (id INT AUTO_INCREMENT NOT NULL, user_trip_id INT NOT NULL, event_id INT NOT NULL, date DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_46824C08FDB13004 (user_trip_id), INDEX IDX_46824C0871F7E88B (event_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | |||||
| $this->addSql('ALTER TABLE user_trip_event ADD CONSTRAINT FK_46824C08FDB13004 FOREIGN KEY (user_trip_id) REFERENCES user_trip (id)'); | |||||
| $this->addSql('ALTER TABLE user_trip_event ADD CONSTRAINT FK_46824C0871F7E88B FOREIGN KEY (event_id) REFERENCES event (id)'); | |||||
| $this->addSql('ALTER TABLE user_trip_location DROP FOREIGN KEY FK_1841178B64D218E'); | |||||
| $this->addSql('ALTER TABLE user_trip_location DROP FOREIGN KEY FK_1841178BFDB13004'); | |||||
| $this->addSql('ALTER TABLE user_trip_work_log DROP FOREIGN KEY FK_B38EA119FDB13004'); | |||||
| $this->addSql('ALTER TABLE user_trip_work_log DROP FOREIGN KEY FK_B38EA1195C3A313A'); | |||||
| $this->addSql('ALTER TABLE user_trip_work_log DROP FOREIGN KEY FK_B38EA119C43C7F1'); | |||||
| $this->addSql('DROP TABLE user_trip_location'); | |||||
| $this->addSql('DROP TABLE user_trip_work_log'); | |||||
| $this->addSql('ALTER TABLE trip_location ADD is_arrival TINYINT(1) NOT NULL'); | |||||
| } | |||||
| public function down(Schema $schema): void | |||||
| { | |||||
| // this down() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('CREATE TABLE user_trip_location (id INT AUTO_INCREMENT NOT NULL, user_trip_id INT NOT NULL, location_id INT NOT NULL, planned_date DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_1841178BFDB13004 (user_trip_id), INDEX IDX_1841178B64D218E (location_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); | |||||
| $this->addSql('CREATE TABLE user_trip_work_log (id INT AUTO_INCREMENT NOT NULL, user_trip_id INT NOT NULL, start_location_id INT NOT NULL, end_location_id INT NOT NULL, start_date DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', end_date DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_B38EA119C43C7F1 (end_location_id), INDEX IDX_B38EA119FDB13004 (user_trip_id), INDEX IDX_B38EA1195C3A313A (start_location_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); | |||||
| $this->addSql('ALTER TABLE user_trip_location ADD CONSTRAINT FK_1841178B64D218E FOREIGN KEY (location_id) REFERENCES location (id)'); | |||||
| $this->addSql('ALTER TABLE user_trip_location ADD CONSTRAINT FK_1841178BFDB13004 FOREIGN KEY (user_trip_id) REFERENCES user_trip (id)'); | |||||
| $this->addSql('ALTER TABLE user_trip_work_log ADD CONSTRAINT FK_B38EA119FDB13004 FOREIGN KEY (user_trip_id) REFERENCES user_trip (id)'); | |||||
| $this->addSql('ALTER TABLE user_trip_work_log ADD CONSTRAINT FK_B38EA1195C3A313A FOREIGN KEY (start_location_id) REFERENCES location (id)'); | |||||
| $this->addSql('ALTER TABLE user_trip_work_log ADD CONSTRAINT FK_B38EA119C43C7F1 FOREIGN KEY (end_location_id) REFERENCES location (id)'); | |||||
| $this->addSql('ALTER TABLE user_trip_event DROP FOREIGN KEY FK_46824C08FDB13004'); | |||||
| $this->addSql('ALTER TABLE user_trip_event DROP FOREIGN KEY FK_46824C0871F7E88B'); | |||||
| $this->addSql('DROP TABLE event'); | |||||
| $this->addSql('DROP TABLE user_trip_event'); | |||||
| $this->addSql('ALTER TABLE trip_location DROP is_arrival'); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,31 @@ | |||||
| <?php | |||||
| declare(strict_types=1); | |||||
| namespace DoctrineMigrations; | |||||
| use Doctrine\DBAL\Schema\Schema; | |||||
| use Doctrine\Migrations\AbstractMigration; | |||||
| /** | |||||
| * Auto-generated Migration: Please modify to your needs! | |||||
| */ | |||||
| final class Version20250303152548 extends AbstractMigration | |||||
| { | |||||
| public function getDescription(): string | |||||
| { | |||||
| return ''; | |||||
| } | |||||
| public function up(Schema $schema): void | |||||
| { | |||||
| // this up() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE event CHANGE `order` sequence INT UNSIGNED NOT NULL'); | |||||
| } | |||||
| public function down(Schema $schema): void | |||||
| { | |||||
| // this down() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE event CHANGE sequence `order` INT UNSIGNED NOT NULL'); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,31 @@ | |||||
| <?php | |||||
| declare(strict_types=1); | |||||
| namespace DoctrineMigrations; | |||||
| use Doctrine\DBAL\Schema\Schema; | |||||
| use Doctrine\Migrations\AbstractMigration; | |||||
| /** | |||||
| * Auto-generated Migration: Please modify to your needs! | |||||
| */ | |||||
| final class Version20250304114315 extends AbstractMigration | |||||
| { | |||||
| public function getDescription(): string | |||||
| { | |||||
| return ''; | |||||
| } | |||||
| public function up(Schema $schema): void | |||||
| { | |||||
| // this up() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE user_trip_event ADD note LONGTEXT DEFAULT NULL'); | |||||
| } | |||||
| public function down(Schema $schema): void | |||||
| { | |||||
| // this down() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE user_trip_event DROP note'); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,33 @@ | |||||
| <?php | |||||
| declare(strict_types=1); | |||||
| namespace DoctrineMigrations; | |||||
| use Doctrine\DBAL\Schema\Schema; | |||||
| use Doctrine\Migrations\AbstractMigration; | |||||
| /** | |||||
| * Auto-generated Migration: Please modify to your needs! | |||||
| */ | |||||
| final class Version20250304115016 extends AbstractMigration | |||||
| { | |||||
| public function getDescription(): string | |||||
| { | |||||
| return ''; | |||||
| } | |||||
| public function up(Schema $schema): void | |||||
| { | |||||
| // this up() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('DROP INDEX UNIQ_7656F53B69AF50E7 ON trip'); | |||||
| $this->addSql('ALTER TABLE trip DROP pilotage_reference'); | |||||
| } | |||||
| public function down(Schema $schema): void | |||||
| { | |||||
| // this down() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE trip ADD pilotage_reference VARCHAR(255) NOT NULL'); | |||||
| $this->addSql('CREATE UNIQUE INDEX UNIQ_7656F53B69AF50E7 ON trip (pilotage_reference)'); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,31 @@ | |||||
| <?php | |||||
| declare(strict_types=1); | |||||
| namespace DoctrineMigrations; | |||||
| use Doctrine\DBAL\Schema\Schema; | |||||
| use Doctrine\Migrations\AbstractMigration; | |||||
| /** | |||||
| * Auto-generated Migration: Please modify to your needs! | |||||
| */ | |||||
| final class Version20250304122802 extends AbstractMigration | |||||
| { | |||||
| public function getDescription(): string | |||||
| { | |||||
| return ''; | |||||
| } | |||||
| public function up(Schema $schema): void | |||||
| { | |||||
| // this up() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE trip CHANGE cruise_reference cruise_reference VARCHAR(255) DEFAULT NULL'); | |||||
| } | |||||
| public function down(Schema $schema): void | |||||
| { | |||||
| // this down() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE trip CHANGE cruise_reference cruise_reference VARCHAR(255) NOT NULL'); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,31 @@ | |||||
| <?php | |||||
| declare(strict_types=1); | |||||
| namespace DoctrineMigrations; | |||||
| use Doctrine\DBAL\Schema\Schema; | |||||
| use Doctrine\Migrations\AbstractMigration; | |||||
| /** | |||||
| * Auto-generated Migration: Please modify to your needs! | |||||
| */ | |||||
| final class Version20250304124329 extends AbstractMigration | |||||
| { | |||||
| public function getDescription(): string | |||||
| { | |||||
| return ''; | |||||
| } | |||||
| public function up(Schema $schema): void | |||||
| { | |||||
| // this up() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE trip CHANGE cruise_reference customer_reference VARCHAR(255) DEFAULT NULL'); | |||||
| } | |||||
| public function down(Schema $schema): void | |||||
| { | |||||
| // this down() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE trip CHANGE customer_reference cruise_reference VARCHAR(255) DEFAULT NULL'); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,56 @@ | |||||
| <?php | |||||
| namespace App\ApiResource; | |||||
| use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; | |||||
| use ApiPlatform\Metadata\ApiFilter; | |||||
| use ApiPlatform\Metadata\ApiProperty; | |||||
| use ApiPlatform\Metadata\ApiResource; | |||||
| use ApiPlatform\Metadata\Get; | |||||
| use ApiPlatform\Metadata\GetCollection; | |||||
| use ApiPlatform\Doctrine\Orm\State\Options; | |||||
| use App\Entity\Event; | |||||
| use App\Filter\CustomJsonFilter; | |||||
| use App\Filter\CustomJsonOrderFilter; | |||||
| use App\State\EntityClassDtoStateProcessor; | |||||
| use App\State\EntityToDtoStateProvider; | |||||
| #[ApiResource( | |||||
| shortName: 'Event', | |||||
| operations: [ | |||||
| new Get( | |||||
| security: 'is_granted("ROLE_USER")' | |||||
| ), | |||||
| new GetCollection( | |||||
| security: 'is_granted("ROLE_USER")' | |||||
| ), | |||||
| ], | |||||
| security: 'is_granted("ROLE_USER")', | |||||
| provider: EntityToDtoStateProvider::class, | |||||
| processor: EntityClassDtoStateProcessor::class, | |||||
| stateOptions: new Options(entityClass: Event::class), | |||||
| )] | |||||
| #[ApiFilter(SearchFilter::class, properties: [ | |||||
| 'name' => 'ipartial', | |||||
| ])] | |||||
| #[ApiFilter(CustomJsonFilter::class)] | |||||
| #[ApiFilter(CustomJsonOrderFilter::class)] | |||||
| class EventApi | |||||
| { | |||||
| #[ApiProperty(readable: false, writable: false, identifier: true)] | |||||
| public ?int $id = null; | |||||
| #[ApiProperty(writable: false)] | |||||
| public ?int $dbId = null; | |||||
| public string $name; | |||||
| public string $identifier; | |||||
| public int $sequence; | |||||
| public bool $mandatory; | |||||
| #[ApiProperty(writable: false)] | |||||
| public ?\DateTimeImmutable $createdAt = null; | |||||
| } | |||||
| @@ -79,6 +79,12 @@ class LocationApi | |||||
| #[Assert\NotBlank] | #[Assert\NotBlank] | ||||
| public string $code; | public string $code; | ||||
| public bool $isZone; | |||||
| public bool $isPlace; | |||||
| public bool $isPort; | |||||
| #[ApiProperty(writable: false)] | #[ApiProperty(writable: false)] | ||||
| public ?\DateTimeImmutable $createdAt = null; | public ?\DateTimeImmutable $createdAt = null; | ||||
| } | } | ||||
| @@ -2,14 +2,19 @@ | |||||
| namespace App\ApiResource; | namespace App\ApiResource; | ||||
| use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; | |||||
| use ApiPlatform\Metadata\ApiFilter; | |||||
| use ApiPlatform\Metadata\ApiProperty; | use ApiPlatform\Metadata\ApiProperty; | ||||
| use ApiPlatform\Metadata\ApiResource; | use ApiPlatform\Metadata\ApiResource; | ||||
| use ApiPlatform\Metadata\Delete; | |||||
| use ApiPlatform\Metadata\Get; | use ApiPlatform\Metadata\Get; | ||||
| use ApiPlatform\Metadata\GetCollection; | use ApiPlatform\Metadata\GetCollection; | ||||
| use ApiPlatform\Metadata\Patch; | use ApiPlatform\Metadata\Patch; | ||||
| use ApiPlatform\Metadata\Post; | use ApiPlatform\Metadata\Post; | ||||
| use ApiPlatform\Doctrine\Orm\State\Options; | use ApiPlatform\Doctrine\Orm\State\Options; | ||||
| use App\Entity\Trip; | use App\Entity\Trip; | ||||
| use App\Filter\CustomJsonFilter; | |||||
| use App\Filter\CustomJsonOrderFilter; | |||||
| use App\State\EntityClassDtoStateProcessor; | use App\State\EntityClassDtoStateProcessor; | ||||
| use App\State\EntityToDtoStateProvider; | use App\State\EntityToDtoStateProvider; | ||||
| use Symfony\Component\Validator\Constraints as Assert; | use Symfony\Component\Validator\Constraints as Assert; | ||||
| @@ -30,12 +35,20 @@ use Symfony\Component\PropertyInfo\Type; | |||||
| new Patch( | new Patch( | ||||
| security: 'is_granted("ROLE_ADMIN")' | security: 'is_granted("ROLE_ADMIN")' | ||||
| ), | ), | ||||
| new Delete( | |||||
| security: 'is_granted("ROLE_ADMIN")' | |||||
| ) | |||||
| ], | ], | ||||
| security: 'is_granted("ROLE_USER")', | security: 'is_granted("ROLE_USER")', | ||||
| provider: EntityToDtoStateProvider::class, | provider: EntityToDtoStateProvider::class, | ||||
| processor: EntityClassDtoStateProcessor::class, | processor: EntityClassDtoStateProcessor::class, | ||||
| stateOptions: new Options(entityClass: Trip::class), | stateOptions: new Options(entityClass: Trip::class), | ||||
| )] | )] | ||||
| #[ApiFilter(SearchFilter::class, properties: [ | |||||
| 'id' => 'ipartial', | |||||
| ])] | |||||
| #[ApiFilter(CustomJsonFilter::class)] | |||||
| #[ApiFilter(CustomJsonOrderFilter::class)] | |||||
| class TripApi | class TripApi | ||||
| { | { | ||||
| #[ApiProperty(readable: false, writable: false, identifier: true)] | #[ApiProperty(readable: false, writable: false, identifier: true)] | ||||
| @@ -48,9 +61,9 @@ class TripApi | |||||
| * @var VesselApi | * @var VesselApi | ||||
| */ | */ | ||||
| #[ApiProperty( | #[ApiProperty( | ||||
| writable: false, | |||||
| writable: true, | |||||
| readableLink: true, | readableLink: true, | ||||
| writableLink: false, | |||||
| writableLink: true, | |||||
| builtinTypes: [ | builtinTypes: [ | ||||
| new Type( | new Type( | ||||
| 'object', | 'object', | ||||
| @@ -60,8 +73,10 @@ class TripApi | |||||
| )] | )] | ||||
| public ?VesselApi $vessel = null; | public ?VesselApi $vessel = null; | ||||
| #[Assert\NotBlank] | |||||
| public string $pilotReference; | |||||
| #[ApiProperty(writable: false)] | |||||
| public ?string $pilotageReference = null; | |||||
| public ?string $customerReference = null; | |||||
| public ?string $captainName = null; | public ?string $captainName = null; | ||||
| @@ -69,9 +84,9 @@ class TripApi | |||||
| * @var LocationApi | * @var LocationApi | ||||
| */ | */ | ||||
| #[ApiProperty( | #[ApiProperty( | ||||
| writable: false, | |||||
| writable: true, | |||||
| readableLink: true, | readableLink: true, | ||||
| writableLink: false, | |||||
| writableLink: true, | |||||
| builtinTypes: [ | builtinTypes: [ | ||||
| new Type( | new Type( | ||||
| 'object', | 'object', | ||||
| @@ -85,9 +100,9 @@ class TripApi | |||||
| * @var LocationApi | * @var LocationApi | ||||
| */ | */ | ||||
| #[ApiProperty( | #[ApiProperty( | ||||
| writable: false, | |||||
| writable: true, | |||||
| readableLink: true, | readableLink: true, | ||||
| writableLink: false, | |||||
| writableLink: true, | |||||
| builtinTypes: [ | builtinTypes: [ | ||||
| new Type( | new Type( | ||||
| 'object', | 'object', | ||||
| @@ -103,6 +118,8 @@ class TripApi | |||||
| #[Assert\NotBlank] | #[Assert\NotBlank] | ||||
| public \DateTimeImmutable $endDate; | public \DateTimeImmutable $endDate; | ||||
| public ?string $note; | |||||
| #[ApiProperty(writable: false)] | #[ApiProperty(writable: false)] | ||||
| public ?\DateTimeImmutable $createdAt = null; | public ?\DateTimeImmutable $createdAt = null; | ||||
| } | } | ||||
| @@ -2,14 +2,19 @@ | |||||
| namespace App\ApiResource; | namespace App\ApiResource; | ||||
| use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; | |||||
| use ApiPlatform\Metadata\ApiFilter; | |||||
| use ApiPlatform\Metadata\ApiProperty; | use ApiPlatform\Metadata\ApiProperty; | ||||
| use ApiPlatform\Metadata\ApiResource; | use ApiPlatform\Metadata\ApiResource; | ||||
| use ApiPlatform\Metadata\Delete; | |||||
| use ApiPlatform\Metadata\Get; | use ApiPlatform\Metadata\Get; | ||||
| use ApiPlatform\Metadata\GetCollection; | use ApiPlatform\Metadata\GetCollection; | ||||
| use ApiPlatform\Metadata\Patch; | use ApiPlatform\Metadata\Patch; | ||||
| use ApiPlatform\Metadata\Post; | use ApiPlatform\Metadata\Post; | ||||
| use ApiPlatform\Doctrine\Orm\State\Options; | use ApiPlatform\Doctrine\Orm\State\Options; | ||||
| use App\Entity\TripLocation; | use App\Entity\TripLocation; | ||||
| use App\Filter\CustomJsonFilter; | |||||
| use App\Filter\CustomJsonOrderFilter; | |||||
| use App\State\EntityClassDtoStateProcessor; | use App\State\EntityClassDtoStateProcessor; | ||||
| use App\State\EntityToDtoStateProvider; | use App\State\EntityToDtoStateProvider; | ||||
| use Symfony\Component\Validator\Constraints as Assert; | use Symfony\Component\Validator\Constraints as Assert; | ||||
| @@ -30,12 +35,20 @@ use Symfony\Component\PropertyInfo\Type; | |||||
| new Patch( | new Patch( | ||||
| security: 'is_granted("ROLE_ADMIN")' | security: 'is_granted("ROLE_ADMIN")' | ||||
| ), | ), | ||||
| new Delete( | |||||
| security: 'is_granted("ROLE_ADMIN")' | |||||
| ) | |||||
| ], | ], | ||||
| order: ['date' => 'ASC'], | |||||
| security: 'is_granted("ROLE_USER")', | security: 'is_granted("ROLE_USER")', | ||||
| provider: EntityToDtoStateProvider::class, | provider: EntityToDtoStateProvider::class, | ||||
| processor: EntityClassDtoStateProcessor::class, | processor: EntityClassDtoStateProcessor::class, | ||||
| stateOptions: new Options(entityClass: TripLocation::class), | stateOptions: new Options(entityClass: TripLocation::class), | ||||
| )] | )] | ||||
| #[ApiFilter(SearchFilter::class, properties: ['trip' => 'exact'])] | |||||
| #[ApiFilter(CustomJsonFilter::class)] | |||||
| #[ApiFilter(CustomJsonOrderFilter::class)] | |||||
| class TripLocationApi | class TripLocationApi | ||||
| { | { | ||||
| #[ApiProperty(readable: false, writable: false, identifier: true)] | #[ApiProperty(readable: false, writable: false, identifier: true)] | ||||
| @@ -48,9 +61,9 @@ class TripLocationApi | |||||
| * @var TripApi | * @var TripApi | ||||
| */ | */ | ||||
| #[ApiProperty( | #[ApiProperty( | ||||
| writable: false, | |||||
| writable: true, | |||||
| readableLink: true, | readableLink: true, | ||||
| writableLink: false, | |||||
| writableLink: true, | |||||
| builtinTypes: [ | builtinTypes: [ | ||||
| new Type( | new Type( | ||||
| 'object', | 'object', | ||||
| @@ -64,9 +77,9 @@ class TripLocationApi | |||||
| * @var LocationApi | * @var LocationApi | ||||
| */ | */ | ||||
| #[ApiProperty( | #[ApiProperty( | ||||
| writable: false, | |||||
| writable: true, | |||||
| readableLink: true, | readableLink: true, | ||||
| writableLink: false, | |||||
| writableLink: true, | |||||
| builtinTypes: [ | builtinTypes: [ | ||||
| new Type( | new Type( | ||||
| 'object', | 'object', | ||||
| @@ -76,6 +89,8 @@ class TripLocationApi | |||||
| )] | )] | ||||
| public ?LocationApi $location = null; | public ?LocationApi $location = null; | ||||
| public bool $isArrival; | |||||
| #[Assert\NotBlank] | #[Assert\NotBlank] | ||||
| public \DateTimeImmutable $date; | public \DateTimeImmutable $date; | ||||
| @@ -69,6 +69,9 @@ class UserApi | |||||
| #[Assert\NotBlank] | #[Assert\NotBlank] | ||||
| public string $firstName; | public string $firstName; | ||||
| #[Assert\NotBlank] | |||||
| public string $referenceId; | |||||
| #[Assert\NotBlank] | #[Assert\NotBlank] | ||||
| public string $lastName; | public string $lastName; | ||||
| @@ -9,14 +9,15 @@ use ApiPlatform\Metadata\GetCollection; | |||||
| use ApiPlatform\Metadata\Patch; | use ApiPlatform\Metadata\Patch; | ||||
| use ApiPlatform\Metadata\Post; | use ApiPlatform\Metadata\Post; | ||||
| use ApiPlatform\Doctrine\Orm\State\Options; | use ApiPlatform\Doctrine\Orm\State\Options; | ||||
| use App\Entity\UserTripLocation; | |||||
| use App\Entity\UserTrip; | |||||
| use App\Entity\UserTripEvent; | |||||
| use App\State\EntityClassDtoStateProcessor; | use App\State\EntityClassDtoStateProcessor; | ||||
| use App\State\EntityToDtoStateProvider; | use App\State\EntityToDtoStateProvider; | ||||
| use Symfony\Component\Validator\Constraints as Assert; | use Symfony\Component\Validator\Constraints as Assert; | ||||
| use Symfony\Component\PropertyInfo\Type; | use Symfony\Component\PropertyInfo\Type; | ||||
| #[ApiResource( | #[ApiResource( | ||||
| shortName: 'UserTripLocation', | |||||
| shortName: 'UserTrip', | |||||
| operations: [ | operations: [ | ||||
| new Get( | new Get( | ||||
| security: 'is_granted("ROLE_USER")' | security: 'is_granted("ROLE_USER")' | ||||
| @@ -34,9 +35,9 @@ use Symfony\Component\PropertyInfo\Type; | |||||
| security: 'is_granted("ROLE_USER")', | security: 'is_granted("ROLE_USER")', | ||||
| provider: EntityToDtoStateProvider::class, | provider: EntityToDtoStateProvider::class, | ||||
| processor: EntityClassDtoStateProcessor::class, | processor: EntityClassDtoStateProcessor::class, | ||||
| stateOptions: new Options(entityClass: UserTripLocation::class), | |||||
| stateOptions: new Options(entityClass: UserTripEvent::class), | |||||
| )] | )] | ||||
| class UserTripLocationApi | |||||
| class UserTripEventApi | |||||
| { | { | ||||
| #[ApiProperty(readable: false, writable: false, identifier: true)] | #[ApiProperty(readable: false, writable: false, identifier: true)] | ||||
| public ?int $id = null; | public ?int $id = null; | ||||
| @@ -54,14 +55,14 @@ class UserTripLocationApi | |||||
| builtinTypes: [ | builtinTypes: [ | ||||
| new Type( | new Type( | ||||
| 'object', | 'object', | ||||
| class: UserTripApi::class, | |||||
| class: UserTrip::class, | |||||
| ) | ) | ||||
| ] | ] | ||||
| )] | )] | ||||
| public ?UserTripApi $userTrip = null; | public ?UserTripApi $userTrip = null; | ||||
| /** | /** | ||||
| * @var LocationApi | |||||
| * @var EventApi | |||||
| */ | */ | ||||
| #[ApiProperty( | #[ApiProperty( | ||||
| writable: false, | writable: false, | ||||
| @@ -70,14 +71,16 @@ class UserTripLocationApi | |||||
| builtinTypes: [ | builtinTypes: [ | ||||
| new Type( | new Type( | ||||
| 'object', | 'object', | ||||
| class: LocationApi::class, | |||||
| class: EventApi::class, | |||||
| ) | ) | ||||
| ] | ] | ||||
| )] | )] | ||||
| public ?LocationApi $location = null; | |||||
| public ?EventApi $event = null; | |||||
| #[Assert\NotBlank] | #[Assert\NotBlank] | ||||
| public \DateTimeImmutable $plannedDate; | |||||
| public \DateTimeImmutable $date; | |||||
| public ?string $note; | |||||
| #[ApiProperty(writable: false)] | #[ApiProperty(writable: false)] | ||||
| public ?\DateTimeImmutable $createdAt = null; | public ?\DateTimeImmutable $createdAt = null; | ||||
| @@ -1,103 +0,0 @@ | |||||
| <?php | |||||
| namespace App\ApiResource; | |||||
| use ApiPlatform\Metadata\ApiProperty; | |||||
| use ApiPlatform\Metadata\ApiResource; | |||||
| use ApiPlatform\Metadata\Get; | |||||
| use ApiPlatform\Metadata\GetCollection; | |||||
| use ApiPlatform\Metadata\Patch; | |||||
| use ApiPlatform\Metadata\Post; | |||||
| use ApiPlatform\Doctrine\Orm\State\Options; | |||||
| use App\Entity\UserTripWorkLog; | |||||
| use App\State\EntityClassDtoStateProcessor; | |||||
| use App\State\EntityToDtoStateProvider; | |||||
| use Symfony\Component\Validator\Constraints as Assert; | |||||
| use Symfony\Component\PropertyInfo\Type; | |||||
| #[ApiResource( | |||||
| shortName: 'UserTripWorkLog', | |||||
| operations: [ | |||||
| new Get( | |||||
| security: 'is_granted("ROLE_USER")' | |||||
| ), | |||||
| new GetCollection( | |||||
| security: 'is_granted("ROLE_USER")' | |||||
| ), | |||||
| new Post( | |||||
| security: 'is_granted("ROLE_ADMIN")' | |||||
| ), | |||||
| new Patch( | |||||
| security: 'is_granted("ROLE_ADMIN")' | |||||
| ), | |||||
| ], | |||||
| security: 'is_granted("ROLE_USER")', | |||||
| provider: EntityToDtoStateProvider::class, | |||||
| processor: EntityClassDtoStateProcessor::class, | |||||
| stateOptions: new Options(entityClass: UserTripWorkLog::class), | |||||
| )] | |||||
| class UserTripWorkLogApi | |||||
| { | |||||
| #[ApiProperty(readable: false, writable: false, identifier: true)] | |||||
| public ?int $id = null; | |||||
| #[ApiProperty(writable: false)] | |||||
| public ?int $dbId = null; | |||||
| /** | |||||
| * @var UserTripApi | |||||
| */ | |||||
| #[ApiProperty( | |||||
| writable: false, | |||||
| readableLink: true, | |||||
| writableLink: false, | |||||
| builtinTypes: [ | |||||
| new Type( | |||||
| 'object', | |||||
| class: UserTripApi::class, | |||||
| ) | |||||
| ] | |||||
| )] | |||||
| public ?UserTripApi $userTrip = null; | |||||
| /** | |||||
| * @var LocationApi | |||||
| */ | |||||
| #[ApiProperty( | |||||
| writable: false, | |||||
| readableLink: true, | |||||
| writableLink: false, | |||||
| builtinTypes: [ | |||||
| new Type( | |||||
| 'object', | |||||
| class: LocationApi::class, | |||||
| ) | |||||
| ] | |||||
| )] | |||||
| public ?LocationApi $startLocation = null; | |||||
| /** | |||||
| * @var LocationApi | |||||
| */ | |||||
| #[ApiProperty( | |||||
| writable: false, | |||||
| readableLink: true, | |||||
| writableLink: false, | |||||
| builtinTypes: [ | |||||
| new Type( | |||||
| 'object', | |||||
| class: LocationApi::class, | |||||
| ) | |||||
| ] | |||||
| )] | |||||
| public ?LocationApi $endLocation = null; | |||||
| #[Assert\NotBlank] | |||||
| public \DateTimeImmutable $startDate; | |||||
| #[Assert\NotBlank] | |||||
| public \DateTimeImmutable $endDate; | |||||
| #[ApiProperty(writable: false)] | |||||
| public ?\DateTimeImmutable $createdAt = null; | |||||
| } | |||||
| @@ -0,0 +1,116 @@ | |||||
| <?php | |||||
| declare(strict_types=1); | |||||
| namespace App\Command\Import; | |||||
| use App\Entity\Event; | |||||
| use Doctrine\ORM\EntityManagerInterface; | |||||
| use Symfony\Component\Console\Attribute\AsCommand; | |||||
| use Symfony\Component\Console\Command\Command; | |||||
| use Symfony\Component\Console\Input\InputInterface; | |||||
| use Symfony\Component\Console\Output\OutputInterface; | |||||
| #[AsCommand( | |||||
| name: 'app:create-events', | |||||
| description: 'Creates events' | |||||
| )] | |||||
| class CreateEventsCommand extends Command | |||||
| { | |||||
| public function __construct( | |||||
| private readonly EntityManagerInterface $entityManager | |||||
| ) { | |||||
| parent::__construct(); | |||||
| } | |||||
| protected function execute(InputInterface $input, OutputInterface $output): int | |||||
| { | |||||
| $event = new Event(); | |||||
| $event->setName('EEZ In'); | |||||
| $event->setIdentifier('eez'); | |||||
| $event->setSequence(1); | |||||
| $this->entityManager->persist($event); | |||||
| $event = new Event(); | |||||
| $event->setName('EEZ Out'); | |||||
| $event->setIdentifier('eez'); | |||||
| $event->setSequence(2); | |||||
| $this->entityManager->persist($event); | |||||
| $event = new Event(); | |||||
| $event->setName('Watch Start'); | |||||
| $event->setIdentifier('watch'); | |||||
| $event->setSequence(1); | |||||
| $this->entityManager->persist($event); | |||||
| $event = new Event(); | |||||
| $event->setName('Watch Stop'); | |||||
| $event->setIdentifier('watch'); | |||||
| $event->setSequence(2); | |||||
| $this->entityManager->persist($event); | |||||
| $event = new Event(); | |||||
| $event->setName('3nm In'); | |||||
| $event->setIdentifier('3nm'); | |||||
| $event->setSequence(1); | |||||
| $this->entityManager->persist($event); | |||||
| $event = new Event(); | |||||
| $event->setName('3nm Out'); | |||||
| $event->setIdentifier('3nm'); | |||||
| $event->setSequence(2); | |||||
| $this->entityManager->persist($event); | |||||
| $event = new Event(); | |||||
| $event->setName('Arrival to port'); | |||||
| $event->setIdentifier('port'); | |||||
| $event->setSequence(1); | |||||
| $this->entityManager->persist($event); | |||||
| $event = new Event(); | |||||
| $event->setName('Departure from port'); | |||||
| $event->setIdentifier('port'); | |||||
| $event->setSequence(2); | |||||
| $this->entityManager->persist($event); | |||||
| $event = new Event(); | |||||
| $event->setName('Anchor Start'); | |||||
| $event->setIdentifier('anchor'); | |||||
| $event->setSequence(1); | |||||
| $this->entityManager->persist($event); | |||||
| $event = new Event(); | |||||
| $event->setName('Anchor Stop'); | |||||
| $event->setIdentifier('anchor'); | |||||
| $event->setSequence(2); | |||||
| $this->entityManager->persist($event); | |||||
| $event = new Event(); | |||||
| $event->setName('Drifting Start'); | |||||
| $event->setIdentifier('drifting'); | |||||
| $event->setSequence(1); | |||||
| $this->entityManager->persist($event); | |||||
| $event = new Event(); | |||||
| $event->setName('Drifting Stop'); | |||||
| $event->setIdentifier('drifting'); | |||||
| $event->setSequence(2); | |||||
| $this->entityManager->persist($event); | |||||
| $event = new Event(); | |||||
| $event->setName('Port canceled'); | |||||
| $event->setIdentifier('port_canceled'); | |||||
| $event->setSequence(1); | |||||
| $this->entityManager->persist($event); | |||||
| $event = new Event(); | |||||
| $event->setName('Port amended'); | |||||
| $event->setIdentifier('port_amended'); | |||||
| $event->setSequence(1); | |||||
| $this->entityManager->persist($event); | |||||
| $this->entityManager->flush(); | |||||
| return Command::SUCCESS; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,89 @@ | |||||
| <?php | |||||
| declare(strict_types=1); | |||||
| namespace App\Entity; | |||||
| use DateTimeImmutable; | |||||
| use Doctrine\ORM\Mapping as ORM; | |||||
| #[ORM\Entity] | |||||
| #[ORM\Table(name: 'event')] | |||||
| class Event | |||||
| { | |||||
| #[ORM\Id] | |||||
| #[ORM\GeneratedValue] | |||||
| #[ORM\Column] | |||||
| private ?int $id = null; | |||||
| #[ORM\Column(length: 255, unique: true)] | |||||
| private string $name; | |||||
| #[ORM\Column(length: 255)] | |||||
| private string $identifier; | |||||
| #[ORM\Column(type: 'integer', options: ["unsigned" => true])] | |||||
| private ?int $sequence = null; | |||||
| #[ORM\Column(nullable: false)] | |||||
| private bool $mandatory = true; | |||||
| #[ORM\Column] | |||||
| private DateTimeImmutable $createdAt; | |||||
| public function __construct() | |||||
| { | |||||
| $this->createdAt = new DateTimeImmutable(); | |||||
| } | |||||
| public function getId(): ?int | |||||
| { | |||||
| return $this->id; | |||||
| } | |||||
| public function getName(): string | |||||
| { | |||||
| return $this->name; | |||||
| } | |||||
| public function setName(string $name): void | |||||
| { | |||||
| $this->name = $name; | |||||
| } | |||||
| public function getIdentifier(): string | |||||
| { | |||||
| return $this->identifier; | |||||
| } | |||||
| public function setIdentifier(string $identifier): void | |||||
| { | |||||
| $this->identifier = $identifier; | |||||
| } | |||||
| public function getSequence(): ?int | |||||
| { | |||||
| return $this->sequence; | |||||
| } | |||||
| public function setSequence(?int $sequence): void | |||||
| { | |||||
| $this->sequence = $sequence; | |||||
| } | |||||
| public function isMandatory(): bool | |||||
| { | |||||
| return $this->mandatory; | |||||
| } | |||||
| public function setMandatory(bool $mandatory): void | |||||
| { | |||||
| $this->mandatory = $mandatory; | |||||
| } | |||||
| public function getCreatedAt(): DateTimeImmutable | |||||
| { | |||||
| return $this->createdAt; | |||||
| } | |||||
| } | |||||
| @@ -28,21 +28,21 @@ class Location | |||||
| #[ORM\Column(length: 255)] | #[ORM\Column(length: 255)] | ||||
| private string $name; | private string $name; | ||||
| #[ORM\Column(nullable: false)] | |||||
| private bool $isZone = false; | |||||
| #[ORM\Column(nullable: false)] | |||||
| private bool $isPlace = false; | |||||
| #[ORM\Column(nullable: false)] | |||||
| private bool $isPort = false; | |||||
| #[ORM\Column] | #[ORM\Column] | ||||
| private DateTimeImmutable $createdAt; | private DateTimeImmutable $createdAt; | ||||
| #[ORM\OneToMany(targetEntity: TripLocation::class, mappedBy: 'location')] | #[ORM\OneToMany(targetEntity: TripLocation::class, mappedBy: 'location')] | ||||
| private Collection $tripLocations; | private Collection $tripLocations; | ||||
| #[ORM\OneToMany(targetEntity: UserTripLocation::class, mappedBy: 'location')] | |||||
| private Collection $userTripLocations; | |||||
| #[ORM\OneToMany(targetEntity: UserTripWorkLog::class, mappedBy: 'startLocation')] | |||||
| private Collection $startWorkLogs; | |||||
| #[ORM\OneToMany(targetEntity: UserTripWorkLog::class, mappedBy: 'endLocation')] | |||||
| private Collection $endWorkLogs; | |||||
| public function __construct(Zone $zone, string $name, string $code) | public function __construct(Zone $zone, string $name, string $code) | ||||
| { | { | ||||
| $this->zone = $zone; | $this->zone = $zone; | ||||
| @@ -50,9 +50,6 @@ class Location | |||||
| $this->code = $code; | $this->code = $code; | ||||
| $this->createdAt = new DateTimeImmutable(); | $this->createdAt = new DateTimeImmutable(); | ||||
| $this->tripLocations = new ArrayCollection(); | $this->tripLocations = new ArrayCollection(); | ||||
| $this->userTripLocations = new ArrayCollection(); | |||||
| $this->startWorkLogs = new ArrayCollection(); | |||||
| $this->endWorkLogs = new ArrayCollection(); | |||||
| } | } | ||||
| public function getId(): ?int | public function getId(): ?int | ||||
| @@ -92,29 +89,43 @@ class Location | |||||
| $this->code = $code; | $this->code = $code; | ||||
| } | } | ||||
| public function getCreatedAt(): DateTimeImmutable | |||||
| public function isZone(): bool | |||||
| { | { | ||||
| return $this->createdAt; | |||||
| return $this->isZone; | |||||
| } | } | ||||
| public function getTripLocations(): Collection | |||||
| public function setIsZone(bool $isZone): void | |||||
| { | { | ||||
| return $this->tripLocations; | |||||
| $this->isZone = $isZone; | |||||
| } | |||||
| public function isPlace(): bool | |||||
| { | |||||
| return $this->isPlace; | |||||
| } | } | ||||
| public function getUserTripLocations(): Collection | |||||
| public function setIsPlace(bool $isPlace): void | |||||
| { | { | ||||
| return $this->userTripLocations; | |||||
| $this->isPlace = $isPlace; | |||||
| } | } | ||||
| public function getStartWorkLogs(): Collection | |||||
| public function isPort(): bool | |||||
| { | { | ||||
| return $this->startWorkLogs; | |||||
| return $this->isPort; | |||||
| } | } | ||||
| public function getEndWorkLogs(): Collection | |||||
| public function setIsPort(bool $isPort): void | |||||
| { | { | ||||
| return $this->endWorkLogs; | |||||
| $this->isPort = $isPort; | |||||
| } | } | ||||
| public function getCreatedAt(): DateTimeImmutable | |||||
| { | |||||
| return $this->createdAt; | |||||
| } | |||||
| public function getTripLocations(): Collection | |||||
| { | |||||
| return $this->tripLocations; | |||||
| } | |||||
| } | } | ||||
| @@ -22,8 +22,8 @@ class Trip | |||||
| #[ORM\JoinColumn(nullable: false)] | #[ORM\JoinColumn(nullable: false)] | ||||
| private Vessel $vessel; | private Vessel $vessel; | ||||
| #[ORM\Column(length: 255)] | |||||
| private string $pilotReference; | |||||
| #[ORM\Column(length: 255, nullable: true)] | |||||
| private ?string $customerReference = null; | |||||
| #[ORM\Column(length: 255, nullable: true)] | #[ORM\Column(length: 255, nullable: true)] | ||||
| private ?string $captainName = null; | private ?string $captainName = null; | ||||
| @@ -42,6 +42,9 @@ class Trip | |||||
| #[ORM\Column] | #[ORM\Column] | ||||
| private DateTimeImmutable $endDate; | private DateTimeImmutable $endDate; | ||||
| #[ORM\Column(type: "text", nullable: true)] | |||||
| protected ?string $note; | |||||
| #[ORM\Column] | #[ORM\Column] | ||||
| private DateTimeImmutable $createdAt; | private DateTimeImmutable $createdAt; | ||||
| @@ -53,14 +56,12 @@ class Trip | |||||
| public function __construct( | public function __construct( | ||||
| Vessel $vessel, | Vessel $vessel, | ||||
| string $pilotageReference, | |||||
| Location $startLocation, | Location $startLocation, | ||||
| Location $endLocation, | Location $endLocation, | ||||
| DateTimeImmutable $startDate, | DateTimeImmutable $startDate, | ||||
| DateTimeImmutable $endDate | DateTimeImmutable $endDate | ||||
| ) { | ) { | ||||
| $this->vessel = $vessel; | $this->vessel = $vessel; | ||||
| $this->pilotReference = $pilotageReference; | |||||
| $this->startLocation = $startLocation; | $this->startLocation = $startLocation; | ||||
| $this->endLocation = $endLocation; | $this->endLocation = $endLocation; | ||||
| $this->startDate = $startDate; | $this->startDate = $startDate; | ||||
| @@ -86,15 +87,14 @@ class Trip | |||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getPilotReference(): string | |||||
| public function getCustomerReference(): ?string | |||||
| { | { | ||||
| return $this->pilotReference; | |||||
| return $this->customerReference; | |||||
| } | } | ||||
| public function setPilotReference(string $pilotReference): self | |||||
| public function setCustomerReference(?string $customerReference): void | |||||
| { | { | ||||
| $this->pilotReference = $pilotReference; | |||||
| return $this; | |||||
| $this->customerReference = $customerReference; | |||||
| } | } | ||||
| public function getCaptainName(): ?string | public function getCaptainName(): ?string | ||||
| @@ -152,6 +152,16 @@ class Trip | |||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getNote(): ?string | |||||
| { | |||||
| return $this->note; | |||||
| } | |||||
| public function setNote(?string $note): void | |||||
| { | |||||
| $this->note = $note; | |||||
| } | |||||
| public function getCreatedAt(): DateTimeImmutable | public function getCreatedAt(): DateTimeImmutable | ||||
| { | { | ||||
| return $this->createdAt; | return $this->createdAt; | ||||
| @@ -24,6 +24,9 @@ class TripLocation | |||||
| #[ORM\JoinColumn(nullable: false)] | #[ORM\JoinColumn(nullable: false)] | ||||
| private Location $location; | private Location $location; | ||||
| #[ORM\Column(nullable: false)] | |||||
| private bool $isArrival = true; | |||||
| #[ORM\Column] | #[ORM\Column] | ||||
| private DateTimeImmutable $date; | private DateTimeImmutable $date; | ||||
| @@ -76,6 +79,16 @@ class TripLocation | |||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function isArrival(): bool | |||||
| { | |||||
| return $this->isArrival; | |||||
| } | |||||
| public function setIsArrival(bool $isArrival): void | |||||
| { | |||||
| $this->isArrival = $isArrival; | |||||
| } | |||||
| public function getCreatedAt(): DateTimeImmutable | public function getCreatedAt(): DateTimeImmutable | ||||
| { | { | ||||
| return $this->createdAt; | return $this->createdAt; | ||||
| @@ -22,6 +22,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface | |||||
| #[ORM\Column(length: 180, unique: true)] | #[ORM\Column(length: 180, unique: true)] | ||||
| private ?string $email = null; | private ?string $email = null; | ||||
| #[ORM\Column(length: 255)] | |||||
| private ?string $referenceId = null; | |||||
| #[ORM\Column(length: 255)] | #[ORM\Column(length: 255)] | ||||
| private ?string $firstName = null; | private ?string $firstName = null; | ||||
| @@ -70,6 +73,16 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface | |||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getReferenceId(): ?string | |||||
| { | |||||
| return $this->referenceId; | |||||
| } | |||||
| public function setReferenceId(?string $referenceId): void | |||||
| { | |||||
| $this->referenceId = $referenceId; | |||||
| } | |||||
| /** | /** | ||||
| * A visual identifier that represents this user. | * A visual identifier that represents this user. | ||||
| * | * | ||||
| @@ -38,11 +38,8 @@ class UserTrip | |||||
| #[ORM\Column] | #[ORM\Column] | ||||
| private DateTimeImmutable $createdAt; | private DateTimeImmutable $createdAt; | ||||
| #[ORM\OneToMany(targetEntity: UserTripLocation::class, mappedBy: 'userTrip')] | |||||
| private Collection $tripLocations; | |||||
| #[ORM\OneToMany(targetEntity: UserTripWorkLog::class, mappedBy: 'userTrip')] | |||||
| private Collection $workLogs; | |||||
| #[ORM\OneToMany(targetEntity: UserTripEvent::class, mappedBy: 'userTrip')] | |||||
| private Collection $userTripEvents; | |||||
| public function __construct( | public function __construct( | ||||
| Trip $trip, | Trip $trip, | ||||
| @@ -57,8 +54,7 @@ class UserTrip | |||||
| $this->startDate = $startDate; | $this->startDate = $startDate; | ||||
| $this->endDate = $endDate; | $this->endDate = $endDate; | ||||
| $this->createdAt = new DateTimeImmutable(); | $this->createdAt = new DateTimeImmutable(); | ||||
| $this->tripLocations = new ArrayCollection(); | |||||
| $this->workLogs = new ArrayCollection(); | |||||
| $this->userTripEvents = new ArrayCollection(); | |||||
| } | } | ||||
| public function getId(): ?int | public function getId(): ?int | ||||
| @@ -121,56 +117,13 @@ class UserTrip | |||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getCreatedAt(): DateTimeImmutable | |||||
| { | |||||
| return $this->createdAt; | |||||
| } | |||||
| public function getTripLocations(): Collection | |||||
| { | |||||
| return $this->tripLocations; | |||||
| } | |||||
| public function addTripLocation(UserTripLocation $tripLocation): self | |||||
| { | |||||
| if (!$this->tripLocations->contains($tripLocation)) { | |||||
| $this->tripLocations->add($tripLocation); | |||||
| $tripLocation->setUserTrip($this); | |||||
| } | |||||
| return $this; | |||||
| } | |||||
| public function removeTripLocation(UserTripLocation $tripLocation): self | |||||
| { | |||||
| if ($this->tripLocations->removeElement($tripLocation)) { | |||||
| if ($tripLocation->getUserTrip() === $this) { | |||||
| $tripLocation->setUserTrip(null); | |||||
| } | |||||
| } | |||||
| return $this; | |||||
| } | |||||
| public function getWorkLogs(): Collection | |||||
| { | |||||
| return $this->workLogs; | |||||
| } | |||||
| public function addWorkLog(UserTripWorkLog $workLog): self | |||||
| public function getUserTripEvents(): Collection | |||||
| { | { | ||||
| if (!$this->workLogs->contains($workLog)) { | |||||
| $this->workLogs->add($workLog); | |||||
| $workLog->setUserTrip($this); | |||||
| } | |||||
| return $this; | |||||
| return $this->userTripEvents; | |||||
| } | } | ||||
| public function removeWorkLog(UserTripWorkLog $workLog): self | |||||
| public function getCreatedAt(): DateTimeImmutable | |||||
| { | { | ||||
| if ($this->workLogs->removeElement($workLog)) { | |||||
| if ($workLog->getUserTrip() === $this) { | |||||
| $workLog->setUserTrip(null); | |||||
| } | |||||
| } | |||||
| return $this; | |||||
| return $this->createdAt; | |||||
| } | } | ||||
| } | } | ||||
| @@ -0,0 +1,96 @@ | |||||
| <?php | |||||
| declare(strict_types=1); | |||||
| namespace App\Entity; | |||||
| use DateTimeImmutable; | |||||
| use Doctrine\ORM\Mapping as ORM; | |||||
| #[ORM\Entity] | |||||
| #[ORM\Table(name: 'user_trip_event')] | |||||
| class UserTripEvent | |||||
| { | |||||
| #[ORM\Id] | |||||
| #[ORM\GeneratedValue] | |||||
| #[ORM\Column] | |||||
| private ?int $id = null; | |||||
| #[ORM\ManyToOne(targetEntity: UserTrip::class, inversedBy: 'userTripEvents')] | |||||
| #[ORM\JoinColumn(nullable: false)] | |||||
| private UserTrip $userTrip; | |||||
| #[ORM\ManyToOne(targetEntity: Event::class)] | |||||
| #[ORM\JoinColumn(nullable: false)] | |||||
| private Event $event; | |||||
| #[ORM\Column(nullable: false)] | |||||
| private DateTimeImmutable $date; | |||||
| #[ORM\Column(type: "text", nullable: true)] | |||||
| protected ?string $note; | |||||
| #[ORM\Column] | |||||
| private DateTimeImmutable $createdAt; | |||||
| public function __construct( | |||||
| UserTrip $userTrip, | |||||
| Event $event, | |||||
| DateTimeImmutable $date | |||||
| ) { | |||||
| $this->userTrip = $userTrip; | |||||
| $this->event = $event; | |||||
| $this->date = $date; | |||||
| $this->createdAt = new DateTimeImmutable(); | |||||
| } | |||||
| public function getId(): ?int | |||||
| { | |||||
| return $this->id; | |||||
| } | |||||
| public function getUserTrip(): UserTrip | |||||
| { | |||||
| return $this->userTrip; | |||||
| } | |||||
| public function setUserTrip(UserTrip $userTrip): void | |||||
| { | |||||
| $this->userTrip = $userTrip; | |||||
| } | |||||
| public function getEvent(): Event | |||||
| { | |||||
| return $this->event; | |||||
| } | |||||
| public function setEvent(Event $event): void | |||||
| { | |||||
| $this->event = $event; | |||||
| } | |||||
| public function getDate(): DateTimeImmutable | |||||
| { | |||||
| return $this->date; | |||||
| } | |||||
| public function setDate(DateTimeImmutable $date): void | |||||
| { | |||||
| $this->date = $date; | |||||
| } | |||||
| public function getNote(): ?string | |||||
| { | |||||
| return $this->note; | |||||
| } | |||||
| public function setNote(?string $note): void | |||||
| { | |||||
| $this->note = $note; | |||||
| } | |||||
| public function getCreatedAt(): DateTimeImmutable | |||||
| { | |||||
| return $this->createdAt; | |||||
| } | |||||
| } | |||||
| @@ -1,83 +0,0 @@ | |||||
| <?php | |||||
| declare(strict_types=1); | |||||
| namespace App\Entity; | |||||
| use DateTimeImmutable; | |||||
| use Doctrine\ORM\Mapping as ORM; | |||||
| #[ORM\Entity] | |||||
| #[ORM\Table(name: 'user_trip_location')] | |||||
| class UserTripLocation | |||||
| { | |||||
| #[ORM\Id] | |||||
| #[ORM\GeneratedValue] | |||||
| #[ORM\Column] | |||||
| private ?int $id = null; | |||||
| #[ORM\ManyToOne(targetEntity: UserTrip::class, inversedBy: 'tripLocations')] | |||||
| #[ORM\JoinColumn(nullable: false)] | |||||
| private UserTrip $userTrip; | |||||
| #[ORM\ManyToOne(targetEntity: Location::class, inversedBy: 'userTripLocations')] | |||||
| #[ORM\JoinColumn(nullable: false)] | |||||
| private Location $location; | |||||
| #[ORM\Column] | |||||
| private DateTimeImmutable $plannedDate; | |||||
| #[ORM\Column] | |||||
| private DateTimeImmutable $createdAt; | |||||
| public function __construct(UserTrip $userTrip, Location $location, DateTimeImmutable $plannedDate) | |||||
| { | |||||
| $this->userTrip = $userTrip; | |||||
| $this->location = $location; | |||||
| $this->plannedDate = $plannedDate; | |||||
| $this->createdAt = new DateTimeImmutable(); | |||||
| } | |||||
| public function getId(): ?int | |||||
| { | |||||
| return $this->id; | |||||
| } | |||||
| public function getUserTrip(): UserTrip | |||||
| { | |||||
| return $this->userTrip; | |||||
| } | |||||
| public function setUserTrip(UserTrip $userTrip): self | |||||
| { | |||||
| $this->userTrip = $userTrip; | |||||
| return $this; | |||||
| } | |||||
| public function getLocation(): Location | |||||
| { | |||||
| return $this->location; | |||||
| } | |||||
| public function setLocation(Location $location): self | |||||
| { | |||||
| $this->location = $location; | |||||
| return $this; | |||||
| } | |||||
| public function getPlannedDate(): DateTimeImmutable | |||||
| { | |||||
| return $this->plannedDate; | |||||
| } | |||||
| public function setPlannedDate(DateTimeImmutable $plannedDate): self | |||||
| { | |||||
| $this->plannedDate = $plannedDate; | |||||
| return $this; | |||||
| } | |||||
| public function getCreatedAt(): DateTimeImmutable | |||||
| { | |||||
| return $this->createdAt; | |||||
| } | |||||
| } | |||||
| @@ -1,119 +0,0 @@ | |||||
| <?php | |||||
| declare(strict_types=1); | |||||
| namespace App\Entity; | |||||
| use DateTimeImmutable; | |||||
| use Doctrine\ORM\Mapping as ORM; | |||||
| #[ORM\Entity] | |||||
| #[ORM\Table(name: 'user_trip_work_log')] | |||||
| class UserTripWorkLog | |||||
| { | |||||
| #[ORM\Id] | |||||
| #[ORM\GeneratedValue] | |||||
| #[ORM\Column] | |||||
| private ?int $id = null; | |||||
| #[ORM\ManyToOne(targetEntity: UserTrip::class, inversedBy: 'workLogs')] | |||||
| #[ORM\JoinColumn(nullable: false)] | |||||
| private UserTrip $userTrip; | |||||
| #[ORM\ManyToOne(targetEntity: Location::class, inversedBy: 'startWorkLogs')] | |||||
| #[ORM\JoinColumn(name: 'start_location_id', nullable: false)] | |||||
| private Location $startLocation; | |||||
| #[ORM\ManyToOne(targetEntity: Location::class, inversedBy: 'endWorkLogs')] | |||||
| #[ORM\JoinColumn(name: 'end_location_id', nullable: false)] | |||||
| private Location $endLocation; | |||||
| #[ORM\Column] | |||||
| private DateTimeImmutable $startDate; | |||||
| #[ORM\Column] | |||||
| private DateTimeImmutable $endDate; | |||||
| #[ORM\Column] | |||||
| private DateTimeImmutable $createdAt; | |||||
| public function __construct( | |||||
| UserTrip $userTrip, | |||||
| Location $startLocation, | |||||
| Location $endLocation, | |||||
| DateTimeImmutable $startDate, | |||||
| DateTimeImmutable $endDate | |||||
| ) { | |||||
| $this->userTrip = $userTrip; | |||||
| $this->startLocation = $startLocation; | |||||
| $this->endLocation = $endLocation; | |||||
| $this->startDate = $startDate; | |||||
| $this->endDate = $endDate; | |||||
| $this->createdAt = new DateTimeImmutable(); | |||||
| } | |||||
| public function getId(): ?int | |||||
| { | |||||
| return $this->id; | |||||
| } | |||||
| public function getUserTrip(): UserTrip | |||||
| { | |||||
| return $this->userTrip; | |||||
| } | |||||
| public function setUserTrip(UserTrip $userTrip): self | |||||
| { | |||||
| $this->userTrip = $userTrip; | |||||
| return $this; | |||||
| } | |||||
| public function getStartLocation(): Location | |||||
| { | |||||
| return $this->startLocation; | |||||
| } | |||||
| public function setStartLocation(Location $startLocation): self | |||||
| { | |||||
| $this->startLocation = $startLocation; | |||||
| return $this; | |||||
| } | |||||
| public function getEndLocation(): Location | |||||
| { | |||||
| return $this->endLocation; | |||||
| } | |||||
| public function setEndLocation(Location $endLocation): self | |||||
| { | |||||
| $this->endLocation = $endLocation; | |||||
| return $this; | |||||
| } | |||||
| public function getStartDate(): DateTimeImmutable | |||||
| { | |||||
| return $this->startDate; | |||||
| } | |||||
| public function setStartDate(DateTimeImmutable $startDate): self | |||||
| { | |||||
| $this->startDate = $startDate; | |||||
| return $this; | |||||
| } | |||||
| public function getEndDate(): DateTimeImmutable | |||||
| { | |||||
| return $this->endDate; | |||||
| } | |||||
| public function setEndDate(DateTimeImmutable $endDate): self | |||||
| { | |||||
| $this->endDate = $endDate; | |||||
| return $this; | |||||
| } | |||||
| public function getCreatedAt(): DateTimeImmutable | |||||
| { | |||||
| return $this->createdAt; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,41 @@ | |||||
| <?php | |||||
| namespace App\Mapper; | |||||
| use App\ApiResource\EventApi; | |||||
| use App\ApiResource\ZoneApi; | |||||
| use App\Entity\Event; | |||||
| use Symfonycasts\MicroMapper\AsMapper; | |||||
| use Symfonycasts\MicroMapper\MapperInterface; | |||||
| #[AsMapper(from: Event::class, to: EventApi::class)] | |||||
| class EventEntityToApiMapper implements MapperInterface | |||||
| { | |||||
| public function load(object $from, string $toClass, array $context): object | |||||
| { | |||||
| $entity = $from; | |||||
| assert($entity instanceof Event); | |||||
| $dto = new EventApi(); | |||||
| $dto->id = $entity->getId(); | |||||
| return $dto; | |||||
| } | |||||
| public function populate(object $from, object $to, array $context): object | |||||
| { | |||||
| $entity = $from; | |||||
| $dto = $to; | |||||
| assert($entity instanceof Event); | |||||
| assert($dto instanceof EventApi); | |||||
| $dto->dbId = $entity->getId(); | |||||
| $dto->name = $entity->getName(); | |||||
| $dto->identifier = $entity->getIdentifier(); | |||||
| $dto->sequence = $entity->getSequence(); | |||||
| $dto->mandatory = $entity->isMandatory(); | |||||
| $dto->createdAt = $entity->getCreatedAt(); | |||||
| return $dto; | |||||
| } | |||||
| } | |||||
| @@ -53,6 +53,9 @@ class LocationApiToEntityMapper implements MapperInterface | |||||
| $entity->setName($dto->name); | $entity->setName($dto->name); | ||||
| $entity->setCode($dto->code); | $entity->setCode($dto->code); | ||||
| $entity->setIsZone($dto->isZone); | |||||
| $entity->setIsPlace($dto->isPlace); | |||||
| $entity->setIsPort($dto->isPort); | |||||
| if ($dto->zone) { | if ($dto->zone) { | ||||
| $zone = $this->zoneRepository->find($dto->zone->id); | $zone = $this->zoneRepository->find($dto->zone->id); | ||||
| @@ -38,6 +38,9 @@ class LocationEntityToApiMapper implements MapperInterface | |||||
| $dto->dbId = $entity->getId(); | $dto->dbId = $entity->getId(); | ||||
| $dto->name = $entity->getName(); | $dto->name = $entity->getName(); | ||||
| $dto->code = $entity->getCode(); | $dto->code = $entity->getCode(); | ||||
| $dto->isZone = $entity->isZone(); | |||||
| $dto->isPlace = $entity->isPlace(); | |||||
| $dto->isPort = $entity->isPort(); | |||||
| $dto->createdAt = $entity->getCreatedAt(); | $dto->createdAt = $entity->getCreatedAt(); | ||||
| $dto->zone = $this->microMapper->map($entity->getZone(), ZoneApi::class, [ | $dto->zone = $this->microMapper->map($entity->getZone(), ZoneApi::class, [ | ||||