@antelopejs/interface-dms-saas 0.10.3-next.284.g92c929d → 0.10.3-next.294.g0a52f35
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.
|
@@ -22,7 +22,6 @@ declare const InvoiceModel_base: {
|
|
|
22
22
|
validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
|
|
23
23
|
};
|
|
24
24
|
export declare class InvoiceModel extends InvoiceModel_base {
|
|
25
|
-
getAllInvoices(): Promise<Invoice[]>;
|
|
26
25
|
updateUnlessVoided(id: string, patch: DeepPartial<Invoice>): Promise<boolean>;
|
|
27
26
|
findOneByStripeInvoice(stripeInvoiceId: string): Promise<Invoice | undefined>;
|
|
28
27
|
findOneByStripeCreditNote(stripeCreditNoteId: string): Promise<Invoice | undefined>;
|
|
@@ -5,16 +5,7 @@ const interface_database_decorators_1 = require("@antelopejs/interface-database-
|
|
|
5
5
|
const invoices_table_1 = require("../tables/invoices.table");
|
|
6
6
|
const update_result_1 = require("./update-result");
|
|
7
7
|
const STATUS_OPEN = "open";
|
|
8
|
-
const INVOICE_DOCUMENT_TYPE = "invoice";
|
|
9
8
|
class InvoiceModel extends (0, interface_database_decorators_1.BasicDataModel)(invoices_table_1.Invoice, invoices_table_1.invoicesTableName) {
|
|
10
|
-
async getAllInvoices() {
|
|
11
|
-
const rows = await this.table
|
|
12
|
-
.filter((invoice) => invoice.key("documentType").eq(INVOICE_DOCUMENT_TYPE))
|
|
13
|
-
.run();
|
|
14
|
-
return rows
|
|
15
|
-
.map((row) => InvoiceModel.fromDatabase(row))
|
|
16
|
-
.filter((row) => row !== undefined);
|
|
17
|
-
}
|
|
18
9
|
async updateUnlessVoided(id, patch) {
|
|
19
10
|
const result = await this.table
|
|
20
11
|
.getAll(id)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoices.model.js","sourceRoot":"","sources":["../../../src/db/models/invoices.model.ts"],"names":[],"mappings":";;;AACA,6FAA2E;AAC3E,6DAAsE;AACtE,mDAAiD;AAEjD,MAAM,WAAW,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"invoices.model.js","sourceRoot":"","sources":["../../../src/db/models/invoices.model.ts"],"names":[],"mappings":";;;AACA,6FAA2E;AAC3E,6DAAsE;AACtE,mDAAiD;AAEjD,MAAM,WAAW,GAAG,MAAM,CAAC;AAG3B,MAAa,YAAa,SAAQ,IAAA,8CAAc,EAAC,wBAAO,EAAE,kCAAiB,CAAC;IAE1E,KAAK,CAAC,kBAAkB,CACtB,EAAU,EACV,KAA2B;QAE3B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK;aAC5B,MAAM,CAAC,EAAE,CAAC;aACV,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;aAC7C,MAAM,CAAC,KAAK,CAAC;aACb,GAAG,EAAE,CAAC;QACT,OAAO,IAAA,8BAAc,EAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,sBAAsB,CAC1B,eAAuB;QAEvB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK;aAC1B,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC;aAC1C,GAAG,EAAE,CAAC;QACT,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;QACpE,OAAO,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,yBAAyB,CAC7B,kBAA0B;QAE1B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK;aACzB,MAAM,CAAC,kBAAkB,EAA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
|
+
"version": "0.10.3-next.294.g0a52f35",
|
|
4
4
|
"description": "AntelopeJS interface for the DMS SaaS module: billing, plans, registration, workspace pages and lifecycle extension points.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@antelopejs/interface-database-decorators": ">=0.5.2 <0.6.0"
|
|
81
81
|
},
|
|
82
82
|
"antelopeJs": {},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "0a52f354b50876648bc9ea95653a1e5f7751352f",
|
|
84
84
|
"scripts": {
|
|
85
85
|
"build": "rimraf dist && tsc",
|
|
86
86
|
"typecheck": "tsc --noEmit",
|