using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;

namespace QRRapidoApp.Models
{
    public class Order
    {
        [BsonId]
        [BsonRepresentation(BsonType.ObjectId)]
        public string Id { get; set; } = string.Empty;

        [BsonElement("userId")]
        public string UserId { get; set; } = string.Empty;

        [BsonElement("userEmail")]
        public string UserEmail { get; set; } = string.Empty;

        [BsonElement("amount")]
        public decimal Amount { get; set; } // Valor em R$ (ex: 10.00)

        [BsonElement("creditsAmount")]
        public int CreditsAmount { get; set; } // Quantidade de créditos comprados (ex: 10)

        [BsonElement("pixCode")]
        public string PixCode { get; set; } = string.Empty; // Código de identificação do PIX (ex: PED-12345)

        [BsonElement("status")]
        public string Status { get; set; } = "Pending"; // Pending, Paid, Cancelled

        [BsonElement("createdAt")]
        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;

        [BsonElement("paidAt")]
        public DateTime? PaidAt { get; set; }

        [BsonElement("approvedBy")]
        public string? ApprovedBy { get; set; } // Email do admin que aprovou
    }
}