feat: work shifts by QR codes
This commit is contained in:
130
src/client/services/WorkShiftsService.ts
Normal file
130
src/client/services/WorkShiftsService.ts
Normal file
@@ -0,0 +1,130 @@
|
||||
/* generated using openapi-typescript-codegen -- do not edit */
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { ActiveWorkShiftsResponse } from '../models/ActiveWorkShiftsResponse';
|
||||
import type { DeleteShiftResponse } from '../models/DeleteShiftResponse';
|
||||
import type { FinishShiftByIdResponse } from '../models/FinishShiftByIdResponse';
|
||||
import type { FinishShiftResponse } from '../models/FinishShiftResponse';
|
||||
import type { StartShiftResponse } from '../models/StartShiftResponse';
|
||||
import type { CancelablePromise } from '../core/CancelablePromise';
|
||||
import { OpenAPI } from '../core/OpenAPI';
|
||||
import { request as __request } from '../core/request';
|
||||
export class WorkShiftsService {
|
||||
/**
|
||||
* Generate Qr Code
|
||||
* @returns any Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static generateQrCode({
|
||||
userId,
|
||||
}: {
|
||||
userId: number,
|
||||
}): CancelablePromise<any> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/work-shifts/generate-qr-code/{user_id}',
|
||||
path: {
|
||||
'user_id': userId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Start Shift
|
||||
* @returns StartShiftResponse Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static startShift({
|
||||
userId,
|
||||
}: {
|
||||
userId: number,
|
||||
}): CancelablePromise<StartShiftResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/work-shifts/start-shift/{user_id}',
|
||||
path: {
|
||||
'user_id': userId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Finish Shift
|
||||
* @returns FinishShiftResponse Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static finishShift({
|
||||
userId,
|
||||
}: {
|
||||
userId: number,
|
||||
}): CancelablePromise<FinishShiftResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/work-shifts/finish-shift/{user_id}',
|
||||
path: {
|
||||
'user_id': userId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Finish Work Shift By Id
|
||||
* @returns FinishShiftByIdResponse Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static finishWorkShiftById({
|
||||
shiftId,
|
||||
}: {
|
||||
shiftId: number,
|
||||
}): CancelablePromise<FinishShiftByIdResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'POST',
|
||||
url: '/work-shifts/finish-shift-by-id/{shift_id}',
|
||||
path: {
|
||||
'shift_id': shiftId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get Active Shifts
|
||||
* @returns ActiveWorkShiftsResponse Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static getActiveShifts(): CancelablePromise<ActiveWorkShiftsResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'GET',
|
||||
url: '/work-shifts/get-active-shifts',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Delete Work Shift
|
||||
* @returns DeleteShiftResponse Successful Response
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static deleteWorkShift({
|
||||
shiftId,
|
||||
}: {
|
||||
shiftId: number,
|
||||
}): CancelablePromise<DeleteShiftResponse> {
|
||||
return __request(OpenAPI, {
|
||||
method: 'DELETE',
|
||||
url: '/work-shifts/delete-shift/{shift_id}',
|
||||
path: {
|
||||
'shift_id': shiftId,
|
||||
},
|
||||
errors: {
|
||||
422: `Validation Error`,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user