first commit
This commit is contained in:
90
src/pages/tours/lib/useTourForm.ts
Normal file
90
src/pages/tours/lib/useTourForm.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
// src/models/tour.ts
|
||||
|
||||
// Ilovada foydalaniladigan barcha modellar
|
||||
export type TicketAmenity = {
|
||||
name: string;
|
||||
icon_name: string; // Misol uchun: "wifi", "pool"
|
||||
};
|
||||
|
||||
export type IncludedService = {
|
||||
image: string;
|
||||
title: string;
|
||||
description: string;
|
||||
};
|
||||
|
||||
export type HotelMeal = {
|
||||
image: string;
|
||||
name: string;
|
||||
description: string;
|
||||
};
|
||||
|
||||
export type HotelData = {
|
||||
name: string; // Joylashadigan manzil nomi
|
||||
rating: number; // Yulduz
|
||||
meal_plan: string; // Ovqatlanish rejasi
|
||||
// Bu malumotlar API orqali keladi deb faraz qilinadi
|
||||
hotel_type_id: number;
|
||||
hotel_amenity_ids: number[];
|
||||
hotel_feature_ids: number[];
|
||||
};
|
||||
|
||||
export type TourFormData = {
|
||||
// Etap 1: Asosiy Tur Ma'lumotlari
|
||||
title: string;
|
||||
price: number;
|
||||
departure: string;
|
||||
destination: string;
|
||||
departure_time: string;
|
||||
travel_time: string;
|
||||
passenger_count: number;
|
||||
languages: string;
|
||||
duration_days: number;
|
||||
hotel_meals_option: string; // 'nonushta', 'yarmpansion'
|
||||
tariff: string; // 'econom', 'business'
|
||||
badge: string; // 'hot', 'new'
|
||||
visa_required: boolean;
|
||||
banner_image: File[];
|
||||
transport: string; // 'airplane', 'bus'
|
||||
|
||||
// Qo'shimcha Modellar
|
||||
tickets_images: string[]; // Bilet rasmlari URL massivi
|
||||
tickets_amenities: TicketAmenity[];
|
||||
tickets_included_services: IncludedService[];
|
||||
tickets_hotel_meals: HotelMeal[];
|
||||
|
||||
// Etap 2: Mehmonxona Ma'lumotlari (yoki uni qismi)
|
||||
hotel_info: string; // Asosiy matn
|
||||
hotel_data: HotelData;
|
||||
};
|
||||
|
||||
// Forma holatini boshqarish uchun boshlang'ich qiymat
|
||||
export const initialTourData: TourFormData = {
|
||||
title: "",
|
||||
price: 0,
|
||||
departure: "",
|
||||
destination: "",
|
||||
departure_time: "",
|
||||
travel_time: "",
|
||||
passenger_count: 1,
|
||||
languages: "O'zbek, Rus",
|
||||
duration_days: 1,
|
||||
hotel_meals_option: "Nonushta",
|
||||
tariff: "Econom",
|
||||
badge: "New",
|
||||
visa_required: false,
|
||||
banner_image: [],
|
||||
transport: "Samolyot",
|
||||
tickets_images: [],
|
||||
tickets_amenities: [{ name: "Wi-Fi", icon_name: "Wifi" }],
|
||||
tickets_included_services: [],
|
||||
tickets_hotel_meals: [],
|
||||
hotel_info: "",
|
||||
hotel_data: {
|
||||
name: "",
|
||||
rating: 5,
|
||||
meal_plan: "Nonushta",
|
||||
hotel_type_id: 1,
|
||||
hotel_amenity_ids: [],
|
||||
hotel_feature_ids: [],
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user