|
1
|
{"slug":"/references/promotion/models/PromotionRuleValue","title":"PromotionRuleValue - Promotion Module Data Models Reference","frontmatter":{"displayed_sidebar":"promotionModelReference","slug":"/references/promotion/models/PromotionRuleValue","sidebar_label":"PromotionRuleValue"},"toc":[],"blocks":[{"kind":"markdown","html":"This documentation provides a reference to the PromotionRuleValue data model. It belongs to the Promotion Module."},{"kind":"sourceCodeLink","link":"https://github.com/medusajs/medusa/blob/020565398e436a2bc65777a3b1ad347b4735d6df/packages/modules/promotion/src/models/promotion-rule-value.ts#L4"},{"kind":"typeList","sectionTitle":"PromotionRuleValue","types":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the promotion rule value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The value of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record<string, unknown>>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"types","type":"[SearchFacetKind](/references/types/SearchTypes/types/types.SearchTypes.SearchFacetKind)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"weight","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`\"text\"`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, any>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"promotion_rule","type":"BelongsTo<[PromotionRule](/references/promotion/models/PromotionRule)>","description":"The associated promotion rule.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The description of the promotion rule","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record<string, unknown>>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"attribute","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The attribute of the promotion rule.","optional":false,"defaultValue":"","example":"customer_group_id","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record<string, unknown>>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"operator","type":"EnumProperty<typeof [PromotionRuleOperator](/references/utils/PromotionUtils/enums/utils.PromotionUtils.PromotionRuleOperator)>","description":"The operator of the promotion rule.","optional":false,"defaultValue":"","example":"in","expandable":false,"children":[]},{"name":"values","type":"HasMany<[PromotionRuleValue](/references/promotion/models/PromotionRuleValue)>","description":"The associated values.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the promotion rule value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The value of the promotion rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion_rule","type":"BelongsTo<[PromotionRule](/references/promotion/models/PromotionRule)>","description":"The associated promotion rule.","optional":false,"defaultValue":"","expandable":true,"children":[]}]},{"name":"promotions","type":"ManyToMany<[Promotion](/references/promotion/models/Promotion)>","description":"The associated promotions.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The code of the promotion","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_automatic","type":"[BooleanProperty](/references/utils/classes/utils.BooleanProperty)","description":"Whether the promotion is applied automatic. If disabled, the customer must enter the code during checkout.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"[BooleanProperty](/references/utils/classes/utils.BooleanProperty)","description":"Whether the promotion is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`NumberProperty`","description":"The limit of the promotion\n\n@since v2.12.0","optional":true,"defaultValue":"","expandable":false,"children":[],"since":"2.12.0"},{"name":"used","type":"`NumberProperty`","description":"How much of the limit has been used.\n\n@since v2.12.0","optional":false,"defaultValue":"","expandable":false,"children":[],"since":"2.12.0"},{"name":"type","type":"EnumProperty<typeof [PromotionType](/references/utils/PromotionUtils/enums/utils.PromotionUtils.PromotionType)>","description":"The type of the promotion","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"EnumProperty<typeof [PromotionStatus](/references/utils/PromotionUtils/enums/utils.PromotionUtils.PromotionStatus)>","description":"The status of the promotion","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign","type":"BelongsTo<[Campaign](/references/promotion/models/Campaign)>","description":"The associated campaign.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"application_method","type":"HasOne<[ApplicationMethod](/references/promotion/models/ApplicationMethod)>","description":"The associated application method.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"rules","type":"ManyToMany<[PromotionRule](/references/promotion/models/PromotionRule)>","description":"The associated rules.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"metadata","type":"JSONProperty<NoInfer<Record<string, unknown>>>","description":"Holds custom data in key-value pairs.\n\n@since v2.12.0","optional":true,"defaultValue":"","expandable":false,"children":[],"since":"2.12.0"}]},{"name":"method_target_rules","type":"ManyToMany<[ApplicationMethod](/references/promotion/models/ApplicationMethod)>","description":"The associated method target rules.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the application method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`BigNumberProperty`","description":"The value of the application method","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The currency code of the application method.","optional":true,"defaultValue":"","example":"usd","expandable":false,"children":[]},{"name":"max_quantity","type":"`NumberProperty`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`NumberProperty`","description":"The quantity that results from matching the `buyget` promotion's condition. For example, if the promotion is a \"Buy 2 shirts get 1 free\", the value of this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`NumberProperty`","description":"The minimum quantity required for a `buyget` promotion to be applied. For example, if the promotion is a \"Buy 2 shirts get 1 free\", the value of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"EnumProperty<typeof [ApplicationMethodType](/references/utils/PromotionUtils/enums/utils.PromotionUtils.ApplicationMethodType)>","description":"The application method's type. If it's `fixed`, the promotion discounts a fixed amount. If it's `percentage`, the promotion discounts a percentage.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"EnumProperty<typeof [ApplicationMethodTargetType](/references/utils/PromotionUtils/enums/utils.PromotionUtils.ApplicationMethodTargetType)>","description":"Which item does the promotion apply to. `items` mean the promotion applies to the cart's items; `shipping_methods` means the promotion applies to the cart's shipping methods; `order` means the promotion applies on the entire order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"EnumProperty<typeof [ApplicationMethodAllocation](/references/utils/PromotionUtils/enums/utils.PromotionUtils.ApplicationMethodAllocation)>","description":"How is the promotion amount discounted. `each` means the discounted amount is applied on each applicable item; `across` means the discounted amount is split accross the applicable items.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"BelongsTo<[Promotion](/references/promotion/models/Promotion)>","description":"The associated promotion.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"target_rules","type":"ManyToMany<[PromotionRule](/references/promotion/models/PromotionRule)>","description":"The associated target rules.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"buy_rules","type":"ManyToMany<[PromotionRule](/references/promotion/models/PromotionRule)>","description":"The associated buy rules.","optional":false,"defaultValue":"","expandable":true,"children":[]}]},{"name":"method_buy_rules","type":"ManyToMany<[ApplicationMethod](/references/promotion/models/ApplicationMethod)>","description":"The associated method buy rules.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the application method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`BigNumberProperty`","description":"The value of the application method","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The currency code of the application method.","optional":true,"defaultValue":"","example":"usd","expandable":false,"children":[]},{"name":"max_quantity","type":"`NumberProperty`","description":"The max quantity allowed in the cart for the associated promotion to be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apply_to_quantity","type":"`NumberProperty`","description":"The quantity that results from matching the `buyget` promotion's condition. For example, if the promotion is a \"Buy 2 shirts get 1 free\", the value of this attribute is `1`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"buy_rules_min_quantity","type":"`NumberProperty`","description":"The minimum quantity required for a `buyget` promotion to be applied. For example, if the promotion is a \"Buy 2 shirts get 1 free\", the value of this attribute is `2`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"EnumProperty<typeof [ApplicationMethodType](/references/utils/PromotionUtils/enums/utils.PromotionUtils.ApplicationMethodType)>","description":"The application method's type. If it's `fixed`, the promotion discounts a fixed amount. If it's `percentage`, the promotion discounts a percentage.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"target_type","type":"EnumProperty<typeof [ApplicationMethodTargetType](/references/utils/PromotionUtils/enums/utils.PromotionUtils.ApplicationMethodTargetType)>","description":"Which item does the promotion apply to. `items` mean the promotion applies to the cart's items; `shipping_methods` means the promotion applies to the cart's shipping methods; `order` means the promotion applies on the entire order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allocation","type":"EnumProperty<typeof [ApplicationMethodAllocation](/references/utils/PromotionUtils/enums/utils.PromotionUtils.ApplicationMethodAllocation)>","description":"How is the promotion amount discounted. `each` means the discounted amount is applied on each applicable item; `across` means the discounted amount is split accross the applicable items.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion","type":"BelongsTo<[Promotion](/references/promotion/models/Promotion)>","description":"The associated promotion.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"target_rules","type":"ManyToMany<[PromotionRule](/references/promotion/models/PromotionRule)>","description":"The associated target rules.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"buy_rules","type":"ManyToMany<[PromotionRule](/references/promotion/models/PromotionRule)>","description":"The associated buy rules.","optional":false,"defaultValue":"","expandable":true,"children":[]}]}]}]}]} |