chore: move to swc/jest (#7739)
* chore: move to swc * chore: fix tax rate tests * chore: undo failed test * chore: fix unit tests script * chore: use node 20 * Update scripts/run-workspace-unit-tests-in-chunks.sh
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
OptionalProps,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import PriceListRule from "./price-list-rule"
|
||||
|
||||
@@ -49,7 +50,7 @@ export default class PriceListRuleValue {
|
||||
price_list_rule_id: string
|
||||
|
||||
@ManyToOne(() => PriceListRule, { persist: false })
|
||||
price_list_rule: PriceListRule
|
||||
price_list_rule: Rel<PriceListRule>
|
||||
|
||||
@Property({ columnType: "text" })
|
||||
value: string
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
OptionalProps,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import PriceList from "./price-list"
|
||||
import PriceListRuleValue from "./price-list-rule-value"
|
||||
@@ -60,12 +61,12 @@ export default class PriceListRule {
|
||||
rule_type_id: string
|
||||
|
||||
@ManyToOne(() => RuleType, { persist: false })
|
||||
rule_type: RuleType
|
||||
rule_type: Rel<RuleType>
|
||||
|
||||
@OneToMany(() => PriceListRuleValue, (plrv) => plrv.price_list_rule, {
|
||||
cascade: [Cascade.PERSIST, "soft-remove" as Cascade],
|
||||
})
|
||||
price_list_rule_values = new Collection<PriceListRuleValue>(this)
|
||||
price_list_rule_values = new Collection<Rel<PriceListRuleValue>>(this)
|
||||
|
||||
@PriceListRulePriceListIdIndex.MikroORMIndex()
|
||||
@ManyToOne(() => PriceList, {
|
||||
@@ -77,7 +78,7 @@ export default class PriceListRule {
|
||||
price_list_id: string
|
||||
|
||||
@ManyToOne(() => PriceList, { persist: false })
|
||||
price_list: PriceList
|
||||
price_list: Rel<PriceList>
|
||||
|
||||
@Property({
|
||||
onCreate: () => new Date(),
|
||||
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
OptionalProps,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import Price from "./price"
|
||||
import PriceListRule from "./price-list-rule"
|
||||
@@ -76,18 +77,18 @@ export default class PriceList {
|
||||
@OneToMany(() => Price, (price) => price.price_list, {
|
||||
cascade: [Cascade.PERSIST, "soft-remove" as Cascade],
|
||||
})
|
||||
prices = new Collection<Price>(this)
|
||||
prices = new Collection<Rel<Price>>(this)
|
||||
|
||||
@OneToMany(() => PriceListRule, (pr) => pr.price_list, {
|
||||
cascade: [Cascade.PERSIST, "soft-remove" as Cascade],
|
||||
})
|
||||
price_list_rules = new Collection<PriceListRule>(this)
|
||||
price_list_rules = new Collection<Rel<PriceListRule>>(this)
|
||||
|
||||
@ManyToMany({
|
||||
entity: () => RuleType,
|
||||
pivotEntity: () => PriceListRule,
|
||||
})
|
||||
rule_types = new Collection<RuleType>(this)
|
||||
rule_types = new Collection<Rel<RuleType>>(this)
|
||||
|
||||
@Property({ columnType: "integer", default: 0 })
|
||||
rules_count: number = 0
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
OptionalProps,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import Price from "./price"
|
||||
import PriceSet from "./price-set"
|
||||
@@ -64,7 +65,7 @@ export default class PriceRule {
|
||||
price_set_id: string
|
||||
|
||||
@ManyToOne(() => PriceSet, { persist: false })
|
||||
price_set: PriceSet
|
||||
price_set: Rel<PriceSet>
|
||||
|
||||
@PriceRuleRuleTypeIdIndex.MikroORMIndex()
|
||||
@ManyToOne(() => RuleType, {
|
||||
@@ -75,7 +76,7 @@ export default class PriceRule {
|
||||
rule_type_id: string
|
||||
|
||||
@ManyToOne(() => RuleType, { persist: false })
|
||||
rule_type: RuleType
|
||||
rule_type: Rel<RuleType>
|
||||
|
||||
@Property({ columnType: "text" })
|
||||
value: string
|
||||
@@ -93,7 +94,7 @@ export default class PriceRule {
|
||||
price_id: string
|
||||
|
||||
@ManyToOne(() => Price, { persist: false })
|
||||
price: Price
|
||||
price: Rel<Price>
|
||||
|
||||
@Property({
|
||||
onCreate: () => new Date(),
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
OnInit,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import Price from "./price"
|
||||
import PriceRule from "./price-rule"
|
||||
@@ -38,19 +39,19 @@ export default class PriceSet {
|
||||
@OneToMany(() => Price, (price) => price.price_set, {
|
||||
cascade: [Cascade.PERSIST, "soft-remove" as Cascade],
|
||||
})
|
||||
prices = new Collection<Price>(this)
|
||||
prices = new Collection<Rel<Price>>(this)
|
||||
|
||||
@OneToMany(() => PriceRule, (pr) => pr.price_set, {
|
||||
cascade: [Cascade.PERSIST, "soft-remove" as Cascade],
|
||||
})
|
||||
price_rules = new Collection<PriceRule>(this)
|
||||
price_rules = new Collection<Rel<PriceRule>>(this)
|
||||
|
||||
@ManyToMany({
|
||||
entity: () => RuleType,
|
||||
pivotEntity: () => PriceSetRuleType,
|
||||
cascade: ["soft-remove" as Cascade],
|
||||
})
|
||||
rule_types = new Collection<RuleType>(this)
|
||||
rule_types = new Collection<Rel<RuleType>>(this)
|
||||
|
||||
@Property({
|
||||
onCreate: () => new Date(),
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
OptionalProps,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import PriceList from "./price-list"
|
||||
import PriceRule from "./price-rule"
|
||||
@@ -87,7 +88,7 @@ export default class Price {
|
||||
price_set_id: string
|
||||
|
||||
@ManyToOne(() => PriceSet, { persist: false })
|
||||
price_set?: PriceSet
|
||||
price_set?: Rel<PriceSet>
|
||||
|
||||
@Property({ columnType: "integer", default: 0 })
|
||||
rules_count: number = 0
|
||||
@@ -97,7 +98,7 @@ export default class Price {
|
||||
mappedBy: (pr) => pr.price,
|
||||
cascade: [Cascade.PERSIST, "soft-remove" as Cascade],
|
||||
})
|
||||
price_rules = new Collection<PriceRule>(this)
|
||||
price_rules = new Collection<Rel<PriceRule>>(this)
|
||||
|
||||
@PricePriceListIdIndex.MikroORMIndex()
|
||||
@ManyToOne(() => PriceList, {
|
||||
@@ -110,7 +111,7 @@ export default class Price {
|
||||
price_list_id: string | null = null
|
||||
|
||||
@ManyToOne(() => PriceList, { persist: false, nullable: true })
|
||||
price_list: PriceList | null = null
|
||||
price_list: Rel<PriceList> | null = null
|
||||
|
||||
@Property({
|
||||
onCreate: () => new Date(),
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
OptionalProps,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import PriceSet from "./price-set"
|
||||
|
||||
@@ -50,7 +51,7 @@ class RuleType {
|
||||
default_priority: number
|
||||
|
||||
@ManyToMany(() => PriceSet, (priceSet) => priceSet.rule_types)
|
||||
price_sets = new Collection<PriceSet>(this)
|
||||
price_sets = new Collection<Rel<PriceSet>>(this)
|
||||
|
||||
@Property({
|
||||
onCreate: () => new Date(),
|
||||
|
||||
Reference in New Issue
Block a user