Closed CCirbo closed 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!
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!
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