@bisondesk/documents-sdk 1.0.602 → 1.0.603
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/lib/types/recurring-invoices.d.ts +16 -8
- package/lib/types/recurring-invoices.d.ts.map +1 -1
- package/lib/types/recurring-invoices.js +8 -5
- package/lib/types/recurring-invoices.js.map +1 -1
- package/package.json +1 -1
- package/src/types/recurring-invoices.ts +29 -15
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/constants/search.d.ts +0 -476
- package/lib/constants/search.d.ts.map +0 -1
- package/lib/constants/search.js +0 -240
- package/lib/constants/search.js.map +0 -1
- package/src/constants/index.js +0 -45
- package/src/constants/index.js.map +0 -1
- package/src/constants/search.js +0 -240
- package/src/constants/search.js.map +0 -1
- package/src/types/bank-accounts.js +0 -2
- package/src/types/bank-accounts.js.map +0 -1
- package/src/types/booking.js +0 -2
- package/src/types/booking.js.map +0 -1
- package/src/types/document-categories.js +0 -11
- package/src/types/document-categories.js.map +0 -1
- package/src/types/documents.js +0 -68
- package/src/types/documents.js.map +0 -1
- package/src/types/legacy.js +0 -2
- package/src/types/legacy.js.map +0 -1
- package/src/types/rules.js +0 -15
- package/src/types/rules.js.map +0 -1
- package/src/types/search.js +0 -13
- package/src/types/search.js.map +0 -1
- package/src/types/vat.js +0 -2
- package/src/types/vat.js.map +0 -1
- package/src/utils/previews.js +0 -2
- package/src/utils/previews.js.map +0 -1
|
@@ -24,24 +24,32 @@ export type RecurringInvoice = RecurringInvoiceUpdate & {
|
|
|
24
24
|
modifiedAt: string;
|
|
25
25
|
modifiedBy: string;
|
|
26
26
|
};
|
|
27
|
-
export declare enum
|
|
27
|
+
export declare enum RecurrenceSummaryState {
|
|
28
|
+
scheduled = "scheduled",
|
|
28
29
|
executed = "executed",
|
|
29
|
-
|
|
30
|
+
failed = "failed",
|
|
31
|
+
ended = "ended",
|
|
32
|
+
starting = "starting"
|
|
30
33
|
}
|
|
34
|
+
export type RecurrenceSummaryQuery = {
|
|
35
|
+
from: string;
|
|
36
|
+
to: string;
|
|
37
|
+
summaryState?: RecurrenceSummaryState;
|
|
38
|
+
};
|
|
31
39
|
export type RecurringInvoiceFilterOptions = {
|
|
32
40
|
contractId?: string;
|
|
33
41
|
onlyActive?: boolean;
|
|
34
42
|
onlyFixedPeriod?: boolean;
|
|
35
|
-
|
|
36
|
-
scheduledTo?: string;
|
|
37
|
-
runState?: RecurringRunState;
|
|
43
|
+
summary?: RecurrenceSummaryQuery;
|
|
38
44
|
limit?: number;
|
|
39
45
|
offset?: number;
|
|
40
46
|
};
|
|
41
47
|
export type RecurringInvoiceSummary = {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
scheduled: number;
|
|
49
|
+
executed: number;
|
|
50
|
+
failed: number;
|
|
51
|
+
ended: number;
|
|
52
|
+
starting: number;
|
|
45
53
|
};
|
|
46
54
|
export type ContractRecurrenceState = {
|
|
47
55
|
hasActiveRecurrence: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recurring-invoices.d.ts","sourceRoot":"/","sources":["types/recurring-invoices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEjE,MAAM,MAAM,mBAAmB,GAAG;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,GAAG;IACzD,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GAAG;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UA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AM,MAAM,6BAA6B,GAAG;IAC1C,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CACzD,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QACJ,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH,CAAC;AAEF,oBAAY,wBAAwB;IAClC,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,IAAI,SAAS;CACd;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,wBAAwB,CAAC;CAClC,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
export var
|
|
2
|
-
(function (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export var RecurrenceSummaryState;
|
|
2
|
+
(function (RecurrenceSummaryState) {
|
|
3
|
+
RecurrenceSummaryState["scheduled"] = "scheduled";
|
|
4
|
+
RecurrenceSummaryState["executed"] = "executed";
|
|
5
|
+
RecurrenceSummaryState["failed"] = "failed";
|
|
6
|
+
RecurrenceSummaryState["ended"] = "ended";
|
|
7
|
+
RecurrenceSummaryState["starting"] = "starting";
|
|
8
|
+
})(RecurrenceSummaryState || (RecurrenceSummaryState = {}));
|
|
6
9
|
export var RecurringExecutionStatus;
|
|
7
10
|
(function (RecurringExecutionStatus) {
|
|
8
11
|
RecurringExecutionStatus["scheduled"] = "scheduled";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recurring-invoices.js","sourceRoot":"/","sources":["types/recurring-invoices.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"recurring-invoices.js","sourceRoot":"/","sources":["types/recurring-invoices.ts"],"names":[],"mappings":"AA6CA,MAAM,CAAN,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAChC,iDAAuB,CAAA;IACvB,+CAAqB,CAAA;IACrB,2CAAiB,CAAA;IACjB,yCAAe,CAAA;IACf,+CAAqB,CAAA;AACvB,CAAC,EANW,sBAAsB,KAAtB,sBAAsB,QAMjC;AA6DD,MAAM,CAAN,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,mDAAuB,CAAA;IACvB,6CAAiB,CAAA;IACjB,mDAAuB,CAAA;IACvB,yCAAa,CAAA;AACf,CAAC,EALW,wBAAwB,KAAxB,wBAAwB,QAKnC","sourcesContent":["import { LeasingContractStatus } from '@bisondesk/core-sdk/types/leasing';\nimport { DocumentType, FinanceDocumentV2 } from './documents.js';\n\nexport type NewRecurringInvoice = {\n originalInvoiceId: string;\n leasingContractId?: string;\n startPeriod: number;\n totalExecutions?: number; // can be undefined if the recurring invoice is infinite\n};\n\nexport type RecurringInvoiceUpdate = NewRecurringInvoice & {\n active: boolean;\n};\n\nexport type RecurringInvoice = RecurringInvoiceUpdate & {\n id: string;\n country: string;\n executions: number;\n automationStart: string;\n\n // stored invoice data for display\n amountExcl: string;\n organizationId: string;\n\n originalInvoiceData: Pick<\n FinanceDocumentV2,\n 'category' | 'branchId' | 'tags' | 'total' | 'notes' | 'lines' | 'bankAccounts'\n >;\n lastGeneratedDocumentId?: string;\n lastExecutedAt?: string;\n\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n};\n\n// State of a recurring invoice used to drive the scheduled-recurrences overview tiles and the\n// matching windowed listing. The execution-based states (scheduled/executed/failed) are evaluated\n// against the queried [from, to] window; ended/starting are lifecycle states of the invoice itself.\n// - scheduled: has an upcoming execution due in the window\n// - executed: has an in-window execution that completed\n// - failed: has an in-window execution that was due but never completed\n// - ended: completed all of its executions (inactive, executions >= totalExecutions)\n// - starting: active but has not run yet (executions = 0)\nexport enum RecurrenceSummaryState {\n scheduled = 'scheduled',\n executed = 'executed',\n failed = 'failed',\n ended = 'ended',\n starting = 'starting',\n}\n\n// Window + optional state, always passed together. `from`/`to` bound the execution-based states;\n// `summaryState` narrows a listing to a single tile (omit it to list everything in the window).\nexport type RecurrenceSummaryQuery = {\n from: string;\n to: string;\n summaryState?: RecurrenceSummaryState;\n};\n\nexport type RecurringInvoiceFilterOptions = {\n contractId?: string;\n onlyActive?: boolean;\n onlyFixedPeriod?: boolean;\n // Grouped window + state for the scheduled-recurrences overview and its windowed listing.\n summary?: RecurrenceSummaryQuery;\n limit?: number;\n offset?: number;\n};\n\n// Aggregate counters for the scheduled-recurrences overview\nexport type RecurringInvoiceSummary = {\n scheduled: number;\n executed: number;\n failed: number;\n ended: number;\n starting: number;\n};\n\n// Recurrence state for a single leasing contract, used to enrich the leasing-contracts search\n// index: whether the contract currently has an active recurrence and the most recent run time\n// across all of its recurrences.\nexport type ContractRecurrenceState = {\n hasActiveRecurrence: boolean;\n lastRecurrenceRunAt?: string;\n};\n\n// Meta attached to a scheduled-window listing: the single in-window execution keyed by\n// recurring invoice id (a recurring invoice has at most one execution scheduled per window)\nexport type RecurringInvoiceExecutionsMeta = {\n executions: Record<string, RecurringInvoiceExecution>;\n};\n\n// Current leasing-contract status keyed by leasing contract id. Lets a listing explain why a\n// scheduled run was missed (e.g. the contract is no longer billable vs. an execution error).\nexport type RecurringInvoiceContractsMeta = {\n contractStatuses: Record<string, LeasingContractStatus>;\n};\n\nexport type RecurringDocShareData = {\n type: DocumentType.Finance;\n recipient?: string;\n tenant: string;\n message: string;\n meta: {\n amount?: string;\n issueDate: string;\n reference: string;\n };\n};\n\nexport enum RecurringExecutionStatus {\n scheduled = 'scheduled',\n queued = 'queued',\n executing = 'executing',\n done = 'done',\n}\n\nexport type RecurringInvoiceExecution = {\n recurrenceId: string;\n execution: number;\n executionDate: string;\n status: RecurringExecutionStatus;\n};\n"]}
|
package/package.json
CHANGED
|
@@ -35,33 +35,47 @@ export type RecurringInvoice = RecurringInvoiceUpdate & {
|
|
|
35
35
|
modifiedBy: string;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
|
|
38
|
+
// State of a recurring invoice used to drive the scheduled-recurrences overview tiles and the
|
|
39
|
+
// matching windowed listing. The execution-based states (scheduled/executed/failed) are evaluated
|
|
40
|
+
// against the queried [from, to] window; ended/starting are lifecycle states of the invoice itself.
|
|
41
|
+
// - scheduled: has an upcoming execution due in the window
|
|
42
|
+
// - executed: has an in-window execution that completed
|
|
43
|
+
// - failed: has an in-window execution that was due but never completed
|
|
44
|
+
// - ended: completed all of its executions (inactive, executions >= totalExecutions)
|
|
45
|
+
// - starting: active but has not run yet (executions = 0)
|
|
46
|
+
export enum RecurrenceSummaryState {
|
|
47
|
+
scheduled = 'scheduled',
|
|
41
48
|
executed = 'executed',
|
|
42
|
-
|
|
49
|
+
failed = 'failed',
|
|
50
|
+
ended = 'ended',
|
|
51
|
+
starting = 'starting',
|
|
43
52
|
}
|
|
44
53
|
|
|
54
|
+
// Window + optional state, always passed together. `from`/`to` bound the execution-based states;
|
|
55
|
+
// `summaryState` narrows a listing to a single tile (omit it to list everything in the window).
|
|
56
|
+
export type RecurrenceSummaryQuery = {
|
|
57
|
+
from: string;
|
|
58
|
+
to: string;
|
|
59
|
+
summaryState?: RecurrenceSummaryState;
|
|
60
|
+
};
|
|
61
|
+
|
|
45
62
|
export type RecurringInvoiceFilterOptions = {
|
|
46
63
|
contractId?: string;
|
|
47
64
|
onlyActive?: boolean;
|
|
48
65
|
onlyFixedPeriod?: boolean;
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
scheduledTo?: string;
|
|
52
|
-
// Narrows the windowed listing to invoices whose in-window execution ran or was missed.
|
|
53
|
-
// Only meaningful together with scheduledFrom/scheduledTo.
|
|
54
|
-
runState?: RecurringRunState;
|
|
66
|
+
// Grouped window + state for the scheduled-recurrences overview and its windowed listing.
|
|
67
|
+
summary?: RecurrenceSummaryQuery;
|
|
55
68
|
limit?: number;
|
|
56
69
|
offset?: number;
|
|
57
70
|
};
|
|
58
71
|
|
|
59
|
-
// Aggregate counters for the scheduled-recurrences overview
|
|
60
|
-
// current state; ran/missed are scoped to the queried [scheduledFrom, scheduledTo] window.
|
|
72
|
+
// Aggregate counters for the scheduled-recurrences overview
|
|
61
73
|
export type RecurringInvoiceSummary = {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
scheduled: number;
|
|
75
|
+
executed: number;
|
|
76
|
+
failed: number;
|
|
77
|
+
ended: number;
|
|
78
|
+
starting: number;
|
|
65
79
|
};
|
|
66
80
|
|
|
67
81
|
// Recurrence state for a single leasing contract, used to enrich the leasing-contracts search
|