@foxiko/client
Advanced tools
Comparing version 1.0.76 to 1.0.77
@@ -160,2 +160,17 @@ const {Invoice, InvoiceItem} = require("../entities/Invoice"); | ||
async finalize(invoice) { | ||
const data = await this.client.request() | ||
.url(FINANCE.INVOICE.FINALIZE(invoice.id)) | ||
.contentType().json() | ||
.header("x-finance-account-id", this.#accountId) | ||
.responseType().json() | ||
.send(); | ||
if(data['error']) { | ||
throw data; | ||
} | ||
let result = new Invoice(data); | ||
result._handler(this); | ||
return result; | ||
} | ||
async reset(invoice) { | ||
@@ -162,0 +177,0 @@ const data = await this.client.request() |
@@ -84,2 +84,6 @@ const {Product} = require("./Product"); | ||
async finalize() { | ||
return await this.#handler.finalize(this); | ||
} | ||
async createItem(item) { | ||
@@ -86,0 +90,0 @@ let result = await this.#handler.createItem(this, item); |
@@ -21,2 +21,3 @@ const schema = process.env['LOCAL'] === "true" ? "http" : "https"; | ||
EDIT: (id) => `${schema}://${domain}/${version}/finance/invoice/${id}/edit`, | ||
FINALIZE: (id) => `${schema}://${domain}/${version}/finance/invoice/${id}/finalize`, | ||
ALL: `${schema}://${domain}/${version}/finance/invoice/all`, | ||
@@ -23,0 +24,0 @@ GET_PDF: invoice_id => `${schema}://${domain}/${version}/finance/invoice/${invoice_id}/pdf`, |
{ | ||
"name": "@foxiko/client", | ||
"version": "1.0.76", | ||
"version": "1.0.77", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
177664
3597