feat(pricing, utils, types): adds money amount to pricing module (#4909)
What: - Adds money amount service / repo / model - Adds money amount to entry service - Adds tests for services - Refreshes schema - Update joiner config to include money amounts RESOLVES CORE-1478 RESOLVES CORE-1479 Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com> Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
This commit is contained in:
co-authored by
Shahed Nasser
Carlos R. L. Rodrigues
parent
0627d06f72
commit
fcb6b4f510
@@ -1 +1,2 @@
|
||||
export * from "./currency"
|
||||
export * from "./money-amount"
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import { BaseFilterable } from "../../dal"
|
||||
import { CreateCurrencyDTO, CurrencyDTO } from "./currency"
|
||||
|
||||
export interface MoneyAmountDTO {
|
||||
id: string
|
||||
currency_code?: string
|
||||
currency?: CurrencyDTO
|
||||
amount?: number
|
||||
min_quantity?: number
|
||||
max_quantity?: number
|
||||
}
|
||||
|
||||
export interface CreateMoneyAmountDTO {
|
||||
id: string
|
||||
currency_code: string
|
||||
currency?: CreateCurrencyDTO
|
||||
amount?: number
|
||||
min_quantity?: number
|
||||
max_quantity?: number
|
||||
}
|
||||
|
||||
export interface UpdateMoneyAmountDTO {
|
||||
id: string
|
||||
currency_code?: string
|
||||
amount?: number
|
||||
min_quantity?: number
|
||||
max_quantity?: number
|
||||
}
|
||||
|
||||
export interface FilterableMoneyAmountProps
|
||||
extends BaseFilterable<FilterableMoneyAmountProps> {
|
||||
id?: string[]
|
||||
}
|
||||
@@ -1,14 +1,49 @@
|
||||
import { FindConfig } from "../common"
|
||||
import { JoinerServiceConfig } from "../joiner"
|
||||
import { ModuleJoinerConfig } from "../modules-sdk"
|
||||
import { Context } from "../shared-context"
|
||||
import {
|
||||
CreateCurrencyDTO,
|
||||
CreateMoneyAmountDTO,
|
||||
CurrencyDTO,
|
||||
FilterableCurrencyProps,
|
||||
FilterableMoneyAmountProps,
|
||||
MoneyAmountDTO,
|
||||
UpdateCurrencyDTO,
|
||||
UpdateMoneyAmountDTO,
|
||||
} from "./common"
|
||||
|
||||
export interface IPricingModuleService {
|
||||
__joinerConfig(): JoinerServiceConfig
|
||||
__joinerConfig(): ModuleJoinerConfig
|
||||
|
||||
retrieve(
|
||||
id: string,
|
||||
config?: FindConfig<MoneyAmountDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<MoneyAmountDTO>
|
||||
|
||||
list(
|
||||
filters?: FilterableMoneyAmountProps,
|
||||
config?: FindConfig<MoneyAmountDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<MoneyAmountDTO[]>
|
||||
|
||||
listAndCount(
|
||||
filters?: FilterableMoneyAmountProps,
|
||||
config?: FindConfig<MoneyAmountDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<[MoneyAmountDTO[], number]>
|
||||
|
||||
create(
|
||||
data: CreateMoneyAmountDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<MoneyAmountDTO[]>
|
||||
|
||||
update(
|
||||
data: UpdateMoneyAmountDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<MoneyAmountDTO[]>
|
||||
|
||||
delete(ids: string[], sharedContext?: Context): Promise<void>
|
||||
|
||||
retrieveCurrency(
|
||||
code: string,
|
||||
|
||||
Reference in New Issue
Block a user