{"openapi":"3.0.1","info":{"version":"1.0.0","title":"5S Leilões","description":""},"security":[{"password":["read","write"]}],"paths":{"/api/profile/general":{"get":{"summary":"Get general info about user","tags":["Profile information"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number","example":23094},"email":{"type":"string","example":"example@example.com"},"firstName":{"type":"string","example":"Ivan"},"lastName":{"type":"string","example":"Petrov"},"phone":{"type":"string","example":"79061111111"}}}}}},"401":{"description":"Unauthorized"}}}},"/api/profile/full":{"get":{"summary":"Get full info about user","tags":["Profile information"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number","example":23094},"email":{"type":"string","example":"example@example.com"},"firstName":{"type":"string","example":"Ivan"},"lastName":{"type":"string","example":"Petrov"},"phone":{"type":"string","example":"79061111111"},"hasBloodResults":{"type":"boolean","example":true},"hasDnaResults":{"type":"boolean","example":true},"fitbitConnected":{"type":"boolean","example":true}}}}}},"401":{"description":"Unauthorized"}}}},"/api/auth/createAccount":{"post":{"summary":"Create new account","tags":["Account creation"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string","example":"Adam"},"lastName":{"type":"string","example":"Smith"},"email":{"type":"string","example":"adamsmith@example.com"},"password":{"type":"string","example":"TWsT3t5qqwrer"},"verifyPassword":{"type":"string","example":"TWsT3t5qqwrer"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","example":"7c8e4efa50b36939967e7091abc538285f29685d"},"expires_in":{"type":"number","example":86400},"token_type":{"type":"string","example":"Bearer"},"scope":{"type":"string","example":"Basic"},"refresh_token":{"type":"string","example":"7c8e4efa50b36939967e7091abc538285f29685d"}}}}}},"422":{"description":"Data Validation Failed","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","example":"customer-email"},"message":{"type":"string","example":"Please use a different email address"}}}}}}},"401":{"description":"Unauthorized"}}}},"/api/questionnaire/getPassingStatus":{"get":{"summary":"Get passing status","tags":["Questionnaire flow"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"currentStep":{"type":"string","example":"start"}}}}}},"401":{"description":"Unauthorized"}}}},"/api/questionnaire/setPassingStatus":{"post":{"summary":"Set passing status","tags":["Questionnaire flow"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","example":"start"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"}}}}}},"422":{"description":"Data Validation Failed","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","example":"status"},"message":{"type":"string","example":"Status is empty"}}}}}}},"401":{"description":"Unauthorized"}}}},"/api/questionnaire/gender":{"get":{"summary":"Get gender info","tags":["Questionnaire flow"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","example":"Male"},"value":{"type":"string","example":"m"}}}},"value":{"type":"string","example":"m"}}}}}},"401":{"description":"Unauthorized"}}}},"/api/questionnaire/saveGender":{"post":{"summary":"Save gender","tags":["Questionnaire flow"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","example":"m"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"}}}}}},"422":{"description":"Data Validation Error","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","example":"value"},"message":{"type":"string","example":"Not supported value"}}}}}}},"401":{"description":"Unauthorized"}}}},"/api/questionnaire/birthdate":{"get":{"summary":"Get birth date","tags":["Questionnaire flow"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","example":"1994-12-27"}}}}}},"401":{"description":"Unauthorized"}}}},"/api/questionnaire/saveBirthdate":{"post":{"summary":"Save birth date","tags":["Questionnaire flow"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","example":"1995-01-01"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"}}}}}},"422":{"description":"Data Validation Error","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","example":"value"},"message":{"type":"string","example":"Date format is not valid"}}}}}}},"401":{"description":"Unauthorized"}}}},"/api/questionnaire/getFoodConstraints":{"get":{"summary":"Get food constrains","tags":["Questionnaire flow"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","example":"Vegetarian"},"value":{"type":"string","example":"vegetarian"}}}},"values":{"description":"Selected values","type":"array","items":{"type":"string","example":"vegan"}}}}}}},"401":{"description":"Unauthorized"}}}},"/api/questionnaire/saveFoodConstraints":{"post":{"summary":"Save food constrains","tags":["Questionnaire flow"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","example":"vegan"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"}}}}}},"401":{"description":"Unauthorized"}}}},"/api/questionnaire/getEatFoods":{"get":{"summary":"Get foods that user eats","tags":["Questionnaire flow"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"values":{"description":"Food ids","type":"array","items":{"type":"number","example":2},"example":[1,2,3]}}}}}},"401":{"description":"Unauthorized"}}}},"/api/questionnaire/getNeverEatFoods":{"get":{"summary":"Get never eat foods","tags":["Questionnaire flow"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","example":"Beans"},"value":{"type":"number","example":4}}}},"values":{"description":"Selected values","type":"array","items":{"type":"number","example":2},"example":[1,2,3]}}}}}},"401":{"description":"Unauthorized"}}}},"/api/questionnaire/saveNeverEatFoods":{"post":{"summary":"Save never eat foods","tags":["Questionnaire flow"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"values":{"type":"array","items":{"type":"number"},"example":[1,3]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"}}}}}},"401":{"description":"Unauthorized"}}}},"/api/questionnaire/getFoodFrequency/{foodId}":{"get":{"summary":"Get food frequency by food ID","tags":["Questionnaire flow"],"parameters":[{"name":"foodId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"foodName":{"type":"string","example":"Beverages"},"fields":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","example":"≤ 1 per week"},"value":{"type":"number","example":1}}}},"values":{"type":"number","example":2}}}}}},"401":{"description":"Unauthorized"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Food not found"}}}}}}}}},"/api/questionnaire/saveFoodFrequency":{"post":{"summary":"Save food frequency by food ID","tags":["Questionnaire flow"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"foodId":{"type":"number","example":1},"value":{"type":"number","example":1}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"}}}}}},"401":{"description":"Unauthorized"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Food not found"}}}}}},"422":{"description":"Data Validation Error","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","example":"value"},"message":{"type":"string","example":"Not supported value"}}}}}}}}}},"/api/auth/sendVerificationCode":{"post":{"summary":"Send verification code","tags":["Recovery password flow"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","example":"test@example.com"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"User not found"}}}}}}}}},"/api/auth/checkVerificationCode":{"post":{"summary":"Check verification code","tags":["Recovery password flow"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","example":"test@example.com"},"code":{"type":"string","example":"25212"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"User not found"}}}}}},"422":{"description":"Data Validation Error","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","example":"code"},"message":{"type":"string","example":"Code is invalid"}}}}}}}}}},"/api/auth/resetPassword":{"post":{"summary":"Reset password","tags":["Recovery password flow"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","example":"test@example.com"},"code":{"type":"string","example":"25212"},"password":{"type":"string","example":"dh28e1hjwgqu"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"success"}}}}}},"422":{"description":"Data Validation Error","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","example":"password"},"message":{"type":"string","example":"Password should contain at least 5 unique characters"}}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"User not found"}}}}}}}}},"/api/auth/passwordRecoveryQuestion":{"post":{"summary":"Get security question","tags":["Request password recovery flow"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","example":"test@example.com"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","example":"How old are you?"}}}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Instructions sent."}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"User not found"}}}}}}}}},"/api/auth/passwordRecovery":{"post":{"summary":"Request instructions for recovery","tags":["Request password recovery flow"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","example":"test@example.com"},"answer":{"type":"string","example":"Moscow"},"reirectUrl":{"type":"string","example":"app://recovery-page/"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","example":"Instructions sent"}}}}}},"422":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Invalid email or answer"}}}}}}}}},"/api/blood/getLatestPhysioResult/{markerAbbr}":{"get":{"summary":"NEED TO DUSCUSS Returns PhysioMarker object for the given abbreviation","tags":["Blood results"],"parameters":[{"in":"header","name":"Authorization","schema":{"type":"string"},"required":true},{"in":"path","name":"markerAbbr","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"PhysioMarker objects for the given abbreviation"}}}},"/api/blood/getAllPhysioResults/{markerAbbr}":{"get":{"summary":"NEED TO DUSCUSS Returns the array of PhysioMarker objects for the given abbreviation","tags":["Blood results"],"parameters":[{"in":"header","name":"Authorization","schema":{"type":"string"},"required":true},{"in":"path","name":"markerAbbr","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"array of PhysioMarker objects for the given abbreviation"}}}},"/api/blood/markers":{"get":{"summary":"Returns the array of markers","tags":["Blood results"],"responses":{"200":{"description":"array of markers","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BloodMarker"}}}}}}}},"/api/blood/results":{"get":{"summary":"Returns the array of results","tags":["Blood results"],"responses":{"200":{"description":"array of markers","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BloodResult"}}}}}}}},"/api/physio/markers":{"get":{"summary":"Returns the array of physio markers","tags":["Physio results"],"responses":{"200":{"description":"array of markers","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PhysioMarker"}}}}}}}},"/api/physio/results":{"get":{"summary":"Returns the array of results","tags":["Physio results"],"responses":{"200":{"description":"array of markers","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PhysioDailyResults"}}}}}}}},"/api/dna/getDNA":{"get":{"summary":"Returns DNA data [NOT IMPLEMENTED]","tags":["DNA"],"parameters":[{"in":"header","name":"Authorization","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"DNA data"}}}}},"components":{"schemas":{"BloodResult":{"type":"object","properties":{"id":{"type":"number","example":11432},"dateTested":{"type":"number","example":1583940906},"markerValues":{"type":"array","items":{"$ref":"#/components/schemas/BloodMarkerValue"}}}},"PhysioDailyResults":{"type":"object","properties":{"dateTested":{"type":"number","example":1583940906},"markerValues":{"type":"array","items":{"$ref":"#/components/schemas/PhysioMarkerValue"}}}},"BloodMarkerValue":{"type":"object","properties":{"id":{"type":"number","example":1214},"markerId":{"type":"number","example":1},"absoluteValue":{"type":"number","example":12.4},"currentState":{"type":"number","example":-1},"ranges":{"$ref":"#/components/schemas/BloodMarkerRanges"}}},"PhysioMarkerValue":{"type":"object","properties":{"id":{"type":"number","example":1214},"markerId":{"type":"number","example":1},"source":{"type":"string","enum":["fitbit","profile"],"example":"fitbit"},"absoluteValue":{"type":"number","example":12.4},"currentState":{"type":"number","example":-1},"ranges":{"$ref":"#/components/schemas/BloodMarkerRanges"}}},"BloodMarkerRanges":{"type":"object","properties":{"minG":{"type":"number","example":5},"maxG":{"type":"number","example":5},"maxBorderLine":{"type":"number","example":5},"minBorderLine":{"type":"number","example":5},"maxNearNormal":{"type":"number","example":5},"minNearNormal":{"type":"number","example":5}}},"BloodMarker":{"type":"object","properties":{"id":{"type":"number","example":1},"abbr":{"type":"string","example":"Glu"},"name":{"type":"string","example":"Glucose"},"unit":{"type":"string","example":"mg/dl"}}},"PhysioMarker":{"type":"object","properties":{"id":{"type":"number","example":1},"abbr":{"type":"string","example":"RHR"},"name":{"type":"string","example":"Resting Heart Rate"},"precision":{"type":"integer","example":2}}}},"securitySchemes":{"password":{"type":"oauth2","flows":{"password":{"tokenUrl":"https://dev4.segterra.com/customer/oauth/token","scopes":{"write":"allows modifying resources","read":"allows reading resources"}}}}}},"servers":[{"url":"https://virtserver.swaggerhub.com/Lohn/5sleiloes/1.0.0","description":"Auto Mock"}]}