Line data Source code
1 4 : (ns schemas.api.club)
2 :
3 :
4 4 : (def ClubCreateRequestSchema
5 28 : [:map {:swagger/title "ClubCreateRequest"
6 : :swagger/description "Request body for creating a club"}
7 8 : [:name
8 28 : [:string {:min 1
9 : :max 255}]]
10 20 : [:network {:optional true}
11 12 : [:maybe :string]]
12 20 : [:country {:optional true}
13 12 : [:maybe :string]]
14 20 : [:city {:optional true}
15 12 : [:maybe :string]]
16 20 : [:phone-number {:optional true}
17 12 : [:maybe :string]]
18 20 : [:sl-uuid {:optional true}
19 20 : [:maybe [:ref :types/AnyUuidString]]]
20 20 : [:location {:optional true}
21 12 : [:maybe :map]]
22 20 : [:working-hours {:optional true}
23 20 : [:maybe [:sequential :any]]]
24 20 : [:images {:optional true}
25 20 : [:maybe [:sequential :any]]]])
26 :
27 :
28 4 : (def ClubUpdateRequestSchema
29 28 : [:map {:swagger/title "ClubUpdateRequest"
30 : :swagger/description "Request body for updating a club"}
31 20 : [:name {:optional true}
32 8 : [:maybe
33 28 : [:string {:min 1
34 : :max 255}]]]
35 20 : [:network {:optional true}
36 12 : [:maybe :string]]
37 20 : [:country {:optional true}
38 12 : [:maybe :string]]
39 20 : [:city {:optional true}
40 12 : [:maybe :string]]
41 20 : [:phone-number {:optional true}
42 12 : [:maybe :string]]
43 20 : [:sl-uuid {:optional true}
44 20 : [:maybe [:ref :types/AnyUuidString]]]
45 20 : [:location {:optional true}
46 12 : [:maybe :map]]
47 20 : [:working-hours {:optional true}
48 20 : [:maybe [:sequential :any]]]
49 20 : [:images {:optional true}
50 20 : [:maybe [:sequential :any]]]
51 20 : [:is-active {:optional true}
52 12 : [:maybe :boolean]]])
53 :
54 :
55 4 : (def ClubResponseBody
56 20 : [:map {:swagger/title "ClubResponseBody"}
57 20 : [:uuid [:ref :types/UuidString]]
58 12 : [:public-id :string]
59 20 : [:sl-uuid {:optional true}
60 20 : [:maybe [:ref :types/AnyUuidString]]]
61 12 : [:name :string]
62 20 : [:network {:optional true}
63 12 : [:maybe :string]]
64 20 : [:country {:optional true}
65 12 : [:maybe :string]]
66 20 : [:city {:optional true}
67 12 : [:maybe :string]]
68 20 : [:phone-number {:optional true}
69 12 : [:maybe :string]]
70 12 : [:location :map]
71 20 : [:working-hours [:sequential :any]]
72 20 : [:images [:sequential :any]]
73 12 : [:is-active :boolean]
74 24 : [:created-datetime {:optional true}
75 : :any]
76 24 : [:updated-datetime {:optional true}
77 : :any]])
78 :
79 :
80 4 : (def ClubCreateResponseSchema
81 8 : [:or
82 68 : [:map [:status [:= 201]] [:body [:map [:message :string] [:data ClubResponseBody]]]]
83 68 : [:map [:status [:= 400]] [:body [:map [:message :string] [:error :map]]]]])
84 :
85 :
86 4 : (def ClubUpdateResponseSchema
87 8 : [:or
88 68 : [:map [:status [:= 200]] [:body [:map [:message :string] [:data ClubResponseBody]]]]
89 56 : [:map [:status [:= 404]] [:body [:map [:message :string]]]]
90 68 : [:map [:status [:= 400]] [:body [:map [:message :string] [:error :map]]]]])
91 :
92 :
93 4 : (def ClubListResponseSchema
94 64 : [:map [:status [:= 200]] [:body [:map [:data [:sequential ClubResponseBody]]]]])
95 :
96 :
97 4 : (def ClubGetResponseSchema
98 8 : [:or
99 56 : [:map [:status [:= 200]] [:body [:map [:data ClubResponseBody]]]]
100 56 : [:map [:status [:= 404]] [:body [:map [:message :string]]]]])
101 :
102 :
103 4 : (def ClubDeleteResponseSchema
104 8 : [:or
105 68 : [:map [:status [:= 200]] [:body [:map [:message :string] [:data ClubResponseBody]]]]
106 56 : [:map [:status [:= 404]] [:body [:map [:message :string]]]]])
107 :
108 :
109 4 : (def ClubPathParamsSchema
110 20 : [:map {:swagger/title "ClubPathParams"}
111 20 : [:club-uuid {:description "Club UUID"}
112 12 : [:ref :types/UuidString]]])
|