chore: Merge master to develop (#3653)

This commit is contained in:
Oliver Windall Juhl
2023-03-31 13:09:57 +02:00
committed by GitHub
parent b2e2eddcea
commit 809ab2e0eb
120 changed files with 2240 additions and 585 deletions
+5
View File
@@ -170,6 +170,10 @@
* type: integer
* example: 1000
* discount_total:
* description: The total of discount rounded
* type: integer
* example: 800
* raw_discount_total:
* description: The total of discount
* type: integer
* example: 800
@@ -376,6 +380,7 @@ export class Cart extends SoftDeletableEntity {
shipping_total?: number
discount_total?: number
raw_discount_total?: number
item_tax_total?: number | null
shipping_tax_total?: number | null
tax_total?: number | null
@@ -8,10 +8,9 @@ import {
PrimaryColumn,
} from "typeorm"
import { DbAwareColumn } from "../utils/db-aware-column"
import { DbAwareColumn, generateEntityId } from "../utils"
import { Discount } from "./discount"
import { LineItem } from "./line-item"
import { generateEntityId } from "../utils/generate-entity-id"
@Entity()
@Index(["discount_id", "item_id"], {
@@ -41,7 +40,7 @@ export class LineItemAdjustment {
@Column({ nullable: true })
discount_id: string
@Column({ type: "int" })
@Column({ type: "numeric", transformer: { to: (value) => value, from: (value) => parseFloat(value) } })
amount: number
@DbAwareColumn({ type: "jsonb", nullable: true })
@@ -93,7 +92,7 @@ export class LineItemAdjustment {
* $ref: "#/components/schemas/Discount"
* amount:
* description: The adjustment amount
* type: integer
* type: number
* example: 1000
* metadata:
* description: An optional key-value map with additional details
+7 -1
View File
@@ -10,7 +10,8 @@ import {
} from "typeorm"
import { BaseEntity } from "../interfaces"
import TaxInclusivePricingFeatureFlag from "../loaders/feature-flags/tax-inclusive-pricing"
import TaxInclusivePricingFeatureFlag
from "../loaders/feature-flags/tax-inclusive-pricing"
import { generateEntityId } from "../utils"
import { DbAwareColumn } from "../utils/db-aware-column"
import { FeatureFlagColumn } from "../utils/feature-flag-decorators"
@@ -147,6 +148,7 @@ export class LineItem extends BaseEntity {
original_total?: number | null
original_tax_total?: number | null
discount_total?: number | null
raw_discount_total?: number | null
gift_card_total?: number | null
@BeforeInsert()
@@ -341,6 +343,10 @@ export class LineItem extends BaseEntity {
* type: integer
* example: 0
* discount_total:
* description: The total of discount of the line item rounded
* type: integer
* example: 0
* raw_discount_total:
* description: The total of discount of the line item
* type: integer
* example: 0
+6 -1
View File
@@ -241,6 +241,7 @@ export class Order extends BaseEntity {
// Total fields
shipping_total: number
discount_total: number
raw_discount_total: number
tax_total: number | null
refunded_total: number
total: number
@@ -506,10 +507,14 @@ export class Order extends BaseEntity {
* type: integer
* description: The total of shipping
* example: 1000
* discount_total:
* raw_discount_total:
* description: The total of discount
* type: integer
* example: 800
* discount_total:
* description: The total of discount rounded
* type: integer
* example: 800
* tax_total:
* description: The total of tax
* type: integer