feat: work shifts history

This commit is contained in:
2024-11-28 18:01:47 +04:00
parent f41083d2a8
commit 900427275f
14 changed files with 434 additions and 248 deletions

View File

@@ -7,8 +7,6 @@ export { CancelablePromise, CancelError } from './core/CancelablePromise';
export { OpenAPI } from './core/OpenAPI';
export type { OpenAPIConfig } from './core/OpenAPI';
export type { ActiveWorkShiftSchema } from './models/ActiveWorkShiftSchema';
export type { ActiveWorkShiftsResponse } from './models/ActiveWorkShiftsResponse';
export type { AuthLoginRequest } from './models/AuthLoginRequest';
export type { AuthLoginResponse } from './models/AuthLoginResponse';
export type { BarcodeAttributeSchema } from './models/BarcodeAttributeSchema';
@@ -187,6 +185,7 @@ export type { GetProfitTableDataResponse } from './models/GetProfitTableDataResp
export type { GetServiceKitSchema } from './models/GetServiceKitSchema';
export type { GetTimeTrackingRecordsRequest } from './models/GetTimeTrackingRecordsRequest';
export type { GetTimeTrackingRecordsResponse } from './models/GetTimeTrackingRecordsResponse';
export type { GetWorkShiftsResponse } from './models/GetWorkShiftsResponse';
export type { GroupBillRequestSchema } from './models/GroupBillRequestSchema';
export type { HTTPValidationError } from './models/HTTPValidationError';
export type { MarketplaceCreateSchema } from './models/MarketplaceCreateSchema';
@@ -275,6 +274,7 @@ export type { UserCreate } from './models/UserCreate';
export type { UserSchema } from './models/UserSchema';
export type { UserUpdate } from './models/UserUpdate';
export type { ValidationError } from './models/ValidationError';
export type { WorkShiftSchema } from './models/WorkShiftSchema';
export { AuthService } from './services/AuthService';
export { BarcodeService } from './services/BarcodeService';

View File

@@ -1,9 +0,0 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { ActiveWorkShiftSchema } from './ActiveWorkShiftSchema';
export type ActiveWorkShiftsResponse = {
shifts: Array<ActiveWorkShiftSchema>;
};

View File

@@ -0,0 +1,11 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { PaginationInfoSchema } from './PaginationInfoSchema';
import type { WorkShiftSchema } from './WorkShiftSchema';
export type GetWorkShiftsResponse = {
shifts: Array<WorkShiftSchema>;
paginationInfo: PaginationInfoSchema;
};

View File

@@ -3,9 +3,11 @@
/* tslint:disable */
/* eslint-disable */
import type { UserSchema } from './UserSchema';
export type ActiveWorkShiftSchema = {
export type WorkShiftSchema = {
id: number;
startedAt: string;
finishedAt?: (string | null);
hours?: (number | null);
user: UserSchema;
};

View File

@@ -2,10 +2,10 @@
/* 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 { GetWorkShiftsResponse } from '../models/GetWorkShiftsResponse';
import type { StartShiftResponse } from '../models/StartShiftResponse';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
@@ -96,14 +96,32 @@ export class WorkShiftsService {
});
}
/**
* Get Active Shifts
* @returns ActiveWorkShiftsResponse Successful Response
* Get Shifts
* @returns GetWorkShiftsResponse Successful Response
* @throws ApiError
*/
public static getActiveShifts(): CancelablePromise<ActiveWorkShiftsResponse> {
public static getShifts({
isActive,
page,
itemsPerPage,
}: {
isActive: boolean,
page?: (number | null),
itemsPerPage?: (number | null),
}): CancelablePromise<GetWorkShiftsResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/work-shifts/get-active-shifts',
url: '/work-shifts/get-shifts/{is_active}',
path: {
'is_active': isActive,
},
query: {
'page': page,
'items_per_page': itemsPerPage,
},
errors: {
422: `Validation Error`,
},
});
}
/**