@opencxh/domain 1.243.0 → 1.244.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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DocumentBlock } from '../../platform/document-blocks';
|
|
2
|
+
import { PostalAddress } from '../organization/types';
|
|
2
3
|
/**
|
|
3
4
|
* A document template: the blocks a generated document is built from.
|
|
4
5
|
*
|
|
@@ -85,3 +86,44 @@ export interface OrganizationHouseStyle {
|
|
|
85
86
|
*/
|
|
86
87
|
iban?: string;
|
|
87
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* The sender, as a document shows it: the organisation's own details, already turned into lines.
|
|
91
|
+
*
|
|
92
|
+
* Drawn **around** a document rather than written into it — the reason `DocumentBlock` has no
|
|
93
|
+
* sender block. It is computed on the server so the print, the preview and whatever mails a PDF
|
|
94
|
+
* one day all show the same letterhead, and so the renderer needs to know nothing about
|
|
95
|
+
* `Organization`.
|
|
96
|
+
*/
|
|
97
|
+
export interface DocumentSender {
|
|
98
|
+
name: string;
|
|
99
|
+
/** Street, postcode + city, country — only the lines that exist. */
|
|
100
|
+
addressLines: string[];
|
|
101
|
+
/** KvK, VAT, IBAN, plus the organisation's own footer sentence. Only what is filled in. */
|
|
102
|
+
footerLines: string[];
|
|
103
|
+
/** Inline data-URI; there is no publicly readable URL for an uploaded file. */
|
|
104
|
+
logo?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* An organisation's details as a letterhead.
|
|
108
|
+
*
|
|
109
|
+
* Every field is optional on `Organization`, so every line here is conditional: a half-filled
|
|
110
|
+
* organisation gets a short letterhead, never `undefined, undefined`. The billing name wins over
|
|
111
|
+
* the display name — what is on a quote is the legal entity.
|
|
112
|
+
*/
|
|
113
|
+
export declare function organizationSender(organization: OrganizationLike | null | undefined): DocumentSender;
|
|
114
|
+
/**
|
|
115
|
+
* What {@link organizationSender} reads. Structural rather than `Organization` itself, so this
|
|
116
|
+
* file keeps pointing at the organisation entity instead of the other way round.
|
|
117
|
+
*/
|
|
118
|
+
export interface OrganizationLike {
|
|
119
|
+
name?: string;
|
|
120
|
+
displayName?: string;
|
|
121
|
+
logo?: string;
|
|
122
|
+
address?: PostalAddress;
|
|
123
|
+
billing?: {
|
|
124
|
+
companyName?: string;
|
|
125
|
+
vatNumber?: string;
|
|
126
|
+
kvkNumber?: string;
|
|
127
|
+
};
|
|
128
|
+
houseStyle?: OrganizationHouseStyle;
|
|
129
|
+
}
|