@opencxh/domain 1.286.3 → 1.288.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/dist/entities/activity/types.d.ts +4 -0
- package/dist/entities/agreement/index.d.ts +3 -0
- package/dist/entities/agreement/period.d.ts +37 -0
- package/dist/entities/agreement/period.test.d.ts +1 -0
- package/dist/entities/agreement/schedule.d.ts +80 -0
- package/dist/entities/agreement/schedule.test.d.ts +1 -0
- package/dist/entities/agreement/types.d.ts +167 -0
- package/dist/entities/catalog/index.d.ts +3 -0
- package/dist/entities/catalog/pricing.d.ts +9 -6
- package/dist/entities/catalog/rate-csv.d.ts +29 -0
- package/dist/entities/catalog/rate-csv.test.d.ts +1 -0
- package/dist/entities/catalog/rating.d.ts +122 -0
- package/dist/entities/catalog/rating.test.d.ts +1 -0
- package/dist/entities/catalog/types.d.ts +41 -2
- package/dist/entities/catalog/usage-source.d.ts +83 -0
- package/dist/entities/inbox/types.d.ts +3 -0
- package/dist/entities/interaction/index.d.ts +1 -0
- package/dist/entities/interaction/resolution.d.ts +29 -0
- package/dist/entities/interaction/resolution.test.d.ts +1 -0
- package/dist/entities/interaction/types.d.ts +7 -0
- package/dist/entities/transaction/keys.d.ts +7 -0
- package/dist/entities/transaction/types.d.ts +14 -0
- package/dist/index.cjs +20 -20
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2539 -2162
- package/dist/platform/ai-tools.d.ts +10 -0
- package/dist/platform/coded-message.d.ts +15 -0
- package/dist/platform/coded-message.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Inbox } from '../inbox/types';
|
|
2
|
+
/**
|
|
3
|
+
* *How* a conversation ended, apart from its status. `closed` already behaves like a servicedesk's
|
|
4
|
+
* "solved" (an inbound reopens it), so what was missing was the reason, not a fourth status.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately not `WorkResolution`: "deal won" and "spam" are different vocabularies, and one
|
|
7
|
+
* shared type would tie two apps that must change apart.
|
|
8
|
+
*/
|
|
9
|
+
export interface InteractionResolution {
|
|
10
|
+
key: string;
|
|
11
|
+
/** System: an i18n key in the communication app. Custom: what the admin typed. */
|
|
12
|
+
label: string;
|
|
13
|
+
order: number;
|
|
14
|
+
/** `true` ended well, `false` ended badly, absent says neither. */
|
|
15
|
+
positive?: boolean;
|
|
16
|
+
system?: true;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The resolutions every inbox has. In code and not seeded, so `solved` means solved in every
|
|
20
|
+
* organisation: rules, analytics, AI tools and CSAT key on these, and a renamed or deleted row
|
|
21
|
+
* would silently break all of them. An inbox adds its own next to these; it cannot change them.
|
|
22
|
+
*/
|
|
23
|
+
export declare const SYSTEM_RESOLUTIONS: readonly InteractionResolution[];
|
|
24
|
+
/** Closed with one of these, a conversation does not count as resolved: nothing was worked on. */
|
|
25
|
+
export declare const UNWORKED_RESOLUTIONS: readonly string[];
|
|
26
|
+
/** Custom keys carry this prefix, so they can never collide with a later system key. */
|
|
27
|
+
export declare const CUSTOM_RESOLUTION_PREFIX = "c_";
|
|
28
|
+
/** System first, then the inbox's own in their order. The one list every reader uses. */
|
|
29
|
+
export declare function resolutionsFor(inbox?: Pick<Inbox, "resolutions"> | null): InteractionResolution[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -133,4 +133,11 @@ export interface Interaction {
|
|
|
133
133
|
* = not snoozed.
|
|
134
134
|
*/
|
|
135
135
|
snoozedTill?: number | null;
|
|
136
|
+
/**
|
|
137
|
+
* {@link InteractionResolution.key}, set when closing; cleared (`""`) on any move away from
|
|
138
|
+
* `closed`. `resolutionLabel` is the label at that moment, so renaming or deleting a custom
|
|
139
|
+
* resolution later does not rewrite history.
|
|
140
|
+
*/
|
|
141
|
+
resolution?: string;
|
|
142
|
+
resolutionLabel?: string;
|
|
136
143
|
}
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const TRANSACTION_SCOPE_KINDS: readonly string[];
|
|
11
11
|
export declare const PRODUCT_SCOPE_KIND = "product";
|
|
12
|
+
/** An agreement: what a customer takes every period. Puts it in the customer file. */
|
|
13
|
+
export declare const AGREEMENT_SCOPE_KIND = "agreement";
|
|
12
14
|
/** `invoice:412`. The kind of a transaction *is* its kind key — no mapping table. */
|
|
13
15
|
export declare function transactionScopeKey(kindKey: string, id: string): string;
|
|
14
16
|
export declare function productScopeKey(id: string): string;
|
|
@@ -27,6 +29,11 @@ export declare function productHref(row: {
|
|
|
27
29
|
id: string;
|
|
28
30
|
businessEntityId?: string;
|
|
29
31
|
}, fallbackEntityId?: string): string | undefined;
|
|
32
|
+
export declare function agreementScopeKey(id: string): string;
|
|
33
|
+
export declare function agreementHref(row: {
|
|
34
|
+
id: string;
|
|
35
|
+
businessEntityId?: string;
|
|
36
|
+
}, fallbackEntityId?: string): string | undefined;
|
|
30
37
|
/** Is this scopeKey one of ours, and which id does it point at? */
|
|
31
38
|
export declare function transactionIdFromScope(scopeKey: string): string | undefined;
|
|
32
39
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DocumentBlock } from '../../platform/document-blocks';
|
|
2
|
+
import { LineUsage } from '../agreement/types';
|
|
2
3
|
import { DocumentSender } from '../document-template/types';
|
|
3
4
|
import { Cents } from '../money/money';
|
|
4
5
|
import { TaxRateKind } from '../money/tax';
|
|
@@ -182,6 +183,19 @@ export interface TransactionLine {
|
|
|
182
183
|
* the line — not the entry — is the source of truth. Never copied to a new document.
|
|
183
184
|
*/
|
|
184
185
|
timeEntryIds?: string[];
|
|
186
|
+
/** How a usage line was counted: from a meter or entered per period. Never re-priced. */
|
|
187
|
+
usage?: LineUsage;
|
|
188
|
+
/**
|
|
189
|
+
* The agreement line this bills, and the days it covers. Together with `correction` these are
|
|
190
|
+
* the whole "what was billed" state of an agreement — see `dueCharges`.
|
|
191
|
+
*/
|
|
192
|
+
agreementLineId?: string;
|
|
193
|
+
servicePeriod?: {
|
|
194
|
+
from: number;
|
|
195
|
+
to: number;
|
|
196
|
+
};
|
|
197
|
+
/** Settles days of a window billed earlier, at the price it was billed at. */
|
|
198
|
+
correction?: boolean;
|
|
185
199
|
/**
|
|
186
200
|
* An option: priced and shown, but **not** in the total.
|
|
187
201
|
*
|