CCirbo / Little_Shop

1 stars 2 forks source link

Feature merchant all customers #69

Closed CCirbo closed 3 weeks ago

CCirbo commented 3 weeks ago

Created a merchant_customers_spec.rb test file with tests for the GET /api/v1/merchants/:merchant_id/customers endpoint. Added a MerchantCustomersController to handle retrieving all customers for a specific merchant. Added a joins method to the Customer model to handle the logic for fetching customers associated with a merchant. Updated the routes to include a new route for GET /api/v1/merchants/:merchant_id/customers to return all customers for a given merchant. Created a customer serializer file

jimmacur commented 3 weeks ago

Great job on this update! I appreciate the use of the joins method in the for_merchant scope, which simplifies the query and ensures we’re only fetching distinct customers for a given merchant. The test coverage looks thorough, especially for edge cases like merchants with no customers. Everything seems well structured! Nice job!

MDelarosa1993 commented 3 weeks ago

Thanks for the detailed work on this. It enhances our API functionality and maintains good test coverage. I’ll review it more closely, but everything seems well-implemented so far!