feat: departments and department sections

This commit is contained in:
2024-12-17 12:43:33 +04:00
parent 43bba73f06
commit 31a959236c
40 changed files with 1220 additions and 11 deletions

View File

@@ -7,6 +7,8 @@ export { CancelablePromise, CancelError } from './core/CancelablePromise';
export { OpenAPI } from './core/OpenAPI';
export type { OpenAPIConfig } from './core/OpenAPI';
export type { AddUserRequest } from './models/AddUserRequest';
export type { AddUserResponse } from './models/AddUserResponse';
export type { AuthLoginRequest } from './models/AuthLoginRequest';
export type { AuthLoginResponse } from './models/AuthLoginResponse';
export type { BarcodeAttributeSchema } from './models/BarcodeAttributeSchema';
@@ -50,6 +52,10 @@ export type { CreateBoxInDealSchema } from './models/CreateBoxInDealSchema';
export type { CreateBoxInPalletSchema } from './models/CreateBoxInPalletSchema';
export type { CreateDealBillRequest } from './models/CreateDealBillRequest';
export type { CreateDealBillResponse } from './models/CreateDealBillResponse';
export type { CreateDepartmentRequest } from './models/CreateDepartmentRequest';
export type { CreateDepartmentResponse } from './models/CreateDepartmentResponse';
export type { CreateDepartmentSectionRequest } from './models/CreateDepartmentSectionRequest';
export type { CreateDepartmentSectionResponse } from './models/CreateDepartmentSectionResponse';
export type { CreateMarketplaceRequest } from './models/CreateMarketplaceRequest';
export type { CreateMarketplaceResponse } from './models/CreateMarketplaceResponse';
export type { CreatePalletResponse } from './models/CreatePalletResponse';
@@ -139,6 +145,8 @@ export type { DealUpdateServiceQuantityResponse } from './models/DealUpdateServi
export type { DealUpdateServiceRequest } from './models/DealUpdateServiceRequest';
export type { DealUpdateServiceResponse } from './models/DealUpdateServiceResponse';
export type { DeleteBoxResponse } from './models/DeleteBoxResponse';
export type { DeleteDepartmentResponse } from './models/DeleteDepartmentResponse';
export type { DeleteDepartmentSectionResponse } from './models/DeleteDepartmentSectionResponse';
export type { DeleteMarketplaceRequest } from './models/DeleteMarketplaceRequest';
export type { DeleteMarketplaceResponse } from './models/DeleteMarketplaceResponse';
export type { DeletePalletResponse } from './models/DeletePalletResponse';
@@ -156,6 +164,12 @@ export type { DeleteShippingWarehouseRequest } from './models/DeleteShippingWare
export type { DeleteShippingWarehouseResponse } from './models/DeleteShippingWarehouseResponse';
export type { DeleteTransactionResponse } from './models/DeleteTransactionResponse';
export type { DeleteTransactionTagResponse } from './models/DeleteTransactionTagResponse';
export type { DeleteUserRequest } from './models/DeleteUserRequest';
export type { DeleteUserResponse } from './models/DeleteUserResponse';
export type { DepartmentBaseSchema } from './models/DepartmentBaseSchema';
export type { DepartmentSchema } from './models/DepartmentSchema';
export type { DepartmentSectionBaseSchema } from './models/DepartmentSectionBaseSchema';
export type { DepartmentSectionSchema } from './models/DepartmentSectionSchema';
export type { FinishPauseByShiftIdResponse } from './models/FinishPauseByShiftIdResponse';
export type { FinishPauseByUserIdResponse } from './models/FinishPauseByUserIdResponse';
export type { FinishShiftByIdResponse } from './models/FinishShiftByIdResponse';
@@ -175,6 +189,7 @@ export type { GetAllTransactionsRequest } from './models/GetAllTransactionsReque
export type { GetAllTransactionsResponse } from './models/GetAllTransactionsResponse';
export type { GetAllTransactionTagsResponse } from './models/GetAllTransactionTagsResponse';
export type { GetAllUsersResponse } from './models/GetAllUsersResponse';
export type { GetAvailableUsersForDepartmentSectionResponse } from './models/GetAvailableUsersForDepartmentSectionResponse';
export type { GetBarcodeTemplateByIdRequest } from './models/GetBarcodeTemplateByIdRequest';
export type { GetBarcodeTemplateByIdResponse } from './models/GetBarcodeTemplateByIdResponse';
export type { GetClientMarketplacesRequest } from './models/GetClientMarketplacesRequest';
@@ -182,6 +197,7 @@ export type { GetClientMarketplacesResponse } from './models/GetClientMarketplac
export type { GetDealBillById } from './models/GetDealBillById';
export type { GetDealProductsBarcodesPdfRequest } from './models/GetDealProductsBarcodesPdfRequest';
export type { GetDealProductsBarcodesPdfResponse } from './models/GetDealProductsBarcodesPdfResponse';
export type { GetDepartmentsResponse } from './models/GetDepartmentsResponse';
export type { GetManagersResponse } from './models/GetManagersResponse';
export type { GetPaymentRecordsResponse } from './models/GetPaymentRecordsResponse';
export type { GetProductBarcodePdfRequest } from './models/GetProductBarcodePdfRequest';
@@ -271,6 +287,10 @@ export type { TransactionTagSchema } from './models/TransactionTagSchema';
export type { UpdateBoxRequest } from './models/UpdateBoxRequest';
export type { UpdateBoxResponse } from './models/UpdateBoxResponse';
export type { UpdateBoxSchema } from './models/UpdateBoxSchema';
export type { UpdateDepartmentRequest } from './models/UpdateDepartmentRequest';
export type { UpdateDepartmentResponse } from './models/UpdateDepartmentResponse';
export type { UpdateDepartmentSectionRequest } from './models/UpdateDepartmentSectionRequest';
export type { UpdateDepartmentSectionResponse } from './models/UpdateDepartmentSectionResponse';
export type { UpdateMarketplaceRequest } from './models/UpdateMarketplaceRequest';
export type { UpdateMarketplaceResponse } from './models/UpdateMarketplaceResponse';
export type { UpdatePayRateRequest } from './models/UpdatePayRateRequest';
@@ -307,6 +327,7 @@ export { BarcodeService } from './services/BarcodeService';
export { BillingService } from './services/BillingService';
export { ClientService } from './services/ClientService';
export { DealService } from './services/DealService';
export { DepartmentService } from './services/DepartmentService';
export { MarketplaceService } from './services/MarketplaceService';
export { PayrollService } from './services/PayrollService';
export { PositionService } from './services/PositionService';

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type AddUserRequest = {
userId: number;
sectionId: number;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type AddUserResponse = {
ok: boolean;
message: string;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { DepartmentBaseSchema } from './DepartmentBaseSchema';
export type CreateDepartmentRequest = {
department: DepartmentBaseSchema;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type CreateDepartmentResponse = {
ok: boolean;
message: string;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { DepartmentSectionBaseSchema } from './DepartmentSectionBaseSchema';
export type CreateDepartmentSectionRequest = {
section: DepartmentSectionBaseSchema;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type CreateDepartmentSectionResponse = {
ok: boolean;
message: string;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type DeleteDepartmentResponse = {
ok: boolean;
message: string;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type DeleteDepartmentSectionResponse = {
ok: boolean;
message: string;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type DeleteUserRequest = {
userId: number;
sectionId: number;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type DeleteUserResponse = {
ok: boolean;
message: string;
};

View File

@@ -0,0 +1,8 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type DepartmentBaseSchema = {
name: string;
};

View File

@@ -0,0 +1,11 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { DepartmentSectionSchema } from './DepartmentSectionSchema';
export type DepartmentSchema = {
name: string;
id: number;
sections?: Array<DepartmentSectionSchema>;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type DepartmentSectionBaseSchema = {
name: string;
departmentId: number;
};

View File

@@ -0,0 +1,12 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { UserSchema } from './UserSchema';
export type DepartmentSectionSchema = {
name: string;
departmentId: number;
id: number;
users?: Array<UserSchema>;
};

View File

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

View File

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

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { DepartmentSchema } from './DepartmentSchema';
export type UpdateDepartmentRequest = {
department: DepartmentSchema;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type UpdateDepartmentResponse = {
ok: boolean;
message: string;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { DepartmentSectionSchema } from './DepartmentSectionSchema';
export type UpdateDepartmentSectionRequest = {
section: DepartmentSectionSchema;
};

View File

@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type UpdateDepartmentSectionResponse = {
ok: boolean;
message: string;
};

View File

@@ -0,0 +1,219 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AddUserRequest } from '../models/AddUserRequest';
import type { AddUserResponse } from '../models/AddUserResponse';
import type { CreateDepartmentRequest } from '../models/CreateDepartmentRequest';
import type { CreateDepartmentResponse } from '../models/CreateDepartmentResponse';
import type { CreateDepartmentSectionRequest } from '../models/CreateDepartmentSectionRequest';
import type { CreateDepartmentSectionResponse } from '../models/CreateDepartmentSectionResponse';
import type { DeleteDepartmentResponse } from '../models/DeleteDepartmentResponse';
import type { DeleteDepartmentSectionResponse } from '../models/DeleteDepartmentSectionResponse';
import type { DeleteUserRequest } from '../models/DeleteUserRequest';
import type { DeleteUserResponse } from '../models/DeleteUserResponse';
import type { GetAvailableUsersForDepartmentSectionResponse } from '../models/GetAvailableUsersForDepartmentSectionResponse';
import type { GetDepartmentsResponse } from '../models/GetDepartmentsResponse';
import type { UpdateDepartmentRequest } from '../models/UpdateDepartmentRequest';
import type { UpdateDepartmentResponse } from '../models/UpdateDepartmentResponse';
import type { UpdateDepartmentSectionRequest } from '../models/UpdateDepartmentSectionRequest';
import type { UpdateDepartmentSectionResponse } from '../models/UpdateDepartmentSectionResponse';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class DepartmentService {
/**
* Get Departments
* @returns GetDepartmentsResponse Successful Response
* @throws ApiError
*/
public static getDepartments(): CancelablePromise<GetDepartmentsResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/department/',
});
}
/**
* Create Department
* @returns CreateDepartmentResponse Successful Response
* @throws ApiError
*/
public static createDepartment({
requestBody,
}: {
requestBody: CreateDepartmentRequest,
}): CancelablePromise<CreateDepartmentResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/department/',
body: requestBody,
mediaType: 'application/json',
errors: {
422: `Validation Error`,
},
});
}
/**
* Update Department
* @returns UpdateDepartmentResponse Successful Response
* @throws ApiError
*/
public static updateDepartment({
requestBody,
}: {
requestBody: UpdateDepartmentRequest,
}): CancelablePromise<UpdateDepartmentResponse> {
return __request(OpenAPI, {
method: 'PATCH',
url: '/department/',
body: requestBody,
mediaType: 'application/json',
errors: {
422: `Validation Error`,
},
});
}
/**
* Delete Department
* @returns DeleteDepartmentResponse Successful Response
* @throws ApiError
*/
public static deleteDepartment({
departmentId,
}: {
departmentId: number,
}): CancelablePromise<DeleteDepartmentResponse> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/department/{department_id}',
path: {
'department_id': departmentId,
},
errors: {
422: `Validation Error`,
},
});
}
/**
* Create Section
* @returns CreateDepartmentSectionResponse Successful Response
* @throws ApiError
*/
public static createSection({
requestBody,
}: {
requestBody: CreateDepartmentSectionRequest,
}): CancelablePromise<CreateDepartmentSectionResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/department/section',
body: requestBody,
mediaType: 'application/json',
errors: {
422: `Validation Error`,
},
});
}
/**
* Update Section
* @returns UpdateDepartmentSectionResponse Successful Response
* @throws ApiError
*/
public static updateSection({
requestBody,
}: {
requestBody: UpdateDepartmentSectionRequest,
}): CancelablePromise<UpdateDepartmentSectionResponse> {
return __request(OpenAPI, {
method: 'PATCH',
url: '/department/section',
body: requestBody,
mediaType: 'application/json',
errors: {
422: `Validation Error`,
},
});
}
/**
* Delete Section
* @returns DeleteDepartmentSectionResponse Successful Response
* @throws ApiError
*/
public static deleteSection({
sectionId,
}: {
sectionId: number,
}): CancelablePromise<DeleteDepartmentSectionResponse> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/department/section/{section_id}',
path: {
'section_id': sectionId,
},
errors: {
422: `Validation Error`,
},
});
}
/**
* Get Available Users For Department Section
* @returns GetAvailableUsersForDepartmentSectionResponse Successful Response
* @throws ApiError
*/
public static getAvailableUsersForSection({
sectionId,
}: {
sectionId: number,
}): CancelablePromise<GetAvailableUsersForDepartmentSectionResponse> {
return __request(OpenAPI, {
method: 'GET',
url: '/department/users/{section_id}',
path: {
'section_id': sectionId,
},
errors: {
422: `Validation Error`,
},
});
}
/**
* Add User
* @returns AddUserResponse Successful Response
* @throws ApiError
*/
public static addUser({
requestBody,
}: {
requestBody: AddUserRequest,
}): CancelablePromise<AddUserResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/department/users',
body: requestBody,
mediaType: 'application/json',
errors: {
422: `Validation Error`,
},
});
}
/**
* Delete User
* @returns DeleteUserResponse Successful Response
* @throws ApiError
*/
public static deleteUser({
requestBody,
}: {
requestBody: DeleteUserRequest,
}): CancelablePromise<DeleteUserResponse> {
return __request(OpenAPI, {
method: 'POST',
url: '/department/users/delete',
body: requestBody,
mediaType: 'application/json',
errors: {
422: `Validation Error`,
},
});
}
}