Class: Smartbill::Sdk::Services::EstimatesService
- Inherits:
-
BaseService
- Object
- BaseService
- Smartbill::Sdk::Services::EstimatesService
show all
- Defined in:
- lib/smartbill/sdk/services/estimates_service.rb
Overview
Instance Method Summary
collapse
-
#cancel(cif, series_name, number) ⇒ Object
-
#create(estimate) ⇒ Object
-
#delete(cif, series_name, number) ⇒ Object
-
#invoices_status(cif, series_name, number) ⇒ Object
-
#pdf(cif, series_name, number) ⇒ Object
-
#restore(cif, series_name, number) ⇒ Object
Methods inherited from BaseService
#initialize
Instance Method Details
#cancel(cif, series_name, number) ⇒ Object
24
25
26
|
# File 'lib/smartbill/sdk/services/estimates_service.rb', line 24
def cancel(cif, series_name, number)
cancel_restore("cancel", cif, series_name, number)
end
|
#create(estimate) ⇒ Object
8
9
10
11
12
13
14
|
# File 'lib/smartbill/sdk/services/estimates_service.rb', line 8
def create(estimate)
validate(estimate, Contracts::EstimateContract)
parse(execute(build_request(
method: "POST", base_url: @client.base_url, path: "estimate",
json_body: dump(estimate), auth_header: @client.
)), Models::InvoiceCreateResponse)
end
|
#delete(cif, series_name, number) ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/smartbill/sdk/services/estimates_service.rb', line 16
def delete(cif, series_name, number)
parse(execute(build_request(
method: "DELETE", base_url: @client.base_url, path: "estimate",
params: { "cif" => cif, "seriesName" => series_name, "number" => number },
auth_header: @client.
)), Models::BaseResponse)
end
|
#invoices_status(cif, series_name, number) ⇒ Object
40
41
42
43
44
45
46
|
# File 'lib/smartbill/sdk/services/estimates_service.rb', line 40
def invoices_status(cif, series_name, number)
parse(execute(build_request(
method: "GET", base_url: @client.base_url, path: "estimate/invoices",
params: { "cif" => cif, "seriesName" => series_name, "number" => number },
auth_header: @client.
)), Models::ProformaInvoicesResponse)
end
|
#pdf(cif, series_name, number) ⇒ Object
32
33
34
35
36
37
38
|
# File 'lib/smartbill/sdk/services/estimates_service.rb', line 32
def pdf(cif, series_name, number)
execute(build_request(
method: "GET", base_url: @client.base_url, path: "estimate/pdf",
params: { "cif" => cif, "seriesName" => series_name, "number" => number },
accept: "application/octet-stream", auth_header: @client.
), binary: true)
end
|
#restore(cif, series_name, number) ⇒ Object
28
29
30
|
# File 'lib/smartbill/sdk/services/estimates_service.rb', line 28
def restore(cif, series_name, number)
cancel_restore("restore", cif, series_name, number)
end
|