High-Table-Consortium / fullstack-capstone-dockerized

0 stars 3 forks source link

Implement CRUD and Search Functionality for AttractionSite #50

Closed Tumelo2748 closed 1 month ago

Tumelo2748 commented 1 month ago

Summary

This issue is to implement full CRUD (Create, Read, Update, Delete) and search functionality for the AttractionSite model. The controller should be able to handle creating new attraction sites, updating existing ones, deleting them, retrieving all sites, fetching a site by its ID, and searching for specific attraction sites based on name, category, or location.

Detailed Requirements

  1. Get All Attraction Sites:

    • Implement a function that retrieves all attraction sites.
    • Endpoint: GET /attractions
  2. Get Attraction Site by ID:

    • Implement a function that fetches a single attraction site based on its ID.
    • Endpoint: GET /attractions/:id
  3. Create New Attraction Site:

    • Implement a function to create a new attraction site with fields like:
      • name
      • location
      • description
      • category
      • rating
      • hours
      • admission_price
      • image
      • nearby_restaurants
      • other_activities
    • Endpoint: POST /attractions
  4. Update Attraction Site:

    • Implement a function to update an existing attraction site.
    • Endpoint: PUT /attractions/:id
  5. Delete Attraction Site:

    • Implement a function to delete an attraction site by ID.
    • Endpoint: DELETE /attractions/:id
  6. Search Attraction Sites:

    • Implement a search functionality to allow filtering by:
      • name
      • category
      • location
    • Endpoint: GET /attractions/search?name=&category=&location=

Acceptance Criteria