@vivlab/api-database
Advanced tools
Comparing version 1.0.80 to 1.0.81
@@ -103,4 +103,5 @@ import * as transform from "./transform"; | ||
}>; | ||
export declare function retrieveSummary({ id, stripeAccount }: IdAccount): Promise<Invoice.Summary>; | ||
export declare function updateInternal({ id, data, stripeAccount }: IdDataAccount<Pick<Invoice.Data, "internal">>): Promise<{ | ||
status: string; | ||
}>; |
@@ -25,3 +25,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.updateInternal = exports.retrieve = exports.create = exports.persist = exports.hashInvoiceItem = exports.hashInvoice = exports.transform = void 0; | ||
exports.updateInternal = exports.retrieveSummary = exports.retrieve = exports.create = exports.persist = exports.hashInvoiceItem = exports.hashInvoice = exports.transform = void 0; | ||
const redis_1 = __importDefault(require("../../libraries/redis")); | ||
@@ -182,2 +182,21 @@ const transform = __importStar(require("./transform")); | ||
exports.retrieve = retrieve; | ||
async function retrieveSummary({ id, stripeAccount }) { | ||
const invoice = await retrieve({ id, stripeAccount }); | ||
return { | ||
order: invoice.order, | ||
email: `${invoice.email.slice(0, 1)}••••${invoice.email.slice(invoice.email.indexOf("@"))}`, | ||
shipping: { | ||
delay: invoice.shipping?.delay || 0, | ||
withdrawal: invoice.shipping?.withdrawal || false | ||
}, | ||
created: invoice.created, | ||
status: invoice.internal.status, | ||
products: invoice.products.map(e => ({ | ||
name: e.name, | ||
quantity: e.quantity, | ||
attributes: e.attributes | ||
})) | ||
}; | ||
} | ||
exports.retrieveSummary = retrieveSummary; | ||
async function updateInternal({ id, data, stripeAccount }) { | ||
@@ -184,0 +203,0 @@ const prefix = stripeAccount; |
{ | ||
"name": "@vivlab/api-database", | ||
"version": "1.0.80", | ||
"version": "1.0.81", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
455015
7244