feat(pricing, types, utils, medusa-sdk): Pricing Module Setup + Currency (#4860)
What: - Setups the skeleton for pricing module - Creates service/model/repository for currency model - Setups types - Setups DB - Moved some utils to a common place RESOLVES CORE-1477 RESOLVES CORE-1476
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
export * as CacheTypes from "./cache"
|
||||
export * as CommonTypes from "./common"
|
||||
export * as DAL from "./dal"
|
||||
export * as EventBusTypes from "./event-bus"
|
||||
export * as FeatureFlagTypes from "./feature-flag"
|
||||
export * as InventoryTypes from "./inventory"
|
||||
export * as ProductTypes from "./product"
|
||||
export * as LoggerTypes from "./logger"
|
||||
export * as ModulesSdkTypes from "./modules-sdk"
|
||||
export * as PricingTypes from "./pricing"
|
||||
export * as ProductTypes from "./product"
|
||||
export * as SalesChannelTypes from "./sales-channel"
|
||||
export * as SearchTypes from "./search"
|
||||
export * as StockLocationTypes from "./stock-location"
|
||||
export * as TransactionBaseTypes from "./transaction-base"
|
||||
export * as DAL from "./dal"
|
||||
export * as LoggerTypes from "./logger"
|
||||
export * as FeatureFlagTypes from "./feature-flag"
|
||||
export * as SalesChannelTypes from "./sales-channel"
|
||||
export * as WorkflowTypes from "./workflow"
|
||||
|
||||
@@ -11,6 +11,7 @@ export * from "./inventory"
|
||||
export * from "./joiner"
|
||||
export * from "./logger"
|
||||
export * from "./modules-sdk"
|
||||
export * from "./pricing"
|
||||
export * from "./product"
|
||||
export * from "./product-category"
|
||||
export * from "./sales-channel"
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import { BaseFilterable } from "../../dal"
|
||||
|
||||
export interface CurrencyDTO {
|
||||
code: string
|
||||
symbol?: string
|
||||
symbol_native?: string
|
||||
name?: string
|
||||
}
|
||||
|
||||
export interface CreateCurrencyDTO {
|
||||
code: string
|
||||
symbol: string
|
||||
symbol_native: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export interface UpdateCurrencyDTO {
|
||||
code: string
|
||||
symbol?: string
|
||||
symbol_native?: string
|
||||
name?: string
|
||||
}
|
||||
|
||||
export interface FilterableCurrencyProps
|
||||
extends BaseFilterable<FilterableCurrencyProps> {
|
||||
code?: string[]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./currency"
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from "./common"
|
||||
export * from "./service"
|
||||
@@ -0,0 +1,45 @@
|
||||
import { FindConfig } from "../common"
|
||||
import { JoinerServiceConfig } from "../joiner"
|
||||
import { Context } from "../shared-context"
|
||||
import {
|
||||
CreateCurrencyDTO,
|
||||
CurrencyDTO,
|
||||
FilterableCurrencyProps,
|
||||
UpdateCurrencyDTO,
|
||||
} from "./common"
|
||||
export interface IPricingModuleService {
|
||||
__joinerConfig(): JoinerServiceConfig
|
||||
|
||||
retrieveCurrency(
|
||||
code: string,
|
||||
config?: FindConfig<CurrencyDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<CurrencyDTO>
|
||||
|
||||
listCurrencies(
|
||||
filters?: FilterableCurrencyProps,
|
||||
config?: FindConfig<CurrencyDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<CurrencyDTO[]>
|
||||
|
||||
listAndCountCurrencies(
|
||||
filters?: FilterableCurrencyProps,
|
||||
config?: FindConfig<CurrencyDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<[CurrencyDTO[], number]>
|
||||
|
||||
createCurrencies(
|
||||
data: CreateCurrencyDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<CurrencyDTO[]>
|
||||
|
||||
updateCurrencies(
|
||||
data: UpdateCurrencyDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<CurrencyDTO[]>
|
||||
|
||||
deleteCurrencies(
|
||||
currencyCodes: string[],
|
||||
sharedContext?: Context
|
||||
): Promise<void>
|
||||
}
|
||||
Reference in New Issue
Block a user