packages/core/src/modules/commission/models. Every model also has created_at, updated_at, and a nullable deleted_at, which Medusa adds and the tables below leave out.
CommissionRate
The rate the marketplace takes from a sale. Tablecommission_rate, id prefix comrate.
Relations:
rules: has manyCommissionRulevalues: has manyCommissionRateValue
CommissionRule
Scopes a rate to one record in one dimension. Tablecommission_rule, id prefix comrule.
Relations:
commission_rate: belongs toCommissionRate
(reference, reference_id) for non-deleted rows.
CommissionRateValue
A per-currency amount for a fixed rate. Tablecommission_rate_value, id prefix comval.
Relations:
commission_rate: belongs toCommissionRate
CommissionLine
The resolved commission for one order line item or shipping method. Tablecommission_line, id prefix comline.
The table has indexes on
item_id and on shipping_method_id for non-deleted rows. A line sets one of the two anchors and leaves the other null.
Enums
CommissionRateType is exported from @mercurjs/types.