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.
| Option | Type | Required | Description |
|---|---|---|---|
| discountId | string | Yes | ID of the discount to assign |
| customerId | string | Yes | Customer ID to receive the assignment |
| rule | one_time | next_n | forever | No | Usage rule (default: one_time) |
| totalAllowed | number | Required for one_time/next_n | Maximum times the customer can use it |
| expiresAt | datetime | No | Optional expiration date |
/discount-revoke
Soft-revokes a discount assignment by setting its expiration to the past. Requires admin role.
| Option | Type | Required | Description |
|---|---|---|---|
| assignmentId | string | Yes | ID of the assignment to revoke |