Files
webMontime/src/api/types.ts
T

173 lines
3.7 KiB
TypeScript
Raw Normal View History

2026-06-29 15:49:13 +03:30
export type BookingStatus =
| 'pending'
| 'awaiting_payment'
| 'confirmed'
| 'cancelled'
| 'completed';
2026-06-12 20:16:14 +03:30
export type BusinessCategory = {
id: string;
slug: string;
title: string;
isActive: boolean;
};
export type BusinessImage = {
id: string;
url: string;
2026-06-12 20:16:14 +03:30
originalName?: string | null;
sortOrder: number;
2026-06-12 20:16:14 +03:30
isCover: boolean;
};
export type Business = {
id: string;
title: string;
2026-06-12 20:16:14 +03:30
subtitle?: string | null;
slug: string;
2026-06-12 20:16:14 +03:30
description?: string | null;
address?: string | null;
2026-06-13 10:19:31 +03:30
contactPhone?: string | null;
2026-06-12 20:16:14 +03:30
phone?: string | null;
isActive: boolean;
categoryId: string;
category?: BusinessCategory;
images?: BusinessImage[];
2026-06-12 20:16:14 +03:30
concurrentCapacity?: number;
slotStepMinutes?: number;
serviceClassesEnabled?: boolean;
2026-06-29 15:49:13 +03:30
autoApproveBookings?: boolean;
2026-06-29 19:32:19 +03:30
tipsEnabled?: boolean;
averageRating?: number | null;
reviewCount?: number;
2026-06-12 20:16:14 +03:30
createdAt?: string;
updatedAt?: string;
};
export type UpdateBusinessPayload = {
title?: string;
2026-06-12 20:16:14 +03:30
subtitle?: string | null;
description?: string | null;
address?: string | null;
2026-06-13 10:19:31 +03:30
contactPhone?: string | null;
2026-06-12 20:16:14 +03:30
phone?: string | null;
isActive?: boolean;
2026-06-01 13:22:07 +03:30
concurrentCapacity?: number;
2026-06-01 21:01:45 +03:30
slotStepMinutes?: number;
2026-06-12 20:16:14 +03:30
serviceClassesEnabled?: boolean;
2026-06-29 15:49:13 +03:30
autoApproveBookings?: boolean;
2026-06-29 19:32:19 +03:30
tipsEnabled?: boolean;
};
export type ServiceTemplate = {
id: string;
title: string;
slug: string;
2026-06-12 20:16:14 +03:30
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;
2026-06-12 20:16:14 +03:30
durationMinutes?: number | null;
isActive: boolean;
2026-07-15 20:42:03 +03:30
loyaltyEnabled?: boolean;
loyaltyEveryN?: number | null;
serviceTemplate?: ServiceTemplate;
2026-05-31 21:38:09 +03:30
classPrices?: BusinessServiceClassPrice[];
};
2026-07-15 20:42:03 +03:30
export type ServiceLoyaltyStatus = {
enabled: boolean;
everyN: number | null;
paidCount: number;
nextIsFree: boolean;
remainingPaidVisits: number | null;
};
export type Booking = {
id: string;
customerId: string;
businessId: string;
businessServiceId: string;
2026-05-31 21:38:09 +03:30
serviceClassId?: string | null;
bookingGroupId?: string | null;
scheduledAt: string;
status: BookingStatus;
2026-06-12 20:16:14 +03:30
note?: string | null;
2026-06-13 13:43:40 +03:30
cancellationReason?: string | null;
2026-06-29 15:49:13 +03:30
paymentToken?: string | null;
paymentAmount?: string | null;
2026-07-15 20:42:03 +03:30
loyaltyRedeemed?: boolean;
business?: Business;
businessService?: BusinessService;
2026-05-31 21:38:09 +03:30
serviceClass?: BusinessServiceClass;
2026-06-12 20:16:14 +03:30
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;
};
2026-06-13 10:19:31 +03:30
export type BusinessServiceRequestStatus = 'pending' | 'approved' | 'rejected';
2026-06-12 20:16:14 +03:30
export type BusinessServiceRequest = {
id: string;
businessId: string;
2026-06-13 10:19:31 +03:30
status: BusinessServiceRequestStatus;
2026-06-12 20:16:14 +03:30
title: string;
description?: string | null;
price: string;
durationMinutes?: number | null;
2026-06-13 10:19:31 +03:30
adminNote?: string | null;
2026-06-12 20:16:14 +03:30
createdAt: string;
};
export type CreateBusinessServiceRequestPayload = {
businessId: string;
title: string;
description?: string;
price: number;
durationMinutes?: number;
};