feat(medusa,pricing,types): added get endpoints for pricing rule types (#6678)
what: - adds list endpoint for rule types - adds get endpoint for rule types
This commit is contained in:
@@ -6,9 +6,8 @@ import {
|
||||
Filter,
|
||||
Index,
|
||||
ManyToMany,
|
||||
ManyToOne,
|
||||
OneToOne,
|
||||
OnInit,
|
||||
OneToOne,
|
||||
OptionalProps,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
@@ -30,7 +29,11 @@ class MoneyAmount {
|
||||
@PrimaryKey({ columnType: "text" })
|
||||
id!: string
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
@Property({
|
||||
columnType: "text",
|
||||
nullable: true,
|
||||
index: "IDX_money_amount_currency_code",
|
||||
})
|
||||
currency_code: string | null
|
||||
|
||||
@ManyToMany({
|
||||
|
||||
@@ -32,6 +32,21 @@ class RuleType {
|
||||
@ManyToMany(() => PriceSet, (priceSet) => priceSet.rule_types)
|
||||
price_sets = new Collection<PriceSet>(this)
|
||||
|
||||
@Property({
|
||||
onCreate: () => new Date(),
|
||||
columnType: "timestamptz",
|
||||
defaultRaw: "now()",
|
||||
})
|
||||
created_at: Date
|
||||
|
||||
@Property({
|
||||
onCreate: () => new Date(),
|
||||
onUpdate: () => new Date(),
|
||||
columnType: "timestamptz",
|
||||
defaultRaw: "now()",
|
||||
})
|
||||
updated_at: Date
|
||||
|
||||
@BeforeCreate()
|
||||
onCreate() {
|
||||
this.id = generateEntityId(this.id, "rul-typ")
|
||||
|
||||
Reference in New Issue
Block a user