Files
webMontime/src/api/types.ts
T
2026-06-13 13:43:40 +03:30

149 lines
3.2 KiB
TypeScript

export type BookingStatus = 'pending' | 'confirmed' | 'cancelled' | 'completed';
export type BusinessCategory = {
id: string;
slug: string;
title: string;
isActive: boolean;
};
export type BusinessImage = {
id: string;
url: string;
originalName?: string | null;
sortOrder: number;
isCover: boolean;
};
export type Business = {
id: string;
title: string;
subtitle?: string | null;
slug: string;
description?: string | null;
address?: string | null;
contactPhone?: string | null;
phone?: string | null;
isActive: boolean;
categoryId: string;
category?: BusinessCategory;
images?: BusinessImage[];
concurrentCapacity?: number;
slotStepMinutes?: number;
serviceClassesEnabled?: boolean;
createdAt?: string;
updatedAt?: string;
};
export type UpdateBusinessPayload = {
title?: string;
subtitle?: string | null;
description?: string | null;
address?: string | null;
contactPhone?: string | null;
phone?: string | null;
isActive?: boolean;
concurrentCapacity?: number;
slotStepMinutes?: number;
serviceClassesEnabled?: boolean;
};
export type ServiceTemplate = {
id: string;
title: string;
slug: string;
description?: string | null;
defaultDurationMinutes?: number | null;
isActive: boolean;
categoryId: string;
};
export type BusinessServiceClassPrice = {
id: string;
classId: string;
price: string;
durationMinutes?: number | null;
isActive: boolean;
};
export type BusinessServiceClass = {
id: string;
businessId: string;
title: string;
description?: string | null;
sortOrder: number;
isActive: boolean;
classPrices?: BusinessServiceClassPrice[];
};
export type BusinessService = {
id: string;
businessId: string;
serviceTemplateId: string;
price: string;
durationMinutes?: number | null;
isActive: boolean;
serviceTemplate?: ServiceTemplate;
classPrices?: BusinessServiceClassPrice[];
};
export type Booking = {
id: string;
customerId: string;
businessId: string;
businessServiceId: string;
serviceClassId?: string | null;
bookingGroupId?: string | null;
scheduledAt: string;
status: BookingStatus;
note?: string | null;
cancellationReason?: string | null;
business?: Business;
businessService?: BusinessService;
serviceClass?: BusinessServiceClass;
customer?: {
id: string;
mobile: string;
fullName?: string | null;
};
};
export type BusinessRegistrationRequest = {
id: string;
status: string;
businessTitle: string;
categoryId: string;
ownerMobile: string;
createdAt: string;
};
export type CreateBusinessRegistrationPayload = {
businessTitle: string;
categoryId: string;
description?: string;
address?: string;
phone?: string;
};
export type BusinessServiceRequestStatus = 'pending' | 'approved' | 'rejected';
export type BusinessServiceRequest = {
id: string;
businessId: string;
status: BusinessServiceRequestStatus;
title: string;
description?: string | null;
price: string;
durationMinutes?: number | null;
adminNote?: string | null;
createdAt: string;
};
export type CreateBusinessServiceRequestPayload = {
businessId: string;
title: string;
description?: string;
price: number;
durationMinutes?: number;
};