From d18e79ab19a4a40e8c1e54f52ff0ecfdbb2838da Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Thu, 14 Jan 2021 10:47:25 +0100 Subject: [PATCH] Move query object to app/queries/ and doc it --- app/{services => queries}/customers_with_balance.rb | 2 ++ spec/{services => queries}/customers_with_balance_spec.rb | 0 2 files changed, 2 insertions(+) rename app/{services => queries}/customers_with_balance.rb (83%) rename spec/{services => queries}/customers_with_balance_spec.rb (100%) diff --git a/app/services/customers_with_balance.rb b/app/queries/customers_with_balance.rb similarity index 83% rename from app/services/customers_with_balance.rb rename to app/queries/customers_with_balance.rb index bf6cf70396..2303c28687 100644 --- a/app/services/customers_with_balance.rb +++ b/app/queries/customers_with_balance.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +# Fetches the customers of the specified enterprise including the aggregated balance across the +# customer's orders. That is, we get the total balance for each customer with this enterprise. class CustomersWithBalance def initialize(enterprise) @enterprise = enterprise diff --git a/spec/services/customers_with_balance_spec.rb b/spec/queries/customers_with_balance_spec.rb similarity index 100% rename from spec/services/customers_with_balance_spec.rb rename to spec/queries/customers_with_balance_spec.rb