From 2745be5672a093311daa1032735259f531aa2ba7 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Thu, 18 Apr 2024 11:28:38 +0200 Subject: [PATCH] chore: remove old code --- app/services/bill_signature_service.rb | 8 ----- spec/services/bill_signature_service_spec.rb | 34 -------------------- 2 files changed, 42 deletions(-) diff --git a/app/services/bill_signature_service.rb b/app/services/bill_signature_service.rb index 7badb3399..685355e7b 100644 --- a/app/services/bill_signature_service.rb +++ b/app/services/bill_signature_service.rb @@ -1,12 +1,4 @@ class BillSignatureService - def self.grouped_unsigned_operation_until(date) - date = date.in_time_zone - unsigned_operations = DossierOperationLog - .where(bill_signature: nil) - .where('executed_at < ?', date) - unsigned_operations.group_by { |e| e.executed_at.to_date } - end - def self.sign_operations(operations, day) return unless Certigna::API.enabled? bill = BillSignature.build_with_operations(operations, day) diff --git a/spec/services/bill_signature_service_spec.rb b/spec/services/bill_signature_service_spec.rb index e9a0866ac..7f4f8c081 100644 --- a/spec/services/bill_signature_service_spec.rb +++ b/spec/services/bill_signature_service_spec.rb @@ -1,38 +1,4 @@ describe BillSignatureService do - describe ".grouped_unsigned_operation_until" do - subject { BillSignatureService.grouped_unsigned_operation_until(date).length } - - let(:date) { Time.zone.now.beginning_of_day } - - context "when operations of several days need to be signed" do - before do - create :dossier_operation_log, executed_at: 3.days.ago - create :dossier_operation_log, executed_at: 2.days.ago - create :dossier_operation_log, executed_at: 1.day.ago - end - - it { is_expected.to eq 3 } - end - - context "when operations on a single day need to be signed" do - before do - create :dossier_operation_log, executed_at: 1.day.ago - create :dossier_operation_log, executed_at: 1.day.ago - end - - it { is_expected.to eq 1 } - end - - context "when there are no operations to be signed" do - before do - create :dossier_operation_log, created_at: 1.day.ago, bill_signature: build(:bill_signature, :with_signature, :with_serialized) - create :dossier_operation_log, created_at: 1.day.from_now - end - - it { is_expected.to eq 0 } - end - end - describe ".sign_operations" do let(:date) { Date.today }