chore: cleanup inspection (#6358)

This commit is contained in:
Adrien de Peretti
2024-02-09 14:40:09 +01:00
committed by GitHub
parent 94062d28be
commit b91a1ca5b8
19 changed files with 66 additions and 72 deletions

View File

@@ -4,11 +4,10 @@ import {
Collection,
Entity,
Filter,
Index,
ManyToOne,
OnInit,
OneToMany,
OneToOne,
OnInit,
OptionalProps,
PrimaryKey,
PrimaryKeyType,
@@ -84,7 +83,11 @@ export default class PriceSetMoneyAmount {
})
updated_at: Date
@Property({ columnType: "timestamptz", nullable: true , index: "IDX_price_set_money_amount_deleted_at"})
@Property({
columnType: "timestamptz",
nullable: true,
index: "IDX_price_set_money_amount_deleted_at",
})
deleted_at: Date | null
@BeforeCreate()

View File

@@ -48,9 +48,9 @@ import {
PriceRuleService,
RuleTypeService,
} from "@services"
import {entityNameToLinkableKeysMap, joinerConfig} from "../joiner-config"
import {validatePriceListDates} from "@utils"
import {ServiceTypes} from "@types"
import { entityNameToLinkableKeysMap, joinerConfig } from "../joiner-config"
import { validatePriceListDates } from "@utils"
import { ServiceTypes } from "@types"
type InjectedDependencies = {
baseRepository: DAL.RepositoryService
@@ -950,7 +950,7 @@ export default class PricingModuleService<
priceListsToCreate
)) as unknown as PricingTypes.PriceListDTO[]
for (var i = 0; i < data.length; i++) {
for (let i = 0; i < data.length; i++) {
const { rules = {}, prices = [] } = data[i]
const priceList = priceLists[i]
@@ -1167,12 +1167,11 @@ export default class PricingModuleService<
): Promise<PricingTypes.PriceListRuleDTO[]> {
const priceLists = await this.createPriceListRules_(data, sharedContext)
return await this.baseRepository_.serialize<PricingTypes.PriceListRuleDTO[]>(
priceLists,
{
populate: true,
}
)
return await this.baseRepository_.serialize<
PricingTypes.PriceListRuleDTO[]
>(priceLists, {
populate: true,
})
}
@InjectTransactionManager("baseRepository_")
@@ -1193,12 +1192,11 @@ export default class PricingModuleService<
sharedContext
)
return await this.baseRepository_.serialize<PricingTypes.PriceListRuleDTO[]>(
priceLists,
{
populate: true,
}
)
return await this.baseRepository_.serialize<
PricingTypes.PriceListRuleDTO[]
>(priceLists, {
populate: true,
})
}
@InjectManager("baseRepository_")

View File

@@ -1,5 +1,4 @@
import { PriceSet, PriceSetMoneyAmount, RuleType } from "@models"
import { PriceSetDTO, PriceSetMoneyAmountDTO, RuleTypeDTO } from "@medusajs/types"
export interface CreatePriceRuleDTO {
id?: string

View File

@@ -1,4 +1,4 @@
import { BaseFilterable, PriceSetDTO, PriceSetMoneyAmountDTO, RuleTypeDTO } from "@medusajs/types"
import { BaseFilterable, PriceSetDTO, RuleTypeDTO } from "@medusajs/types"
import { PriceSet, PriceSetMoneyAmount, RuleType } from "@models"
export interface CreatePriceRuleDTO {