using System.Text.Json.Serialization;

namespace MemberCenter.Api.Contracts;

public sealed record SubscribeRequest(
    [property: JsonPropertyName("list_id")] Guid ListId,
    [property: JsonPropertyName("email")] string Email,
    [property: JsonPropertyName("preferences")] Dictionary<string, object>? Preferences,
    [property: JsonPropertyName("source")] string? Source);

public sealed record UnsubscribeRequest(
    [property: JsonPropertyName("token")] string Token);

public sealed record IssueUnsubscribeTokenRequest(
    [property: JsonPropertyName("list_id")] Guid ListId,
    [property: JsonPropertyName("email")] string Email);

public sealed record UpdatePreferencesRequest(
    [property: JsonPropertyName("list_id")] Guid ListId,
    [property: JsonPropertyName("email")] string Email,
    [property: JsonPropertyName("preferences")] Dictionary<string, object> Preferences);
