feat(cart): Public-facing DTOs + (partial) module interface (#6000)

This commit is contained in:
Oli Juhl
2024-01-10 13:27:58 +01:00
committed by GitHub
parent 6721633478
commit ef5024980d
11 changed files with 664 additions and 17 deletions
+3
View File
@@ -8,6 +8,7 @@ import {
OnInit,
OneToMany,
OneToOne,
OptionalProps,
PrimaryKey,
Property,
} from "@mikro-orm/core"
@@ -22,6 +23,8 @@ type OptionalCartProps =
@Entity({ tableName: "cart" })
export default class Cart {
[OptionalProps]?: OptionalCartProps
@PrimaryKey({ columnType: "text" })
id: string
-3
View File
@@ -1,5 +1,4 @@
export { default as Address } from "./address"
export { default as AdjustmentLine } from "./adjustment-line"
export { default as Cart } from "./cart"
export { default as LineItem } from "./line-item"
export { default as LineItemAdjustmentLine } from "./line-item-adjustment-line"
@@ -7,5 +6,3 @@ export { default as LineItemTaxLine } from "./line-item-tax-line"
export { default as ShippingMethod } from "./shipping-method"
export { default as ShippingMethodAdjustmentLine } from "./shipping-method-adjustment-line"
export { default as ShippingMethodTaxLine } from "./shipping-method-tax-line"
export { default as TaxLine } from "./tax-line"
+1 -1
View File
@@ -11,7 +11,7 @@ import {
OneToMany,
OptionalProps,
PrimaryKey,
Property
Property,
} from "@mikro-orm/core"
import Cart from "./cart"
import LineItemAdjustmentLine from "./line-item-adjustment-line"
+2 -2
View File
@@ -28,7 +28,7 @@ export default class ShippingMethod {
cart: Cart
@Property({ columnType: "text" })
title: string
name: string
@Property({ columnType: "jsonb", nullable: true })
description?: string | null
@@ -38,7 +38,7 @@ export default class ShippingMethod {
amount: number
@Property({ columnType: "boolean" })
tax_inclusive = false
is_tax_inclusive = false
@Property({ columnType: "text", nullable: true })
shipping_option_id?: string | null