39 lines
955 B
C#
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;
|
|
}
|
|
}
|
|
}
|