Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. Make a Ruby application with JSON RESTful API.
  2.  
  3. The user leaves an announcement about the work, and other users can respond to this announcement (response) with a price (I can do the work for so much).
  4.  
  5. The author of the announcement can cancel the announcement. In this case, all responses should be automatically rejected (declined).
  6.  
  7. The author can accept one of the responses, then the other responses should be rejected (declined), and the ad should become closed (closed).
  8.  
  9. You can't leave feedback on a closed or canceled announcement.
  10.  
  11. The user who left the response can cancel his response (cancel).
  12. In this case, the response status should be canceled, not declined.
  13.  
  14. Also the API needs methods to get your announcement with all responses and get a list of all active announcement (no responses).
  15.  
  16. Essences
  17.  
  18. Announcement(id, user_id, description, status)
  19. description-text, no more than 1000 characters
  20.  
  21. Response(id, announcement_id, user_id, price, status)
  22. price - int, price in rubles: from 100 to 10000
  23.  
  24. User(id)
  25.  
  26.  
  27. Ad statuses
  28.  
  29. active - active, you can respond
  30. canceled - canceled by the author
  31. closed - closed (there is an accepted response)
  32.  
  33.  
  34. The status of the response to the announcement
  35.  
  36. pending - new response
  37. canceled - canceled by the author of the response
  38. declined - canceled by the author of the announcement (or automatically if the ad is closed or canceled)
  39. accepted - accepted by the author of the announcement
  40.  
  41.  
  42. Restrictions
  43. 1. you can only respond to an active announcement
  44. 2. if the author of the announcement has rejected someone's response, then you can not re-respond
  45. 3. if the author of the response canceled his response, he can re-respond to the same announcement.
  46.  
  47.  
  48. Authentication
  49.  
  50. In the API, instead of full authentication, you can pass `user_id` in the request headers.
  51.  
  52. You can also make an endpoint to create a user for tests ` 'POST /users', which will create a new user and return his ' id`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement