index.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. export type UserRole = 'superadmin' | 'moderator' | 'landlord' | 'executor' | 'customer'
  2. export type UserStatus = 'active' | 'banned' | 'pending_verification'
  3. export interface User {
  4. id: string
  5. email: string
  6. role: UserRole
  7. status: UserStatus
  8. name?: string
  9. avatar_url?: string
  10. phone?: string
  11. bio?: string
  12. country?: string
  13. created_at: string
  14. }
  15. export type PlaceType = 'place' | 'studio'
  16. export type PlaceStatus = 'draft' | 'pending_moderation' | 'published' | 'rejected' | 'archived'
  17. export interface Coordinates {
  18. lat: number
  19. lng: number
  20. }
  21. export interface Place {
  22. id: string
  23. type: PlaceType
  24. title: string
  25. description?: string
  26. address?: string
  27. coordinates: Coordinates
  28. cover_image?: string
  29. images: string[]
  30. access_info?: string
  31. rating: number
  32. reviews_count: number
  33. tags: Tag[]
  34. features: Feature[]
  35. status: PlaceStatus
  36. owner: Pick<User, 'id' | 'name' | 'avatar_url'>
  37. pricing?: {
  38. hourly_rate: number
  39. currency: string
  40. min_hours: number
  41. }
  42. booking_url?: string
  43. executor_services?: ExecutorService[]
  44. created_at: string
  45. updated_at?: string
  46. }
  47. export interface ExecutorService {
  48. id: string
  49. title: string
  50. price: number
  51. currency: string
  52. duration_minutes?: number
  53. executor_name: string
  54. }
  55. export interface Tag {
  56. id: string
  57. name: string
  58. category?: string
  59. }
  60. export interface Feature {
  61. id: string
  62. name: string
  63. category?: string
  64. icon?: string
  65. }
  66. export interface Service {
  67. id: string
  68. executor_id: string
  69. title: string
  70. description?: string
  71. price: number
  72. currency: string
  73. duration_minutes?: number
  74. tags: Tag[]
  75. rating: number
  76. reviews_count: number
  77. portfolio_images: string[]
  78. status: 'draft' | 'published' | 'archived'
  79. created_at: string
  80. }
  81. export interface Review {
  82. id: string
  83. user: Pick<User, 'id' | 'name' | 'avatar_url'>
  84. rating: number
  85. text?: string
  86. created_at: string
  87. }
  88. export interface Booking {
  89. id: string
  90. place_id: string
  91. start_time: string
  92. end_time: string
  93. status: 'pending' | 'confirmed' | 'cancelled' | 'completed'
  94. total_price?: number
  95. currency: string
  96. comment?: string
  97. }
  98. export interface PaginatedResponse<T> {
  99. data: T[]
  100. next_cursor?: string
  101. has_more: boolean
  102. }
  103. export interface ApiError {
  104. type: string
  105. title: string
  106. status: number
  107. detail: string
  108. instance?: string
  109. errors?: { field: string; message: string }[]
  110. }