mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 13:36:15 +02:00
updated attributes
This commit is contained in:
parent
9bdca96f87
commit
9aba744494
1 changed files with 3 additions and 4 deletions
|
@ -22,18 +22,17 @@ module EisBilling
|
||||||
:created_at,
|
:created_at,
|
||||||
:updated_at,
|
:updated_at,
|
||||||
:e_invoice_sent_at,
|
:e_invoice_sent_at,
|
||||||
:issue_date,
|
:items_attributes])
|
||||||
:due_date])
|
|
||||||
|
|
||||||
parsed_data = JSON.parse(invoice)
|
parsed_data = JSON.parse(invoice)
|
||||||
parsed_data["role"] = "registrar"
|
parsed_data["role"] = "registrar"
|
||||||
parsed_data["invoice_number"] = "2232"
|
|
||||||
parsed_data["description"] = "some" if parsed_data["description"] == ''
|
parsed_data["description"] = "some" if parsed_data["description"] == ''
|
||||||
|
|
||||||
parsed_data = replace_key(json_obj: parsed_data, old_key: "total", new_key: "transaction_amount")
|
parsed_data = replace_key(json_obj: parsed_data, old_key: "total", new_key: "transaction_amount")
|
||||||
parsed_data = replace_key(json_obj: parsed_data, old_key: "reference_no", new_key: "reference_number")
|
parsed_data = replace_key(json_obj: parsed_data, old_key: "reference_no", new_key: "reference_number")
|
||||||
|
|
||||||
p parsed_data
|
invoice_items_json = @invoice.items.to_json(except: [:created_at, :updated_at])
|
||||||
|
parsed_data["items"] = JSON.parse(invoice_items_json)
|
||||||
parsed_data
|
parsed_data
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue