@absolutejs/commerce 0.10.0-beta.0 → 0.11.0-beta.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/drizzle/index.d.ts +38 -0
- package/dist/drizzle/index.js +6 -0
- package/dist/drizzle/queries.d.ts +57 -0
- package/package.json +1 -1
package/dist/drizzle/index.d.ts
CHANGED
|
@@ -461,6 +461,25 @@ export declare const commerceInvoices: import("drizzle-orm/pg-core").PgTableWith
|
|
|
461
461
|
}, {}, {
|
|
462
462
|
length: 40;
|
|
463
463
|
}>;
|
|
464
|
+
order_session: import("drizzle-orm/pg-core").PgColumn<{
|
|
465
|
+
name: "order_session";
|
|
466
|
+
tableName: "invoices";
|
|
467
|
+
dataType: "string";
|
|
468
|
+
columnType: "PgVarchar";
|
|
469
|
+
data: string;
|
|
470
|
+
driverParam: string;
|
|
471
|
+
notNull: false;
|
|
472
|
+
hasDefault: false;
|
|
473
|
+
isPrimaryKey: false;
|
|
474
|
+
isAutoincrement: false;
|
|
475
|
+
hasRuntimeDefault: false;
|
|
476
|
+
enumValues: [string, ...string[]];
|
|
477
|
+
baseColumn: never;
|
|
478
|
+
identity: undefined;
|
|
479
|
+
generated: undefined;
|
|
480
|
+
}, {}, {
|
|
481
|
+
length: 255;
|
|
482
|
+
}>;
|
|
464
483
|
po_number: import("drizzle-orm/pg-core").PgColumn<{
|
|
465
484
|
name: "po_number";
|
|
466
485
|
tableName: "invoices";
|
|
@@ -3541,6 +3560,25 @@ export declare const commerceDrizzleSchema: {
|
|
|
3541
3560
|
}, {}, {
|
|
3542
3561
|
length: 40;
|
|
3543
3562
|
}>;
|
|
3563
|
+
order_session: import("drizzle-orm/pg-core").PgColumn<{
|
|
3564
|
+
name: "order_session";
|
|
3565
|
+
tableName: "invoices";
|
|
3566
|
+
dataType: "string";
|
|
3567
|
+
columnType: "PgVarchar";
|
|
3568
|
+
data: string;
|
|
3569
|
+
driverParam: string;
|
|
3570
|
+
notNull: false;
|
|
3571
|
+
hasDefault: false;
|
|
3572
|
+
isPrimaryKey: false;
|
|
3573
|
+
isAutoincrement: false;
|
|
3574
|
+
hasRuntimeDefault: false;
|
|
3575
|
+
enumValues: [string, ...string[]];
|
|
3576
|
+
baseColumn: never;
|
|
3577
|
+
identity: undefined;
|
|
3578
|
+
generated: undefined;
|
|
3579
|
+
}, {}, {
|
|
3580
|
+
length: 255;
|
|
3581
|
+
}>;
|
|
3544
3582
|
po_number: import("drizzle-orm/pg-core").PgColumn<{
|
|
3545
3583
|
name: "po_number";
|
|
3546
3584
|
tableName: "invoices";
|
package/dist/drizzle/index.js
CHANGED
|
@@ -102,6 +102,10 @@ var getInvoice = async (db, id) => {
|
|
|
102
102
|
const [invoice] = await db.select().from(commerceInvoices).where(eq(commerceInvoices.id, id)).limit(1);
|
|
103
103
|
return invoice ?? null;
|
|
104
104
|
};
|
|
105
|
+
var getInvoiceByOrder = async (db, orderSession) => {
|
|
106
|
+
const [invoice] = await db.select().from(commerceInvoices).where(eq(commerceInvoices.order_session, orderSession)).limit(1);
|
|
107
|
+
return invoice ?? null;
|
|
108
|
+
};
|
|
105
109
|
var setInvoiceStatus = async (db, id, status) => {
|
|
106
110
|
const [updated] = await db.update(commerceInvoices).set({ status }).where(eq(commerceInvoices.id, id)).returning();
|
|
107
111
|
return updated;
|
|
@@ -204,6 +208,7 @@ var commerceInvoices = pgTable("invoices", {
|
|
|
204
208
|
line_items: jsonb().$type().default([]),
|
|
205
209
|
notes: text(),
|
|
206
210
|
number: varchar({ length: 40 }).notNull(),
|
|
211
|
+
order_session: varchar({ length: 255 }),
|
|
207
212
|
po_number: varchar({ length: 80 }),
|
|
208
213
|
status: varchar({ length: 20 }).notNull().default("draft"),
|
|
209
214
|
tax_exempt: boolean().notNull().default(false)
|
|
@@ -406,6 +411,7 @@ export {
|
|
|
406
411
|
listApprovedReviews,
|
|
407
412
|
listAllReviews,
|
|
408
413
|
issueGiftCard,
|
|
414
|
+
getInvoiceByOrder,
|
|
409
415
|
getInvoice,
|
|
410
416
|
getGroupStoreBySlug,
|
|
411
417
|
getGiftCard,
|
|
@@ -1414,6 +1414,7 @@ export declare const createInvoice: (db: CommerceDb, invoice: NewInvoice) => Pro
|
|
|
1414
1414
|
company_id: string | null;
|
|
1415
1415
|
due_date: Date | null;
|
|
1416
1416
|
line_items: import("./index").CommerceInvoiceLine[] | null;
|
|
1417
|
+
order_session: string | null;
|
|
1417
1418
|
po_number: string | null;
|
|
1418
1419
|
} | undefined>;
|
|
1419
1420
|
export declare const listInvoices: (db: CommerceDb) => Omit<import("drizzle-orm/pg-core").PgSelectBase<"invoices", {
|
|
@@ -1576,6 +1577,25 @@ export declare const listInvoices: (db: CommerceDb) => Omit<import("drizzle-orm/
|
|
|
1576
1577
|
}, {}, {
|
|
1577
1578
|
length: 40;
|
|
1578
1579
|
}>;
|
|
1580
|
+
order_session: import("drizzle-orm/pg-core").PgColumn<{
|
|
1581
|
+
name: "order_session";
|
|
1582
|
+
tableName: "invoices";
|
|
1583
|
+
dataType: "string";
|
|
1584
|
+
columnType: "PgVarchar";
|
|
1585
|
+
data: string;
|
|
1586
|
+
driverParam: string;
|
|
1587
|
+
notNull: false;
|
|
1588
|
+
hasDefault: false;
|
|
1589
|
+
isPrimaryKey: false;
|
|
1590
|
+
isAutoincrement: false;
|
|
1591
|
+
hasRuntimeDefault: false;
|
|
1592
|
+
enumValues: [string, ...string[]];
|
|
1593
|
+
baseColumn: never;
|
|
1594
|
+
identity: undefined;
|
|
1595
|
+
generated: undefined;
|
|
1596
|
+
}, {}, {
|
|
1597
|
+
length: 255;
|
|
1598
|
+
}>;
|
|
1579
1599
|
po_number: import("drizzle-orm/pg-core").PgColumn<{
|
|
1580
1600
|
name: "po_number";
|
|
1581
1601
|
tableName: "invoices";
|
|
@@ -1641,6 +1661,7 @@ export declare const listInvoices: (db: CommerceDb) => Omit<import("drizzle-orm/
|
|
|
1641
1661
|
line_items: import("./index").CommerceInvoiceLine[] | null;
|
|
1642
1662
|
notes: string | null;
|
|
1643
1663
|
number: string;
|
|
1664
|
+
order_session: string | null;
|
|
1644
1665
|
po_number: string | null;
|
|
1645
1666
|
status: string;
|
|
1646
1667
|
tax_exempt: boolean;
|
|
@@ -1804,6 +1825,25 @@ export declare const listInvoices: (db: CommerceDb) => Omit<import("drizzle-orm/
|
|
|
1804
1825
|
}, {}, {
|
|
1805
1826
|
length: 40;
|
|
1806
1827
|
}>;
|
|
1828
|
+
order_session: import("drizzle-orm/pg-core").PgColumn<{
|
|
1829
|
+
name: "order_session";
|
|
1830
|
+
tableName: "invoices";
|
|
1831
|
+
dataType: "string";
|
|
1832
|
+
columnType: "PgVarchar";
|
|
1833
|
+
data: string;
|
|
1834
|
+
driverParam: string;
|
|
1835
|
+
notNull: false;
|
|
1836
|
+
hasDefault: false;
|
|
1837
|
+
isPrimaryKey: false;
|
|
1838
|
+
isAutoincrement: false;
|
|
1839
|
+
hasRuntimeDefault: false;
|
|
1840
|
+
enumValues: [string, ...string[]];
|
|
1841
|
+
baseColumn: never;
|
|
1842
|
+
identity: undefined;
|
|
1843
|
+
generated: undefined;
|
|
1844
|
+
}, {}, {
|
|
1845
|
+
length: 255;
|
|
1846
|
+
}>;
|
|
1807
1847
|
po_number: import("drizzle-orm/pg-core").PgColumn<{
|
|
1808
1848
|
name: "po_number";
|
|
1809
1849
|
tableName: "invoices";
|
|
@@ -1870,6 +1910,22 @@ export declare const getInvoice: (db: CommerceDb, id: string) => Promise<{
|
|
|
1870
1910
|
line_items: import("./index").CommerceInvoiceLine[] | null;
|
|
1871
1911
|
notes: string | null;
|
|
1872
1912
|
number: string;
|
|
1913
|
+
order_session: string | null;
|
|
1914
|
+
po_number: string | null;
|
|
1915
|
+
status: string;
|
|
1916
|
+
tax_exempt: boolean;
|
|
1917
|
+
} | null>;
|
|
1918
|
+
export declare const getInvoiceByOrder: (db: CommerceDb, orderSession: string) => Promise<{
|
|
1919
|
+
amount_cents: number;
|
|
1920
|
+
company_id: string | null;
|
|
1921
|
+
created_at: Date;
|
|
1922
|
+
customer_email: string | null;
|
|
1923
|
+
due_date: Date | null;
|
|
1924
|
+
id: string;
|
|
1925
|
+
line_items: import("./index").CommerceInvoiceLine[] | null;
|
|
1926
|
+
notes: string | null;
|
|
1927
|
+
number: string;
|
|
1928
|
+
order_session: string | null;
|
|
1873
1929
|
po_number: string | null;
|
|
1874
1930
|
status: string;
|
|
1875
1931
|
tax_exempt: boolean;
|
|
@@ -1884,6 +1940,7 @@ export declare const setInvoiceStatus: (db: CommerceDb, id: string, status: stri
|
|
|
1884
1940
|
line_items: import("./index").CommerceInvoiceLine[] | null;
|
|
1885
1941
|
notes: string | null;
|
|
1886
1942
|
number: string;
|
|
1943
|
+
order_session: string | null;
|
|
1887
1944
|
po_number: string | null;
|
|
1888
1945
|
status: string;
|
|
1889
1946
|
tax_exempt: boolean;
|
package/package.json
CHANGED