Skip to main content

Discount Commands

Source: src/data/discount/discount.command.ts

Admin-only commands for managing discount assignments.

/discount-assign

Assigns a discount to a specific customer, or updates an existing assignment (idempotent upsert). Requires admin role.

OptionTypeRequiredDescription
discountIdstringYesID of the discount to assign
customerIdstringYesCustomer ID to receive the assignment
ruleone_time | next_n | foreverNoUsage rule (default: one_time)
totalAllowednumberRequired for one_time/next_nMaximum times the customer can use it
expiresAtdatetimeNoOptional expiration date

/discount-revoke

Soft-revokes a discount assignment by setting its expiration to the past. Requires admin role.

OptionTypeRequiredDescription
assignmentIdstringYesID of the assignment to revoke