Files
webMontime/src/api/types.ts
T

135 lines
2.8 KiB
TypeScript
Raw Normal View History

export type BusinessCategory = {
id: string;
slug: string;
title: string;
isActive: boolean;
};
export type BusinessImage = {
id: string;
url: string;
isCover: boolean;
sortOrder: number;
};
export type Business = {
id: string;
title: string;
slug: string;
description: string | null;
contactPhone: string | null;
address: string | null;
latitude: number | null;
longitude: number | null;
isActive: boolean;
categoryId: string;
ownerId?: string | null;
category?: BusinessCategory;
images?: BusinessImage[];
};
export type BusinessRegistrationStatus = 'pending' | 'approved' | 'rejected';
export type BusinessRegistrationRequest = {
id: string;
applicantId: string;
status: BusinessRegistrationStatus;
title: string;
slug: string;
categoryId: string;
description: string | null;
contactPhone: string | null;
address: string | null;
adminNote: string | null;
businessId: string | null;
createdAt: string;
category?: BusinessCategory;
applicant?: { id: string; mobile: string; fullName: string | null };
};
export type CreateBusinessRegistrationPayload = {
title: string;
categoryId: string;
slug?: string;
description?: string;
contactPhone?: string;
address?: string;
};
export type UpdateBusinessPayload = {
title?: string;
description?: string | null;
contactPhone?: string | null;
address?: string | null;
latitude?: number | null;
longitude?: number | null;
};
export type ServiceTemplate = {
id: string;
title: string;
slug: string;
description: string | null;
defaultDurationMinutes: number;
};
export type BusinessService = {
id: string;
businessId: string;
serviceTemplateId: string;
price: string;
durationMinutes: number | null;
isActive: boolean;
serviceTemplate?: ServiceTemplate;
};
2026-05-25 21:38:17 +03:30
export type BusinessServiceRequestStatus = 'pending' | 'approved' | 'rejected';
export type BusinessServiceRequest = {
id: string;
businessId: string;
requestedById: string;
status: BusinessServiceRequestStatus;
title: string;
description: string | null;
price: string;
durationMinutes: number | null;
adminNote: string | null;
serviceTemplateId: string | null;
businessServiceId: string | null;
createdAt?: string;
business?: Business;
};
export type CreateBusinessServiceRequestPayload = {
title: string;
description?: string;
price: number;
durationMinutes?: number;
};
export type BookingStatus =
| 'pending'
| 'confirmed'
| 'cancelled'
| 'completed';
export type Booking = {
id: string;
customerId: string;
businessId: string;
businessServiceId: string;
scheduledAt: string;
status: BookingStatus;
note: string | null;
createdAt?: string;
updatedAt?: string;
customer?: {
id: string;
mobile: string;
fullName: string | null;
};
business?: Business;
businessService?: BusinessService;
};