@endora-commerce/mod-invoices 0.106.0 → 0.108.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/README.md +7 -8
  2. package/dist/admin/components/InvoiceSectionTabs.d.ts +8 -0
  3. package/dist/admin/components/InvoiceSectionTabs.d.ts.map +1 -1
  4. package/dist/admin/components/InvoiceSectionTabs.js +13 -2
  5. package/dist/admin/components/InvoiceSectionTabs.js.map +1 -1
  6. package/dist/admin/document-blocks/InvoiceDivider.d.ts +5 -0
  7. package/dist/admin/document-blocks/InvoiceDivider.d.ts.map +1 -0
  8. package/dist/admin/document-blocks/InvoiceDivider.js +5 -0
  9. package/dist/admin/document-blocks/InvoiceDivider.js.map +1 -0
  10. package/dist/admin/document-blocks/InvoiceFooter.d.ts +5 -0
  11. package/dist/admin/document-blocks/InvoiceFooter.d.ts.map +1 -0
  12. package/dist/admin/document-blocks/InvoiceFooter.js +5 -0
  13. package/dist/admin/document-blocks/InvoiceFooter.js.map +1 -0
  14. package/dist/admin/document-blocks/InvoiceHeader.d.ts +5 -0
  15. package/dist/admin/document-blocks/InvoiceHeader.d.ts.map +1 -0
  16. package/dist/admin/document-blocks/InvoiceHeader.js +5 -0
  17. package/dist/admin/document-blocks/InvoiceHeader.js.map +1 -0
  18. package/dist/admin/document-blocks/InvoiceLineItems.d.ts +5 -0
  19. package/dist/admin/document-blocks/InvoiceLineItems.d.ts.map +1 -0
  20. package/dist/admin/document-blocks/InvoiceLineItems.js +5 -0
  21. package/dist/admin/document-blocks/InvoiceLineItems.js.map +1 -0
  22. package/dist/admin/document-blocks/InvoiceLogo.d.ts +5 -0
  23. package/dist/admin/document-blocks/InvoiceLogo.d.ts.map +1 -0
  24. package/dist/admin/document-blocks/InvoiceLogo.js +5 -0
  25. package/dist/admin/document-blocks/InvoiceLogo.js.map +1 -0
  26. package/dist/admin/document-blocks/InvoiceNotes.d.ts +5 -0
  27. package/dist/admin/document-blocks/InvoiceNotes.d.ts.map +1 -0
  28. package/dist/admin/document-blocks/InvoiceNotes.js +5 -0
  29. package/dist/admin/document-blocks/InvoiceNotes.js.map +1 -0
  30. package/dist/admin/document-blocks/InvoiceParties.d.ts +5 -0
  31. package/dist/admin/document-blocks/InvoiceParties.d.ts.map +1 -0
  32. package/dist/admin/document-blocks/InvoiceParties.js +5 -0
  33. package/dist/admin/document-blocks/InvoiceParties.js.map +1 -0
  34. package/dist/admin/document-blocks/InvoiceSpacer.d.ts +5 -0
  35. package/dist/admin/document-blocks/InvoiceSpacer.d.ts.map +1 -0
  36. package/dist/admin/document-blocks/InvoiceSpacer.js +5 -0
  37. package/dist/admin/document-blocks/InvoiceSpacer.js.map +1 -0
  38. package/dist/admin/document-blocks/InvoiceTotals.d.ts +5 -0
  39. package/dist/admin/document-blocks/InvoiceTotals.d.ts.map +1 -0
  40. package/dist/admin/document-blocks/InvoiceTotals.js +5 -0
  41. package/dist/admin/document-blocks/InvoiceTotals.js.map +1 -0
  42. package/dist/admin/document-blocks/InvoiceVatSummary.d.ts +5 -0
  43. package/dist/admin/document-blocks/InvoiceVatSummary.d.ts.map +1 -0
  44. package/dist/admin/document-blocks/InvoiceVatSummary.js +5 -0
  45. package/dist/admin/document-blocks/InvoiceVatSummary.js.map +1 -0
  46. package/dist/admin/index.d.ts +3 -1
  47. package/dist/admin/index.d.ts.map +1 -1
  48. package/dist/admin/index.js +62 -2
  49. package/dist/admin/index.js.map +1 -1
  50. package/dist/admin/pages/InvoiceDetail.d.ts.map +1 -1
  51. package/dist/admin/pages/InvoiceDetail.js +3 -1
  52. package/dist/admin/pages/InvoiceDetail.js.map +1 -1
  53. package/dist/admin/pages/InvoiceTemplatesRedirect.d.ts +10 -0
  54. package/dist/admin/pages/InvoiceTemplatesRedirect.d.ts.map +1 -0
  55. package/dist/admin/pages/InvoiceTemplatesRedirect.js +14 -0
  56. package/dist/admin/pages/InvoiceTemplatesRedirect.js.map +1 -0
  57. package/dist/admin/templates/invoice-puck-config.d.ts +7 -21
  58. package/dist/admin/templates/invoice-puck-config.d.ts.map +1 -1
  59. package/dist/admin/templates/invoice-puck-config.js +13 -27
  60. package/dist/admin/templates/invoice-puck-config.js.map +1 -1
  61. package/dist/backend/document/block-descriptions.d.ts +22 -0
  62. package/dist/backend/document/block-descriptions.d.ts.map +1 -0
  63. package/dist/backend/{pdf-components/descriptor.js → document/block-descriptions.js} +8 -24
  64. package/dist/backend/document/block-descriptions.js.map +1 -0
  65. package/dist/backend/document/document-templates-grant.d.ts +29 -0
  66. package/dist/backend/document/document-templates-grant.d.ts.map +1 -0
  67. package/dist/backend/document/document-templates-grant.js +45 -0
  68. package/dist/backend/document/document-templates-grant.js.map +1 -0
  69. package/dist/backend/document/invoice-document-type.d.ts +38 -0
  70. package/dist/backend/document/invoice-document-type.d.ts.map +1 -0
  71. package/dist/backend/document/invoice-document-type.js +108 -0
  72. package/dist/backend/document/invoice-document-type.js.map +1 -0
  73. package/dist/backend/document/render-invoice.d.ts +14 -0
  74. package/dist/backend/document/render-invoice.d.ts.map +1 -0
  75. package/dist/backend/document/render-invoice.js +24 -0
  76. package/dist/backend/document/render-invoice.js.map +1 -0
  77. package/dist/backend/entities/invoice.entity.d.ts +13 -0
  78. package/dist/backend/entities/invoice.entity.d.ts.map +1 -1
  79. package/dist/backend/entities/invoice.entity.js +10 -0
  80. package/dist/backend/entities/invoice.entity.js.map +1 -1
  81. package/dist/backend/index.d.ts +1 -3
  82. package/dist/backend/index.d.ts.map +1 -1
  83. package/dist/backend/index.js +76 -5
  84. package/dist/backend/index.js.map +1 -1
  85. package/dist/backend/pdf-components/sections.d.ts +7 -1
  86. package/dist/backend/pdf-components/sections.d.ts.map +1 -1
  87. package/dist/backend/pdf-components/sections.js +10 -1
  88. package/dist/backend/pdf-components/sections.js.map +1 -1
  89. package/dist/backend/pdf-components/tree-mapper.d.ts +5 -21
  90. package/dist/backend/pdf-components/tree-mapper.d.ts.map +1 -1
  91. package/dist/backend/pdf-components/tree-mapper.js +8 -44
  92. package/dist/backend/pdf-components/tree-mapper.js.map +1 -1
  93. package/dist/backend/plugin.d.ts +12 -13
  94. package/dist/backend/plugin.d.ts.map +1 -1
  95. package/dist/backend/plugin.js +4 -17
  96. package/dist/backend/plugin.js.map +1 -1
  97. package/dist/backend/routes.admin.d.ts +3 -5
  98. package/dist/backend/routes.admin.d.ts.map +1 -1
  99. package/dist/backend/routes.admin.js +8 -53
  100. package/dist/backend/routes.admin.js.map +1 -1
  101. package/dist/backend/routes.customer.d.ts +3 -5
  102. package/dist/backend/routes.customer.d.ts.map +1 -1
  103. package/dist/backend/routes.customer.js +3 -3
  104. package/dist/backend/routes.customer.js.map +1 -1
  105. package/dist/backend/services/auto-issue-reactor.d.ts.map +1 -1
  106. package/dist/backend/services/auto-issue-reactor.js +11 -0
  107. package/dist/backend/services/auto-issue-reactor.js.map +1 -1
  108. package/dist/backend/services/corrective-invoice.d.ts +90 -0
  109. package/dist/backend/services/corrective-invoice.d.ts.map +1 -1
  110. package/dist/backend/services/corrective-invoice.js +275 -63
  111. package/dist/backend/services/corrective-invoice.js.map +1 -1
  112. package/dist/backend/services/invoice-email-dispatch.d.ts +7 -3
  113. package/dist/backend/services/invoice-email-dispatch.d.ts.map +1 -1
  114. package/dist/backend/services/invoice-email-dispatch.js +2 -1
  115. package/dist/backend/services/invoice-email-dispatch.js.map +1 -1
  116. package/dist/backend/services/invoice-line-builder.d.ts +63 -13
  117. package/dist/backend/services/invoice-line-builder.d.ts.map +1 -1
  118. package/dist/backend/services/invoice-line-builder.js +79 -28
  119. package/dist/backend/services/invoice-line-builder.js.map +1 -1
  120. package/dist/backend/services/invoice-service.d.ts +14 -1
  121. package/dist/backend/services/invoice-service.d.ts.map +1 -1
  122. package/dist/backend/services/invoice-service.js +64 -54
  123. package/dist/backend/services/invoice-service.js.map +1 -1
  124. package/dist/manifest.d.ts +7 -3
  125. package/dist/manifest.d.ts.map +1 -1
  126. package/dist/manifest.js +45 -19
  127. package/dist/manifest.js.map +1 -1
  128. package/dist/migrations/20261017T075839_invoices_drop_invoice_templates.d.ts +20 -0
  129. package/dist/migrations/20261017T075839_invoices_drop_invoice_templates.d.ts.map +1 -0
  130. package/dist/migrations/20261017T075839_invoices_drop_invoice_templates.js +43 -0
  131. package/dist/migrations/20261017T075839_invoices_drop_invoice_templates.js.map +1 -0
  132. package/dist/migrations/20261024T145631_invoices_vat_summary.d.ts +18 -0
  133. package/dist/migrations/20261024T145631_invoices_vat_summary.d.ts.map +1 -0
  134. package/dist/migrations/20261024T145631_invoices_vat_summary.js +22 -0
  135. package/dist/migrations/20261024T145631_invoices_vat_summary.js.map +1 -0
  136. package/dist/migrations/index.d.ts +3 -1
  137. package/dist/migrations/index.d.ts.map +1 -1
  138. package/dist/migrations/index.js +5 -1
  139. package/dist/migrations/index.js.map +1 -1
  140. package/docs/invoices.md +44 -14
  141. package/i18n/en.json +4 -3
  142. package/i18n/pl.json +4 -3
  143. package/package.json +13 -13
  144. package/dist/admin/pages/InvoiceTemplateEditor.d.ts +0 -11
  145. package/dist/admin/pages/InvoiceTemplateEditor.d.ts.map +0 -1
  146. package/dist/admin/pages/InvoiceTemplateEditor.js +0 -189
  147. package/dist/admin/pages/InvoiceTemplateEditor.js.map +0 -1
  148. package/dist/admin/pages/InvoiceTemplatesPage.d.ts +0 -10
  149. package/dist/admin/pages/InvoiceTemplatesPage.d.ts.map +0 -1
  150. package/dist/admin/pages/InvoiceTemplatesPage.js +0 -60
  151. package/dist/admin/pages/InvoiceTemplatesPage.js.map +0 -1
  152. package/dist/admin/templates/described-blocks.d.ts +0 -67
  153. package/dist/admin/templates/described-blocks.d.ts.map +0 -1
  154. package/dist/admin/templates/described-blocks.js +0 -83
  155. package/dist/admin/templates/described-blocks.js.map +0 -1
  156. package/dist/admin/templates/invoice-builder-plugin.d.ts +0 -4
  157. package/dist/admin/templates/invoice-builder-plugin.d.ts.map +0 -1
  158. package/dist/admin/templates/invoice-builder-plugin.js +0 -12
  159. package/dist/admin/templates/invoice-builder-plugin.js.map +0 -1
  160. package/dist/backend/entities/invoice-template.entity.d.ts +0 -22
  161. package/dist/backend/entities/invoice-template.entity.d.ts.map +0 -1
  162. package/dist/backend/entities/invoice-template.entity.js +0 -84
  163. package/dist/backend/entities/invoice-template.entity.js.map +0 -1
  164. package/dist/backend/pdf-components/descriptor.d.ts +0 -29
  165. package/dist/backend/pdf-components/descriptor.d.ts.map +0 -1
  166. package/dist/backend/pdf-components/descriptor.js.map +0 -1
  167. package/dist/backend/services/invoice-pdf-renderer.d.ts +0 -57
  168. package/dist/backend/services/invoice-pdf-renderer.d.ts.map +0 -1
  169. package/dist/backend/services/invoice-pdf-renderer.js +0 -158
  170. package/dist/backend/services/invoice-pdf-renderer.js.map +0 -1
  171. package/dist/backend/services/invoice-template-service.d.ts +0 -43
  172. package/dist/backend/services/invoice-template-service.d.ts.map +0 -1
  173. package/dist/backend/services/invoice-template-service.js +0 -147
  174. package/dist/backend/services/invoice-template-service.js.map +0 -1
@@ -1,60 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useState } from 'react';
3
- import { Link } from 'react-router-dom';
4
- import { ApiError, apiClient } from '@endora-commerce/admin-kit/lib';
5
- import { Alert, AlertDescription, Badge, Button, Card, CardContent, Input, Label, PageHeader, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@endora-commerce/admin-kit/ui';
6
- import { SalesChannelPicker } from '@endora-commerce/admin-kit/components';
7
- import { InvoiceSectionTabs } from '../components/InvoiceSectionTabs.js';
8
- import { useTranslation } from '@endora-commerce/admin-kit/i18n';
9
- /** Admin invoice templates list + create (feature 047, US6). */
10
- export function InvoiceTemplatesPage() {
11
- const t = useTranslation('core');
12
- const [rows, setRows] = useState([]);
13
- const [loading, setLoading] = useState(true);
14
- const [error, setError] = useState(null);
15
- const [code, setCode] = useState('');
16
- const [name, setName] = useState('');
17
- const [channelId, setChannelId] = useState('');
18
- const refresh = useCallback(async () => {
19
- setLoading(true);
20
- setError(null);
21
- try {
22
- const res = await apiClient.get('/api/v1/admin/invoice-templates');
23
- setRows(res.data);
24
- }
25
- catch (err) {
26
- setError(err instanceof ApiError ? err.envelope.error.message : 'Failed to load.');
27
- }
28
- finally {
29
- setLoading(false);
30
- }
31
- }, []);
32
- useEffect(() => {
33
- void refresh();
34
- }, [refresh]);
35
- const create = useCallback(async () => {
36
- setError(null);
37
- try {
38
- await apiClient.post('/api/v1/admin/invoice-templates', {
39
- code,
40
- name,
41
- salesChannelId: channelId.trim() ? channelId.trim() : null,
42
- });
43
- setCode('');
44
- setName('');
45
- setChannelId('');
46
- await refresh();
47
- }
48
- catch (err) {
49
- setError(err instanceof ApiError ? err.envelope.error.message : 'Failed to create.');
50
- }
51
- }, [code, name, channelId, refresh]);
52
- return (_jsxs(_Fragment, { children: [_jsx(PageHeader, { title: t('invoiceTemplates.title'), description: t('invoiceTemplates.description') }), _jsx(InvoiceSectionTabs, {}), error ? (_jsx(Alert, { variant: "destructive", className: "mb-4", children: _jsx(AlertDescription, { children: error }) })) : null, _jsx(Card, { className: "mb-4", children: _jsxs(CardContent, { className: "grid gap-3 pt-6 md:grid-cols-4", children: [_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: "tcode", children: t('invoiceTemplates.fields.code') }), _jsx(Input, { id: "tcode", value: code, onChange: (e) => setCode(e.target.value) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: "tname", children: t('invoiceTemplates.fields.name') }), _jsx(Input, { id: "tname", value: name, onChange: (e) => setName(e.target.value) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: "tchan", children: t('invoiceTemplates.fields.channel') }), _jsx(SalesChannelPicker, { id: "tchan", value: channelId.trim() ? channelId : null, onChange: (id) => setChannelId(id ?? ''), placeholder: t('invoiceTemplates.fields.channelHint'), clearable: true })] }), _jsx("div", { className: "flex items-end", children: _jsx(Button, { onClick: () => void create(), disabled: !code || !name, children: t('invoiceTemplates.create') }) })] }) }), _jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: loading ? (_jsx("p", { className: "text-sm text-muted-foreground", children: t('common.state.loading') })) : (_jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: t('invoiceTemplates.columns.name') }), _jsx(TableHead, { children: t('invoiceTemplates.columns.scope') }), _jsx(TableHead, { children: t('invoiceTemplates.columns.active') }), _jsx(TableHead, {})] }) }), _jsx(TableBody, { children: rows.map((r) => (_jsxs(TableRow, { children: [_jsxs(TableCell, { className: "font-medium", children: [r.name, r.isSystem ? _jsx(Badge, { className: "ml-2", variant: "secondary", children: "system" }) : null] }), _jsx(TableCell, { className: "font-mono text-xs", children: r.salesChannelId ? r.salesChannelId.slice(0, 8) : t('invoiceTemplates.global') }), _jsx(TableCell, { children: r.active ? _jsx(Badge, { variant: "success", children: t('invoiceTemplates.active') }) : null }), _jsx(TableCell, { children: _jsx(Button, { asChild: true, variant: "outline", size: "sm", children: _jsx(Link, { to: `/invoices/templates/${r.id}`, children: t('common.action.edit') }) }) })] }, r.id))) })] })) }) })] }));
53
- }
54
- /**
55
- * The registry loads a route component through a dynamic-import factory and
56
- * reads its default export (feature 091, FR-013). The named export stays: it is
57
- * the spelling this module's own code and its tests use.
58
- */
59
- export default InvoiceTemplatesPage;
60
- //# sourceMappingURL=InvoiceTemplatesPage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InvoiceTemplatesPage.js","sourceRoot":"","sources":["../../../src/admin/pages/InvoiceTemplatesPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,gBAAgB,E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AAC,SAAS,YAAE,CAAC,CAAC,yBAAyB,CAAC,GAAS,CAAC,CAAC,CAAC,IAAI,GACxE,EACZ,KAAC,SAAS,cACR,KAAC,MAAM,IAAC,OAAO,QAAC,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,IAAI,YACzC,KAAC,IAAI,IAAC,EAAE,EAAE,uBAAuB,CAAC,CAAC,EAAE,EAAE,YAAG,CAAC,CAAC,oBAAoB,CAAC,GAAQ,GAClE,GACC,KAfC,CAAC,CAAC,EAAE,CAgBR,CACZ,CAAC,GACQ,IACN,CACT,GACW,GACT,IACN,CACJ,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,eAAe,oBAAoB,CAAC"}
@@ -1,67 +0,0 @@
1
- import type { Config } from '@puckeditor/core';
2
- import type { InvoiceTemplateBlockField } from '@endora-commerce/contracts';
3
- /**
4
- * The invoice editor's view of blocks it has no React binding for —
5
- * `specs/134-paid-module-extraction/` T138 (`research.md` D22 §3(b)).
6
- *
7
- * `invoicePuckConfig` binds this module's own ten blocks. A block another
8
- * module declares reaches the editor as **data**: the served descriptor
9
- * (`GET /api/v1/admin/invoice-templates/page-builder/config`) lists every
10
- * present contributor's block with its label and fields, and this merge turns
11
- * each one the local map does not bind into a config Puck can insert and
12
- * configure. Its canvas render is a neutral stand-in; the *Preview PDF* button
13
- * renders it for real, server-side, through the contributor's registration.
14
- *
15
- * **This is not a contribution kind (α).** No module hands this editor React;
16
- * the keys come from the descriptor at runtime, so this module's admin names no
17
- * other module's block. The shape is the CMS editor's `mergeConfig` and
18
- * FR-019's degradation merge, applied to this surface.
19
- *
20
- * **A stored name nothing covers** — its module off, not installed, or a name
21
- * nobody recognises (`specs/096-page-builder-block-ownership/` FR-019, FR-020,
22
- * identical for all three) — gets a visible, data-preserving placeholder that
23
- * is **not** in the palette: it stays where it is, and nobody may insert it.
24
- * It is built here rather than taken from `@endora-commerce/cms-components`,
25
- * whose placeholder speaks about storefront builds and would bring that
26
- * package's peers into this module.
27
- *
28
- * Strings arrive through `text` so they are translated by the caller, and both
29
- * are statements of fact on the surface where the block sits (D-265): no link,
30
- * no action, and a palette that only ever lists present contributors.
31
- */
32
- /** One block as the served descriptor describes it. */
33
- export interface InvoiceBuilderDescriptorEntry {
34
- readonly name: string;
35
- readonly ownerModule: string;
36
- readonly label: string;
37
- readonly fields: Readonly<Record<string, InvoiceTemplateBlockField>>;
38
- }
39
- /** The served descriptor, as the editor reads it. */
40
- export interface InvoiceBuilderDescriptor {
41
- readonly components: readonly InvoiceBuilderDescriptorEntry[];
42
- }
43
- /** The two sentences this merge renders, already translated. */
44
- export interface DescribedBlockText {
45
- /** A present contributor's block on the canvas. */
46
- standIn(input: {
47
- readonly label: string;
48
- readonly owner: string;
49
- }): string;
50
- /** A stored block nothing covers; `owner` is `null` for a name that states none. */
51
- placeholder(input: {
52
- readonly owner: string | null;
53
- readonly name: string;
54
- }): string;
55
- }
56
- /** The one palette section this editor has. */
57
- export declare const INVOICE_PALETTE_CATEGORY = "invoice";
58
- /**
59
- * `config` plus every present contributor's described block (insertable, in
60
- * the invoice category) and a placeholder for every stored name neither covers
61
- * (not in any category). `descriptor` is `null` when it could not be fetched:
62
- * nothing is then described, and every stored unknown name is kept.
63
- *
64
- * Entries the local map already binds are left exactly as they are.
65
- */
66
- export declare function withDescribedInvoiceBlocks(config: Config, descriptor: InvoiceBuilderDescriptor | null, storedNames: Iterable<string>, text: DescribedBlockText): Config;
67
- //# sourceMappingURL=described-blocks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"described-blocks.d.ts","sourceRoot":"","sources":["../../../src/admin/templates/described-blocks.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,MAAM,EAAS,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,uDAAuD;AACvD,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC,CAAC;CACtE;AAED,qDAAqD;AACrD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,UAAU,EAAE,SAAS,6BAA6B,EAAE,CAAC;CAC/D;AAED,gEAAgE;AAChE,MAAM,WAAW,kBAAkB;IACjC,mDAAmD;IACnD,OAAO,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;IAC3E,oFAAoF;IACpF,WAAW,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC;CACtF;AAED,+CAA+C;AAC/C,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAmDlD;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,wBAAwB,GAAG,IAAI,EAC3C,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,EAC7B,IAAI,EAAE,kBAAkB,GACvB,MAAM,CA4BR"}
@@ -1,83 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { createColorField, ownerOf } from '@endora-commerce/page-builder-core';
3
- /** The one palette section this editor has. */
4
- export const INVOICE_PALETTE_CATEGORY = 'invoice';
5
- const noteStyle = {
6
- fontFamily: 'system-ui, sans-serif',
7
- fontSize: 12,
8
- color: '#475569',
9
- background: '#f8fafc',
10
- border: '1px dashed #cbd5e1',
11
- borderRadius: 4,
12
- padding: '8px 10px',
13
- margin: '6px 0',
14
- };
15
- function Note({ text }) {
16
- return (_jsx("div", { role: "note", style: noteStyle, children: text }));
17
- }
18
- function puckField(field) {
19
- if (field.type === 'color')
20
- return createColorField({ label: field.label });
21
- if (field.type === 'select' || field.type === 'radio') {
22
- return { type: field.type, label: field.label, options: [...(field.options ?? [])] };
23
- }
24
- return { type: field.type, label: field.label };
25
- }
26
- function describedBlock(entry, text) {
27
- const sentence = text.standIn({ label: entry.label, owner: entry.ownerModule });
28
- const fields = {};
29
- for (const [key, field] of Object.entries(entry.fields))
30
- fields[key] = puckField(field);
31
- return {
32
- label: entry.label,
33
- fields,
34
- render: () => _jsx(Note, { text: sentence }),
35
- };
36
- }
37
- function placeholderBlock(name, text) {
38
- const sentence = text.placeholder({ owner: ownerOf(name), name });
39
- // No fields and no defaults: Puck neither offers nor writes a prop, so every
40
- // stored prop goes back through a save exactly as it came.
41
- return {
42
- label: name,
43
- fields: {},
44
- render: () => _jsx(Note, { text: sentence }),
45
- };
46
- }
47
- /**
48
- * `config` plus every present contributor's described block (insertable, in
49
- * the invoice category) and a placeholder for every stored name neither covers
50
- * (not in any category). `descriptor` is `null` when it could not be fetched:
51
- * nothing is then described, and every stored unknown name is kept.
52
- *
53
- * Entries the local map already binds are left exactly as they are.
54
- */
55
- export function withDescribedInvoiceBlocks(config, descriptor, storedNames, text) {
56
- const local = (config.components ?? {});
57
- const components = { ...local };
58
- const described = [];
59
- for (const entry of descriptor?.components ?? []) {
60
- if (entry.name in components)
61
- continue;
62
- components[entry.name] = describedBlock(entry, text);
63
- described.push(entry.name);
64
- }
65
- for (const name of new Set(storedNames)) {
66
- if (name in components)
67
- continue;
68
- components[name] = placeholderBlock(name, text);
69
- }
70
- const categories = { ...(config.categories ?? {}) };
71
- const section = categories[INVOICE_PALETTE_CATEGORY];
72
- if (described.length > 0) {
73
- categories[INVOICE_PALETTE_CATEGORY] = {
74
- ...section,
75
- components: [...(section?.components ?? []), ...described],
76
- };
77
- }
78
- // A placeholder belongs to no category, and Puck would otherwise list every
79
- // uncategorised name under "Other" — which would make it insertable.
80
- categories.other = { ...categories.other, visible: false };
81
- return { ...config, components, categories };
82
- }
83
- //# sourceMappingURL=described-blocks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"described-blocks.js","sourceRoot":"","sources":["../../../src/admin/templates/described-blocks.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAqD/E,+CAA+C;AAC/C,MAAM,CAAC,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAElD,MAAM,SAAS,GAAkB;IAC/B,UAAU,EAAE,uBAAuB;IACnC,QAAQ,EAAE,EAAE;IACZ,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE,SAAS;IACrB,MAAM,EAAE,oBAAoB;IAC5B,YAAY,EAAE,CAAC;IACf,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,OAAO;CAChB,CAAC;AAEF,SAAS,IAAI,CAAC,EAAE,IAAI,EAA6B;IAC/C,OAAO,CACL,cAAK,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,SAAS,YAC9B,IAAI,GACD,CACP,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,KAAgC;IACjD,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,gBAAgB,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAU,CAAC;IACrF,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QACtD,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,EAAW,CAAC;IAChG,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,I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AAC;IAE/B,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE,UAAU,IAAI,EAAE,EAAE,CAAC;QACjD,IAAI,KAAK,CAAC,IAAI,IAAI,UAAU;YAAE,SAAS;QACvC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACrD,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,IAAI,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QACxC,IAAI,IAAI,IAAI,UAAU;YAAE,SAAS;QACjC,UAAU,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,UAAU,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,EAAuC,CAAC;IACzF,MAAM,OAAO,GAAG,UAAU,CAAC,wBAAwB,CAAC,CAAC;IACrD,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,UAAU,CAAC,wBAAwB,CAAC,GAAG;YACrC,GAAG,OAAO;YACV,UAAU,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC;SAC3D,CAAC;IACJ,CAAC;IACD,4EAA4E;IAC5E,qEAAqE;IACrE,UAAU,CAAC,KAAK,GAAG,EAAE,GAAG,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAE3D,OAAO,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,UAAU,EAAY,CAAC;AACzD,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { Plugin } from '@puckeditor/core';
2
- /** Invoice builder plugin — Outline like CMS/email, without viewport fields. */
3
- export declare function createInvoiceBuilderEditorPlugin(): Plugin;
4
- //# sourceMappingURL=invoice-builder-plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoice-builder-plugin.d.ts","sourceRoot":"","sources":["../../../src/admin/templates/invoice-builder-plugin.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG/C,gFAAgF;AAChF,wBAAgB,gCAAgC,IAAI,MAAM,CAQzD"}
@@ -1,12 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { PageBuilderOutline } from '@endora-commerce/page-builder-core/editor';
4
- /** Invoice builder plugin — Outline like CMS/email, without viewport fields. */
5
- export function createInvoiceBuilderEditorPlugin() {
6
- return {
7
- overrides: {
8
- outline: ({ children }) => (_jsx(PageBuilderOutline, { children: children })),
9
- },
10
- };
11
- }
12
- //# sourceMappingURL=invoice-builder-plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoice-builder-plugin.js","sourceRoot":"","sources":["../../../src/admin/templates/invoice-builder-plugin.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAE/E,gFAAgF;AAChF,MAAM,UAAU,gCAAgC;IAC9C,OAAO;QACL,SAAS,EAAE;YACT,OAAO,EAAE,CAAC,EAAE,QAAQ,EAA2B,EAAgB,EAAE,CAAC,CAChE,KAAC,kBAAkB,cAAE,QAAQ,GAAsB,CACpD;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -1,22 +0,0 @@
1
- import { OptionalProps } from '@mikro-orm/core';
2
- /**
3
- * WYSIWYG (Puck) invoice PDF template (feature 047, research R2). One global
4
- * generic default (`salesChannelId = null`, `isSystem = true`); optional
5
- * per-channel overrides. `content` is a Puck envelope
6
- * `{ schema_version, languages: { <lang>: <PuckTree> } }`.
7
- */
8
- export declare class InvoiceTemplate {
9
- [OptionalProps]?: 'id' | 'salesChannelId' | 'active' | 'isSystem' | 'version' | 'languages' | 'createdAt' | 'updatedAt';
10
- id: string;
11
- code: string;
12
- name: string;
13
- salesChannelId?: string | null;
14
- content: Record<string, unknown>;
15
- languages: string[];
16
- active: boolean;
17
- isSystem: boolean;
18
- version: number;
19
- createdAt: Date;
20
- updatedAt: Date;
21
- }
22
- //# sourceMappingURL=invoice-template.entity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoice-template.entity.d.ts","sourceRoot":"","sources":["../../../src/backend/entities/invoice-template.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,aAAa,EAAwB,MAAM,iBAAiB,CAAC;AAIrF;;;;;GAKG;AACH,qBAEa,eAAe;IAC1B,CAAC,aAAa,CAAC,CAAC,EACZ,IAAI,GACJ,gBAAgB,GAChB,QAAQ,GACR,UAAU,GACV,SAAS,GACT,WAAW,GACX,WAAW,GACX,WAAW,CAAC;IAGhB,EAAE,EAAE,MAAM,CAAgB;IAI1B,IAAI,EAAG,MAAM,CAAC;IAGd,IAAI,EAAG,MAAM,CAAC;IAId,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAwC;IAGxE,SAAS,EAAE,MAAM,EAAE,CAAM;IAGzB,MAAM,EAAE,OAAO,CAAQ;IAGvB,QAAQ,EAAE,OAAO,CAAS;IAG1B,OAAO,EAAE,MAAM,CAAK;IAGpB,SAAS,EAAE,IAAI,CAAc;IAG7B,SAAS,EAAE,IAAI,CAAc;CAC9B"}
@@ -1,84 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { Entity, Index, OptionalProps, PrimaryKey, Property } from '@mikro-orm/core';
11
- import { GlobalEntity } from '@endora-commerce/platform/tenancy';
12
- import { randomUUID } from 'crypto';
13
- /**
14
- * WYSIWYG (Puck) invoice PDF template (feature 047, research R2). One global
15
- * generic default (`salesChannelId = null`, `isSystem = true`); optional
16
- * per-channel overrides. `content` is a Puck envelope
17
- * `{ schema_version, languages: { <lang>: <PuckTree> } }`.
18
- */
19
- let InvoiceTemplate = class InvoiceTemplate {
20
- [OptionalProps];
21
- id = randomUUID();
22
- code;
23
- name;
24
- salesChannelId;
25
- content = { schema_version: 1, languages: {} };
26
- languages = [];
27
- active = true;
28
- isSystem = false;
29
- version = 1;
30
- createdAt = new Date();
31
- updatedAt = new Date();
32
- };
33
- __decorate([
34
- PrimaryKey({ type: 'uuid' }),
35
- __metadata("design:type", String)
36
- ], InvoiceTemplate.prototype, "id", void 0);
37
- __decorate([
38
- Property({ type: 'string', length: 180 }),
39
- Index(),
40
- __metadata("design:type", String)
41
- ], InvoiceTemplate.prototype, "code", void 0);
42
- __decorate([
43
- Property({ type: 'string', length: 200 }),
44
- __metadata("design:type", String)
45
- ], InvoiceTemplate.prototype, "name", void 0);
46
- __decorate([
47
- Property({ type: 'uuid', nullable: true }),
48
- Index(),
49
- __metadata("design:type", Object)
50
- ], InvoiceTemplate.prototype, "salesChannelId", void 0);
51
- __decorate([
52
- Property({ type: 'json' }),
53
- __metadata("design:type", Object)
54
- ], InvoiceTemplate.prototype, "content", void 0);
55
- __decorate([
56
- Property({ type: 'json' }),
57
- __metadata("design:type", Array)
58
- ], InvoiceTemplate.prototype, "languages", void 0);
59
- __decorate([
60
- Property({ type: 'boolean' }),
61
- __metadata("design:type", Boolean)
62
- ], InvoiceTemplate.prototype, "active", void 0);
63
- __decorate([
64
- Property({ type: 'boolean' }),
65
- __metadata("design:type", Boolean)
66
- ], InvoiceTemplate.prototype, "isSystem", void 0);
67
- __decorate([
68
- Property({ type: 'integer' }),
69
- __metadata("design:type", Number)
70
- ], InvoiceTemplate.prototype, "version", void 0);
71
- __decorate([
72
- Property({ type: 'datetime', onCreate: () => new Date() }),
73
- __metadata("design:type", Date)
74
- ], InvoiceTemplate.prototype, "createdAt", void 0);
75
- __decorate([
76
- Property({ type: 'datetime', onUpdate: () => new Date() }),
77
- __metadata("design:type", Date)
78
- ], InvoiceTemplate.prototype, "updatedAt", void 0);
79
- InvoiceTemplate = __decorate([
80
- GlobalEntity(),
81
- Entity({ tableName: 'invoice_templates' })
82
- ], InvoiceTemplate);
83
- export { InvoiceTemplate };
84
- //# sourceMappingURL=invoice-template.entity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoice-template.entity.js","sourceRoot":"","sources":["../../../src/backend/entities/invoice-template.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC;;;;;GAKG;AAGI,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,CAAC,aAAa,CAAC,CAQC;IAGhB,EAAE,GAAW,UAAU,EAAE,CAAC;IAI1B,IAAI,CAAU;IAGd,IAAI,CAAU;IAId,cAAc,CAAiB;IAG/B,OAAO,GAA4B,EAAE,cAAc,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IAGxE,SAAS,GAAa,EAAE,CAAC;IAGzB,MAAM,GAAY,IAAI,CAAC;IAGvB,QAAQ,GAAY,KAAK,CAAC;IAG1B,OAAO,GAAW,CAAC,CAAC;IAGp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 @@
1
- import type { InvoiceTemplateBlockField } from '@endora-commerce/contracts';
2
- import type { InvoicePdfBlockRegistry } from '../services/invoice-pdf-block-registry.js';
3
- /**
4
- * Page-builder descriptor for the invoice template WYSIWYG palette (US6).
5
- * Served to the admin editor so it can offer the bounded invoice component set.
6
- *
7
- * The field shape is the published contract's, because a contributed block
8
- * describes its own fields (`specs/134-paid-module-extraction/` T063).
9
- */
10
- export type InvoiceComponentField = InvoiceTemplateBlockField;
11
- export interface InvoiceComponentDescriptor {
12
- name: string;
13
- ownerModule: string;
14
- label: string;
15
- fields: Record<string, InvoiceComponentField>;
16
- }
17
- /**
18
- * The descriptor `GET /api/v1/admin/invoice-templates/page-builder/config`
19
- * serves: this module's ten blocks, then every present contributor's.
20
- *
21
- * Built per request rather than held as a constant, because a contributor's
22
- * presence is read on every call — switching one off removes its block from
23
- * the palette description without a restart, and switching it on restores it.
24
- */
25
- export declare function invoicePageBuilderDescriptor(blocks: InvoicePdfBlockRegistry): {
26
- schemaVersion: 1;
27
- components: InvoiceComponentDescriptor[];
28
- };
29
- //# sourceMappingURL=descriptor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../../../src/backend/pdf-components/descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAGzF;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAE9D,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CAC/C;AA+MD;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,uBAAuB,GAA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MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE;aAC3B,CAAC,CACH;YACD,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAA8B,EAAE;gBAC5D,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;gBAC3C,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC;YACzF,CAAC,CAAC;SACH;KACF,CAAC;AACJ,CAAC"}
@@ -1,57 +0,0 @@
1
- import type { Content } from 'pdfmake/interfaces.js';
2
- import type { InvoiceDetail } from '@endora-commerce/contracts';
3
- import type { AmountToWordsLocale } from './amount-to-words.js';
4
- import { InvoicePdfBlockRegistry } from './invoice-pdf-block-registry.js';
5
- import { type LoadAssetImage } from '../pdf-components/embed-logo-images.js';
6
- export type InvoicePdfRendererOptions = {
7
- /** Load library asset bytes for InvoiceLogo (avoids pdfmake self-HTTP). */
8
- loadAssetImage?: LoadAssetImage;
9
- /**
10
- * The blocks other modules render (T063/T126). Defaults to an empty,
11
- * always-present registry, so a renderer a unit test builds renders this
12
- * module's own blocks and nothing else.
13
- */
14
- blocks?: InvoicePdfBlockRegistry;
15
- };
16
- /**
17
- * Renders an invoice to a PDF Buffer using pdfmake (feature 047, R1/R2/US6).
18
- *
19
- * When a WYSIWYG (Puck) template tree is supplied and yields renderable invoice
20
- * components, the PDF follows that layout; otherwise it falls back to the
21
- * built-in generic layout (FR-016). Both paths share the same section builders.
22
- */
23
- export declare class InvoicePdfRenderer {
24
- #private;
25
- /**
26
- * The contributed-block seam — the generalisation of the
27
- * `setKsefVerificationResolver` this class carried from feature 059 to 134.
28
- *
29
- * That setter was one vendor's contribution point: a composition root had to
30
- * call it after building both modules, which only this repository's
31
- * reference root did, so on an instance composed through the platform the
32
- * PDF carried no KSeF verification block while `ksef` was installed and on
33
- * (`research.md` D16 §1 item 7). A contributor now registers the whole block —
34
- * renderer, description and the per-render data it needs — from its own
35
- * composition, and every render path reads it here.
36
- */
37
- readonly blocks: InvoicePdfBlockRegistry;
38
- constructor(opts?: InvoicePdfRendererOptions);
39
- render(invoice: InvoiceDetail, locale?: AmountToWordsLocale, templateTree?: unknown): Promise<Buffer>;
40
- /**
41
- * The pdfmake content an invoice renders to — the template's blocks, or the
42
- * built-in layout when the template places none this module or a present
43
- * contributor renders (FR-016).
44
- *
45
- * Public because it is the one place every render path meets, which makes it
46
- * the place a test asserts what a PDF carries without parsing one.
47
- */
48
- content(invoice: InvoiceDetail, locale?: AmountToWordsLocale, templateTree?: unknown): Promise<Content[]>;
49
- /**
50
- * Each block's per-render data, read once. A rejection is the block's `null`:
51
- * the data is an enrichment, and an invoice — a legal document — never fails
52
- * to render on it. The `catch` is around a contributed callback, not a port.
53
- */
54
- private resolveContributed;
55
- private buildDoc;
56
- }
57
- //# sourceMappingURL=invoice-pdf-renderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoice-pdf-renderer.d.ts","sourceRoot":"","sources":["../../../src/backend/services/invoice-pdf-renderer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAyC,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAC5F,OAAO,KAAK,EAAE,aAAa,EAA+B,MAAM,4BAA4B,CAAC;AAC7F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAchE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,wCAAwC,CAAC;AA+DhD,MAAM,MAAM,yBAAyB,GAAG;IACtC,2EAA2E;IAC3E,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC,CAAC;AAEF;;;;;;GAMG;AACH,qBAAa,kBAAkB;;IAG7B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;gBAE7B,IAAI,GAAE,yBAA8B;IAK1C,MAAM,CACV,OAAO,EAAE,aAAa,EACtB,MAAM,GAAE,mBAA0B,EAClC,YAAY,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,MAAM,CAAC;IAWlB;;;;;;;OAOG;IACG,OAAO,CACX,OAAO,EAAE,aAAa,EACtB,MAAM,GAAE,mBAA0B,EAClC,YAAY,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,OAAO,EAAE,CAAC;IAgDrB;;;;OAIG;YACW,kBAAkB;IAgBhC,OAAO,CAAC,QAAQ;CASjB"}