feat(medusa,pricing,types): added get endpoints for pricing rule types (#6678)

what:

- adds list endpoint for rule types
- adds get endpoint for rule types
This commit is contained in:
Riqwan Thamir
2024-03-12 17:35:24 +00:00
committed by GitHub
parent f0c8142635
commit d4b921f3db
14 changed files with 312 additions and 14 deletions
+16 -8
View File
@@ -2,7 +2,7 @@ import { BaseFilterable } from "../../dal"
/**
* @interface
*
*
* A rule type's data.
*/
export interface RuleTypeDTO {
@@ -15,20 +15,28 @@ export interface RuleTypeDTO {
*/
name: string
/**
* The unique name used to later identify the rule_attribute. For example, it can be used in the `context` parameter of
* The unique name used to later identify the rule_attribute. For example, it can be used in the `context` parameter of
* the `calculatePrices` method to specify a rule for calculating the price.
*/
rule_attribute: string
/**
* The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy
* The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy
* the provided context. The higher the value, the higher the priority of the rule type.
*/
default_priority: number
/**
* The creation date of the rule type.
*/
created_at?: Date | string
/**
* The update date of the rule type.
*/
updated_at?: Date | string
}
/**
* @interface
*
*
* The rule type to create.
*/
export interface CreateRuleTypeDTO {
@@ -41,12 +49,12 @@ export interface CreateRuleTypeDTO {
*/
name: string
/**
* The unique name used to later identify the rule_attribute. For example, it can be used in the `context` parameter of the `calculatePrices`
* The unique name used to later identify the rule_attribute. For example, it can be used in the `context` parameter of the `calculatePrices`
* method to specify a rule for calculating the price.
*/
rule_attribute: string
/**
* The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy the provided context.
* The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy the provided context.
* The higher the value, the higher the priority of the rule type.
*/
default_priority?: number
@@ -54,7 +62,7 @@ export interface CreateRuleTypeDTO {
/**
* @interface
*
*
* The data to update in a rule type. The `id` is used to identify which price set to update.
*/
export interface UpdateRuleTypeDTO {
@@ -78,7 +86,7 @@ export interface UpdateRuleTypeDTO {
/**
* @interface
*
*
* Filters to apply on rule types.
*/
export interface FilterableRuleTypeProps