diff --git a/src/swagger.json b/src/swagger.json index 0dded2b..67a9c26 100644 --- a/src/swagger.json +++ b/src/swagger.json @@ -1 +1 @@ -{"openapi":"3.0.1","info":{"title":"API","description":"","version":"1.0.0"},"tags":[{"name":"Event"},{"name":"User"},{"name":"UserActions"}],"paths":{"/events/latest":{"get":{"summary":"Get latest events","deprecated":false,"description":"Returns a list of 5 most recently created events","tags":["Event"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/EventCard"}}},"required":["events"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/login":{"post":{"summary":"Login","deprecated":false,"description":"This endpoint generates a token for user that submits correct credentials.","tags":["User"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","faker":"admin1@grabit.com"},"password":{"type":"string","faker":"password123"}},"required":["email","password"]},"example":""}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"email":{"type":"string"},"accountType":{"type":"string","enum":["HARVESTER","ORGANISER"]},"name":{"type":"string"},"phoneNumber":{"type":"string","nullable":true}},"required":["token","email","accountType","name"]},"examples":{"1":{"summary":"Success","value":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNsdWJncHQyajAwMHNtMnQ4czl1MTF1ZHkiLCJyb2xlIjoiT1JHQU5JU0VSIiwiaWF0IjoxNzExNjU2MjY4LCJleHAiOjE3MTE3NDI2Njh9.ycica3zI-ICN9AGbiB8X40iRy7Uug4RbdkSZ7PvfcJA","email":"admin1@grabit.sk","accountType":"ORGANISER","name":"Leonard Homenick","phoneNumber":"377-409-0332 x981"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"User not found","value":{"code":"USER_NOT_FOUND","message":"User not found"}},"2":{"summary":"Wrong password","value":{"code":"WRONG_PASSWORD","message":"Wrong password"}}}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Record not found","value":{"message":"Wrong email address","code":"WRONG_EMAIL"}}}}}}},"security":[]}},"/events/categories":{"get":{"summary":"List of categories assigned to at least one event","deprecated":false,"description":"Get a list of categories that were assigned to at least one event along with the number of events assigned to the event.","tags":["Event"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string"},"colorVariant":{"type":"string","enum":["CHERRY","LEMON","LIME","APPLE","ORANGE"]},"_count":{"type":"object","properties":{"EventCategoryRelation":{"type":"integer"}},"required":["EventCategoryRelation"]}},"required":["id","name","icon","colorVariant","_count"]}}},"required":["categories"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}},"/user/editAccount":{"put":{"summary":"Edit account","deprecated":false,"description":"Allows users to edit their account information","tags":["User"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"phoneNumber":{"type":"string"}},"required":["name"]}}}},"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/my":{"get":{"summary":"My events","deprecated":false,"description":"Returns a list of events. If user is ORGANISER, query contains all events that were created by user. If the user is HARVESTER, the endpoint returns list of events, to which user signed to.","tags":["Event"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/EventCard"}}},"required":["events"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/nearby":{"get":{"summary":"Get events nearby","deprecated":false,"description":"Endpoint that returns events that are in 30km radius from users location.","tags":["Event"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"lat":{"type":"number","format":"float","minimum":-180,"maximum":180},"lon":{"type":"number","minimum":-180,"maximum":180,"format":"float"}},"required":["lon","lat"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/EventCard"}}},"required":["events"]},"examples":{"1":{"summary":"Success","value":{"events":[{"id":"clufwukav001bh2plbo8x0aht","name":"Electronic Wooden Keyboard","happeningAt":"2025-02-25T15:25:44.396Z","thumbnailURL":"https://picsum.photos/seed/791/1280/720","Location":{"id":"clufwukaj000wh2pltbm0cm71","locationLat":103.4928,"locationLon":-48.041,"address":"4961 Grange Avenue","city":"Tryciatown","name":"Steuber, Conn and Dooley"},"sallaryType":"GOODS","status":"CREATED","sallaryAmount":0.2,"sallaryProductName":"Handcrafted Bronze Mouse","sallaryUnit":"ml","EventCategoryRelation":[{"EventCategory":{"id":"clufwuk9o000ah2pll5sw1x4z","name":"Broskyňa","icon":"🍑","colorVariant":"ORANGE"}},{"EventCategory":{"id":"clufwuk9o000ah2pll5sw1x4z","name":"Broskyňa","icon":"🍑","colorVariant":"ORANGE"}},{"EventCategory":{"id":"clufwuk9o000fh2ploo10ialt","name":"Rajčina","icon":"🍅","colorVariant":"CHERRY"}}],"User":{"name":"Teresa Larson"}},{"id":"clufwukav001mh2plufg1ab33","name":"Handcrafted Rubber Salad","happeningAt":"2024-09-12T13:29:13.653Z","thumbnailURL":"https://picsum.photos/seed/463/1280/720","Location":{"id":"clufwukaj0017h2plia71s1sl","locationLat":58.3093,"locationLon":179.8429,"address":"49388 Jake Pass","city":"Kohlerport","name":"Russel, Koepp and Zieme"},"sallaryType":"MONEY","status":"CREATED","sallaryAmount":6.5,"sallaryProductName":null,"sallaryUnit":null,"EventCategoryRelation":[{"EventCategory":{"id":"clufwuk9o0008h2pli1zt4bow","name":"Čučoriedky","icon":"🫐","colorVariant":"LEMON"}},{"EventCategory":{"id":"clufwuk9o0006h2plczrbrq0z","name":"Hrozno","icon":"🍇","colorVariant":"LIME"}}],"User":{"name":"Saul Abbott"}},{"id":"clufwukav001nh2pldmln26sl","name":"Handcrafted Rubber Sausages","happeningAt":"2025-03-11T17:56:23.447Z","thumbnailURL":"https://picsum.photos/seed/913/1280/720","Location":{"id":"clufwukaj0018h2pl377kl15p","locationLat":86.2392,"locationLon":154.2931,"address":"929 Schaden Keys","city":"East Katherine","name":"Herzog, Hettinger and Rippin"},"sallaryType":"GOODS","status":"CREATED","sallaryAmount":1,"sallaryProductName":"Refined Rubber Mouse","sallaryUnit":"mg","EventCategoryRelation":[{"EventCategory":{"id":"clufwuk9o0007h2pl4si1pdnf","name":"Jahoda","icon":"🍓","colorVariant":"CHERRY"}},{"EventCategory":{"id":"clufwuk9o000bh2plpxndfmvw","name":"Mango","icon":"🥭","colorVariant":"LIME"}},{"EventCategory":{"id":"clufwuk9o000dh2pls9stowox","name":"Kokos","icon":"🥥","colorVariant":"APPLE"}}],"User":{"name":"Teresa Larson"}},{"id":"clufwukav001eh2pl3uqnagm8","name":"Intelligent Concrete Fish","happeningAt":"2024-04-16T18:41:50.255Z","thumbnailURL":"https://picsum.photos/seed/380/1280/720","Location":{"id":"clufwukaj000zh2pl08vjpmvv","locationLat":68.6195,"locationLon":-167.343,"address":"976 Harrison Street","city":"Considineside","name":"Lueilwitz and Sons"},"sallaryType":"GOODS","status":"CREATED","sallaryAmount":0.8,"sallaryProductName":"Practical Granite Chips","sallaryUnit":"kg","EventCategoryRelation":[{"EventCategory":{"id":"clufwuk9o000ph2plz2bphtsh","name":"Cibuľa","icon":"🧅","colorVariant":"LIME"}},{"EventCategory":{"id":"clufwuk9o000ih2plomjac7d1","name":"Brokolica","icon":"🥦","colorVariant":"APPLE"}},{"EventCategory":{"id":"clufwuk9o0003h2pl6tirr7op","name":"Citron","icon":"🍋","colorVariant":"LIME"}}],"User":{"name":"Teresa Larson"}},{"id":"clufwukav001lh2pl5fwntxd8","name":"Modern Bronze Soap","happeningAt":"2024-04-23T06:07:47.989Z","thumbnailURL":"https://picsum.photos/seed/169/1280/720","Location":{"id":"clufwukaj0016h2plr5ov92c5","locationLat":117.806,"locationLon":-64.8481,"address":"82861 White Wells","city":"East Letabury","name":"Bins - Johns"},"sallaryType":"GOODS","status":"CREATED","sallaryAmount":1.2,"sallaryProductName":"Rustic Fresh Pizza","sallaryUnit":"kg","EventCategoryRelation":[{"EventCategory":{"id":"clufwuk9o000bh2plpxndfmvw","name":"Mango","icon":"🥭","colorVariant":"LIME"}}],"User":{"name":"Mrs. Samantha Ratke"}}]}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/uploadImage":{"post":{"summary":"Upload image","deprecated":false,"description":"Upload image, and get an public URL.","tags":["Event"],"parameters":[],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"image":{"description":"Event image that we want to upload","example":"file:///Users/martinvanco/Documents/FIIT/2_ROC/MTAA/mtaa-2024-fronted/composeApp/src/commonMain/composeResources/drawable/placeholder.png","type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"imageURL":{"type":"string"}},"required":["imageURL"]},"examples":{"1":{"summary":"Success","value":{"imageURL":"https://loremflickr.com/640/480/nature"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}":{"get":{"summary":"Get event details","deprecated":false,"description":"Returns all avaliable informations about an event.","tags":["Event"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uu"},"name":{"type":"string"},"description":{"type":"string"},"happeningAt":{"type":"string","format":"date"},"thumbnailURL":{"type":"string","format":"url"},"capacity":{"type":"integer","minimum":0},"Location":{"$ref":"#/components/schemas/Location"},"sallaryType":{"type":"string","enum":["MONEY","GOODS"]},"sallaryAmount":{"type":"number","format":"float"},"sallaryUnit":{"type":"string","nullable":true},"sallaryProductName":{"type":"string","nullable":true},"toolingRequired":{"type":"string","nullable":true},"toolingProvided":{"type":"string","nullable":true},"status":{"type":"string","default":"'CREATED'","enum":["CREATED","PROGRESS","ARCHIVED","CANCELLED"]},"User":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"EventCategoryRelation":{"type":"array","items":{"type":"object","properties":{"EventCategory":{"type":"object","properties":{"id":{"type":"string","description":"ID","format":"uu"},"name":{"type":"string"},"icon":{"type":"string"},"colorVariant":{"type":"string","enum":["CHERRY","LEMON","LIME","APPLE","ORANGE"]}},"description":"ID","required":["id","name","icon","colorVariant"]}},"required":["EventCategory"]}},"_count":{"type":"object","properties":{"EventAssignment":{"type":"integer","minimum":0}},"required":["EventAssignment"]},"isOwnedByUser":{"type":"boolean"},"isUserSignedIn":{"type":"boolean"}},"required":["id","name","description","happeningAt","capacity","Location","sallaryType","sallaryAmount","status","User","EventCategoryRelation","_count","isOwnedByUser","isUserSignedIn"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]},"delete":{"summary":"Cancel event","deprecated":false,"description":"Endpoint avaliable for organisers to cancell event that they created.","tags":["Event"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/onMap":{"get":{"summary":"Points on map","deprecated":false,"description":"Get all event ids along with their qordinates on map. This specific endpoint is used for displaying events on map.","tags":["Event"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"Location":{"type":"object","properties":{"locationLat":{"type":"number"},"locationLon":{"type":"number"}},"required":["locationLat","locationLon"]}},"required":["id","Location"]}}},"required":["events"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}},"/createAccount":{"post":{"summary":"Create account","deprecated":false,"description":"Create a new account of specified type: ORGANISER / HARVESTER","tags":["User"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"},"name":{"type":"string"},"accountType":{"type":"string","enum":["HARVESTER","ORGANISER"]},"phoneNumber":{"type":"string","nullable":true}},"required":["email","password","name","accountType"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"},"phoneNumber":{"type":"string","nullable":true},"accountType":{"type":"string","enum":["HARVESTER","ORGANISER"]},"token":{"type":"string"}},"required":["email","name","accountType","token"]},"examples":{"1":{"summary":"Success","value":{"email":"Ova.Pollich@yahoo.com","name":"accusamus fugiat explicabo","phoneNumber":"958-309-6630 x4687","accountType":"ORGANISER","token":"cillum culpa id ut exercitation"}}}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Email exists","value":{"message":"Email already in use","code":"EMAIL_IN_USE"}}}}}}},"security":[]}},"/events/active":{"get":{"summary":"Get active event","deprecated":false,"description":"This endpoint returns an event that is currently in progress for a certain user. \n- If user is organiser, it returns event created by user that has \"IN_PROGRESS\" status.\n- If user is harvester, it returns event with \"IN_PROGRESS\" status that user is signed for.\n\nIf there is no event like this, endpoint returns 404 Not Found.","tags":["Event"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"thumbnailURL":{"type":"string","format":"url","nullable":true},"User":{"type":"object","properties":{"name":{"type":"string","description":"name"}},"required":["name"]}},"required":["id","name","User"]},"examples":{"1":{"summary":"Success","value":{"id":"clufwukd5004kh2pl8zap41c9","thumbnailURL":"https://picsum.photos/seed/637/1280/720","name":"Tasty Cotton Pizza","User":{"name":"Greg Quitzon"}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/user/verifyToken":{"get":{"summary":"Verify token","deprecated":false,"description":"Endpoint verifies if provided token is valid","tags":["User"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{},"required":["01HQXZRBF1TF1ZRJMK56SP5718"]}}}},"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}},"examples":{"1":{"summary":"Success","value":""}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}}},"security":[{"bearer":[]}]}},"/events/":{"get":{"summary":"Get all events","deprecated":false,"description":"Get all events that are in status \"CREATED\". This filters out events that were cancelled, are already in progress or are archived.","tags":["Event"],"parameters":[{"name":"limit","in":"query","description":"Number of posts","required":false,"example":"","schema":{"type":"string"}},{"name":"categoryID","in":"query","description":"cantegory ID","required":false,"example":"","schema":{"type":"string"}},{"name":"priceType","in":"query","description":"MONEY | GOODS","required":false,"example":"","schema":{"type":"string"}},{"name":"distance","in":"query","description":"Radius in km","required":false,"example":"","schema":{"type":"integer"}},{"name":"lat","in":"query","description":"latitude","required":false,"example":"","schema":{"type":"number","minimum":-180,"maximum":180,"format":"float"}},{"name":"lon","in":"query","description":"longitude","required":false,"example":"","schema":{"type":"number","format":"float","minimum":-180,"maximum":180}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/EventCard"}}},"required":["events"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid Input","value":{"code":"INVALID_QUERY","message":"Invalid query. Check the parameters."}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"No posts found","value":{"code":"NO_POSTS_FOUND","message":"No posts matching your request."}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/signFor":{"post":{"summary":"Sign for event","deprecated":false,"description":"This endpoint is avaliable for HARVESTERS only. It allows them to sign for an event.","tags":["UserActions"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/signOff":{"post":{"summary":"Sign off event","deprecated":false,"description":"This endpoint is avaliable for HARVESTERS only. It allows them to sign off an event.","tags":["UserActions"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/user":{"delete":{"summary":"Delete user account","deprecated":false,"description":"","tags":["User"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/updateAttendance":{"put":{"summary":"Update event attendance","deprecated":false,"description":"This event has to be in IN_PROGRESS status. This endpoint is only avaliable to organiser who created the event.","tags":["UserActions"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workers":{"type":"array","items":{"type":"object","properties":{"userID":{"type":"string"},"presenceStatus":{"type":"string"},"arrivedAt":{"type":"string"},"leftAt":{"type":"string"}},"required":["userID","presenceStatus"]}}},"required":["workers"]},"example":{"workers":[{"userID":"clutvexj9002l10vy9igdy2qw","presenceStatus":"PRESENT","arrivedAt":"2024-04-09T19:05:25.417Z","leftAt":"2024-04-09T23:49:55.223Z"},{"userID":"clutvexj9002k10vyujbo31w6","presenceStatus":"PRESENT","arrivedAt":"2024-04-10T13:27:34.870Z","leftAt":"2024-04-09T22:39:13.219Z"}]}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"title":"","type":"undefined"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/endEvent":{"post":{"summary":"End event","deprecated":false,"description":"Sets the event status to ARCHIVED - marks all workers attendance to LEFT and calculates insights for the company about sallary for each worker.","tags":["UserActions"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/startEvent":{"put":{"summary":"Start event","deprecated":false,"description":"This endpoint is avaliable for ORGANISERS only. It allows them to start event.","tags":["UserActions"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/create":{"post":{"summary":"Create event","deprecated":false,"description":"Endpoint avaliable for organisers, to create a new event.","tags":["Event"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"happeningAt":{"type":"string","format":"date"},"capacity":{"type":"integer","minimum":0},"sallaryType":{"type":"string","enum":["MONEY","GOODS"]},"sallaryAmount":{"type":"number","format":"float"},"sallaryProductName":{"type":"string"},"sallaryUnit":{"type":"string"},"categories":{"type":"array","items":{"type":"string"}},"toolingRequired":{"type":"string"},"toolingProvided":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"thumbnailURL":{"type":"string","format":"url"},"location":{"type":"object","properties":{"locationLat":{"type":"number"},"locationLon":{"type":"number"},"address":{"type":"string"},"city":{"type":"string"},"name":{"type":"string"}},"required":["locationLat","locationLon","address","city"]},"harmonogramItems":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"from":{"type":"string","format":"time","examples":["12:00"]},"to":{"type":"string","format":"time","examples":["12:00"]}},"required":["title","from","to","description"]}}},"required":["happeningAt","capacity","sallaryType","name","location","sallaryAmount"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string"}},"required":["eventId"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/update":{"put":{"summary":"Update event","deprecated":false,"description":"Endpoint avaliable for organisers to update event data that they created.","tags":["Event"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"happeningAt":{"type":"string","format":"date"},"capacity":{"type":"integer","minimum":0,"maximum":2147483647},"sallaryType":{"type":"string","enum":["MONEY","GOODS"]},"sallaryAmount":{"type":"number","format":"float","minimum":0},"sallaryProductName":{"type":"string"},"sallaryUnit":{"type":"string"},"categories":{"type":"array","items":{"type":"string"}},"toolingRequired":{"type":"string"},"toolingProvided":{"type":"string"},"description":{"type":"string"},"thumbnailURL":{"type":"string","format":"url"},"location":{"type":"object","properties":{"locationLat":{"type":"number","format":"float","minimum":-180,"maximum":180},"locationLon":{"type":"number","format":"float","minimum":-180,"maximum":180,"title":""},"address":{"type":"string"},"city":{"type":"string"},"name":{"type":"string"}},"required":["locationLat","locationLon","address","city"]},"harmonogramItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"If harmonogram item is new, id is \"new\""},"title":{"type":"string"},"description":{"type":"string"},"from":{"type":"string","format":"time","examples":["12:00"]},"to":{"type":"string","format":"time","examples":["12:00"]}},"required":["title","from","to","description","id"]}}},"required":["happeningAt","capacity","sallaryType","location","sallaryAmount"]}}}},"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/live":{"get":{"summary":"In progress event data","deprecated":false,"description":"This endpoint returns harmonogram items and announcement items to the user. \nThis endpoint works only:\n- for events in \"IN_PROGRESS\" status\n- for organisers who created the event\n- for harvesters who are signed for the event","tags":["Event"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"announcementItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date"},"eventId":{"type":"string"},"userId":{"type":"string"},"message":{"type":"string"}},"required":["id","createdAt","eventId","userId","message"]}},"harmonogramItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date"},"from":{"type":"string","format":"time"},"to":{"type":"string","format":"time"},"title":{"type":"string"},"description":{"type":"string"},"eventId":{"type":"string"}},"required":["id","createdAt","from","to","title","description","eventId"]}}},"required":["announcementItems","harmonogramItems"]},"examples":{"1":{"summary":"Success","value":{"announcementItems":[{"id":"cluv30sgp00dn5ohvj17nctbz","createdAt":"2024-04-11T06:02:50.257Z","eventId":"liveEventId","userId":"admin1","message":"Curia adipisci inventore despecto vulgo."},{"id":"cluv30sgp00e05ohvoza7ujh5","createdAt":"2024-04-11T07:21:25.257Z","eventId":"liveEventId","userId":"admin1","message":"Auditor argentum cetera."},{"id":"cluv30sgp00dm5ohvgbliuzk0","createdAt":"2024-04-11T08:46:29.257Z","eventId":"liveEventId","userId":"admin1","message":"Vomica totam crux."},{"id":"cluv30sgp00dp5ohv2yw38vfe","createdAt":"2024-04-11T09:28:37.257Z","eventId":"liveEventId","userId":"admin1","message":"Tametsi clarus cur cado officia ago cresco administratio solitudo auditor."},{"id":"cluv30sgp00do5ohv4dr0tla7","createdAt":"2024-04-11T10:39:21.257Z","eventId":"liveEventId","userId":"admin1","message":"Aptus undique tabesco administratio atque aut coadunatio astrum coadunatio."},{"id":"cluv30sgp00dr5ohvtlokauwz","createdAt":"2024-04-11T11:33:55.257Z","eventId":"liveEventId","userId":"admin1","message":"Argumentum volutabrum creptio vacuus provident decor clibanus clementia usque cumque."},{"id":"cluv30sgp00dv5ohvcw546f6h","createdAt":"2024-04-11T12:26:18.257Z","eventId":"liveEventId","userId":"admin1","message":"Velit colo sopor vilitas."},{"id":"cluv30sgp00dx5ohvwc2ud56g","createdAt":"2024-04-11T13:55:13.257Z","eventId":"liveEventId","userId":"admin1","message":"Bellum decerno crastinus absorbeo vespillo."},{"id":"cluv30sgp00dw5ohvlcgufwiz","createdAt":"2024-04-11T14:52:36.257Z","eventId":"liveEventId","userId":"admin1","message":"Tutamen non delectus templum saepe."},{"id":"cluv30sgp00e15ohvwbze4o3u","createdAt":"2024-04-11T15:05:43.257Z","eventId":"liveEventId","userId":"admin1","message":"Theca adulescens abstergo baiulus carpo tametsi correptius."}],"harmonogramItems":[{"id":"cluv30sgn00dc5ohvkvbsk6pk","createdAt":"2024-04-11T10:14:03.288Z","from":"08:04","to":"09:04","title":"victoria decipio decretum","description":"Ter aiunt ulterius defungo advenio clam odit cunctatio articulus. Tener calco cognatus defetiscor amissio asper. Decumbo admiratio stillicidium conatus antea callide amplexus.","eventId":"liveEventId"},{"id":"cluv30sgn00dd5ohvxgnawtvq","createdAt":"2024-04-11T10:14:03.288Z","from":"09:04","to":"10:04","title":"neque compello commodi","description":"Adicio quaerat spero maiores vulgo adfero vester. Accusantium desparatus vox aranea sequi uberrime. Voro substantia claustrum versus deleo maxime corrigo aedificium cupressus.","eventId":"liveEventId"},{"id":"cluv30sgn00de5ohvr3vqh1iv","createdAt":"2024-04-11T10:14:03.288Z","from":"10:04","to":"11:04","title":"vobis centum nihil","description":"Templum sub itaque terebro quaerat tego ago correptius. Pectus tepesco benevolentia audeo substantia curo aspernatur cura repellat. Sustineo chirographum credo sponte subnecto cultellus.","eventId":"liveEventId"},{"id":"cluv30sgn00df5ohv291zr5td","createdAt":"2024-04-11T10:14:03.288Z","from":"11:04","to":"12:04","title":"decretum pariatur teres creptio tenuis ait verecundia cruentus universe","description":"Cotidie urbs acceptus comitatus tum contra sustineo. Cras decumbo vicissitudo. Templum tondeo sopor consuasor.","eventId":"liveEventId"},{"id":"cluv30sgn00dh5ohvsxx8y2ie","createdAt":"2024-04-11T10:14:03.288Z","from":"12:04","to":"13:04","title":"quisquam volutabrum exercitationem carbo","description":"Arma vos doloremque quisquam appello adicio volup. Talus sufficio clibanus solio. Claro corrupti acceptus aliqua aranea argumentum derideo adfectus similique sumptus.","eventId":"liveEventId"}]}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/reporting":{"get":{"summary":"Get event reporting","deprecated":false,"description":"Get summary of number of hours the workers worked during event.\n- If user is ORGANISER - get all users who shosed up on event and get information about their working hours\n- If user is HARVESTER - get information about the specific harvesters working hours","tags":["Event"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"reportingItems":{"type":"array","items":{"type":"object","properties":{"arrivedAt":{"type":"string"},"leftAt":{"type":"string"},"hoursWorked":{"type":"integer"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"required":["arrivedAt","leftAt","hoursWorked","user"]}}},"required":["reportingItems"]},"examples":{"1":{"summary":"Success","value":{"reportingItems":[{"arrivedAt":"2024-04-11T05:29:42.464Z","leftAt":"2024-04-11T11:09:49.808Z","hoursWorked":6,"user":{"id":"cluv4sn80008l11w15l5uc8im","name":"Mr. Irving Leffler"}},{"arrivedAt":"2024-04-11T05:22:42.464Z","leftAt":"2024-04-11T13:45:42.464Z","hoursWorked":9,"user":{"id":"cluv4sn80008h11w1z0rdntga","name":"Jerry Boehm"}},{"arrivedAt":"2024-04-11T05:35:42.464Z","leftAt":"2024-04-11T11:43:42.464Z","hoursWorked":7,"user":{"id":"cluv4sn80008m11w1lro6311n","name":"Sonia Maggio"}},{"arrivedAt":"2024-04-11T05:34:42.464Z","leftAt":"2024-04-11T11:09:49.808Z","hoursWorked":6,"user":{"id":"cluv4sn81008t11w1nd3qsw1l","name":"Jeffery MacGyver"}},{"arrivedAt":"2024-04-11T05:34:42.464Z","leftAt":"2024-04-11T07:34:42.464Z","hoursWorked":3,"user":{"id":"harvester1","name":"Lana Beatty Sr."}},{"arrivedAt":"2024-04-11T05:35:42.464Z","leftAt":"2024-04-11T11:09:49.808Z","hoursWorked":6,"user":{"id":"cluv4sn80008p11w1wy03b543","name":"Sergio Bernhard"}},{"arrivedAt":"2024-04-11T05:28:42.464Z","leftAt":"2024-04-11T11:09:49.808Z","hoursWorked":6,"user":{"id":"cluv4sn80008n11w1917szb1s","name":"Betsy Nicolas MD"}}]}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/workers":{"get":{"summary":"List of signed in workers","deprecated":false,"description":"Get information about users who signed in for certain event. This endpoint is only avaliable for organiser that created certain event.\nEvent has to be in CREATED status.","tags":["Event"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"workers":{"type":"array","items":{"type":"object","properties":{"assignmentStatus":{"type":"string","enum":["ACTIVE","SIGNED_OFF"]},"createdAt":{"type":"string","format":"date"},"user":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phoneNumber":{"type":"string","nullable":true}},"required":["name","email","phoneNumber"]}},"required":["assignmentStatus","createdAt","user"]}}},"required":["workers"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/attendance":{"get":{"summary":"Event attendance","deprecated":false,"description":"Get attendance data of a certain event. This event has to be in IN_PROGRESS status. This endpoint is only avaliable to organiser who created the event.","tags":["Event"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"workers":{"type":"array","items":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"assignmentStatus":{"type":"string","enum":["ACTIVE","SIGNED_OFF"]},"presenceStatus":{"type":"string","enum":["NOT_PRESENT","DID_NOT_ARRIVE","PRESENT","LEFT"]},"arrived_at":{"type":"string","format":"date","nullable":true},"left_at":{"type":"string","format":"date","nullable":true}},"required":["presenceStatus","arrived_at","left_at","assignmentStatus","user"]}}},"required":["workers"]},"examples":{"1":{"summary":"Success","value":{"workers":[{"user":{"id":"cluhgramk008fr032gpm60bdf","name":"Charlene Yundt"},"assignmentStatus":"ACTIVE","presenceStatus":"NOT_PRESENT","arrivedAt":null,"leftAt":null},{"user":{"id":"cluhgramk008hr032i960ess0","name":"Roxanne Kuphal IV"},"assignmentStatus":"ACTIVE","presenceStatus":"NOT_PRESENT","arrivedAt":null,"leftAt":null},{"user":{"id":"cluhgramk008gr032sg02za9a","name":"Ms. Sophie DuBuque"},"assignmentStatus":"ACTIVE","presenceStatus":"NOT_PRESENT","arrivedAt":null,"leftAt":null},{"user":{"id":"cluhgralj0036r032f0bv5pmf","name":"Darla McCullough"},"assignmentStatus":"ACTIVE","presenceStatus":"NOT_PRESENT","arrivedAt":null,"leftAt":null},{"user":{"id":"cluhgramk008ir0320fe5fkal","name":"Anne Powlowski"},"assignmentStatus":"SIGNED_OFF","presenceStatus":"LEFT","arrivedAt":null,"leftAt":null},{"user":{"id":"cluhgramk008cr032e0znk7dg","name":"Dominick Carroll"},"assignmentStatus":"ACTIVE","presenceStatus":"PRESENT","arrivedAt":null,"leftAt":null}]}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}}},"components":{"schemas":{"Category":{"type":"object","properties":{"id":{"type":"string","description":"ID","format":"uu"},"name":{"type":"string"},"icon":{"type":"string"},"colorVariant":{"type":"string","enum":["CHERRY","LEMON","LIME","APPLE","ORANGE"]}},"required":["id","name","icon","colorVariant"]},"Location":{"properties":{"locationLat":{"type":"number","minimum":-180,"maximum":180},"locationLon":{"type":"number","minimum":-180,"maximum":180},"address":{"type":"string"},"city":{"type":"string"},"name":{"type":"string"}},"type":"object","required":["locationLat","locationLon","address","city"]},"EventCard":{"type":"object","properties":{"id":{"type":"string","format":"uu"},"name":{"type":"string"},"happeningAt":{"type":"string","format":"date"},"thumbnailURL":{"type":"string","format":"url"},"Location":{"$ref":"#/components/schemas/Location"},"sallaryType":{"type":"string","enum":["MONEY","GOODS"]},"sallaryAmount":{"type":"number","format":"float"},"sallaryUnit":{"type":"string","nullable":true},"sallaryProductName":{"type":"string","nullable":true},"status":{"type":"string","default":"'CREATED'","enum":["CREATED","PROGRESS","ARCHIVED","CANCELLED"]},"User":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"EventCategoryRelation":{"type":"array","items":{"type":"object","properties":{"EventCategory":{"$ref":"#/components/schemas/Category"}},"required":["EventCategory"]}}},"required":["id","name","happeningAt","sallaryType","status","sallaryAmount","User","Location","EventCategoryRelation"]},"User":{"properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"avatarURL":{"type":"string"},"createdAt":{"default":"CURRENT_TIMESTAMP","type":"string"},"phoneNumber":{"type":"string"},"type":{"type":"string","enum":["WORKER","COMPANY"]},"verificationToken":{"type":"string"},"password":{"type":"string"}},"type":"object","required":["id","email","name","createdAt","type","password"]},"HarmonogramItem":{"properties":{"createdAt":{"default":"CURRENT_TIMESTAMP","type":"string"},"from":{"type":"string"},"to":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"}},"type":"object","required":["createdAt","from","to","title"]},"Event":{"type":"object","properties":{"id":{"type":"string","format":"uu"},"name":{"type":"string"},"description":{"type":"string"},"happeningAt":{"type":"string","format":"date"},"thumbnailURL":{"type":"string","format":"url"},"capacity":{"type":"integer","minimum":0},"Location":{"$ref":"#/components/schemas/Location"},"sallaryType":{"type":"string","enum":["MONEY","GOODS"]},"sallaryAmount":{"type":"number","format":"float"},"sallaryUnit":{"type":"string","nullable":true},"sallaryProductName":{"type":"string","nullable":true},"toolingRequired":{"type":"string","nullable":true},"toolingProvided":{"type":"string","nullable":true},"status":{"type":"string","default":"'CREATED'","enum":["CREATED","PROGRESS","ARCHIVED","CANCELLED"]},"User":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"EventCategoryRelation":{"type":"array","items":{"type":"object","properties":{"EventCategory":{"type":"object","properties":{"id":{"type":"string","description":"ID","format":"uu"},"name":{"type":"string"},"icon":{"type":"string"},"colorVariant":{"type":"string","enum":["CHERRY","LEMON","LIME","APPLE","ORANGE"]}},"description":"ID","required":["id","name","icon","colorVariant"]}},"required":["EventCategory"]}},"_count":{"type":"object","properties":{"EventAssignment":{"type":"integer","minimum":0}},"required":["EventAssignment"]},"isOwnedByUser":{"type":"boolean"},"isUserSignedIn":{"type":"boolean"}},"required":["id","name","happeningAt","sallaryType","status","sallaryAmount","User","Location","EventCategoryRelation","description","capacity","_count","isOwnedByUser","isUserSignedIn"]},"AnnouncementItem":{"properties":{"id":{"type":"string"},"createdAt":{"default":"CURRENT_TIMESTAMP","type":"string"},"eventId":{"type":"string"},"userId":{"type":"string"},"message":{"type":"string"}},"type":"object","required":["id","createdAt","eventId","userId","message"]}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"servers":[]} \ No newline at end of file +{"openapi":"3.0.1","info":{"title":"API","description":"","version":"1.0.0"},"tags":[{"name":"Event"},{"name":"Others"},{"name":"User"},{"name":"Announcements"},{"name":"UserActions"}],"paths":{"/events/latest":{"get":{"summary":"Get latest events","deprecated":false,"description":"Returns a list of 5 most recently created events","tags":["Event"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/EventCard"}}},"required":["events"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/searchPlaces":{"get":{"summary":"Search locations","deprecated":false,"description":"Search for locations using Google Places API.","tags":["Others"],"parameters":[{"name":"q","in":"query","description":"","required":false,"example":"nova dubnica","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"mainText":{"type":"string"},"secondaryText":{"type":"string"},"placeId":{"type":"string"}},"required":["mainText","secondaryText","placeId"]}}},"required":["items"]},"examples":{"1":{"summary":"Success","value":{"items":[{"mainText":"Stavebné bytové družstvo Šaľa","secondaryText":"Horná, Šaľa, Slovensko","placeId":"ChIJTbRH9gZta0cRsYcEjXmjkNo"},{"mainText":"Roľnícke družstvo Šaľa, Pozberová linka, Ťažká mechanizácia, Sklady","secondaryText":"Šaľa, Slovensko","placeId":"ChIJ5VT6kkFta0cRpWOtMiGF3Fg"},{"mainText":"Roľnícke Družstvo Šaľa, vedenie-kancelárie","secondaryText":"Hviezdoslavova, Šaľa, Slovensko","placeId":"ChIJneT8mRpta0cRN27xl78vbJE"},{"mainText":"Roľnícke družstvo Šaľa - stredisko Hetméň","secondaryText":"Šaľa-Hetméň, Slovensko","placeId":"ChIJe5-VkqsSa0cRQF2zjR7gAig"},{"mainText":"Družstvo salaš Lipová","secondaryText":"Lipová, Slovensko","placeId":"ChIJXbA0uICdPkcRdXEiqeI1mfs"}]}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}},"/events/categories":{"get":{"summary":"List of categories assigned to at least one event","deprecated":false,"description":"Get a list of categories that were assigned to at least one event along with the number of events assigned to the event.","tags":["Event"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string"},"colorVariant":{"type":"string","enum":["CHERRY","LEMON","LIME","APPLE","ORANGE"]},"_count":{"type":"object","properties":{"EventCategoryRelation":{"type":"integer"}},"required":["EventCategoryRelation"]}},"required":["id","name","icon","colorVariant","_count"]}}},"required":["categories"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}},"/user/editAccount":{"put":{"summary":"Edit account","deprecated":false,"description":"Allows users to edit their account information","tags":["User"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"phoneNumber":{"type":"string"}},"required":["name"]}}}},"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/login":{"post":{"summary":"Login","deprecated":false,"description":"This endpoint generates a token for user that submits correct credentials.","tags":["User"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","faker":"admin1@grabit.com"},"password":{"type":"string","faker":"password123"}},"required":["email","password"]},"example":""}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"email":{"type":"string"},"accountType":{"type":"string","enum":["HARVESTER","ORGANISER"]},"name":{"type":"string"},"phoneNumber":{"type":"string","nullable":true}},"required":["token","email","accountType","name"]},"examples":{"1":{"summary":"Success","value":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNsdWJncHQyajAwMHNtMnQ4czl1MTF1ZHkiLCJyb2xlIjoiT1JHQU5JU0VSIiwiaWF0IjoxNzExNjU2MjY4LCJleHAiOjE3MTE3NDI2Njh9.ycica3zI-ICN9AGbiB8X40iRy7Uug4RbdkSZ7PvfcJA","email":"admin1@grabit.sk","accountType":"ORGANISER","name":"Leonard Homenick","phoneNumber":"377-409-0332 x981"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"User not found","value":{"code":"USER_NOT_FOUND","message":"User not found"}},"2":{"summary":"Wrong password","value":{"code":"WRONG_PASSWORD","message":"Wrong password"}}}}}},"404":{"description":"Record Not Found","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Record not found","value":{"message":"Wrong email address","code":"WRONG_EMAIL"}}}}}}},"security":[]}},"/events/my":{"get":{"summary":"My events","deprecated":false,"description":"Returns a list of events. If user is ORGANISER, query contains all events that were created by user. If the user is HARVESTER, the endpoint returns list of events, to which user signed to.","tags":["Event"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/EventCard"}}},"required":["events"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/nearby":{"get":{"summary":"Get events nearby","deprecated":false,"description":"Endpoint that returns events that are in 30km radius from users location.","tags":["Event"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"lat":{"type":"number","format":"float","minimum":-180,"maximum":180},"lon":{"type":"number","minimum":-180,"maximum":180,"format":"float"}},"required":["lon","lat"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/EventCard"}}},"required":["events"]},"examples":{"1":{"summary":"Success","value":{"events":[{"id":"clufwukav001bh2plbo8x0aht","name":"Electronic Wooden Keyboard","happeningAt":"2025-02-25T15:25:44.396Z","thumbnailURL":"https://picsum.photos/seed/791/1280/720","Location":{"id":"clufwukaj000wh2pltbm0cm71","locationLat":103.4928,"locationLon":-48.041,"address":"4961 Grange Avenue","city":"Tryciatown","name":"Steuber, Conn and Dooley"},"sallaryType":"GOODS","status":"CREATED","sallaryAmount":0.2,"sallaryProductName":"Handcrafted Bronze Mouse","sallaryUnit":"ml","EventCategoryRelation":[{"EventCategory":{"id":"clufwuk9o000ah2pll5sw1x4z","name":"Broskyňa","icon":"🍑","colorVariant":"ORANGE"}},{"EventCategory":{"id":"clufwuk9o000ah2pll5sw1x4z","name":"Broskyňa","icon":"🍑","colorVariant":"ORANGE"}},{"EventCategory":{"id":"clufwuk9o000fh2ploo10ialt","name":"Rajčina","icon":"🍅","colorVariant":"CHERRY"}}],"User":{"name":"Teresa Larson"}},{"id":"clufwukav001mh2plufg1ab33","name":"Handcrafted Rubber Salad","happeningAt":"2024-09-12T13:29:13.653Z","thumbnailURL":"https://picsum.photos/seed/463/1280/720","Location":{"id":"clufwukaj0017h2plia71s1sl","locationLat":58.3093,"locationLon":179.8429,"address":"49388 Jake Pass","city":"Kohlerport","name":"Russel, Koepp and Zieme"},"sallaryType":"MONEY","status":"CREATED","sallaryAmount":6.5,"sallaryProductName":null,"sallaryUnit":null,"EventCategoryRelation":[{"EventCategory":{"id":"clufwuk9o0008h2pli1zt4bow","name":"Čučoriedky","icon":"🫐","colorVariant":"LEMON"}},{"EventCategory":{"id":"clufwuk9o0006h2plczrbrq0z","name":"Hrozno","icon":"🍇","colorVariant":"LIME"}}],"User":{"name":"Saul Abbott"}},{"id":"clufwukav001nh2pldmln26sl","name":"Handcrafted Rubber Sausages","happeningAt":"2025-03-11T17:56:23.447Z","thumbnailURL":"https://picsum.photos/seed/913/1280/720","Location":{"id":"clufwukaj0018h2pl377kl15p","locationLat":86.2392,"locationLon":154.2931,"address":"929 Schaden Keys","city":"East Katherine","name":"Herzog, Hettinger and Rippin"},"sallaryType":"GOODS","status":"CREATED","sallaryAmount":1,"sallaryProductName":"Refined Rubber Mouse","sallaryUnit":"mg","EventCategoryRelation":[{"EventCategory":{"id":"clufwuk9o0007h2pl4si1pdnf","name":"Jahoda","icon":"🍓","colorVariant":"CHERRY"}},{"EventCategory":{"id":"clufwuk9o000bh2plpxndfmvw","name":"Mango","icon":"🥭","colorVariant":"LIME"}},{"EventCategory":{"id":"clufwuk9o000dh2pls9stowox","name":"Kokos","icon":"🥥","colorVariant":"APPLE"}}],"User":{"name":"Teresa Larson"}},{"id":"clufwukav001eh2pl3uqnagm8","name":"Intelligent Concrete Fish","happeningAt":"2024-04-16T18:41:50.255Z","thumbnailURL":"https://picsum.photos/seed/380/1280/720","Location":{"id":"clufwukaj000zh2pl08vjpmvv","locationLat":68.6195,"locationLon":-167.343,"address":"976 Harrison Street","city":"Considineside","name":"Lueilwitz and Sons"},"sallaryType":"GOODS","status":"CREATED","sallaryAmount":0.8,"sallaryProductName":"Practical Granite Chips","sallaryUnit":"kg","EventCategoryRelation":[{"EventCategory":{"id":"clufwuk9o000ph2plz2bphtsh","name":"Cibuľa","icon":"🧅","colorVariant":"LIME"}},{"EventCategory":{"id":"clufwuk9o000ih2plomjac7d1","name":"Brokolica","icon":"🥦","colorVariant":"APPLE"}},{"EventCategory":{"id":"clufwuk9o0003h2pl6tirr7op","name":"Citron","icon":"🍋","colorVariant":"LIME"}}],"User":{"name":"Teresa Larson"}},{"id":"clufwukav001lh2pl5fwntxd8","name":"Modern Bronze Soap","happeningAt":"2024-04-23T06:07:47.989Z","thumbnailURL":"https://picsum.photos/seed/169/1280/720","Location":{"id":"clufwukaj0016h2plr5ov92c5","locationLat":117.806,"locationLon":-64.8481,"address":"82861 White Wells","city":"East Letabury","name":"Bins - Johns"},"sallaryType":"GOODS","status":"CREATED","sallaryAmount":1.2,"sallaryProductName":"Rustic Fresh Pizza","sallaryUnit":"kg","EventCategoryRelation":[{"EventCategory":{"id":"clufwuk9o000bh2plpxndfmvw","name":"Mango","icon":"🥭","colorVariant":"LIME"}}],"User":{"name":"Mrs. Samantha Ratke"}}]}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/uploadImage":{"post":{"summary":"Upload image","deprecated":false,"description":"Upload image, and get an public URL.","tags":["Event"],"parameters":[],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"image":{"description":"Event image that we want to upload","example":"file:///Users/martinvanco/Documents/FIIT/2_ROC/MTAA/mtaa-2024-fronted/composeApp/src/commonMain/composeResources/drawable/placeholder.png","type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"imageURL":{"type":"string"}},"required":["imageURL"]},"examples":{"1":{"summary":"Success","value":{"imageURL":"https://loremflickr.com/640/480/nature"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/publishAnnouncement":{"post":{"summary":"Publish announcement","deprecated":false,"description":"Send announcement to workers. This feature supports Websocket updates of messages.","tags":["Announcements"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{}},"examples":{"1":{"summary":"Success","value":""}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}},"/events/onMap":{"get":{"summary":"Points on map","deprecated":false,"description":"Get all event ids along with their qordinates on map. This specific endpoint is used for displaying events on map.","tags":["Event"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"Location":{"type":"object","properties":{"locationLat":{"type":"number"},"locationLon":{"type":"number"}},"required":["locationLat","locationLon"]}},"required":["id","Location"]}}},"required":["events"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}":{"get":{"summary":"Get event details","deprecated":false,"description":"Returns all avaliable informations about an event.","tags":["Event"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"example":"","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uu"},"name":{"type":"string"},"description":{"type":"string"},"happeningAt":{"type":"string","format":"date"},"thumbnailURL":{"type":"string","format":"url"},"capacity":{"type":"integer","minimum":0},"Location":{"$ref":"#/components/schemas/Location"},"sallaryType":{"type":"string","enum":["MONEY","GOODS"]},"sallaryAmount":{"type":"number","format":"float"},"sallaryUnit":{"type":"string","nullable":true},"sallaryProductName":{"type":"string","nullable":true},"toolingRequired":{"type":"string","nullable":true},"toolingProvided":{"type":"string","nullable":true},"status":{"type":"string","default":"'CREATED'","enum":["CREATED","PROGRESS","ARCHIVED","CANCELLED"]},"User":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"EventCategoryRelation":{"type":"array","items":{"type":"object","properties":{"EventCategory":{"type":"object","properties":{"id":{"type":"string","description":"ID","format":"uu"},"name":{"type":"string"},"icon":{"type":"string"},"colorVariant":{"type":"string","enum":["CHERRY","LEMON","LIME","APPLE","ORANGE"]}},"description":"ID","required":["id","name","icon","colorVariant"]}},"required":["EventCategory"]}},"_count":{"type":"object","properties":{"EventAssignment":{"type":"integer","minimum":0}},"required":["EventAssignment"]},"isOwnedByUser":{"type":"boolean"},"isUserSignedIn":{"type":"boolean"}},"required":["id","name","description","happeningAt","capacity","Location","sallaryType","sallaryAmount","status","User","EventCategoryRelation","_count","isOwnedByUser","isUserSignedIn"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]},"delete":{"summary":"Cancel event","deprecated":false,"description":"Endpoint avaliable for organisers to cancell event that they created.","tags":["Event"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/active":{"get":{"summary":"Get active event","deprecated":false,"description":"This endpoint returns an event that is currently in progress for a certain user. \n- If user is organiser, it returns event created by user that has \"IN_PROGRESS\" status.\n- If user is harvester, it returns event with \"IN_PROGRESS\" status that user is signed for.\n\nIf there is no event like this, endpoint returns 404 Not Found.","tags":["Event"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"thumbnailURL":{"type":"string","format":"url","nullable":true},"User":{"type":"object","properties":{"name":{"type":"string","description":"name"}},"required":["name"]}},"required":["id","name","User"]},"examples":{"1":{"summary":"Success","value":{"id":"clufwukd5004kh2pl8zap41c9","thumbnailURL":"https://picsum.photos/seed/637/1280/720","name":"Tasty Cotton Pizza","User":{"name":"Greg Quitzon"}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/createAccount":{"post":{"summary":"Create account","deprecated":false,"description":"Create a new account of specified type: ORGANISER / HARVESTER","tags":["User"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"},"name":{"type":"string"},"accountType":{"type":"string","enum":["HARVESTER","ORGANISER"]},"phoneNumber":{"type":"string","nullable":true}},"required":["email","password","name","accountType"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"},"phoneNumber":{"type":"string","nullable":true},"accountType":{"type":"string","enum":["HARVESTER","ORGANISER"]},"token":{"type":"string"}},"required":["email","name","accountType","token"]},"examples":{"1":{"summary":"Success","value":{"email":"Ova.Pollich@yahoo.com","name":"accusamus fugiat explicabo","phoneNumber":"958-309-6630 x4687","accountType":"ORGANISER","token":"cillum culpa id ut exercitation"}}}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Email exists","value":{"message":"Email already in use","code":"EMAIL_IN_USE"}}}}}}},"security":[]}},"/user/verifyToken":{"get":{"summary":"Verify token","deprecated":false,"description":"Endpoint verifies if provided token is valid","tags":["User"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{},"required":["01HQXZRBF1TF1ZRJMK56SP5718"]}}}},"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}},"examples":{"1":{"summary":"Success","value":""}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}}},"security":[{"bearer":[]}]}},"/events/":{"get":{"summary":"Get all events","deprecated":false,"description":"Get all events that are in status \"CREATED\". This filters out events that were cancelled, are already in progress or are archived.","tags":["Event"],"parameters":[{"name":"limit","in":"query","description":"Number of posts","required":false,"example":"","schema":{"type":"string"}},{"name":"categoryID","in":"query","description":"cantegory ID","required":false,"example":"","schema":{"type":"string"}},{"name":"priceType","in":"query","description":"MONEY | GOODS","required":false,"example":"","schema":{"type":"string"}},{"name":"distance","in":"query","description":"Radius in km","required":false,"example":"","schema":{"type":"integer"}},{"name":"lat","in":"query","description":"latitude","required":false,"example":"","schema":{"type":"number","minimum":-180,"maximum":180,"format":"float"}},{"name":"lon","in":"query","description":"longitude","required":false,"example":"","schema":{"type":"number","format":"float","minimum":-180,"maximum":180}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/EventCard"}}},"required":["events"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid Input","value":{"code":"INVALID_QUERY","message":"Invalid query. Check the parameters."}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"No posts found","value":{"code":"NO_POSTS_FOUND","message":"No posts matching your request."}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/signFor":{"post":{"summary":"Sign for event","deprecated":false,"description":"This endpoint is avaliable for HARVESTERS only. It allows them to sign for an event.","tags":["UserActions"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/signOff":{"post":{"summary":"Sign off event","deprecated":false,"description":"This endpoint is avaliable for HARVESTERS only. It allows them to sign off an event.","tags":["UserActions"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/user":{"delete":{"summary":"Delete user account","deprecated":false,"description":"","tags":["User"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/updateAttendance":{"put":{"summary":"Update event attendance","deprecated":false,"description":"This event has to be in IN_PROGRESS status. This endpoint is only avaliable to organiser who created the event.","tags":["UserActions"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workers":{"type":"array","items":{"type":"object","properties":{"userID":{"type":"string"},"presenceStatus":{"type":"string"},"arrivedAt":{"type":"string"},"leftAt":{"type":"string"}},"required":["userID","presenceStatus"]}}},"required":["workers"]},"example":{"workers":[{"userID":"clutvexj9002l10vy9igdy2qw","presenceStatus":"PRESENT","arrivedAt":"2024-04-09T19:05:25.417Z","leftAt":"2024-04-09T23:49:55.223Z"},{"userID":"clutvexj9002k10vyujbo31w6","presenceStatus":"PRESENT","arrivedAt":"2024-04-10T13:27:34.870Z","leftAt":"2024-04-09T22:39:13.219Z"}]}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"title":"","type":"undefined"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/endEvent":{"post":{"summary":"End event","deprecated":false,"description":"Sets the event status to ARCHIVED - marks all workers attendance to LEFT and calculates insights for the company about sallary for each worker.","tags":["UserActions"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/startEvent":{"put":{"summary":"Start event","deprecated":false,"description":"This endpoint is avaliable for ORGANISERS only. It allows them to start event.","tags":["UserActions"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/create":{"post":{"summary":"Create event","deprecated":false,"description":"Endpoint avaliable for organisers, to create a new event.","tags":["Event"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"happeningAt":{"type":"string","format":"date"},"capacity":{"type":"integer","minimum":0},"sallaryType":{"type":"string","enum":["MONEY","GOODS"]},"sallaryAmount":{"type":"number","format":"float"},"sallaryProductName":{"type":"string"},"sallaryUnit":{"type":"string"},"categories":{"type":"array","items":{"type":"string"}},"toolingRequired":{"type":"string"},"toolingProvided":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"thumbnailURL":{"type":"string","format":"url"},"harmonogramItems":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"from":{"type":"string","format":"time","examples":["12:00"]},"to":{"type":"string","format":"time","examples":["12:00"]}},"required":["title","from","to","description"]}},"placeId":{"type":"string"}},"required":["happeningAt","capacity","sallaryType","name","sallaryAmount","placeId"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string"}},"required":["eventId"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/update":{"put":{"summary":"Update event","deprecated":false,"description":"Endpoint avaliable for organisers to update event data that they created.","tags":["Event"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"happeningAt":{"type":"string","format":"date"},"capacity":{"type":"integer","minimum":0,"maximum":2147483647},"sallaryType":{"type":"string","enum":["MONEY","GOODS"]},"sallaryAmount":{"type":"number","format":"float","minimum":0},"sallaryProductName":{"type":"string"},"sallaryUnit":{"type":"string"},"categories":{"type":"array","items":{"type":"string"}},"toolingRequired":{"type":"string"},"toolingProvided":{"type":"string"},"description":{"type":"string"},"thumbnailURL":{"type":"string","format":"url"},"harmonogramItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"If harmonogram item is new, id is \"new\""},"title":{"type":"string"},"description":{"type":"string"},"from":{"type":"string","format":"time","examples":["12:00"]},"to":{"type":"string","format":"time","examples":["12:00"]}},"required":["title","from","to","description","id"]}},"placeId":{"type":"string","nullable":true}},"required":["happeningAt","capacity","sallaryType","sallaryAmount"]}}}},"responses":{"200":{"description":"Success","content":{"*/*":{"schema":{"type":"object","properties":{}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Invalid input format","value":{"code":"INVALID_REQUEST","message":"Invalid request params"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"404":{"description":"Record not found","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"NOT_FOUND","message":"Record not found"}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/live":{"get":{"summary":"In progress event data","deprecated":false,"description":"This endpoint returns harmonogram items and announcement items to the user. \nThis endpoint works only:\n- for events in \"IN_PROGRESS\" status\n- for organisers who created the event\n- for harvesters who are signed for the event","tags":["Event"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"announcementItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date"},"eventId":{"type":"string"},"userId":{"type":"string"},"message":{"type":"string"}},"required":["id","createdAt","eventId","userId","message"]}},"harmonogramItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date"},"from":{"type":"string","format":"time"},"to":{"type":"string","format":"time"},"title":{"type":"string"},"description":{"type":"string"},"eventId":{"type":"string"}},"required":["id","createdAt","from","to","title","description","eventId"]}}},"required":["announcementItems","harmonogramItems"]},"examples":{"1":{"summary":"Success","value":{"announcementItems":[{"id":"cluv30sgp00dn5ohvj17nctbz","createdAt":"2024-04-11T06:02:50.257Z","eventId":"liveEventId","userId":"admin1","message":"Curia adipisci inventore despecto vulgo."},{"id":"cluv30sgp00e05ohvoza7ujh5","createdAt":"2024-04-11T07:21:25.257Z","eventId":"liveEventId","userId":"admin1","message":"Auditor argentum cetera."},{"id":"cluv30sgp00dm5ohvgbliuzk0","createdAt":"2024-04-11T08:46:29.257Z","eventId":"liveEventId","userId":"admin1","message":"Vomica totam crux."},{"id":"cluv30sgp00dp5ohv2yw38vfe","createdAt":"2024-04-11T09:28:37.257Z","eventId":"liveEventId","userId":"admin1","message":"Tametsi clarus cur cado officia ago cresco administratio solitudo auditor."},{"id":"cluv30sgp00do5ohv4dr0tla7","createdAt":"2024-04-11T10:39:21.257Z","eventId":"liveEventId","userId":"admin1","message":"Aptus undique tabesco administratio atque aut coadunatio astrum coadunatio."},{"id":"cluv30sgp00dr5ohvtlokauwz","createdAt":"2024-04-11T11:33:55.257Z","eventId":"liveEventId","userId":"admin1","message":"Argumentum volutabrum creptio vacuus provident decor clibanus clementia usque cumque."},{"id":"cluv30sgp00dv5ohvcw546f6h","createdAt":"2024-04-11T12:26:18.257Z","eventId":"liveEventId","userId":"admin1","message":"Velit colo sopor vilitas."},{"id":"cluv30sgp00dx5ohvwc2ud56g","createdAt":"2024-04-11T13:55:13.257Z","eventId":"liveEventId","userId":"admin1","message":"Bellum decerno crastinus absorbeo vespillo."},{"id":"cluv30sgp00dw5ohvlcgufwiz","createdAt":"2024-04-11T14:52:36.257Z","eventId":"liveEventId","userId":"admin1","message":"Tutamen non delectus templum saepe."},{"id":"cluv30sgp00e15ohvwbze4o3u","createdAt":"2024-04-11T15:05:43.257Z","eventId":"liveEventId","userId":"admin1","message":"Theca adulescens abstergo baiulus carpo tametsi correptius."}],"harmonogramItems":[{"id":"cluv30sgn00dc5ohvkvbsk6pk","createdAt":"2024-04-11T10:14:03.288Z","from":"08:04","to":"09:04","title":"victoria decipio decretum","description":"Ter aiunt ulterius defungo advenio clam odit cunctatio articulus. Tener calco cognatus defetiscor amissio asper. Decumbo admiratio stillicidium conatus antea callide amplexus.","eventId":"liveEventId"},{"id":"cluv30sgn00dd5ohvxgnawtvq","createdAt":"2024-04-11T10:14:03.288Z","from":"09:04","to":"10:04","title":"neque compello commodi","description":"Adicio quaerat spero maiores vulgo adfero vester. Accusantium desparatus vox aranea sequi uberrime. Voro substantia claustrum versus deleo maxime corrigo aedificium cupressus.","eventId":"liveEventId"},{"id":"cluv30sgn00de5ohvr3vqh1iv","createdAt":"2024-04-11T10:14:03.288Z","from":"10:04","to":"11:04","title":"vobis centum nihil","description":"Templum sub itaque terebro quaerat tego ago correptius. Pectus tepesco benevolentia audeo substantia curo aspernatur cura repellat. Sustineo chirographum credo sponte subnecto cultellus.","eventId":"liveEventId"},{"id":"cluv30sgn00df5ohv291zr5td","createdAt":"2024-04-11T10:14:03.288Z","from":"11:04","to":"12:04","title":"decretum pariatur teres creptio tenuis ait verecundia cruentus universe","description":"Cotidie urbs acceptus comitatus tum contra sustineo. Cras decumbo vicissitudo. Templum tondeo sopor consuasor.","eventId":"liveEventId"},{"id":"cluv30sgn00dh5ohvsxx8y2ie","createdAt":"2024-04-11T10:14:03.288Z","from":"12:04","to":"13:04","title":"quisquam volutabrum exercitationem carbo","description":"Arma vos doloremque quisquam appello adicio volup. Talus sufficio clibanus solio. Claro corrupti acceptus aliqua aranea argumentum derideo adfectus similique sumptus.","eventId":"liveEventId"}]}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/reporting":{"get":{"summary":"Get event reporting","deprecated":false,"description":"Get summary of number of hours the workers worked during event.\n- If user is ORGANISER - get all users who shosed up on event and get information about their working hours\n- If user is HARVESTER - get information about the specific harvesters working hours","tags":["Event"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"reportingItems":{"type":"array","items":{"type":"object","properties":{"arrivedAt":{"type":"string"},"leftAt":{"type":"string"},"hoursWorked":{"type":"integer"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}}},"sallary":{"type":"object","properties":{"sallaryAmount":{"type":"number"},"sallaryProductName":{"type":"null"},"sallaryType":{"type":"string"},"sallaryUnit":{"type":"null"}},"required":["sallaryAmount","sallaryProductName","sallaryType","sallaryUnit"]}},"required":["reportingItems","sallary"]},"examples":{"1":{"summary":"Success","value":{"reportingItems":[{"arrivedAt":"2024-04-11T05:29:42.464Z","leftAt":"2024-04-11T11:09:49.808Z","hoursWorked":6,"user":{"id":"cluv4sn80008l11w15l5uc8im","name":"Mr. Irving Leffler"}},{"arrivedAt":"2024-04-11T05:22:42.464Z","leftAt":"2024-04-11T13:45:42.464Z","hoursWorked":9,"user":{"id":"cluv4sn80008h11w1z0rdntga","name":"Jerry Boehm"}},{"arrivedAt":"2024-04-11T05:35:42.464Z","leftAt":"2024-04-11T11:43:42.464Z","hoursWorked":7,"user":{"id":"cluv4sn80008m11w1lro6311n","name":"Sonia Maggio"}},{"arrivedAt":"2024-04-11T05:34:42.464Z","leftAt":"2024-04-11T11:09:49.808Z","hoursWorked":6,"user":{"id":"cluv4sn81008t11w1nd3qsw1l","name":"Jeffery MacGyver"}},{"arrivedAt":"2024-04-11T05:34:42.464Z","leftAt":"2024-04-11T07:34:42.464Z","hoursWorked":3,"user":{"id":"harvester1","name":"Lana Beatty Sr."}},{"arrivedAt":"2024-04-11T05:35:42.464Z","leftAt":"2024-04-11T11:09:49.808Z","hoursWorked":6,"user":{"id":"cluv4sn80008p11w1wy03b543","name":"Sergio Bernhard"}},{"arrivedAt":"2024-04-11T05:28:42.464Z","leftAt":"2024-04-11T11:09:49.808Z","hoursWorked":6,"user":{"id":"cluv4sn80008n11w1917szb1s","name":"Betsy Nicolas MD"}}]}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/workers":{"get":{"summary":"List of signed in workers","deprecated":false,"description":"Get information about users who signed in for certain event. This endpoint is only avaliable for organiser that created certain event.\nEvent has to be in CREATED status.","tags":["Event"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"workers":{"type":"array","items":{"type":"object","properties":{"assignmentStatus":{"type":"string","enum":["ACTIVE","SIGNED_OFF"]},"createdAt":{"type":"string","format":"date"},"user":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phoneNumber":{"type":"string","nullable":true}},"required":["name","email","phoneNumber"]}},"required":["assignmentStatus","createdAt","user"]}}},"required":["workers"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}},"/events/{eventId}/attendance":{"get":{"summary":"Event attendance","deprecated":false,"description":"Get attendance data of a certain event. This event has to be in IN_PROGRESS status. This endpoint is only avaliable to organiser who created the event.","tags":["Event"],"parameters":[{"name":"eventId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"workers":{"type":"array","items":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"assignmentStatus":{"type":"string","enum":["ACTIVE","SIGNED_OFF"]},"presenceStatus":{"type":"string","enum":["NOT_PRESENT","DID_NOT_ARRIVE","PRESENT","LEFT"]},"arrived_at":{"type":"string","format":"date","nullable":true},"left_at":{"type":"string","format":"date","nullable":true}},"required":["presenceStatus","arrived_at","left_at","assignmentStatus","user"]}},"lastUpdated":{"type":"string","format":"date"}},"required":["workers","lastUpdated"]},"examples":{"1":{"summary":"Success","value":{"workers":[{"user":{"id":"cluhgramk008fr032gpm60bdf","name":"Charlene Yundt"},"assignmentStatus":"ACTIVE","presenceStatus":"NOT_PRESENT","arrivedAt":null,"leftAt":null},{"user":{"id":"cluhgramk008hr032i960ess0","name":"Roxanne Kuphal IV"},"assignmentStatus":"ACTIVE","presenceStatus":"NOT_PRESENT","arrivedAt":null,"leftAt":null},{"user":{"id":"cluhgramk008gr032sg02za9a","name":"Ms. Sophie DuBuque"},"assignmentStatus":"ACTIVE","presenceStatus":"NOT_PRESENT","arrivedAt":null,"leftAt":null},{"user":{"id":"cluhgralj0036r032f0bv5pmf","name":"Darla McCullough"},"assignmentStatus":"ACTIVE","presenceStatus":"NOT_PRESENT","arrivedAt":null,"leftAt":null},{"user":{"id":"cluhgramk008ir0320fe5fkal","name":"Anne Powlowski"},"assignmentStatus":"SIGNED_OFF","presenceStatus":"LEFT","arrivedAt":null,"leftAt":null},{"user":{"id":"cluhgramk008cr032e0znk7dg","name":"Dominick Carroll"},"assignmentStatus":"ACTIVE","presenceStatus":"PRESENT","arrivedAt":null,"leftAt":null}]}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"title":"","type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"}},"required":["message","code"]},"examples":{"1":{"summary":"Unauthorized","value":{"message":"Unauthorized","code":"UNAUTHORIZED"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"examples":{"1":{"summary":"Record not found","value":{"code":"SERVER_ERROR","message":"That's not your fault, we are working on repair."}}}}}}},"security":[{"bearer":[]}]}}},"components":{"schemas":{"Category":{"type":"object","properties":{"id":{"type":"string","description":"ID","format":"uu"},"name":{"type":"string"},"icon":{"type":"string"},"colorVariant":{"type":"string","enum":["CHERRY","LEMON","LIME","APPLE","ORANGE"]}},"required":["id","name","icon","colorVariant"]},"Location":{"properties":{"locationLat":{"type":"number","minimum":-180,"maximum":180},"locationLon":{"type":"number","minimum":-180,"maximum":180},"address":{"type":"string"},"city":{"type":"string"},"name":{"type":"string"}},"type":"object","required":["locationLat","locationLon","address","city"]},"EventCard":{"type":"object","properties":{"id":{"type":"string","format":"uu"},"name":{"type":"string"},"happeningAt":{"type":"string","format":"date"},"thumbnailURL":{"type":"string","format":"url"},"Location":{"$ref":"#/components/schemas/Location"},"sallaryType":{"type":"string","enum":["MONEY","GOODS"]},"sallaryAmount":{"type":"number","format":"float"},"sallaryUnit":{"type":"string","nullable":true},"sallaryProductName":{"type":"string","nullable":true},"status":{"type":"string","default":"'CREATED'","enum":["CREATED","PROGRESS","ARCHIVED","CANCELLED"]},"User":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"EventCategoryRelation":{"type":"array","items":{"type":"object","properties":{"EventCategory":{"$ref":"#/components/schemas/Category"}},"required":["EventCategory"]}}},"required":["id","name","happeningAt","sallaryType","status","sallaryAmount","User","Location","EventCategoryRelation"]},"User":{"properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"avatarURL":{"type":"string"},"createdAt":{"default":"CURRENT_TIMESTAMP","type":"string"},"phoneNumber":{"type":"string"},"type":{"type":"string","enum":["WORKER","COMPANY"]},"verificationToken":{"type":"string"},"password":{"type":"string"}},"type":"object","required":["id","email","name","createdAt","type","password"]},"HarmonogramItem":{"properties":{"createdAt":{"default":"CURRENT_TIMESTAMP","type":"string"},"from":{"type":"string"},"to":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"}},"type":"object","required":["createdAt","from","to","title"]},"Event":{"type":"object","properties":{"id":{"type":"string","format":"uu"},"name":{"type":"string"},"description":{"type":"string"},"happeningAt":{"type":"string","format":"date"},"thumbnailURL":{"type":"string","format":"url"},"capacity":{"type":"integer","minimum":0},"Location":{"$ref":"#/components/schemas/Location"},"sallaryType":{"type":"string","enum":["MONEY","GOODS"]},"sallaryAmount":{"type":"number","format":"float"},"sallaryUnit":{"type":"string","nullable":true},"sallaryProductName":{"type":"string","nullable":true},"toolingRequired":{"type":"string","nullable":true},"toolingProvided":{"type":"string","nullable":true},"status":{"type":"string","default":"'CREATED'","enum":["CREATED","PROGRESS","ARCHIVED","CANCELLED"]},"User":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"EventCategoryRelation":{"type":"array","items":{"type":"object","properties":{"EventCategory":{"type":"object","properties":{"id":{"type":"string","description":"ID","format":"uu"},"name":{"type":"string"},"icon":{"type":"string"},"colorVariant":{"type":"string","enum":["CHERRY","LEMON","LIME","APPLE","ORANGE"]}},"description":"ID","required":["id","name","icon","colorVariant"]}},"required":["EventCategory"]}},"_count":{"type":"object","properties":{"EventAssignment":{"type":"integer","minimum":0}},"required":["EventAssignment"]},"isOwnedByUser":{"type":"boolean"},"isUserSignedIn":{"type":"boolean"}},"required":["id","name","happeningAt","sallaryType","status","sallaryAmount","User","Location","EventCategoryRelation","description","capacity","_count","isOwnedByUser","isUserSignedIn"]},"AnnouncementItem":{"properties":{"id":{"type":"string"},"createdAt":{"default":"CURRENT_TIMESTAMP","type":"string"},"eventId":{"type":"string"},"userId":{"type":"string"},"message":{"type":"string"}},"type":"object","required":["id","createdAt","eventId","userId","message"]}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"servers":[{"url":"http://localhost:3000","description":"Develop Env"},{"url":"https://mtaa.martinvanco.sk","description":"Prod Env"}]} \ No newline at end of file