2026-05-29 23:29:31 +03:30
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
|
|
|
|
namespace FlatRender.IdentitySvc.Models.Requests;
|
|
|
|
|
|
|
|
|
|
public record PurchasePlanRequest(
|
|
|
|
|
[Required] Guid PlanId,
|
|
|
|
|
string? Gateway,
|
|
|
|
|
string? DiscountCode
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
public record ValidateDiscountRequest([Required] string Code, Guid? PlanId);
|
|
|
|
|
|
|
|
|
|
public record CreateDiscountRequest(
|
|
|
|
|
[Required] string Name,
|
|
|
|
|
[Required] string Code,
|
|
|
|
|
[Required] string Kind,
|
|
|
|
|
[Required] decimal Value,
|
|
|
|
|
Guid? OwnerUserId,
|
|
|
|
|
decimal OwnerProfitPercentage = 0,
|
|
|
|
|
int? MaxUseCount = null,
|
|
|
|
|
Guid[]? AppliesToPlanIds = null,
|
|
|
|
|
DateTime? StartsAt = null,
|
|
|
|
|
DateTime? ExpiresAt = null
|
|
|
|
|
);
|
|
|
|
|
|
2026-06-05 12:16:13 +03:30
|
|
|
// 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
|
|
|
|
|
);
|
|
|
|
|
|
2026-05-29 23:29:31 +03:30
|
|
|
public record IssueRefundRequest(
|
|
|
|
|
[Required] Guid PaymentId,
|
|
|
|
|
long? AmountMinor,
|
|
|
|
|
[Required] string Reason,
|
|
|
|
|
string RefundTo = "Balance"
|
|
|
|
|
);
|