manager-service/ManagerService/Data/SubscriptionPlan.cs
2026-04-01 17:00:13 +02:00

39 lines
955 B
C#

using ManagerService.DTOs;
using System.ComponentModel.DataAnnotations;
namespace ManagerService.Data
{
public class SubscriptionPlan
{
[Key]
[Required]
public string Id { get; set; }
[Required]
public string Name { get; set; }
public long StorageQuotaBytes { get; set; } = 0;
public int AiRequestsPerMonth { get; set; } = 0;
public SubscriptionPlanDTO ToDTO()
{
return new SubscriptionPlanDTO
{
id = Id,
name = Name,
storageQuotaBytes = StorageQuotaBytes,
aiRequestsPerMonth = AiRequestsPerMonth
};
}
public SubscriptionPlan FromDTO(SubscriptionPlanDTO dto)
{
Name = dto.name;
StorageQuotaBytes = dto.storageQuotaBytes;
AiRequestsPerMonth = dto.aiRequestsPerMonth;
return this;
}
}
}