feat(loyalty): multi-select categories on transactions
Some checks failed
Some checks failed
Switch from single category_id to category_ids JSON array on transactions. Sellers can now select multiple categories (e.g., Men + Accessories) when entering stamp/points transactions. - Migration loyalty_009: drop category_id FK, add category_ids JSON - Schemas: category_id → category_ids (list[int] | None) - Services: stamp_service + points_service accept category_ids - Terminal UI: pills are now multi-select (toggle on/off) - Transaction response: category_names (list[str]) resolved from IDs - Recent transactions table: new Category column showing comma- separated names Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,7 @@ function storeLoyaltyTerminal() {
|
||||
// Transaction inputs
|
||||
earnAmount: null,
|
||||
selectedReward: '',
|
||||
selectedCategory: null,
|
||||
selectedCategories: [],
|
||||
categories: [],
|
||||
|
||||
// PIN entry
|
||||
@@ -300,7 +300,7 @@ function storeLoyaltyTerminal() {
|
||||
await apiClient.post('/store/loyalty/stamp', {
|
||||
card_id: this.selectedCard.id,
|
||||
staff_pin: this.pinDigits,
|
||||
category_id: this.selectedCategory || undefined,
|
||||
category_ids: this.selectedCategories.length > 0 ? this.selectedCategories : undefined,
|
||||
});
|
||||
|
||||
Utils.showToast(I18n.t('loyalty.store.terminal.stamp_added'), 'success');
|
||||
@@ -326,7 +326,7 @@ function storeLoyaltyTerminal() {
|
||||
card_id: this.selectedCard.id,
|
||||
purchase_amount_cents: Math.round(this.earnAmount * 100),
|
||||
staff_pin: this.pinDigits,
|
||||
category_id: this.selectedCategory || undefined,
|
||||
category_ids: this.selectedCategories.length > 0 ? this.selectedCategories : undefined,
|
||||
});
|
||||
|
||||
const pointsEarned = response.points_earned || Math.floor(this.earnAmount * (this.program?.points_per_euro || 1));
|
||||
|
||||
Reference in New Issue
Block a user