@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
60 lines • 2.95 kB
JavaScript
import { InvoiceHdrReprintResponseSchema } from '../schemas';
/**
* Creates the invoiceHdr resource methods
* OpenAPI Path: /invoice-hdr → invoiceHdr.*
* @description Invoice processing and document management with Prophet 21 integration
*/
export function createInvoiceHdrResource(executeRequest) {
return {
/**
* Invoice reprint operations - OpenAPI Path: /invoice-hdr/{invoiceNo}/reprint
*/
reprint: {
/**
* Reprint an existing invoice through Prophet 21 integration
* @description Generates a reprint of an existing invoice through Prophet 21 system integration. Returns invoice document data and reprint status for billing and customer service workflows.
*
* @fullPath api.orders.invoiceHdr.reprint.get
* @service orders
* @domain invoice-management
* @dataMethod invoiceHdrData.reprint.get - returns only the reprint result without metadata
* @discoverable true
* @searchTerms ["invoice reprint", "reprint invoice", "invoice copy", "duplicate invoice", "invoice document"]
* @relatedEndpoints ["api.orders.oeHdr.doc.get", "api.customers.customer.get", "api.p21-core.company.get"]
* @commonPatterns ["Reprint invoice", "Customer invoice copy", "Billing document", "Invoice duplicate"]
* @workflow ["invoice-management", "customer-service", "billing-workflow"]
* @prerequisites ["Valid invoice number", "Invoice exists in Prophet 21", "Reprint permissions"]
* @nextSteps ["Deliver invoice to customer", "Update billing records", "Customer service follow-up"]
* @businessRules ["Invoice must exist in Prophet 21", "Reprint creates audit trail", "Formatting matches original invoice"]
* @functionalArea "billing-and-invoicing"
* @performance "Integrates with Prophet 21 - response time depends on P21 system load"
*/
get: async (invoiceNo) => {
return executeRequest({
method: 'GET',
path: `/invoice-hdr/${invoiceNo}/reprint`,
responseSchema: InvoiceHdrReprintResponseSchema,
}, {});
},
},
};
}
/**
* Creates the invoiceHdrData resource methods (data-only versions)
*/
export function createInvoiceHdrDataResource(invoiceHdr) {
return {
reprint: {
/**
* Get only invoice reprint data without response metadata
* @param invoiceNo Invoice number to reprint
* @returns Promise<InvoiceReprintResult> Direct reprint result object
*/
get: async (invoiceNo) => {
const response = await invoiceHdr.reprint.get(invoiceNo);
return response.data;
},
},
};
}
//# sourceMappingURL=invoice-hdr.js.map