feat(admin): discount edit/delete + project-scoped scene/color editor

Identity (discounts):
- DiscountsController: PUT /v1/discounts/{id}, DELETE /v1/discounts/{id}
- DiscountService.UpdateAsync (partial update, code-clash guard) + DeleteAsync
- UpdateDiscountRequest record (all fields optional incl. is_active)
- Frontend discountsConfig: canEdit + canDelete + is_active field

Content (scenes/colors — UI for existing CRUD endpoints):
- New SceneColorEditor.tsx: 3-tab modal (scenes / shared-colors / color-presets),
  project-scoped, full add/edit/delete per tab, colour pickers + palette item editor
- Wired into TemplatesAdmin: "صحنه‌ها و رنگ‌ها" button per template variant row
- Routes through the generic admin proxy with ?project_id=

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-05 12:16:13 +03:30
parent ac700787bd
commit 67060c73b2
7 changed files with 805 additions and 1 deletions
@@ -23,6 +23,21 @@ public record CreateDiscountRequest(
DateTime? ExpiresAt = null
);
// Partial update — every field optional; only non-null values are applied.
public record UpdateDiscountRequest(
string? Name = null,
string? Code = null,
string? Kind = null,
decimal? Value = null,
Guid? OwnerUserId = null,
decimal? OwnerProfitPercentage = null,
int? MaxUseCount = null,
Guid[]? AppliesToPlanIds = null,
DateTime? StartsAt = null,
DateTime? ExpiresAt = null,
bool? IsActive = null
);
public record IssueRefundRequest(
[Required] Guid PaymentId,
long? AmountMinor,