@opencxh/domain 1.278.0 → 1.279.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/catalog/types.d.ts +5 -0
- package/dist/entities/company/types.d.ts +3 -0
- package/dist/entities/time-entry/billing.d.ts +20 -0
- package/dist/entities/time-entry/billing.test.d.ts +1 -0
- package/dist/entities/time-entry/index.d.ts +1 -0
- package/dist/entities/time-entry/types.d.ts +5 -0
- package/dist/entities/transaction/types.d.ts +5 -0
- package/dist/index.cjs +13 -13
- package/dist/index.js +495 -476
- package/package.json +1 -1
|
@@ -39,6 +39,11 @@ export interface Product {
|
|
|
39
39
|
ledgerCategoryKey?: string;
|
|
40
40
|
/** References to this product elsewhere (`moneybird:412`). A reference, never a copy. */
|
|
41
41
|
externalIds?: string[];
|
|
42
|
+
/**
|
|
43
|
+
* Hours booked on this `WorkType.key` are invoiced as this product. Here and not on the work
|
|
44
|
+
* type: time must not know sales, and several products may share one type (junior/senior).
|
|
45
|
+
*/
|
|
46
|
+
workTypeKey?: string;
|
|
42
47
|
/** See {@link FIXED_UNITS}. Drives the form and the word after the quantity. */
|
|
43
48
|
unitKey: string;
|
|
44
49
|
/** Key into the organisation's VAT table, never the percentage itself. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PostalAddress } from '../organization/types';
|
|
2
|
+
import { LifecycleStage } from '../contact/lifecycle';
|
|
2
3
|
import { OwnerScope } from '../scope/types';
|
|
3
4
|
/** Same meaning as {@link ContactOrigin}: `shadow` is a lazily cached hit, a landed row is `own`. */
|
|
4
5
|
export type CompanyOrigin = "own" | "shadow";
|
|
@@ -43,6 +44,8 @@ export interface Company {
|
|
|
43
44
|
ownerScope: OwnerScope;
|
|
44
45
|
source: CompanySource;
|
|
45
46
|
origin?: CompanyOrigin;
|
|
47
|
+
/** Where the organisation stands with us; independent of its contacts' own stages. */
|
|
48
|
+
lifecycleStage?: LifecycleStage;
|
|
46
49
|
/** The group this company belongs to. One level up per row; a cycle is refused on write. */
|
|
47
50
|
parentCompanyId?: string;
|
|
48
51
|
/**
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TimeEntry } from './types';
|
|
2
|
+
/** Booked hours that become one invoice line: one work type on one subject. */
|
|
3
|
+
export interface BillableTimeGroup {
|
|
4
|
+
/** `WorkType.key`; absent = booked without a type, which no product can carry. */
|
|
5
|
+
workType?: string;
|
|
6
|
+
scopeKey?: string;
|
|
7
|
+
scopeLabel?: string;
|
|
8
|
+
seconds: number;
|
|
9
|
+
/** Hours, two decimals — what goes on the line as `quantity`. */
|
|
10
|
+
hours: number;
|
|
11
|
+
entryIds: string[];
|
|
12
|
+
/** Epoch ms of the first and last entry, for the line's description. */
|
|
13
|
+
from: number;
|
|
14
|
+
to: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Group billable entries per work type × subject, in the order they were first booked.
|
|
18
|
+
* `durationSeconds` is the booked duration, so rounding has already been applied per entry.
|
|
19
|
+
*/
|
|
20
|
+
export declare function billableTimeGroups(entries: readonly TimeEntry[]): BillableTimeGroup[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -69,6 +69,11 @@ export interface TimeEntry {
|
|
|
69
69
|
workType?: string;
|
|
70
70
|
note?: string;
|
|
71
71
|
source: TimeEntrySource;
|
|
72
|
+
/**
|
|
73
|
+
* The invoice (a sales transaction id) this entry is on, draft included. Set by sales only;
|
|
74
|
+
* while set, the entry cannot be edited or deleted — that is what stops billing it twice.
|
|
75
|
+
*/
|
|
76
|
+
invoicedTransactionId?: string;
|
|
72
77
|
createdAt?: number;
|
|
73
78
|
updatedAt?: number;
|
|
74
79
|
}
|
|
@@ -177,6 +177,11 @@ export interface TransactionLine {
|
|
|
177
177
|
* booked against, not what the customer reads.
|
|
178
178
|
*/
|
|
179
179
|
dealItemId?: string;
|
|
180
|
+
/**
|
|
181
|
+
* The time entries this line bills. Sales stamps exactly this set onto them on every save, so
|
|
182
|
+
* the line — not the entry — is the source of truth. Never copied to a new document.
|
|
183
|
+
*/
|
|
184
|
+
timeEntryIds?: string[];
|
|
180
185
|
/**
|
|
181
186
|
* An option: priced and shown, but **not** in the total.
|
|
182
187
|
*
|