fix(medusa): Move discount usage from rule to discount

This commit is contained in:
olivermrbl
2021-03-29 10:15:41 +02:00
parent 08bb111e29
commit d9cd52a177
17 changed files with 188 additions and 59 deletions
@@ -63,12 +63,6 @@ export class DiscountRule {
})
valid_for: Product[]
@Column({ nullable: true })
usage_limit: number
@Column({ default: 0 })
usage_count: number
@CreateDateColumn({ type: "timestamptz" })
created_at: Date
@@ -121,12 +115,6 @@ export class DiscountRule {
* type: array
* items:
* $ref: "#/components/schemas/product"
* usage_limit:
* description: "The maximum number of times that a discount can be used."
* type: integer
* usage_count:
* description: "The number of times a discount has been used."
* type: integer
* created_at:
* description: "The date with timezone at which the resource was created."
* type: string
+12
View File
@@ -68,6 +68,12 @@ export class Discount {
})
regions: Region[]
@Column({ nullable: true })
usage_limit: number
@Column({ default: 0 })
usage_count: number
@CreateDateColumn({ type: "timestamptz" })
created_at: Date
@@ -127,6 +133,12 @@ export class Discount {
* type: array
* items:
* $ref: "#/components/schemas/region"
* usage_limit:
* description: "The maximum number of times that a discount can be used."
* type: integer
* usage_count:
* description: "The number of times a discount has been used."
* type: integer
* created_at:
* description: "The date with timezone at which the resource was created."
* type: string