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:
Riqwan Thamir
2024-03-12 17:35:24 +00:00
committed by GitHub
parent f0c8142635
commit d4b921f3db
14 changed files with 312 additions and 14 deletions
+6 -3
View File
@@ -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({
+15
View File
@@ -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")