mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 05:26:17 +02:00
remove legacy code
This commit is contained in:
parent
5aacaef006
commit
29e7f954f3
4 changed files with 0 additions and 45 deletions
|
@ -40,11 +40,6 @@ class Invoice < ApplicationRecord
|
|||
|
||||
attribute :vat_rate, ::Type::VatRate.new
|
||||
|
||||
def get_status_from_billing
|
||||
response = EisBilling::GetInvoiceStatus.send_invoice(invoice_number: number)
|
||||
JSON.parse(response.body, symbolize_names: true)[:status]
|
||||
end
|
||||
|
||||
def set_invoice_number
|
||||
if Feature.billing_system_integrated?
|
||||
result = EisBilling::GetInvoiceNumber.send_invoice
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
class Registrar::InvoiceStatusPresenter
|
||||
include ActionView::Helpers::TagHelper
|
||||
|
||||
attr_reader :invoice
|
||||
|
||||
def initialize(invoice:)
|
||||
@invoice = invoice
|
||||
end
|
||||
|
||||
def display
|
||||
case invoice.get_status_from_billing
|
||||
when 'unpaid'
|
||||
content_tag(:span, 'Unpaid', style: 'color: red;')
|
||||
when 'paid'
|
||||
content_tag(:span, 'Unpaid', style: 'color: red;')
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,18 +0,0 @@
|
|||
module EisBilling
|
||||
class GetInvoiceStatus < EisBilling::Base
|
||||
def self.send_invoice(invoice_number:)
|
||||
send_request(invoice_number: invoice_number)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def self.send_request(invoice_number:)
|
||||
http = EisBilling::Base.base_request(url: invoice_number_generator_url)
|
||||
http.get(invoice_number_generator_url + "/#{invoice_number}", EisBilling::Base.headers)
|
||||
end
|
||||
|
||||
def self.invoice_number_generator_url
|
||||
"#{BASE_URL}/api/v1/invoice_generator/invoice_status"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -34,7 +34,3 @@
|
|||
|
||||
%dt= Invoice.human_attribute_name :reference_no
|
||||
%dd= @invoice.reference_no
|
||||
|
||||
- invoice_presenter = Registrar::InvoiceStatusPresenter.new(invoice: @invoice)
|
||||
%dt Billing system
|
||||
%dd= invoice_presenter.display
|
Loading…
Add table
Add a link
Reference in a new issue