feat(pricing) Add Price Set Rule Type (#4977)
* initial * initial service * update pricing module service * add integration test for rule-type * update pricing-module integration tests * update pricing service interface * feat(pricing): PriceSets as entry point to pricing module * chore: add price set money amount * chore: add price set money amount * chore: change name of test * chore: added changeset * chore: use filterable props from money amount in price sets * chore: update migrations * test update integration test * fix weird behavior * Update packages/pricing/integration-tests/__fixtures__/rule-type/index.ts Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * Apply suggestions from code review Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * move rule-type to common * chore: reset migration * chore: remove incorrect conflicts * chore: address review * chore: remove ghost price list * Apply suggestions from code review Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> * update id prefix * use persist not persistAndflush * rename key_value to rule_attribute * more renaming --------- Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
co-authored by
Riqwan Thamir
Oli Juhl
parent
5b09f816cb
commit
edf90eecb4
@@ -1,3 +1,4 @@
|
||||
export * from "./currency"
|
||||
export * from "./money-amount"
|
||||
export * from "./price-set"
|
||||
export * from "./rule-type"
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import { BaseFilterable } from "../../dal"
|
||||
|
||||
export interface RuleTypeDTO {
|
||||
id: string
|
||||
name: string
|
||||
rule_attribute: string
|
||||
default_priority: number
|
||||
}
|
||||
|
||||
export interface CreateRuleTypeDTO {
|
||||
id?: string
|
||||
name: string
|
||||
rule_attribute: string
|
||||
default_priority?: number
|
||||
}
|
||||
|
||||
export interface UpdateRuleTypeDTO {
|
||||
id: string
|
||||
name?: string
|
||||
rule_attribute?: string
|
||||
default_priority?: number
|
||||
}
|
||||
|
||||
export interface FilterableRuleTypeProps
|
||||
extends BaseFilterable<FilterableRuleTypeProps> {
|
||||
id?: string[]
|
||||
name?: string[]
|
||||
}
|
||||
@@ -1,2 +1,2 @@
|
||||
export * from "./common"
|
||||
export * from "./service"
|
||||
export * from "./service"
|
||||
@@ -6,17 +6,21 @@ import {
|
||||
CreateCurrencyDTO,
|
||||
CreateMoneyAmountDTO,
|
||||
CreatePriceSetDTO,
|
||||
CreateRuleTypeDTO,
|
||||
CurrencyDTO,
|
||||
FilterableCurrencyProps,
|
||||
FilterableMoneyAmountProps,
|
||||
FilterablePriceSetProps,
|
||||
FilterableRuleTypeProps,
|
||||
MoneyAmountDTO,
|
||||
PriceSetDTO,
|
||||
PricingContext,
|
||||
PricingFilters,
|
||||
RuleTypeDTO,
|
||||
UpdateCurrencyDTO,
|
||||
UpdateMoneyAmountDTO,
|
||||
UpdatePriceSetDTO,
|
||||
UpdateRuleTypeDTO,
|
||||
} from "./common"
|
||||
|
||||
export interface IPricingModuleService {
|
||||
@@ -120,4 +124,34 @@ export interface IPricingModuleService {
|
||||
currencyCodes: string[],
|
||||
sharedContext?: Context
|
||||
): Promise<void>
|
||||
|
||||
retrieveRuleType(
|
||||
code: string,
|
||||
config?: FindConfig<RuleTypeDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<RuleTypeDTO>
|
||||
|
||||
listRuleTypes(
|
||||
filters?: FilterableRuleTypeProps,
|
||||
config?: FindConfig<RuleTypeDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<RuleTypeDTO[]>
|
||||
|
||||
listAndCountRuleTypes(
|
||||
filters?: FilterableRuleTypeProps,
|
||||
config?: FindConfig<RuleTypeDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<[RuleTypeDTO[], number]>
|
||||
|
||||
createRuleTypes(
|
||||
data: CreateRuleTypeDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<RuleTypeDTO[]>
|
||||
|
||||
updateRuleTypes(
|
||||
data: UpdateRuleTypeDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<RuleTypeDTO[]>
|
||||
|
||||
deleteRuleTypes(ruleTypes: string[], sharedContext?: Context): Promise<void>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user