users.types.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. import type { Pagination } from './common.types'
  2. export interface User {
  3. id: number
  4. is_me: boolean
  5. first_name: string
  6. last_name: string
  7. full_name: string
  8. phone: string
  9. email: null
  10. username: string
  11. province_id: number
  12. city_id: number
  13. gender: number
  14. birth_date: string
  15. weight: number
  16. height: number
  17. foot_specialization: string
  18. post_skill: string
  19. skill_level: string
  20. activity_history: number
  21. team_name: null
  22. favorite_iranian_team: string
  23. favorite_foreign_team: string
  24. shirt_number: number
  25. bio: null
  26. followers_count: number
  27. following_count: number
  28. post_count: number
  29. avatar?: Avatar
  30. created_at: string
  31. updated_at: string
  32. }
  33. export interface UsersListMeta {
  34. total?: number
  35. per_page?: number
  36. current_page?: number
  37. last_page?: number
  38. }
  39. export interface GetUserResponse {
  40. success: boolean
  41. message: string
  42. data: {
  43. users: User[]
  44. pagination: Pagination
  45. }
  46. }
  47. export interface Avatar {
  48. name: string
  49. url: string
  50. hash: string
  51. type: string
  52. entity_slug: string
  53. }
  54. export interface Post {
  55. id: number
  56. user_id: number
  57. state: string
  58. caption: string
  59. video: Avatar
  60. thumbnail: null
  61. likes_count: number
  62. dislikes_count: number
  63. views_count: number
  64. comment_count: number
  65. created_at: string
  66. updated_at: string
  67. }
  68. export interface GetUserDetailResponse {
  69. success: boolean
  70. message: string
  71. data: {
  72. user: User
  73. posts: Post[]
  74. }
  75. }
  76. export interface CreateUserPayload {
  77. phone: string
  78. first_name: string
  79. last_name: string
  80. email?: string
  81. username: string
  82. province_id?: number
  83. city_id?: number
  84. gender: number
  85. birth_date: string | undefined
  86. weight?: number
  87. height?: number
  88. foot_specialization?: string
  89. post_skill?: string
  90. skill_level?: string
  91. activity_history?: boolean | number
  92. team_name?: string
  93. favorite_iranian_team?: string
  94. favorite_foreign_team?: string
  95. shirt_number?: number
  96. bio?: string
  97. }