{"swagger":"2.0","info":{"description":"4 Drivers API definition\n","version":"1.0.1","title":"4Drivers","termsOfService":"http://swagger.io/terms/","contact":{"email":"smorales@fiveflamesmobile.com"}},"tags":[{"name":"Users","description":"User endpoints"},{"name":"Providers","description":"Provider endpoints"},{"name":"Services","description":"Services endpoints"},{"name":"Vehicles","description":"Vehicles endpoints"},{"name":"Documents","description":"Documents related endpoints."},{"name":"Tickets","description":"Ticket related endpoints."},{"name":"Issues","description":"Issue related endpoints"}],"securityDefinitions":{"petstore_auth":{"type":"oauth2","authorizationUrl":"http://petstore.swagger.io/oauth/dialog","flow":"implicit","scopes":{"write:provider":"modify in your account","read:provider":"read your acount"}},"api_key":{"type":"apiKey","name":"api_key","in":"header"}},"paths":{"/provider":{"get":{"tags":["Providers"],"summary":"Providers list","description":"Retrieves a list of available providers","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"}],"responses":{"200":{"description":"List of providers","schema":{"type":"array","items":{"$ref":"#/definitions/Provider"},"example":[{"idProvider":"357b3048-79f6-11ec-90d6-0242ac120003","idCLEAR":"357b32fads-79f6-11ec-90d6-0242ac120003","name":"First provider name"},{"idProvider":"357b3123-79f6-11ec-90d6-0242ac120003","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac120003","name":"Second provider name"},{"idProvider":"357b3123-79f6-11ec-90d6-0242ac1200413","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac12321403","name":"Long name for a provider S.L.U."},{"idProvider":"357b3123-79f6-11ec-90d6-0242ac41200413","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41221403","name":"Name"},{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"}]}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"post":{"tags":["Providers"],"summary":"Create provider","description":"Create a new provider. It must log who and when created this provider","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"provider","in":"body","description":"Information of the new provider","required":true,"schema":{"$ref":"#/definitions/Provider"}}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/provider/{idProvider}":{"get":{"tags":["Providers"],"summary":"Provider's detail","description":"Retrieves all the information available of a selected provider","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idProvider","in":"path","description":"Provider's UUID","required":true,"type":"string"}],"responses":{"200":{"description":"Provider information","schema":{"$ref":"#/definitions/Provider"}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"delete":{"tags":["Providers"],"summary":"Delete provider","description":"Deletes logically the selected provider. It must log who and when deleted this provider","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idProvider","in":"path","description":"Provider's UUID","required":true,"type":"string"}],"responses":{"204":{"description":"Provider deleted"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"put":{"tags":["Providers"],"summary":"Updates provider","description":"Updates an existing provider. It must log who and when this provider is updated","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idProvider","in":"path","description":"Provider's UUID","required":true,"type":"string"},{"name":"provider","in":"body","description":"Information to update the provider","required":true,"schema":{"$ref":"#/definitions/Provider"}}],"responses":{"204":{"description":"Provider updated"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/user":{"get":{"tags":["Users"],"summary":"List users","description":"Only available by the superadmin of the middleware. It retrieves all the users of the platform","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"}],"responses":{"200":{"description":"List of users","schema":{"type":"array","items":{"$ref":"#/definitions/User"},"example":[{"idUser":"9609ccff-7e95-4dc9-9942-ce6989710868","name":"Lorem Ipsum","email":"lorem.ipsum@providerone.com","role":"driver","active":true,"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"}},{"idUser":"9609ccff-7e95-4dc9-9942-ce6989741343","name":"Lorem Ipsum-Dolor","email":"lorem.ipsum@longemailforaprovider.com","role":"driver","active":true,"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"}},{"idUser":"9609ccff-7e95-4dc9-9942-ce69897412345","name":"Lorem Ipsum-Dolor","email":"lorem.ipsum@longemailforaprovider.com","role":"driver","active":true,"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"}},{"idUser":"9609ccff-7e95-4dc9-9942-ce69897412215","name":"Sic Amet","email":"lorem.ipsum@longemailforaprovider.com","role":"driver","active":true,"provider":{"idProvider":"357b3048-79f6-11ec-90d6-0242ac120003","idCLEAR":"357b32fads-79f6-11ec-90d6-0242ac120003","name":"First provider name"}},{"idUser":"960941ff-7e95-4dc9-9942-ce69897412345","name":"Jhon McEnroe's","email":"lorem.ipsum@longemailforaprovider.com","role":"driver","active":true,"provider":{"idProvider":"357b3048-79f6-11ec-90d6-0242ac120003","idCLEAR":"357b32fads-79f6-11ec-90d6-0242ac120003","name":"First provider name"}}]}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"post":{"tags":["Users"],"summary":"Create a new user","description":"Create a new user. It must log who and when created this user. Once created, the platform must send an email to the user so he/she can configure the pasword \n   Depending on the role we must check the user's role.\n   - If role=admin the user's role must be also admin. Provider must be null.\n   - If role=providerAdmin the user's role must be admin or providerAdmin. Provider must be informed\n   - If role=routeManger the user's role must be providerAdmin. Provider must be informed\n   - If role=driver the user's role must be admin, providerAdmin or routeManger. Provider must be informed\n   \n","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"provider","in":"body","description":"Information of the new user","required":true,"schema":{"$ref":"#/definitions/User"}}],"responses":{"204":{"description":"User created"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/user/resetPassword":{"post":{"tags":["Users"],"summary":"Reset password","description":"Send a link to the specified email to reset the user's password, only if the user previously exists in the platform","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"email","in":"body","description":"Email used for log in.","required":true,"schema":{"properties":{"email":{"type":"string","description":"User's email"}}}}],"responses":{"204":{"description":"Email sent for resetting password"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/services/pushfromclear":{"post":{"tags":["Services"],"summary":"Receive a list of services to force their update in pre-drivers; this method will send a request to CLEAR every time it is invoked","description":"Receive a list of services to force their update in pre-drivers; this method will send a request to CLEAR every time it is invoked","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"services","in":"body","description":"Array de servicios","required":true,"schema":{"type":"array","items":{"type":"string"},"example":[{"action":"A","orderId":"165432342","orderLineId":"651134123","provider":"66589","date":"29/11/2023"},{"action":"C","orderId":"165432343","orderLineId":"651134456","provider":"66589","date":"29/11/2023"},{"action":"D","orderId":"165432344","orderLineId":"651134789","provider":"66589","date":"29/11/2023"}]}}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/user/{idUser}":{"get":{"tags":["Users"],"summary":"User Detail","description":"Retrieves all the information available of a selected user This endpoint must check if the logged in user belongs to the specified provider or have an admin role","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idUser","in":"path","description":"User's UUID","required":true,"type":"string"}],"responses":{"200":{"description":"User information","schema":{"$ref":"#/definitions/User"}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"delete":{"tags":["Users"],"summary":"Delete provider","description":"Deletes logically the selected user. It must log who and when deleted this user This endpoint must check if the logged in user belongs to the specified provider or have an admin role","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idUser","in":"path","description":"User's UUID","required":true,"type":"string"}],"responses":{"204":{"description":"User deleted"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"put":{"tags":["Users"],"summary":"Update user","description":"Updates an existing user. It must log who and when this provider is updated This endpoint must check if the logged in user belongs to the specified provider or have an admin role","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idUser","in":"path","description":"User's UUID","required":true,"type":"string"},{"name":"user","in":"body","description":"Information to update the user","required":true,"schema":{"$ref":"#/definitions/User"}}],"responses":{"204":{"description":"User updated"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/provider/{idProvider}/user":{"get":{"tags":["Users"],"summary":"List user by provider","description":"Retrieves a list of all registered users in the platform for a specific provider. Only available by the providers of the middleware. It retrieves all the users of the platform that belongs to the specified provider This endpoint must check if the logged in user belongs to the specified provider","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idProvider","in":"path","description":"Provider's UUID","required":true,"type":"string"}],"responses":{"200":{"description":"List of users of the specfied provider","schema":{"type":"array","items":{"$ref":"#/definitions/User"},"example":[{"idUser":"9609ccff-7e95-4dc9-9942-ce6989710868","name":"Lorem Ipsum","email":"lorem.ipsum@providerone.com","role":"driver","active":true,"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"}},{"idUser":"9609ccff-7e95-4dc9-9942-ce6989741343","name":"Lorem Ipsum-Dolor","email":"lorem.ipsum@longemailforaprovider.com","role":"driver","active":true,"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"}},{"idUser":"9609ccff-7e95-4dc9-9942-ce69897412345","name":"Lorem Ipsum-Dolor","email":"lorem.ipsum@longemailforaprovider.com","role":"driver","active":true,"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"}}]}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/provider/{idProvider}/user/{idUser}/assignServices":{"post":{"tags":["Services"],"summary":"Assign services to user","description":"Assigns multiple services to the specified user. The user must have Driver role.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idProvider","in":"path","description":"Provider's UUID","required":true,"type":"string"},{"name":"idUser","in":"path","description":"User's UUID","required":true,"type":"string"},{"name":"services","in":"body","description":"Array of service's UUID to be assigned to this vehicle","required":true,"schema":{"type":"array","items":{"type":"string"},"example":["4313efdasf-af431241-fafa","fdafa-fadfafdad-431411"]}}],"responses":{"204":{"description":"Services assigned"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/vehicle":{"get":{"tags":["Vehicles"],"summary":"List vehicles","description":"Returns an array of vehicles. Only available for admin users","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/Vehicle"}}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/provider/{idProvider}/vehicle":{"post":{"tags":["Vehicles"],"summary":"Create vehicle","description":"Create a new vehicle. It must log who and when created this vehicle . This service must check if the user who creates the vehicle is providerAdmin or routeManager and belongs to the specified provider","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idProvider","in":"path","type":"string","required":true,"description":"Provider's UUID"},{"name":"vehicle","in":"body","description":"Information of the new vehicle","required":true,"schema":{"$ref":"#/definitions/Vehicle"}}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"get":{"tags":["Vehicles"],"summary":"Vehicles by provider","description":"Returns an array of providers for a specific provider. This service must check if the user who creates the vehicle is providerAdmin or routeManager and belongs to the specified provider","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idProvider","in":"path","description":"Provider's UUID","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/Vehicle"},"example":[{"idVehicle":"7a74e153-a641-432d-9952-da51d7fae1b9","licensePlate":"8888 ABC","carrier":"123456789012345678901234567","motorized":true,"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"},"active":true},{"idVehicle":"7a74e153-a641-2hs8-9952-da51d7fae1b9","licensePlate":"1234 ABC","carrier":"123456789012345678901234567","motorized":false,"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"},"active":false},{"idVehicle":"7a74e9b3-a641-432d-9952-da51d7fae1b9","licensePlate":"9876 CBD","carrier":"123456789012345678901234567","motorized":false,"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"},"active":true},{"idVehicle":"7a74e9b3-a641-432d-9952-da51d7fae1b9","licensePlate":"3210 ZZZ","carrier":"123456789012345678901234567","motorized":true,"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"},"active":false}]}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/provider/{idProvider}/vehicle/{idVehicle}/assignServices":{"post":{"tags":["Services"],"summary":"Assigns services to vehicle","description":"Assigns multiple services to the specified vehicle. The user must have Driver role.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idProvider","in":"path","description":"Provider's UUID","required":true,"type":"string"},{"name":"idVehicle","in":"path","description":"Vehicle's UUID","required":true,"type":"string"},{"name":"services","in":"body","description":"Array of service's UUID to be assigned to this vehicle","required":true,"schema":{"type":"array","items":{"type":"string"},"example":["4313efdasf-af431241-fafa","fdafa-fadfafdad-431411"]}}],"responses":{"204":{"description":"Services assigned"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/provider/{idProvider}/vehicle/{idVehicle}":{"get":{"tags":["Vehicles"],"summary":"Vehicle detail","description":"Retrieves all the information available of a selected vehicle","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idProvider","in":"path","description":"Provider's UUID","required":true,"type":"string"},{"name":"idVehicle","in":"path","description":"Vehicle's UUID","required":true,"type":"string"}],"responses":{"200":{"description":"Vehicle retrieved","schema":{"$ref":"#/definitions/Vehicle"}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"delete":{"tags":["Vehicles"],"summary":"Delete vehicle","description":"Deletes logically the selected vehicle. It must log who and when deleted this provider. This service must check if the user who creates the vehicle is providerAdmin or routeManager and belongs to the specified provider","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idProvider","in":"path","description":"Provider's UUID","required":true,"type":"string"},{"name":"idVehicle","in":"path","description":"Vehicles's UUID","required":true,"type":"string"}],"responses":{"204":{"description":"Vehicle deleted"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"put":{"tags":["Vehicles"],"summary":"Update vehicle","description":"Updates an existing vehicle. It must log who and when this vehicle is updated. This service must check if the user who creates the vehicle is providerAdmin or routeManager and belongs to the specified provider","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idProvider","in":"path","type":"string","required":true,"description":"Provider's UUID"},{"name":"idVehicle","in":"path","description":"Vehicle's UUID","required":true,"type":"string"},{"name":"vehicle","in":"body","description":"Information to update the vehicle","required":true,"schema":{"$ref":"#/definitions/Vehicle"}}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/serviceFilters":{"get":{"tags":["Services"],"summary":"Retrieves the values for the service filters form.","description":"Return the arrays of possible values for the providers and available waste types.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/ServiceFilter"}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/service":{"get":{"tags":["Services"],"summary":"Retrieves a list of services","description":"Returns an array of all services that complain with the specified filters.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"filterProvider","in":"query","description":"Provider's unique UUID","required":false,"type":"string"},{"name":"filterStatus","in":"query","description":"Service's status. Use the enums defined on \"#/definitions/ServiceStatus\"","required":false,"type":"string"},{"name":"filterDateFrom","in":"query","description":"Service's with date equal or later than the specified date.","required":false,"type":"string","format":"yyyy-MM-dd"},{"name":"filterDateUntil","in":"query","description":"Service's with date equal or later than the specified date.","required":false,"type":"string","format":"yyyy-MM-dd"},{"name":"filterWasteType","in":"query","description":"Service's waste type","required":false,"type":"string"},{"name":"filter","in":"query","description":"Service's that match part or the whole word in any of the fields deliveryNote, client, destination, description.","required":false,"type":"string"},{"name":"filterOpenClosed","in":"query","required":true,"type":"string","description":"- \"open\" shows the services with status pending|inProgress|paused. \n- \"close\" shows the services sith status finished|failed\n"}],"responses":{"200":{"description":"List of services","schema":{"type":"array","items":{"$ref":"#/definitions/Service"},"example":[{"idService":"b5f89ebf-b6e4-4ea4-b441-077548a038b9","deliveryNote":"A 1234567","date":"2022-02-01 15:30:00","client":"Nombre del cliente","destination":"Nombre de la planta de residuos","description":"Recogida de residuos solidos alimentarios y traslado a planta de procesamiento","contactMail":"mail@contacto.com","contactPhone":"+34123456789","vehicle":{"idVehicle":"7a74e153-a641-432d-9952-da51d7fae1b9","licensePlate":"8888 ABC","carrier":"123456789012345678901234567","motorized":true,"active":true},"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"},"additionalInfo":"Información adicional para el condcutor.","DI":"123456789012345678901234567","comments":"Comentarios sobre el servicio","status":"pending","documents":[{"idDocument":"de45e6a1-06a1-451b-8795-7ad799e90688","documentType":"DI","name":"Carta de porte","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"},{"idDocument":"de45e6a1-06a1-451b-8795-7ad7929j0688","documentType":"DeliveryNote","name":"Albarán","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"}],"serviceAmounts":[{"idServiceAmount":"2a6979d2-82af-43e4-a74b-c5b969ec6a2b","description":"Recogida de residuos soliddos y traslado a la planta de tratamiento","amount":1,"idWaste":"SOLID_ALIMENTS","wasteName":"Residuo de alimento sólido","DI":"123456789012345678901234567"}]},{"idService":"b57ec5d6-54f5-49cb-90d3-ded85685c431","deliveryNote":"A-12345677","date":"2022-02-02 10:30:00","client":"Nombre del cliente 2","destination":"Nombre de la planta de residuos","description":"Recogida de residuos solidos alimentarios y traslado a planta de procesamiento","contactMail":"mail.masloargo@dominiodelcontacto.com","contactPhone":"+34123456789","vehicle":{"idVehicle":"7a74e153-a641-432d-9952-da51d7fae1b9","licensePlate":"8888 ABC","carrier":"123456789012345678901234567","motorized":true,"active":true},"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"},"additionalInfo":"Información adicional para el condcutor.","DI":"123456789012345678901234567","comments":"Comentarios sobre el servicio","status":"inProgress","documents":[{"idDocument":"de45e6a1-06a1-451b-8795-7ad799e90688","documentType":"DI","name":"Carta de porte","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"},{"idDocument":"de45e6a1-06a1-451b-8795-7ad7929j0688","documentType":"DeliveryNote","name":"Albarán","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"}],"serviceAmounts":[{"idServiceAmount":"2a6979d2-82af-43e4-a74b-c5b969ec6a2b","description":"Recogida de residuos soliddos y traslado a la planta de tratamiento","amount":1,"idWaste":"SOLID_ALIMENTS","wasteName":"Residuo de alimento sólido","DI":"123456789012345678901234567"}],"tickets":[{"idTicket":"18c1d5e6-fc62-4b76-9b6b-89b45b6bb7a4","numTicket":"1","amount":1,"idWaste":"SOLID_ALIMENTS","wasteName":"Residuo de alimento sólido","urlPhoto":"https://4drivers.fiveflamesmobile.com/images/serviceid/ticketId/image1.jpg","DI":"123456789012345678901234567","basculaPrezero":false}]},{"idService":"309c671e-e0b0-44e1-ae6e-9cff9b597d97","deliveryNote":"A-12345677","date":"2022-02-02 10:30:00","client":"Nombre del cliente 3","destination":"Nombre de la planta de residuos","description":"Recogida de residuos solidos alimentarios y traslado a planta de procesamiento","contactMail":"mail.masloargo@dominiodelcontacto.com","contactPhone":"+34123456789","vehicle":{"idVehicle":"7a74e153-a641-432d-9952-da51d7fae1b9","licensePlate":"8888 ABC","carrier":"123456789012345678901234567","motorized":true,"active":true},"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"},"additionalInfo":"Información adicional para el condcutor.","DI":"123456789012345678901234567","comments":"Comentarios sobre el servicio","status":"failed","documents":[{"idDocument":"de45e6a1-06a1-451b-8795-7ad799e90688","documentType":"DI","name":"Carta de porte","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"},{"idDocument":"de45e6a1-06a1-451b-8795-7ad7929j0688","documentType":"DeliveryNote","name":"Albarán","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"}],"serviceAmounts":[{"idServiceAmount":"2a6979d2-82af-43e4-a74b-c5b969ec6a2b","description":"Recogida de residuos soliddos y traslado a la planta de tratamiento","amount":1,"idWaste":"SOLID_ALIMENTS","wasteName":"Residuo de alimento sólido","DI":"123456789012345678901234567","basculaPrezero":false}],"issues":[{"idIssue":"7dda3a4e-2ee0-4bf2-a7d2-23151c3fa89e ","text":"El contenedor estaba dañado","photos":["https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image1.jpg","https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image2.jpg","https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image3.jpg"],"date":"2022-02-01 15:47:32","location":{"latitude":41.6499052,"longitude":-4.7290731}}]},{"idService":"6a136c6d-5941-44ca-abee-4511947fccc5","deliveryNote":"A-12345677","date":"2022-02-02 10:30:00","client":"Nombre del cliente 2","destination":"Nombre de la planta de residuos","description":"Recogida de residuos solidos alimentarios y traslado a planta de procesamiento","contactMail":"mail.masloargo@dominiodelcontacto.com","contactPhone":"+34123456789","vehicle":{"idVehicle":"7a74e153-a641-432d-9952-da51d7fae1b9","licensePlate":"8888 ABC","carrier":"123456789012345678901234567","motorized":true,"active":true},"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"},"additionalInfo":"Información adicional para el condcutor.","DI":"123456789012345678901234567","comments":"Comentarios sobre el servicio","status":"finished","documents":[{"idDocument":"de45e6a1-06a1-451b-8795-7ad799e90688","documentType":"DI","name":"Carta de porte","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"},{"idDocument":"de45e6a1-06a1-451b-8795-7ad7929j0688","documentType":"DeliveryNote","name":"Albarán","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"}],"serviceAmounts":[{"idServiceAmount":"2a6979d2-82af-43e4-a74b-c5b969ec6a2b","description":"Recogida de residuos soliddos y traslado a la planta de tratamiento","amount":1,"idWaste":"SOLID_ALIMENTS","wasteName":"Residuo de alimento sólido","DI":"123456789012345678901234567","basculaPrezero":false}],"tickets":[{"idTicket":"18c1d5e6-fc62-4b76-9b6b-89b45b6bb7a4","numTicket":"1","amount":1,"idWaste":"SOLID_ALIMENTS","wasteName":"Residuo de alimento sólido","urlPhoto":"https://4drivers.fiveflamesmobile.com/images/serviceid/ticketId/image1.jpg","DI":"123456789012345678901234567"}],"issues":[{"idIssue":"7dda3a4e-2ee0-4bf2-a7d2-23151c3fa89e ","text":"El contenedor estaba dañado","photos":["https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image1.jpg","https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image2.jpg","https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image3.jpg"],"date":"2022-02-01 15:47:32","location":{"latitude":41.6499052,"longitude":-4.7290731}}],"signature":{"idSignature":"f6990950-334f-477d-93f2-f9499bbc9e3a","signerData":"Nombre del firmante","comments":"Sin comentarios","signatureURL":"https://4drivers.fiveflamesmobile.com/images/serviceid/signature/signature.jpg","date":"string","location":{"latitude":"41.6499052,","longitude":-4.7290731}}}]}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"post":{"tags":["Services"],"summary":"Create a new Service","description":"Create a new service. It must log who and when created this vehicle. This web service won't be available (by the moment) in the front-end. It will be only invoked in the synchronization proccess.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"service","in":"body","description":"Information of the new service","required":true,"schema":{"$ref":"#/definitions/Service"}}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/service/{idService}":{"get":{"tags":["Services"],"summary":"Service Detail","description":"Retrieves all the information available of a selected service","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"SErvice's UUID","required":true,"type":"string"}],"responses":{"200":{"description":"Service retrieved","schema":{"$ref":"#/definitions/Service"}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"put":{"tags":["Services"],"summary":"Update service (SOA)","description":"Updates an existing service. It must log who and when this service is updated. This service can be only invoked by the synchronization proccess","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's UUID","required":true,"type":"string"},{"name":"service","in":"body","description":"Information to update the service","required":true,"schema":{"$ref":"#/definitions/Service"}}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"delete":{"tags":["Services"],"summary":"Cancel service (SOA)","description":"(Out of scope, by the moment) Cancels an existing service from SOA. It must log who and when this service is updated. This service can be only invoked by the synchronization proccess","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's UUID","required":true,"type":"string"}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"patch":{"tags":["Services"],"summary":"Update service (Portal)","description":"Updates an existing service. It must log who and when this service is updated. Depending on the role the user can only edit the services that belong to the same provider as him do. - If user is admin. Any service can be edited - If user is providerAdmin, routeManager, he can only edit the services of his provier. - If the user is driver he can only change the date and the status of the service from the app. Only the next fields can be updated - date - vehicle - status","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's UUID","required":true,"type":"string"},{"name":"vehicle","in":"body","description":"Information to update the service","required":true,"schema":{"properties":{"newStatus":{"$ref":"#/definitions/ServiceStatus"},"newIdVehicle":{"type":"string","description":"New assigned vehicle's UUID."},"newDate":{"type":"string","description":"New assigned date","format":"yyyy-MM-dd"}}}}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/provider/{idProvider}/service":{"post":{"tags":["Services"],"summary":"Synchronize services","description":"Synchronizes the services from the app to the middleware. It must log who and when created the services.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idProvider","in":"path","type":"string","required":true},{"name":"service","in":"body","description":"Information of the new service","required":true,"schema":{"type":"array","items":{"$ref":"#/definitions/Service"}}},{"name":"syncWithClear","in":"query","description":"Tells the server if the data shall be synchronized with CLEAR","required":true,"type":"boolean"}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"get":{"tags":["Services"],"summary":"Services by provider","description":"Returns an array of providers for a specific service. This endpoint must check if the logged in user belongs to the specified provider.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idProvider","in":"path","description":"Provider's UUID","required":true,"type":"string"},{"name":"status","in":"query","description":"Service's status. Use the enums defined on \"#/definitions/ServiceStatus\"","required":false,"type":"string"},{"name":"initDate","in":"query","description":"Service's with date equal or later than the specified date.","required":false,"type":"string","format":"yyyy-MM-dd"},{"name":"endDate","in":"query","description":"Service's with date equal or later than the specified date.","required":false,"type":"string","format":"yyyy-MM-dd"},{"name":"wasteType","in":"query","description":"Service's waste type","required":false,"type":"string"},{"name":"text","in":"query","description":"Service's that match part or the whole word in any of the fields deliveryNote, client, destination, description.","required":false,"type":"string"},{"name":"openOrClosed","in":"query","required":true,"type":"string","description":"- \"open\" shows the services with status pending|inProgress|paused. \n- \"close\" shows the services sith status finished|failed\n"}],"responses":{"200":{"description":"List of services","schema":{"type":"array","items":{"$ref":"#/definitions/Service"},"example":[{"idService":"b5f89ebf-b6e4-4ea4-b441-077548a038b9","deliveryNote":"A 1234567","date":"2022-02-01 15:30:00","client":"Nombre del cliente","serviceAddress":"P.I.LLEVANT-C/CAN GUASH 2, 08150 PARETS DEL VALLES","destination":"Nombre de la planta de residuos","description":"Recogida de residuos solidos alimentarios y traslado a planta de procesamiento","contactMail":"mail@contacto.com","contactPhone":"+34123456789","vehicle":{"idVehicle":"7a74e153-a641-432d-9952-da51d7fae1b9","licensePlate":"8888 ABC","carrier":"123456789012345678901234567","motorized":true,"active":true},"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"},"additionalInfo":"Información adicional para el condcutor.","DI":"123456789012345678901234567","comments":"Comentarios sobre el servicio","status":"pending","documents":[{"idDocument":"de45e6a1-06a1-451b-8795-7ad799e90688","documentType":"DI","name":"Carta de porte","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"},{"idDocument":"de45e6a1-06a1-451b-8795-7ad7929j0688","documentType":"DeliveryNote","name":"Albarán","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"}],"serviceAmounts":[{"idServiceAmount":"2a6979d2-82af-43e4-a74b-c5b969ec6a2b","description":"Recogida de residuos soliddos y traslado a la planta de tratamiento","amount":1,"idWaste":"SOLID_ALIMENTS","wasteName":"Residuo de alimento sólido","DI":"123456789012345678901234567"}]},{"idService":"b57ec5d6-54f5-49cb-90d3-ded85685c431","deliveryNote":"A-12345677","date":"2022-02-02 10:30:00","client":"Nombre del cliente 2","serviceAddress":"P.I.LLEVANT-C/CAN GUASH 2, 08150 PARETS DEL VALLES","destination":"Nombre de la planta de residuos","description":"Recogida de residuos solidos alimentarios y traslado a planta de procesamiento","contactMail":"mail.masloargo@dominiodelcontacto.com","contactPhone":"+34123456789","vehicle":{"idVehicle":"7a74e153-a641-432d-9952-da51d7fae1b9","licensePlate":"8888 ABC","carrier":"123456789012345678901234567","motorized":true,"active":true},"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"},"additionalInfo":"Información adicional para el condcutor.","DI":"123456789012345678901234567","comments":"Comentarios sobre el servicio","status":"inProgress","documents":[{"idDocument":"de45e6a1-06a1-451b-8795-7ad799e90688","documentType":"DI","name":"Carta de porte","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"},{"idDocument":"de45e6a1-06a1-451b-8795-7ad7929j0688","documentType":"DeliveryNote","name":"Albarán","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"}],"serviceAmounts":[{"idServiceAmount":"2a6979d2-82af-43e4-a74b-c5b969ec6a2b","description":"Recogida de residuos soliddos y traslado a la planta de tratamiento","amount":1,"idWaste":"SOLID_ALIMENTS","wasteName":"Residuo de alimento sólido","DI":"123456789012345678901234567"}],"tickets":[{"idTicket":"18c1d5e6-fc62-4b76-9b6b-89b45b6bb7a4","numTicket":"1","amount":1,"idWaste":"SOLID_ALIMENTS","wasteName":"Residuo de alimento sólido","urlPhoto":"https://4drivers.fiveflamesmobile.com/images/serviceid/ticketId/image1.jpg","DI":"123456789012345678901234567"}]},{"idService":"309c671e-e0b0-44e1-ae6e-9cff9b597d97","deliveryNote":"A-12345677","date":"2022-02-02 10:30:00","client":"Nombre del cliente 3","serviceAddress":"P.I.LLEVANT-C/CAN GUASH 2, 08150 PARETS DEL VALLES","destination":"Nombre de la planta de residuos","description":"Recogida de residuos solidos alimentarios y traslado a planta de procesamiento","contactMail":"mail.masloargo@dominiodelcontacto.com","contactPhone":"+34123456789","vehicle":{"idVehicle":"7a74e153-a641-432d-9952-da51d7fae1b9","licensePlate":"8888 ABC","carrier":"123456789012345678901234567","motorized":true,"active":true},"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"},"additionalInfo":"Información adicional para el condcutor.","DI":"123456789012345678901234567","comments":"Comentarios sobre el servicio","status":"failed","documents":[{"idDocument":"de45e6a1-06a1-451b-8795-7ad799e90688","documentType":"DI","name":"Carta de porte","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"},{"idDocument":"de45e6a1-06a1-451b-8795-7ad7929j0688","documentType":"DeliveryNote","name":"Albarán","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"}],"serviceAmounts":[{"idServiceAmount":"2a6979d2-82af-43e4-a74b-c5b969ec6a2b","description":"Recogida de residuos soliddos y traslado a la planta de tratamiento","amount":1,"idWaste":"SOLID_ALIMENTS","wasteName":"Residuo de alimento sólido","DI":"123456789012345678901234567"}],"issues":[{"idIssue":"7dda3a4e-2ee0-4bf2-a7d2-23151c3fa89e ","text":"El contenedor estaba dañado","photos":["https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image1.jpg","https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image2.jpg","https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image3.jpg"],"date":"2022-02-01 15:47:32","location":{"latitude":41.6499052,"longitude":-4.7290731}}]},{"idService":"6a136c6d-5941-44ca-abee-4511947fccc5","deliveryNote":"A-12345677","date":"2022-02-02 10:30:00","client":"Nombre del cliente 2","serviceAddress":"P.I.LLEVANT-C/CAN GUASH 2, 08150 PARETS DEL VALLES","destination":"Nombre de la planta de residuos","description":"Recogida de residuos solidos alimentarios y traslado a planta de procesamiento","contactMail":"mail.masloargo@dominiodelcontacto.com","contactPhone":"+34123456789","vehicle":{"idVehicle":"7a74e153-a641-432d-9952-da51d7fae1b9","licensePlate":"8888 ABC","carrier":"123456789012345678901234567","motorized":true,"active":true},"provider":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"},"additionalInfo":"Información adicional para el condcutor.","DI":"123456789012345678901234567","comments":"Comentarios sobre el servicio","status":"finished","documents":[{"idDocument":"de45e6a1-06a1-451b-8795-7ad799e90688","documentType":"DI","name":"Carta de porte","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"},{"idDocument":"de45e6a1-06a1-451b-8795-7ad7929j0688","documentType":"DeliveryNote","name":"Albarán","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"}],"serviceAmounts":[{"idServiceAmount":"2a6979d2-82af-43e4-a74b-c5b969ec6a2b","description":"Recogida de residuos soliddos y traslado a la planta de tratamiento","amount":1,"idWaste":"SOLID_ALIMENTS","wasteName":"Residuo de alimento sólido","DI":"123456789012345678901234567"}],"tickets":[{"idTicket":"18c1d5e6-fc62-4b76-9b6b-89b45b6bb7a4","numTicket":"1","amount":1,"idWaste":"SOLID_ALIMENTS","wasteName":"Residuo de alimento sólido","urlPhoto":"https://4drivers.fiveflamesmobile.com/images/serviceid/ticketId/image1.jpg","DI":"123456789012345678901234567"}],"issues":[{"idIssue":"7dda3a4e-2ee0-4bf2-a7d2-23151c3fa89e ","text":"El contenedor estaba dañado","photos":["https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image1.jpg","https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image2.jpg","https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image3.jpg"],"date":"2022-02-01 15:47:32","location":{"latitude":41.6499052,"longitude":-4.7290731}}],"signature":{"idSignature":"f6990950-334f-477d-93f2-f9499bbc9e3a","signerData":"Nombre del firmante","comments":"Sin comentarios","signatureURL":"https://4drivers.fiveflamesmobile.com/images/serviceid/signature/signature.jpg","date":"string","location":{"latitude":"41.6499052,","longitude":-4.7290731}}}]}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/user/service":{"get":{"tags":["Services"],"summary":"Services by user","description":"Returns an array of future peding services for a specific user. This endpoint must check if the logged in user is a driver and belongs to the specified provider. For security reasons the user UUID is retrieved from the JWT token. This endpoint is only available from the app.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"type":"object","description":"Array of dates with pending services gropued by vehicles.","properties":{"date":{"type":"string","format":"yyyy-mm-dd","description":"Date with pending services."},"services":{"type":"array","description":"Array with the service's basic information to be shown in the list.","items":{"$ref":"#/definitions/Service"}}}},"example":[{"date":"2022-02-01","services":[{"idService":"b5f89ebf-b6e4-4ea4-b441-077548a038b9","deliveryNote":"A1234567","date":"2022-02-01 15:30:00","client":"Nombre del cliente","destination":"Nombre de la planta de residuos","description":"Recogida de residuos solidos alimentarios y traslado a planta de procesamiento","vehicle":{"idVehicle":"7a74e153-a641-432d-9952-da51d7fae1b9","licensePlate":"8888 ABC"},"status":"pending"}]},{"date":"2022-02-02","services":[{"idService":"b57ec5d6-54f5-49cb-90d3-ded85685c431","deliveryNote":"A-12345677","date":"2022-02-02 10:30:00","client":"Nombre del cliente 2","destination":"Nombre de la planta de residuos","description":"Recogida de residuos solidos alimentarios y traslado a planta de procesamiento","vehicle":{"idVehicle":"7a74e153-a641-432d-9952-da51d7fae1b9","licensePlate":"8888 ABC"},"status":"inProgress"},{"idService":"309c671e-e0b0-44e1-ae6e-9cff9b597d97","deliveryNote":"A-12345677","date":"2022-02-02 12:30:00","client":"Nombre del cliente 3","destination":"Nombre de la planta de residuos","description":"Recogida de residuos solidos alimentarios y traslado a planta de procesamiento","vehicle":{"idVehicle":"7a74e153-a641-432d-9952-da51d7fae1b9","licensePlate":"8888 ABC"},"status":"failed"},{"idService":"6a136c6d-5941-44ca-abee-4511947fccc5","deliveryNote":"A-12345677","date":"2022-02-02 14:30:00","client":"Nombre del cliente 2","destination":"Nombre de la planta de residuos","description":"Recogida de residuos solidos alimentarios y traslado a planta de procesamiento","vehicle":{"idVehicle":"7a74e153-a641-432d-9952-da51d7fae1b9","licensePlate":"8888 ABC"},"status":"finished"}]}]}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/service/{idService}/document":{"get":{"tags":["Documents"],"summary":"Documents by service","description":"Returns an array of all documents of a specific service","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's unique UUID","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/Document"},"example":[{"idDocument":"de45e6a1-06a1-451b-8795-7ad799e90688","documentType":"DI","name":"Carta de porte","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"},{"idDocument":"de45e6a1-06a1-451b-8795-7ad8she90688","documentType":"DI","name":"Albaran","url":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/albaran.pdf"}]}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"post":{"tags":["Documents"],"summary":"Create document","description":"Create a new document. It must log who and when created this document. This web service won't be available (by the moment) in the front-end. It will be only invoked in the synchronization proccess.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's UUID","required":true,"type":"string"},{"name":"document","in":"body","description":"Information of the new document","required":true,"schema":{"$ref":"#/definitions/Document"}}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/service/{idService}/document/{idDocument}":{"get":{"tags":["Documents"],"summary":"Document detail","description":"Retrieves all the information available of a selected document","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"SErvice's UUID","required":true,"type":"string"},{"name":"idDocument","in":"path","description":"Document's UUID","required":true,"type":"string"}],"responses":{"200":{"description":"Document retrieved","schema":{"$ref":"#/definitions/Document"}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"delete":{"tags":["Documents"],"summary":"Delete document","description":"Deletes logically the selected document. It must log who and when deleted this provider. This service can be invoked only in the synchronization process","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's UUID","required":true,"type":"string"},{"name":"idDocument","in":"path","description":"Document's UUID","required":true,"type":"string"}],"responses":{"204":{"description":"Document deleted"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"put":{"tags":["Documents"],"summary":"Update document","description":"Updates an existing document. It must log who and when this document is updated. This service can be only invoked by the synchronization proccess","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's UUID","required":true,"type":"string"},{"name":"idDocument","in":"path","description":"Document's UUID","required":true,"type":"string"},{"name":"document","in":"body","description":"Information to update the document","required":true,"schema":{"$ref":"#/definitions/Document"}}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/service/{idService}/ticket":{"get":{"tags":["Tickets"],"summary":"Tickets by service","description":"Returns an array of all tickets of a specific service","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's unique UUID","required":true,"type":"string"}],"responses":{"200":{"description":"List of weight tickets","schema":{"type":"array","items":{"$ref":"#/definitions/Ticket"},"example":[{"idTicket":"18c1d5e6-fc62-4b76-9b6b-89b45b6bb7a4","numTicket":"1","amount":1,"idWaste":"SOLID_ALIMENTS","wasteName":"Residuo de alimento sólido","urlPhoto":"https://4drivers.fiveflamesmobile.com/images/serviceid/ticketId/image1.jpg","DI":"123456789012345678901234567"},{"idTicket":"18c2f5e6-fc62-4b76-9b6b-89b45b6bb7a4","numTicket":"2","amount":1,"idWaste":"TRANSPORT","wasteName":"Transporte de residuo solido","urlPhoto":"https://4drivers.fiveflamesmobile.com/images/serviceid/ticketId/image2.jpg","DI":"123456789012345678901234567"}]}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"post":{"tags":["Tickets"],"summary":"Create ticket","description":"Create a new ticket. It must log who and when created this ticket.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's UUID","required":true,"type":"string"},{"name":"document","in":"body","description":"Information of the new ticket","required":true,"schema":{"$ref":"#/definitions/Ticket"}}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/service/{idService}/ticket/{idTicket}":{"delete":{"tags":["Tickets"],"summary":"Delete ticket","description":"Deletes logically the selected ticket. It must log who and when deleted this ticket.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's UUID","required":true,"type":"string"},{"name":"idTicket","in":"path","description":"Ticket's UUID","required":true,"type":"string"}],"responses":{"204":{"description":"Ticket deleted"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"put":{"tags":["Tickets"],"summary":"Update ticket","description":"Updates an existing service. It must log who and when this ticket is updated.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's UUID","required":true,"type":"string"},{"name":"idTicket","in":"path","description":"Ticket's UUID","required":true,"type":"string"},{"name":"document","in":"body","description":"Information to update the ticket","required":true,"schema":{"$ref":"#/definitions/Document"}}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/service/{idService}/issue":{"get":{"tags":["Issues"],"summary":"Issues by service","description":"Returns an array of all issues of a specific service","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's unique UUID","required":true,"type":"string"}],"responses":{"200":{"description":"List of issues","schema":{"type":"array","items":{"$ref":"#/definitions/Issue"},"example":[{"idIssue":"7dda3a4e-2ee0-4bf2-a7d2-23151c3fa89e ","text":"El contenedor estaba dañado","photos":["https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image1.jpg","https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image2.jpg","https://4drivers.fiveflamesmobile.com/images/serviceid/issues/image3.jpg"],"date":"2022-02-01 15:47:32","location":{"latitude":41.6499052,"longitude":-4.7290731}}]}},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"post":{"tags":["Issues"],"summary":"Create issue","description":"Create a new issue. It must log who and when created this issue.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's UUID","required":true,"type":"string"},{"name":"document","in":"body","description":"Information of the new issue","required":true,"schema":{"$ref":"#/definitions/Issue"}}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}},"/service/{idService}/issue/{idIssue}":{"delete":{"tags":["Issues"],"summary":"Delete issue","description":"Deletes logically the selected issue. It must log who and when deleted this issue.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's UUID","required":true,"type":"string"},{"name":"idIssue","in":"path","description":"Issue's UUID","required":true,"type":"string"}],"responses":{"204":{"description":"Issue deleted"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}},"put":{"tags":["Issues"],"summary":"Update issue","description":"Updates an existing service. It must log who and when this ticket is updated.","produces":["application/json"],"parameters":[{"name":"x-api-key","in":"header","description":"API Key","required":true,"type":"string"},{"name":"idService","in":"path","description":"Service's UUID","required":true,"type":"string"},{"name":"idIssue","in":"path","description":"Issue's UUID","required":true,"type":"string"},{"name":"document","in":"body","description":"Information to update the service","required":true,"schema":{"$ref":"#/definitions/Document"}}],"responses":{"204":{"description":"OK"},"403":{"description":"Forbidden"},"404":{"description":"Bad request"},"500":{"description":"Server error"}}}}},"definitions":{"Provider":{"type":"object","description":"Provider's information","properties":{"idProvier":{"type":"string","format":"UUID","description":"Unique ID of the provider in the middleware database"},"idCLEAR":{"type":"string","description":"Unique ID of the provider in the CLEAR system."},"name":{"type":"string","description":"Provider's name"},"haulierCode":{"type":"string","description":"Provider's haulier code to inherit from all the vehicles of the provider."}},"example":{"idProvider":"357b3123-79f6-11ec-90d6-0242ac4120123","idCLEAR":"357b3231-79f6-11ec-90d6-0242ac41222343","name":"Special's caracters name (España)"}},"User":{"type":"object","description":"Portal user information","properties":{"idUser":{"type":"string","format":"Unique ID of the user in the middleware","example":"9609ccff-7e95-4dc9-9942-ce6989710868"},"name":{"type":"string","description":"User's name","example":"Lorem Ipsum"},"email":{"type":"string","description":"User's email. Used for log in and reset password.","example":"lorem.ipsum@providerone.com"},"password":{"type":"string","description":"User's password","example":""},"role":{"type":"string","description":"User's rol in the middleware: admin, provider, routeManager, driver","enum":["admin","providerAdmin","driver"],"example":"driver"},"active":{"type":"boolean","description":"Indicates if the user is active or not","example":true},"provider":{"$ref":"#/definitions/Provider"}}},"Vehicle":{"type":"object","description":"Information of a vehicle.","properties":{"idVehicle":{"type":"string","format":"UUID","description":"Vehicle's UUID in the middleware database","example":"7a74e153-a641-432d-9952-da51d7fae1b9"},"licensePlate":{"type":"string","format":"Only digits and characters.","description":"Vehicle's license plate","example":"8888 ABC"},"motorized":{"type":"boolean","format":"Only digits and characters.","description":"Vehicle's license plate","example":true},"provider":{"$ref":"#/definitions/Provider"},"active":{"type":"boolean","description":"Indicates if the vehicle is active. Only active vehicles can be choosen for Services","example":true}}},"ServiceFilter":{"type":"object","description":"Possible values for the service filter's combos","properties":{"providers":{"type":"array","description":"Array of available providers","items":{"$ref":"#/definitions/Provider"}},"wasteTypes":{"type":"array","description":"Array of available wast types","items":{"$ref":"#/definitions/WasteType"}}}},"Service":{"type":"object","description":"Service information","properties":{"idService":{"type":"string","format":"UUID","description":"Service's UUID in the middleware database","example":"b5f89ebf-b6e4-4ea4-b441-077548a038b9"},"deliveryNote":{"type":"string","description":"Reference number of the delivery note."},"date":{"type":"string","format":"yyyy-MM-dd HH:mm:ss","description":"Date the service is planned","example":"2022-02-01 15:30:00"},"serviceAddress":{"type":"string","description":"Service Address concatenating fields from CLEAR: Street Name, House Number, PostCode, City","example":"P.I.LLEVANT-C/CAN GUASH 2, 08150 PARETS DEL VALLES"},"client":{"type":"string","description":"Client's name","example":"Nombre del cliente"},"destination":{"type":"string","description":"Waste treatment plant's name","example":"Nombre de la planta de residuos"},"description":{"type":"string","description":"Service's description","example":"Recogida de residuos solidos alimentarios y traslado a planta de procesamiento"},"contactMail":{"type":"string","description":"Client's contact email","example":"mail@contacto.com"},"contactPhone":{"type":"string","description":"Client's contact phone","example":"+34123456789"},"vehicle":{"$ref":"#/definitions/Vehicle"},"provider":{"$ref":"#/definitions/Provider"},"additionalInfo":{"type":"string","description":"Additional information for the driver.","example":"Información adicional para el condcutor."},"DI":{"type":"string","description":"Reference number of the DI document","example":"123456789012345678901234567"},"comments":{"type":"string","description":"Driver's comments of the service","example":"Comentarios sobre el servicio"},"ticketType":{"$ref":"#/definitions/TicketType"},"status":{"$ref":"#/definitions/ServiceStatus"},"documents":{"type":"array","items":{"$ref":"#/definitions/Document"}},"serviceAmounts":{"type":"array","items":{"$ref":"#/definitions/ServiceAmount"}},"tickets":{"type":"array","items":{"$ref":"#/definitions/Ticket"}},"issues":{"type":"array","items":{"$ref":"#/definitions/Issue"}},"Signature":{"$ref":"#/definitions/Signature"}}},"Document":{"type":"object","description":"Document attached to a service","properties":{"idDocument":{"type":"string","format":"UUID","description":"Document's UUID in middleware database","example":"de45e6a1-06a1-451b-8795-7ad799e90688"},"documentType":{"$ref":"#/definitions/DocumentType"},"name":{"type":"string","description":"Document's name","example":"Carta de porte"},"url":{"type":"string","format":"URL","description":"Document's URL to visualize / download.","example":"https://4drivers.fiveflamesmobile.com/de45e6a1-06a1-451b-8795-7ad799e90688/cartadeporte.pdf"}}},"ServiceAmount":{"type":"object","description":"Lines of service amounts to be completed by the driver","properties":{"idService":{"type":"string","description":"Unique identifier of ther order this service amount belongs to.","example":"123456778"},"idServiceAmount":{"type":"integer","description":"Unique identifier of the line of amount of service in this service. Sort by this item.","example":"2a6979d2-82af-43e4-a74b-c5b969ec6a2b"},"description":{"type":"string","description":"Description of the service","example":"Recogida de residuos soliddos y traslado a la planta de tratamiento"},"amount":{"type":"number","description":"Amount of units of this service","example":1},"idWaste":{"type":"string","description":"Unique identifier of the type of waste","example":"SOLID_ALIMENTS"},"wasteName":{"type":"string","description":"Name of the type of the waste","example":"Residuo de alimento sólido"},"DI":{"type":"string","description":"DI reference number of the item.","example":"123456789012345678901234567"}}},"Ticket":{"type":"object","description":"Weight tickets associated to a service","properties":{"idTicket":{"type":"integer","description":"Unique identifier of the ticket in the middleware","example":"18c1d5e6-fc62-4b76-9b6b-89b45b6bb7a4 "},"numTicket":{"type":"string","description":"Number of the ticket.","example":1},"amount":{"type":"number","description":"Amount of waste in kilograms","example":1},"units":{"type":"number","description":"Amount of waste in units","example":1},"idWaste":{"type":"string","description":"Unique identifier of the type of waste","example":"SOLID_ALIMENTS"},"wasteName":{"type":"string","description":"Name of the type of the waste","example":"Residuo de alimento sólido"},"urlPhoto":{"type":"string","format":"URL","description":"Relative URL where the pic of the ticket has been uploaded.","example":"/ticketId/image1.jpg"},"urlS3":{"type":"string","format":"URL","description":"Temporary S3 URL for the resource","example":"https://4drivers.fiveflamesmobile.com/images/serviceid/"},"DI":{"type":"string","description":"DI reference number of the item.","example":"123456789012345678901234567"},"basculaPrezero":{"type":"boolean","description":"Identify a PreZero bacule","example":false}}},"Issue":{"type":"object","description":"Issue registered on a service.","properties":{"idIssue":{"type":"integer","description":"Unique identifier of the ticket in the middleware","example":"7dda3a4e-2ee0-4bf2-a7d2-23151c3fa89e "},"text":{"type":"string","description":"Description of the issue.","example":"El contenedor estaba dañado"},"photos":{"type":"array","items":{"type":"array","items":{"$ref":"#/definitions/Photo"}}},"date":{"type":"string","format":"yyyy-MM-dd hh:mm:ss","description":"Date and time where the issue was registered in UTC format.","example":"2022-02-01 15:47:32"},"location":{"$ref":"#/definitions/Coordinate"}}},"Coordinate":{"type":"object","description":"Coordinate in latitude/longitude.","properties":{"latitude":{"type":"number","description":"Latitude","example":41.6499052},"longitude":{"type":"number","description":"Longitude","example":-4.7290731}}},"Signature":{"type":"object","description":"Signature of a service's client when finished","properties":{"idSignature":{"type":"string","format":"UUID","description":"Signature's unique identifier in the middleware database","example":"f6990950-334f-477d-93f2-f9499bbc9e3a"},"signerData":{"type":"string","description":"Personal data (name, surname, DNI) of the person who signed the service","example":"Nombre del firmante"},"comments":{"type":"string","description":"Driver's comments when signature is done","example":"Sin comentarios"},"urlS3":{"type":"string","format":"URL","description":"Temporary S3 URL for the signature","example":"https://4drivers.fiveflamesmobile.com/images/serviceid/"},"signatureURL":{"type":"string","format":"URL","description":"Relative URL to the file where the signature is stored.","example":"https://4drivers.fiveflamesmobile.com/images/serviceid/signature/signature.jpg"},"date":{"type":"string","format":"yyyy-MM-dd hh:mm:ss","description":"Date and time when the signature is saved"},"location":{"$ref":"#/definitions/Coordinate"}}},"WasteType":{"type":"object","description":"Information of a waste type.","properties":{"wasteTypeId":{"type":"string","description":"Unique identifier of the waste code. Corresponds to WastCode in CLEAR","example":"200108"},"wasteDescription":{"type":"string","description":"Description of the waste type. Corresponds to WasteCodeDescription in CLEAR","example":"RESIDUOS BIODEGRADABLES DE COCINAS Y RESTAURANTES"}}},"Photo":{"type":"object","description":"Picture of the issue","properties":{"urlPhoto":{"type":"string","format":"URL","description":"Relative URL where the pic of the ticket has been uploaded.","example":"/ticketId/image1.jpg"},"urlS3":{"type":"string","format":"URL","description":"Temporary S3 URL for the resource","example":"https://4drivers.fiveflamesmobile.com/images/serviceid/"}}},"ServiceStatus":{"type":"string","description":"Service's status","enum":["pending","inProgress","finished","failed"],"example":"pending"},"DocumentType":{"type":"string","description":"Different types of documents attached to a service.","enum":["DI","DeliveryNote","WayBill"],"example":"DI"},"TicketType":{"type":"string","description":"Type of measure for the ticket: Kgs or units","enum":["KGS","UN"],"example":"KGS"}},"host":"virtserver.swaggerhub.com","basePath":"/Five-Flames/4Drivers/1.0.1","schemes":["https","http"]}