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

namespace Nalu.Web.Data.Models;

public class NaluUser
{
    [BsonId]
    [BsonRepresentation(BsonType.ObjectId)]
    public string Id { get; set; } = ObjectId.GenerateNewId().ToString();

    [BsonElement("email")]
    public required string Email { get; set; }

    [BsonElement("name")]
    public string? Name { get; set; }

    [BsonElement("provider")]
    public required string Provider { get; set; }  // "google" | "microsoft"

    [BsonElement("provider_id")]
    public required string ProviderId { get; set; }

    [BsonElement("picture_url")]
    public string? PictureUrl { get; set; }

    [BsonElement("plan")]
    public string Plan { get; set; } = "free";

    [BsonElement("stripe_customer_id")]
    public string? StripeCustomerId { get; set; }

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

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

    [BsonElement("is_active")]
    public bool IsActive { get; set; } = true;
}
