@endora-commerce/mod-invoices 0.0.0-stage → 0.100.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.
- package/LICENSE +21 -0
- package/README.md +59 -2
- package/dist/admin/components/InvoiceSectionTabs.d.ts +22 -0
- package/dist/admin/components/InvoiceSectionTabs.d.ts.map +1 -0
- package/dist/admin/components/InvoiceSectionTabs.js +34 -0
- package/dist/admin/components/InvoiceSectionTabs.js.map +1 -0
- package/dist/admin/index.d.ts +34 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +69 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/pages/InvoiceDetail.d.ts +10 -0
- package/dist/admin/pages/InvoiceDetail.d.ts.map +1 -0
- package/dist/admin/pages/InvoiceDetail.js +111 -0
- package/dist/admin/pages/InvoiceDetail.js.map +1 -0
- package/dist/admin/pages/InvoiceTemplateEditor.d.ts +11 -0
- package/dist/admin/pages/InvoiceTemplateEditor.d.ts.map +1 -0
- package/dist/admin/pages/InvoiceTemplateEditor.js +188 -0
- package/dist/admin/pages/InvoiceTemplateEditor.js.map +1 -0
- package/dist/admin/pages/InvoiceTemplatesPage.d.ts +10 -0
- package/dist/admin/pages/InvoiceTemplatesPage.d.ts.map +1 -0
- package/dist/admin/pages/InvoiceTemplatesPage.js +60 -0
- package/dist/admin/pages/InvoiceTemplatesPage.js.map +1 -0
- package/dist/admin/pages/InvoicesList.d.ts +9 -0
- package/dist/admin/pages/InvoicesList.d.ts.map +1 -0
- package/dist/admin/pages/InvoicesList.js +116 -0
- package/dist/admin/pages/InvoicesList.js.map +1 -0
- package/dist/admin/templates/described-blocks.d.ts +67 -0
- package/dist/admin/templates/described-blocks.d.ts.map +1 -0
- package/dist/admin/templates/described-blocks.js +83 -0
- package/dist/admin/templates/described-blocks.js.map +1 -0
- package/dist/admin/templates/invoice-builder-plugin.d.ts +4 -0
- package/dist/admin/templates/invoice-builder-plugin.d.ts.map +1 -0
- package/dist/admin/templates/invoice-builder-plugin.js +12 -0
- package/dist/admin/templates/invoice-builder-plugin.js.map +1 -0
- package/dist/admin/templates/invoice-puck-config.d.ts +37 -0
- package/dist/admin/templates/invoice-puck-config.d.ts.map +1 -0
- package/dist/admin/templates/invoice-puck-config.js +733 -0
- package/dist/admin/templates/invoice-puck-config.js.map +1 -0
- package/dist/backend/email-templates/invoice-issued.default.d.ts +10 -0
- package/dist/backend/email-templates/invoice-issued.default.d.ts.map +1 -0
- package/dist/backend/email-templates/invoice-issued.default.js +45 -0
- package/dist/backend/email-templates/invoice-issued.default.js.map +1 -0
- package/dist/backend/entities/invoice-external-attachment.entity.d.ts +20 -0
- package/dist/backend/entities/invoice-external-attachment.entity.d.ts.map +1 -0
- package/dist/backend/entities/invoice-external-attachment.entity.js +77 -0
- package/dist/backend/entities/invoice-external-attachment.entity.js.map +1 -0
- package/dist/backend/entities/invoice-line.entity.d.ts +20 -0
- package/dist/backend/entities/invoice-line.entity.d.ts.map +1 -0
- package/dist/backend/entities/invoice-line.entity.js +82 -0
- package/dist/backend/entities/invoice-line.entity.js.map +1 -0
- package/dist/backend/entities/invoice-number-counter.entity.d.ts +18 -0
- package/dist/backend/entities/invoice-number-counter.entity.d.ts.map +1 -0
- package/dist/backend/entities/invoice-number-counter.entity.js +63 -0
- package/dist/backend/entities/invoice-number-counter.entity.js.map +1 -0
- package/dist/backend/entities/invoice-template.entity.d.ts +22 -0
- package/dist/backend/entities/invoice-template.entity.d.ts.map +1 -0
- package/dist/backend/entities/invoice-template.entity.js +84 -0
- package/dist/backend/entities/invoice-template.entity.js.map +1 -0
- package/dist/backend/entities/invoice.entity.d.ts +64 -0
- package/dist/backend/entities/invoice.entity.d.ts.map +1 -0
- package/dist/backend/entities/invoice.entity.js +202 -0
- package/dist/backend/entities/invoice.entity.js.map +1 -0
- package/dist/backend/index.d.ts +111 -0
- package/dist/backend/index.d.ts.map +1 -0
- package/dist/backend/index.js +291 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/pdf-components/descriptor.d.ts +29 -0
- package/dist/backend/pdf-components/descriptor.d.ts.map +1 -0
- package/dist/backend/pdf-components/descriptor.js +227 -0
- package/dist/backend/pdf-components/descriptor.js.map +1 -0
- package/dist/backend/pdf-components/embed-logo-images.d.ts +35 -0
- package/dist/backend/pdf-components/embed-logo-images.d.ts.map +1 -0
- package/dist/backend/pdf-components/embed-logo-images.js +101 -0
- package/dist/backend/pdf-components/embed-logo-images.js.map +1 -0
- package/dist/backend/pdf-components/sample.d.ts +4 -0
- package/dist/backend/pdf-components/sample.d.ts.map +1 -0
- package/dist/backend/pdf-components/sample.js +75 -0
- package/dist/backend/pdf-components/sample.js.map +1 -0
- package/dist/backend/pdf-components/sections.d.ts +34 -0
- package/dist/backend/pdf-components/sections.d.ts.map +1 -0
- package/dist/backend/pdf-components/sections.js +445 -0
- package/dist/backend/pdf-components/sections.js.map +1 -0
- package/dist/backend/pdf-components/tree-mapper.d.ts +37 -0
- package/dist/backend/pdf-components/tree-mapper.d.ts.map +1 -0
- package/dist/backend/pdf-components/tree-mapper.js +76 -0
- package/dist/backend/pdf-components/tree-mapper.js.map +1 -0
- package/dist/backend/plugin.d.ts +124 -0
- package/dist/backend/plugin.d.ts.map +1 -0
- package/dist/backend/plugin.js +87 -0
- package/dist/backend/plugin.js.map +1 -0
- package/dist/backend/routes.admin.d.ts +41 -0
- package/dist/backend/routes.admin.d.ts.map +1 -0
- package/dist/backend/routes.admin.js +219 -0
- package/dist/backend/routes.admin.js.map +1 -0
- package/dist/backend/routes.customer.d.ts +33 -0
- package/dist/backend/routes.customer.d.ts.map +1 -0
- package/dist/backend/routes.customer.js +124 -0
- package/dist/backend/routes.customer.js.map +1 -0
- package/dist/backend/seeds/generic-invoice-template.d.ts +18 -0
- package/dist/backend/seeds/generic-invoice-template.d.ts.map +1 -0
- package/dist/backend/seeds/generic-invoice-template.js +174 -0
- package/dist/backend/seeds/generic-invoice-template.js.map +1 -0
- package/dist/backend/services/amount-to-words.d.ts +20 -0
- package/dist/backend/services/amount-to-words.d.ts.map +1 -0
- package/dist/backend/services/amount-to-words.js +232 -0
- package/dist/backend/services/amount-to-words.js.map +1 -0
- package/dist/backend/services/auto-issue-reactor.d.ts +53 -0
- package/dist/backend/services/auto-issue-reactor.d.ts.map +1 -0
- package/dist/backend/services/auto-issue-reactor.js +122 -0
- package/dist/backend/services/auto-issue-reactor.js.map +1 -0
- package/dist/backend/services/corrective-invoice.d.ts +38 -0
- package/dist/backend/services/corrective-invoice.d.ts.map +1 -0
- package/dist/backend/services/corrective-invoice.js +257 -0
- package/dist/backend/services/corrective-invoice.js.map +1 -0
- package/dist/backend/services/cross-module-context.d.ts +82 -0
- package/dist/backend/services/cross-module-context.d.ts.map +1 -0
- package/dist/backend/services/cross-module-context.js +93 -0
- package/dist/backend/services/cross-module-context.js.map +1 -0
- package/dist/backend/services/duplicate-number-refusal.d.ts +33 -0
- package/dist/backend/services/duplicate-number-refusal.d.ts.map +1 -0
- package/dist/backend/services/duplicate-number-refusal.js +92 -0
- package/dist/backend/services/duplicate-number-refusal.js.map +1 -0
- package/dist/backend/services/erp-sale-document-write-port.d.ts +37 -0
- package/dist/backend/services/erp-sale-document-write-port.d.ts.map +1 -0
- package/dist/backend/services/erp-sale-document-write-port.js +192 -0
- package/dist/backend/services/erp-sale-document-write-port.js.map +1 -0
- package/dist/backend/services/invoice-attachment-fetch-registry.d.ts +75 -0
- package/dist/backend/services/invoice-attachment-fetch-registry.d.ts.map +1 -0
- package/dist/backend/services/invoice-attachment-fetch-registry.js +81 -0
- package/dist/backend/services/invoice-attachment-fetch-registry.js.map +1 -0
- package/dist/backend/services/invoice-copy-host.service.d.ts +9 -0
- package/dist/backend/services/invoice-copy-host.service.d.ts.map +1 -0
- package/dist/backend/services/invoice-copy-host.service.js +52 -0
- package/dist/backend/services/invoice-copy-host.service.js.map +1 -0
- package/dist/backend/services/invoice-email-dispatch.d.ts +89 -0
- package/dist/backend/services/invoice-email-dispatch.d.ts.map +1 -0
- package/dist/backend/services/invoice-email-dispatch.js +138 -0
- package/dist/backend/services/invoice-email-dispatch.js.map +1 -0
- package/dist/backend/services/invoice-line-builder.d.ts +29 -0
- package/dist/backend/services/invoice-line-builder.d.ts.map +1 -0
- package/dist/backend/services/invoice-line-builder.js +46 -0
- package/dist/backend/services/invoice-line-builder.js.map +1 -0
- package/dist/backend/services/invoice-number-collisions.d.ts +17 -0
- package/dist/backend/services/invoice-number-collisions.d.ts.map +1 -0
- package/dist/backend/services/invoice-number-collisions.js +154 -0
- package/dist/backend/services/invoice-number-collisions.js.map +1 -0
- package/dist/backend/services/invoice-number-generator.d.ts +96 -0
- package/dist/backend/services/invoice-number-generator.d.ts.map +1 -0
- package/dist/backend/services/invoice-number-generator.js +157 -0
- package/dist/backend/services/invoice-number-generator.js.map +1 -0
- package/dist/backend/services/invoice-pdf-block-registry.d.ts +65 -0
- package/dist/backend/services/invoice-pdf-block-registry.d.ts.map +1 -0
- package/dist/backend/services/invoice-pdf-block-registry.js +94 -0
- package/dist/backend/services/invoice-pdf-block-registry.js.map +1 -0
- package/dist/backend/services/invoice-pdf-renderer.d.ts +57 -0
- package/dist/backend/services/invoice-pdf-renderer.d.ts.map +1 -0
- package/dist/backend/services/invoice-pdf-renderer.js +158 -0
- package/dist/backend/services/invoice-pdf-renderer.js.map +1 -0
- package/dist/backend/services/invoice-pdf.d.ts +24 -0
- package/dist/backend/services/invoice-pdf.d.ts.map +1 -0
- package/dist/backend/services/invoice-pdf.js +52 -0
- package/dist/backend/services/invoice-pdf.js.map +1 -0
- package/dist/backend/services/invoice-placement-apply-port.d.ts +29 -0
- package/dist/backend/services/invoice-placement-apply-port.d.ts.map +1 -0
- package/dist/backend/services/invoice-placement-apply-port.js +40 -0
- package/dist/backend/services/invoice-placement-apply-port.js.map +1 -0
- package/dist/backend/services/invoice-read-port.d.ts +44 -0
- package/dist/backend/services/invoice-read-port.d.ts.map +1 -0
- package/dist/backend/services/invoice-read-port.js +95 -0
- package/dist/backend/services/invoice-read-port.js.map +1 -0
- package/dist/backend/services/invoice-service.d.ts +94 -0
- package/dist/backend/services/invoice-service.d.ts.map +1 -0
- package/dist/backend/services/invoice-service.js +374 -0
- package/dist/backend/services/invoice-service.js.map +1 -0
- package/dist/backend/services/invoice-template-service.d.ts +43 -0
- package/dist/backend/services/invoice-template-service.d.ts.map +1 -0
- package/dist/backend/services/invoice-template-service.js +147 -0
- package/dist/backend/services/invoice-template-service.js.map +1 -0
- package/dist/backend/services/numbering-configuration.d.ts +76 -0
- package/dist/backend/services/numbering-configuration.d.ts.map +1 -0
- package/dist/backend/services/numbering-configuration.js +176 -0
- package/dist/backend/services/numbering-configuration.js.map +1 -0
- package/dist/backend/services/numbering-write-validator.d.ts +22 -0
- package/dist/backend/services/numbering-write-validator.d.ts.map +1 -0
- package/dist/backend/services/numbering-write-validator.js +82 -0
- package/dist/backend/services/numbering-write-validator.js.map +1 -0
- package/dist/backend/services/seller-settings.d.ts +24 -0
- package/dist/backend/services/seller-settings.d.ts.map +1 -0
- package/dist/backend/services/seller-settings.js +38 -0
- package/dist/backend/services/seller-settings.js.map +1 -0
- package/dist/backend/services/vendor-number-hold.d.ts +10 -0
- package/dist/backend/services/vendor-number-hold.d.ts.map +1 -0
- package/dist/backend/services/vendor-number-hold.js +14 -0
- package/dist/backend/services/vendor-number-hold.js.map +1 -0
- package/dist/manifest.d.ts +203 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +390 -0
- package/dist/manifest.js.map +1 -0
- package/dist/migrations/20260629T125121_invoices_module.d.ts +17 -0
- package/dist/migrations/20260629T125121_invoices_module.d.ts.map +1 -0
- package/dist/migrations/20260629T125121_invoices_module.js +117 -0
- package/dist/migrations/20260629T125121_invoices_module.js.map +1 -0
- package/dist/migrations/20260801T111000_invoices_generic_template_reseed.d.ts +6 -0
- package/dist/migrations/20260801T111000_invoices_generic_template_reseed.d.ts.map +1 -0
- package/dist/migrations/20260801T111000_invoices_generic_template_reseed.js +25 -0
- package/dist/migrations/20260801T111000_invoices_generic_template_reseed.js.map +1 -0
- package/dist/migrations/20260817T201110_invoices_correction_idempotency_key.d.ts +20 -0
- package/dist/migrations/20260817T201110_invoices_correction_idempotency_key.d.ts.map +1 -0
- package/dist/migrations/20260817T201110_invoices_correction_idempotency_key.js +33 -0
- package/dist/migrations/20260817T201110_invoices_correction_idempotency_key.js.map +1 -0
- package/dist/migrations/20260903T101756_invoices_namespace_block_names.d.ts +6 -0
- package/dist/migrations/20260903T101756_invoices_namespace_block_names.d.ts.map +1 -0
- package/dist/migrations/20260903T101756_invoices_namespace_block_names.js +56 -0
- package/dist/migrations/20260903T101756_invoices_namespace_block_names.js.map +1 -0
- package/dist/migrations/20260914T133603_invoices_erp_imported_sale_documents.d.ts +12 -0
- package/dist/migrations/20260914T133603_invoices_erp_imported_sale_documents.d.ts.map +1 -0
- package/dist/migrations/20260914T133603_invoices_erp_imported_sale_documents.js +87 -0
- package/dist/migrations/20260914T133603_invoices_erp_imported_sale_documents.js.map +1 -0
- package/dist/migrations/20260926T230239_invoices_import_identity.d.ts +33 -0
- package/dist/migrations/20260926T230239_invoices_import_identity.d.ts.map +1 -0
- package/dist/migrations/20260926T230239_invoices_import_identity.js +83 -0
- package/dist/migrations/20260926T230239_invoices_import_identity.js.map +1 -0
- package/dist/migrations/index.d.ts +32 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +39 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/ports/index.d.ts +93 -0
- package/dist/ports/index.d.ts.map +1 -0
- package/dist/ports/index.js +2 -0
- package/dist/ports/index.js.map +1 -0
- package/docs/invoices.md +113 -0
- package/i18n/en.json +45 -0
- package/i18n/pl.json +45 -0
- package/package.json +119 -3
- package/tailwind.css +14 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Invoices module — manifest (feature 047-invoices-module).
|
|
3
|
+
*
|
|
4
|
+
* Owns invoice generation (proforma / VAT invoice / correction), the per-channel
|
|
5
|
+
* numbering engine, the WYSIWYG PDF templates, seller company settings, and
|
|
6
|
+
* email delivery (through the transactional_emails module). Scalar settings are
|
|
7
|
+
* declared here and seeded by the module-lifecycle ManifestReconciler on boot;
|
|
8
|
+
* all are Sales-Channel-scopable through the standard settings scoping.
|
|
9
|
+
*/
|
|
10
|
+
export declare const INVOICES_SETTING_CODES: {
|
|
11
|
+
readonly SELLER_TAX_ID: "invoices.seller.tax_id";
|
|
12
|
+
readonly SELLER_COMPANY_DATA: "invoices.seller.company_data";
|
|
13
|
+
readonly AUTO_ISSUE_TRIGGER_STATUS: "invoices.auto_issue.trigger_status";
|
|
14
|
+
readonly EMAIL_SEND_ON_ISSUE: "invoices.email.send_on_issue";
|
|
15
|
+
readonly EMAIL_DELIVERY_MODE: "invoices.email.delivery_mode";
|
|
16
|
+
readonly NUMBERING_INVOICE_PATTERN: "invoices.numbering.invoice.pattern";
|
|
17
|
+
readonly NUMBERING_PROFORMA_PATTERN: "invoices.numbering.proforma.pattern";
|
|
18
|
+
readonly NUMBERING_CORRECTION_PATTERN: "invoices.numbering.correction.pattern";
|
|
19
|
+
readonly STOREFRONT_BASE_URL: "invoices.storefront_base_url";
|
|
20
|
+
};
|
|
21
|
+
export declare const invoicesSettingsManifest: {
|
|
22
|
+
moduleCode: string;
|
|
23
|
+
groups: {
|
|
24
|
+
code: string;
|
|
25
|
+
name: string;
|
|
26
|
+
salesChannelCodes?: string[] | undefined;
|
|
27
|
+
isSystemProtected?: boolean | undefined;
|
|
28
|
+
}[];
|
|
29
|
+
settings: {
|
|
30
|
+
code: string;
|
|
31
|
+
name: string;
|
|
32
|
+
valueType: "string" | "number" | "boolean" | "json" | "string_list" | "secret" | "credential_ref";
|
|
33
|
+
defaultValue: unknown;
|
|
34
|
+
description?: string | undefined;
|
|
35
|
+
groupCode?: string | undefined;
|
|
36
|
+
previousDefaultValues?: unknown[] | undefined;
|
|
37
|
+
salesChannelCodes?: string[] | undefined;
|
|
38
|
+
enumOptions?: string[] | undefined;
|
|
39
|
+
configurationType?: string | undefined;
|
|
40
|
+
hidden?: boolean | undefined;
|
|
41
|
+
}[];
|
|
42
|
+
};
|
|
43
|
+
export declare const manifest: {
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
version: string;
|
|
47
|
+
dependencies: string[];
|
|
48
|
+
description?: string | undefined;
|
|
49
|
+
acknowledgedDependencies?: {
|
|
50
|
+
moduleId: string;
|
|
51
|
+
port: string;
|
|
52
|
+
reason: string;
|
|
53
|
+
}[] | undefined;
|
|
54
|
+
nonBindingDependencies?: {
|
|
55
|
+
moduleId: string;
|
|
56
|
+
name: string;
|
|
57
|
+
kind: "contributes-to" | "degrades-without" | "refuses-without";
|
|
58
|
+
reason: string;
|
|
59
|
+
whenAbsent?: string | undefined;
|
|
60
|
+
}[] | undefined;
|
|
61
|
+
activation?: {
|
|
62
|
+
settingCode: string;
|
|
63
|
+
default: boolean;
|
|
64
|
+
} | {
|
|
65
|
+
nonDeactivatable: true;
|
|
66
|
+
reason: string;
|
|
67
|
+
} | undefined;
|
|
68
|
+
settings?: {
|
|
69
|
+
moduleCode: string;
|
|
70
|
+
groups: {
|
|
71
|
+
code: string;
|
|
72
|
+
name: string;
|
|
73
|
+
salesChannelCodes?: string[] | undefined;
|
|
74
|
+
isSystemProtected?: boolean | undefined;
|
|
75
|
+
}[];
|
|
76
|
+
settings: {
|
|
77
|
+
code: string;
|
|
78
|
+
name: string;
|
|
79
|
+
valueType: "string" | "number" | "boolean" | "json" | "string_list" | "secret" | "credential_ref";
|
|
80
|
+
defaultValue: unknown;
|
|
81
|
+
description?: string | undefined;
|
|
82
|
+
groupCode?: string | undefined;
|
|
83
|
+
previousDefaultValues?: unknown[] | undefined;
|
|
84
|
+
salesChannelCodes?: string[] | undefined;
|
|
85
|
+
enumOptions?: string[] | undefined;
|
|
86
|
+
configurationType?: string | undefined;
|
|
87
|
+
hidden?: boolean | undefined;
|
|
88
|
+
}[];
|
|
89
|
+
} | undefined;
|
|
90
|
+
i18n?: {
|
|
91
|
+
bundlesDir: string;
|
|
92
|
+
} | undefined;
|
|
93
|
+
docs?: false | {
|
|
94
|
+
dir: string;
|
|
95
|
+
} | undefined;
|
|
96
|
+
demo?: false | {
|
|
97
|
+
summary: string;
|
|
98
|
+
seed: (context: import("@endora-commerce/contracts").ModuleDemoContext<never>) => Promise<import("@endora-commerce/contracts").DemoSeedResult>;
|
|
99
|
+
reset: (context: import("@endora-commerce/contracts").ModuleDemoContext<never>) => Promise<import("@endora-commerce/contracts").DemoResetResult>;
|
|
100
|
+
after?: readonly string[] | undefined;
|
|
101
|
+
package?: string | undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
actions?: {
|
|
104
|
+
id: string;
|
|
105
|
+
labelKey: string;
|
|
106
|
+
icon: "Plus" | "Sparkles" | "Settings" | "Search" | "Boxes" | "Layers" | "Menu" | "PlusCircle" | "PlusSquare" | "FilePlus" | "FolderPlus" | "Upload" | "FileUp" | "CloudUpload" | "Download" | "FileDown" | "FileText" | "BookOpen" | "Rss" | "Package" | "Tag" | "ShoppingCart" | "Receipt" | "CreditCard" | "Users" | "UserPlus" | "Inbox" | "ListChecks" | "ClipboardList" | "Image" | "Video" | "LayoutDashboard" | "PanelLeft" | "KeyRound" | "ShieldCheck" | "Edit" | "Archive" | "Box" | "Truck" | "CircleDollarSign" | "Activity" | "LineChart" | "Smartphone" | "Webhook" | "Scale" | "PlugZap" | "PercentDiamond" | "Newspaper" | "Languages" | "Eraser" | "Warehouse" | "TrendingDown" | "Bell" | "PackageOpen" | "Building2" | "Store" | "ClipboardCheck";
|
|
107
|
+
targetRoute: string;
|
|
108
|
+
keywords: string[];
|
|
109
|
+
weight: number;
|
|
110
|
+
descriptionKey?: string | undefined;
|
|
111
|
+
requiredPermission?: string | undefined;
|
|
112
|
+
}[] | undefined;
|
|
113
|
+
permissions?: {
|
|
114
|
+
code: string;
|
|
115
|
+
label: string;
|
|
116
|
+
module?: string | undefined;
|
|
117
|
+
description?: string | undefined;
|
|
118
|
+
requires?: string[] | undefined;
|
|
119
|
+
}[] | undefined;
|
|
120
|
+
transactionalEmails?: {
|
|
121
|
+
code: string;
|
|
122
|
+
name: string;
|
|
123
|
+
variables: {
|
|
124
|
+
key: string;
|
|
125
|
+
label: string;
|
|
126
|
+
sampleValue?: string | undefined;
|
|
127
|
+
description?: string | undefined;
|
|
128
|
+
}[];
|
|
129
|
+
description?: string | undefined;
|
|
130
|
+
group?: string | undefined;
|
|
131
|
+
}[] | undefined;
|
|
132
|
+
capabilities?: string[] | undefined;
|
|
133
|
+
exclusiveCapabilities?: {
|
|
134
|
+
key: string;
|
|
135
|
+
errorCode: string;
|
|
136
|
+
}[] | undefined;
|
|
137
|
+
errorCodes?: {
|
|
138
|
+
code: string;
|
|
139
|
+
tokens?: string[] | undefined;
|
|
140
|
+
}[] | undefined;
|
|
141
|
+
blocks?: {
|
|
142
|
+
name: string;
|
|
143
|
+
labelKey: string;
|
|
144
|
+
category: string;
|
|
145
|
+
contexts: ("invoice" | "email" | "cms" | "newsletter")[];
|
|
146
|
+
fields: Record<string, {
|
|
147
|
+
type: "number" | "object" | "array" | "text" | "textarea" | "select" | "radio" | "external" | "uuid" | "richtext";
|
|
148
|
+
label?: string | undefined;
|
|
149
|
+
required?: boolean | undefined;
|
|
150
|
+
options?: {
|
|
151
|
+
label: string;
|
|
152
|
+
value: string | number;
|
|
153
|
+
}[] | undefined;
|
|
154
|
+
refKind?: string | undefined;
|
|
155
|
+
}>;
|
|
156
|
+
descriptionKey?: string | undefined;
|
|
157
|
+
defaultProps?: Record<string, unknown> | undefined;
|
|
158
|
+
responsiveFields?: string[] | undefined;
|
|
159
|
+
previewIcon?: string | undefined;
|
|
160
|
+
weight?: number | undefined;
|
|
161
|
+
}[] | undefined;
|
|
162
|
+
blockCategories?: {
|
|
163
|
+
key: string;
|
|
164
|
+
titleKey: string;
|
|
165
|
+
contexts: ("invoice" | "email" | "cms" | "newsletter")[];
|
|
166
|
+
weight?: number | undefined;
|
|
167
|
+
visible?: boolean | undefined;
|
|
168
|
+
}[] | undefined;
|
|
169
|
+
env?: {
|
|
170
|
+
name: string;
|
|
171
|
+
describes: {
|
|
172
|
+
en: string;
|
|
173
|
+
pl: string;
|
|
174
|
+
};
|
|
175
|
+
requirement: {
|
|
176
|
+
kind: "required";
|
|
177
|
+
} | {
|
|
178
|
+
kind: "requiredWhen";
|
|
179
|
+
input: string;
|
|
180
|
+
equals: string;
|
|
181
|
+
} | {
|
|
182
|
+
kind: "optional";
|
|
183
|
+
without: {
|
|
184
|
+
en: string;
|
|
185
|
+
pl: string;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
secret: boolean;
|
|
189
|
+
generable: boolean;
|
|
190
|
+
owner: {
|
|
191
|
+
kind: "platform";
|
|
192
|
+
} | {
|
|
193
|
+
kind: "application";
|
|
194
|
+
application: "admin" | "backend" | "storefront";
|
|
195
|
+
} | {
|
|
196
|
+
kind: "module";
|
|
197
|
+
moduleId: string;
|
|
198
|
+
};
|
|
199
|
+
consumers: ("admin" | "backend" | "storefront")[];
|
|
200
|
+
addressOf: "admin" | "backend" | "storefront" | null;
|
|
201
|
+
}[] | undefined;
|
|
202
|
+
};
|
|
203
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;CAUzB,CAAC;AAEX,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;CAgHnC,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwQnB,CAAC"}
|
package/dist/manifest.js
ADDED
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import { defineModuleManifest, defineModuleSettingsManifest } from '@endora-commerce/contracts';
|
|
2
|
+
/**
|
|
3
|
+
* Invoices module — manifest (feature 047-invoices-module).
|
|
4
|
+
*
|
|
5
|
+
* Owns invoice generation (proforma / VAT invoice / correction), the per-channel
|
|
6
|
+
* numbering engine, the WYSIWYG PDF templates, seller company settings, and
|
|
7
|
+
* email delivery (through the transactional_emails module). Scalar settings are
|
|
8
|
+
* declared here and seeded by the module-lifecycle ManifestReconciler on boot;
|
|
9
|
+
* all are Sales-Channel-scopable through the standard settings scoping.
|
|
10
|
+
*/
|
|
11
|
+
export const INVOICES_SETTING_CODES = {
|
|
12
|
+
SELLER_TAX_ID: 'invoices.seller.tax_id',
|
|
13
|
+
SELLER_COMPANY_DATA: 'invoices.seller.company_data',
|
|
14
|
+
AUTO_ISSUE_TRIGGER_STATUS: 'invoices.auto_issue.trigger_status',
|
|
15
|
+
EMAIL_SEND_ON_ISSUE: 'invoices.email.send_on_issue',
|
|
16
|
+
EMAIL_DELIVERY_MODE: 'invoices.email.delivery_mode',
|
|
17
|
+
NUMBERING_INVOICE_PATTERN: 'invoices.numbering.invoice.pattern',
|
|
18
|
+
NUMBERING_PROFORMA_PATTERN: 'invoices.numbering.proforma.pattern',
|
|
19
|
+
NUMBERING_CORRECTION_PATTERN: 'invoices.numbering.correction.pattern',
|
|
20
|
+
STOREFRONT_BASE_URL: 'invoices.storefront_base_url',
|
|
21
|
+
};
|
|
22
|
+
export const invoicesSettingsManifest = defineModuleSettingsManifest({
|
|
23
|
+
moduleCode: 'invoices',
|
|
24
|
+
groups: [{ code: 'invoices', name: 'Invoices' }],
|
|
25
|
+
settings: [
|
|
26
|
+
{
|
|
27
|
+
// Feature 073 — the operator's activation control. Platform-wide.
|
|
28
|
+
code: 'invoices.enabled',
|
|
29
|
+
name: 'Invoices enabled',
|
|
30
|
+
description: 'Switches invoice issuance, corrections, the PDF renderer and the customer-facing invoice list on or off. Nothing is dropped: issued invoices, their numbering sequence and their templates stay in the database, and issuance resumes from the same sequence when you switch it back on.',
|
|
31
|
+
groupCode: 'invoices',
|
|
32
|
+
valueType: 'boolean',
|
|
33
|
+
defaultValue: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
code: INVOICES_SETTING_CODES.SELLER_TAX_ID,
|
|
37
|
+
name: 'Seller VAT / NIP',
|
|
38
|
+
description: 'Your company VAT/NIP number printed on every invoice as the seller. Sales-channel value overrides the global value.',
|
|
39
|
+
groupCode: 'invoices',
|
|
40
|
+
valueType: 'string',
|
|
41
|
+
defaultValue: '',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
code: INVOICES_SETTING_CODES.SELLER_COMPANY_DATA,
|
|
45
|
+
name: 'Seller company data',
|
|
46
|
+
description: 'Seller (your company) data printed on invoices: { legalName, addressLine1, addressLine2, postalCode, city, country, bankName, bankAccount, swift, email, phone }. JSON object.',
|
|
47
|
+
groupCode: 'invoices',
|
|
48
|
+
valueType: 'json',
|
|
49
|
+
defaultValue: {},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
code: INVOICES_SETTING_CODES.AUTO_ISSUE_TRIGGER_STATUS,
|
|
53
|
+
name: 'Auto-issue on order status',
|
|
54
|
+
description: 'Order status code that automatically issues a VAT invoice when reached (e.g. "paid"). Empty = manual issuance only.',
|
|
55
|
+
groupCode: 'invoices',
|
|
56
|
+
valueType: 'string',
|
|
57
|
+
defaultValue: '',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
code: INVOICES_SETTING_CODES.EMAIL_SEND_ON_ISSUE,
|
|
61
|
+
name: 'Email invoice on issue',
|
|
62
|
+
description: 'When enabled, the invoice is emailed to the customer automatically once issued.',
|
|
63
|
+
groupCode: 'invoices',
|
|
64
|
+
valueType: 'boolean',
|
|
65
|
+
defaultValue: false,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
code: INVOICES_SETTING_CODES.EMAIL_DELIVERY_MODE,
|
|
69
|
+
name: 'Invoice email delivery mode',
|
|
70
|
+
description: 'Whether the invoice email carries the PDF as an attachment or a link to the storefront customer panel download.',
|
|
71
|
+
groupCode: 'invoices',
|
|
72
|
+
valueType: 'string',
|
|
73
|
+
defaultValue: 'attachment',
|
|
74
|
+
enumOptions: ['attachment', 'link'],
|
|
75
|
+
},
|
|
76
|
+
// Feature 078, D-95.3 — the three numbering defaults carry `{channel}`.
|
|
77
|
+
//
|
|
78
|
+
// Every channel used to resolve one and the same default, so *creating a
|
|
79
|
+
// sales channel* armed a duplicate: two channels drew sequence 1 in the
|
|
80
|
+
// same year, rendered one string, and the second issuance died on
|
|
81
|
+
// `invoices_number_unique`. The operator never had to open this screen for
|
|
82
|
+
// that to happen, which is why the fix is in the default rather than only
|
|
83
|
+
// in the write refusal.
|
|
84
|
+
//
|
|
85
|
+
// `previousDefaultValues` names the pre-D-95 string so `ManifestReconciler`
|
|
86
|
+
// migrates a deployment that never overrode it instead of refusing to boot.
|
|
87
|
+
// The system-default channel is pinned back to the old pattern by this
|
|
88
|
+
// module's boot hook, so no existing series changes shape.
|
|
89
|
+
{
|
|
90
|
+
code: INVOICES_SETTING_CODES.NUMBERING_INVOICE_PATTERN,
|
|
91
|
+
name: 'Invoice numbering pattern',
|
|
92
|
+
description: 'Format for VAT invoice numbers. Tokens: {seq}, {seq:N} (zero-padded), {channel} (the sales channel code), {YYYY}, {YY}, {MM}. The sequence resets yearly, per channel, while the number itself must be unique across the whole platform — so a pattern shared by two channels needs {channel} in it.',
|
|
93
|
+
groupCode: 'invoices',
|
|
94
|
+
valueType: 'string',
|
|
95
|
+
defaultValue: 'FV {seq}/{channel}/{YYYY}',
|
|
96
|
+
previousDefaultValues: ['FV {seq}/{YYYY}'],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
code: INVOICES_SETTING_CODES.NUMBERING_PROFORMA_PATTERN,
|
|
100
|
+
name: 'Proforma numbering pattern',
|
|
101
|
+
description: 'Format for proforma numbers. Tokens: {seq}, {seq:N} (zero-padded), {channel} (the sales channel code), {YYYY}, {YY}, {MM}. The sequence resets yearly, per channel, while the number itself must be unique across the whole platform — so a pattern shared by two channels needs {channel} in it.',
|
|
102
|
+
groupCode: 'invoices',
|
|
103
|
+
valueType: 'string',
|
|
104
|
+
defaultValue: 'PRO {seq}/{channel}/{YYYY}',
|
|
105
|
+
previousDefaultValues: ['PRO {seq}/{YYYY}'],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
code: INVOICES_SETTING_CODES.NUMBERING_CORRECTION_PATTERN,
|
|
109
|
+
name: 'Correction numbering pattern',
|
|
110
|
+
description: 'Format for corrective-invoice numbers. Tokens: {seq}, {seq:N} (zero-padded), {channel} (the sales channel code), {YYYY}, {YY}, {MM}. The sequence resets yearly, per channel, while the number itself must be unique across the whole platform — so a pattern shared by two channels needs {channel} in it.',
|
|
111
|
+
groupCode: 'invoices',
|
|
112
|
+
valueType: 'string',
|
|
113
|
+
defaultValue: 'KOR {seq}/{channel}/{YYYY}',
|
|
114
|
+
previousDefaultValues: ['KOR {seq}/{YYYY}'],
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
code: INVOICES_SETTING_CODES.STOREFRONT_BASE_URL,
|
|
118
|
+
name: 'Storefront base URL (for invoice email links)',
|
|
119
|
+
description: 'Base URL used to build the customer-panel invoice download link in link-mode emails (e.g. https://shop.example.com). Empty = links disabled.',
|
|
120
|
+
groupCode: 'invoices',
|
|
121
|
+
valueType: 'string',
|
|
122
|
+
defaultValue: '',
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
});
|
|
126
|
+
export const manifest = defineModuleManifest({
|
|
127
|
+
id: 'invoices',
|
|
128
|
+
name: 'Invoices',
|
|
129
|
+
description: 'Invoice generation, numbering, PDF templates, corrections, and email delivery.',
|
|
130
|
+
version: '2.0.0',
|
|
131
|
+
// `auth` owns the `requireAdmin` port and the customer guard this module
|
|
132
|
+
// resolves; feature 072 made both container resolutions.
|
|
133
|
+
// `ksef` is deliberately absent: it reads `invoiceService`, so declaring it
|
|
134
|
+
// here would close a cycle. The KSeF verification block reaches this module
|
|
135
|
+
// as a contribution a root fills, not as a port this module resolves.
|
|
136
|
+
//
|
|
137
|
+
// `assets_library` and `customer_accounts` joined in
|
|
138
|
+
// `specs/110-instance-repository/` T118c, when `invoicesBridge` was retired:
|
|
139
|
+
// the operator's logo is `assetReadPort` and the invoice e-mail's recipient
|
|
140
|
+
// is `customerAccountReadPort`, both resolved by this module now and both
|
|
141
|
+
// reached through a composition root's closure before. Binding edges, and
|
|
142
|
+
// **neither costs an operator a control** — derived and not waived: both
|
|
143
|
+
// owners declare `activation.nonDeactivatable`, so there is no switchable
|
|
144
|
+
// owner for a `refuses-without` sentence to describe. That is the same answer
|
|
145
|
+
// `mfa` and `product_feeds` came to and a different one from `returns`, and
|
|
146
|
+
// the difference is the owners', not the consumer's.
|
|
147
|
+
dependencies: [
|
|
148
|
+
'assets_library',
|
|
149
|
+
'auth',
|
|
150
|
+
'customer_accounts',
|
|
151
|
+
'orders',
|
|
152
|
+
'organizations',
|
|
153
|
+
'settings',
|
|
154
|
+
'transactional_emails',
|
|
155
|
+
],
|
|
156
|
+
nonBindingDependencies: [
|
|
157
|
+
{
|
|
158
|
+
moduleId: 'invoice_ledger',
|
|
159
|
+
name: 'invoiceLedgerRoutingPort',
|
|
160
|
+
kind: 'degrades-without',
|
|
161
|
+
whenAbsent: 'Issuance stays Endora-numbered and ready; mode B wait is ignored.',
|
|
162
|
+
reason: 'InvoiceService.issue holds pending only when the ledger module is present and numbering is vendor.',
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
settings: invoicesSettingsManifest,
|
|
166
|
+
i18n: { bundlesDir: 'i18n' },
|
|
167
|
+
docs: { dir: 'docs' },
|
|
168
|
+
// Feature 047 — admin-editable transactional email owned by this module.
|
|
169
|
+
transactionalEmails: [
|
|
170
|
+
{
|
|
171
|
+
code: 'invoice_issued',
|
|
172
|
+
name: 'Invoice issued',
|
|
173
|
+
group: 'invoices',
|
|
174
|
+
variables: [
|
|
175
|
+
{ key: 'invoice.number', label: 'Invoice number', sampleValue: 'FV 26/2026' },
|
|
176
|
+
{ key: 'invoice.total', label: 'Invoice total', sampleValue: '6 648,15' },
|
|
177
|
+
{ key: 'invoice.currency', label: 'Currency', sampleValue: 'PLN' },
|
|
178
|
+
{ key: 'order.businessId', label: 'Order number', sampleValue: 'ORD-1042' },
|
|
179
|
+
{ key: 'invoice.downloadUrl', label: 'Download link', sampleValue: 'https://shop.example.com/orders/…' },
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
permissions: [
|
|
184
|
+
{ code: 'invoices:read', label: 'View invoices and download invoice PDFs' },
|
|
185
|
+
{ code: 'invoices:write', label: 'Issue/correct invoices, edit templates, and configure invoicing' },
|
|
186
|
+
],
|
|
187
|
+
/**
|
|
188
|
+
* The three error codes this module owns — feature 090 Phase 3
|
|
189
|
+
* (`specs/090-module-owned-error-codes/contracts/error-code-declaration.md`
|
|
190
|
+
* §1.1). This is where each sentence is looked up from: `errors.<CODE>` in this
|
|
191
|
+
* module's own `i18n/{en,pl}.json`, which already holds all three in both
|
|
192
|
+
* languages.
|
|
193
|
+
*
|
|
194
|
+
* The list is answer-preserving, not a judgement (§6.2 and §6.5): it is exactly
|
|
195
|
+
* what the prefix chain in `@endora-commerce/mod-i18n` routes here today,
|
|
196
|
+
* copied from the frozen capture at
|
|
197
|
+
* `backend/test/fixtures/error-code-routing/chain-answers.ts` rather than
|
|
198
|
+
* re-derived. Re-routing a code to a better owner is
|
|
199
|
+
* `specs/082-error-code-ownership/rulings.md` §9's remaining work and is
|
|
200
|
+
* deliberately not done here.
|
|
201
|
+
*
|
|
202
|
+
* **This module's list and this module's `throw`s are two different sets, in
|
|
203
|
+
* both directions**, because ownership follows the domain noun and never the
|
|
204
|
+
* thrower (D-95.2). `INVOICE_NOT_READY` is declared here and raised **only** by
|
|
205
|
+
* `orders`, at both ends of its invoice-download path — `GET
|
|
206
|
+
* /api/v1/orders/:id/invoice` and `POST /api/v1/admin/orders/bulk/print-invoices`,
|
|
207
|
+
* both in that module's `routes.ts`. Going the other way, five
|
|
208
|
+
* codes this module does raise belong elsewhere and are absent below:
|
|
209
|
+
* `ORDER_NOT_FOUND` is `orders`', and `NOT_FOUND`, `VALIDATION_FAILED`,
|
|
210
|
+
* `VERSION_CONFLICT` and `INTERNAL` are the platform's.
|
|
211
|
+
*
|
|
212
|
+
* **One more code a reader will look for here and not find.**
|
|
213
|
+
* `PDF_GENERATION_FAILED` reads like this module's — it renders every invoice
|
|
214
|
+
* PDF — and is `comparisons`', by the chain's own `code ===
|
|
215
|
+
* ERROR_CODES.PDF_GENERATION_FAILED` rule. Nothing here raises it: this
|
|
216
|
+
* module's PDF path throws no `HttpError` at all.
|
|
217
|
+
*
|
|
218
|
+
* **The tokens come off the raise sites, not off the bundle.** The envelope's
|
|
219
|
+
* `refusalToken` (`packages/platform/src/http/error-envelope.ts`) reads exactly
|
|
220
|
+
* one member of `details` — `code` — as the tail of `errors.<CODE>.<token>`, so
|
|
221
|
+
* the token set is the set of values this module's raise sites can put there.
|
|
222
|
+
* Unlike `carts` there is no enum and no named type here: every value is a bare
|
|
223
|
+
* string literal, so the set is complete once the raise sites are enumerated,
|
|
224
|
+
* and enumerating them completely is the whole of the work. Each token list
|
|
225
|
+
* below is in raise-site order.
|
|
226
|
+
*
|
|
227
|
+
* - `INVOICE_NUMBER_ALREADY_ISSUED` — `duplicate-number-refusal.ts` throws it
|
|
228
|
+
* twice. The second throw writes `code: sameChannel ? 'same_channel' :
|
|
229
|
+
* 'other_channel'`; the first, taken when the row holding the number has been
|
|
230
|
+
* deleted between the constraint violation and the read, deliberately passes
|
|
231
|
+
* no `code` and so answers the tokenless base sentence.
|
|
232
|
+
* - `INVOICE_NUMBER_PATTERN_COLLIDES` — `numbering-write-validator.ts` throws it
|
|
233
|
+
* twice too, `{ code: 'no_sequence_token' }` for the self-collision and
|
|
234
|
+
* `code: 'other_channel'` for the pairwise one. Two separate throws in one
|
|
235
|
+
* file: an author who stopped at the first grep hit would declare one token
|
|
236
|
+
* and lose the other.
|
|
237
|
+
* - `INVOICE_NOT_READY` — neither raise site passes `details` at all, so it
|
|
238
|
+
* carries no token.
|
|
239
|
+
*
|
|
240
|
+
* The bundle holds a sentence for all four and for no fifth, and
|
|
241
|
+
* `backend/test/unit/invoices/error-sentences.test.ts` enumerates the same
|
|
242
|
+
* seven keys by hand. Both agree with the raise sites; neither is the
|
|
243
|
+
* authority, because a token nobody has written a sentence for is still a token
|
|
244
|
+
* (`specs/090-module-owned-error-codes/migration-runbook.md` §5).
|
|
245
|
+
*/
|
|
246
|
+
errorCodes: [
|
|
247
|
+
{ code: 'INVOICE_NOT_READY' },
|
|
248
|
+
{ code: 'INVOICE_NUMBER_ALREADY_ISSUED', tokens: ['same_channel', 'other_channel'] },
|
|
249
|
+
{
|
|
250
|
+
code: 'INVOICE_NUMBER_PATTERN_COLLIDES',
|
|
251
|
+
tokens: ['no_sequence_token', 'other_channel'],
|
|
252
|
+
},
|
|
253
|
+
],
|
|
254
|
+
actions: [
|
|
255
|
+
{
|
|
256
|
+
id: 'open-invoices',
|
|
257
|
+
labelKey: 'actions.openInvoices.label',
|
|
258
|
+
descriptionKey: 'actions.openInvoices.description',
|
|
259
|
+
icon: 'FileText',
|
|
260
|
+
targetRoute: '/invoices',
|
|
261
|
+
requiredPermission: 'invoices:read',
|
|
262
|
+
keywords: ['invoices', 'faktury', 'vat', 'billing'],
|
|
263
|
+
weight: 240,
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
id: 'invoice-templates',
|
|
267
|
+
labelKey: 'actions.invoiceTemplates.label',
|
|
268
|
+
descriptionKey: 'actions.invoiceTemplates.description',
|
|
269
|
+
icon: 'Layers',
|
|
270
|
+
targetRoute: '/invoices/templates',
|
|
271
|
+
// `invoices:read` — `GET /api/v1/admin/invoice-templates` is read-gated,
|
|
272
|
+
// and the row is a destination rather than an operation (issue #232).
|
|
273
|
+
requiredPermission: 'invoices:read',
|
|
274
|
+
keywords: ['invoice template', 'szablon faktury', 'pdf'],
|
|
275
|
+
weight: 245,
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
activation: { settingCode: 'invoices.enabled', default: true },
|
|
279
|
+
/**
|
|
280
|
+
* The 10 invoice-template blocks this module owns, and the Invoice sections
|
|
281
|
+
* section they populate (feature 096, §7.3 and §2.1).
|
|
282
|
+
*
|
|
283
|
+
* The eleventh block in that palette, `InvoiceKsef`, is **`ksef`'s** —
|
|
284
|
+
* `ksef.InvoiceSection`, by the owner ruling of 2026-09-02 — which is why
|
|
285
|
+
* weight 70 is left unused here.
|
|
286
|
+
*
|
|
287
|
+
* The category declaration carries a **`weight`** deliberately. `ksef`
|
|
288
|
+
* declares the same section, joining it with no `weight` and no `visible`, so
|
|
289
|
+
* under `contracts/block-definition.md` §1.1's total order this declaration
|
|
290
|
+
* wins on weight and names the section. Leaving the weight off would put the
|
|
291
|
+
* pair on the module-id tie-break, which happens to give the same answer
|
|
292
|
+
* today and gives it for no stated reason.
|
|
293
|
+
*/
|
|
294
|
+
blocks: [
|
|
295
|
+
{
|
|
296
|
+
name: 'invoices.InvoiceHeader',
|
|
297
|
+
labelKey: 'blocks.invoiceHeader.label',
|
|
298
|
+
descriptionKey: 'blocks.invoiceHeader.description',
|
|
299
|
+
category: 'invoice',
|
|
300
|
+
contexts: ['invoice'],
|
|
301
|
+
fields: {},
|
|
302
|
+
weight: 10,
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
name: 'invoices.InvoiceParties',
|
|
306
|
+
labelKey: 'blocks.invoiceParties.label',
|
|
307
|
+
descriptionKey: 'blocks.invoiceParties.description',
|
|
308
|
+
category: 'invoice',
|
|
309
|
+
contexts: ['invoice'],
|
|
310
|
+
fields: {},
|
|
311
|
+
weight: 20,
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: 'invoices.InvoiceLineItems',
|
|
315
|
+
labelKey: 'blocks.invoiceLineItems.label',
|
|
316
|
+
descriptionKey: 'blocks.invoiceLineItems.description',
|
|
317
|
+
category: 'invoice',
|
|
318
|
+
contexts: ['invoice'],
|
|
319
|
+
fields: {},
|
|
320
|
+
weight: 30,
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
name: 'invoices.InvoiceVatSummary',
|
|
324
|
+
labelKey: 'blocks.invoiceVatSummary.label',
|
|
325
|
+
descriptionKey: 'blocks.invoiceVatSummary.description',
|
|
326
|
+
category: 'invoice',
|
|
327
|
+
contexts: ['invoice'],
|
|
328
|
+
fields: {},
|
|
329
|
+
weight: 40,
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
name: 'invoices.InvoiceTotals',
|
|
333
|
+
labelKey: 'blocks.invoiceTotals.label',
|
|
334
|
+
descriptionKey: 'blocks.invoiceTotals.description',
|
|
335
|
+
category: 'invoice',
|
|
336
|
+
contexts: ['invoice'],
|
|
337
|
+
fields: {},
|
|
338
|
+
weight: 50,
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: 'invoices.InvoiceNotes',
|
|
342
|
+
labelKey: 'blocks.invoiceNotes.label',
|
|
343
|
+
descriptionKey: 'blocks.invoiceNotes.description',
|
|
344
|
+
category: 'invoice',
|
|
345
|
+
contexts: ['invoice'],
|
|
346
|
+
fields: {},
|
|
347
|
+
weight: 60,
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
name: 'invoices.InvoiceSpacer',
|
|
351
|
+
labelKey: 'blocks.invoiceSpacer.label',
|
|
352
|
+
descriptionKey: 'blocks.invoiceSpacer.description',
|
|
353
|
+
category: 'invoice',
|
|
354
|
+
contexts: ['invoice'],
|
|
355
|
+
fields: {},
|
|
356
|
+
weight: 80,
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
name: 'invoices.InvoiceDivider',
|
|
360
|
+
labelKey: 'blocks.invoiceDivider.label',
|
|
361
|
+
descriptionKey: 'blocks.invoiceDivider.description',
|
|
362
|
+
category: 'invoice',
|
|
363
|
+
contexts: ['invoice'],
|
|
364
|
+
fields: {},
|
|
365
|
+
weight: 90,
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
name: 'invoices.InvoiceLogo',
|
|
369
|
+
labelKey: 'blocks.invoiceLogo.label',
|
|
370
|
+
descriptionKey: 'blocks.invoiceLogo.description',
|
|
371
|
+
category: 'invoice',
|
|
372
|
+
contexts: ['invoice'],
|
|
373
|
+
fields: {},
|
|
374
|
+
weight: 100,
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
name: 'invoices.InvoiceFooter',
|
|
378
|
+
labelKey: 'blocks.invoiceFooter.label',
|
|
379
|
+
descriptionKey: 'blocks.invoiceFooter.description',
|
|
380
|
+
category: 'invoice',
|
|
381
|
+
contexts: ['invoice'],
|
|
382
|
+
fields: {},
|
|
383
|
+
weight: 110,
|
|
384
|
+
},
|
|
385
|
+
],
|
|
386
|
+
blockCategories: [
|
|
387
|
+
{ key: 'invoice', titleKey: 'blocks.category.invoice', contexts: ['invoice'], weight: 10 },
|
|
388
|
+
],
|
|
389
|
+
});
|
|
390
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAEhG;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,aAAa,EAAE,wBAAwB;IACvC,mBAAmB,EAAE,8BAA8B;IACnD,yBAAyB,EAAE,oCAAoC;IAC/D,mBAAmB,EAAE,8BAA8B;IACnD,mBAAmB,EAAE,8BAA8B;IACnD,yBAAyB,EAAE,oCAAoC;IAC/D,0BAA0B,EAAE,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YACE,IAAI,EAAE,wBAAwB;YAC9B,QAAQ,EAAE,4BAA4B;YACtC,cAAc,EAAE,kCAAkC;YAClD,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE,CAAC,SAAS,CAAC;YACrB,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;SACX;QACD;YACE,IAAI,EAAE,yBAAyB;YAC/B,QAAQ,EAAE,6BAA6B;YACvC,cAAc,EAAE,mCAAmC;YACnD,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE,CAAC,SAAS,CAAC;YACrB,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;SACX;QACD;YACE,IAAI,EAAE,sBAAsB;YAC5B,QAAQ,EAAE,0BAA0B;YACpC,cAAc,EAAE,gCAAgC;YAChD,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE,CAAC,SAAS,CAAC;YACrB,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,GAAG;SACZ;QACD;YACE,IAAI,EAAE,wBAAwB;YAC9B,QAAQ,EAAE,4BAA4B;YACtC,cAAc,EAAE,kCAAkC;YAClD,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE,CAAC,SAAS,CAAC;YACrB,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,GAAG;SACZ;KACF;IACD,eAAe,EAAE;QACf,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,yBAAyB,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;KAC3F;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Migration } from '@mikro-orm/migrations';
|
|
2
|
+
/**
|
|
3
|
+
* Feature 047 — Invoices module.
|
|
4
|
+
*
|
|
5
|
+
* Extends the existing `invoices` table (created in 004_commerce_init) with the
|
|
6
|
+
* fields needed for real VAT invoices, and adds the supporting tables:
|
|
7
|
+
* - `invoice_lines` — immutable per-line snapshots
|
|
8
|
+
* - `invoice_number_counters` — per (channel, kind, year) gap-free sequence
|
|
9
|
+
* - `invoice_templates` — WYSIWYG (Puck) PDF layouts (global + per-channel)
|
|
10
|
+
*
|
|
11
|
+
* No email-log table — invoice emails reuse the `transactional_emails` module.
|
|
12
|
+
*/
|
|
13
|
+
export declare class Migration20260629T125121InvoicesModule extends Migration {
|
|
14
|
+
up(): Promise<void>;
|
|
15
|
+
down(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=20260629T125121_invoices_module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20260629T125121_invoices_module.d.ts","sourceRoot":"","sources":["../../src/migrations/20260629T125121_invoices_module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;;;;;;GAUG;AACH,qBAAa,sCAAuC,SAAQ,SAAS;IACpD,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IA0FnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CA0BrC"}
|