app/domain/operations/households/deactivate_financial_assistance_eligibility.rb
def execute(values)
        family = Operations::Families::Find.new.call(id: BSON::ObjectId(values[:family_id]))
        tax_households = family.success.active_household.latest_active_tax_households.tax_household_with_year(values[:date].to_date.year)
        return Success('No Active Tax Households to deactivate') unless tax_households.present?

        tax_households.each do |thh|
          end_on = (values[:date] > thh.effective_starting_on) ? values[:date] : thh.effective_starting_on
          thh.update_attributes!(effective_ending_on: end_on)
        end

        Success("End dated all the Active Tax Households for given family with bson_id: #{values[:family_id]}")
      end
# should not fail for UQHP cases too
# returns Success(nil)
should not fail for UQHP cases too
returns Success(nil)
should not fail for UQHP cases too returns Success ( nil )
def execute(values)
        family = Operations::Families::Find.new.call(id: BSON::ObjectId(values[:family_id]))
        tax_households = family.success.active_household.latest_active_tax_households.tax_household_with_year(values[:date].to_date.year)
        return Success('No Active Tax Households to deactivate') unless tax_households.present?
        tax_households.each do |thh|
          end_on = (values[:date] > thh.effective_starting_on) ? values[:date] : thh.effective_starting_on
          thh.update_attributes!(effective_ending_on: end_on)
        end
        Success("End dated all the Active Tax Households for given family with bson_id: #{values[:family_id]}")
      end
def execute ( values ) family = Operations :: Families :: Find . new . call ( id : BSON :: ObjectId ( values [ :family_id ] ) ) tax_households = family . success . active_household . latest_active_tax_households . tax_household_with_year ( values [ :date ] . to_date . year ) return Success ( 'No Active Tax Households to deactivate' ) unless tax_households . present? tax_households . each do | thh | end_on = ( values [ :date ] > thh . effective_starting_on ) ? values [ :date ] : thh . effective_starting_on thh . update_attributes! ( effective_ending_on : end_on ) end Success ( "End dated all the Active Tax Households for given family with bson_id: #{values[:family_id]}" ) end
should not fail for UQHP cases too
returns Success(nil)
should not fail for UQHP cases too returns Success ( nil )
values